Skip to content

Switches

greysdawn edited this page Nov 17, 2021 · 2 revisions

Switch Objects

Switches can't be instantiated directly; see the API page for getting them

Note: These are also used for fronters

Properties

key type notes
id string (UUID) only available with v2
timestamp Date
members Array<string>|Map<Member> only contains member IDS if getting raw switches

Methods

Note: While some token arguments are marked as not optional, if the API instance has a token attached then it can be omitted

patchTimestamp(timestamp, token) [v2 only]

Patches the switch's timestamp

Arguments

name description optional?
timestamp A valid Date object no
token A token to auth the request no

Returns
The updated Switch object

Errors
Throws for the following:

  • Token invalid
  • Timestamp invalid

patchMembers(token, members) [v2 only]

Patches the switch's members

Arguments

name description optional?
token A token to auth the request no
members Array of member IDs yes (patches empty array if not provided)

Returns
The updated Switch object

Errors
Throws for the following:

  • Token invalid
  • Member ID(s) invalid

delete(token) [v2 only]

Deletes the switch

Arguments

name description optional?
token A token to auth the request no

Returns
Nothing

Errors
Throws for the following:

  • Token invalid