export type UpdateApiClientsClientSidArgs = {body: {is_active?: number | undefined, allow_direct_app_calling?: number | undefined, allow_direct_queue_calling?: number | undefined, allow_direct_user_calling?: number | undefined}}; export type UpdateApiClientsClientSidOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a client * * PUT /Clients/{ClientSid} */ export const updateApiClientsClientSid = async (args: UpdateApiClientsClientSidArgs, options?: UpdateApiClientsClientSidOptions) => { const {baseUrl = "https://api.jambonz.cloud/v1", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/Clients/${encodeURIComponent(String(args.ClientSid))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };