/* 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 { Backup } from '../models';
// @ts-ignore
import type { Cluster } from '../models';
// @ts-ignore
import type { Restore } from '../models';
// @ts-ignore
import type { RestoreCreate } from '../models';
// @ts-ignore
import type { RestoreList } from '../models';
// @ts-ignore
import type { RestoreLog } from '../models';
/**
 * RestoreApi - axios parameter creator
 * @export
 */
export const RestoreApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary Delete restore task
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {string} restoreName name of the restore
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRestoreObject: async (orgName: string, clusterName: string, restoreName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('deleteRestoreObject', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('deleteRestoreObject', 'clusterName', clusterName)
            // verify required parameter 'restoreName' is not null or undefined
            assertParamExists('deleteRestoreObject', 'restoreName', restoreName)
            const localVarPath = `/api/v1/organizations/{orgName}/clusters/{clusterName}/restore`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 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 (restoreName !== undefined) {
                localVarQueryParameter['restoreName'] = restoreName;
            }


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Restore current cluster or instance
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {Restore} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        doRestore: async (orgName: string, clusterName: string, body: Restore, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('doRestore', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('doRestore', 'clusterName', clusterName)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('doRestore', 'body', body)
            const localVarPath = `/api/v1/organizations/{orgName}/clusters/{clusterName}/restore`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 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,
            };
        },
        /**
         * 
         * @summary get restore workload logs of the cluster
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {string} restoreId id of the restore
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRestoreLog: async (orgName: string, clusterName: string, restoreId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getRestoreLog', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('getRestoreLog', 'clusterName', clusterName)
            // verify required parameter 'restoreId' is not null or undefined
            assertParamExists('getRestoreLog', 'restoreId', restoreId)
            const localVarPath = `/api/v1/organizations/{orgName}/clusters/{clusterName}/restore/{restoreId}/logs`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)))
                .replace(`{${"restoreId"}}`, encodeURIComponent(String(restoreId)));
            // 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,
            };
        },
        /**
         * 
         * @summary Get cluster restore time ragne
         * @param {string} orgName name of the Org
         * @param {string} clusterID ID of the KubeBlocks cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRestoreTimeRange: async (orgName: string, clusterID: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getRestoreTimeRange', 'orgName', orgName)
            // verify required parameter 'clusterID' is not null or undefined
            assertParamExists('getRestoreTimeRange', 'clusterID', clusterID)
            const localVarPath = `/api/v1/organizations/{orgName}/clustersWithDelete/restoreTimeRange`
                .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)

            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,
            };
        },
        /**
         * 
         * @summary List restore tasks
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listClusterRestore: async (orgName: string, clusterName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('listClusterRestore', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('listClusterRestore', 'clusterName', clusterName)
            const localVarPath = `/api/v1/organizations/{orgName}/clusters/{clusterName}/restore`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .replace(`{${"clusterName"}}`, encodeURIComponent(String(clusterName)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 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,
            };
        },
        /**
         * 
         * @summary List restore tasks
         * @param {string} orgName name of the Org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRestores: async (orgName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('listRestores', 'orgName', orgName)
            const localVarPath = `/api/v1/organizations/{orgName}/restore`
                .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,
            };
        },
        /**
         * 
         * @summary Restore new cluster
         * @param {string} orgName name of the Org
         * @param {RestoreCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        restoreCluster: async (orgName: string, body: RestoreCreate, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('restoreCluster', 'orgName', orgName)
            // verify required parameter 'body' is not null or undefined
            assertParamExists('restoreCluster', 'body', body)
            const localVarPath = `/api/v1/organizations/{orgName}/restore`
                .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,
            };
        },
    }
};

/**
 * RestoreApi - functional programming interface
 * @export
 */
export const RestoreApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = RestoreApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary Delete restore task
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {string} restoreName name of the restore
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteRestoreObject(orgName: string, clusterName: string, restoreName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRestoreObject(orgName, clusterName, restoreName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RestoreApi.deleteRestoreObject']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Restore current cluster or instance
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {Restore} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async doRestore(orgName: string, clusterName: string, body: Restore, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Restore>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.doRestore(orgName, clusterName, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RestoreApi.doRestore']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary get restore workload logs of the cluster
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {string} restoreId id of the restore
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getRestoreLog(orgName: string, clusterName: string, restoreId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RestoreLog>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getRestoreLog(orgName, clusterName, restoreId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RestoreApi.getRestoreLog']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Get cluster restore time ragne
         * @param {string} orgName name of the Org
         * @param {string} clusterID ID of the KubeBlocks cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getRestoreTimeRange(orgName: string, clusterID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Backup>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getRestoreTimeRange(orgName, clusterID, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RestoreApi.getRestoreTimeRange']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary List restore tasks
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listClusterRestore(orgName: string, clusterName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RestoreList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listClusterRestore(orgName, clusterName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RestoreApi.listClusterRestore']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary List restore tasks
         * @param {string} orgName name of the Org
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listRestores(orgName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<RestoreList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listRestores(orgName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RestoreApi.listRestores']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * 
         * @summary Restore new cluster
         * @param {string} orgName name of the Org
         * @param {RestoreCreate} body 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async restoreCluster(orgName: string, body: RestoreCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Cluster>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.restoreCluster(orgName, body, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RestoreApi.restoreCluster']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * RestoreApi - factory interface
 * @export
 */
export const RestoreApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = RestoreApiFp(configuration)
    return {
        /**
         * 
         * @summary Delete restore task
         * @param {RestoreApiDeleteRestoreObjectRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRestoreObject(requestParameters: RestoreApiDeleteRestoreObjectRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteRestoreObject(requestParameters.orgName, requestParameters.clusterName, requestParameters.restoreName, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Restore current cluster or instance
         * @param {RestoreApiDoRestoreRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        doRestore(requestParameters: RestoreApiDoRestoreRequest, options?: RawAxiosRequestConfig): AxiosPromise<Restore> {
            return localVarFp.doRestore(requestParameters.orgName, requestParameters.clusterName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary get restore workload logs of the cluster
         * @param {RestoreApiGetRestoreLogRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRestoreLog(requestParameters: RestoreApiGetRestoreLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<RestoreLog> {
            return localVarFp.getRestoreLog(requestParameters.orgName, requestParameters.clusterName, requestParameters.restoreId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Get cluster restore time ragne
         * @param {RestoreApiGetRestoreTimeRangeRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getRestoreTimeRange(requestParameters: RestoreApiGetRestoreTimeRangeRequest, options?: RawAxiosRequestConfig): AxiosPromise<Backup> {
            return localVarFp.getRestoreTimeRange(requestParameters.orgName, requestParameters.clusterID, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary List restore tasks
         * @param {RestoreApiListClusterRestoreRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listClusterRestore(requestParameters: RestoreApiListClusterRestoreRequest, options?: RawAxiosRequestConfig): AxiosPromise<RestoreList> {
            return localVarFp.listClusterRestore(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary List restore tasks
         * @param {RestoreApiListRestoresRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listRestores(requestParameters: RestoreApiListRestoresRequest, options?: RawAxiosRequestConfig): AxiosPromise<RestoreList> {
            return localVarFp.listRestores(requestParameters.orgName, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Restore new cluster
         * @param {RestoreApiRestoreClusterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        restoreCluster(requestParameters: RestoreApiRestoreClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise<Cluster> {
            return localVarFp.restoreCluster(requestParameters.orgName, requestParameters.body, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * RestoreApi - interface
 * @export
 * @interface RestoreApi
 */
export interface RestoreApiInterface {
    /**
     * 
     * @summary Delete restore task
     * @param {RestoreApiDeleteRestoreObjectRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApiInterface
     */
    deleteRestoreObject(requestParameters: RestoreApiDeleteRestoreObjectRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

    /**
     * 
     * @summary Restore current cluster or instance
     * @param {RestoreApiDoRestoreRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApiInterface
     */
    doRestore(requestParameters: RestoreApiDoRestoreRequest, options?: RawAxiosRequestConfig): AxiosPromise<Restore>;

    /**
     * 
     * @summary get restore workload logs of the cluster
     * @param {RestoreApiGetRestoreLogRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApiInterface
     */
    getRestoreLog(requestParameters: RestoreApiGetRestoreLogRequest, options?: RawAxiosRequestConfig): AxiosPromise<RestoreLog>;

    /**
     * 
     * @summary Get cluster restore time ragne
     * @param {RestoreApiGetRestoreTimeRangeRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApiInterface
     */
    getRestoreTimeRange(requestParameters: RestoreApiGetRestoreTimeRangeRequest, options?: RawAxiosRequestConfig): AxiosPromise<Backup>;

    /**
     * 
     * @summary List restore tasks
     * @param {RestoreApiListClusterRestoreRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApiInterface
     */
    listClusterRestore(requestParameters: RestoreApiListClusterRestoreRequest, options?: RawAxiosRequestConfig): AxiosPromise<RestoreList>;

    /**
     * 
     * @summary List restore tasks
     * @param {RestoreApiListRestoresRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApiInterface
     */
    listRestores(requestParameters: RestoreApiListRestoresRequest, options?: RawAxiosRequestConfig): AxiosPromise<RestoreList>;

    /**
     * 
     * @summary Restore new cluster
     * @param {RestoreApiRestoreClusterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApiInterface
     */
    restoreCluster(requestParameters: RestoreApiRestoreClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise<Cluster>;

}

/**
 * Request parameters for deleteRestoreObject operation in RestoreApi.
 * @export
 * @interface RestoreApiDeleteRestoreObjectRequest
 */
export interface RestoreApiDeleteRestoreObjectRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RestoreApiDeleteRestoreObject
     */
    readonly orgName: string

    /**
     * name of the KubeBlocks cluster
     * @type {string}
     * @memberof RestoreApiDeleteRestoreObject
     */
    readonly clusterName: string

    /**
     * name of the restore
     * @type {string}
     * @memberof RestoreApiDeleteRestoreObject
     */
    readonly restoreName: string
}

/**
 * Request parameters for doRestore operation in RestoreApi.
 * @export
 * @interface RestoreApiDoRestoreRequest
 */
export interface RestoreApiDoRestoreRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RestoreApiDoRestore
     */
    readonly orgName: string

    /**
     * name of the KubeBlocks cluster
     * @type {string}
     * @memberof RestoreApiDoRestore
     */
    readonly clusterName: string

    /**
     * 
     * @type {Restore}
     * @memberof RestoreApiDoRestore
     */
    readonly body: Restore
}

/**
 * Request parameters for getRestoreLog operation in RestoreApi.
 * @export
 * @interface RestoreApiGetRestoreLogRequest
 */
export interface RestoreApiGetRestoreLogRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RestoreApiGetRestoreLog
     */
    readonly orgName: string

    /**
     * name of the KubeBlocks cluster
     * @type {string}
     * @memberof RestoreApiGetRestoreLog
     */
    readonly clusterName: string

    /**
     * id of the restore
     * @type {string}
     * @memberof RestoreApiGetRestoreLog
     */
    readonly restoreId: string
}

/**
 * Request parameters for getRestoreTimeRange operation in RestoreApi.
 * @export
 * @interface RestoreApiGetRestoreTimeRangeRequest
 */
export interface RestoreApiGetRestoreTimeRangeRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RestoreApiGetRestoreTimeRange
     */
    readonly orgName: string

    /**
     * ID of the KubeBlocks cluster
     * @type {string}
     * @memberof RestoreApiGetRestoreTimeRange
     */
    readonly clusterID: string
}

/**
 * Request parameters for listClusterRestore operation in RestoreApi.
 * @export
 * @interface RestoreApiListClusterRestoreRequest
 */
export interface RestoreApiListClusterRestoreRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RestoreApiListClusterRestore
     */
    readonly orgName: string

    /**
     * name of the KubeBlocks cluster
     * @type {string}
     * @memberof RestoreApiListClusterRestore
     */
    readonly clusterName: string
}

/**
 * Request parameters for listRestores operation in RestoreApi.
 * @export
 * @interface RestoreApiListRestoresRequest
 */
export interface RestoreApiListRestoresRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RestoreApiListRestores
     */
    readonly orgName: string
}

/**
 * Request parameters for restoreCluster operation in RestoreApi.
 * @export
 * @interface RestoreApiRestoreClusterRequest
 */
export interface RestoreApiRestoreClusterRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RestoreApiRestoreCluster
     */
    readonly orgName: string

    /**
     * 
     * @type {RestoreCreate}
     * @memberof RestoreApiRestoreCluster
     */
    readonly body: RestoreCreate
}

/**
 * RestoreApi - object-oriented interface
 * @export
 * @class RestoreApi
 * @extends {BaseAPI}
 */
export class RestoreApi extends BaseAPI implements RestoreApiInterface {
    /**
     * 
     * @summary Delete restore task
     * @param {RestoreApiDeleteRestoreObjectRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApi
     */
    public deleteRestoreObject(requestParameters: RestoreApiDeleteRestoreObjectRequest, options?: RawAxiosRequestConfig) {
        return RestoreApiFp(this.configuration).deleteRestoreObject(requestParameters.orgName, requestParameters.clusterName, requestParameters.restoreName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Restore current cluster or instance
     * @param {RestoreApiDoRestoreRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApi
     */
    public doRestore(requestParameters: RestoreApiDoRestoreRequest, options?: RawAxiosRequestConfig) {
        return RestoreApiFp(this.configuration).doRestore(requestParameters.orgName, requestParameters.clusterName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary get restore workload logs of the cluster
     * @param {RestoreApiGetRestoreLogRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApi
     */
    public getRestoreLog(requestParameters: RestoreApiGetRestoreLogRequest, options?: RawAxiosRequestConfig) {
        return RestoreApiFp(this.configuration).getRestoreLog(requestParameters.orgName, requestParameters.clusterName, requestParameters.restoreId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Get cluster restore time ragne
     * @param {RestoreApiGetRestoreTimeRangeRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApi
     */
    public getRestoreTimeRange(requestParameters: RestoreApiGetRestoreTimeRangeRequest, options?: RawAxiosRequestConfig) {
        return RestoreApiFp(this.configuration).getRestoreTimeRange(requestParameters.orgName, requestParameters.clusterID, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary List restore tasks
     * @param {RestoreApiListClusterRestoreRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApi
     */
    public listClusterRestore(requestParameters: RestoreApiListClusterRestoreRequest, options?: RawAxiosRequestConfig) {
        return RestoreApiFp(this.configuration).listClusterRestore(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary List restore tasks
     * @param {RestoreApiListRestoresRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApi
     */
    public listRestores(requestParameters: RestoreApiListRestoresRequest, options?: RawAxiosRequestConfig) {
        return RestoreApiFp(this.configuration).listRestores(requestParameters.orgName, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Restore new cluster
     * @param {RestoreApiRestoreClusterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RestoreApi
     */
    public restoreCluster(requestParameters: RestoreApiRestoreClusterRequest, options?: RawAxiosRequestConfig) {
        return RestoreApiFp(this.configuration).restoreCluster(requestParameters.orgName, requestParameters.body, options).then((request) => request(this.axios, this.basePath));
    }
}

