export type DeleteApiV4AutomationsJobsJobIdArgs = {job_id: string | string}; export type DeleteApiV4AutomationsJobsJobIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Delete job * * DELETE /v4/automations/jobs/{job_id} */ export const deleteApiV4AutomationsJobsJobId = async (args: DeleteApiV4AutomationsJobsJobIdArgs, options: DeleteApiV4AutomationsJobsJobIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v4/automations/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 };