Class

TypesOfWorks

TypesOfWorks(client)

Class corresponding to Aworks TypeOfWork Endpoints
Constructor

# new TypesOfWorks(client)

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

View Source endpoints/TypesOfWork.js, line 9

Classes

TypesOfWorks

Methods

# async create(typeOfWork) → {Promise.<TypeOfWork>}

Creates a new type of work.
Parameters:
Name Type Description
typeOfWork TypeOfWorkCreateModel The model to create the type of work.

View Source endpoints/TypesOfWork.js, line 55

Promise.<TypeOfWork>

# async delete(typeOfWorkId) → {Promise.<void>}

Deletes the type of work with the specified id. If any tasks, task templates or time entries still use this type, the id of a new type needs to be provided.
Parameters:
Name Type Description
typeOfWorkId String The id of the type of work.

View Source endpoints/TypesOfWork.js, line 82

Promise.<void>

# async get(typeOfWorkId) → {Promise.<TypeOfWork>}

Gets a single type of work by its id.
Parameters:
Name Type Description
typeOfWorkId String The id of the type of work.

View Source endpoints/TypesOfWork.js, line 26

Promise.<TypeOfWork>

# async icons() → {Promise.<Array.<String>>}

Returns all possible icons for type of work.

View Source endpoints/TypesOfWork.js, line 90

Promise.<Array.<String>>

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

Returns all type of work.
Parameters:
Name Type Attributes Description
options ListOptions <optional>
Pagination and filtering options

View Source endpoints/TypesOfWork.js, line 37

Promise.<Array.<TypeOfWork>>

# async setArchived(typeOfWorkId, archivedopt) → {Promise.<Object>}

Archives or unarchives the type of work with the specified id. An archived type of work still exists for all tasks and time entries currently using it, but can no longer be created with this type of work.
Parameters:
Name Type Attributes Default Description
typeOfWorkId String The id of the type of work.
archived Boolean <optional>
true Flags the entity as archived.

View Source endpoints/TypesOfWork.js, line 101

Promise.<Object>

# async update(typeOfWorkId, typeOfWork) → {Promise.<TypeOfWork>}

Changes the properties of an existing type of work. A change will also effect all related tasks and time entries.
Parameters:
Name Type Description
typeOfWorkId String The id of the type of work.
typeOfWork TypeOfWorkUpdateModel The model to update the type of work.

View Source endpoints/TypesOfWork.js, line 71

Promise.<TypeOfWork>