new EventsAPI(rest)
This class is used to interact with Events in TidyHQ.
Parameters:
Name | Type | Description |
---|---|---|
rest | Rest | The rest instance to use for requests. |
- Source
Methods
(async) createEvent(event, optionsopt) → {Promise.<TidyAPI_V1_Event>}
Create a new event.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
event | Tidy_V1_EventParams | The event to create. Requires a name and start_at. | ||||||||||
options | Object | <optional> | {} | Properties
|
- Source
Returns:
- The event.
- Type:
- Promise.<TidyAPI_V1_Event>
(async) deleteEvent(event_id, optionsopt) → {Promise.<TidyAPI_Response>}
Delete an event.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
event_id | number | The ID of the event. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- Success or failure.
- Type:
- Promise.<TidyAPI_Response>
(async) getEvent(event_id, optionsopt) → {Promise.<TidyAPI_V1_Event>}
Get a single event.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
event_id | number | The ID of the event. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The event.
- Type:
- Promise.<TidyAPI_V1_Event>
(async) getEvents(optionsopt) → {Promise.<TidyAPI_V1_Events>}
Get a list of events.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The list of events.
- Type:
- Promise.<TidyAPI_V1_Events>
(async) updateEvent(event_id, event, optionsopt) → {Promise.<TidyAPI_V1_Event>}
Update an event.
Parameters:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
event_id | number | The ID of the event. | ||||||||||
event | Tidy_V1_EventParams | The event to update. Requires at least one parameter. | ||||||||||
options | object | <optional> | {} | Properties
|
- Source
Returns:
- The event.
- Type:
- Promise.<TidyAPI_V1_Event>