export type DeleteApiV2OrgOrgIdJobJobIdArgs = {orgId: string, jobId: string, scenarioId?: string | undefined, date?: string | undefined}; export type DeleteApiV2OrgOrgIdJobJobIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a job * * DELETE /v2/org/{orgId}/job/{jobId} */ export const deleteApiV2OrgOrgIdJobJobId = async (args: DeleteApiV2OrgOrgIdJobJobIdArgs, options?: DeleteApiV2OrgOrgIdJobJobIdOptions) => { const {baseUrl = "https://localhost", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.scenarioId != null) query.append("scenarioId", String(args.scenarioId)) if (args.date != null) query.append("date", String(args.date)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/org/${encodeURIComponent(String(args.orgId))}/job/${encodeURIComponent(String(args.jobId))}${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 };