"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.SLAApi = exports.SLAApiFactory = exports.SLAApiFp = exports.SLAApiAxiosParamCreator = 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");
/**
 * SLAApi - axios parameter creator
 * @export
 */
const SLAApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Calculate daily SLA for a environment or a cluster since a specific date
         * @summary Calculate daily SLA for a environment or a cluster since a specific date
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [clusterID] id of the cluster
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {number} [timezoneOffset] timezone offset in seconds, e.g. offset of UTC+08:00 is +8 * 60 * 60, default is 0
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        calculateDailySLA: async (startTime, endTime, environmentName, clusterID, engine, orgName, timezoneOffset, options = {}) => {
            // verify required parameter 'startTime' is not null or undefined
            (0, common_1.assertParamExists)('calculateDailySLA', 'startTime', startTime);
            // verify required parameter 'endTime' is not null or undefined
            (0, common_1.assertParamExists)('calculateDailySLA', 'endTime', endTime);
            const localVarPath = `/admin/v1/sla/daily`;
            // 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 (environmentName) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            if (startTime !== undefined) {
                localVarQueryParameter['startTime'] = startTime;
            }
            if (endTime !== undefined) {
                localVarQueryParameter['endTime'] = endTime;
            }
            if (clusterID) {
                localVarQueryParameter['clusterID'] = clusterID;
            }
            if (engine) {
                localVarQueryParameter['engine'] = engine;
            }
            if (orgName) {
                localVarQueryParameter['orgName'] = orgName;
            }
            if (timezoneOffset !== undefined) {
                localVarQueryParameter['timezoneOffset'] = timezoneOffset;
            }
            (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,
            };
        },
        /**
         * Calculate SLA for a environment
         * @summary Calculate SLA for a environment
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [clusterID] id of the cluster
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {string} [clusterNamePrefix] Filter clusters by name prefix (fuzzy search).
         * @param {number} [page] Page number for pagination, starts from 1.
         * @param {number} [pageSize] Number of items per page.
         * @param {string} [orderBy] Order by field, available values are \&quot;clusterName\&quot;, \&quot;engine\&quot;.
         * @param {boolean} [desc] Whether to sort in descending order.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        calculateSLA: async (startTime, endTime, environmentName, clusterID, engine, orgName, clusterNamePrefix, page, pageSize, orderBy, desc, options = {}) => {
            // verify required parameter 'startTime' is not null or undefined
            (0, common_1.assertParamExists)('calculateSLA', 'startTime', startTime);
            // verify required parameter 'endTime' is not null or undefined
            (0, common_1.assertParamExists)('calculateSLA', 'endTime', endTime);
            const localVarPath = `/admin/v1/sla`;
            // 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 (environmentName) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            if (clusterID) {
                localVarQueryParameter['clusterID'] = clusterID;
            }
            if (engine) {
                localVarQueryParameter['engine'] = engine;
            }
            if (orgName) {
                localVarQueryParameter['orgName'] = orgName;
            }
            if (startTime !== undefined) {
                localVarQueryParameter['startTime'] = startTime;
            }
            if (endTime !== undefined) {
                localVarQueryParameter['endTime'] = endTime;
            }
            if (clusterNamePrefix !== undefined) {
                localVarQueryParameter['clusterNamePrefix'] = clusterNamePrefix;
            }
            if (page !== undefined) {
                localVarQueryParameter['page'] = page;
            }
            if (pageSize !== undefined) {
                localVarQueryParameter['pageSize'] = pageSize;
            }
            if (orderBy !== undefined) {
                localVarQueryParameter['orderBy'] = orderBy;
            }
            if (desc !== undefined) {
                localVarQueryParameter['desc'] = desc;
            }
            (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 SLA settings in a environment
         * @summary Get SLA settings
         * @param {string} environmentName name of the environment
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getSLASettingsInEnv: async (environmentName, options = {}) => {
            // verify required parameter 'environmentName' is not null or undefined
            (0, common_1.assertParamExists)('getSLASettingsInEnv', 'environmentName', environmentName);
            const localVarPath = `/admin/v1/sla/settings`;
            // 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 (environmentName !== undefined) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            (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 SLA supported engines in a environment
         * @summary Get SLA supported engines
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getSLASupportEngines: async (options = {}) => {
            const localVarPath = `/admin/v1/sla/engines`;
            // 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 outage record for environments
         * @summary List outage record for environments
         * @param {string} [environmentName] name of the environment, if not specified, return all environments
         * @param {string} [orgName] name of the organization
         * @param {string} [clusterID] id of the cluster
         * @param {boolean} [activeOnly] whether to return only active outage records
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listEnvironmentOutageRecord: async (environmentName, orgName, clusterID, activeOnly, options = {}) => {
            const localVarPath = `/admin/v1/sla/outages`;
            // 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 (environmentName !== undefined) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            if (orgName !== undefined) {
                localVarQueryParameter['orgName'] = orgName;
            }
            if (clusterID !== undefined) {
                localVarQueryParameter['clusterID'] = clusterID;
            }
            if (activeOnly !== undefined) {
                localVarQueryParameter['activeOnly'] = activeOnly;
            }
            (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 SLA rank for a environment
         * @summary List SLA rank for a environment
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {number} [limit] Number of items per page.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listSLARank: async (startTime, endTime, environmentName, engine, orgName, limit, options = {}) => {
            // verify required parameter 'startTime' is not null or undefined
            (0, common_1.assertParamExists)('listSLARank', 'startTime', startTime);
            // verify required parameter 'endTime' is not null or undefined
            (0, common_1.assertParamExists)('listSLARank', 'endTime', endTime);
            const localVarPath = `/admin/v1/sla/rank`;
            // 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 (environmentName) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            if (engine) {
                localVarQueryParameter['engine'] = engine;
            }
            if (orgName) {
                localVarQueryParameter['orgName'] = orgName;
            }
            if (startTime !== undefined) {
                localVarQueryParameter['startTime'] = startTime;
            }
            if (endTime !== undefined) {
                localVarQueryParameter['endTime'] = endTime;
            }
            if (limit !== undefined) {
                localVarQueryParameter['limit'] = limit;
            }
            (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 uncompliant clusters that sla lower than the threshold
         * @summary List uncompliant clusters
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUncompliantClusters: async (startTime, endTime, environmentName, engine, orgName, options = {}) => {
            // verify required parameter 'startTime' is not null or undefined
            (0, common_1.assertParamExists)('listUncompliantClusters', 'startTime', startTime);
            // verify required parameter 'endTime' is not null or undefined
            (0, common_1.assertParamExists)('listUncompliantClusters', 'endTime', endTime);
            const localVarPath = `/admin/v1/sla/uncompliant`;
            // 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 (environmentName) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            if (engine) {
                localVarQueryParameter['engine'] = engine;
            }
            if (orgName) {
                localVarQueryParameter['orgName'] = orgName;
            }
            if (startTime !== undefined) {
                localVarQueryParameter['startTime'] = startTime;
            }
            if (endTime !== undefined) {
                localVarQueryParameter['endTime'] = endTime;
            }
            (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 SLA settings in a environment
         * @summary Update SLA settings
         * @param {string} environmentName name of the environment
         * @param {SLASettings} sLASettings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateSLASettingsInEnv: async (environmentName, sLASettings, options = {}) => {
            // verify required parameter 'environmentName' is not null or undefined
            (0, common_1.assertParamExists)('updateSLASettingsInEnv', 'environmentName', environmentName);
            // verify required parameter 'sLASettings' is not null or undefined
            (0, common_1.assertParamExists)('updateSLASettingsInEnv', 'sLASettings', sLASettings);
            const localVarPath = `/admin/v1/sla/settings`;
            // 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);
            if (environmentName !== undefined) {
                localVarQueryParameter['environmentName'] = environmentName;
            }
            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)(sLASettings, localVarRequestOptions, configuration);
            return {
                url: (0, common_1.toPathString)(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    };
};
exports.SLAApiAxiosParamCreator = SLAApiAxiosParamCreator;
/**
 * SLAApi - functional programming interface
 * @export
 */
const SLAApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.SLAApiAxiosParamCreator)(configuration);
    return {
        /**
         * Calculate daily SLA for a environment or a cluster since a specific date
         * @summary Calculate daily SLA for a environment or a cluster since a specific date
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [clusterID] id of the cluster
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {number} [timezoneOffset] timezone offset in seconds, e.g. offset of UTC+08:00 is +8 * 60 * 60, default is 0
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async calculateDailySLA(startTime, endTime, environmentName, clusterID, engine, orgName, timezoneOffset, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.calculateDailySLA(startTime, endTime, environmentName, clusterID, engine, orgName, timezoneOffset, 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['SLAApi.calculateDailySLA']) === 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);
        },
        /**
         * Calculate SLA for a environment
         * @summary Calculate SLA for a environment
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [clusterID] id of the cluster
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {string} [clusterNamePrefix] Filter clusters by name prefix (fuzzy search).
         * @param {number} [page] Page number for pagination, starts from 1.
         * @param {number} [pageSize] Number of items per page.
         * @param {string} [orderBy] Order by field, available values are \&quot;clusterName\&quot;, \&quot;engine\&quot;.
         * @param {boolean} [desc] Whether to sort in descending order.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async calculateSLA(startTime, endTime, environmentName, clusterID, engine, orgName, clusterNamePrefix, page, pageSize, orderBy, desc, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.calculateSLA(startTime, endTime, environmentName, clusterID, engine, orgName, clusterNamePrefix, page, pageSize, orderBy, desc, 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['SLAApi.calculateSLA']) === 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 SLA settings in a environment
         * @summary Get SLA settings
         * @param {string} environmentName name of the environment
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getSLASettingsInEnv(environmentName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getSLASettingsInEnv(environmentName, 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['SLAApi.getSLASettingsInEnv']) === 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 SLA supported engines in a environment
         * @summary Get SLA supported engines
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getSLASupportEngines(options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getSLASupportEngines(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['SLAApi.getSLASupportEngines']) === 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 outage record for environments
         * @summary List outage record for environments
         * @param {string} [environmentName] name of the environment, if not specified, return all environments
         * @param {string} [orgName] name of the organization
         * @param {string} [clusterID] id of the cluster
         * @param {boolean} [activeOnly] whether to return only active outage records
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listEnvironmentOutageRecord(environmentName, orgName, clusterID, activeOnly, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listEnvironmentOutageRecord(environmentName, orgName, clusterID, activeOnly, 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['SLAApi.listEnvironmentOutageRecord']) === 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 SLA rank for a environment
         * @summary List SLA rank for a environment
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {number} [limit] Number of items per page.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listSLARank(startTime, endTime, environmentName, engine, orgName, limit, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listSLARank(startTime, endTime, environmentName, engine, orgName, limit, 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['SLAApi.listSLARank']) === 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 uncompliant clusters that sla lower than the threshold
         * @summary List uncompliant clusters
         * @param {number} startTime SLA calculation start time Unix timestamp, unit is second.
         * @param {number} endTime SLA calculation end time Unix timestamp, unit is second.
         * @param {Array<string>} [environmentName] name of the environment
         * @param {Array<string>} [engine] database engine type
         * @param {Array<string>} [orgName] name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listUncompliantClusters(startTime, endTime, environmentName, engine, orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listUncompliantClusters(startTime, endTime, environmentName, engine, 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['SLAApi.listUncompliantClusters']) === 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 SLA settings in a environment
         * @summary Update SLA settings
         * @param {string} environmentName name of the environment
         * @param {SLASettings} sLASettings
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async updateSLASettingsInEnv(environmentName, sLASettings, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.updateSLASettingsInEnv(environmentName, sLASettings, 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['SLAApi.updateSLASettingsInEnv']) === 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.SLAApiFp = SLAApiFp;
/**
 * SLAApi - factory interface
 * @export
 */
const SLAApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.SLAApiFp)(configuration);
    return {
        /**
         * Calculate daily SLA for a environment or a cluster since a specific date
         * @summary Calculate daily SLA for a environment or a cluster since a specific date
         * @param {SLAApiCalculateDailySLARequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        calculateDailySLA(requestParameters, options) {
            return localVarFp.calculateDailySLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.timezoneOffset, options).then((request) => request(axios, basePath));
        },
        /**
         * Calculate SLA for a environment
         * @summary Calculate SLA for a environment
         * @param {SLAApiCalculateSLARequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        calculateSLA(requestParameters, options) {
            return localVarFp.calculateSLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.clusterNamePrefix, requestParameters.page, requestParameters.pageSize, requestParameters.orderBy, requestParameters.desc, options).then((request) => request(axios, basePath));
        },
        /**
         * Get SLA settings in a environment
         * @summary Get SLA settings
         * @param {SLAApiGetSLASettingsInEnvRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getSLASettingsInEnv(requestParameters, options) {
            return localVarFp.getSLASettingsInEnv(requestParameters.environmentName, options).then((request) => request(axios, basePath));
        },
        /**
         * Get SLA supported engines in a environment
         * @summary Get SLA supported engines
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getSLASupportEngines(options) {
            return localVarFp.getSLASupportEngines(options).then((request) => request(axios, basePath));
        },
        /**
         * List outage record for environments
         * @summary List outage record for environments
         * @param {SLAApiListEnvironmentOutageRecordRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listEnvironmentOutageRecord(requestParameters = {}, options) {
            return localVarFp.listEnvironmentOutageRecord(requestParameters.environmentName, requestParameters.orgName, requestParameters.clusterID, requestParameters.activeOnly, options).then((request) => request(axios, basePath));
        },
        /**
         * List SLA rank for a environment
         * @summary List SLA rank for a environment
         * @param {SLAApiListSLARankRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listSLARank(requestParameters, options) {
            return localVarFp.listSLARank(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, requestParameters.limit, options).then((request) => request(axios, basePath));
        },
        /**
         * List uncompliant clusters that sla lower than the threshold
         * @summary List uncompliant clusters
         * @param {SLAApiListUncompliantClustersRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listUncompliantClusters(requestParameters, options) {
            return localVarFp.listUncompliantClusters(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Update SLA settings in a environment
         * @summary Update SLA settings
         * @param {SLAApiUpdateSLASettingsInEnvRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        updateSLASettingsInEnv(requestParameters, options) {
            return localVarFp.updateSLASettingsInEnv(requestParameters.environmentName, requestParameters.sLASettings, options).then((request) => request(axios, basePath));
        },
    };
};
exports.SLAApiFactory = SLAApiFactory;
/**
 * SLAApi - object-oriented interface
 * @export
 * @class SLAApi
 * @extends {BaseAPI}
 */
class SLAApi extends base_1.BaseAPI {
    /**
     * Calculate daily SLA for a environment or a cluster since a specific date
     * @summary Calculate daily SLA for a environment or a cluster since a specific date
     * @param {SLAApiCalculateDailySLARequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    calculateDailySLA(requestParameters, options) {
        return (0, exports.SLAApiFp)(this.configuration).calculateDailySLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.timezoneOffset, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Calculate SLA for a environment
     * @summary Calculate SLA for a environment
     * @param {SLAApiCalculateSLARequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    calculateSLA(requestParameters, options) {
        return (0, exports.SLAApiFp)(this.configuration).calculateSLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.clusterNamePrefix, requestParameters.page, requestParameters.pageSize, requestParameters.orderBy, requestParameters.desc, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get SLA settings in a environment
     * @summary Get SLA settings
     * @param {SLAApiGetSLASettingsInEnvRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    getSLASettingsInEnv(requestParameters, options) {
        return (0, exports.SLAApiFp)(this.configuration).getSLASettingsInEnv(requestParameters.environmentName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Get SLA supported engines in a environment
     * @summary Get SLA supported engines
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    getSLASupportEngines(options) {
        return (0, exports.SLAApiFp)(this.configuration).getSLASupportEngines(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List outage record for environments
     * @summary List outage record for environments
     * @param {SLAApiListEnvironmentOutageRecordRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    listEnvironmentOutageRecord(requestParameters = {}, options) {
        return (0, exports.SLAApiFp)(this.configuration).listEnvironmentOutageRecord(requestParameters.environmentName, requestParameters.orgName, requestParameters.clusterID, requestParameters.activeOnly, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List SLA rank for a environment
     * @summary List SLA rank for a environment
     * @param {SLAApiListSLARankRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    listSLARank(requestParameters, options) {
        return (0, exports.SLAApiFp)(this.configuration).listSLARank(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, requestParameters.limit, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * List uncompliant clusters that sla lower than the threshold
     * @summary List uncompliant clusters
     * @param {SLAApiListUncompliantClustersRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    listUncompliantClusters(requestParameters, options) {
        return (0, exports.SLAApiFp)(this.configuration).listUncompliantClusters(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Update SLA settings in a environment
     * @summary Update SLA settings
     * @param {SLAApiUpdateSLASettingsInEnvRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SLAApi
     */
    updateSLASettingsInEnv(requestParameters, options) {
        return (0, exports.SLAApiFp)(this.configuration).updateSLASettingsInEnv(requestParameters.environmentName, requestParameters.sLASettings, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.SLAApi = SLAApi;
//# sourceMappingURL=slaapi.js.map