export type DeleteApiApiV2JobsJobIdArgs = {job_id: string}; export type DeleteApiApiV2JobsJobIdOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a job * * DELETE /api/v2/jobs/{job_id} */ export const deleteApiApiV2JobsJobId = async (args: DeleteApiApiV2JobsJobIdArgs, options?: DeleteApiApiV2JobsJobIdOptions) => { const {baseUrl = "https://api.ai.vision.tiliter.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("X-API-Key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/api/v2/jobs/${encodeURIComponent(String(args.job_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };