Class

ProjectRoles

ProjectRoles(client)

Class corresponding to Aworks ProjectRoles Endpoints
Constructor

# new ProjectRoles(client)

Endpoint constructor
Parameters:
Name Type Description
client Client
See:
  • [ProjectRoles in Awork API Docs](https://openapi.awork.com/#/ProjectRoles)

View Source endpoints/ProjectRoles.js, line 9

Classes

ProjectRoles

Methods

# async byUserId(userId) → {Promise.<Array.<ProjectRole>>}

Returns all project roles of a specific user.
Parameters:
Name Type Description
userId String The id of the user.

View Source endpoints/ProjectRoles.js, line 93

Promise.<Array.<ProjectRole>>

# async create(projectRole) → {Promise.<ProjectRole>}

Creates a new project role.
Parameters:
Name Type Description
projectRole ProjectRoleCreateModel The model to create a project role.

View Source endpoints/ProjectRoles.js, line 57

Promise.<ProjectRole>

# async delete(projectRoleId, newProjectRoleId) → {Promise.<void>}

Deletes the project role with the specified id. When you want to delete a project role which is still in use, you are required to specify which role the currently assigned members should be assigned to instead. If the default role gets deleted, the migration role becomes the new default project role.
Parameters:
Name Type Description
projectRoleId String The id of the project role.
newProjectRoleId String The project role id to replace the old project role with.

View Source endpoints/ProjectRoles.js, line 84

Promise.<void>

# async get(projectRoleId) → {Promise.<ProjectRole>}

Returns the project role with the specified id.
Parameters:
Name Type Description
projectRoleId String The id of the project role.

View Source endpoints/ProjectRoles.js, line 27

Promise.<ProjectRole>

# async list(optionsopt) → {Promise.<Array.<ProjectRole>>}

Returns all project roles.
Parameters:
Name Type Attributes Description
options ListOptions <optional>
Pagination and filtering options

View Source endpoints/ProjectRoles.js, line 38

Promise.<Array.<ProjectRole>>

# async update(projectRoleId, projectRole)

Updates the project role with the specified id.
Parameters:
Name Type Description
projectRoleId String The id of the project role.
projectRole ProjectRoleUpdateModel The model to update a project.

View Source endpoints/ProjectRoles.js, line 72