"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Admin API
 * The Admin API is used to manage the ApeCloud platform.
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@apecloud.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserApi = exports.UserApiFactory = exports.UserApiFp = exports.UserApiAxiosParamCreator = void 0;
const axios_1 = __importDefault(require("axios"));
// Some imports not used depending on template conditions
// @ts-ignore
const common_1 = require("../common");
// @ts-ignore
const base_1 = require("../base");
/**
 * UserApi - axios parameter creator
 * @export
 */
const UserApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Create a new user
         * @summary Create a new user
         * @param {UserCreate} userCreate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUser: async (userCreate, options = {}) => {
            // verify required parameter 'userCreate' is not null or undefined
            (0, common_1.assertParamExists)('createUser', 'userCreate', userCreate);
            const localVarPath = `/admin/v1/users`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(userCreate, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Create apikey of the authenticated user
         * @summary Create apikey of the authenticated user
         * @param {ApikeyCreate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUserApikey: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('createUserApikey', 'body', body);
            const localVarPath = `/admin/v1/user/apikeys`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * delete apikey
         * @summary Delete apikey
         * @param {string} keyName Name of the Apikey
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteApikey: async (keyName, options = {}) => {
            // verify required parameter 'keyName' is not null or undefined
            (0, common_1.assertParamExists)('deleteApikey', 'keyName', keyName);
            const localVarPath = `/admin/v1/user/apikey/{keyName}`
                .replace(`{${"keyName"}}`, encodeURIComponent(String(keyName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * delete user
         * @summary delete user
         * @param {string} userID ID of the user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteUser: async (userID, options = {}) => {
            // verify required parameter 'userID' is not null or undefined
            (0, common_1.assertParamExists)('deleteUser', 'userID', userID);
            const localVarPath = `/admin/v1/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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get authenticated login user info
         * @summary Get authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAuthenticatedUser: async (options = {}) => {
            const localVarPath = `/admin/v1/user`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get user roles in multiple organizations
         * @summary Get user roles in multiple organizations
         * @param {string} userID ID of the user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getUserAuthorization: async (userID, options = {}) => {
            // verify required parameter 'userID' is not null or undefined
            (0, common_1.assertParamExists)('getUserAuthorization', 'userID', userID);
            const localVarPath = `/admin/v1/users/{userID}/authorization`
                .replace(`{${"userID"}}`, encodeURIComponent(String(userID)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * List users
         * @summary List users
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUsers: async (options = {}) => {
            const localVarPath = `/admin/v1/users`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * partially update the specified apikey
         * @summary Update apikey information
         * @param {string} keyName Name of the apikey
         * @param {ApikeyCreate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAPIkey: async (keyName, body, options = {}) => {
            // verify required parameter 'keyName' is not null or undefined
            (0, common_1.assertParamExists)('patchAPIkey', 'keyName', keyName);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('patchAPIkey', 'body', body);
            const localVarPath = `/admin/v1/user/apikey/{keyName}`
                .replace(`{${"keyName"}}`, encodeURIComponent(String(keyName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
         * @summary Update user information
         * @param {UserUpdate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAuthenticatedUser: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('patchAuthenticatedUser', 'body', body);
            const localVarPath = `/admin/v1/user`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update the information of the specified user
         * @summary Update the information of the specified user
         * @param {string} userID ID of the user
         * @param {UserUpdate} userUpdate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchUser: async (userID, userUpdate, options = {}) => {
            // verify required parameter 'userID' is not null or undefined
            (0, common_1.assertParamExists)('patchUser', 'userID', userID);
            // verify required parameter 'userUpdate' is not null or undefined
            (0, common_1.assertParamExists)('patchUser', 'userUpdate', userUpdate);
            const localVarPath = `/admin/v1/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, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(userUpdate, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get apikeys of the authenticated user
         * @summary Get apikeys of the authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readUserApikeys: async (options = {}) => {
            const localVarPath = `/admin/v1/user/apikeys`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update current authenticated user password.
         * @summary Update current authenticated user password
         * @param {UpdateAuthenticatedUserPasswordRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAuthenticatedUserPassword: async (body, options = {}) => {
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('updateAuthenticatedUserPassword', 'body', body);
            const localVarPath = `/admin/v1/user/password`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update user password
         * @summary Update user password
         * @param {string} userID ID of the user
         * @param {Password} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateUserPassword: async (userID, body, options = {}) => {
            // verify required parameter 'userID' is not null or undefined
            (0, common_1.assertParamExists)('updateUserPassword', 'userID', userID);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('updateUserPassword', 'body', body);
            const localVarPath = `/admin/v1/users/{userID}/password`
                .replace(`{${"userID"}}`, encodeURIComponent(String(userID)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = Object.assign(Object.assign({ method: 'PATCH' }, baseOptions), options);
            const localVarHeaderParameter = {};
            const localVarQueryParameter = {};
            // authentication BearerToken required
            // http bearer authentication required
            await (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
            // authentication DigestAuth required
            await (0, common_1.setApiKeyToObject)(localVarHeaderParameter, "Authorization", configuration);
            localVarHeaderParameter['Content-Type'] = 'application/json';
            (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
            localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.UserApiAxiosParamCreator = UserApiAxiosParamCreator;
/**
 * UserApi - functional programming interface
 * @export
 */
const UserApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.UserApiAxiosParamCreator)(configuration);
    return {
        /**
         * Create a new user
         * @summary Create a new user
         * @param {UserCreate} userCreate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createUser(userCreate, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(userCreate, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.createUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Create apikey of the authenticated user
         * @summary Create apikey of the authenticated user
         * @param {ApikeyCreate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createUserApikey(body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createUserApikey(body, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.createUserApikey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * delete apikey
         * @summary Delete apikey
         * @param {string} keyName Name of the Apikey
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteApikey(keyName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteApikey(keyName, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.deleteApikey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * delete user
         * @summary delete user
         * @param {string} userID ID of the user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteUser(userID, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteUser(userID, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.deleteUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get authenticated login user info
         * @summary Get authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getAuthenticatedUser(options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getAuthenticatedUser(options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.getAuthenticatedUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get user roles in multiple organizations
         * @summary Get user roles in multiple organizations
         * @param {string} userID ID of the user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getUserAuthorization(userID, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getUserAuthorization(userID, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.getUserAuthorization']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * List users
         * @summary List users
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listUsers(options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listUsers(options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.listUsers']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * partially update the specified apikey
         * @summary Update apikey information
         * @param {string} keyName Name of the apikey
         * @param {ApikeyCreate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchAPIkey(keyName, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchAPIkey(keyName, body, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.patchAPIkey']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
         * @summary Update user information
         * @param {UserUpdate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchAuthenticatedUser(body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchAuthenticatedUser(body, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.patchAuthenticatedUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Update the information of the specified user
         * @summary Update the information of the specified user
         * @param {string} userID ID of the user
         * @param {UserUpdate} userUpdate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async patchUser(userID, userUpdate, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.patchUser(userID, userUpdate, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.patchUser']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get apikeys of the authenticated user
         * @summary Get apikeys of the authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async readUserApikeys(options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.readUserApikeys(options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.readUserApikeys']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Update current authenticated user password.
         * @summary Update current authenticated user password
         * @param {UpdateAuthenticatedUserPasswordRequest} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateAuthenticatedUserPassword(body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateAuthenticatedUserPassword(body, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.updateAuthenticatedUserPassword']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Update user password
         * @summary Update user password
         * @param {string} userID ID of the user
         * @param {Password} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateUserPassword(userID, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateUserPassword(userID, body, options);
            const localVarOperationServerIndex = (_a = configuration === null || configuration === void 0 ? void 0 : configuration.serverIndex) !== null && _a !== void 0 ? _a : 0;
            const localVarOperationServerBasePath = (_c = (_b = base_1.operationServerMap['UserApi.updateUserPassword']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    };
};
exports.UserApiFp = UserApiFp;
/**
 * UserApi - factory interface
 * @export
 */
const UserApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.UserApiFp)(configuration);
    return {
        /**
         * Create a new user
         * @summary Create a new user
         * @param {UserApiCreateUserRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUser(requestParameters, options) {
            return localVarFp.createUser(requestParameters.userCreate, options).then((request) => request(axios, basePath));
        },
        /**
         * Create apikey of the authenticated user
         * @summary Create apikey of the authenticated user
         * @param {UserApiCreateUserApikeyRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createUserApikey(requestParameters, options) {
            return localVarFp.createUserApikey(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * delete apikey
         * @summary Delete apikey
         * @param {UserApiDeleteApikeyRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteApikey(requestParameters, options) {
            return localVarFp.deleteApikey(requestParameters.keyName, options).then((request) => request(axios, basePath));
        },
        /**
         * delete user
         * @summary delete user
         * @param {UserApiDeleteUserRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteUser(requestParameters, options) {
            return localVarFp.deleteUser(requestParameters.userID, options).then((request) => request(axios, basePath));
        },
        /**
         * Get authenticated login user info
         * @summary Get authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getAuthenticatedUser(options) {
            return localVarFp.getAuthenticatedUser(options).then((request) => request(axios, basePath));
        },
        /**
         * Get user roles in multiple organizations
         * @summary Get user roles in multiple organizations
         * @param {UserApiGetUserAuthorizationRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getUserAuthorization(requestParameters, options) {
            return localVarFp.getUserAuthorization(requestParameters.userID, options).then((request) => request(axios, basePath));
        },
        /**
         * List users
         * @summary List users
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUsers(options) {
            return localVarFp.listUsers(options).then((request) => request(axios, basePath));
        },
        /**
         * partially update the specified apikey
         * @summary Update apikey information
         * @param {UserApiPatchAPIkeyRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAPIkey(requestParameters, options) {
            return localVarFp.patchAPIkey(requestParameters.keyName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
         * @summary Update user information
         * @param {UserApiPatchAuthenticatedUserRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchAuthenticatedUser(requestParameters, options) {
            return localVarFp.patchAuthenticatedUser(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * Update the information of the specified user
         * @summary Update the information of the specified user
         * @param {UserApiPatchUserRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        patchUser(requestParameters, options) {
            return localVarFp.patchUser(requestParameters.userID, requestParameters.userUpdate, options).then((request) => request(axios, basePath));
        },
        /**
         * Get apikeys of the authenticated user
         * @summary Get apikeys of the authenticated user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        readUserApikeys(options) {
            return localVarFp.readUserApikeys(options).then((request) => request(axios, basePath));
        },
        /**
         * Update current authenticated user password.
         * @summary Update current authenticated user password
         * @param {UserApiUpdateAuthenticatedUserPasswordRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateAuthenticatedUserPassword(requestParameters, options) {
            return localVarFp.updateAuthenticatedUserPassword(requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * Update user password
         * @summary Update user password
         * @param {UserApiUpdateUserPasswordRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateUserPassword(requestParameters, options) {
            return localVarFp.updateUserPassword(requestParameters.userID, requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};
exports.UserApiFactory = UserApiFactory;
/**
 * UserApi - object-oriented interface
 * @export
 * @class UserApi
 * @extends {BaseAPI}
 */
class UserApi extends base_1.BaseAPI {
    /**
     * Create a new user
     * @summary Create a new user
     * @param {UserApiCreateUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    createUser(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).createUser(requestParameters.userCreate, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Create apikey of the authenticated user
     * @summary Create apikey of the authenticated user
     * @param {UserApiCreateUserApikeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    createUserApikey(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).createUserApikey(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * delete apikey
     * @summary Delete apikey
     * @param {UserApiDeleteApikeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    deleteApikey(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).deleteApikey(requestParameters.keyName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * delete user
     * @summary delete user
     * @param {UserApiDeleteUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    deleteUser(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).deleteUser(requestParameters.userID, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get authenticated login user info
     * @summary Get authenticated user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    getAuthenticatedUser(options) {
        return (0, exports.UserApiFp)(this.configuration).getAuthenticatedUser(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get user roles in multiple organizations
     * @summary Get user roles in multiple organizations
     * @param {UserApiGetUserAuthorizationRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    getUserAuthorization(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).getUserAuthorization(requestParameters.userID, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List users
     * @summary List users
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    listUsers(options) {
        return (0, exports.UserApiFp)(this.configuration).listUsers(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * partially update the specified apikey
     * @summary Update apikey information
     * @param {UserApiPatchAPIkeyRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    patchAPIkey(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).patchAPIkey(requestParameters.keyName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * partially update the specified User. If you want to update phone number, you must request /api/v1/user/phone-verification-code first.
     * @summary Update user information
     * @param {UserApiPatchAuthenticatedUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    patchAuthenticatedUser(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).patchAuthenticatedUser(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update the information of the specified user
     * @summary Update the information of the specified user
     * @param {UserApiPatchUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    patchUser(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).patchUser(requestParameters.userID, requestParameters.userUpdate, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get apikeys of the authenticated user
     * @summary Get apikeys of the authenticated user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    readUserApikeys(options) {
        return (0, exports.UserApiFp)(this.configuration).readUserApikeys(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update current authenticated user password.
     * @summary Update current authenticated user password
     * @param {UserApiUpdateAuthenticatedUserPasswordRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    updateAuthenticatedUserPassword(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).updateAuthenticatedUserPassword(requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update user password
     * @summary Update user password
     * @param {UserApiUpdateUserPasswordRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserApi
     */
    updateUserPassword(requestParameters, options) {
        return (0, exports.UserApiFp)(this.configuration).updateUserPassword(requestParameters.userID, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.UserApi = UserApi;
//# sourceMappingURL=user-api.js.map