Group entity operations.
Methods
# static create(data, optionsopt) → {Promise.<ServiceResponse>}
Creates a new Group entity.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
Object
|
Group field values. |
|
options |
Object
|
<optional> |
|
members |
Array.<string>
|
<optional> |
|
return |
boolean
|
<optional> |
When |
Promise.<ServiceResponse>
Example
const { result } = await customers.Group.create(
{ name: 'Admins' },
{ members: ['person-ada', 'ou-engineering'], return: true }
)
# static delete(humanId) → {Promise.<ServiceResponse>}
Deletes a Group entity.
Parameters:
| Name | Type | Description |
|---|---|---|
humanId |
string
|
The group's human-readable identifier. |
Promise.<ServiceResponse>
# static removeMember(groupHumanId, targetHumanId) → {Promise.<ServiceResponse>}
Removes a member from a group.
Parameters:
| Name | Type | Description |
|---|---|---|
groupHumanId |
string
|
The group's human-readable identifier. |
targetHumanId |
string
|
The member's |
Promise.<ServiceResponse>
# static update(humanId, body) → {Promise.<ServiceResponse>}
Updates an existing Group entity.
Parameters:
| Name | Type | Description |
|---|---|---|
humanId |
string
|
The group's human-readable identifier. |
body |
Object
|
Update payload. |
Promise.<ServiceResponse>
# static upsertMember(groupHumanId, targetHumanId, bodyopt) → {Promise.<ServiceResponse>}
Adds or updates a member in a group.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
groupHumanId |
string
|
The group's human-readable identifier. |
|
targetHumanId |
string
|
The member's |
|
body |
Object
|
<optional> |
Optional membership metadata. |
Promise.<ServiceResponse>