export type CreateApiV1RecreateArgs = {Metadata: 'true'}; export type CreateApiV1RecreateOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Recreate Container Instance * * POST /v1/recreate */ export const createApiV1Recreate = async (args: CreateApiV1RecreateArgs, options?: CreateApiV1RecreateOptions) => { const {baseUrl = "https://api.salad.com/api/public", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.Metadata != null) headers.set("Metadata", String(args.Metadata)) if (ApiKeyAuth !== undefined) headers.set("Salad-Api-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/recreate${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };