export type CreateCodexAutomationRunDto = Record; export type CreateApiV1TasksTaskIdAutomationsAutomationIdCodexRunsArgs = {taskId: string, automationId: string, body: CreateCodexAutomationRunDto}; export type CreateApiV1TasksTaskIdAutomationsAutomationIdCodexRunsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /v1/tasks/{taskId}/automations/{automationId}/codex-runs */ export const createApiV1TasksTaskIdAutomationsAutomationIdCodexRuns = async (args: CreateApiV1TasksTaskIdAutomationsAutomationIdCodexRunsArgs, options?: CreateApiV1TasksTaskIdAutomationsAutomationIdCodexRunsOptions) => { const {baseUrl = "https://api.betayum.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/v1/tasks/${encodeURIComponent(String(args.taskId))}/automations/${encodeURIComponent(String(args.automationId))}/codex-runs${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };