export type UpdateJobCommand = {JobTitle?: (string | null) | undefined, Classification?: (string | null) | undefined, StartDate: string, EndDate?: (string | null) | undefined, WorkingCalendar?: (string | null) | undefined, LineManagerId?: (string | null) | undefined, HierarchyNodeId?: (string | null) | undefined, Active?: boolean | undefined, Salary?: (number | null) | undefined, Contract?: (string | null) | undefined, PayFrequency?: (string | null) | undefined, PayBasis?: (string | null) | undefined, FullTimeEquivalent?: (number | null) | undefined, ChangeReason?: (string | null) | undefined, NextIncrementDate?: (string | null) | undefined, TimesheetLocation?: (string | null) | undefined, TimesheetLunchDuration?: (string | null) | undefined, ExpenseSubmissionFrequency?: (string | null) | undefined, CostCentre?: (string | null) | undefined, JobFamily?: (string | null) | undefined, ApprenticeUnder25?: (boolean | null) | undefined, ApprenticeshipEndDate?: (string | null) | undefined, ContractEndDate?: (string | null) | undefined, NormalHours?: (number | null) | undefined, RealTimeInformationIrregularFrequency?: (string | null) | undefined, NoticePeriod?: (string | null) | undefined}; export type UpdateApiJobsIdArgs = {id: string, body: UpdateJobCommand}; export type UpdateApiJobsIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update a Job referenced by an ID. * * PUT /jobs/{id} */ export const updateApiJobsId = async (args: UpdateApiJobsIdArgs, options?: UpdateApiJobsIdOptions) => { const {baseUrl = "https://api.iris.co.uk/hr/v2", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/jobs/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };