import OrganisationController from 'itslanguage/administrative-sdk/organisation/organisation-controller.js'
OrganisationController
Controller class for the Organisation model.
Constructor Summary
Public Constructor | ||
public |
constructor(connection: Connection) |
Member Summary
Private Members | ||
private |
Object to use for making a connection to the REST API and Websocket server. |
Method Summary
Public Methods | ||
public |
createOrganisation(organisation: Organisation): Promise<Organisation> Create an organisation. |
|
public |
getOrganisation(organisationId: string): Promise<Organisation> Get an organisation the current tenant is the owner of. |
|
public |
Get and return all organisations the current tenant is the owner of. |
Public Constructors
public constructor(connection: Connection) source
Params:
Name | Type | Attribute | Description |
connection | Connection | Object to use for making a connection to the REST API and Websocket server. |
Private Members
private _connection: Connection source
Object to use for making a connection to the REST API and Websocket server.
Public Methods
public createOrganisation(organisation: Organisation): Promise<Organisation> source
Create an organisation. The organisation will be owned by the current active tenant.
Params:
Name | Type | Attribute | Description |
organisation | Organisation | Object to create. |
Throw:
Promise.<Error> |
organisation parameter of type "Organisation" is required. |
Promise.<Error> |
If the server returned an error. |
public getOrganisation(organisationId: string): Promise<Organisation> source
Get an organisation the current tenant is the owner of.
Params:
Name | Type | Attribute | Description |
organisationId | string | Specify an organisation identifier. |
Throw:
Promise.<Error> |
organisationId parameter of type "string" is required. |
Promise.<Error> |
If no result could not be found. |
public getOrganisations(): Promise<Organisation[]> source
Get and return all organisations the current tenant is the owner of.
Throw:
Promise.<Error> |
If no result could not be found. |