export type DeleteApiAppsAppNameDeploymentsDeploymentNameArgs = {appName: string, deploymentName: string, tenant?: string | undefined}; export type DeleteApiAppsAppNameDeploymentsDeploymentNameOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete deployment * * DELETE /apps/{appName}/deployments/{deploymentName} */ export const deleteApiAppsAppNameDeploymentsDeploymentName = async (args: DeleteApiAppsAppNameDeploymentsDeploymentNameArgs, options: DeleteApiAppsAppNameDeploymentsDeploymentNameOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.tenant != null) headers.set("tenant", String(args.tenant)) const url = `${baseUrl.replace(/\/+$/, '')}/apps/${encodeURIComponent(String(args.appName))}/deployments/${encodeURIComponent(String(args.deploymentName))}${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 };