export type UpdateApiV1EmployeesEmployeeIdArgs = {employee_id: string, expand?: unknown | undefined, body: {raw_body?: unknown | undefined}}; export type UpdateApiV1EmployeesEmployeeIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update employee of the center with given catalog details * * PUT /v1/employees/{employee_id} */ export const updateApiV1EmployeesEmployeeId = async (args: UpdateApiV1EmployeesEmployeeIdArgs, options?: UpdateApiV1EmployeesEmployeeIdOptions) => { const {baseUrl = "https://api.zenoti.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args.expand != null) query.append("expand", String(args.expand)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/employees/${encodeURIComponent(String(args.employee_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 (await res.json()) as unknown };