/* 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 { PlatformParameter } from '../models';
/**
 * SharedApi - axios parameter creator
 * @export
 */
export const SharedApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary get platformParameter by name
         * @param {string} platformParameterName name of the platformParameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getPlatformParameter: async (platformParameterName: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'platformParameterName' is not null or undefined
            assertParamExists('getPlatformParameter', 'platformParameterName', platformParameterName)
            const localVarPath = `/internal/v1/platformParameters/{platformParameterName}`
                .replace(`{${"platformParameterName"}}`, encodeURIComponent(String(platformParameterName)));
            // 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,
            };
        },
    }
};

/**
 * SharedApi - functional programming interface
 * @export
 */
export const SharedApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = SharedApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary get platformParameter by name
         * @param {string} platformParameterName name of the platformParameter
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getPlatformParameter(platformParameterName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PlatformParameter>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getPlatformParameter(platformParameterName, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['SharedApi.getPlatformParameter']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * SharedApi - factory interface
 * @export
 */
export const SharedApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = SharedApiFp(configuration)
    return {
        /**
         * 
         * @summary get platformParameter by name
         * @param {SharedApiGetPlatformParameterRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getPlatformParameter(requestParameters: SharedApiGetPlatformParameterRequest, options?: RawAxiosRequestConfig): AxiosPromise<PlatformParameter> {
            return localVarFp.getPlatformParameter(requestParameters.platformParameterName, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * SharedApi - interface
 * @export
 * @interface SharedApi
 */
export interface SharedApiInterface {
    /**
     * 
     * @summary get platformParameter by name
     * @param {SharedApiGetPlatformParameterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SharedApiInterface
     */
    getPlatformParameter(requestParameters: SharedApiGetPlatformParameterRequest, options?: RawAxiosRequestConfig): AxiosPromise<PlatformParameter>;

}

/**
 * Request parameters for getPlatformParameter operation in SharedApi.
 * @export
 * @interface SharedApiGetPlatformParameterRequest
 */
export interface SharedApiGetPlatformParameterRequest {
    /**
     * name of the platformParameter
     * @type {string}
     * @memberof SharedApiGetPlatformParameter
     */
    readonly platformParameterName: string
}

/**
 * SharedApi - object-oriented interface
 * @export
 * @class SharedApi
 * @extends {BaseAPI}
 */
export class SharedApi extends BaseAPI implements SharedApiInterface {
    /**
     * 
     * @summary get platformParameter by name
     * @param {SharedApiGetPlatformParameterRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof SharedApi
     */
    public getPlatformParameter(requestParameters: SharedApiGetPlatformParameterRequest, options?: RawAxiosRequestConfig) {
        return SharedApiFp(this.configuration).getPlatformParameter(requestParameters.platformParameterName, options).then((request) => request(this.axios, this.basePath));
    }
}

