"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * KubeBlocks Cloud API
 * KubeBlocks Cloud API is a RESTful API for managing KubeBlocks Cloud resources.  The API is organized around REST.  Our API has predictable resource-oriented URLs, accepts `JSON-encoded` request bodies, returns `JSON-encoded` responses, and uses standard HTTP response codes, authentication, and verbs.  We use standard HTTP authentication and provide API keys to identify who you are. Your API keys carry many privileges, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.
 *
 * 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.HiveApi = exports.HiveApiFactory = exports.HiveApiFp = exports.HiveApiAxiosParamCreator = 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");
/**
 * HiveApi - axios parameter creator
 * @export
 */
const HiveApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * create an hive account
         * @summary Create Hive account
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {Account} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createHiveAccount: async (orgName, clusterName, body, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('createHiveAccount', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('createHiveAccount', 'clusterName', clusterName);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('createHiveAccount', 'body', body);
            const localVarPath = `/api/v1/data/hive/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)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * delete an hive account in cluster
         * @summary Delete hive account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {string} accountName name of the account
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteHiveAccount: async (orgName, clusterName, accountName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('deleteHiveAccount', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('deleteHiveAccount', 'clusterName', clusterName);
            // verify required parameter 'accountName' is not null or undefined
            (0, common_1.assertParamExists)('deleteHiveAccount', 'accountName', accountName);
            const localVarPath = `/api/v1/data/hive/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,
            };
        },
        /**
         * Get Hive accounts
         * @summary Get Hive accounts
         * @param {string} orgName The name of organization
         * @param {string} clusterName The name of cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getHiveAccounts: async (orgName, clusterName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getHiveAccounts', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('getHiveAccounts', 'clusterName', clusterName);
            const localVarPath = `/api/v1/data/hive/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,
            };
        },
        /**
         * update an hive account in cluster
         * @summary update hive account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {string} accountName name of the account
         * @param {Account} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateHiveAccount: async (orgName, clusterName, accountName, body, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('updateHiveAccount', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('updateHiveAccount', 'clusterName', clusterName);
            // verify required parameter 'accountName' is not null or undefined
            (0, common_1.assertParamExists)('updateHiveAccount', 'accountName', accountName);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('updateHiveAccount', 'body', body);
            const localVarPath = `/api/v1/data/hive/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)(body, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.HiveApiAxiosParamCreator = HiveApiAxiosParamCreator;
/**
 * HiveApi - functional programming interface
 * @export
 */
const HiveApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.HiveApiAxiosParamCreator)(configuration);
    return {
        /**
         * create an hive account
         * @summary Create Hive account
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the Cluster
         * @param {Account} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createHiveAccount(orgName, clusterName, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createHiveAccount(orgName, clusterName, 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['HiveApi.createHiveAccount']) === 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 an hive account in cluster
         * @summary Delete hive account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {string} accountName name of the account
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteHiveAccount(orgName, clusterName, accountName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteHiveAccount(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['HiveApi.deleteHiveAccount']) === 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 Hive accounts
         * @summary Get Hive accounts
         * @param {string} orgName The name of organization
         * @param {string} clusterName The name of cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getHiveAccounts(orgName, clusterName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getHiveAccounts(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['HiveApi.getHiveAccounts']) === 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 an hive account in cluster
         * @summary update hive account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {string} accountName name of the account
         * @param {Account} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateHiveAccount(orgName, clusterName, accountName, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateHiveAccount(orgName, clusterName, accountName, 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['HiveApi.updateHiveAccount']) === 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.HiveApiFp = HiveApiFp;
/**
 * HiveApi - factory interface
 * @export
 */
const HiveApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.HiveApiFp)(configuration);
    return {
        /**
         * create an hive account
         * @summary Create Hive account
         * @param {HiveApiCreateHiveAccountRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createHiveAccount(requestParameters, options) {
            return localVarFp.createHiveAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * delete an hive account in cluster
         * @summary Delete hive account
         * @param {HiveApiDeleteHiveAccountRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteHiveAccount(requestParameters, options) {
            return localVarFp.deleteHiveAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, options).then((request) => request(axios, basePath));
        },
        /**
         * Get Hive accounts
         * @summary Get Hive accounts
         * @param {HiveApiGetHiveAccountsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getHiveAccounts(requestParameters, options) {
            return localVarFp.getHiveAccounts(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
        /**
         * update an hive account in cluster
         * @summary update hive account
         * @param {HiveApiUpdateHiveAccountRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateHiveAccount(requestParameters, options) {
            return localVarFp.updateHiveAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};
exports.HiveApiFactory = HiveApiFactory;
/**
 * HiveApi - object-oriented interface
 * @export
 * @class HiveApi
 * @extends {BaseAPI}
 */
class HiveApi extends base_1.BaseAPI {
    /**
     * create an hive account
     * @summary Create Hive account
     * @param {HiveApiCreateHiveAccountRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof HiveApi
     */
    createHiveAccount(requestParameters, options) {
        return (0, exports.HiveApiFp)(this.configuration).createHiveAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * delete an hive account in cluster
     * @summary Delete hive account
     * @param {HiveApiDeleteHiveAccountRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof HiveApi
     */
    deleteHiveAccount(requestParameters, options) {
        return (0, exports.HiveApiFp)(this.configuration).deleteHiveAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get Hive accounts
     * @summary Get Hive accounts
     * @param {HiveApiGetHiveAccountsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof HiveApi
     */
    getHiveAccounts(requestParameters, options) {
        return (0, exports.HiveApiFp)(this.configuration).getHiveAccounts(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * update an hive account in cluster
     * @summary update hive account
     * @param {HiveApiUpdateHiveAccountRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof HiveApi
     */
    updateHiveAccount(requestParameters, options) {
        return (0, exports.HiveApiFp)(this.configuration).updateHiveAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.accountName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.HiveApi = HiveApi;
//# sourceMappingURL=hive-api.js.map