/* 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 { ApiserverStatusResponse } from '../models';
/**
 * ApiserverApi - axios parameter creator
 * @export
 */
export const ApiserverApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Returns the current status of the API server
         * @summary Get API server status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStatus: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/internal/v1/status`;
            // 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 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,
            };
        },
    }
};

/**
 * ApiserverApi - functional programming interface
 * @export
 */
export const ApiserverApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ApiserverApiAxiosParamCreator(configuration)
    return {
        /**
         * Returns the current status of the API server
         * @summary Get API server status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getStatus(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiserverStatusResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getStatus(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ApiserverApi.getStatus']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ApiserverApi - factory interface
 * @export
 */
export const ApiserverApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ApiserverApiFp(configuration)
    return {
        /**
         * Returns the current status of the API server
         * @summary Get API server status
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStatus(options?: RawAxiosRequestConfig): AxiosPromise<ApiserverStatusResponse> {
            return localVarFp.getStatus(options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ApiserverApi - interface
 * @export
 * @interface ApiserverApi
 */
export interface ApiserverApiInterface {
    /**
     * Returns the current status of the API server
     * @summary Get API server status
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ApiserverApiInterface
     */
    getStatus(options?: RawAxiosRequestConfig): AxiosPromise<ApiserverStatusResponse>;

}

/**
 * ApiserverApi - object-oriented interface
 * @export
 * @class ApiserverApi
 * @extends {BaseAPI}
 */
export class ApiserverApi extends BaseAPI implements ApiserverApiInterface {
    /**
     * Returns the current status of the API server
     * @summary Get API server status
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ApiserverApi
     */
    public getStatus(options?: RawAxiosRequestConfig) {
        return ApiserverApiFp(this.configuration).getStatus(options).then((request) => request(this.axios, this.basePath));
    }
}

