import UserController from 'itslanguage/administrative-sdk/user/user-controller.js'
UserController
Controller class for the User 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 |
createUser(user: User): Promise<User> Create a user. |
|
public |
Get the current authenticated user. |
|
public |
Get a user in the current active Organisation derived from the OAuth2 scope. |
|
public |
List all users in the current active Organisation derived from the OAuth2 scope. |
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 createUser(user: User): Promise<User> source
Create a user. The user will be created in the current active Organisation derived from the OAuth2 scope.
Params:
Name | Type | Attribute | Description |
user | User | User to create. |
Throw:
Promise.<Error> |
user parameter of type "User" is required. |
Promise.<Error> |
If the server returned an error. |
public getCurrentUser(): Promise<User> source
Get the current authenticated user.
Throw:
Promise.<Error> |
If something went wrong in the server. |
public getUser(userId: string): Promise<User> source
Get a user in the current active Organisation derived from the OAuth2 scope.
Params:
Name | Type | Attribute | Description |
userId | string | Specify a user identifier. |
Throw:
Promise.<Error> |
userId parameter of type "string" is required. |
Promise.<Error> |
If no result could not be found. |