UNPKG

coconut-open-api-js

Version:
81 lines (80 loc) 2.82 kB
import { AxiosInstance } from 'axios'; import { Pageable } from '../index'; import Conditional, { ConditionalResource } from './conditional'; export interface LocatableServiceParameters { [key: string]: any; region?: string; } export interface ServiceFilter { [key: string]: any; assigned?: boolean; category?: number | string; group?: number; invitable?: number; invite_only_resources?: boolean; location?: number | string; location_category?: number | string; method?: number; preferred?: number; resource?: string; user?: number | string; user_category?: number | string; } export interface ServiceParameters { assignments?: number; category?: number | string; client_view_meeting_method?: number; group?: number; invite_only?: number; invite_only_resources?: number; location?: number | string; location_category?: number | string; preferred?: number; province?: string; resource?: string; user?: number | string; user_category?: number | string; } export interface ServiceResource extends Pageable, ConditionalResource { assigned(assigned: boolean): this; at(location: number | string): this; by(user: number | string): this; group(): this; in(category: number | string): this; individual(): this; invitable(): this; located(details: LocatableServiceParameters): this; preferred(): this; supporting(method: number): this; through(resource: string): this; withInviteOnly(inviteOnlyResources?: boolean): this; withinLocationCategory(locationCategory: number | string): this; withinUserCategory(userCategory: number | string): this; } export default class Service extends Conditional implements ServiceResource { protected client: AxiosInstance; protected filters: ServiceFilter; protected page: number | null; protected sortable: string | null; protected limit: number | null; constructor(client: AxiosInstance); assigned(assigned?: boolean): this; at(location: number | string): this; by(user: number | string): this; get(): Promise<any>; group(): this; in(category: number | string): this; individual(): this; invitable(): this; located(details: LocatableServiceParameters): this; preferred(): this; on(page: number): this; sortBy(sortable: string): this; supporting(method: number): this; take(limit: number): this; through(resource: string): this; withInviteOnly(inviteOnlyResources?: boolean): this; withinLocationCategory(locationCategory: number | string): this; withinUserCategory(userCategory: number | string): this; protected params(): ServiceParameters; }