export type InitializeProforma = {proformaType?: ('WithSalaryResultsWithSalaryVariables' | 'WithSalaryResultsWithoutSalaryVariables' | 'WithoutSalaryResultsWithSalaryVariables' | 'WithoutSalaryResultsWithoutSalaryVariables' | 'WithoutEmployments') | undefined, employeeId?: (string | null) | undefined}; export type CreateApiV2ProvidersEmployersEmployerIdProformaInitializeArgs = {employerId: string, Authorization: string, Accept: string, body: InitializeProforma}; export type CreateApiV2ProvidersEmployersEmployerIdProformaInitializeOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Initialize the proforma environment * * POST /v2/providers/employers/{employerId}/proforma/initialize */ export const createApiV2ProvidersEmployersEmployerIdProformaInitialize = async (args: CreateApiV2ProvidersEmployersEmployerIdProformaInitializeArgs, options?: CreateApiV2ProvidersEmployersEmployerIdProformaInitializeOptions) => { const {baseUrl = "https://api.loket.nl", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json;version=2018-01-01") if (args.Authorization != null) headers.set("Authorization", String(args.Authorization)) if (args.Accept != null) headers.set("Accept", String(args.Accept)) const url = `${baseUrl.replace(/\/+$/, '')}/v2/providers/employers/${encodeURIComponent(String(args.employerId))}/proforma/initialize${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };