/* tslint:disable */
/* eslint-disable */
/**
 * Halo Next API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.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, AxiosRequestConfig } 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,
} from "../base";
// @ts-ignore
import { ConfigMap } from "../models";
// @ts-ignore
import { InstallFromUriRequest } from "../models";
// @ts-ignore
import { Plugin } from "../models";
// @ts-ignore
import { PluginList } from "../models";
// @ts-ignore
import { PluginRunningStateRequest } from "../models";
// @ts-ignore
import { Setting } from "../models";
// @ts-ignore
import { UpgradeFromUriRequest } from "../models";
/**
 * ApiConsoleHaloRunV1alpha1PluginApi - axios parameter creator
 * @export
 */
export const ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator = function (
  configuration?: Configuration
) {
  return {
    /**
     * Change the running state of a plugin by name.
     * @param {string} name
     * @param {PluginRunningStateRequest} pluginRunningStateRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    changePluginRunningState: async (
      name: string,
      pluginRunningStateRequest: PluginRunningStateRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("changePluginRunningState", "name", name);
      // verify required parameter 'pluginRunningStateRequest' is not null or undefined
      assertParamExists(
        "changePluginRunningState",
        "pluginRunningStateRequest",
        pluginRunningStateRequest
      );
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/plugin-state`.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: "PUT",
        ...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);

      localVarHeaderParameter["Content-Type"] = "application/json";

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * Merge all CSS bundles of enabled plugins into one.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchCssBundle: async (
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/-/bundle.css`;
      // 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,
      };
    },
    /**
     * Merge all JS bundles of enabled plugins into one.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchJsBundle: async (
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/-/bundle.js`;
      // 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,
      };
    },
    /**
     * Fetch configMap of plugin by configured configMapName.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchPluginConfig: async (
      name: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("fetchPluginConfig", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/config`.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,
      };
    },
    /**
     * Fetch setting of plugin.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchPluginSetting: async (
      name: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("fetchPluginSetting", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/setting`.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,
      };
    },
    /**
     * Install a plugin by uploading a Jar file.
     * @param {File} [file]
     * @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
     * @param {string} [source] Install source. Default is file.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    installPlugin: async (
      file?: File,
      presetName?: string,
      source?: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/install`;
      // 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;
      const localVarFormParams = new ((configuration &&
        configuration.formDataCtor) ||
        FormData)();

      // authentication BasicAuth required
      // http basic authentication required
      setBasicAuthToObject(localVarRequestOptions, configuration);

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

      if (file !== undefined) {
        localVarFormParams.append("file", file as any);
      }

      if (presetName !== undefined) {
        localVarFormParams.append("presetName", presetName as any);
      }

      if (source !== undefined) {
        localVarFormParams.append("source", source as any);
      }

      localVarHeaderParameter["Content-Type"] = "multipart/form-data";

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * Install a plugin from uri.
     * @param {InstallFromUriRequest} installFromUriRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    installPluginFromUri: async (
      installFromUriRequest: InstallFromUriRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'installFromUriRequest' is not null or undefined
      assertParamExists(
        "installPluginFromUri",
        "installFromUriRequest",
        installFromUriRequest
      );
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins/-/install-from-uri`;
      // 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);

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

      localVarHeaderParameter["Content-Type"] = "application/json";

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * List all plugin presets in the system.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    listPluginPresets: async (
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugin-presets`;
      // 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,
      };
    },
    /**
     * List plugins using query criteria and sort params
     * @param {boolean} [enabled] Whether the plugin is enabled
     * @param {Array<string>} [fieldSelector] Field selector for filtering.
     * @param {string} [keyword] Keyword of plugin name or description
     * @param {Array<string>} [labelSelector] Label selector for filtering.
     * @param {number} [page] The page number. Zero indicates no page.
     * @param {number} [size] Size of one page. Zero indicates no limit.
     * @param {Array<string>} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    listPlugins: async (
      enabled?: boolean,
      fieldSelector?: Array<string>,
      keyword?: string,
      labelSelector?: Array<string>,
      page?: number,
      size?: number,
      sort?: Array<string>,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/plugins`;
      // 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);

      if (enabled !== undefined) {
        localVarQueryParameter["enabled"] = enabled;
      }

      if (fieldSelector) {
        localVarQueryParameter["fieldSelector"] = fieldSelector;
      }

      if (keyword !== undefined) {
        localVarQueryParameter["keyword"] = keyword;
      }

      if (labelSelector) {
        localVarQueryParameter["labelSelector"] = labelSelector;
      }

      if (page !== undefined) {
        localVarQueryParameter["page"] = page;
      }

      if (size !== undefined) {
        localVarQueryParameter["size"] = size;
      }

      if (sort) {
        localVarQueryParameter["sort"] = Array.from(sort);
      }

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * Reload a plugin by name.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    reloadPlugin: async (
      name: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("reloadPlugin", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/reload`.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: "PUT",
        ...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,
      };
    },
    /**
     * Reset the configMap of plugin setting.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    resetPluginConfig: async (
      name: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("resetPluginConfig", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/reset-config`.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: "PUT",
        ...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,
      };
    },
    /**
     * Update the configMap of plugin setting.
     * @param {string} name
     * @param {ConfigMap} configMap
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    updatePluginConfig: async (
      name: string,
      configMap: ConfigMap,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("updatePluginConfig", "name", name);
      // verify required parameter 'configMap' is not null or undefined
      assertParamExists("updatePluginConfig", "configMap", configMap);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/config`.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: "PUT",
        ...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);

      localVarHeaderParameter["Content-Type"] = "application/json";

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * Upgrade a plugin by uploading a Jar file
     * @param {string} name
     * @param {File} [file]
     * @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
     * @param {string} [source] Install source. Default is file.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    upgradePlugin: async (
      name: string,
      file?: File,
      presetName?: string,
      source?: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("upgradePlugin", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/upgrade`.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: "POST",
        ...baseOptions,
        ...options,
      };
      const localVarHeaderParameter = {} as any;
      const localVarQueryParameter = {} as any;
      const localVarFormParams = new ((configuration &&
        configuration.formDataCtor) ||
        FormData)();

      // authentication BasicAuth required
      // http basic authentication required
      setBasicAuthToObject(localVarRequestOptions, configuration);

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

      if (file !== undefined) {
        localVarFormParams.append("file", file as any);
      }

      if (presetName !== undefined) {
        localVarFormParams.append("presetName", presetName as any);
      }

      if (source !== undefined) {
        localVarFormParams.append("source", source as any);
      }

      localVarHeaderParameter["Content-Type"] = "multipart/form-data";

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * Upgrade a plugin from uri.
     * @param {string} name
     * @param {UpgradeFromUriRequest} upgradeFromUriRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    upgradePluginFromUri: async (
      name: string,
      upgradeFromUriRequest: UpgradeFromUriRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("upgradePluginFromUri", "name", name);
      // verify required parameter 'upgradeFromUriRequest' is not null or undefined
      assertParamExists(
        "upgradePluginFromUri",
        "upgradeFromUriRequest",
        upgradeFromUriRequest
      );
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/plugins/{name}/upgrade-from-uri`.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: "POST",
        ...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);

      localVarHeaderParameter["Content-Type"] = "application/json";

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

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

/**
 * ApiConsoleHaloRunV1alpha1PluginApi - functional programming interface
 * @export
 */
export const ApiConsoleHaloRunV1alpha1PluginApiFp = function (
  configuration?: Configuration
) {
  const localVarAxiosParamCreator =
    ApiConsoleHaloRunV1alpha1PluginApiAxiosParamCreator(configuration);
  return {
    /**
     * Change the running state of a plugin by name.
     * @param {string} name
     * @param {PluginRunningStateRequest} pluginRunningStateRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async changePluginRunningState(
      name: string,
      pluginRunningStateRequest: PluginRunningStateRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.changePluginRunningState(
          name,
          pluginRunningStateRequest,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Merge all CSS bundles of enabled plugins into one.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async fetchCssBundle(
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.fetchCssBundle(
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Merge all JS bundles of enabled plugins into one.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async fetchJsBundle(
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.fetchJsBundle(
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Fetch configMap of plugin by configured configMapName.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async fetchPluginConfig(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConfigMap>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.fetchPluginConfig(name, options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Fetch setting of plugin.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async fetchPluginSetting(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Setting>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.fetchPluginSetting(name, options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Install a plugin by uploading a Jar file.
     * @param {File} [file]
     * @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
     * @param {string} [source] Install source. Default is file.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async installPlugin(
      file?: File,
      presetName?: string,
      source?: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.installPlugin(
        file,
        presetName,
        source,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Install a plugin from uri.
     * @param {InstallFromUriRequest} installFromUriRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async installPluginFromUri(
      installFromUriRequest: InstallFromUriRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.installPluginFromUri(
          installFromUriRequest,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * List all plugin presets in the system.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async listPluginPresets(
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<Plugin>>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.listPluginPresets(options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * List plugins using query criteria and sort params
     * @param {boolean} [enabled] Whether the plugin is enabled
     * @param {Array<string>} [fieldSelector] Field selector for filtering.
     * @param {string} [keyword] Keyword of plugin name or description
     * @param {Array<string>} [labelSelector] Label selector for filtering.
     * @param {number} [page] The page number. Zero indicates no page.
     * @param {number} [size] Size of one page. Zero indicates no limit.
     * @param {Array<string>} [sort] Sort property and direction of the list result. Supported fields: creationTimestamp
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async listPlugins(
      enabled?: boolean,
      fieldSelector?: Array<string>,
      keyword?: string,
      labelSelector?: Array<string>,
      page?: number,
      size?: number,
      sort?: Array<string>,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<PluginList>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.listPlugins(
        enabled,
        fieldSelector,
        keyword,
        labelSelector,
        page,
        size,
        sort,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Reload a plugin by name.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async reloadPlugin(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.reloadPlugin(
        name,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Reset the configMap of plugin setting.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async resetPluginConfig(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConfigMap>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.resetPluginConfig(name, options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Update the configMap of plugin setting.
     * @param {string} name
     * @param {ConfigMap} configMap
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async updatePluginConfig(
      name: string,
      configMap: ConfigMap,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ConfigMap>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.updatePluginConfig(
          name,
          configMap,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Upgrade a plugin by uploading a Jar file
     * @param {string} name
     * @param {File} [file]
     * @param {string} [presetName] Plugin preset name. We will find the plugin from plugin presets
     * @param {string} [source] Install source. Default is file.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async upgradePlugin(
      name: string,
      file?: File,
      presetName?: string,
      source?: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.upgradePlugin(
        name,
        file,
        presetName,
        source,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Upgrade a plugin from uri.
     * @param {string} name
     * @param {UpgradeFromUriRequest} upgradeFromUriRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async upgradePluginFromUri(
      name: string,
      upgradeFromUriRequest: UpgradeFromUriRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Plugin>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.upgradePluginFromUri(
          name,
          upgradeFromUriRequest,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
  };
};

/**
 * ApiConsoleHaloRunV1alpha1PluginApi - factory interface
 * @export
 */
export const ApiConsoleHaloRunV1alpha1PluginApiFactory = function (
  configuration?: Configuration,
  basePath?: string,
  axios?: AxiosInstance
) {
  const localVarFp = ApiConsoleHaloRunV1alpha1PluginApiFp(configuration);
  return {
    /**
     * Change the running state of a plugin by name.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningStateRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    changePluginRunningState(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningStateRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<Plugin> {
      return localVarFp
        .changePluginRunningState(
          requestParameters.name,
          requestParameters.pluginRunningStateRequest,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Merge all CSS bundles of enabled plugins into one.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchCssBundle(options?: AxiosRequestConfig): AxiosPromise<string> {
      return localVarFp
        .fetchCssBundle(options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Merge all JS bundles of enabled plugins into one.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchJsBundle(options?: AxiosRequestConfig): AxiosPromise<string> {
      return localVarFp
        .fetchJsBundle(options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Fetch configMap of plugin by configured configMapName.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiFetchPluginConfigRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchPluginConfig(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiFetchPluginConfigRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<ConfigMap> {
      return localVarFp
        .fetchPluginConfig(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Fetch setting of plugin.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiFetchPluginSettingRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchPluginSetting(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiFetchPluginSettingRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<Setting> {
      return localVarFp
        .fetchPluginSetting(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Install a plugin by uploading a Jar file.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    installPlugin(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest = {},
      options?: AxiosRequestConfig
    ): AxiosPromise<Plugin> {
      return localVarFp
        .installPlugin(
          requestParameters.file,
          requestParameters.presetName,
          requestParameters.source,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Install a plugin from uri.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiInstallPluginFromUriRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    installPluginFromUri(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginFromUriRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<Plugin> {
      return localVarFp
        .installPluginFromUri(requestParameters.installFromUriRequest, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * List all plugin presets in the system.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    listPluginPresets(
      options?: AxiosRequestConfig
    ): AxiosPromise<Array<Plugin>> {
      return localVarFp
        .listPluginPresets(options)
        .then((request) => request(axios, basePath));
    },
    /**
     * List plugins using query criteria and sort params
     * @param {ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    listPlugins(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest = {},
      options?: AxiosRequestConfig
    ): AxiosPromise<PluginList> {
      return localVarFp
        .listPlugins(
          requestParameters.enabled,
          requestParameters.fieldSelector,
          requestParameters.keyword,
          requestParameters.labelSelector,
          requestParameters.page,
          requestParameters.size,
          requestParameters.sort,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Reload a plugin by name.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiReloadPluginRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    reloadPlugin(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiReloadPluginRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<Plugin> {
      return localVarFp
        .reloadPlugin(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Reset the configMap of plugin setting.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiResetPluginConfigRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    resetPluginConfig(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiResetPluginConfigRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<ConfigMap> {
      return localVarFp
        .resetPluginConfig(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Update the configMap of plugin setting.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfigRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    updatePluginConfig(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfigRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<ConfigMap> {
      return localVarFp
        .updatePluginConfig(
          requestParameters.name,
          requestParameters.configMap,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Upgrade a plugin by uploading a Jar file
     * @param {ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    upgradePlugin(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<void> {
      return localVarFp
        .upgradePlugin(
          requestParameters.name,
          requestParameters.file,
          requestParameters.presetName,
          requestParameters.source,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Upgrade a plugin from uri.
     * @param {ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUriRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    upgradePluginFromUri(
      requestParameters: ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUriRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<Plugin> {
      return localVarFp
        .upgradePluginFromUri(
          requestParameters.name,
          requestParameters.upgradeFromUriRequest,
          options
        )
        .then((request) => request(axios, basePath));
    },
  };
};

/**
 * Request parameters for changePluginRunningState operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningStateRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningStateRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningState
   */
  readonly name: string;

  /**
   *
   * @type {PluginRunningStateRequest}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningState
   */
  readonly pluginRunningStateRequest: PluginRunningStateRequest;
}

/**
 * Request parameters for fetchPluginConfig operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiFetchPluginConfigRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiFetchPluginConfigRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiFetchPluginConfig
   */
  readonly name: string;
}

/**
 * Request parameters for fetchPluginSetting operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiFetchPluginSettingRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiFetchPluginSettingRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiFetchPluginSetting
   */
  readonly name: string;
}

/**
 * Request parameters for installPlugin operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest {
  /**
   *
   * @type {File}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
   */
  readonly file?: File;

  /**
   * Plugin preset name. We will find the plugin from plugin presets
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
   */
  readonly presetName?: string;

  /**
   * Install source. Default is file.
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPlugin
   */
  readonly source?: string;
}

/**
 * Request parameters for installPluginFromUri operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiInstallPluginFromUriRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiInstallPluginFromUriRequest {
  /**
   *
   * @type {InstallFromUriRequest}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiInstallPluginFromUri
   */
  readonly installFromUriRequest: InstallFromUriRequest;
}

/**
 * Request parameters for listPlugins operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest {
  /**
   * Whether the plugin is enabled
   * @type {boolean}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
   */
  readonly enabled?: boolean;

  /**
   * Field selector for filtering.
   * @type {Array<string>}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
   */
  readonly fieldSelector?: Array<string>;

  /**
   * Keyword of plugin name or description
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
   */
  readonly keyword?: string;

  /**
   * Label selector for filtering.
   * @type {Array<string>}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
   */
  readonly labelSelector?: Array<string>;

  /**
   * The page number. Zero indicates no page.
   * @type {number}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
   */
  readonly page?: number;

  /**
   * Size of one page. Zero indicates no limit.
   * @type {number}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
   */
  readonly size?: number;

  /**
   * Sort property and direction of the list result. Supported fields: creationTimestamp
   * @type {Array<string>}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiListPlugins
   */
  readonly sort?: Array<string>;
}

