export type GetApiMntfeeServicesV2MaintenancefeeBulkExportArgs = {fileId?: number | undefined}; export type GetApiMntfeeServicesV2MaintenancefeeBulkExportOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Generates a CSV file containing all the lines errors in the given bulk file * * GET /mntfee-services/v2/maintenancefee/bulk/export */ export const getApiMntfeeServicesV2MaintenancefeeBulkExport = async (args: GetApiMntfeeServicesV2MaintenancefeeBulkExportArgs, options: GetApiMntfeeServicesV2MaintenancefeeBulkExportOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.fileId != null) query.append("fileId", String(args.fileId)) const url = `${baseUrl.replace(/\/+$/, '')}/mntfee-services/v2/maintenancefee/bulk/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.blob() };