/* tslint:disable */ /* eslint-disable */ /** * configuration/customfields * 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 { CustomFieldsConfiguration } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * CustomFieldsConfigurationApi - axios parameter creator */ export const CustomFieldsConfigurationApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Get custom field definitions configuration * @param {Array} [availableFor] The entity type of the custom field sets to be returned. If it is used multiple times, it will return all the custom field sets of all the specified entity types. If the parameter is absent, all the custom field sets will be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ get: async ( availableFor?: Array, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/configuration/customfields.yaml`; // 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 (availableFor) { localVarQueryParameter['availableFor'] = availableFor; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+yaml'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get custom field definitions configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTemplate: async ( options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/configuration/customfields/template.yaml`; // 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+yaml'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update custom field definitions configuration * @param {boolean} [xMambuAsync] * @param {string} [xMambuCallback] * @param {CustomFieldsConfiguration} [customFieldsConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ update: async ( xMambuAsync?: boolean, xMambuCallback?: string, customFieldsConfiguration?: CustomFieldsConfiguration, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/configuration/customfields.yaml`; // 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/yaml'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+yaml'; if (xMambuAsync != null) { localVarHeaderParameter['X-Mambu-Async'] = typeof xMambuAsync === 'string' ? xMambuAsync : JSON.stringify(xMambuAsync, replaceWithSerializableTypeIfNeeded); } if (xMambuCallback != null) { localVarHeaderParameter['X-Mambu-Callback'] = String(xMambuCallback); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( customFieldsConfiguration, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * CustomFieldsConfigurationApi - functional programming interface */ export const CustomFieldsConfigurationApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = CustomFieldsConfigurationApiAxiosParamCreator(configuration); return { /** * * @summary Get custom field definitions configuration * @param {Array} [availableFor] The entity type of the custom field sets to be returned. If it is used multiple times, it will return all the custom field sets of all the specified entity types. If the parameter is absent, all the custom field sets will be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async get( availableFor?: Array, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.get( availableFor, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CustomFieldsConfigurationApi.get']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get custom field definitions configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getTemplate( options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getTemplate(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CustomFieldsConfigurationApi.getTemplate']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update custom field definitions configuration * @param {boolean} [xMambuAsync] * @param {string} [xMambuCallback] * @param {CustomFieldsConfiguration} [customFieldsConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async update( xMambuAsync?: boolean, xMambuCallback?: string, customFieldsConfiguration?: CustomFieldsConfiguration, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.update( xMambuAsync, xMambuCallback, customFieldsConfiguration, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CustomFieldsConfigurationApi.update']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * CustomFieldsConfigurationApi - factory interface */ export const CustomFieldsConfigurationApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = CustomFieldsConfigurationApiFp(configuration); return { /** * * @summary Get custom field definitions configuration * @param {Array} [availableFor] The entity type of the custom field sets to be returned. If it is used multiple times, it will return all the custom field sets of all the specified entity types. If the parameter is absent, all the custom field sets will be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ get( availableFor?: Array, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .get(availableFor, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get custom field definitions configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ getTemplate( options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getTemplate(options) .then((request) => request(axios, basePath)); }, /** * * @summary Update custom field definitions configuration * @param {boolean} [xMambuAsync] * @param {string} [xMambuCallback] * @param {CustomFieldsConfiguration} [customFieldsConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ update( xMambuAsync?: boolean, xMambuCallback?: string, customFieldsConfiguration?: CustomFieldsConfiguration, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .update(xMambuAsync, xMambuCallback, customFieldsConfiguration, options) .then((request) => request(axios, basePath)); }, }; }; /** * CustomFieldsConfigurationApi - object-oriented interface */ export class CustomFieldsConfigurationApi extends BaseAPI { /** * * @summary Get custom field definitions configuration * @param {Array} [availableFor] The entity type of the custom field sets to be returned. If it is used multiple times, it will return all the custom field sets of all the specified entity types. If the parameter is absent, all the custom field sets will be returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public get( availableFor?: Array, options?: RawAxiosRequestConfig, ) { return CustomFieldsConfigurationApiFp(this.configuration) .get(availableFor, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get custom field definitions configuration * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getTemplate(options?: RawAxiosRequestConfig) { return CustomFieldsConfigurationApiFp(this.configuration) .getTemplate(options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update custom field definitions configuration * @param {boolean} [xMambuAsync] * @param {string} [xMambuCallback] * @param {CustomFieldsConfiguration} [customFieldsConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public update( xMambuAsync?: boolean, xMambuCallback?: string, customFieldsConfiguration?: CustomFieldsConfiguration, options?: RawAxiosRequestConfig, ) { return CustomFieldsConfigurationApiFp(this.configuration) .update(xMambuAsync, xMambuCallback, customFieldsConfiguration, options) .then((request) => request(this.axios, this.basePath)); } } export const GetAvailableForEnum = { Client: 'CLIENT', Group: 'GROUP', CreditArrangement: 'CREDIT_ARRANGEMENT', LoanAccount: 'LOAN_ACCOUNT', Guarantor: 'GUARANTOR', Asset: 'ASSET', DepositAccount: 'DEPOSIT_ACCOUNT', DepositProduct: 'DEPOSIT_PRODUCT', TransactionChannel: 'TRANSACTION_CHANNEL', TransactionType: 'TRANSACTION_TYPE', Branch: 'BRANCH', Centre: 'CENTRE', User: 'USER', } as const; export type GetAvailableForEnum = (typeof GetAvailableForEnum)[keyof typeof GetAvailableForEnum];