/* 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 { LoanAccount } from '../models'; // @ts-ignore import type { LoanAccountSearchCriteria } from '../models'; /** * LoanAccountsSearchApi - axios parameter creator */ export const LoanAccountsSearchApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Search loan accounts * @param {LoanAccountSearchCriteria} loanAccountSearchCriteria Criteria to be used to search the loan accounts. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search: async ( loanAccountSearchCriteria: LoanAccountSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'loanAccountSearchCriteria' is not null or undefined assertParamExists( 'search', 'loanAccountSearchCriteria', loanAccountSearchCriteria, ); const localVarPath = `/loans:search`; // 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); if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } 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( loanAccountSearchCriteria, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * LoanAccountsSearchApi - functional programming interface */ export const LoanAccountsSearchApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = LoanAccountsSearchApiAxiosParamCreator(configuration); return { /** * * @summary Search loan accounts * @param {LoanAccountSearchCriteria} loanAccountSearchCriteria Criteria to be used to search the loan accounts. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async search( loanAccountSearchCriteria: LoanAccountSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.search( loanAccountSearchCriteria, offset, limit, paginationDetails, cursor, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['LoanAccountsSearchApi.search']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * LoanAccountsSearchApi - factory interface */ export const LoanAccountsSearchApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = LoanAccountsSearchApiFp(configuration); return { /** * * @summary Search loan accounts * @param {LoanAccountSearchCriteria} loanAccountSearchCriteria Criteria to be used to search the loan accounts. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ search( loanAccountSearchCriteria: LoanAccountSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .search( loanAccountSearchCriteria, offset, limit, paginationDetails, cursor, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * LoanAccountsSearchApi - object-oriented interface */ export class LoanAccountsSearchApi extends BaseAPI { /** * * @summary Search loan accounts * @param {LoanAccountSearchCriteria} loanAccountSearchCriteria Criteria to be used to search the loan accounts. * @param {number} [offset] Pagination, index to start searching at when retrieving elements, used in combination with limit to paginate results * @param {number} [limit] Pagination, the number of elements to retrieve, used in combination with offset to paginate results * @param {SearchPaginationDetailsEnum} [paginationDetails] Flag specifying whether the pagination details should be provided in response headers. Please note that by default it is disabled (OFF), in order to improve the performance of the APIs * @param {string} [cursor] Pagination, cursor to start searching at when retrieving elements, used in combination with limit to paginate results * @param {SearchDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public search( loanAccountSearchCriteria: LoanAccountSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, cursor?: string, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return LoanAccountsSearchApiFp(this.configuration) .search( loanAccountSearchCriteria, offset, limit, paginationDetails, cursor, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } } export const SearchPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type SearchPaginationDetailsEnum = (typeof SearchPaginationDetailsEnum)[keyof typeof SearchPaginationDetailsEnum]; export const SearchDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type SearchDetailsLevelEnum = (typeof SearchDetailsLevelEnum)[keyof typeof SearchDetailsLevelEnum];