export type CreateApiV1RestartArgs = {Metadata: 'true'}; export type CreateApiV1RestartOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Restart Container Instance * * POST /v1/restart */ export const createApiV1Restart = async (args: CreateApiV1RestartArgs, options?: CreateApiV1RestartOptions) => { 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/restart${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 };