/* 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 { StorageClassList } from '../models';
/**
 * StorageClassApi - axios parameter creator
 * @export
 */
export const StorageClassApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Provides a summary of storage class statistics, aggregated and organized by namespace.
         * @summary Get storage class stats
         * @param {string} orgName name of the Organization
         * @param {string} environmentName name of the Environment
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStorageClassStats: async (orgName: string, environmentName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'orgName' is not null or undefined
            assertParamExists('getStorageClassStats', 'orgName', orgName)
            // verify required parameter 'environmentName' is not null or undefined
            assertParamExists('getStorageClassStats', 'environmentName', environmentName)
            const localVarPath = `/api/v1/organizations/{orgName}/environments/{environmentName}/storageClasses`
                .replace(`{${"orgName"}}`, encodeURIComponent(String(orgName)))
                .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: '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,
            };
        },
    }
};

/**
 * StorageClassApi - functional programming interface
 * @export
 */
export const StorageClassApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = StorageClassApiAxiosParamCreator(configuration)
    return {
        /**
         * Provides a summary of storage class statistics, aggregated and organized by namespace.
         * @summary Get storage class stats
         * @param {string} orgName name of the Organization
         * @param {string} environmentName name of the Environment
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getStorageClassStats(orgName: string, environmentName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<StorageClassList>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getStorageClassStats(orgName, environmentName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['StorageClassApi.getStorageClassStats']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * StorageClassApi - factory interface
 * @export
 */
export const StorageClassApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = StorageClassApiFp(configuration)
    return {
        /**
         * Provides a summary of storage class statistics, aggregated and organized by namespace.
         * @summary Get storage class stats
         * @param {StorageClassApiGetStorageClassStatsRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStorageClassStats(requestParameters: StorageClassApiGetStorageClassStatsRequest, options?: RawAxiosRequestConfig): AxiosPromise<StorageClassList> {
            return localVarFp.getStorageClassStats(requestParameters.orgName, requestParameters.environmentName, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * StorageClassApi - interface
 * @export
 * @interface StorageClassApi
 */
export interface StorageClassApiInterface {
    /**
     * Provides a summary of storage class statistics, aggregated and organized by namespace.
     * @summary Get storage class stats
     * @param {StorageClassApiGetStorageClassStatsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageClassApiInterface
     */
    getStorageClassStats(requestParameters: StorageClassApiGetStorageClassStatsRequest, options?: RawAxiosRequestConfig): AxiosPromise<StorageClassList>;

}

/**
 * Request parameters for getStorageClassStats operation in StorageClassApi.
 * @export
 * @interface StorageClassApiGetStorageClassStatsRequest
 */
export interface StorageClassApiGetStorageClassStatsRequest {
    /**
     * name of the Organization
     * @type {string}
     * @memberof StorageClassApiGetStorageClassStats
     */
    readonly orgName: string

    /**
     * name of the Environment
     * @type {string}
     * @memberof StorageClassApiGetStorageClassStats
     */
    readonly environmentName: string
}

/**
 * StorageClassApi - object-oriented interface
 * @export
 * @class StorageClassApi
 * @extends {BaseAPI}
 */
export class StorageClassApi extends BaseAPI implements StorageClassApiInterface {
    /**
     * Provides a summary of storage class statistics, aggregated and organized by namespace.
     * @summary Get storage class stats
     * @param {StorageClassApiGetStorageClassStatsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof StorageClassApi
     */
    public getStorageClassStats(requestParameters: StorageClassApiGetStorageClassStatsRequest, options?: RawAxiosRequestConfig) {
        return StorageClassApiFp(this.configuration).getStorageClassStats(requestParameters.orgName, requestParameters.environmentName, options).then((request) => request(this.axios, this.basePath));
    }
}

