"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.RabbitMQApi = exports.RabbitMQApiFactory = exports.RabbitMQApiFp = exports.RabbitMQApiAxiosParamCreator = 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");
/**
 * RabbitMQApi - axios parameter creator
 * @export
 */
const RabbitMQApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Create a new RabbitMQ account
         * @summary Create RabbitMQ account
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {RbmqAccountRequest} rbmqAccountRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRabbitAccount: async (orgName, clusterName, rbmqAccountRequest, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('createRabbitAccount', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('createRabbitAccount', 'clusterName', clusterName);
            // verify required parameter 'rbmqAccountRequest' is not null or undefined
            (0, common_1.assertParamExists)('createRabbitAccount', 'rbmqAccountRequest', rbmqAccountRequest);
            const localVarPath = `/admin/v1/data/rabbitmq/organizations/{orgName}/clusters/{clusterName}/accounts`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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)(rbmqAccountRequest, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Delete a RabbitMQ account
         * @summary Delete RabbitMQ account
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} accountName name of the Account
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRabbitAccount: async (orgName, clusterName, accountName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('deleteRabbitAccount', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('deleteRabbitAccount', 'clusterName', clusterName);
            // verify required parameter 'accountName' is not null or undefined
            (0, common_1.assertParamExists)('deleteRabbitAccount', 'accountName', accountName);
            const localVarPath = `/admin/v1/data/rabbitmq/organizations/{orgName}/clusters/{clusterName}/accounts/{accountName}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
            // 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,
            };
        },
        /**
         * List all RabbitMQ accounts
         * @summary List RabbitMQ accounts
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRabbitAccounts: async (orgName, clusterName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listRabbitAccounts', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('listRabbitAccounts', 'clusterName', clusterName);
            const localVarPath = `/admin/v1/data/rabbitmq/organizations/{orgName}/clusters/{clusterName}/accounts`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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 RabbitMQ exchanges
         * @summary List RabbitMQ exchanges
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRabbitExchanges: async (orgName, clusterName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listRabbitExchanges', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('listRabbitExchanges', 'clusterName', clusterName);
            const localVarPath = `/admin/v1/data/rabbitmq/organizations/{orgName}/clusters/{clusterName}/exchanges`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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 RabbitMQ vhosts
         * @summary List RabbitMQ vhosts
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRabbitVHosts: async (orgName, clusterName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listRabbitVHosts', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('listRabbitVHosts', 'clusterName', clusterName);
            const localVarPath = `/admin/v1/data/rabbitmq/organizations/{orgName}/clusters/{clusterName}/vhosts`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // 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 a RabbitMQ account password
         * @summary Update RabbitMQ account password
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} accountName name of the Account
         * @param {RbmqUser} rbmqUser
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRabbitAccountPassword: async (orgName, clusterName, accountName, rbmqUser, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPassword', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPassword', 'clusterName', clusterName);
            // verify required parameter 'accountName' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPassword', 'accountName', accountName);
            // verify required parameter 'rbmqUser' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPassword', 'rbmqUser', rbmqUser);
            const localVarPath = `/admin/v1/data/rabbitmq/organizations/{orgName}/clusters/{clusterName}/accounts/{accountName}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
            // 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)(rbmqUser, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update a RabbitMQ account privileges
         * @summary Update RabbitMQ account privileges
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} accountName name of the Account
         * @param {RbmqPermission} rbmqPermission
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRabbitAccountPrivileges: async (orgName, clusterName, accountName, rbmqPermission, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPrivileges', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPrivileges', 'clusterName', clusterName);
            // verify required parameter 'accountName' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPrivileges', 'accountName', accountName);
            // verify required parameter 'rbmqPermission' is not null or undefined
            (0, common_1.assertParamExists)('updateRabbitAccountPrivileges', 'rbmqPermission', rbmqPermission);
            const localVarPath = `/admin/v1/data/rabbitmq/organizations/{orgName}/clusters/{clusterName}/accounts/{accountName}/privileges`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"accountName"}}`, encodeURIComponent(String(accountName)));
            // 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: 'PUT' }, 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)(rbmqPermission, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.RabbitMQApiAxiosParamCreator = RabbitMQApiAxiosParamCreator;
/**
 * RabbitMQApi - functional programming interface
 * @export
 */
const RabbitMQApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.RabbitMQApiAxiosParamCreator)(configuration);
    return {
        /**
         * Create a new RabbitMQ account
         * @summary Create RabbitMQ account
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {RbmqAccountRequest} rbmqAccountRequest
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createRabbitAccount(orgName, clusterName, rbmqAccountRequest, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createRabbitAccount(orgName, clusterName, rbmqAccountRequest, 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['RabbitMQApi.createRabbitAccount']) === 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 a RabbitMQ account
         * @summary Delete RabbitMQ account
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} accountName name of the Account
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteRabbitAccount(orgName, clusterName, accountName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRabbitAccount(orgName, clusterName, accountName, 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['RabbitMQApi.deleteRabbitAccount']) === 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 all RabbitMQ accounts
         * @summary List RabbitMQ accounts
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listRabbitAccounts(orgName, clusterName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listRabbitAccounts(orgName, clusterName, 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['RabbitMQApi.listRabbitAccounts']) === 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 RabbitMQ exchanges
         * @summary List RabbitMQ exchanges
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listRabbitExchanges(orgName, clusterName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listRabbitExchanges(orgName, clusterName, 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['RabbitMQApi.listRabbitExchanges']) === 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 RabbitMQ vhosts
         * @summary List RabbitMQ vhosts
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listRabbitVHosts(orgName, clusterName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listRabbitVHosts(orgName, clusterName, 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['RabbitMQApi.listRabbitVHosts']) === 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 a RabbitMQ account password
         * @summary Update RabbitMQ account password
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} accountName name of the Account
         * @param {RbmqUser} rbmqUser
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateRabbitAccountPassword(orgName, clusterName, accountName, rbmqUser, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateRabbitAccountPassword(orgName, clusterName, accountName, rbmqUser, 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['RabbitMQApi.updateRabbitAccountPassword']) === 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 a RabbitMQ account privileges
         * @summary Update RabbitMQ account privileges
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {string} accountName name of the Account
         * @param {RbmqPermission} rbmqPermission
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateRabbitAccountPrivileges(orgName, clusterName, accountName, rbmqPermission, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateRabbitAccountPrivileges(orgName, clusterName, accountName, rbmqPermission, 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['RabbitMQApi.updateRabbitAccountPrivileges']) === 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.RabbitMQApiFp = RabbitMQApiFp;
/**
 * RabbitMQApi - factory interface
 * @export
 */
const RabbitMQApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.RabbitMQApiFp)(configuration);
    return {
        /**
         * Create a new RabbitMQ account
         * @summary Create RabbitMQ account
         * @param {RabbitMQApiCreateRabbitAccountRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createRabbitAccount(requestParameters, options) {
            return localVarFp.createRabbitAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.rbmqAccountRequest, options).then((request) => request(axios, basePath));
        },
        /**
         * Delete a RabbitMQ account
         * @summary Delete RabbitMQ account
         * @param {RabbitMQApiDeleteRabbitAccountRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRabbitAccount(requestParameters, options) {
            return localVarFp.deleteRabbitAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, options).then((request) => request(axios, basePath));
        },
        /**
         * List all RabbitMQ accounts
         * @summary List RabbitMQ accounts
         * @param {RabbitMQApiListRabbitAccountsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRabbitAccounts(requestParameters, options) {
            return localVarFp.listRabbitAccounts(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
        /**
         * List RabbitMQ exchanges
         * @summary List RabbitMQ exchanges
         * @param {RabbitMQApiListRabbitExchangesRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRabbitExchanges(requestParameters, options) {
            return localVarFp.listRabbitExchanges(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
        /**
         * List RabbitMQ vhosts
         * @summary List RabbitMQ vhosts
         * @param {RabbitMQApiListRabbitVHostsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRabbitVHosts(requestParameters, options) {
            return localVarFp.listRabbitVHosts(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
        /**
         * Update a RabbitMQ account password
         * @summary Update RabbitMQ account password
         * @param {RabbitMQApiUpdateRabbitAccountPasswordRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRabbitAccountPassword(requestParameters, options) {
            return localVarFp.updateRabbitAccountPassword(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, requestParameters.rbmqUser, options).then((request) => request(axios, basePath));
        },
        /**
         * Update a RabbitMQ account privileges
         * @summary Update RabbitMQ account privileges
         * @param {RabbitMQApiUpdateRabbitAccountPrivilegesRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateRabbitAccountPrivileges(requestParameters, options) {
            return localVarFp.updateRabbitAccountPrivileges(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, requestParameters.rbmqPermission, options).then((request) => request(axios, basePath));
        },
    };
};
exports.RabbitMQApiFactory = RabbitMQApiFactory;
/**
 * RabbitMQApi - object-oriented interface
 * @export
 * @class RabbitMQApi
 * @extends {BaseAPI}
 */
class RabbitMQApi extends base_1.BaseAPI {
    /**
     * Create a new RabbitMQ account
     * @summary Create RabbitMQ account
     * @param {RabbitMQApiCreateRabbitAccountRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RabbitMQApi
     */
    createRabbitAccount(requestParameters, options) {
        return (0, exports.RabbitMQApiFp)(this.configuration).createRabbitAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.rbmqAccountRequest, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Delete a RabbitMQ account
     * @summary Delete RabbitMQ account
     * @param {RabbitMQApiDeleteRabbitAccountRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RabbitMQApi
     */
    deleteRabbitAccount(requestParameters, options) {
        return (0, exports.RabbitMQApiFp)(this.configuration).deleteRabbitAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List all RabbitMQ accounts
     * @summary List RabbitMQ accounts
     * @param {RabbitMQApiListRabbitAccountsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RabbitMQApi
     */
    listRabbitAccounts(requestParameters, options) {
        return (0, exports.RabbitMQApiFp)(this.configuration).listRabbitAccounts(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List RabbitMQ exchanges
     * @summary List RabbitMQ exchanges
     * @param {RabbitMQApiListRabbitExchangesRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RabbitMQApi
     */
    listRabbitExchanges(requestParameters, options) {
        return (0, exports.RabbitMQApiFp)(this.configuration).listRabbitExchanges(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List RabbitMQ vhosts
     * @summary List RabbitMQ vhosts
     * @param {RabbitMQApiListRabbitVHostsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RabbitMQApi
     */
    listRabbitVHosts(requestParameters, options) {
        return (0, exports.RabbitMQApiFp)(this.configuration).listRabbitVHosts(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update a RabbitMQ account password
     * @summary Update RabbitMQ account password
     * @param {RabbitMQApiUpdateRabbitAccountPasswordRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RabbitMQApi
     */
    updateRabbitAccountPassword(requestParameters, options) {
        return (0, exports.RabbitMQApiFp)(this.configuration).updateRabbitAccountPassword(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, requestParameters.rbmqUser, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update a RabbitMQ account privileges
     * @summary Update RabbitMQ account privileges
     * @param {RabbitMQApiUpdateRabbitAccountPrivilegesRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RabbitMQApi
     */
    updateRabbitAccountPrivileges(requestParameters, options) {
        return (0, exports.RabbitMQApiFp)(this.configuration).updateRabbitAccountPrivileges(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, requestParameters.rbmqPermission, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.RabbitMQApi = RabbitMQApi;
//# sourceMappingURL=rabbit-mqapi.js.map