/* tslint:disable */
/* eslint-disable */
/**
 * Admin API
 * The Admin API is used to manage the ApeCloud platform. 
 *
 * The version of the OpenAPI document: 1.0.0
 * Contact: support@apecloud.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


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';
/**
 * MarkClusterApi - axios parameter creator
 * @export
 */
export const MarkClusterApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary mark cluster to restore completed, usually used when manually repairing or recovering issues
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        markClusterRestoreCompleted: async (orgName: string, clusterName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('markClusterRestoreCompleted', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('markClusterRestoreCompleted', 'clusterName', clusterName)
            const localVarPath = `/admin/v1/organizations/{orgName}/clusters/{clusterName}/markClusterRestoreCompleted`
                .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)


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

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

/**
 * MarkClusterApi - functional programming interface
 * @export
 */
export const MarkClusterApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = MarkClusterApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary mark cluster to restore completed, usually used when manually repairing or recovering issues
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the KubeBlocks cluster
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async markClusterRestoreCompleted(orgName: string, clusterName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.markClusterRestoreCompleted(orgName, clusterName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MarkClusterApi.markClusterRestoreCompleted']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * MarkClusterApi - factory interface
 * @export
 */
export const MarkClusterApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = MarkClusterApiFp(configuration)
    return {
        /**
         * 
         * @summary mark cluster to restore completed, usually used when manually repairing or recovering issues
         * @param {MarkClusterApiMarkClusterRestoreCompletedRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        markClusterRestoreCompleted(requestParameters: MarkClusterApiMarkClusterRestoreCompletedRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.markClusterRestoreCompleted(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * MarkClusterApi - interface
 * @export
 * @interface MarkClusterApi
 */
export interface MarkClusterApiInterface {
    /**
     * 
     * @summary mark cluster to restore completed, usually used when manually repairing or recovering issues
     * @param {MarkClusterApiMarkClusterRestoreCompletedRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MarkClusterApiInterface
     */
    markClusterRestoreCompleted(requestParameters: MarkClusterApiMarkClusterRestoreCompletedRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

}

/**
 * Request parameters for markClusterRestoreCompleted operation in MarkClusterApi.
 * @export
 * @interface MarkClusterApiMarkClusterRestoreCompletedRequest
 */
export interface MarkClusterApiMarkClusterRestoreCompletedRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof MarkClusterApiMarkClusterRestoreCompleted
     */
    readonly orgName: string

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

/**
 * MarkClusterApi - object-oriented interface
 * @export
 * @class MarkClusterApi
 * @extends {BaseAPI}
 */
export class MarkClusterApi extends BaseAPI implements MarkClusterApiInterface {
    /**
     * 
     * @summary mark cluster to restore completed, usually used when manually repairing or recovering issues
     * @param {MarkClusterApiMarkClusterRestoreCompletedRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MarkClusterApi
     */
    public markClusterRestoreCompleted(requestParameters: MarkClusterApiMarkClusterRestoreCompletedRequest, options?: RawAxiosRequestConfig) {
        return MarkClusterApiFp(this.configuration).markClusterRestoreCompleted(requestParameters.orgName, requestParameters.clusterName, options).then((request) => request(this.axios, this.basePath));
    }
}

