export type PatchApiConfigTenantLocatorDeploymentsVersionsStaticVersionLocatorRetireArgs = {tenantLocator: string, staticVersionLocator: unknown}; export type PatchApiConfigTenantLocatorDeploymentsVersionsStaticVersionLocatorRetireOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PATCH /config/{tenantLocator}/deployments/versions/{staticVersionLocator}/retire */ export const patchApiConfigTenantLocatorDeploymentsVersionsStaticVersionLocatorRetire = async (args: PatchApiConfigTenantLocatorDeploymentsVersionsStaticVersionLocatorRetireArgs, options: PatchApiConfigTenantLocatorDeploymentsVersionsStaticVersionLocatorRetireOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/config/${encodeURIComponent(String(args.tenantLocator))}/deployments/versions/${encodeURIComponent(String(args.staticVersionLocator))}/retire${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };