export type CreateApiApiAgentExecutionsBulkTerminateArgs = {reason?: string | undefined, body: Array}; export type CreateApiApiAgentExecutionsBulkTerminateOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/agent/executions/bulk/terminate */ export const createApiApiAgentExecutionsBulkTerminate = async (args: CreateApiApiAgentExecutionsBulkTerminateArgs, options?: CreateApiApiAgentExecutionsBulkTerminateOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.reason != null) query.append("reason", String(args.reason)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/agent/executions/bulk/terminate${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 };