export type DeleteApiV1PhoneNumbersIdWhatsappCallingArgs = {id: string, accountId: string}; export type DeleteApiV1PhoneNumbersIdWhatsappCallingOptions = {baseUrl?: string | undefined, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Disable calling on a number * * DELETE /v1/phone-numbers/{id}/whatsapp/calling */ export const deleteApiV1PhoneNumbersIdWhatsappCalling = async (args: DeleteApiV1PhoneNumbersIdWhatsappCallingArgs, options?: DeleteApiV1PhoneNumbersIdWhatsappCallingOptions) => { const {baseUrl = "https://zernio.com/api", fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.accountId != null) query.append("accountId", String(args.accountId)) if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/phone-numbers/${encodeURIComponent(String(args.id))}/whatsapp/calling${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };