@ubstream/ubstream-node-client-sdk / Exports / OrganizationsClient
Class: OrganizationsClient
This class provides access to methods concerning organizations. Attributes groups and users allows to manage users and groups in an organization.
Hierarchy
AbstractClient
↳ OrganizationsClient
Table of contents
Properties
Methods
Properties
groups
• Readonly groups: OrganizationsGroupsClient
Attribute to access all methods concerning groups.
libraries
• Readonly libraries: OrganizationLibrariesClient
Attribute to access all methods concerning libraries.
users
• Readonly users: OrganizationsUsersClient
Attribute to access all methods concerning users.
Methods
addMembers
▸ addMembers(orgId, usersIds): Promise<void>
Parameters
| Name | Type | Description |
|---|---|---|
orgId | string | The uuid of the targeted organization. |
usersIds | string[] | The uuids of the users to be attached. |
Returns
Promise<void>
Summary
Attach members to organization.
Example
await client.organizations.addMembers("organization_id", ["user_id_1", "user_id_2"]);
getOrganizationById
▸ getOrganizationById(orgId): Promise<IPublicOrganizationData>
Parameters
| Name | Type | Description |
|---|---|---|
orgId | string | The uuid of the targeted organization. |
Returns
Promise<IPublicOrganizationData>
Promise returning the organization.
Summary
Retrieve organization by its id.
Example
const organization = await client.organizations.getOrganizationById("organization_id");
getSubOrganizations
▸ getSubOrganizations(orgId): Promise<IPublicOrganizationQuery>
Parameters
| Name | Type | Description |
|---|---|---|
orgId | string | The uuid of the parent organization. |
Returns
Promise<IPublicOrganizationQuery>
Promise returning sub-organizations of an organization.
Summary
Retrieve sub-organizations of an organization.
Example
const result = await client.organizations.getSubOrganizations("organization_id");
const subOrganizations = result.$resources;
listMembers
▸ listMembers(orgId): Promise<IPublicUserQuery>
Parameters
| Name | Type | Description |
|---|---|---|
orgId | string | The uuid of the targeted organization. |
Returns
Promise<IPublicUserQuery>
Promise returning all members specified in organization.
Summary
Retrieve all members of specified organization.
Example
const result = await client.organizations.listMembers("organization_id");
const users = result.$resources;
removeMembers
▸ removeMembers(orgId, usersIds): Promise<void>
Parameters
| Name | Type | Description |
|---|---|---|
orgId | string | The uuid of the targeted organization. |
usersIds | string[] | The uuids of the users to be detached. |
Returns
Promise<void>
Summary
Detach members to organization.
Example
await client.organizations.removeMembers("organization_id", ["user_id_1", "user_id_2"]);