export type DeletionCost = {deletion_cost: number}; export type UpdateApiV1DeletionCostArgs = {Metadata: 'true', body: DeletionCost}; export type UpdateApiV1DeletionCostOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Replace Container Instance Deletion Cost * * PUT /v1/deletion-cost */ export const updateApiV1DeletionCost = async (args: UpdateApiV1DeletionCostArgs, options?: UpdateApiV1DeletionCostOptions) => { const {baseUrl = "https://api.salad.com/api/public", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.Metadata != null) headers.set("Metadata", String(args.Metadata)) if (ApiKeyAuth !== undefined) headers.set("Salad-Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/deletion-cost${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };