export type GetApiApiAgentExecutionsExecutionIdTasksArgs = {executionId: string, status?: string | undefined, count?: number | undefined, start?: number | undefined}; export type GetApiApiAgentExecutionsExecutionIdTasksOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /api/agent/executions/{executionId}/tasks */ export const getApiApiAgentExecutionsExecutionIdTasks = async (args: GetApiApiAgentExecutionsExecutionIdTasksArgs, options?: GetApiApiAgentExecutionsExecutionIdTasksOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.status != null) query.append("status", String(args.status)) if (args.count != null) query.append("count", String(args.count)) if (args.start != null) query.append("start", String(args.start)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/agent/executions/${encodeURIComponent(String(args.executionId))}/tasks${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 res.blob() };