Class

Absences

Absences(client)

Class corresponding to Aworks Absences Endpoints
Constructor

# new Absences(client)

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

View Source endpoints/Absences.js, line 9

Classes

Absences

Methods

# async create(absence) → {Promise.<Absence>}

Creates a new absence. The startOn of the model always gets set to 00:00:00 and the endOn gets set to 23:59:59 both in UTC. The end date needs to be the same or after the start date.
Parameters:
Name Type Description
absence AbsenceCreateModel

View Source endpoints/Absences.js, line 56

Promise.<Absence>

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

Deletes the absence with the specified id.
Parameters:
Name Type Description
absenceId String The id of the absence to delete.

View Source endpoints/Absences.js, line 83

Promise.<void>

# async get(absenceId) → {Promise.<Absence>}

Returns the absence with the specified id.
Parameters:
Name Type Description
absenceId String The id of the absence to get.

View Source endpoints/Absences.js, line 27

Promise.<Absence>

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

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

View Source endpoints/Absences.js, line 38

Promise.<Array.<Absence>>

# async update(absenceId, absence) → {Promise.<Absence>}

Updates the absence with the specified id. The startOn of the model always gets set to 00:00:00 and the endOn gets set to 23:59:59 both in UTC. The end date needs to be the same or after the start date.
Parameters:
Name Type Description
absenceId String The id of the absence to update.
absence AbsenceUpdateModel

View Source endpoints/Absences.js, line 72

Promise.<Absence>