export type DeleteApiTrustedDestinationsCreationRequestIdCancelArgs = {creationRequestId: string}; export type DeleteApiTrustedDestinationsCreationRequestIdCancelOptions = {baseUrl?: string | undefined, ApiAccessKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Cancel Trusted Destination creation * * DELETE /trusted_destinations/{creationRequestId}/cancel */ export const deleteApiTrustedDestinationsCreationRequestIdCancel = async (args: DeleteApiTrustedDestinationsCreationRequestIdCancelArgs, options?: DeleteApiTrustedDestinationsCreationRequestIdCancelOptions) => { const {baseUrl = "https://api.anchorage-staging.com/v2", fetch: fetchFn = fetch, ApiAccessKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiAccessKey !== undefined) headers.set("Api-Access-Key", ApiAccessKey) const url = `${baseUrl.replace(/\/+$/, '')}/trusted_destinations/${encodeURIComponent(String(args.creationRequestId))}/cancel${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 };