export type CreateApiMntfeeServicesV1MaintenancefeeBulkUploadArgs = {body: {file: string}}; export type CreateApiMntfeeServicesV1MaintenancefeeBulkUploadOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Uploads a bulk file for processing * * POST /mntfee-services/v1/maintenancefee/bulk/upload */ export const createApiMntfeeServicesV1MaintenancefeeBulkUpload = async (args: CreateApiMntfeeServicesV1MaintenancefeeBulkUploadArgs, options: CreateApiMntfeeServicesV1MaintenancefeeBulkUploadOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "text/plain") const url = `${baseUrl.replace(/\/+$/, '')}/mntfee-services/v1/maintenancefee/bulk/upload${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 res.text() };