export type GetApiApiV1CompensationTotalRewardsEmployeeIdArgs = {employeeId: string}; export type GetApiApiV1CompensationTotalRewardsEmployeeIdOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Check Total Rewards Profile Availability * * GET /api/v1/compensation/total_rewards/{employeeId} */ export const getApiApiV1CompensationTotalRewardsEmployeeId = async (args: GetApiApiV1CompensationTotalRewardsEmployeeIdArgs, options?: GetApiApiV1CompensationTotalRewardsEmployeeIdOptions) => { const {baseUrl = "https://companySubDomain.bamboohr.com", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/compensation/total_rewards/${encodeURIComponent(String(args.employeeId))}${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 };