export type CreateApiDectPhonesIdArgs = {id: string, body: {name?: string | undefined, password?: string | undefined, user_password?: string | undefined, engineer_password?: string | undefined, timezone?: string | undefined, region?: string | undefined, language?: ('ENGLISH' | 'CHINESE' | 'DUTCH' | 'FRENCH' | 'GERMAN' | 'GREEK' | 'ITALIAN' | 'JAPANESE' | 'POLISH' | 'RUSSIAN' | 'SPANISH' | 'SWEDISH' | 'UKRAINIAN' | 'BULGARIAN') | undefined, handset_language?: ('ENGLISH' | 'CHINESE' | 'DUTCH' | 'FRENCH' | 'GERMAN' | 'GREEK' | 'ITALIAN' | 'JAPANESE' | 'POLISH' | 'RUSSIAN' | 'SPANISH' | 'SWEDISH' | 'UKRAINIAN' | 'BULGARIAN') | undefined, tone?: string | undefined, rps?: boolean | undefined, https?: boolean | undefined, codecs?: Array | undefined, interface?: ('WEB_DOMAIN' | 'PUBLIC_IPV4' | 'PUBLIC_IPV6' | 'PRIVATE_IPV4' | 'PRIVATE_IPV6' | 'SBC_DOMAIN') | undefined, preferred_transport?: ('UDP' | 'TCP' | 'TLS') | undefined}}; export type CreateApiDectPhonesIdOptions = {baseUrl?: string | undefined, bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update DECT phone * * POST /dect_phones/{id} */ export const createApiDectPhonesId = async (args: CreateApiDectPhonesIdArgs, options?: CreateApiDectPhonesIdOptions) => { 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(/\/+$/, '')}/dect_phones/${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 };