Home Manual Reference Source
private class | source

GroupController

Controller class for the Group 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 a group.

public

Get a group which is part of the current active Organisation derived from the OAuth2 scope.

public

Get and return all groups in the current active Organisation derived from the OAuth2 scope.

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 createGroup(group: Organisation): Promise<Group> source

Create a group. The group will be part of the current active Organisation derived from the OAuth2 scope.

Params:

NameTypeAttributeDescription
group Organisation

Object to create.

Return:

Promise<Group>

Promise containing the newly created Group.

Throw:

Promise.<Error>

organisation parameter of type "Group" is required.

Promise.<Error>

If the server returned an error.

public getGroup(groupId: string): Promise<Group> source

Get a group which is part of the current active Organisation derived from the OAuth2 scope.

Params:

NameTypeAttributeDescription
groupId string

Specify a group identifier.

Return:

Promise<Group>

Promise containing an Group.

Throw:

Promise.<Error>

groupId parameter of type "string" is required.

Promise.<Error>

If no result could not be found.

public getGroups(): Promise<Group[]> source

Get and return all groups in the current active Organisation derived from the OAuth2 scope.

Return:

Promise<Group[]>

Promise containing an array of Groups.

Throw:

Promise.<Error>

If no result could not be found.