export type CreateApiSmolmachinesV1MachinesIdStartArgs = {id: string}; export type CreateApiSmolmachinesV1MachinesIdStartOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Start a stopped machine * * POST /smolmachines/v1/machines/{id}/start */ export const createApiSmolmachinesV1MachinesIdStart = async (args: CreateApiSmolmachinesV1MachinesIdStartArgs, options?: CreateApiSmolmachinesV1MachinesIdStartOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/smolmachines/v1/machines/${encodeURIComponent(String(args.id))}/start${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 };