/* 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 { LoanAccountSchedule } from '../models'; // @ts-ignore import type { PreviewLoanAccountSchedule } from '../models'; /** * LoanAccountSchedulePreviewApi - axios parameter creator */ export const LoanAccountSchedulePreviewApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Preview loan account schedule for non-existent loan account * @param {PreviewLoanAccountSchedule} previewLoanAccountSchedule Loan account parameters for a schedule to be previewed. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ getPreviewLoanAccountSchedule: async ( previewLoanAccountSchedule: PreviewLoanAccountSchedule, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'previewLoanAccountSchedule' is not null or undefined assertParamExists( 'getPreviewLoanAccountSchedule', 'previewLoanAccountSchedule', previewLoanAccountSchedule, ); const localVarPath = `/loans:previewSchedule`; // 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'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( previewLoanAccountSchedule, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * LoanAccountSchedulePreviewApi - functional programming interface */ export const LoanAccountSchedulePreviewApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = LoanAccountSchedulePreviewApiAxiosParamCreator(configuration); return { /** * * @summary Preview loan account schedule for non-existent loan account * @param {PreviewLoanAccountSchedule} previewLoanAccountSchedule Loan account parameters for a schedule to be previewed. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ async getPreviewLoanAccountSchedule( previewLoanAccountSchedule: PreviewLoanAccountSchedule, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getPreviewLoanAccountSchedule( previewLoanAccountSchedule, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap[ 'LoanAccountSchedulePreviewApi.getPreviewLoanAccountSchedule' ]?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * LoanAccountSchedulePreviewApi - factory interface */ export const LoanAccountSchedulePreviewApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = LoanAccountSchedulePreviewApiFp(configuration); return { /** * * @summary Preview loan account schedule for non-existent loan account * @param {PreviewLoanAccountSchedule} previewLoanAccountSchedule Loan account parameters for a schedule to be previewed. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ getPreviewLoanAccountSchedule( previewLoanAccountSchedule: PreviewLoanAccountSchedule, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getPreviewLoanAccountSchedule(previewLoanAccountSchedule, options) .then((request) => request(axios, basePath)); }, }; }; /** * LoanAccountSchedulePreviewApi - object-oriented interface */ export class LoanAccountSchedulePreviewApi extends BaseAPI { /** * * @summary Preview loan account schedule for non-existent loan account * @param {PreviewLoanAccountSchedule} previewLoanAccountSchedule Loan account parameters for a schedule to be previewed. * @param {*} [options] Override http request option. * @deprecated * @throws {RequiredError} */ public getPreviewLoanAccountSchedule( previewLoanAccountSchedule: PreviewLoanAccountSchedule, options?: RawAxiosRequestConfig, ) { return LoanAccountSchedulePreviewApiFp(this.configuration) .getPreviewLoanAccountSchedule(previewLoanAccountSchedule, options) .then((request) => request(this.axios, this.basePath)); } }