/* 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 { InvestorFund } from '../models'; // @ts-ignore import type { PatchOperation } from '../models'; /** * LoanAccountFundingApi - axios parameter creator */ export const LoanAccountFundingApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Create funding sources for a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to create for loan account. * @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} */ createLoanAccountFundingSources: async ( loanAccountId: string, investorFund: Array, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists( 'createLoanAccountFundingSources', 'loanAccountId', loanAccountId, ); // verify required parameter 'investorFund' is not null or undefined assertParamExists( 'createLoanAccountFundingSources', 'investorFund', investorFund, ); const localVarPath = `/loans/{loanAccountId}/funding`.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( investorFund, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Delete loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteFundingSources: async ( loanAccountId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('deleteFundingSources', 'loanAccountId', loanAccountId); const localVarPath = `/loans/{loanAccountId}/funding`.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: '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 Delete loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteSingleFundingSource: async ( loanAccountId: string, fundEncodedKey: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists( 'deleteSingleFundingSource', 'loanAccountId', loanAccountId, ); // verify required parameter 'fundEncodedKey' is not null or undefined assertParamExists( 'deleteSingleFundingSource', 'fundEncodedKey', fundEncodedKey, ); const localVarPath = `/loans/{loanAccountId}/funding/{fundEncodedKey}` .replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ) .replace( `{${'fundEncodedKey'}}`, encodeURIComponent(String(fundEncodedKey)), ); // 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 Update loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchFundingSource: async ( loanAccountId: string, fundEncodedKey: string, patchOperation: Array, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists('patchFundingSource', 'loanAccountId', loanAccountId); // verify required parameter 'fundEncodedKey' is not null or undefined assertParamExists('patchFundingSource', 'fundEncodedKey', fundEncodedKey); // verify required parameter 'patchOperation' is not null or undefined assertParamExists('patchFundingSource', 'patchOperation', patchOperation); const localVarPath = `/loans/{loanAccountId}/funding/{fundEncodedKey}` .replace( `{${'loanAccountId'}}`, encodeURIComponent(String(loanAccountId)), ) .replace( `{${'fundEncodedKey'}}`, encodeURIComponent(String(fundEncodedKey)), ); // 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: 'PATCH', ...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( patchOperation, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to update the loan account with. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLoanAccountFundingSources: async ( loanAccountId: string, investorFund: Array, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountId' is not null or undefined assertParamExists( 'updateLoanAccountFundingSources', 'loanAccountId', loanAccountId, ); // verify required parameter 'investorFund' is not null or undefined assertParamExists( 'updateLoanAccountFundingSources', 'investorFund', investorFund, ); const localVarPath = `/loans/{loanAccountId}/funding`.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( investorFund, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * LoanAccountFundingApi - functional programming interface */ export const LoanAccountFundingApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = LoanAccountFundingApiAxiosParamCreator(configuration); return { /** * * @summary Create funding sources for a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to create for loan account. * @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 createLoanAccountFundingSources( loanAccountId: string, investorFund: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.createLoanAccountFundingSources( loanAccountId, investorFund, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ 'LoanAccountFundingApi.createLoanAccountFundingSources' ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Delete loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteFundingSources( loanAccountId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteFundingSources( loanAccountId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountFundingApi.deleteFundingSources']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Delete loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteSingleFundingSource( loanAccountId: string, fundEncodedKey: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteSingleFundingSource( loanAccountId, fundEncodedKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountFundingApi.deleteSingleFundingSource']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async patchFundingSource( loanAccountId: string, fundEncodedKey: string, patchOperation: Array, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.patchFundingSource( loanAccountId, fundEncodedKey, patchOperation, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountFundingApi.patchFundingSource']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to update the loan account with. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateLoanAccountFundingSources( loanAccountId: string, investorFund: Array, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.updateLoanAccountFundingSources( loanAccountId, investorFund, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ 'LoanAccountFundingApi.updateLoanAccountFundingSources' ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * LoanAccountFundingApi - factory interface */ export const LoanAccountFundingApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = LoanAccountFundingApiFp(configuration); return { /** * * @summary Create funding sources for a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to create for loan account. * @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} */ createLoanAccountFundingSources( loanAccountId: string, investorFund: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .createLoanAccountFundingSources( loanAccountId, investorFund, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Delete loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteFundingSources( loanAccountId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .deleteFundingSources(loanAccountId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Delete loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteSingleFundingSource( loanAccountId: string, fundEncodedKey: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .deleteSingleFundingSource(loanAccountId, fundEncodedKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Update loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patchFundingSource( loanAccountId: string, fundEncodedKey: string, patchOperation: Array, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .patchFundingSource( loanAccountId, fundEncodedKey, patchOperation, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Update loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to update the loan account with. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateLoanAccountFundingSources( loanAccountId: string, investorFund: Array, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .updateLoanAccountFundingSources(loanAccountId, investorFund, options) .then((request) => request(axios, basePath)); }, }; }; /** * LoanAccountFundingApi - object-oriented interface */ export class LoanAccountFundingApi extends BaseAPI { /** * * @summary Create funding sources for a loan account * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to create for loan account. * @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 createLoanAccountFundingSources( loanAccountId: string, investorFund: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return LoanAccountFundingApiFp(this.configuration) .createLoanAccountFundingSources( loanAccountId, investorFund, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deleteFundingSources( loanAccountId: string, options?: RawAxiosRequestConfig, ) { return LoanAccountFundingApiFp(this.configuration) .deleteFundingSources(loanAccountId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deleteSingleFundingSource( loanAccountId: string, fundEncodedKey: string, options?: RawAxiosRequestConfig, ) { return LoanAccountFundingApiFp(this.configuration) .deleteSingleFundingSource(loanAccountId, fundEncodedKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update loan account funding source * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {string} fundEncodedKey The encoded key of the funding source. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public patchFundingSource( loanAccountId: string, fundEncodedKey: string, patchOperation: Array, options?: RawAxiosRequestConfig, ) { return LoanAccountFundingApiFp(this.configuration) .patchFundingSource( loanAccountId, fundEncodedKey, patchOperation, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update loan account funding sources * @param {string} loanAccountId The ID or encoded key of the loan account. * @param {Array} investorFund The funding sources to update the loan account with. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public updateLoanAccountFundingSources( loanAccountId: string, investorFund: Array, options?: RawAxiosRequestConfig, ) { return LoanAccountFundingApiFp(this.configuration) .updateLoanAccountFundingSources(loanAccountId, investorFund, options) .then((request) => request(this.axios, this.basePath)); } }