export type PatchApiEmployeesEmployeeCOPYArgs = {employee: string, body: {first_name?: string | undefined, middle_name?: string | undefined, last_name?: string | undefined, email?: string | undefined, dob?: string | undefined, residence?: ({line1: string, line2?: string | undefined, city: string, state: string, postal_code: string, country?: string | undefined}) | undefined, start_date?: string | undefined, termination_date?: string | undefined, default_net_pay_split?: string | undefined, workplaces?: Array | undefined, primary_workplace?: string | undefined, ssn?: string | undefined, payment_method_preference?: string | undefined, active?: boolean | undefined, w2_electronic_consent_provided?: boolean | undefined, metadata?: unknown | undefined}}; export type PatchApiEmployeesEmployeeCOPYOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an employee * * PATCH /employees/{employee} (COPY) */ export const patchApiEmployeesEmployeeCOPY = async (args: PatchApiEmployeesEmployeeCOPYArgs, options?: PatchApiEmployeesEmployeeCOPYOptions) => { const {baseUrl = "https://sandbox.checkhq.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/employees/${encodeURIComponent(String(args.employee))} (COPY)${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 (await res.json()) as unknown };