"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.ClusterTagApi = exports.ClusterTagApiFactory = exports.ClusterTagApiFp = exports.ClusterTagApiAxiosParamCreator = 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");
/**
 * ClusterTagApi - axios parameter creator
 * @export
 */
const ClusterTagApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * create tag
         * @summary Create cluster tags
         * @param {string} orgName
         * @param {TagCreate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createTag: async (orgName, body, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('createTag', 'orgName', orgName);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('createTag', 'body', body);
            const localVarPath = `/admin/v1/organizations/{orgName}/tags`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // 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 cluster tag
         * @summary Delete tag
         * @param {string} orgName
         * @param {string} tagId
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteTag: async (orgName, tagId, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('deleteTag', 'orgName', orgName);
            // verify required parameter 'tagId' is not null or undefined
            (0, common_1.assertParamExists)('deleteTag', 'tagId', tagId);
            const localVarPath = `/admin/v1/organizations/{orgName}/tags/{tagId}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"tagId"}}`, encodeURIComponent(String(tagId)));
            // 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,
            };
        },
        /**
         *
         * @summary Get cluster tags
         * @param {string} orgName name of the Org
         * @param {string} clusterIds Comma-separated list of cluster IDs
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTags: async (orgName, clusterIds, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getTags', 'orgName', orgName);
            // verify required parameter 'clusterIds' is not null or undefined
            (0, common_1.assertParamExists)('getTags', 'clusterIds', clusterIds);
            const localVarPath = `/admin/v1/organizations/{orgName}/clusterTags`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // 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);
            if (clusterIds !== undefined) {
                localVarQueryParameter['clusterIds'] = clusterIds;
            }
            (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 tags by organization name.
         * @summary List tags by organization name
         * @param {string} orgName name of the Org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listOrgTags: async (orgName, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listOrgTags', 'orgName', orgName);
            const localVarPath = `/admin/v1/organizations/{orgName}/tags`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // 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 cluster tags
         * @param {string} orgName
         * @param {string} tagId
         * @param {TagUpdate} tagUpdate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateTag: async (orgName, tagId, tagUpdate, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('updateTag', 'orgName', orgName);
            // verify required parameter 'tagId' is not null or undefined
            (0, common_1.assertParamExists)('updateTag', 'tagId', tagId);
            // verify required parameter 'tagUpdate' is not null or undefined
            (0, common_1.assertParamExists)('updateTag', 'tagUpdate', tagUpdate);
            const localVarPath = `/admin/v1/organizations/{orgName}/tags/{tagId}`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"tagId"}}`, encodeURIComponent(String(tagId)));
            // 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)(tagUpdate, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.ClusterTagApiAxiosParamCreator = ClusterTagApiAxiosParamCreator;
/**
 * ClusterTagApi - functional programming interface
 * @export
 */
const ClusterTagApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.ClusterTagApiAxiosParamCreator)(configuration);
    return {
        /**
         * create tag
         * @summary Create cluster tags
         * @param {string} orgName
         * @param {TagCreate} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createTag(orgName, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createTag(orgName, 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['ClusterTagApi.createTag']) === 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 cluster tag
         * @summary Delete tag
         * @param {string} orgName
         * @param {string} tagId
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteTag(orgName, tagId, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteTag(orgName, tagId, 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['ClusterTagApi.deleteTag']) === 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);
        },
        /**
         *
         * @summary Get cluster tags
         * @param {string} orgName name of the Org
         * @param {string} clusterIds Comma-separated list of cluster IDs
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getTags(orgName, clusterIds, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getTags(orgName, clusterIds, 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['ClusterTagApi.getTags']) === 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 tags by organization name.
         * @summary List tags by organization name
         * @param {string} orgName name of the Org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listOrgTags(orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listOrgTags(orgName, 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['ClusterTagApi.listOrgTags']) === 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 cluster tags
         * @param {string} orgName
         * @param {string} tagId
         * @param {TagUpdate} tagUpdate
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateTag(orgName, tagId, tagUpdate, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateTag(orgName, tagId, tagUpdate, 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['ClusterTagApi.updateTag']) === 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.ClusterTagApiFp = ClusterTagApiFp;
/**
 * ClusterTagApi - factory interface
 * @export
 */
const ClusterTagApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.ClusterTagApiFp)(configuration);
    return {
        /**
         * create tag
         * @summary Create cluster tags
         * @param {ClusterTagApiCreateTagRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createTag(requestParameters, options) {
            return localVarFp.createTag(requestParameters.orgName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * delete cluster tag
         * @summary Delete tag
         * @param {ClusterTagApiDeleteTagRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteTag(requestParameters, options) {
            return localVarFp.deleteTag(requestParameters.orgName, requestParameters.tagId, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary Get cluster tags
         * @param {ClusterTagApiGetTagsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getTags(requestParameters, options) {
            return localVarFp.getTags(requestParameters.orgName, requestParameters.clusterIds, options).then((request) => request(axios, basePath));
        },
        /**
         * List tags by organization name.
         * @summary List tags by organization name
         * @param {ClusterTagApiListOrgTagsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listOrgTags(requestParameters, options) {
            return localVarFp.listOrgTags(requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Update cluster tags
         * @param {ClusterTagApiUpdateTagRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateTag(requestParameters, options) {
            return localVarFp.updateTag(requestParameters.orgName, requestParameters.tagId, requestParameters.tagUpdate, options).then((request) => request(axios, basePath));
        },
    };
};
exports.ClusterTagApiFactory = ClusterTagApiFactory;
/**
 * ClusterTagApi - object-oriented interface
 * @export
 * @class ClusterTagApi
 * @extends {BaseAPI}
 */
class ClusterTagApi extends base_1.BaseAPI {
    /**
     * create tag
     * @summary Create cluster tags
     * @param {ClusterTagApiCreateTagRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ClusterTagApi
     */
    createTag(requestParameters, options) {
        return (0, exports.ClusterTagApiFp)(this.configuration).createTag(requestParameters.orgName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * delete cluster tag
     * @summary Delete tag
     * @param {ClusterTagApiDeleteTagRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ClusterTagApi
     */
    deleteTag(requestParameters, options) {
        return (0, exports.ClusterTagApiFp)(this.configuration).deleteTag(requestParameters.orgName, requestParameters.tagId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary Get cluster tags
     * @param {ClusterTagApiGetTagsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ClusterTagApi
     */
    getTags(requestParameters, options) {
        return (0, exports.ClusterTagApiFp)(this.configuration).getTags(requestParameters.orgName, requestParameters.clusterIds, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List tags by organization name.
     * @summary List tags by organization name
     * @param {ClusterTagApiListOrgTagsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ClusterTagApi
     */
    listOrgTags(requestParameters, options) {
        return (0, exports.ClusterTagApiFp)(this.configuration).listOrgTags(requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update cluster tags
     * @param {ClusterTagApiUpdateTagRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ClusterTagApi
     */
    updateTag(requestParameters, options) {
        return (0, exports.ClusterTagApiFp)(this.configuration).updateTag(requestParameters.orgName, requestParameters.tagId, requestParameters.tagUpdate, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.ClusterTagApi = ClusterTagApi;
//# sourceMappingURL=cluster-tag-api.js.map