/* tslint:disable */ /* eslint-disable */ /** * customfieldsets * 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 { CustomFieldMeta } from '../models'; // @ts-ignore import type { CustomFieldSetMeta } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * CustomFieldSetsApi - axios parameter creator */ export const CustomFieldSetsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Get custom field sets * @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 {Array} [availableFor] The entity that the custom field set is associated with * @param {boolean} [displaySettingsBuiltIn] Indicates if it is a built in custom field set or not * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: async ( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, availableFor?: Array, displaySettingsBuiltIn?: boolean, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/customfieldsets`; // 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 (availableFor) { localVarQueryParameter['availableFor'] = availableFor; } if (displaySettingsBuiltIn !== undefined) { localVarQueryParameter['displaySettings.builtIn'] = displaySettingsBuiltIn; } 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 custom field definitions by custom field set * @param {string} customFieldSetId The encoded key or ID of the custom field set used to get all the custom field definitions of that set. * @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 {GetAllBySetIdPaginationDetailsEnum} [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 {GetAllBySetIdDetailsLevelEnum} [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} */ getAllBySetId: async ( customFieldSetId: string, offset?: number, limit?: number, paginationDetails?: GetAllBySetIdPaginationDetailsEnum, detailsLevel?: GetAllBySetIdDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'customFieldSetId' is not null or undefined assertParamExists('getAllBySetId', 'customFieldSetId', customFieldSetId); const localVarPath = `/customfieldsets/{customFieldSetId}/customfields`.replace( `{${'customFieldSetId'}}`, encodeURIComponent(String(customFieldSetId)), ); // 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; } 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, }; }, }; }; /** * CustomFieldSetsApi - functional programming interface */ export const CustomFieldSetsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = CustomFieldSetsApiAxiosParamCreator(configuration); return { /** * * @summary Get custom field sets * @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 {Array} [availableFor] The entity that the custom field set is associated with * @param {boolean} [displaySettingsBuiltIn] Indicates if it is a built in custom field set or not * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, availableFor?: Array, displaySettingsBuiltIn?: boolean, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAll( offset, limit, paginationDetails, detailsLevel, availableFor, displaySettingsBuiltIn, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CustomFieldSetsApi.getAll']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get custom field definitions by custom field set * @param {string} customFieldSetId The encoded key or ID of the custom field set used to get all the custom field definitions of that set. * @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 {GetAllBySetIdPaginationDetailsEnum} [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 {GetAllBySetIdDetailsLevelEnum} [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 getAllBySetId( customFieldSetId: string, offset?: number, limit?: number, paginationDetails?: GetAllBySetIdPaginationDetailsEnum, detailsLevel?: GetAllBySetIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllBySetId( customFieldSetId, offset, limit, paginationDetails, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CustomFieldSetsApi.getAllBySetId']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * CustomFieldSetsApi - factory interface */ export const CustomFieldSetsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = CustomFieldSetsApiFp(configuration); return { /** * * @summary Get custom field sets * @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 {Array} [availableFor] The entity that the custom field set is associated with * @param {boolean} [displaySettingsBuiltIn] Indicates if it is a built in custom field set or not * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, availableFor?: Array, displaySettingsBuiltIn?: boolean, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAll( offset, limit, paginationDetails, detailsLevel, availableFor, displaySettingsBuiltIn, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Get custom field definitions by custom field set * @param {string} customFieldSetId The encoded key or ID of the custom field set used to get all the custom field definitions of that set. * @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 {GetAllBySetIdPaginationDetailsEnum} [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 {GetAllBySetIdDetailsLevelEnum} [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} */ getAllBySetId( customFieldSetId: string, offset?: number, limit?: number, paginationDetails?: GetAllBySetIdPaginationDetailsEnum, detailsLevel?: GetAllBySetIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAllBySetId( customFieldSetId, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, }; }; /** * CustomFieldSetsApi - object-oriented interface */ export class CustomFieldSetsApi extends BaseAPI { /** * * @summary Get custom field sets * @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 {Array} [availableFor] The entity that the custom field set is associated with * @param {boolean} [displaySettingsBuiltIn] Indicates if it is a built in custom field set or not * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, availableFor?: Array, displaySettingsBuiltIn?: boolean, options?: RawAxiosRequestConfig, ) { return CustomFieldSetsApiFp(this.configuration) .getAll( offset, limit, paginationDetails, detailsLevel, availableFor, displaySettingsBuiltIn, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get custom field definitions by custom field set * @param {string} customFieldSetId The encoded key or ID of the custom field set used to get all the custom field definitions of that set. * @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 {GetAllBySetIdPaginationDetailsEnum} [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 {GetAllBySetIdDetailsLevelEnum} [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 getAllBySetId( customFieldSetId: string, offset?: number, limit?: number, paginationDetails?: GetAllBySetIdPaginationDetailsEnum, detailsLevel?: GetAllBySetIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CustomFieldSetsApiFp(this.configuration) .getAllBySetId( customFieldSetId, offset, limit, paginationDetails, detailsLevel, 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 GetAllAvailableForEnum = { 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 GetAllAvailableForEnum = (typeof GetAllAvailableForEnum)[keyof typeof GetAllAvailableForEnum]; export const GetAllBySetIdPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type GetAllBySetIdPaginationDetailsEnum = (typeof GetAllBySetIdPaginationDetailsEnum)[keyof typeof GetAllBySetIdPaginationDetailsEnum]; export const GetAllBySetIdDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetAllBySetIdDetailsLevelEnum = (typeof GetAllBySetIdDetailsLevelEnum)[keyof typeof GetAllBySetIdDetailsLevelEnum];