"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.BlueGreenDeploymentApi = exports.BlueGreenDeploymentApiFactory = exports.BlueGreenDeploymentApiFp = exports.BlueGreenDeploymentApiAxiosParamCreator = 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");
/**
 * BlueGreenDeploymentApi - axios parameter creator
 * @export
 */
const BlueGreenDeploymentApiAxiosParamCreator = function (configuration) {
    return {
        /**
         * Create a blue-green deployment instance for the specified parent cluster.
         * @summary Create a new blue-green deployment instance
         * @param {string} parentClusterID The unique identifier of the parent database cluster
         * @param {string} orgName Name of the organization
         * @param {BlueGreenDeploymentCreation} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBlueGreenDeployment: async (parentClusterID, orgName, body, options = {}) => {
            // verify required parameter 'parentClusterID' is not null or undefined
            (0, common_1.assertParamExists)('createBlueGreenDeployment', 'parentClusterID', parentClusterID);
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('createBlueGreenDeployment', 'orgName', orgName);
            // verify required parameter 'body' is not null or undefined
            (0, common_1.assertParamExists)('createBlueGreenDeployment', 'body', body);
            const localVarPath = `/api/v1/organizations/{orgName}/parent/{parentClusterID}/blueGreenDeployment`
                .replace(`{${"parentClusterID"}}`, encodeURIComponent(String(parentClusterID)))
                .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,
            };
        },
        /**
         * Trigger a precheck task to verify settings or readiness for blue-green deployment.
         * @summary Run a precheck for blue-green deployment
         * @param {string} orgName Name of the organization
         * @param {string} parentClusterID The unique identifier of the parent database cluster
         * @param {string} greenClusterVersion The version of the green cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBlueGreenDeploymentPreCheck: async (orgName, parentClusterID, greenClusterVersion, options = {}) => {
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('createBlueGreenDeploymentPreCheck', 'orgName', orgName);
            // verify required parameter 'parentClusterID' is not null or undefined
            (0, common_1.assertParamExists)('createBlueGreenDeploymentPreCheck', 'parentClusterID', parentClusterID);
            // verify required parameter 'greenClusterVersion' is not null or undefined
            (0, common_1.assertParamExists)('createBlueGreenDeploymentPreCheck', 'greenClusterVersion', greenClusterVersion);
            const localVarPath = `/api/v1/organizations/{orgName}/parent/{parentClusterID}/blueGreenDeployment/precheck`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"parentClusterID"}}`, encodeURIComponent(String(parentClusterID)));
            // 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);
            if (greenClusterVersion !== undefined) {
                localVarQueryParameter['greenClusterVersion'] = greenClusterVersion;
            }
            (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,
            };
        },
        /**
         * Delete a specified blue-green deployment instance.
         * @summary Delete a blue-green deployment instance
         * @param {string} deploymentID The unique identifier of the blue-green deployment instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteBlueGreenDeployment: async (deploymentID, orgName, options = {}) => {
            // verify required parameter 'deploymentID' is not null or undefined
            (0, common_1.assertParamExists)('deleteBlueGreenDeployment', 'deploymentID', deploymentID);
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('deleteBlueGreenDeployment', 'orgName', orgName);
            const localVarPath = `/api/v1/organizations/{orgName}/blueGreenDeployment/{deploymentID}`
                .replace(`{${"deploymentID"}}`, encodeURIComponent(String(deploymentID)))
                .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: '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,
            };
        },
        /**
         * Retrieve details for a single blue-green deployment instance by parent cluster and organization.
         * @summary Get a blue-green deployment instance
         * @param {string} deploymentID The unique identifier of the blue-green deployment instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBlueGreenDeployment: async (deploymentID, orgName, options = {}) => {
            // verify required parameter 'deploymentID' is not null or undefined
            (0, common_1.assertParamExists)('getBlueGreenDeployment', 'deploymentID', deploymentID);
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getBlueGreenDeployment', 'orgName', orgName);
            const localVarPath = `/api/v1/organizations/{orgName}/blueGreenDeployment/{deploymentID}`
                .replace(`{${"deploymentID"}}`, encodeURIComponent(String(deploymentID)))
                .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,
            };
        },
        /**
         * Retrieve the details of a precheck task for a blue-green deployment.
         * @summary Get blue-green deployment precheck task detail
         * @param {string} preCheckID The unique identifier of the precheck task
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBlueGreenDeploymentPreCheckDetail: async (preCheckID, orgName, options = {}) => {
            // verify required parameter 'preCheckID' is not null or undefined
            (0, common_1.assertParamExists)('getBlueGreenDeploymentPreCheckDetail', 'preCheckID', preCheckID);
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getBlueGreenDeploymentPreCheckDetail', 'orgName', orgName);
            const localVarPath = `/api/v1/organizations/{orgName}/blueGreenDeployment/precheck/{preCheckID}`
                .replace(`{${"preCheckID"}}`, encodeURIComponent(String(preCheckID)))
                .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,
            };
        },
        /**
         * Retrieve detailed information about the switch-over operation for a blue-green deployment cluster.
         * @summary Get blue-green deployment switch job detail
         * @param {string} deploymentID The unique identifier of the blue-green deployment instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBlueGreenDeploymentSwitchDetail: async (deploymentID, orgName, options = {}) => {
            // verify required parameter 'deploymentID' is not null or undefined
            (0, common_1.assertParamExists)('getBlueGreenDeploymentSwitchDetail', 'deploymentID', deploymentID);
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('getBlueGreenDeploymentSwitchDetail', 'orgName', orgName);
            const localVarPath = `/api/v1/organizations/{orgName}/blueGreenDeployment/{deploymentID}/switch`
                .replace(`{${"deploymentID"}}`, encodeURIComponent(String(deploymentID)))
                .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,
            };
        },
        /**
         * Retrieve a list of blue-green deployment instances associated with the given parent database cluster.
         * @summary List blue-green deployment instances for the specified parent cluster
         * @param {string} parentClusterID The unique identifier of the parent database cluster
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listBlueGreenDeployments: async (parentClusterID, orgName, options = {}) => {
            // verify required parameter 'parentClusterID' is not null or undefined
            (0, common_1.assertParamExists)('listBlueGreenDeployments', 'parentClusterID', parentClusterID);
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('listBlueGreenDeployments', 'orgName', orgName);
            const localVarPath = `/api/v1/organizations/{orgName}/parent/{parentClusterID}/blueGreenDeployment`
                .replace(`{${"parentClusterID"}}`, encodeURIComponent(String(parentClusterID)))
                .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,
            };
        },
        /**
         * Switch the specified blue-green deployment cluster to act as the primary instance.
         * @summary Switch roles of blue-green deployment instances
         * @param {string} deploymentID The unique identifier of the blue-green deployment cluster
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        switchBlueGreenDeployment: async (deploymentID, orgName, options = {}) => {
            // verify required parameter 'deploymentID' is not null or undefined
            (0, common_1.assertParamExists)('switchBlueGreenDeployment', 'deploymentID', deploymentID);
            // verify required parameter 'orgName' is not null or undefined
            (0, common_1.assertParamExists)('switchBlueGreenDeployment', 'orgName', orgName);
            const localVarPath = `/api/v1/organizations/{orgName}/blueGreenDeployment/{deploymentID}/switch`
                .replace(`{${"deploymentID"}}`, encodeURIComponent(String(deploymentID)))
                .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);
            (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,
            };
        },
    };
};
exports.BlueGreenDeploymentApiAxiosParamCreator = BlueGreenDeploymentApiAxiosParamCreator;
/**
 * BlueGreenDeploymentApi - functional programming interface
 * @export
 */
const BlueGreenDeploymentApiFp = function (configuration) {
    const localVarAxiosParamCreator = (0, exports.BlueGreenDeploymentApiAxiosParamCreator)(configuration);
    return {
        /**
         * Create a blue-green deployment instance for the specified parent cluster.
         * @summary Create a new blue-green deployment instance
         * @param {string} parentClusterID The unique identifier of the parent database cluster
         * @param {string} orgName Name of the organization
         * @param {BlueGreenDeploymentCreation} body
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createBlueGreenDeployment(parentClusterID, orgName, body, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createBlueGreenDeployment(parentClusterID, 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['BlueGreenDeploymentApi.createBlueGreenDeployment']) === 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);
        },
        /**
         * Trigger a precheck task to verify settings or readiness for blue-green deployment.
         * @summary Run a precheck for blue-green deployment
         * @param {string} orgName Name of the organization
         * @param {string} parentClusterID The unique identifier of the parent database cluster
         * @param {string} greenClusterVersion The version of the green cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createBlueGreenDeploymentPreCheck(orgName, parentClusterID, greenClusterVersion, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.createBlueGreenDeploymentPreCheck(orgName, parentClusterID, greenClusterVersion, 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['BlueGreenDeploymentApi.createBlueGreenDeploymentPreCheck']) === null || _b === void 0 ? void 0 : _b[localVarOperationServerIndex]) === null || _c === void 0 ? void 0 : _c.url;
            return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Delete a specified blue-green deployment instance.
         * @summary Delete a blue-green deployment instance
         * @param {string} deploymentID The unique identifier of the blue-green deployment instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteBlueGreenDeployment(deploymentID, orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteBlueGreenDeployment(deploymentID, 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['BlueGreenDeploymentApi.deleteBlueGreenDeployment']) === 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);
        },
        /**
         * Retrieve details for a single blue-green deployment instance by parent cluster and organization.
         * @summary Get a blue-green deployment instance
         * @param {string} deploymentID The unique identifier of the blue-green deployment instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getBlueGreenDeployment(deploymentID, orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getBlueGreenDeployment(deploymentID, 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['BlueGreenDeploymentApi.getBlueGreenDeployment']) === 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);
        },
        /**
         * Retrieve the details of a precheck task for a blue-green deployment.
         * @summary Get blue-green deployment precheck task detail
         * @param {string} preCheckID The unique identifier of the precheck task
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getBlueGreenDeploymentPreCheckDetail(preCheckID, orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getBlueGreenDeploymentPreCheckDetail(preCheckID, 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['BlueGreenDeploymentApi.getBlueGreenDeploymentPreCheckDetail']) === 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);
        },
        /**
         * Retrieve detailed information about the switch-over operation for a blue-green deployment cluster.
         * @summary Get blue-green deployment switch job detail
         * @param {string} deploymentID The unique identifier of the blue-green deployment instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getBlueGreenDeploymentSwitchDetail(deploymentID, orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.getBlueGreenDeploymentSwitchDetail(deploymentID, 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['BlueGreenDeploymentApi.getBlueGreenDeploymentSwitchDetail']) === 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);
        },
        /**
         * Retrieve a list of blue-green deployment instances associated with the given parent database cluster.
         * @summary List blue-green deployment instances for the specified parent cluster
         * @param {string} parentClusterID The unique identifier of the parent database cluster
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listBlueGreenDeployments(parentClusterID, orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.listBlueGreenDeployments(parentClusterID, 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['BlueGreenDeploymentApi.listBlueGreenDeployments']) === 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);
        },
        /**
         * Switch the specified blue-green deployment cluster to act as the primary instance.
         * @summary Switch roles of blue-green deployment instances
         * @param {string} deploymentID The unique identifier of the blue-green deployment cluster
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async switchBlueGreenDeployment(deploymentID, orgName, options) {
            var _a, _b, _c;
            const localVarAxiosArgs = await localVarAxiosParamCreator.switchBlueGreenDeployment(deploymentID, 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['BlueGreenDeploymentApi.switchBlueGreenDeployment']) === 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.BlueGreenDeploymentApiFp = BlueGreenDeploymentApiFp;
/**
 * BlueGreenDeploymentApi - factory interface
 * @export
 */
const BlueGreenDeploymentApiFactory = function (configuration, basePath, axios) {
    const localVarFp = (0, exports.BlueGreenDeploymentApiFp)(configuration);
    return {
        /**
         * Create a blue-green deployment instance for the specified parent cluster.
         * @summary Create a new blue-green deployment instance
         * @param {BlueGreenDeploymentApiCreateBlueGreenDeploymentRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBlueGreenDeployment(requestParameters, options) {
            return localVarFp.createBlueGreenDeployment(requestParameters.parentClusterID, requestParameters.orgName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * Trigger a precheck task to verify settings or readiness for blue-green deployment.
         * @summary Run a precheck for blue-green deployment
         * @param {BlueGreenDeploymentApiCreateBlueGreenDeploymentPreCheckRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBlueGreenDeploymentPreCheck(requestParameters, options) {
            return localVarFp.createBlueGreenDeploymentPreCheck(requestParameters.orgName, requestParameters.parentClusterID, requestParameters.greenClusterVersion, options).then((request) => request(axios, basePath));
        },
        /**
         * Delete a specified blue-green deployment instance.
         * @summary Delete a blue-green deployment instance
         * @param {BlueGreenDeploymentApiDeleteBlueGreenDeploymentRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteBlueGreenDeployment(requestParameters, options) {
            return localVarFp.deleteBlueGreenDeployment(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve details for a single blue-green deployment instance by parent cluster and organization.
         * @summary Get a blue-green deployment instance
         * @param {BlueGreenDeploymentApiGetBlueGreenDeploymentRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBlueGreenDeployment(requestParameters, options) {
            return localVarFp.getBlueGreenDeployment(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve the details of a precheck task for a blue-green deployment.
         * @summary Get blue-green deployment precheck task detail
         * @param {BlueGreenDeploymentApiGetBlueGreenDeploymentPreCheckDetailRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBlueGreenDeploymentPreCheckDetail(requestParameters, options) {
            return localVarFp.getBlueGreenDeploymentPreCheckDetail(requestParameters.preCheckID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve detailed information about the switch-over operation for a blue-green deployment cluster.
         * @summary Get blue-green deployment switch job detail
         * @param {BlueGreenDeploymentApiGetBlueGreenDeploymentSwitchDetailRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getBlueGreenDeploymentSwitchDetail(requestParameters, options) {
            return localVarFp.getBlueGreenDeploymentSwitchDetail(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve a list of blue-green deployment instances associated with the given parent database cluster.
         * @summary List blue-green deployment instances for the specified parent cluster
         * @param {BlueGreenDeploymentApiListBlueGreenDeploymentsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listBlueGreenDeployments(requestParameters, options) {
            return localVarFp.listBlueGreenDeployments(requestParameters.parentClusterID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Switch the specified blue-green deployment cluster to act as the primary instance.
         * @summary Switch roles of blue-green deployment instances
         * @param {BlueGreenDeploymentApiSwitchBlueGreenDeploymentRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        switchBlueGreenDeployment(requestParameters, options) {
            return localVarFp.switchBlueGreenDeployment(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
    };
};
exports.BlueGreenDeploymentApiFactory = BlueGreenDeploymentApiFactory;
/**
 * BlueGreenDeploymentApi - object-oriented interface
 * @export
 * @class BlueGreenDeploymentApi
 * @extends {BaseAPI}
 */
class BlueGreenDeploymentApi extends base_1.BaseAPI {
    /**
     * Create a blue-green deployment instance for the specified parent cluster.
     * @summary Create a new blue-green deployment instance
     * @param {BlueGreenDeploymentApiCreateBlueGreenDeploymentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    createBlueGreenDeployment(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).createBlueGreenDeployment(requestParameters.parentClusterID, requestParameters.orgName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Trigger a precheck task to verify settings or readiness for blue-green deployment.
     * @summary Run a precheck for blue-green deployment
     * @param {BlueGreenDeploymentApiCreateBlueGreenDeploymentPreCheckRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    createBlueGreenDeploymentPreCheck(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).createBlueGreenDeploymentPreCheck(requestParameters.orgName, requestParameters.parentClusterID, requestParameters.greenClusterVersion, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Delete a specified blue-green deployment instance.
     * @summary Delete a blue-green deployment instance
     * @param {BlueGreenDeploymentApiDeleteBlueGreenDeploymentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    deleteBlueGreenDeployment(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).deleteBlueGreenDeployment(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Retrieve details for a single blue-green deployment instance by parent cluster and organization.
     * @summary Get a blue-green deployment instance
     * @param {BlueGreenDeploymentApiGetBlueGreenDeploymentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    getBlueGreenDeployment(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).getBlueGreenDeployment(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Retrieve the details of a precheck task for a blue-green deployment.
     * @summary Get blue-green deployment precheck task detail
     * @param {BlueGreenDeploymentApiGetBlueGreenDeploymentPreCheckDetailRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    getBlueGreenDeploymentPreCheckDetail(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).getBlueGreenDeploymentPreCheckDetail(requestParameters.preCheckID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Retrieve detailed information about the switch-over operation for a blue-green deployment cluster.
     * @summary Get blue-green deployment switch job detail
     * @param {BlueGreenDeploymentApiGetBlueGreenDeploymentSwitchDetailRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    getBlueGreenDeploymentSwitchDetail(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).getBlueGreenDeploymentSwitchDetail(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Retrieve a list of blue-green deployment instances associated with the given parent database cluster.
     * @summary List blue-green deployment instances for the specified parent cluster
     * @param {BlueGreenDeploymentApiListBlueGreenDeploymentsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    listBlueGreenDeployments(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).listBlueGreenDeployments(requestParameters.parentClusterID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * Switch the specified blue-green deployment cluster to act as the primary instance.
     * @summary Switch roles of blue-green deployment instances
     * @param {BlueGreenDeploymentApiSwitchBlueGreenDeploymentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof BlueGreenDeploymentApi
     */
    switchBlueGreenDeployment(requestParameters, options) {
        return (0, exports.BlueGreenDeploymentApiFp)(this.configuration).switchBlueGreenDeployment(requestParameters.deploymentID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }
}
exports.BlueGreenDeploymentApi = BlueGreenDeploymentApi;
//# sourceMappingURL=blue-green-deployment-api.js.map