Roles
@smokeballdev/smokeball-client-sdk
Interface: Api
Entry point for roles to Smokeball.
Methods
add()
add(
request
):Promise
<Role
>
Adds a new role with the specified contactId to the current context and returns the role.
Parameters
request
the create request.
Returns
Promise
<Role
>
Example
get()
get():
Promise
<Roles
>
Gets the roles associated to the current context.
Returns
Promise
<Roles
>
the roles for the current context.
Example
observe()
observe(
callback
,matterId?
):void
Creates a subscription for the roles associated to the current context or the specified matter id if provided.
Only one subscription will be made per session. Regardless of how many times this function is called, the last registered callback will be used.
Parameters
callback
(roles
) => void
the function to execute when a change is made to contact(s) in Smokeball.
matterId?
string
Returns
void
Example
remove()
remove(
id
):Promise
<Roles
>
Removes the specified role from the current context.
Parameters
id
string
Returns
Promise
<Roles
>
Example
update()
update(
request
):Promise
<Role
>
Updates the role associated to the specified role id and returns the role.
Parameters
request
the update request.
Returns
Promise
<Role
>