export type CreateApiApiHumanTasksTaskIdSkipArgs = {taskId: string, reason?: string | undefined}; export type CreateApiApiHumanTasksTaskIdSkipOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * If a task is assigned to a user, this API can be used to skip that assignment and move to the next assignee * * POST /api/human/tasks/{taskId}/skip */ export const createApiApiHumanTasksTaskIdSkip = async (args: CreateApiApiHumanTasksTaskIdSkipArgs, options?: CreateApiApiHumanTasksTaskIdSkipOptions) => { const {baseUrl = "https://developer.orkescloud.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.reason != null) query.append("reason", String(args.reason)) if (apiKey !== undefined) headers.set("X-Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/human/tasks/${encodeURIComponent(String(args.taskId))}/skip${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 };