export type Job = {type?: string | undefined, id?: string | undefined, attributes?: ({approvalTeam?: string | undefined, comments?: string | undefined, createdBy?: string | undefined, createdDate?: string | undefined, output?: string | undefined, status?: ('pending' | 'waitingApproval' | 'approved' | 'queue' | 'running' | 'completed' | 'rejected' | 'cancelled' | 'failed') | undefined, tcl?: string | undefined, templateReference?: string | undefined, terraformPlan?: string | undefined, updatedBy?: string | undefined, updatedDate?: string | undefined}) | undefined, relationships?: ({organization?: ({id?: string | undefined, type?: 'organization' | undefined}) | undefined, step?: ({id?: string | undefined, type?: 'step' | undefined}) | undefined, workspace?: ({id?: string | undefined, type?: 'workspace' | undefined}) | undefined}) | undefined}; export type PatchApiStepStepIdJobJobIdArgs = {body: {data?: Job | undefined}}; export type PatchApiStepStepIdJobJobIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Modifies an instance of type job * * PATCH /step/{stepId}/job/{jobId} */ export const patchApiStepStepIdJobJobId = async (args: PatchApiStepStepIdJobJobIdArgs, options: PatchApiStepStepIdJobJobIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/vnd.api+json") const url = `${baseUrl.replace(/\/+$/, '')}/step/${encodeURIComponent(String(args.stepId))}/job/${encodeURIComponent(String(args.jobId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };