export type GetApiMntfeeServicesV2MaintenancefeeStatementPdfArgs = {patentNumber?: string | undefined, applicationNumber?: string | undefined, transactionId?: string | undefined}; export type GetApiMntfeeServicesV2MaintenancefeeStatementPdfOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Generates a PDF document for the given patent number, application number, and transaction id * * GET /mntfee-services/v2/maintenancefee/statement/pdf */ export const getApiMntfeeServicesV2MaintenancefeeStatementPdf = async (args: GetApiMntfeeServicesV2MaintenancefeeStatementPdfArgs, options: GetApiMntfeeServicesV2MaintenancefeeStatementPdfOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.patentNumber != null) query.append("patentNumber", String(args.patentNumber)) if (args.applicationNumber != null) query.append("applicationNumber", String(args.applicationNumber)) if (args.transactionId != null) query.append("transactionId", String(args.transactionId)) const url = `${baseUrl.replace(/\/+$/, '')}/mntfee-services/v2/maintenancefee/statement/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() };