/* tslint:disable */ /* eslint-disable */ /** * users * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { PatchOperation } from '../models'; // @ts-ignore import type { User } from '../models'; // @ts-ignore import type { UserRequest } from '../models'; /** * UsersApi - axios parameter creator */ export const UsersApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Delete user * @param {string} userId The ID or encoded key of the user to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete: async ( userId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'userId' is not null or undefined assertParamExists('_delete', 'userId', userId); const localVarPath = `/users/{userId}`.replace( `{${'userId'}}`, encodeURIComponent(String(userId)), ); // 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 user * @param {UserRequest} userRequest User 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 ( userRequest: UserRequest, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'userRequest' is not null or undefined assertParamExists('create', 'userRequest', userRequest); const localVarPath = `/users`; // 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( userRequest, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get users * @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} [branchId] The branch identifier to search by, can be the encoded key or the id * @param {GetAllBranchIdTypeEnum} [branchIdType] Represents the way how the users should be searched by branch, when the users are ASSIGNED to a branch or when the user can manage a branch which includes ASSIGNED and extra users that can manage the branch and the ones that ca manage all branches * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll: async ( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, branchId?: string, branchIdType?: GetAllBranchIdTypeEnum, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/users`; // 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 (branchId !== undefined) { localVarQueryParameter['branchId'] = branchId; } if (branchIdType !== undefined) { localVarQueryParameter['branchIdType'] = branchIdType; } 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 user * @param {string} userId The ID or encoded key of the user 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 ( userId: string, detailsLevel?: GetByIdDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'userId' is not null or undefined assertParamExists('getById', 'userId', userId); const localVarPath = `/users/{userId}`.replace( `{${'userId'}}`, encodeURIComponent(String(userId)), ); // 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 user * @param {string} userId The ID or encoded key of the user to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @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} */ patch: async ( userId: string, patchOperation: Array, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'userId' is not null or undefined assertParamExists('patch', 'userId', userId); // verify required parameter 'patchOperation' is not null or undefined assertParamExists('patch', 'patchOperation', patchOperation); const localVarPath = `/users/{userId}`.replace( `{${'userId'}}`, encodeURIComponent(String(userId)), ); // 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'; 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( patchOperation, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update user * @param {string} userId The ID or encoded key of the user to be updated. * @param {User} user User to be updated. * @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} */ update: async ( userId: string, user: User, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'userId' is not null or undefined assertParamExists('update', 'userId', userId); // verify required parameter 'user' is not null or undefined assertParamExists('update', 'user', user); const localVarPath = `/users/{userId}`.replace( `{${'userId'}}`, encodeURIComponent(String(userId)), ); // 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'; 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( user, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * UsersApi - functional programming interface */ export const UsersApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = UsersApiAxiosParamCreator(configuration); return { /** * * @summary Delete user * @param {string} userId The ID or encoded key of the user to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async _delete( userId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator._delete( userId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UsersApi._delete']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create user * @param {UserRequest} userRequest User 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( userRequest: UserRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.create( userRequest, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UsersApi.create']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get users * @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} [branchId] The branch identifier to search by, can be the encoded key or the id * @param {GetAllBranchIdTypeEnum} [branchIdType] Represents the way how the users should be searched by branch, when the users are ASSIGNED to a branch or when the user can manage a branch which includes ASSIGNED and extra users that can manage the branch and the ones that ca manage all branches * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, branchId?: string, branchIdType?: GetAllBranchIdTypeEnum, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAll( offset, limit, paginationDetails, detailsLevel, branchId, branchIdType, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UsersApi.getAll']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get user * @param {string} userId The ID or encoded key of the user 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( userId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getById( userId, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UsersApi.getById']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Partially update user * @param {string} userId The ID or encoded key of the user to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @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 patch( userId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.patch( userId, patchOperation, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UsersApi.patch']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update user * @param {string} userId The ID or encoded key of the user to be updated. * @param {User} user User to be updated. * @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 update( userId: string, user: User, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.update( userId, user, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['UsersApi.update']?.[localVarOperationServerIndex] ?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * UsersApi - factory interface */ export const UsersApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = UsersApiFp(configuration); return { /** * * @summary Delete user * @param {string} userId The ID or encoded key of the user to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ _delete( userId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp ._delete(userId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Create user * @param {UserRequest} userRequest User 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( userRequest: UserRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .create(userRequest, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get users * @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} [branchId] The branch identifier to search by, can be the encoded key or the id * @param {GetAllBranchIdTypeEnum} [branchIdType] Represents the way how the users should be searched by branch, when the users are ASSIGNED to a branch or when the user can manage a branch which includes ASSIGNED and extra users that can manage the branch and the ones that ca manage all branches * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, branchId?: string, branchIdType?: GetAllBranchIdTypeEnum, options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAll( offset, limit, paginationDetails, detailsLevel, branchId, branchIdType, options, ) .then((request) => request(axios, basePath)); }, /** * * @summary Get user * @param {string} userId The ID or encoded key of the user 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( userId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getById(userId, detailsLevel, options) .then((request) => request(axios, basePath)); }, /** * * @summary Partially update user * @param {string} userId The ID or encoded key of the user to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @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} */ patch( userId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .patch(userId, patchOperation, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Update user * @param {string} userId The ID or encoded key of the user to be updated. * @param {User} user User to be updated. * @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} */ update( userId: string, user: User, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .update(userId, user, idempotencyKey, options) .then((request) => request(axios, basePath)); }, }; }; /** * UsersApi - object-oriented interface */ export class UsersApi extends BaseAPI { /** * * @summary Delete user * @param {string} userId The ID or encoded key of the user to be deleted. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public _delete(userId: string, options?: RawAxiosRequestConfig) { return UsersApiFp(this.configuration) ._delete(userId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Create user * @param {UserRequest} userRequest User 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( userRequest: UserRequest, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return UsersApiFp(this.configuration) .create(userRequest, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get users * @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} [branchId] The branch identifier to search by, can be the encoded key or the id * @param {GetAllBranchIdTypeEnum} [branchIdType] Represents the way how the users should be searched by branch, when the users are ASSIGNED to a branch or when the user can manage a branch which includes ASSIGNED and extra users that can manage the branch and the ones that ca manage all branches * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAll( offset?: number, limit?: number, paginationDetails?: GetAllPaginationDetailsEnum, detailsLevel?: GetAllDetailsLevelEnum, branchId?: string, branchIdType?: GetAllBranchIdTypeEnum, options?: RawAxiosRequestConfig, ) { return UsersApiFp(this.configuration) .getAll( offset, limit, paginationDetails, detailsLevel, branchId, branchIdType, options, ) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get user * @param {string} userId The ID or encoded key of the user 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( userId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return UsersApiFp(this.configuration) .getById(userId, detailsLevel, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Partially update user * @param {string} userId The ID or encoded key of the user to be updated. * @param {Array} patchOperation Patch operations to be applied to a resource. * @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 patch( userId: string, patchOperation: Array, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return UsersApiFp(this.configuration) .patch(userId, patchOperation, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update user * @param {string} userId The ID or encoded key of the user to be updated. * @param {User} user User to be updated. * @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 update( userId: string, user: User, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return UsersApiFp(this.configuration) .update(userId, user, idempotencyKey, 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 GetAllBranchIdTypeEnum = { Assigned: 'ASSIGNED', Manage: 'MANAGE', } as const; export type GetAllBranchIdTypeEnum = (typeof GetAllBranchIdTypeEnum)[keyof typeof GetAllBranchIdTypeEnum]; export const GetByIdDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetByIdDetailsLevelEnum = (typeof GetByIdDetailsLevelEnum)[keyof typeof GetByIdDetailsLevelEnum];