/* tslint:disable */ /* eslint-disable */ /** * creditarrangements * 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 { AddCreditArrangementAccountInput } from '../models'; // @ts-ignore import type { CreditArrangement } from '../models'; // @ts-ignore import type { CreditArrangementAccounts } from '../models'; // @ts-ignore import type { CreditArrangementAction } from '../models'; // @ts-ignore import type { CreditArrangementSchedule } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { PatchOperation } from '../models'; // @ts-ignore import type { RemoveCreditArrangementAccountInput } from '../models'; /** * CreditArrangementsApi - axios parameter creator */ export const CreditArrangementsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Delete credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete: async ( creditArrangementId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists('_delete', 'creditArrangementId', creditArrangementId); const localVarPath = `/creditarrangements/{creditArrangementId}`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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 Add account to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be added. * @param {AddCreditArrangementAccountInput} addCreditArrangementAccountInput The account ID and type to be added to the credit arrangement. * @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} */ addAccount: async ( creditArrangementId: string, addCreditArrangementAccountInput: AddCreditArrangementAccountInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists( 'addAccount', 'creditArrangementId', creditArrangementId, ); // verify required parameter 'addCreditArrangementAccountInput' is not null or undefined assertParamExists( 'addAccount', 'addCreditArrangementAccountInput', addCreditArrangementAccountInput, ); const localVarPath = `/creditarrangements/{creditArrangementId}:addAccount`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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( addCreditArrangementAccountInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Change credit arrangement state * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangementAction} creditArrangementAction The state change to perform on the credit arrangement. * @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} */ changeState: async ( creditArrangementId: string, creditArrangementAction: CreditArrangementAction, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists( 'changeState', 'creditArrangementId', creditArrangementId, ); // verify required parameter 'creditArrangementAction' is not null or undefined assertParamExists( 'changeState', 'creditArrangementAction', creditArrangementAction, ); const localVarPath = `/creditarrangements/{creditArrangementId}:changeState`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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( creditArrangementAction, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Create credit arrangement * @param {CreditArrangement} creditArrangement Credit arrangement 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} */ create: async ( creditArrangement: CreditArrangement, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangement' is not null or undefined assertParamExists('create', 'creditArrangement', creditArrangement); const localVarPath = `/creditarrangements`; // 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( creditArrangement, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get credit arrangements * @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 {GetAllPaginationDetailsEnum} [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 {GetAllDetailsLevelEnum} [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 {string} [sortBy] The criteria based on which the records will be sorted. Expected format is <field:order>, for example, sortBy = field1:ASC,field2:DESC.<br/>Only the following fields can be used: creationDate,startDate,expireDate,amount<br/>Default sorting is done by startDate:DESC * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: async ( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, sortBy?: string, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/creditarrangements`; // 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 (offset !== undefined) { localVarQueryParameter['offset'] = offset; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (paginationDetails !== undefined) { localVarQueryParameter['paginationDetails'] = paginationDetails; } if (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } if (sortBy !== undefined) { localVarQueryParameter['sortBy'] = sortBy; } 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 all loan and deposit accounts linked to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllAccounts: async ( creditArrangementId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists( 'getAllAccounts', 'creditArrangementId', creditArrangementId, ); const localVarPath = `/creditarrangements/{creditArrangementId}/accounts`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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 Get credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetByIdDetailsLevelEnum} [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} */ getById: async ( creditArrangementId: string, detailsLevel?: GetByIdDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists('getById', 'creditArrangementId', creditArrangementId); const localVarPath = `/creditarrangements/{creditArrangementId}`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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 (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } 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 credit arrangement schedule * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetScheduleDetailsLevelEnum} [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} */ getSchedule: async ( creditArrangementId: string, detailsLevel?: GetScheduleDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists( 'getSchedule', 'creditArrangementId', creditArrangementId, ); const localVarPath = `/creditarrangements/{creditArrangementId}/schedule`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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 (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } 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 Partially update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patch: async ( creditArrangementId: string, patchOperation: Array, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists('patch', 'creditArrangementId', creditArrangementId); // verify required parameter 'patchOperation' is not null or undefined assertParamExists('patch', 'patchOperation', patchOperation); const localVarPath = `/creditarrangements/{creditArrangementId}`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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 Remove account from credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be removed. * @param {RemoveCreditArrangementAccountInput} removeCreditArrangementAccountInput The account ID and type to be removed from the credit arrangement. * @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} */ removeAccount: async ( creditArrangementId: string, removeCreditArrangementAccountInput: RemoveCreditArrangementAccountInput, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists( 'removeAccount', 'creditArrangementId', creditArrangementId, ); // verify required parameter 'removeCreditArrangementAccountInput' is not null or undefined assertParamExists( 'removeAccount', 'removeCreditArrangementAccountInput', removeCreditArrangementAccountInput, ); const localVarPath = `/creditarrangements/{creditArrangementId}:removeAccount`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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( removeCreditArrangementAccountInput, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangement} creditArrangement Credit arrangement to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update: async ( creditArrangementId: string, creditArrangement: CreditArrangement, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'creditArrangementId' is not null or undefined assertParamExists('update', 'creditArrangementId', creditArrangementId); // verify required parameter 'creditArrangement' is not null or undefined assertParamExists('update', 'creditArrangement', creditArrangement); const localVarPath = `/creditarrangements/{creditArrangementId}`.replace( `{${'creditArrangementId'}}`, encodeURIComponent(String(creditArrangementId)), ); // 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( creditArrangement, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * CreditArrangementsApi - functional programming interface */ export const CreditArrangementsApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = CreditArrangementsApiAxiosParamCreator(configuration); return { /** * * @summary Delete credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async _delete( creditArrangementId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator._delete( creditArrangementId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi._delete']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Add account to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be added. * @param {AddCreditArrangementAccountInput} addCreditArrangementAccountInput The account ID and type to be added to the credit arrangement. * @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 addAccount( creditArrangementId: string, addCreditArrangementAccountInput: AddCreditArrangementAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.addAccount( creditArrangementId, addCreditArrangementAccountInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.addAccount']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Change credit arrangement state * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangementAction} creditArrangementAction The state change to perform on the credit arrangement. * @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 changeState( creditArrangementId: string, creditArrangementAction: CreditArrangementAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.changeState( creditArrangementId, creditArrangementAction, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.changeState']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create credit arrangement * @param {CreditArrangement} creditArrangement Credit arrangement 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 create( creditArrangement: CreditArrangement, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.create( creditArrangement, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.create']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get credit arrangements * @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 {GetAllPaginationDetailsEnum} [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 {GetAllDetailsLevelEnum} [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 {string} [sortBy] The criteria based on which the records will be sorted. Expected format is <field:order>, for example, sortBy = field1:ASC,field2:DESC.<br/>Only the following fields can be used: creationDate,startDate,expireDate,amount<br/>Default sorting is done by startDate:DESC * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, sortBy?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAll( offset, limit, paginationDetails, detailsLevel, sortBy, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.getAll']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get all loan and deposit accounts linked to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllAccounts( creditArrangementId: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllAccounts( creditArrangementId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.getAllAccounts']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetByIdDetailsLevelEnum} [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 getById( creditArrangementId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getById( creditArrangementId, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.getById']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get credit arrangement schedule * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetScheduleDetailsLevelEnum} [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 getSchedule( creditArrangementId: string, detailsLevel?: GetScheduleDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getSchedule( creditArrangementId, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.getSchedule']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Partially update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async patch( creditArrangementId: string, patchOperation: Array, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.patch( creditArrangementId, patchOperation, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.patch']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Remove account from credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be removed. * @param {RemoveCreditArrangementAccountInput} removeCreditArrangementAccountInput The account ID and type to be removed from the credit arrangement. * @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 removeAccount( creditArrangementId: string, removeCreditArrangementAccountInput: RemoveCreditArrangementAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.removeAccount( creditArrangementId, removeCreditArrangementAccountInput, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.removeAccount']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangement} creditArrangement Credit arrangement to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async update( creditArrangementId: string, creditArrangement: CreditArrangement, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.update( creditArrangementId, creditArrangement, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CreditArrangementsApi.update']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * CreditArrangementsApi - factory interface */ export const CreditArrangementsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = CreditArrangementsApiFp(configuration); return { /** * * @summary Delete credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete( creditArrangementId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp ._delete(creditArrangementId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Add account to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be added. * @param {AddCreditArrangementAccountInput} addCreditArrangementAccountInput The account ID and type to be added to the credit arrangement. * @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} */ addAccount( creditArrangementId: string, addCreditArrangementAccountInput: AddCreditArrangementAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .addAccount( creditArrangementId, addCreditArrangementAccountInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Change credit arrangement state * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangementAction} creditArrangementAction The state change to perform on the credit arrangement. * @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} */ changeState( creditArrangementId: string, creditArrangementAction: CreditArrangementAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .changeState( creditArrangementId, creditArrangementAction, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Create credit arrangement * @param {CreditArrangement} creditArrangement Credit arrangement 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} */ create( creditArrangement: CreditArrangement, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .create(creditArrangement, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get credit arrangements * @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 {GetAllPaginationDetailsEnum} [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 {GetAllDetailsLevelEnum} [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 {string} [sortBy] The criteria based on which the records will be sorted. Expected format is <field:order>, for example, sortBy = field1:ASC,field2:DESC.<br/>Only the following fields can be used: creationDate,startDate,expireDate,amount<br/>Default sorting is done by startDate:DESC * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, sortBy?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAll(offset, limit, paginationDetails, detailsLevel, sortBy, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get all loan and deposit accounts linked to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllAccounts( creditArrangementId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getAllAccounts(creditArrangementId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetByIdDetailsLevelEnum} [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} */ getById( creditArrangementId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getById(creditArrangementId, detailsLevel, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get credit arrangement schedule * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetScheduleDetailsLevelEnum} [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} */ getSchedule( creditArrangementId: string, detailsLevel?: GetScheduleDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getSchedule(creditArrangementId, detailsLevel, options) .then((request) => request(axios, basePath)); }, /** * * @summary Partially update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patch( creditArrangementId: string, patchOperation: Array, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .patch(creditArrangementId, patchOperation, options) .then((request) => request(axios, basePath)); }, /** * * @summary Remove account from credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be removed. * @param {RemoveCreditArrangementAccountInput} removeCreditArrangementAccountInput The account ID and type to be removed from the credit arrangement. * @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} */ removeAccount( creditArrangementId: string, removeCreditArrangementAccountInput: RemoveCreditArrangementAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .removeAccount( creditArrangementId, removeCreditArrangementAccountInput, idempotencyKey, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangement} creditArrangement Credit arrangement to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update( creditArrangementId: string, creditArrangement: CreditArrangement, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .update(creditArrangementId, creditArrangement, options) .then((request) => request(axios, basePath)); }, }; }; /** * CreditArrangementsApi - object-oriented interface */ export class CreditArrangementsApi extends BaseAPI { /** * * @summary Delete credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public _delete(creditArrangementId: string, options?: RawAxiosRequestConfig) { return CreditArrangementsApiFp(this.configuration) ._delete(creditArrangementId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Add account to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be added. * @param {AddCreditArrangementAccountInput} addCreditArrangementAccountInput The account ID and type to be added to the credit arrangement. * @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 addAccount( creditArrangementId: string, addCreditArrangementAccountInput: AddCreditArrangementAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .addAccount( creditArrangementId, addCreditArrangementAccountInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Change credit arrangement state * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangementAction} creditArrangementAction The state change to perform on the credit arrangement. * @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 changeState( creditArrangementId: string, creditArrangementAction: CreditArrangementAction, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .changeState( creditArrangementId, creditArrangementAction, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create credit arrangement * @param {CreditArrangement} creditArrangement Credit arrangement 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 create( creditArrangement: CreditArrangement, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .create(creditArrangement, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get credit arrangements * @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 {GetAllPaginationDetailsEnum} [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 {GetAllDetailsLevelEnum} [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 {string} [sortBy] The criteria based on which the records will be sorted. Expected format is <field:order>, for example, sortBy = field1:ASC,field2:DESC.<br/>Only the following fields can be used: creationDate,startDate,expireDate,amount<br/>Default sorting is done by startDate:DESC * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, sortBy?: string, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .getAll(offset, limit, paginationDetails, detailsLevel, sortBy, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get all loan and deposit accounts linked to credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAllAccounts( creditArrangementId: string, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .getAllAccounts(creditArrangementId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetByIdDetailsLevelEnum} [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 getById( creditArrangementId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .getById(creditArrangementId, detailsLevel, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get credit arrangement schedule * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be returned. * @param {GetScheduleDetailsLevelEnum} [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 getSchedule( creditArrangementId: string, detailsLevel?: GetScheduleDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .getSchedule(creditArrangementId, detailsLevel, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Partially update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public patch( creditArrangementId: string, patchOperation: Array, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .patch(creditArrangementId, patchOperation, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Remove account from credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement for an account to be removed. * @param {RemoveCreditArrangementAccountInput} removeCreditArrangementAccountInput The account ID and type to be removed from the credit arrangement. * @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 removeAccount( creditArrangementId: string, removeCreditArrangementAccountInput: RemoveCreditArrangementAccountInput, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .removeAccount( creditArrangementId, removeCreditArrangementAccountInput, idempotencyKey, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update credit arrangement * @param {string} creditArrangementId The ID or encoded key of the credit arrangement to be updated. * @param {CreditArrangement} creditArrangement Credit arrangement to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public update( creditArrangementId: string, creditArrangement: CreditArrangement, options?: RawAxiosRequestConfig, ) { return CreditArrangementsApiFp(this.configuration) .update(creditArrangementId, creditArrangement, options) .then((request) => request(this.axios, this.basePath)); } } export const GetAllPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type GetAllPaginationDetailsEnum = (typeof GetAllPaginationDetailsEnum)[keyof typeof GetAllPaginationDetailsEnum]; export const GetAllDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetAllDetailsLevelEnum = (typeof GetAllDetailsLevelEnum)[keyof typeof GetAllDetailsLevelEnum]; export const GetByIdDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetByIdDetailsLevelEnum = (typeof GetByIdDetailsLevelEnum)[keyof typeof GetByIdDetailsLevelEnum]; export const GetScheduleDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetScheduleDetailsLevelEnum = (typeof GetScheduleDetailsLevelEnum)[keyof typeof GetScheduleDetailsLevelEnum];