UNPKG

coconut-open-api-js

Version:
76 lines (75 loc) 3.03 kB
import { AxiosInstance } from 'axios'; import { Pageable } from '../index'; import Conditional, { ConditionalResource } from './conditional'; export interface LocatableUserParameters { [key: string]: any; region?: string; } export interface UserFilter { [key: string]: any; assigned?: boolean; category?: number | string; invite_only_resources?: boolean; location?: number | string; location_category?: number | string; lobby_location_id?: number | string; without_remote_staff_only?: boolean; method?: number; resource?: string; services?: number | number[] | string | string[]; user?: number | string; } export interface UserParameters { assignments?: boolean; category?: number | string; client_view_meeting_method?: number; invite_only_resources?: number; location?: number | string; location_category?: number | string; lobby_location_id?: number | string; without_remote_staff_only_at_location?: number | string; meeting_method?: number; province?: string; resource?: string; service?: number | number[] | string | string[]; user?: number | string; } export interface UserResource extends Pageable, ConditionalResource { assigned(assigned: boolean): this; at(location: number | string): this; find(user: number | string): this; located(details: LocatableUserParameters): this; performing(services: number | number[] | string | string[]): this; supporting(method: number): this; through(resource: string): this; withInviteOnly(inviteOnlyResources?: boolean): this; withinLocationCategory(locationCategory?: number | string): this; withinUserCategory(category?: number | string): this; availableInLobby(lobbyLocationId: number | string): this; withoutRemoteStaffOnly(withoutRemoteStaffOnly?: boolean): this; } export default class User extends Conditional implements UserResource { protected client: AxiosInstance; protected filters: UserFilter; protected page: number | null; protected sortable: string | null; protected limit: number | null; constructor(client: AxiosInstance); assigned(assigned?: boolean): this; at(location: number | string): this; find(user: number | string): this; located(details: LocatableUserParameters): this; get(): Promise<any>; on(page: number): this; performing(services: number | number[] | string | string[]): this; sortBy(sortable: string): this; supporting(method: number): this; through(resource: string): this; take(limit: number): this; withInviteOnly(inviteOnlyResources?: boolean): this; withinLocationCategory(locationCategory: number | string): this; withinUserCategory(category: number | string): this; withoutRemoteStaffOnly(withoutRemoteStaffOnly?: boolean): this; availableInLobby(lobbyLocationId: number | string): this; protected params(): UserParameters; }