export type GetApiWhatsappCallCallPermissionsArgs = {wabaNumber: string, customerId: string, client?: string | undefined, version?: string | undefined}; export type GetApiWhatsappCallCallPermissionsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get call permissions * * GET /whatsapp/call/call-permissions */ export const getApiWhatsappCallCallPermissions = async (args: GetApiWhatsappCallCallPermissionsArgs, options?: GetApiWhatsappCallCallPermissionsOptions) => { const {baseUrl = "https://public.doubletick.io", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.wabaNumber != null) query.append("wabaNumber", String(args.wabaNumber)) if (args.customerId != null) query.append("customerId", String(args.customerId)) if (args.client != null) query.append("client", String(args.client)) if (args.version != null) query.append("version", String(args.version)) const url = `${baseUrl.replace(/\/+$/, '')}/whatsapp/call/call-permissions${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };