export type DeleteApiApiV1AccountAuthIdNumbersE164Args = {auth_id: string, e164: string}; export type DeleteApiApiV1AccountAuthIdNumbersE164Options = {baseUrl?: string | undefined, AuthID?: string | undefined, AuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Unrent a number * * DELETE /api/v1/Account/{auth_id}/numbers/{e164} */ export const deleteApiApiV1AccountAuthIdNumbersE164 = async (args: DeleteApiApiV1AccountAuthIdNumbersE164Args, options?: DeleteApiApiV1AccountAuthIdNumbersE164Options) => { const {baseUrl = "https://api.vobiz.ai", fetch: fetchFn = fetch, AuthID, AuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (AuthID !== undefined) headers.set("X-Auth-ID", AuthID) if (AuthToken !== undefined) headers.set("X-Auth-Token", AuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/Account/${encodeURIComponent(String(args.auth_id))}/numbers/${encodeURIComponent(String(args.e164))}${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 };