Namespace

Group

CustomersService#Group

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>

humanId list of initial members (persons or OUs).

return boolean <optional>

When true, returns the created entity.

View Source services/CustomersService.class.js, line 379

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.

View Source services/CustomersService.class.js, line 401

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 humanId.

View Source services/CustomersService.class.js, line 421

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.

View Source services/CustomersService.class.js, line 393

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 humanId (person or OU).

body Object <optional>

Optional membership metadata.

View Source services/CustomersService.class.js, line 411

Promise.<ServiceResponse>