/* 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';
// @ts-ignore
import type { Cluster } from '../models';
/**
 * VictoriaMetricsClusterApi - axios parameter creator
 * @export
 */
export const VictoriaMetricsClusterApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * create VictoriaMetrics Cluster and install victoria-metrics addon when it\'s uninstalled
         * @summary create metrics Monitor
         * @param {string} environmentName name of the environment
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createVictoriaMetricsCluster: async (environmentName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('createVictoriaMetricsCluster', 'environmentName', environmentName)
            const localVarPath = `/internal/v1/environments/{environmentName}/victoriaMetricsCluster`
                .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName)));
            // 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 BasicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)


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

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

/**
 * VictoriaMetricsClusterApi - functional programming interface
 * @export
 */
export const VictoriaMetricsClusterApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = VictoriaMetricsClusterApiAxiosParamCreator(configuration)
    return {
        /**
         * create VictoriaMetrics Cluster and install victoria-metrics addon when it\'s uninstalled
         * @summary create metrics Monitor
         * @param {string} environmentName name of the environment
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createVictoriaMetricsCluster(environmentName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Cluster>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createVictoriaMetricsCluster(environmentName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['VictoriaMetricsClusterApi.createVictoriaMetricsCluster']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * VictoriaMetricsClusterApi - factory interface
 * @export
 */
export const VictoriaMetricsClusterApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = VictoriaMetricsClusterApiFp(configuration)
    return {
        /**
         * create VictoriaMetrics Cluster and install victoria-metrics addon when it\'s uninstalled
         * @summary create metrics Monitor
         * @param {VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createVictoriaMetricsCluster(requestParameters: VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise<Cluster> {
            return localVarFp.createVictoriaMetricsCluster(requestParameters.environmentName, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * VictoriaMetricsClusterApi - interface
 * @export
 * @interface VictoriaMetricsClusterApi
 */
export interface VictoriaMetricsClusterApiInterface {
    /**
     * create VictoriaMetrics Cluster and install victoria-metrics addon when it\'s uninstalled
     * @summary create metrics Monitor
     * @param {VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof VictoriaMetricsClusterApiInterface
     */
    createVictoriaMetricsCluster(requestParameters: VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise<Cluster>;

}

/**
 * Request parameters for createVictoriaMetricsCluster operation in VictoriaMetricsClusterApi.
 * @export
 * @interface VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest
 */
export interface VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest {
    /**
     * name of the environment
     * @type {string}
     * @memberof VictoriaMetricsClusterApiCreateVictoriaMetricsCluster
     */
    readonly environmentName: string
}

/**
 * VictoriaMetricsClusterApi - object-oriented interface
 * @export
 * @class VictoriaMetricsClusterApi
 * @extends {BaseAPI}
 */
export class VictoriaMetricsClusterApi extends BaseAPI implements VictoriaMetricsClusterApiInterface {
    /**
     * create VictoriaMetrics Cluster and install victoria-metrics addon when it\'s uninstalled
     * @summary create metrics Monitor
     * @param {VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof VictoriaMetricsClusterApi
     */
    public createVictoriaMetricsCluster(requestParameters: VictoriaMetricsClusterApiCreateVictoriaMetricsClusterRequest, options?: RawAxiosRequestConfig) {
        return VictoriaMetricsClusterApiFp(this.configuration).createVictoriaMetricsCluster(requestParameters.environmentName, options).then((request) => request(this.axios, this.basePath));
    }
}

