export type GetApiEmployeeTaxParamsEmployeeIdArgs = {employee_id: string, as_of?: string | undefined, jurisdiction?: string | undefined, submitter?: string | undefined, tax_id?: string | undefined}; export type GetApiEmployeeTaxParamsEmployeeIdOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * List an employee's tax parameters * * GET /employee_tax_params/{employee_id} */ export const getApiEmployeeTaxParamsEmployeeId = async (args: GetApiEmployeeTaxParamsEmployeeIdArgs, options?: GetApiEmployeeTaxParamsEmployeeIdOptions) => { const {baseUrl = "https://sandbox.checkhq.com", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.as_of != null) query.append("as_of", String(args.as_of)) if (args.jurisdiction != null) query.append("jurisdiction", String(args.jurisdiction)) if (args.submitter != null) query.append("submitter", String(args.submitter)) if (args.tax_id != null) query.append("tax_id", String(args.tax_id)) if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/employee_tax_params/${encodeURIComponent(String(args.employee_id))}${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 };