/* tslint:disable */ /* eslint-disable */ /** * groups * 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 { CreditArrangement } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { Group } from '../models'; // @ts-ignore import type { GroupSearchCriteria } from '../models'; // @ts-ignore import type { PatchOperation } from '../models'; /** * GroupsApi - axios parameter creator */ export const GroupsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Delete group * @param {string} groupId The ID or encoded key of the group to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete: async ( groupId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'groupId' is not null or undefined assertParamExists('_delete', 'groupId', groupId); const localVarPath = `/groups/{groupId}`.replace( `{${'groupId'}}`, encodeURIComponent(String(groupId)), ); // 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 Create group * @param {Group} group Group 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 ( group: Group, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'group' is not null or undefined assertParamExists('create', 'group', group); const localVarPath = `/groups`; // 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( group, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get groups * @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} [creditOfficerUsername] The username of the credit officer to whom the entities are assigned to * @param {string} [branchId] The id/encodedKey of the branch to which the entities are assigned to * @param {string} [centreId] The id/encodedKey of the centre to which the entities are assigned to * @param {string} [sortBy] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: async ( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, creditOfficerUsername?: string, branchId?: string, centreId?: string, sortBy?: string, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/groups`; // 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 (creditOfficerUsername !== undefined) { localVarQueryParameter['creditOfficerUsername'] = creditOfficerUsername; } if (branchId !== undefined) { localVarQueryParameter['branchId'] = branchId; } if (centreId !== undefined) { localVarQueryParameter['centreId'] = centreId; } 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 group * @param {string} groupId The ID or encoded key of the group 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 ( groupId: string, detailsLevel?: GetByIdDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'groupId' is not null or undefined assertParamExists('getById', 'groupId', groupId); const localVarPath = `/groups/{groupId}`.replace( `{${'groupId'}}`, encodeURIComponent(String(groupId)), ); // 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 Credit arrangements list returned. * @param {string} groupId The ID or encoded key of the group to be returned. * @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 {GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum} [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 {GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum} [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} */ getCreditArrangementsByGroupIdOrKey: async ( groupId: string, offset?: number, limit?: number, paginationDetails?: GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum, detailsLevel?: GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'groupId' is not null or undefined assertParamExists( 'getCreditArrangementsByGroupIdOrKey', 'groupId', groupId, ); const localVarPath = `/groups/{groupId}/creditarrangements`.replace( `{${'groupId'}}`, encodeURIComponent(String(groupId)), ); // 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, }; }, /** * * @summary Partially update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patch: async ( groupId: string, patchOperation: Array, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'groupId' is not null or undefined assertParamExists('patch', 'groupId', groupId); // verify required parameter 'patchOperation' is not null or undefined assertParamExists('patch', 'patchOperation', patchOperation); const localVarPath = `/groups/{groupId}`.replace( `{${'groupId'}}`, encodeURIComponent(String(groupId)), ); // 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 Search groups * @param {GroupSearchCriteria} groupSearchCriteria Criteria to be used to search groups. * @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 {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 ( groupSearchCriteria: GroupSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'groupSearchCriteria' is not null or undefined assertParamExists('search', 'groupSearchCriteria', groupSearchCriteria); const localVarPath = `/groups: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 (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( groupSearchCriteria, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Group} group Group to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update: async ( groupId: string, group: Group, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'groupId' is not null or undefined assertParamExists('update', 'groupId', groupId); // verify required parameter 'group' is not null or undefined assertParamExists('update', 'group', group); const localVarPath = `/groups/{groupId}`.replace( `{${'groupId'}}`, encodeURIComponent(String(groupId)), ); // 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( group, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * GroupsApi - functional programming interface */ export const GroupsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = GroupsApiAxiosParamCreator(configuration); return { /** * * @summary Delete group * @param {string} groupId The ID or encoded key of the group to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async _delete( groupId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator._delete( groupId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi._delete']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create group * @param {Group} group Group 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( group: Group, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.create( group, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi.create']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get groups * @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} [creditOfficerUsername] The username of the credit officer to whom the entities are assigned to * @param {string} [branchId] The id/encodedKey of the branch to which the entities are assigned to * @param {string} [centreId] The id/encodedKey of the centre to which the entities are assigned to * @param {string} [sortBy] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, creditOfficerUsername?: string, branchId?: string, centreId?: string, sortBy?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAll( offset, limit, paginationDetails, detailsLevel, creditOfficerUsername, branchId, centreId, sortBy, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi.getAll']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get group * @param {string} groupId The ID or encoded key of the group 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( groupId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getById( groupId, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi.getById']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Credit arrangements list returned. * @param {string} groupId The ID or encoded key of the group to be returned. * @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 {GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum} [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 {GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum} [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 getCreditArrangementsByGroupIdOrKey( groupId: string, offset?: number, limit?: number, paginationDetails?: GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum, detailsLevel?: GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getCreditArrangementsByGroupIdOrKey( groupId, offset, limit, paginationDetails, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi.getCreditArrangementsByGroupIdOrKey']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Partially update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async patch( groupId: string, patchOperation: Array, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.patch( groupId, patchOperation, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi.patch']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Search groups * @param {GroupSearchCriteria} groupSearchCriteria Criteria to be used to search groups. * @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 {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( groupSearchCriteria: GroupSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.search( groupSearchCriteria, offset, limit, paginationDetails, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi.search']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Group} group Group to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async update( groupId: string, group: Group, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.update( groupId, group, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['GroupsApi.update']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * GroupsApi - factory interface */ export const GroupsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = GroupsApiFp(configuration); return { /** * * @summary Delete group * @param {string} groupId The ID or encoded key of the group to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete( groupId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp ._delete(groupId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Create group * @param {Group} group Group 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( group: Group, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .create(group, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get groups * @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} [creditOfficerUsername] The username of the credit officer to whom the entities are assigned to * @param {string} [branchId] The id/encodedKey of the branch to which the entities are assigned to * @param {string} [centreId] The id/encodedKey of the centre to which the entities are assigned to * @param {string} [sortBy] * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, creditOfficerUsername?: string, branchId?: string, centreId?: string, sortBy?: string, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAll( offset, limit, paginationDetails, detailsLevel, creditOfficerUsername, branchId, centreId, sortBy, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Get group * @param {string} groupId The ID or encoded key of the group 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( groupId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getById(groupId, detailsLevel, options) .then((request) => request(axios, basePath)); }, /** * * @summary Credit arrangements list returned. * @param {string} groupId The ID or encoded key of the group to be returned. * @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 {GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum} [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 {GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum} [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} */ getCreditArrangementsByGroupIdOrKey( groupId: string, offset?: number, limit?: number, paginationDetails?: GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum, detailsLevel?: GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getCreditArrangementsByGroupIdOrKey( groupId, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Partially update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ patch( groupId: string, patchOperation: Array, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .patch(groupId, patchOperation, options) .then((request) => request(axios, basePath)); }, /** * * @summary Search groups * @param {GroupSearchCriteria} groupSearchCriteria Criteria to be used to search groups. * @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 {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( groupSearchCriteria: GroupSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .search( groupSearchCriteria, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Group} group Group to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ update( groupId: string, group: Group, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .update(groupId, group, options) .then((request) => request(axios, basePath)); }, }; }; /** * GroupsApi - object-oriented interface */ export class GroupsApi extends BaseAPI { /** * * @summary Delete group * @param {string} groupId The ID or encoded key of the group to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public _delete(groupId: string, options?: RawAxiosRequestConfig) { return GroupsApiFp(this.configuration) ._delete(groupId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create group * @param {Group} group Group 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( group: Group, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return GroupsApiFp(this.configuration) .create(group, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get groups * @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} [creditOfficerUsername] The username of the credit officer to whom the entities are assigned to * @param {string} [branchId] The id/encodedKey of the branch to which the entities are assigned to * @param {string} [centreId] The id/encodedKey of the centre to which the entities are assigned to * @param {string} [sortBy] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, creditOfficerUsername?: string, branchId?: string, centreId?: string, sortBy?: string, options?: RawAxiosRequestConfig, ) { return GroupsApiFp(this.configuration) .getAll( offset, limit, paginationDetails, detailsLevel, creditOfficerUsername, branchId, centreId, sortBy, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get group * @param {string} groupId The ID or encoded key of the group 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( groupId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return GroupsApiFp(this.configuration) .getById(groupId, detailsLevel, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Credit arrangements list returned. * @param {string} groupId The ID or encoded key of the group to be returned. * @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 {GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum} [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 {GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum} [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 getCreditArrangementsByGroupIdOrKey( groupId: string, offset?: number, limit?: number, paginationDetails?: GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum, detailsLevel?: GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return GroupsApiFp(this.configuration) .getCreditArrangementsByGroupIdOrKey( groupId, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Partially update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public patch( groupId: string, patchOperation: Array, options?: RawAxiosRequestConfig, ) { return GroupsApiFp(this.configuration) .patch(groupId, patchOperation, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Search groups * @param {GroupSearchCriteria} groupSearchCriteria Criteria to be used to search groups. * @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 {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( groupSearchCriteria: GroupSearchCriteria, offset?: number, limit?: number, paginationDetails?: SearchPaginationDetailsEnum, detailsLevel?: SearchDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return GroupsApiFp(this.configuration) .search( groupSearchCriteria, offset, limit, paginationDetails, detailsLevel, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update group * @param {string} groupId The ID or encoded key of the group to be updated. * @param {Group} group Group to be updated. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public update( groupId: string, group: Group, options?: RawAxiosRequestConfig, ) { return GroupsApiFp(this.configuration) .update(groupId, group, 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 GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum = { On: 'ON', Off: 'OFF', } as const; export type GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum = (typeof GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum)[keyof typeof GetCreditArrangementsByGroupIdOrKeyPaginationDetailsEnum]; export const GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum = (typeof GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum)[keyof typeof GetCreditArrangementsByGroupIdOrKeyDetailsLevelEnum]; 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];