export type GetApiApiV1CompensationBenchmarksDetailsExportArgs = {jobId: string, locationId?: string | undefined}; export type GetApiApiV1CompensationBenchmarksDetailsExportOptions = {baseUrl?: string | undefined, oauth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Export Compensation Benchmark Details * * GET /api/v1/compensation/benchmarks/details/export */ export const getApiApiV1CompensationBenchmarksDetailsExport = async (args: GetApiApiV1CompensationBenchmarksDetailsExportArgs, options?: GetApiApiV1CompensationBenchmarksDetailsExportOptions) => { const {baseUrl = "https://companySubDomain.bamboohr.com", fetch: fetchFn = fetch, oauth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "text/csv") if (args.jobId != null) query.append("jobId", String(args.jobId)) if (args.locationId != null) query.append("locationId", String(args.locationId)) if (oauth !== undefined) headers.set('authorization', `Bearer ${oauth}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/compensation/benchmarks/details/export${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.text() };