/* tslint:disable */
/* eslint-disable */
/**
 * Halo
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.20.10-SNAPSHOT
 * 
 *
 * 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, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { MenuVo } from '../models';
/**
 * MenuV1alpha1PublicApi - axios parameter creator
 * @export
 */
export const MenuV1alpha1PublicApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Gets menu by name.
         * @param {string} name Menu name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        queryMenuByName: async (name: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'name' is not null or undefined
            assertParamExists('queryMenuByName', 'name', name)
            const localVarPath = `/apis/api.halo.run/v1alpha1/menus/{name}`
                .replace(`{${"name"}}`, encodeURIComponent(String(name)));
            // 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)

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Gets primary menu.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        queryPrimaryMenu: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/apis/api.halo.run/v1alpha1/menus/-`;
            // 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)

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)


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

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

/**
 * MenuV1alpha1PublicApi - functional programming interface
 * @export
 */
export const MenuV1alpha1PublicApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = MenuV1alpha1PublicApiAxiosParamCreator(configuration)
    return {
        /**
         * Gets menu by name.
         * @param {string} name Menu name
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async queryMenuByName(name: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MenuVo>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.queryMenuByName(name, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MenuV1alpha1PublicApi.queryMenuByName']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Gets primary menu.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async queryPrimaryMenu(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<MenuVo>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.queryPrimaryMenu(options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['MenuV1alpha1PublicApi.queryPrimaryMenu']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * MenuV1alpha1PublicApi - factory interface
 * @export
 */
export const MenuV1alpha1PublicApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = MenuV1alpha1PublicApiFp(configuration)
    return {
        /**
         * Gets menu by name.
         * @param {MenuV1alpha1PublicApiQueryMenuByNameRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        queryMenuByName(requestParameters: MenuV1alpha1PublicApiQueryMenuByNameRequest, options?: RawAxiosRequestConfig): AxiosPromise<MenuVo> {
            return localVarFp.queryMenuByName(requestParameters.name, options).then((request) => request(axios, basePath));
        },
        /**
         * Gets primary menu.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        queryPrimaryMenu(options?: RawAxiosRequestConfig): AxiosPromise<MenuVo> {
            return localVarFp.queryPrimaryMenu(options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * Request parameters for queryMenuByName operation in MenuV1alpha1PublicApi.
 * @export
 * @interface MenuV1alpha1PublicApiQueryMenuByNameRequest
 */
export interface MenuV1alpha1PublicApiQueryMenuByNameRequest {
    /**
     * Menu name
     * @type {string}
     * @memberof MenuV1alpha1PublicApiQueryMenuByName
     */
    readonly name: string
}

/**
 * MenuV1alpha1PublicApi - object-oriented interface
 * @export
 * @class MenuV1alpha1PublicApi
 * @extends {BaseAPI}
 */
export class MenuV1alpha1PublicApi extends BaseAPI {
    /**
     * Gets menu by name.
     * @param {MenuV1alpha1PublicApiQueryMenuByNameRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MenuV1alpha1PublicApi
     */
    public queryMenuByName(requestParameters: MenuV1alpha1PublicApiQueryMenuByNameRequest, options?: RawAxiosRequestConfig) {
        return MenuV1alpha1PublicApiFp(this.configuration).queryMenuByName(requestParameters.name, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Gets primary menu.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof MenuV1alpha1PublicApi
     */
    public queryPrimaryMenu(options?: RawAxiosRequestConfig) {
        return MenuV1alpha1PublicApiFp(this.configuration).queryPrimaryMenu(options).then((request) => request(this.axios, this.basePath));
    }
}

