export type Ownership = 'Personal' | 'Organization'; export type PhoneType = 'Mobile' | 'Landline'; export type Phone = {Ownership?: Ownership | undefined, Type?: PhoneType | undefined, Value?: (string | null) | undefined}; export type Email = {Ownership?: Ownership | undefined, Value?: (string | null) | undefined}; export type Address = {Ownership?: Ownership | undefined, Address1?: (string | null) | undefined, Address2?: (string | null) | undefined, Address3?: (string | null) | undefined, Address4?: (string | null) | undefined, Address5?: (string | null) | undefined, PostCode?: (string | null) | undefined}; export type UpdateEmployeeCommand = {DisplayId?: (string | null) | undefined, TitleHonorific?: (string | null) | undefined, FirstName: string | null, KnownAs?: (string | null) | undefined, OtherName?: (string | null) | undefined, LastName: string | null, CostCentre?: (string | null) | undefined, NationalInsuranceNumber?: (string | null) | undefined, PayrollId?: (string | null) | undefined, TaxCode?: (string | null) | undefined, IncludeInPayroll?: (boolean | null) | undefined, EmploymentStartDate?: (string | null) | undefined, EmploymentLeftDate?: (string | null) | undefined, ContinuousServiceDate?: (string | null) | undefined, DateOfBirth?: (string | null) | undefined, LastWorkingDate?: (string | null) | undefined, Gender?: (string | null) | undefined, Ethnicity?: (string | null) | undefined, Nationality?: (string | null) | undefined, Religion?: (string | null) | undefined, LeaverReason?: (string | null) | undefined, MaritalStatus?: (string | null) | undefined, Phones?: (Array | null) | undefined, Emails?: (Array | null) | undefined, Addresses?: (Array
| null) | undefined, GenderIdentity?: (string | null) | undefined, WindowsUsername?: (string | null) | undefined}; export type UpdateApiEmployeesIdArgs = {id: string, body: UpdateEmployeeCommand}; export type UpdateApiEmployeesIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an Employee referenced by ID. * * PUT /employees/{id} */ export const updateApiEmployeesId = async (args: UpdateApiEmployeesIdArgs, options?: UpdateApiEmployeesIdOptions) => { 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(/\/+$/, '')}/employees/${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 };