/* tslint:disable */ /* eslint-disable */ /** * loans * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * LoanAccountDocumentsApi - axios parameter creator */ export const LoanAccountDocumentsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Get loan account document * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLoanAccountDocument: async ( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists( 'getLoanAccountDocument', 'loanAccountId', loanAccountId, ); // verify required parameter 'templateId' is not null or undefined assertParamExists('getLoanAccountDocument', 'templateId', templateId); const localVarPath = `/loans/{loanAccountId}/templates/{templateId}` .replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ) .replace(`{${'templateId'}}`, encodeURIComponent(String(templateId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (startDate !== undefined) { localVarQueryParameter['startDate'] = (startDate as any) instanceof Date ? (startDate as any).toISOString().substring(0, 10) : startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = (endDate as any) instanceof Date ? (endDate as any).toISOString().substring(0, 10) : endDate; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Download loan account document PDF * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPdfDocument: async ( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('getPdfDocument', 'loanAccountId', loanAccountId); // verify required parameter 'templateId' is not null or undefined assertParamExists('getPdfDocument', 'templateId', templateId); const localVarPath = `/loans/{loanAccountId}/templates/{templateId}/pdf` .replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ) .replace(`{${'templateId'}}`, encodeURIComponent(String(templateId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); if (startDate !== undefined) { localVarQueryParameter['startDate'] = (startDate as any) instanceof Date ? (startDate as any).toISOString().substring(0, 10) : startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = (endDate as any) instanceof Date ? (endDate as any).toISOString().substring(0, 10) : endDate; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+file'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * LoanAccountDocumentsApi - functional programming interface */ export const LoanAccountDocumentsApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = LoanAccountDocumentsApiAxiosParamCreator(configuration); return { /** * * @summary Get loan account document * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getLoanAccountDocument( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getLoanAccountDocument( loanAccountId, templateId, startDate, endDate, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountDocumentsApi.getLoanAccountDocument']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Download loan account document PDF * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPdfDocument( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getPdfDocument( loanAccountId, templateId, startDate, endDate, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountDocumentsApi.getPdfDocument']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * LoanAccountDocumentsApi - factory interface */ export const LoanAccountDocumentsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = LoanAccountDocumentsApiFp(configuration); return { /** * * @summary Get loan account document * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLoanAccountDocument( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getLoanAccountDocument( loanAccountId, templateId, startDate, endDate, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Download loan account document PDF * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPdfDocument( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getPdfDocument(loanAccountId, templateId, startDate, endDate, options) .then((request) => request(axios, basePath)); }, }; }; /** * LoanAccountDocumentsApi - object-oriented interface */ export class LoanAccountDocumentsApi extends BaseAPI { /** * * @summary Get loan account document * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getLoanAccountDocument( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ) { return LoanAccountDocumentsApiFp(this.configuration) .getLoanAccountDocument( loanAccountId, templateId, startDate, endDate, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Download loan account document PDF * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} templateId The ID of the loan product template. * @param {string} [startDate] The first date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {string} [endDate] The last date to consider when the document contains a list of transactions. Required when the document contains a transaction history. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getPdfDocument( loanAccountId: string, templateId: string, startDate?: string, endDate?: string, options?: RawAxiosRequestConfig, ) { return LoanAccountDocumentsApiFp(this.configuration) .getPdfDocument(loanAccountId, templateId, startDate, endDate, options) .then((request) => request(this.axios, this.basePath)); } }