/**
 * Request parameters for reloadPlugin operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiReloadPluginRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiReloadPluginRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiReloadPlugin
   */
  readonly name: string;
}

/**
 * Request parameters for resetPluginConfig operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiResetPluginConfigRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiResetPluginConfigRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiResetPluginConfig
   */
  readonly name: string;
}

/**
 * Request parameters for updatePluginConfig operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfigRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfigRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfig
   */
  readonly name: string;

  /**
   *
   * @type {ConfigMap}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfig
   */
  readonly configMap: ConfigMap;
}

/**
 * Request parameters for upgradePlugin operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
   */
  readonly name: string;

  /**
   *
   * @type {File}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
   */
  readonly file?: File;

  /**
   * Plugin preset name. We will find the plugin from plugin presets
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
   */
  readonly presetName?: string;

  /**
   * Install source. Default is file.
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePlugin
   */
  readonly source?: string;
}

/**
 * Request parameters for upgradePluginFromUri operation in ApiConsoleHaloRunV1alpha1PluginApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUriRequest
 */
export interface ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUriRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUri
   */
  readonly name: string;

  /**
   *
   * @type {UpgradeFromUriRequest}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUri
   */
  readonly upgradeFromUriRequest: UpgradeFromUriRequest;
}

/**
 * ApiConsoleHaloRunV1alpha1PluginApi - object-oriented interface
 * @export
 * @class ApiConsoleHaloRunV1alpha1PluginApi
 * @extends {BaseAPI}
 */
