Skip to content

EventTypesClient

Patrick Smith edited this page Jan 22, 2021 · 1 revision

EventTypesClient

Client used for accessing Event Type resource data

Parameters

  • token (Token) - Access Token that can be retrieved using the OAuthClient

Example Usage

const oauthClient = new OAuthClient(clientId, clientSecret)
const token = oauthClient.token({...})

const client = new EventTypesClient(token)

Method Signatures

  • async get(uuid: string): Promise<EventType>

Please refer to Calendly's v2 API documentation for more details: Get Event Type

/**
  * Returns the Event Type associated with the specified UUID
  * @param uuid - UUID of the Event Type
  */
async get(uuid: string): Promise<EventType>

type EventType = {
  uri: string
  name: string
  active: boolean
  slug: string
  schedulingUrl: string
  duration: number
  kind: Kind
  poolingType: PoolingType
  type: EventTypeType
  color: string
  createdAt: Date
  updatedAt: Date
  internalNote: string
  descriptionPlain: string
  descriptionHtml: string
  profile: Profile
  secret: boolean
}

enum Kind {
  Solo = 'solo',
  Group = 'group'
}

enum PoolingType {
  RoundRobin = 'round robin',
  Collective = 'collective'
}

enum EventTypeType {
  AdhocEventType = 'AdhocEventType',
  StandardEventType = 'StandardEventType'
}

type Profile = {
  type: ProfileType
  name: string
  owner: string
}

enum ProfileType {
  User = 'user',
  Team = 'team'
}
  • async list(options: EventTypeOptions): Promise<EventTypeList>

Please refer to Calendly's v2 API documentation for more details: List Event Types

/**
 * Returns all Event Types associated with a specified User
 */
async list(options: EventTypeOptions): Promise<EventTypeList>

type EventTypeOptions = {
  user: string,
  count?: number,
  pageToken?: string,
  sort?: EventTypeSort
}

enum EventTypeSort {
  NameAscending = 'name:asc',
  NameDescending = 'name:desc'
}

type EventTypeList = {
  collection: EventType[]
  pagination: Pagination
}

type Pagination = {
  count: number,
  nextPage: string
}