/* 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.
 */


import type { Configuration } from '../configuration';
import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { APIErrorResponse } from '../models';
// @ts-ignore
import type { DisasterRecoveryClusterList } from '../models';
// @ts-ignore
import type { DisasterRecoveryCreate } from '../models';
// @ts-ignore
import type { DisasterRecoveryHistory } from '../models';
// @ts-ignore
import type { DisasterRecoveryPromote } from '../models';
// @ts-ignore
import type { DisasterRecoveryStatusResponse } from '../models';
// @ts-ignore
import type { DisasterRecoveryTask } from '../models';
/**
 * DisasterRecoveryApi - axios parameter creator
 * @export
 */
export const DisasterRecoveryApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Create a new disaster recovery instance for a database cluster.
         * @summary Create a new disaster recovery instance
         * @param {string} parentClusterID The ID of the parent database cluster
         * @param {string} orgName name of the org
         * @param {DisasterRecoveryCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createDisasterRecovery: async (parentClusterID: string, orgName: string, body: DisasterRecoveryCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'parentClusterID' is not null or undefined
            assertParamExists('createDisasterRecovery', 'parentClusterID', parentClusterID)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('createDisasterRecovery', 'orgName', orgName)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('createDisasterRecovery', 'body', body)
            const localVarPath = `/api/v1/organizations/{orgName}/parent/{parentClusterID}/disasterRecovery`
                .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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Delete a specific disaster recovery instance
         * @summary Delete a disaster recovery instance
         * @param {string} orgName name of the org
         * @param {string} [logicalInstanceID] The ID of the disaster recovery logical instance
         * @param {string} [clusterID] The ID of the disaster recovery cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteDisasterRecovery: async (orgName: string, logicalInstanceID?: string, clusterID?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('deleteDisasterRecovery', 'orgName', orgName)
            const localVarPath = `/api/v1/organizations/{orgName}/disasterRecovery`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)

            if (logicalInstanceID !== undefined) {
                localVarQueryParameter['logicalInstanceID'] = logicalInstanceID;
            }

            if (clusterID !== undefined) {
                localVarQueryParameter['clusterID'] = clusterID;
            }


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieve the history of failover and failback operations for a specific disaster recovery instance.
         * @summary Get switch history of a disaster recovery instance
         * @param {string} clusterID The ID of the disaster recovery instance
         * @param {string} orgName name of the org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDisasterRecoveryHistory: async (clusterID: string, orgName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'clusterID' is not null or undefined
            assertParamExists('getDisasterRecoveryHistory', 'clusterID', clusterID)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getDisasterRecoveryHistory', 'orgName', orgName)
            const localVarPath = `/api/v1/organizations/{orgName}/disasterRecovery/{clusterID}/switchHistory`
                .replace(`{${"clusterID"}}`, encodeURIComponent(String(clusterID)))
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get detailed information about the status of a specific disaster recovery instance, including delay and current replication point.
         * @summary Retrieve Disaster Recovery Instance Status
         * @param {string} clusterID Unique identifier of the disaster recovery instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDisasterRecoveryStatus: async (clusterID: string, orgName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'clusterID' is not null or undefined
            assertParamExists('getDisasterRecoveryStatus', 'clusterID', clusterID)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getDisasterRecoveryStatus', 'orgName', orgName)
            const localVarPath = `/api/v1/organizations/{orgName}/disasterRecovery/{clusterID}/status`
                .replace(`{${"clusterID"}}`, encodeURIComponent(String(clusterID)))
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Retrieve a list of disaster recovery instances for a specific database cluster.
         * @summary List Disaster Recovery instances under the main cluster
         * @param {string} parentClusterID The ID of the parent database cluster
         * @param {string} orgName name of the org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDisasterRecovery: async (parentClusterID: string, orgName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'parentClusterID' is not null or undefined
            assertParamExists('listDisasterRecovery', 'parentClusterID', parentClusterID)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('listDisasterRecovery', 'orgName', orgName)
            const localVarPath = `/api/v1/organizations/{orgName}/parent/{parentClusterID}/disasterRecovery`
                .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, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Promote the disaster recovery instance to the primary database instance.
         * @summary Promote a disaster recovery instance to the main instance
         * @param {string} clusterID The ID of the disaster recovery instance
         * @param {string} orgName name of the org
         * @param {DisasterRecoveryPromote} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        promoteDisasterRecovery: async (clusterID: string, orgName: string, body: DisasterRecoveryPromote, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'clusterID' is not null or undefined
            assertParamExists('promoteDisasterRecovery', 'clusterID', clusterID)
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('promoteDisasterRecovery', 'orgName', orgName)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('promoteDisasterRecovery', 'body', body)
            const localVarPath = `/api/v1/organizations/{orgName}/disasterRecovery/{clusterID}/promote`
                .replace(`{${"clusterID"}}`, encodeURIComponent(String(clusterID)))
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication BearerToken required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            // authentication DigestAuth required
            await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)


    
            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * DisasterRecoveryApi - functional programming interface
 * @export
 */
export const DisasterRecoveryApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = DisasterRecoveryApiAxiosParamCreator(configuration)
    return {
        /**
         * Create a new disaster recovery instance for a database cluster.
         * @summary Create a new disaster recovery instance
         * @param {string} parentClusterID The ID of the parent database cluster
         * @param {string} orgName name of the org
         * @param {DisasterRecoveryCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createDisasterRecovery(parentClusterID: string, orgName: string, body: DisasterRecoveryCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DisasterRecoveryTask>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createDisasterRecovery(parentClusterID, orgName, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DisasterRecoveryApi.createDisasterRecovery']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Delete a specific disaster recovery instance
         * @summary Delete a disaster recovery instance
         * @param {string} orgName name of the org
         * @param {string} [logicalInstanceID] The ID of the disaster recovery logical instance
         * @param {string} [clusterID] The ID of the disaster recovery cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteDisasterRecovery(orgName: string, logicalInstanceID?: string, clusterID?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DisasterRecoveryTask>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteDisasterRecovery(orgName, logicalInstanceID, clusterID, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DisasterRecoveryApi.deleteDisasterRecovery']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Retrieve the history of failover and failback operations for a specific disaster recovery instance.
         * @summary Get switch history of a disaster recovery instance
         * @param {string} clusterID The ID of the disaster recovery instance
         * @param {string} orgName name of the org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getDisasterRecoveryHistory(clusterID: string, orgName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DisasterRecoveryHistory>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getDisasterRecoveryHistory(clusterID, orgName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DisasterRecoveryApi.getDisasterRecoveryHistory']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get detailed information about the status of a specific disaster recovery instance, including delay and current replication point.
         * @summary Retrieve Disaster Recovery Instance Status
         * @param {string} clusterID Unique identifier of the disaster recovery instance
         * @param {string} orgName Name of the organization
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getDisasterRecoveryStatus(clusterID: string, orgName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DisasterRecoveryStatusResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getDisasterRecoveryStatus(clusterID, orgName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DisasterRecoveryApi.getDisasterRecoveryStatus']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Retrieve a list of disaster recovery instances for a specific database cluster.
         * @summary List Disaster Recovery instances under the main cluster
         * @param {string} parentClusterID The ID of the parent database cluster
         * @param {string} orgName name of the org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listDisasterRecovery(parentClusterID: string, orgName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DisasterRecoveryClusterList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listDisasterRecovery(parentClusterID, orgName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DisasterRecoveryApi.listDisasterRecovery']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Promote the disaster recovery instance to the primary database instance.
         * @summary Promote a disaster recovery instance to the main instance
         * @param {string} clusterID The ID of the disaster recovery instance
         * @param {string} orgName name of the org
         * @param {DisasterRecoveryPromote} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async promoteDisasterRecovery(clusterID: string, orgName: string, body: DisasterRecoveryPromote, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DisasterRecoveryTask>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.promoteDisasterRecovery(clusterID, orgName, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['DisasterRecoveryApi.promoteDisasterRecovery']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * DisasterRecoveryApi - factory interface
 * @export
 */
export const DisasterRecoveryApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = DisasterRecoveryApiFp(configuration)
    return {
        /**
         * Create a new disaster recovery instance for a database cluster.
         * @summary Create a new disaster recovery instance
         * @param {DisasterRecoveryApiCreateDisasterRecoveryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createDisasterRecovery(requestParameters: DisasterRecoveryApiCreateDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryTask> {
            return localVarFp.createDisasterRecovery(requestParameters.parentClusterID, requestParameters.orgName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * Delete a specific disaster recovery instance
         * @summary Delete a disaster recovery instance
         * @param {DisasterRecoveryApiDeleteDisasterRecoveryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteDisasterRecovery(requestParameters: DisasterRecoveryApiDeleteDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryTask> {
            return localVarFp.deleteDisasterRecovery(requestParameters.orgName, requestParameters.logicalInstanceID, requestParameters.clusterID, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve the history of failover and failback operations for a specific disaster recovery instance.
         * @summary Get switch history of a disaster recovery instance
         * @param {DisasterRecoveryApiGetDisasterRecoveryHistoryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDisasterRecoveryHistory(requestParameters: DisasterRecoveryApiGetDisasterRecoveryHistoryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryHistory> {
            return localVarFp.getDisasterRecoveryHistory(requestParameters.clusterID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Get detailed information about the status of a specific disaster recovery instance, including delay and current replication point.
         * @summary Retrieve Disaster Recovery Instance Status
         * @param {DisasterRecoveryApiGetDisasterRecoveryStatusRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getDisasterRecoveryStatus(requestParameters: DisasterRecoveryApiGetDisasterRecoveryStatusRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryStatusResponse> {
            return localVarFp.getDisasterRecoveryStatus(requestParameters.clusterID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Retrieve a list of disaster recovery instances for a specific database cluster.
         * @summary List Disaster Recovery instances under the main cluster
         * @param {DisasterRecoveryApiListDisasterRecoveryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listDisasterRecovery(requestParameters: DisasterRecoveryApiListDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryClusterList> {
            return localVarFp.listDisasterRecovery(requestParameters.parentClusterID, requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * Promote the disaster recovery instance to the primary database instance.
         * @summary Promote a disaster recovery instance to the main instance
         * @param {DisasterRecoveryApiPromoteDisasterRecoveryRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        promoteDisasterRecovery(requestParameters: DisasterRecoveryApiPromoteDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryTask> {
            return localVarFp.promoteDisasterRecovery(requestParameters.clusterID, requestParameters.orgName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * DisasterRecoveryApi - interface
 * @export
 * @interface DisasterRecoveryApi
 */
export interface DisasterRecoveryApiInterface {
    /**
     * Create a new disaster recovery instance for a database cluster.
     * @summary Create a new disaster recovery instance
     * @param {DisasterRecoveryApiCreateDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApiInterface
     */
    createDisasterRecovery(requestParameters: DisasterRecoveryApiCreateDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryTask>;

    /**
     * Delete a specific disaster recovery instance
     * @summary Delete a disaster recovery instance
     * @param {DisasterRecoveryApiDeleteDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApiInterface
     */
    deleteDisasterRecovery(requestParameters: DisasterRecoveryApiDeleteDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryTask>;

    /**
     * Retrieve the history of failover and failback operations for a specific disaster recovery instance.
     * @summary Get switch history of a disaster recovery instance
     * @param {DisasterRecoveryApiGetDisasterRecoveryHistoryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApiInterface
     */
    getDisasterRecoveryHistory(requestParameters: DisasterRecoveryApiGetDisasterRecoveryHistoryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryHistory>;

    /**
     * Get detailed information about the status of a specific disaster recovery instance, including delay and current replication point.
     * @summary Retrieve Disaster Recovery Instance Status
     * @param {DisasterRecoveryApiGetDisasterRecoveryStatusRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApiInterface
     */
    getDisasterRecoveryStatus(requestParameters: DisasterRecoveryApiGetDisasterRecoveryStatusRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryStatusResponse>;

    /**
     * Retrieve a list of disaster recovery instances for a specific database cluster.
     * @summary List Disaster Recovery instances under the main cluster
     * @param {DisasterRecoveryApiListDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApiInterface
     */
    listDisasterRecovery(requestParameters: DisasterRecoveryApiListDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryClusterList>;

    /**
     * Promote the disaster recovery instance to the primary database instance.
     * @summary Promote a disaster recovery instance to the main instance
     * @param {DisasterRecoveryApiPromoteDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApiInterface
     */
    promoteDisasterRecovery(requestParameters: DisasterRecoveryApiPromoteDisasterRecoveryRequest, options?: RawAxiosRequestConfig): AxiosPromise<DisasterRecoveryTask>;

}

/**
 * Request parameters for createDisasterRecovery operation in DisasterRecoveryApi.
 * @export
 * @interface DisasterRecoveryApiCreateDisasterRecoveryRequest
 */
export interface DisasterRecoveryApiCreateDisasterRecoveryRequest {
    /**
     * The ID of the parent database cluster
     * @type {string}
     * @memberof DisasterRecoveryApiCreateDisasterRecovery
     */
    readonly parentClusterID: string

    /**
     * name of the org
     * @type {string}
     * @memberof DisasterRecoveryApiCreateDisasterRecovery
     */
    readonly orgName: string

    /**
     * 
     * @type {DisasterRecoveryCreate}
     * @memberof DisasterRecoveryApiCreateDisasterRecovery
     */
    readonly body: DisasterRecoveryCreate
}

/**
 * Request parameters for deleteDisasterRecovery operation in DisasterRecoveryApi.
 * @export
 * @interface DisasterRecoveryApiDeleteDisasterRecoveryRequest
 */
export interface DisasterRecoveryApiDeleteDisasterRecoveryRequest {
    /**
     * name of the org
     * @type {string}
     * @memberof DisasterRecoveryApiDeleteDisasterRecovery
     */
    readonly orgName: string

    /**
     * The ID of the disaster recovery logical instance
     * @type {string}
     * @memberof DisasterRecoveryApiDeleteDisasterRecovery
     */
    readonly logicalInstanceID?: string

    /**
     * The ID of the disaster recovery cluster
     * @type {string}
     * @memberof DisasterRecoveryApiDeleteDisasterRecovery
     */
    readonly clusterID?: string
}

/**
 * Request parameters for getDisasterRecoveryHistory operation in DisasterRecoveryApi.
 * @export
 * @interface DisasterRecoveryApiGetDisasterRecoveryHistoryRequest
 */
export interface DisasterRecoveryApiGetDisasterRecoveryHistoryRequest {
    /**
     * The ID of the disaster recovery instance
     * @type {string}
     * @memberof DisasterRecoveryApiGetDisasterRecoveryHistory
     */
    readonly clusterID: string

    /**
     * name of the org
     * @type {string}
     * @memberof DisasterRecoveryApiGetDisasterRecoveryHistory
     */
    readonly orgName: string
}

/**
 * Request parameters for getDisasterRecoveryStatus operation in DisasterRecoveryApi.
 * @export
 * @interface DisasterRecoveryApiGetDisasterRecoveryStatusRequest
 */
export interface DisasterRecoveryApiGetDisasterRecoveryStatusRequest {
    /**
     * Unique identifier of the disaster recovery instance
     * @type {string}
     * @memberof DisasterRecoveryApiGetDisasterRecoveryStatus
     */
    readonly clusterID: string

    /**
     * Name of the organization
     * @type {string}
     * @memberof DisasterRecoveryApiGetDisasterRecoveryStatus
     */
    readonly orgName: string
}

/**
 * Request parameters for listDisasterRecovery operation in DisasterRecoveryApi.
 * @export
 * @interface DisasterRecoveryApiListDisasterRecoveryRequest
 */
export interface DisasterRecoveryApiListDisasterRecoveryRequest {
    /**
     * The ID of the parent database cluster
     * @type {string}
     * @memberof DisasterRecoveryApiListDisasterRecovery
     */
    readonly parentClusterID: string

    /**
     * name of the org
     * @type {string}
     * @memberof DisasterRecoveryApiListDisasterRecovery
     */
    readonly orgName: string
}

/**
 * Request parameters for promoteDisasterRecovery operation in DisasterRecoveryApi.
 * @export
 * @interface DisasterRecoveryApiPromoteDisasterRecoveryRequest
 */
export interface DisasterRecoveryApiPromoteDisasterRecoveryRequest {
    /**
     * The ID of the disaster recovery instance
     * @type {string}
     * @memberof DisasterRecoveryApiPromoteDisasterRecovery
     */
    readonly clusterID: string

    /**
     * name of the org
     * @type {string}
     * @memberof DisasterRecoveryApiPromoteDisasterRecovery
     */
    readonly orgName: string

    /**
     * 
     * @type {DisasterRecoveryPromote}
     * @memberof DisasterRecoveryApiPromoteDisasterRecovery
     */
    readonly body: DisasterRecoveryPromote
}

/**
 * DisasterRecoveryApi - object-oriented interface
 * @export
 * @class DisasterRecoveryApi
 * @extends {BaseAPI}
 */
export class DisasterRecoveryApi extends BaseAPI implements DisasterRecoveryApiInterface {
    /**
     * Create a new disaster recovery instance for a database cluster.
     * @summary Create a new disaster recovery instance
     * @param {DisasterRecoveryApiCreateDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApi
     */
    public createDisasterRecovery(requestParameters: DisasterRecoveryApiCreateDisasterRecoveryRequest, options?: RawAxiosRequestConfig) {
        return DisasterRecoveryApiFp(this.configuration).createDisasterRecovery(requestParameters.parentClusterID, requestParameters.orgName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Delete a specific disaster recovery instance
     * @summary Delete a disaster recovery instance
     * @param {DisasterRecoveryApiDeleteDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApi
     */
    public deleteDisasterRecovery(requestParameters: DisasterRecoveryApiDeleteDisasterRecoveryRequest, options?: RawAxiosRequestConfig) {
        return DisasterRecoveryApiFp(this.configuration).deleteDisasterRecovery(requestParameters.orgName, requestParameters.logicalInstanceID, requestParameters.clusterID, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Retrieve the history of failover and failback operations for a specific disaster recovery instance.
     * @summary Get switch history of a disaster recovery instance
     * @param {DisasterRecoveryApiGetDisasterRecoveryHistoryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApi
     */
    public getDisasterRecoveryHistory(requestParameters: DisasterRecoveryApiGetDisasterRecoveryHistoryRequest, options?: RawAxiosRequestConfig) {
        return DisasterRecoveryApiFp(this.configuration).getDisasterRecoveryHistory(requestParameters.clusterID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get detailed information about the status of a specific disaster recovery instance, including delay and current replication point.
     * @summary Retrieve Disaster Recovery Instance Status
     * @param {DisasterRecoveryApiGetDisasterRecoveryStatusRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApi
     */
    public getDisasterRecoveryStatus(requestParameters: DisasterRecoveryApiGetDisasterRecoveryStatusRequest, options?: RawAxiosRequestConfig) {
        return DisasterRecoveryApiFp(this.configuration).getDisasterRecoveryStatus(requestParameters.clusterID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Retrieve a list of disaster recovery instances for a specific database cluster.
     * @summary List Disaster Recovery instances under the main cluster
     * @param {DisasterRecoveryApiListDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApi
     */
    public listDisasterRecovery(requestParameters: DisasterRecoveryApiListDisasterRecoveryRequest, options?: RawAxiosRequestConfig) {
        return DisasterRecoveryApiFp(this.configuration).listDisasterRecovery(requestParameters.parentClusterID, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Promote the disaster recovery instance to the primary database instance.
     * @summary Promote a disaster recovery instance to the main instance
     * @param {DisasterRecoveryApiPromoteDisasterRecoveryRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DisasterRecoveryApi
     */
    public promoteDisasterRecovery(requestParameters: DisasterRecoveryApiPromoteDisasterRecoveryRequest, options?: RawAxiosRequestConfig) {
        return DisasterRecoveryApiFp(this.configuration).promoteDisasterRecovery(requestParameters.clusterID, requestParameters.orgName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}

