export type GetApiLumabotFlowsLumabotFlowIdPdfArgs = {lumabotFlowId: string}; export type GetApiLumabotFlowsLumabotFlowIdPdfOptions = {baseUrl?: string | undefined, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get responses of a lumabotFlow in PDF format. * * GET /lumabotFlows/{lumabotFlowId}/pdf */ export const getApiLumabotFlowsLumabotFlowIdPdf = async (args: GetApiLumabotFlowsLumabotFlowIdPdfArgs, options?: GetApiLumabotFlowsLumabotFlowIdPdfOptions) => { const {baseUrl = "https://api.lumahealth.io/api/v2", fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/pdf") if (Bearer !== undefined) headers.set('authorization', `Bearer ${Bearer}`) const url = `${baseUrl.replace(/\/+$/, '')}/lumabotFlows/${encodeURIComponent(String(args.lumabotFlowId))}/pdf${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() };