export type CreateApiV1TasksTaskIdAutomationsAutomationIdVersionsArgs = {taskId: string, automationId: string}; export type CreateApiV1TasksTaskIdAutomationsAutomationIdVersionsOptions = {baseUrl?: string | undefined, apikey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Create a published version record for an automation * * POST /v1/tasks/{taskId}/automations/{automationId}/versions */ export const createApiV1TasksTaskIdAutomationsAutomationIdVersions = async (args: CreateApiV1TasksTaskIdAutomationsAutomationIdVersionsArgs, options?: CreateApiV1TasksTaskIdAutomationsAutomationIdVersionsOptions) => { const {baseUrl = "https://api.betayum.com", fetch: fetchFn = fetch, apikey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apikey !== undefined) headers.set("X-API-Key", apikey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/tasks/${encodeURIComponent(String(args.taskId))}/automations/${encodeURIComponent(String(args.automationId))}/versions${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 };