export type CreateApiHotdeskingIdArgs = {id: string, body: {display_name?: string | undefined, password?: string | undefined, language?: ('ENGLISH' | 'CHINESE' | 'DUTCH' | 'FRENCH' | 'GERMAN' | 'GREEK' | 'ITALIAN' | 'JAPANESE' | 'POLISH' | 'RUSSIAN' | 'SPANISH' | 'SWEDISH' | 'UKRAINIAN' | 'BULGARIAN') | undefined, transfer?: ('BLIND' | 'ATTENDED' | 'NEW_CALL') | undefined, timezone?: string | undefined, ringtone?: string | undefined, queue_ringtone?: string | undefined, external_ringtone?: string | undefined, date_format?: string | undefined, time_format?: string | undefined, powerled?: string | undefined, backlight?: string | undefined, screensaver?: string | undefined, rps?: boolean | undefined, https?: boolean | undefined, codecs?: Array | undefined, enable_lldp?: boolean | undefined, enable_vlan_wan_port?: boolean | undefined, wan_port_id?: number | undefined, wan_port_priority?: number | undefined, enable_vlan_pc_port?: boolean | undefined, pc_port_id?: number | undefined, pc_port_priority?: number | undefined, interface?: ('WEB_DOMAIN' | 'PUBLIC_IPV4' | 'PUBLIC_IPV6' | 'PRIVATE_IPV4' | 'PRIVATE_IPV6' | 'SBC_DOMAIN') | undefined, preferred_transport?: ('UDP' | 'TCP' | 'TLS') | undefined, serial_number?: string | undefined}}; export type CreateApiHotdeskingIdOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update hot desking * * POST /hotdesking/{id} */ export const createApiHotdeskingId = async (args: CreateApiHotdeskingIdArgs, options?: CreateApiHotdeskingIdOptions) => { const {baseUrl = "https://HOSTNAME:8887/api", fetch: fetchFn = fetch, bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearer !== undefined) headers.set('authorization', `Bearer ${bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/hotdesking/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };