Skip to content

Collaborator

This class defines a Collaborator of a [[Book]].

A Collaborator represents a user that has been granted access to a Book with specific permissions.

Extends

  • Resource<bkper.Collaborator>

Constructors

Constructor

new Collaborator(book, payload?): Collaborator;

Parameters

ParameterType
bookBook
payload?Collaborator

Returns

Collaborator

Overrides

Resource<bkper.Collaborator>.constructor

Properties

payload

payload: Collaborator;

The underlying payload data for this resource

Inherited from

Resource.payload

Methods

create()

create(message?): Promise<Collaborator>;

Performs create new Collaborator.

Parameters

ParameterType
message?string

Returns

Promise<Collaborator>

Promise with the created Collaborator


getEmail()

getEmail(): string | undefined;

Gets the Collaborator email address.

Returns

string | undefined

The Collaborator email address


getId()

getId(): string | undefined;

Gets the Collaborator internal id.

Returns

string | undefined

The Collaborator internal id


getPermission()

getPermission(): Permission | undefined;

Gets the permission level of the Collaborator.

Returns

Permission | undefined

The permission level


json()

json(): Collaborator;

Gets an immutable copy of the JSON payload for this resource.

Returns

Collaborator

An immutable copy of the json payload

Inherited from

Resource.json

remove()

remove(): Promise<Collaborator>;

Performs remove Collaborator.

Returns

Promise<Collaborator>

Promise with the removed Collaborator


setEmail()

setEmail(email): Collaborator;

Sets the email address of the Collaborator.

Parameters

ParameterTypeDescription
emailstringThe email address to set

Returns

Collaborator

This Collaborator, for chaining


setPermission()

setPermission(permission): Collaborator;

Sets the permission level of the Collaborator.

Parameters

ParameterTypeDescription
permissionPermissionThe permission level to set

Returns

Collaborator

This Collaborator, for chaining


update()

update(): Promise<Collaborator>;

Performs update Collaborator.

Returns

Promise<Collaborator>

Promise with the updated Collaborator