export type GetApiV1PayrollsPayrollIdEmployeesEmployeeIdPayStubArgs = {'X-Gusto-API-Version'?: '2026-06-15' | undefined, payroll_id: string, employee_id: string}; export type GetApiV1PayrollsPayrollIdEmployeesEmployeeIdPayStubOptions = {baseUrl?: string | undefined, CompanyAccessAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get an employee pay stub (pdf) * * GET /v1/payrolls/{payroll_id}/employees/{employee_id}/pay_stub */ export const getApiV1PayrollsPayrollIdEmployeesEmployeeIdPayStub = async (args: GetApiV1PayrollsPayrollIdEmployeesEmployeeIdPayStubArgs, options?: GetApiV1PayrollsPayrollIdEmployeesEmployeeIdPayStubOptions) => { const {baseUrl = "https://api.gusto-demo.com", fetch: fetchFn = fetch, CompanyAccessAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Gusto-API-Version'] != null) headers.set("X-Gusto-API-Version", String(args['X-Gusto-API-Version'])) if (CompanyAccessAuth !== undefined) headers.set('authorization', `Bearer ${CompanyAccessAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/payrolls/${encodeURIComponent(String(args.payroll_id))}/employees/${encodeURIComponent(String(args.employee_id))}/pay_stub${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 undefined };