export class ApiConsoleHaloRunV1alpha1PluginApi extends BaseAPI {
  /**
   * Change the running state of a plugin by name.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningStateRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public changePluginRunningState(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiChangePluginRunningStateRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .changePluginRunningState(
        requestParameters.name,
        requestParameters.pluginRunningStateRequest,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Merge all CSS bundles of enabled plugins into one.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public fetchCssBundle(options?: AxiosRequestConfig) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .fetchCssBundle(options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Merge all JS bundles of enabled plugins into one.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public fetchJsBundle(options?: AxiosRequestConfig) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .fetchJsBundle(options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Fetch configMap of plugin by configured configMapName.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiFetchPluginConfigRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public fetchPluginConfig(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiFetchPluginConfigRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .fetchPluginConfig(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Fetch setting of plugin.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiFetchPluginSettingRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public fetchPluginSetting(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiFetchPluginSettingRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .fetchPluginSetting(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Install a plugin by uploading a Jar file.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public installPlugin(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginRequest = {},
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .installPlugin(
        requestParameters.file,
        requestParameters.presetName,
        requestParameters.source,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Install a plugin from uri.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiInstallPluginFromUriRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public installPluginFromUri(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiInstallPluginFromUriRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .installPluginFromUri(requestParameters.installFromUriRequest, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * List all plugin presets in the system.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public listPluginPresets(options?: AxiosRequestConfig) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .listPluginPresets(options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * List plugins using query criteria and sort params
   * @param {ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public listPlugins(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiListPluginsRequest = {},
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .listPlugins(
        requestParameters.enabled,
        requestParameters.fieldSelector,
        requestParameters.keyword,
        requestParameters.labelSelector,
        requestParameters.page,
        requestParameters.size,
        requestParameters.sort,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Reload a plugin by name.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiReloadPluginRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public reloadPlugin(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiReloadPluginRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .reloadPlugin(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Reset the configMap of plugin setting.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiResetPluginConfigRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public resetPluginConfig(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiResetPluginConfigRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .resetPluginConfig(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Update the configMap of plugin setting.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfigRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public updatePluginConfig(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiUpdatePluginConfigRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .updatePluginConfig(
        requestParameters.name,
        requestParameters.configMap,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Upgrade a plugin by uploading a Jar file
   * @param {ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public upgradePlugin(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .upgradePlugin(
        requestParameters.name,
        requestParameters.file,
        requestParameters.presetName,
        requestParameters.source,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Upgrade a plugin from uri.
   * @param {ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUriRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1PluginApi
   */
  public upgradePluginFromUri(
    requestParameters: ApiConsoleHaloRunV1alpha1PluginApiUpgradePluginFromUriRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1PluginApiFp(this.configuration)
      .upgradePluginFromUri(
        requestParameters.name,
        requestParameters.upgradeFromUriRequest,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }
}
