ChinoAPIGroups

ChinoAPIGroups

new ChinoAPIGroups(baseUrl, customerId, customerKey)

Create a caller for Groups Chino APIs

Parameters:
Name Type Default Description
baseUrl string

The url endpoint for APIs

customerId string

The Chino customer id or bearer token

customerKey string | null null

The Chino customer key or null (not provided)

Source:

Methods

create(data) → {Promise.<objects.Group, objects.ChinoException>}

Create a new group

Parameters:
Name Type Description
data object
Source:
Returns:

A promise that return a Group object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Group, objects.ChinoException>

delete(groupId, force) → {Promise.<objects.Success, objects.ChinoException>}

Deactivate (or delete) group selected by its id

Parameters:
Name Type Default Description
groupId string
force boolean false

If true delete group information otherwise only deactivate it. Default value is false (deactivate)

Source:
Returns:

A promise that return a Success object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Success, objects.ChinoException>

details(groupId) → {Promise.<objects.Group, objects.ChinoException>}

Return information about group selected by its id

Parameters:
Name Type Description
groupId string
Source:
Returns:

A promise that return a Group object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Group, objects.ChinoException>

insertUser(groupId, userId) → {Promise.<objects.Success, objects.ChinoException>}

Insert the selected user into the selected group

Parameters:
Name Type Description
groupId string

The id of the selected group

userId string

The id of the selected user

Source:
Returns:

A promise that return a Success object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Success, objects.ChinoException>

list(offset, limit) → {Promise.<Array, objects.ChinoException>}

Return the list of existing groups

Parameters:
Name Type Default Description
offset int 0
limit int 10
Source:
Returns:

A promise that return a list of Group object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<Array, objects.ChinoException>

removeUser(groupId, userId) → {Promise.<objects.Success, objects.ChinoException>}

Remove the selected user from the selected

Parameters:
Name Type Description
groupId string

The id of the selected group

userId string

The id of the selected user

Source:
Returns:

A promise that return a Success object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Success, objects.ChinoException>

update(groupId, data) → {Promise.<objects.Group, objects.ChinoException>}

Update information about group selected by its id with data as group information

Parameters:
Name Type Description
groupId string
data object
Source:
Returns:

A promise that return a Group object if resolved, otherwise throw an ChinoException object if rejected or was not retrieved a success status

Type
Promise.<objects.Group, objects.ChinoException>