/* tslint:disable */
/* eslint-disable */
/**
 * KubeBlocks Cloud Internal API
 * The Internal API is using for interaction of ApeCloud platform microservices. 
 *
 * The version of the OpenAPI document: 1.0.0
 * 
 *
 * 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';
/**
 * RecycleBinClusterApi - axios parameter creator
 * @export
 */
export const RecycleBinClusterApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary Delete cluster from the Recycle Bin of the Org
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the cluster
         * @param {boolean} isDeleteBackup whether to delete the backup of the cluster
         * @param {string} uid the uid of the impersonating user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRecycleBinCluster: async (orgName: string, clusterName: string, isDeleteBackup: boolean, uid: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('deleteRecycleBinCluster', 'orgName', orgName)
            // verify required parameter 'clusterName' is not null or undefined
            assertParamExists('deleteRecycleBinCluster', 'clusterName', clusterName)
            // verify required parameter 'isDeleteBackup' is not null or undefined
            assertParamExists('deleteRecycleBinCluster', 'isDeleteBackup', isDeleteBackup)
            // verify required parameter 'uid' is not null or undefined
            assertParamExists('deleteRecycleBinCluster', 'uid', uid)
            const localVarPath = `/internal/v1/organizations/{orgName}/recycleBin/clusters/{clusterName}`
                .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 BasicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

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

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


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

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

/**
 * RecycleBinClusterApi - functional programming interface
 * @export
 */
export const RecycleBinClusterApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = RecycleBinClusterApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary Delete cluster from the Recycle Bin of the Org
         * @param {string} orgName name of the Org
         * @param {string} clusterName name of the cluster
         * @param {boolean} isDeleteBackup whether to delete the backup of the cluster
         * @param {string} uid the uid of the impersonating user
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteRecycleBinCluster(orgName: string, clusterName: string, isDeleteBackup: boolean, uid: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteRecycleBinCluster(orgName, clusterName, isDeleteBackup, uid, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['RecycleBinClusterApi.deleteRecycleBinCluster']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * RecycleBinClusterApi - factory interface
 * @export
 */
export const RecycleBinClusterApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = RecycleBinClusterApiFp(configuration)
    return {
        /**
         * 
         * @summary Delete cluster from the Recycle Bin of the Org
         * @param {RecycleBinClusterApiDeleteRecycleBinClusterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteRecycleBinCluster(requestParameters: RecycleBinClusterApiDeleteRecycleBinClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteRecycleBinCluster(requestParameters.orgName, requestParameters.clusterName, requestParameters.isDeleteBackup, requestParameters.uid, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * RecycleBinClusterApi - interface
 * @export
 * @interface RecycleBinClusterApi
 */
export interface RecycleBinClusterApiInterface {
    /**
     * 
     * @summary Delete cluster from the Recycle Bin of the Org
     * @param {RecycleBinClusterApiDeleteRecycleBinClusterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RecycleBinClusterApiInterface
     */
    deleteRecycleBinCluster(requestParameters: RecycleBinClusterApiDeleteRecycleBinClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise<void>;

}

/**
 * Request parameters for deleteRecycleBinCluster operation in RecycleBinClusterApi.
 * @export
 * @interface RecycleBinClusterApiDeleteRecycleBinClusterRequest
 */
export interface RecycleBinClusterApiDeleteRecycleBinClusterRequest {
    /**
     * name of the Org
     * @type {string}
     * @memberof RecycleBinClusterApiDeleteRecycleBinCluster
     */
    readonly orgName: string

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

    /**
     * whether to delete the backup of the cluster
     * @type {boolean}
     * @memberof RecycleBinClusterApiDeleteRecycleBinCluster
     */
    readonly isDeleteBackup: boolean

    /**
     * the uid of the impersonating user
     * @type {string}
     * @memberof RecycleBinClusterApiDeleteRecycleBinCluster
     */
    readonly uid: string
}

/**
 * RecycleBinClusterApi - object-oriented interface
 * @export
 * @class RecycleBinClusterApi
 * @extends {BaseAPI}
 */
export class RecycleBinClusterApi extends BaseAPI implements RecycleBinClusterApiInterface {
    /**
     * 
     * @summary Delete cluster from the Recycle Bin of the Org
     * @param {RecycleBinClusterApiDeleteRecycleBinClusterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof RecycleBinClusterApi
     */
    public deleteRecycleBinCluster(requestParameters: RecycleBinClusterApiDeleteRecycleBinClusterRequest, options?: RawAxiosRequestConfig) {
        return RecycleBinClusterApiFp(this.configuration).deleteRecycleBinCluster(requestParameters.orgName, requestParameters.clusterName, requestParameters.isDeleteBackup, requestParameters.uid, options).then((request) => request(this.axios, this.basePath));
    }
}

