export type CreateApiTasksTaskIdAcknowledgeArgs = {task_id: string}; export type CreateApiTasksTaskIdAcknowledgeOptions = {baseUrl?: string | undefined, HTTPBearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Acknowledge Failed Task * * POST /tasks/{task_id}/acknowledge */ export const createApiTasksTaskIdAcknowledge = async (args: CreateApiTasksTaskIdAcknowledgeArgs, options?: CreateApiTasksTaskIdAcknowledgeOptions) => { const {baseUrl = "https://am1.portal.api.nasuni.com", fetch: fetchFn = fetch, HTTPBearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (HTTPBearer !== undefined) headers.set('authorization', `Bearer ${HTTPBearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/tasks/${encodeURIComponent(String(args.task_id))}/acknowledge${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 };