UNPKG

coconut-open-api-js

Version:
78 lines (77 loc) 2.75 kB
import { AxiosInstance } from 'axios'; import { Resource } from '../index'; import Conditional, { ConditionalResource } from './conditional'; export interface TimeSlotFilter { end?: string; exclusion?: number; google?: string; group_service?: boolean; invite_only_resources?: boolean; location?: number; location_category?: number | string; method?: number; services?: number | number[]; start?: string; timezone?: string; locales?: string[]; user?: number; user_category?: number; users?: number | number[]; visibility?: number; } export interface TimeSlotParameters { additional_staff_id?: number | number[]; end?: string; exclusion?: number; google?: string; group_service?: number; invite_only_resources?: number; location_id?: number; location_category_id?: number | string; meeting_method?: number; service_id?: number | number[]; staff_category_id?: number; staff_id?: number; start?: string; supported_locales?: string[]; timezone?: string; visibility?: number; } export interface TimeSlotResource extends Resource, ConditionalResource { at(location: number): this; attendedBy(users: number | number[]): this; between(start: string, end: string): this; by(user: number): this; excluding(exclusion: number): this; for(services: number | number[]): this; google(token: string): this; group(isGroup: boolean): this; in(timezone: string): this; method(method: number): this; supporting(locales: string[]): this; visibility(visibility: number): this; withInviteOnly(inviteOnlyResources?: boolean): this; withinLocationCategory(locationCategory: number | string): this; withinUserCategory(userCategory: number | string): this; } export default class TimeSlot extends Conditional implements TimeSlotResource { protected client: AxiosInstance; protected filters: TimeSlotFilter; constructor(client: AxiosInstance); at(location: number): this; attendedBy(users: number | number[]): this; between(start: string, end: string): this; by(user: number): this; excluding(exclusion: number): this; for(services: number | number[]): this; get(): Promise<any>; google(token: string): this; group(isGroup?: boolean): this; in(timezone: string): this; method(method: number): this; supporting(locales: string[]): this; visibility(visibility: number): this; withInviteOnly(inviteOnlyResources?: boolean): this; withinLocationCategory(locationCategory: number | string): this; withinUserCategory(userCategory: number): this; }