export type DeleteApiAgentphoneV1NumbersNumberIdArgs = {numberId: string}; export type DeleteApiAgentphoneV1NumbersNumberIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Release a phone number. Irreversible. * * DELETE /agentphone/v1/numbers/{numberId} */ export const deleteApiAgentphoneV1NumbersNumberId = async (args: DeleteApiAgentphoneV1NumbersNumberIdArgs, options?: DeleteApiAgentphoneV1NumbersNumberIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/agentphone/v1/numbers/${encodeURIComponent(String(args.numberId))}${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 };