export type DeleteApiV2PartitionPartitionIdCallingplanproductCppIdArchiveCallingplanArgs = {cppId: string, partitionId: string}; export type DeleteApiV2PartitionPartitionIdCallingplanproductCppIdArchiveCallingplanOptions = {baseUrl?: string | undefined, XAuthToken?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive calling plan product * * DELETE /v2/partition/{partitionId}/callingplanproduct/{cppId}/archive-callingplan */ export const deleteApiV2PartitionPartitionIdCallingplanproductCppIdArchiveCallingplan = async (args: DeleteApiV2PartitionPartitionIdCallingplanproductCppIdArchiveCallingplanArgs, options?: DeleteApiV2PartitionPartitionIdCallingplanproductCppIdArchiveCallingplanOptions) => { 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))}/callingplanproduct/${encodeURIComponent(String(args.cppId))}/archive-callingplan${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 };