Home Manual Reference Source
private class | source

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

Create an organisation.

public

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
organisation Organisation

Object to create.

Return:

Promise<Organisation>

Promise containing the newly created Organisation.

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:

NameTypeAttributeDescription
organisationId string

Specify an organisation identifier.

Return:

Promise<Organisation>

Promise containing an Organisation.

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.

Return:

Promise<Organisation[]>

Promise containing an array of Organisations.

Throw:

Promise.<Error>

If no result could not be found.