/* 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'; // @ts-ignore import type { LoanTransaction } from '../models'; // @ts-ignore import type { PlannedFeeKeys } from '../models'; // @ts-ignore import type { PlannedInstallmentFee } from '../models'; /** * LoanAccountPlannedFeesApi - axios parameter creator */ export const LoanAccountPlannedFeesApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary ApplY planned fees from the past installments, as backdated or from future installments, on the first pending installment * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PlannedFeeKeys} plannedFeeKeys List of all loan account\'s planned installment fees to be applied. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyPlannedFees: async ( loanAccountId: string, plannedFeeKeys: PlannedFeeKeys, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('applyPlannedFees', 'loanAccountId', loanAccountId); // verify required parameter 'plannedFeeKeys' is not null or undefined assertParamExists('applyPlannedFees', 'plannedFeeKeys', plannedFeeKeys); const localVarPath = `/loans/{loanAccountId}/plannedfees:apply`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // 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: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( plannedFeeKeys, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Create planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPlannedFees: async ( loanAccountId: string, plannedInstallmentFee: Array, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('createPlannedFees', 'loanAccountId', loanAccountId); // verify required parameter 'plannedInstallmentFee' is not null or undefined assertParamExists( 'createPlannedFees', 'plannedInstallmentFee', plannedInstallmentFee, ); const localVarPath = `/loans/{loanAccountId}/plannedfees`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // 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: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( plannedInstallmentFee, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Delete planned fee * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} plannedInstallmentFeeKey The encoded key of the planned installment fee to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deletePlannedFees: async ( loanAccountId: string, plannedInstallmentFeeKey: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('deletePlannedFees', 'loanAccountId', loanAccountId); // verify required parameter 'plannedInstallmentFeeKey' is not null or undefined assertParamExists( 'deletePlannedFees', 'plannedInstallmentFeeKey', plannedInstallmentFeeKey, ); const localVarPath = `/loans/{loanAccountId}/plannedfees/{plannedInstallmentFeeKey}` .replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ) .replace( `{${'plannedInstallmentFeeKey'}}`, encodeURIComponent(String(plannedInstallmentFeeKey)), ); // 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: 'DELETE', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); 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 Get planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllPlannedFees: async ( loanAccountId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('getAllPlannedFees', 'loanAccountId', loanAccountId); const localVarPath = `/loans/{loanAccountId}/plannedfees`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // 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); 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 Update planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be updated. Installment key should be used for identification. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updatePlannedFees: async ( loanAccountId: string, plannedInstallmentFee: Array, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('updatePlannedFees', 'loanAccountId', loanAccountId); // verify required parameter 'plannedInstallmentFee' is not null or undefined assertParamExists( 'updatePlannedFees', 'plannedInstallmentFee', plannedInstallmentFee, ); const localVarPath = `/loans/{loanAccountId}/plannedfees`.replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ); // 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: 'PUT', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( plannedInstallmentFee, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * LoanAccountPlannedFeesApi - functional programming interface */ export const LoanAccountPlannedFeesApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = LoanAccountPlannedFeesApiAxiosParamCreator(configuration); return { /** * * @summary ApplY planned fees from the past installments, as backdated or from future installments, on the first pending installment * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PlannedFeeKeys} plannedFeeKeys List of all loan account\'s planned installment fees to be applied. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async applyPlannedFees( loanAccountId: string, plannedFeeKeys: PlannedFeeKeys, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.applyPlannedFees( loanAccountId, plannedFeeKeys, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountPlannedFeesApi.applyPlannedFees']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createPlannedFees( loanAccountId: string, plannedInstallmentFee: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.createPlannedFees( loanAccountId, plannedInstallmentFee, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountPlannedFeesApi.createPlannedFees']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Delete planned fee * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} plannedInstallmentFeeKey The encoded key of the planned installment fee to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deletePlannedFees( loanAccountId: string, plannedInstallmentFeeKey: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.deletePlannedFees( loanAccountId, plannedInstallmentFeeKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountPlannedFeesApi.deletePlannedFees']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllPlannedFees( loanAccountId: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllPlannedFees( loanAccountId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountPlannedFeesApi.getAllPlannedFees']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be updated. Installment key should be used for identification. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updatePlannedFees( loanAccountId: string, plannedInstallmentFee: Array, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.updatePlannedFees( loanAccountId, plannedInstallmentFee, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountPlannedFeesApi.updatePlannedFees']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * LoanAccountPlannedFeesApi - factory interface */ export const LoanAccountPlannedFeesApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = LoanAccountPlannedFeesApiFp(configuration); return { /** * * @summary ApplY planned fees from the past installments, as backdated or from future installments, on the first pending installment * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PlannedFeeKeys} plannedFeeKeys List of all loan account\'s planned installment fees to be applied. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ applyPlannedFees( loanAccountId: string, plannedFeeKeys: PlannedFeeKeys, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .applyPlannedFees( loanAccountId, plannedFeeKeys, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Create planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createPlannedFees( loanAccountId: string, plannedInstallmentFee: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .createPlannedFees( loanAccountId, plannedInstallmentFee, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Delete planned fee * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} plannedInstallmentFeeKey The encoded key of the planned installment fee to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deletePlannedFees( loanAccountId: string, plannedInstallmentFeeKey: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .deletePlannedFees(loanAccountId, plannedInstallmentFeeKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllPlannedFees( loanAccountId: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAllPlannedFees(loanAccountId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Update planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be updated. Installment key should be used for identification. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updatePlannedFees( loanAccountId: string, plannedInstallmentFee: Array, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .updatePlannedFees(loanAccountId, plannedInstallmentFee, options) .then((request) => request(axios, basePath)); }, }; }; /** * LoanAccountPlannedFeesApi - object-oriented interface */ export class LoanAccountPlannedFeesApi extends BaseAPI { /** * * @summary ApplY planned fees from the past installments, as backdated or from future installments, on the first pending installment * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {PlannedFeeKeys} plannedFeeKeys List of all loan account\'s planned installment fees to be applied. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public applyPlannedFees( loanAccountId: string, plannedFeeKeys: PlannedFeeKeys, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanAccountPlannedFeesApiFp(this.configuration) .applyPlannedFees(loanAccountId, plannedFeeKeys, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createPlannedFees( loanAccountId: string, plannedInstallmentFee: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanAccountPlannedFeesApiFp(this.configuration) .createPlannedFees( loanAccountId, plannedInstallmentFee, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete planned fee * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} plannedInstallmentFeeKey The encoded key of the planned installment fee to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deletePlannedFees( loanAccountId: string, plannedInstallmentFeeKey: string, options?: RawAxiosRequestConfig, ) { return LoanAccountPlannedFeesApiFp(this.configuration) .deletePlannedFees(loanAccountId, plannedInstallmentFeeKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAllPlannedFees( loanAccountId: string, options?: RawAxiosRequestConfig, ) { return LoanAccountPlannedFeesApiFp(this.configuration) .getAllPlannedFees(loanAccountId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update planned fees * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} plannedInstallmentFee List of all loan account\'s planned installment fees to be updated. Installment key should be used for identification. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public updatePlannedFees( loanAccountId: string, plannedInstallmentFee: Array, options?: RawAxiosRequestConfig, ) { return LoanAccountPlannedFeesApiFp(this.configuration) .updatePlannedFees(loanAccountId, plannedInstallmentFee, options) .then((request) => request(this.axios, this.basePath)); } }