export type GetApiApiV1CompensationTotalRewardsEmployeeIdPrintableArgs = {employeeId: string, multiplier?: number | undefined, year?: number | undefined}; export type GetApiApiV1CompensationTotalRewardsEmployeeIdPrintableOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Printable Total Rewards Statement * * GET /api/v1/compensation/total_rewards/{employeeId}/printable */ export const getApiApiV1CompensationTotalRewardsEmployeeIdPrintable = async (args: GetApiApiV1CompensationTotalRewardsEmployeeIdPrintableArgs, options?: GetApiApiV1CompensationTotalRewardsEmployeeIdPrintableOptions) => { const {baseUrl = "https://companySubDomain.bamboohr.com", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/pdf") if (args.multiplier != null) query.append("multiplier", String(args.multiplier)) if (args.year != null) query.append("year", String(args.year)) if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/compensation/total_rewards/${encodeURIComponent(String(args.employeeId))}/printable${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 res.blob() };