"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.MssqlApi = exports.MssqlApiFactory = exports.MssqlApiFp = exports.MssqlApiAxiosParamCreator = 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");
/**
 * MssqlApi - axios parameter creator
 * @export
 */
const MssqlApiAxiosParamCreator = function (configuration) {
    return {
        /**
         *
         * @summary delete mssql account compatible with windows account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {string} account name of the account
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMssqlAccount: async (orgName, clusterName, account, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('deleteMssqlAccount', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('deleteMssqlAccount', 'clusterName', clusterName);
            // verify required parameter 'account' is not null or undefined
            (0, common_1.assertParamExists)('deleteMssqlAccount', 'account', account);
            const localVarPath = `/admin/v1/data/mssql/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: '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);
            if (account !== undefined) {
                localVarQueryParameter['account'] = account;
            }
            (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 batch modify database tde status
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {DbTDERequest} [dbTDERequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        manageMssqlTDEDatabase: async (orgName, clusterName, dbTDERequest, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('manageMssqlTDEDatabase', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('manageMssqlTDEDatabase', 'clusterName', clusterName);
            const localVarPath = `/admin/v1/data/mssql/organizations/{orgName}/clusters/{clusterName}/tde`
                .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: '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)(dbTDERequest, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         *
         * @summary update mssql account compatible with windows account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {Account} [account]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateMssqlAccount: async (orgName, clusterName, account, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('updateMssqlAccount', 'orgName', orgName);
            // verify required parameter 'clusterName' is not null or undefined
            (0, common_1.assertParamExists)('updateMssqlAccount', 'clusterName', clusterName);
            const localVarPath = `/admin/v1/data/mssql/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: '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)(account, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.MssqlApiAxiosParamCreator = MssqlApiAxiosParamCreator;
/**
 * MssqlApi - functional programming interface
 * @export
 */
const MssqlApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.MssqlApiAxiosParamCreator)(configuration);
    return {
        /**
         *
         * @summary delete mssql account compatible with windows account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {string} account name of the account
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteMssqlAccount(orgName, clusterName, account, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteMssqlAccount(orgName, clusterName, account, 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['MssqlApi.deleteMssqlAccount']) === 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 batch modify database tde status
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {DbTDERequest} [dbTDERequest]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async manageMssqlTDEDatabase(orgName, clusterName, dbTDERequest, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.manageMssqlTDEDatabase(orgName, clusterName, dbTDERequest, 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['MssqlApi.manageMssqlTDEDatabase']) === 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 update mssql account compatible with windows account
         * @param {string} orgName name of the organization
         * @param {string} clusterName name of the cluster
         * @param {Account} [account]
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateMssqlAccount(orgName, clusterName, account, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateMssqlAccount(orgName, clusterName, account, 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['MssqlApi.updateMssqlAccount']) === 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.MssqlApiFp = MssqlApiFp;
/**
 * MssqlApi - factory interface
 * @export
 */
const MssqlApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.MssqlApiFp)(configuration);
    return {
        /**
         *
         * @summary delete mssql account compatible with windows account
         * @param {MssqlApiDeleteMssqlAccountRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteMssqlAccount(requestParameters, options) {
            return localVarFp.deleteMssqlAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.account, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary batch modify database tde status
         * @param {MssqlApiManageMssqlTDEDatabaseRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        manageMssqlTDEDatabase(requestParameters, options) {
            return localVarFp.manageMssqlTDEDatabase(requestParameters.orgName, requestParameters.clusterName, requestParameters.dbTDERequest, options).then((request) => request(axios, basePath));
        },
        /**
         *
         * @summary update mssql account compatible with windows account
         * @param {MssqlApiUpdateMssqlAccountRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateMssqlAccount(requestParameters, options) {
            return localVarFp.updateMssqlAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.account, options).then((request) => request(axios, basePath));
        },
    };
};
exports.MssqlApiFactory = MssqlApiFactory;
/**
 * MssqlApi - object-oriented interface
 * @export
 * @class MssqlApi
 * @extends {BaseAPI}
 */
class MssqlApi extends base_1.BaseAPI {
    /**
     *
     * @summary delete mssql account compatible with windows account
     * @param {MssqlApiDeleteMssqlAccountRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MssqlApi
     */
    deleteMssqlAccount(requestParameters, options) {
        return (0, exports.MssqlApiFp)(this.configuration).deleteMssqlAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.account, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary batch modify database tde status
     * @param {MssqlApiManageMssqlTDEDatabaseRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MssqlApi
     */
    manageMssqlTDEDatabase(requestParameters, options) {
        return (0, exports.MssqlApiFp)(this.configuration).manageMssqlTDEDatabase(requestParameters.orgName, requestParameters.clusterName, requestParameters.dbTDERequest, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     *
     * @summary update mssql account compatible with windows account
     * @param {MssqlApiUpdateMssqlAccountRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MssqlApi
     */
    updateMssqlAccount(requestParameters, options) {
        return (0, exports.MssqlApiFp)(this.configuration).updateMssqlAccount(requestParameters.orgName, requestParameters.clusterName, requestParameters.account, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.MssqlApi = MssqlApi;
//# sourceMappingURL=mssql-api.js.map