export type DeleteApiV2PartitionPartitionIdTelephonenumberTnArgs = {partitionId: string, tn: string}; export type DeleteApiV2PartitionPartitionIdTelephonenumberTnOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete telephone number from the specified partition's inventory * * DELETE /v2/partition/{partitionId}/telephonenumber/{tn} */ export const deleteApiV2PartitionPartitionIdTelephonenumberTn = async (args: DeleteApiV2PartitionPartitionIdTelephonenumberTnArgs, options?: DeleteApiV2PartitionPartitionIdTelephonenumberTnOptions) => { const {baseUrl = "https://api.alianza.com", fetch: fetchFn = fetch, XAuthToken} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (XAuthToken !== undefined) headers.set("X-AUTH-TOKEN", XAuthToken) const url = `${baseUrl.replace(/\/+$/, '')}/v2/partition/${encodeURIComponent(String(args.partitionId))}/telephonenumber/${encodeURIComponent(String(args.tn))}${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 };