export type DeleteApiV1ProjectsProjectIdWhatsappSendersSenderIdArgs = {projectId: string, senderId: string}; export type DeleteApiV1ProjectsProjectIdWhatsappSendersSenderIdOptions = {baseUrl?: string | undefined, BasicAuth?: {username: string, password: string} | undefined, BearerAuth?: string | undefined, OAuth2Production?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete sender for project * * DELETE /v1/projects/{projectId}/whatsapp/senders/{senderId} */ export const deleteApiV1ProjectsProjectIdWhatsappSendersSenderId = async (args: DeleteApiV1ProjectsProjectIdWhatsappSendersSenderIdArgs, options?: DeleteApiV1ProjectsProjectIdWhatsappSendersSenderIdOptions) => { const {baseUrl = "https://provisioning.api.sinch.com", fetch: fetchFn = fetch, BasicAuth, BearerAuth, OAuth2Production} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BasicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${BasicAuth.username}:${BasicAuth.password}`)}`) if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) if (OAuth2Production !== undefined) headers.set('authorization', `Bearer ${OAuth2Production}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/projects/${encodeURIComponent(String(args.projectId))}/whatsapp/senders/${encodeURIComponent(String(args.senderId))}${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 };