export type GetApiEmployeesArgs = {companyID: string, onboarded?: boolean | undefined, employment_status?: string | undefined, title?: string | undefined, dob?: string | undefined, start_date?: string | undefined, email?: string | undefined, phone_number?: string | undefined, default_pay_schedule?: string | undefined, is_943?: boolean | undefined, is_scheduleH?: boolean | undefined, external_id?: string | undefined, workLocationID?: string | undefined}; export type GetApiEmployeesOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Employees * * GET /employees */ export const getApiEmployees = async (args: GetApiEmployeesArgs, options?: GetApiEmployeesOptions) => { const {baseUrl = "https://api.zeal.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.companyID != null) query.append("companyID", String(args.companyID)) if (args.onboarded != null) query.append("onboarded", String(args.onboarded)) if (args.employment_status != null) query.append("employment_status", String(args.employment_status)) if (args.title != null) query.append("title", String(args.title)) if (args.dob != null) query.append("dob", String(args.dob)) if (args.start_date != null) query.append("start_date", String(args.start_date)) if (args.email != null) query.append("email", String(args.email)) if (args.phone_number != null) query.append("phone_number", String(args.phone_number)) if (args.default_pay_schedule != null) query.append("default_pay_schedule", String(args.default_pay_schedule)) if (args.is_943 != null) query.append("is_943", String(args.is_943)) if (args.is_scheduleH != null) query.append("is_scheduleH", String(args.is_scheduleH)) if (args.external_id != null) query.append("external_id", String(args.external_id)) if (args.workLocationID != null) query.append("workLocationID", String(args.workLocationID)) if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/employees${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) 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 };