export type BankAddress = {Address1?: (string | null) | undefined, Address2?: (string | null) | undefined, Address3?: (string | null) | undefined, Address4?: (string | null) | undefined, PostCode?: (string | null) | undefined}; export type UpdateBankDetailsCommand = {BankName?: (string | null) | undefined, BankAddress?: BankAddress | undefined, AccountName?: (string | null) | undefined, AccountNumber?: (string | null) | undefined, SortCode?: (string | null) | undefined, RollNumber?: (string | null) | undefined}; export type UpdateApiBankdetailsIdArgs = {id: string, body: UpdateBankDetailsCommand}; export type UpdateApiBankdetailsIdOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Updates Bank Details. * * PUT /bankdetails/{id} */ export const updateApiBankdetailsId = async (args: UpdateApiBankdetailsIdArgs, options?: UpdateApiBankdetailsIdOptions) => { 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(/\/+$/, '')}/bankdetails/${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 };