export type GetApiSmolmachinesV1MachinesIdArgs = {id: string}; export type GetApiSmolmachinesV1MachinesIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get machine details and status. Poll until ready is true before executing commands. * * GET /smolmachines/v1/machines/{id} */ export const getApiSmolmachinesV1MachinesId = async (args: GetApiSmolmachinesV1MachinesIdArgs, options?: GetApiSmolmachinesV1MachinesIdOptions) => { 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))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };