/* 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 { ChangePasswordRequest } from "../models";
// @ts-ignore
import { CreateUserRequest } from "../models";
// @ts-ignore
import { DetailedUser } from "../models";
// @ts-ignore
import { EmailVerifyRequest } from "../models";
// @ts-ignore
import { GrantRequest } from "../models";
// @ts-ignore
import { User } from "../models";
// @ts-ignore
import { UserEndpointListedUserList } from "../models";
// @ts-ignore
import { UserPermission } from "../models";
// @ts-ignore
import { VerifyCodeRequest } from "../models";
/**
 * ApiConsoleHaloRunV1alpha1UserApi - axios parameter creator
 * @export
 */
export const ApiConsoleHaloRunV1alpha1UserApiAxiosParamCreator = function (
  configuration?: Configuration
) {
  return {
    /**
     * Change password of user.
     * @param {string} name Name of user. If the name is equal to \&#39;-\&#39;, it will change the password of current user.
     * @param {ChangePasswordRequest} changePasswordRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    changePassword: async (
      name: string,
      changePasswordRequest: ChangePasswordRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("changePassword", "name", name);
      // verify required parameter 'changePasswordRequest' is not null or undefined
      assertParamExists(
        "changePassword",
        "changePasswordRequest",
        changePasswordRequest
      );
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/users/{name}/password`.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(
        changePasswordRequest,
        localVarRequestOptions,
        configuration
      );

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * Creates a new user.
     * @param {CreateUserRequest} createUserRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    createUser: async (
      createUserRequest: CreateUserRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'createUserRequest' is not null or undefined
      assertParamExists("createUser", "createUserRequest", createUserRequest);
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/users`;
      // 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(
        createUserRequest,
        localVarRequestOptions,
        configuration
      );

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * delete user avatar
     * @param {string} name User name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    deleteUserAvatar: async (
      name: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("deleteUserAvatar", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/users/{name}/avatar`.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: "DELETE",
        ...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,
      };
    },
    /**
     * Get current user detail
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    getCurrentUserDetail: async (
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/users/-`;
      // 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,
      };
    },
    /**
     * Get permissions of user
     * @param {string} name User name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    getPermissions: async (
      name: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("getPermissions", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/users/{name}/permissions`.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,
      };
    },
    /**
     * Get user detail by name
     * @param {string} name User name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    getUserDetail: async (
      name: string,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("getUserDetail", "name", name);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/users/{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,
      };
    },
    /**
     * Grant permissions to user
     * @param {string} name User name
     * @param {GrantRequest} grantRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    grantPermission: async (
      name: string,
      grantRequest: GrantRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("grantPermission", "name", name);
      // verify required parameter 'grantRequest' is not null or undefined
      assertParamExists("grantPermission", "grantRequest", grantRequest);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/users/{name}/permissions`.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(
        grantRequest,
        localVarRequestOptions,
        configuration
      );

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * List users
     * @param {Array<string>} [fieldSelector] Field selector for filtering.
     * @param {string} [keyword]
     * @param {Array<string>} [labelSelector] Label selector for filtering.
     * @param {number} [page] The page number. Zero indicates no page.
     * @param {string} [role]
     * @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}
     */
    listUsers: async (
      fieldSelector?: Array<string>,
      keyword?: string,
      labelSelector?: Array<string>,
      page?: number,
      role?: string,
      size?: number,
      sort?: Array<string>,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/users`;
      // 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 (fieldSelector) {
        localVarQueryParameter["fieldSelector"] = fieldSelector;
      }

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

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

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

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

      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,
      };
    },
    /**
     * Send email verification code for user
     * @param {EmailVerifyRequest} emailVerifyRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    sendEmailVerificationCode: async (
      emailVerifyRequest: EmailVerifyRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'emailVerifyRequest' is not null or undefined
      assertParamExists(
        "sendEmailVerificationCode",
        "emailVerifyRequest",
        emailVerifyRequest
      );
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/users/-/send-email-verification-code`;
      // 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(
        emailVerifyRequest,
        localVarRequestOptions,
        configuration
      );

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * Update current user profile, but password.
     * @param {User} user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    updateCurrentUser: async (
      user: User,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'user' is not null or undefined
      assertParamExists("updateCurrentUser", "user", user);
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/users/-`;
      // 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(
        user,
        localVarRequestOptions,
        configuration
      );

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions,
      };
    },
    /**
     * upload user avatar
     * @param {string} name User name
     * @param {File} file
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    uploadUserAvatar: async (
      name: string,
      file: File,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'name' is not null or undefined
      assertParamExists("uploadUserAvatar", "name", name);
      // verify required parameter 'file' is not null or undefined
      assertParamExists("uploadUserAvatar", "file", file);
      const localVarPath =
        `/apis/api.console.halo.run/v1alpha1/users/{name}/avatar`.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);
      }

      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,
      };
    },
    /**
     * Verify email for user by code.
     * @param {VerifyCodeRequest} verifyCodeRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    verifyEmail: async (
      verifyCodeRequest: VerifyCodeRequest,
      options: AxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'verifyCodeRequest' is not null or undefined
      assertParamExists("verifyEmail", "verifyCodeRequest", verifyCodeRequest);
      const localVarPath = `/apis/api.console.halo.run/v1alpha1/users/-/verify-email`;
      // 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(
        verifyCodeRequest,
        localVarRequestOptions,
        configuration
      );

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

/**
 * ApiConsoleHaloRunV1alpha1UserApi - functional programming interface
 * @export
 */
export const ApiConsoleHaloRunV1alpha1UserApiFp = function (
  configuration?: Configuration
) {
  const localVarAxiosParamCreator =
    ApiConsoleHaloRunV1alpha1UserApiAxiosParamCreator(configuration);
  return {
    /**
     * Change password of user.
     * @param {string} name Name of user. If the name is equal to \&#39;-\&#39;, it will change the password of current user.
     * @param {ChangePasswordRequest} changePasswordRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async changePassword(
      name: string,
      changePasswordRequest: ChangePasswordRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.changePassword(
        name,
        changePasswordRequest,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Creates a new user.
     * @param {CreateUserRequest} createUserRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async createUser(
      createUserRequest: CreateUserRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.createUser(
        createUserRequest,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * delete user avatar
     * @param {string} name User name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async deleteUserAvatar(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.deleteUserAvatar(name, options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Get current user detail
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async getCurrentUserDetail(
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<DetailedUser>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.getCurrentUserDetail(options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Get permissions of user
     * @param {string} name User name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async getPermissions(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<UserPermission>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.getPermissions(
        name,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Get user detail by name
     * @param {string} name User name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async getUserDetail(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<DetailedUser>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.getUserDetail(
        name,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Grant permissions to user
     * @param {string} name User name
     * @param {GrantRequest} grantRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async grantPermission(
      name: string,
      grantRequest: GrantRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.grantPermission(
        name,
        grantRequest,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * List users
     * @param {Array<string>} [fieldSelector] Field selector for filtering.
     * @param {string} [keyword]
     * @param {Array<string>} [labelSelector] Label selector for filtering.
     * @param {number} [page] The page number. Zero indicates no page.
     * @param {string} [role]
     * @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 listUsers(
      fieldSelector?: Array<string>,
      keyword?: string,
      labelSelector?: Array<string>,
      page?: number,
      role?: string,
      size?: number,
      sort?: Array<string>,
      options?: AxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<UserEndpointListedUserList>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.listUsers(
        fieldSelector,
        keyword,
        labelSelector,
        page,
        role,
        size,
        sort,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Send email verification code for user
     * @param {EmailVerifyRequest} emailVerifyRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async sendEmailVerificationCode(
      emailVerifyRequest: EmailVerifyRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.sendEmailVerificationCode(
          emailVerifyRequest,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Update current user profile, but password.
     * @param {User} user
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async updateCurrentUser(
      user: User,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.updateCurrentUser(user, options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * upload user avatar
     * @param {string} name User name
     * @param {File} file
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async uploadUserAvatar(
      name: string,
      file: File,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<User>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.uploadUserAvatar(name, file, options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Verify email for user by code.
     * @param {VerifyCodeRequest} verifyCodeRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async verifyEmail(
      verifyCodeRequest: VerifyCodeRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.verifyEmail(
        verifyCodeRequest,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
  };
};

/**
 * ApiConsoleHaloRunV1alpha1UserApi - factory interface
 * @export
 */
export const ApiConsoleHaloRunV1alpha1UserApiFactory = function (
  configuration?: Configuration,
  basePath?: string,
  axios?: AxiosInstance
) {
  const localVarFp = ApiConsoleHaloRunV1alpha1UserApiFp(configuration);
  return {
    /**
     * Change password of user.
     * @param {ApiConsoleHaloRunV1alpha1UserApiChangePasswordRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    changePassword(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiChangePasswordRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<User> {
      return localVarFp
        .changePassword(
          requestParameters.name,
          requestParameters.changePasswordRequest,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Creates a new user.
     * @param {ApiConsoleHaloRunV1alpha1UserApiCreateUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    createUser(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiCreateUserRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<User> {
      return localVarFp
        .createUser(requestParameters.createUserRequest, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * delete user avatar
     * @param {ApiConsoleHaloRunV1alpha1UserApiDeleteUserAvatarRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    deleteUserAvatar(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiDeleteUserAvatarRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<User> {
      return localVarFp
        .deleteUserAvatar(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Get current user detail
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    getCurrentUserDetail(
      options?: AxiosRequestConfig
    ): AxiosPromise<DetailedUser> {
      return localVarFp
        .getCurrentUserDetail(options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Get permissions of user
     * @param {ApiConsoleHaloRunV1alpha1UserApiGetPermissionsRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    getPermissions(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiGetPermissionsRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<UserPermission> {
      return localVarFp
        .getPermissions(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Get user detail by name
     * @param {ApiConsoleHaloRunV1alpha1UserApiGetUserDetailRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    getUserDetail(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiGetUserDetailRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<DetailedUser> {
      return localVarFp
        .getUserDetail(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Grant permissions to user
     * @param {ApiConsoleHaloRunV1alpha1UserApiGrantPermissionRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    grantPermission(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiGrantPermissionRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<User> {
      return localVarFp
        .grantPermission(
          requestParameters.name,
          requestParameters.grantRequest,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * List users
     * @param {ApiConsoleHaloRunV1alpha1UserApiListUsersRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    listUsers(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiListUsersRequest = {},
      options?: AxiosRequestConfig
    ): AxiosPromise<UserEndpointListedUserList> {
      return localVarFp
        .listUsers(
          requestParameters.fieldSelector,
          requestParameters.keyword,
          requestParameters.labelSelector,
          requestParameters.page,
          requestParameters.role,
          requestParameters.size,
          requestParameters.sort,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Send email verification code for user
     * @param {ApiConsoleHaloRunV1alpha1UserApiSendEmailVerificationCodeRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    sendEmailVerificationCode(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiSendEmailVerificationCodeRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<void> {
      return localVarFp
        .sendEmailVerificationCode(
          requestParameters.emailVerifyRequest,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Update current user profile, but password.
     * @param {ApiConsoleHaloRunV1alpha1UserApiUpdateCurrentUserRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    updateCurrentUser(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiUpdateCurrentUserRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<User> {
      return localVarFp
        .updateCurrentUser(requestParameters.user, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * upload user avatar
     * @param {ApiConsoleHaloRunV1alpha1UserApiUploadUserAvatarRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    uploadUserAvatar(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiUploadUserAvatarRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<User> {
      return localVarFp
        .uploadUserAvatar(
          requestParameters.name,
          requestParameters.file,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Verify email for user by code.
     * @param {ApiConsoleHaloRunV1alpha1UserApiVerifyEmailRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    verifyEmail(
      requestParameters: ApiConsoleHaloRunV1alpha1UserApiVerifyEmailRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<void> {
      return localVarFp
        .verifyEmail(requestParameters.verifyCodeRequest, options)
        .then((request) => request(axios, basePath));
    },
  };
};

/**
 * Request parameters for changePassword operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiChangePasswordRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiChangePasswordRequest {
  /**
   * Name of user. If the name is equal to \&#39;-\&#39;, it will change the password of current user.
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiChangePassword
   */
  readonly name: string;

  /**
   *
   * @type {ChangePasswordRequest}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiChangePassword
   */
  readonly changePasswordRequest: ChangePasswordRequest;
}

/**
 * Request parameters for createUser operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiCreateUserRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiCreateUserRequest {
  /**
   *
   * @type {CreateUserRequest}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiCreateUser
   */
  readonly createUserRequest: CreateUserRequest;
}

/**
 * Request parameters for deleteUserAvatar operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiDeleteUserAvatarRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiDeleteUserAvatarRequest {
  /**
   * User name
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiDeleteUserAvatar
   */
  readonly name: string;
}

/**
 * Request parameters for getPermissions operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiGetPermissionsRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiGetPermissionsRequest {
  /**
   * User name
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiGetPermissions
   */
  readonly name: string;
}

/**
 * Request parameters for getUserDetail operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiGetUserDetailRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiGetUserDetailRequest {
  /**
   * User name
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiGetUserDetail
   */
  readonly name: string;
}

/**
 * Request parameters for grantPermission operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiGrantPermissionRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiGrantPermissionRequest {
  /**
   * User name
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiGrantPermission
   */
  readonly name: string;

  /**
   *
   * @type {GrantRequest}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiGrantPermission
   */
  readonly grantRequest: GrantRequest;
}

/**
 * Request parameters for listUsers operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiListUsersRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiListUsersRequest {
  /**
   * Field selector for filtering.
   * @type {Array<string>}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiListUsers
   */
  readonly fieldSelector?: Array<string>;

  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiListUsers
   */
  readonly keyword?: string;

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

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

  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiListUsers
   */
  readonly role?: string;

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

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

/**
 * Request parameters for sendEmailVerificationCode operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiSendEmailVerificationCodeRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiSendEmailVerificationCodeRequest {
  /**
   *
   * @type {EmailVerifyRequest}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiSendEmailVerificationCode
   */
  readonly emailVerifyRequest: EmailVerifyRequest;
}

/**
 * Request parameters for updateCurrentUser operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiUpdateCurrentUserRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiUpdateCurrentUserRequest {
  /**
   *
   * @type {User}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiUpdateCurrentUser
   */
  readonly user: User;
}

/**
 * Request parameters for uploadUserAvatar operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiUploadUserAvatarRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiUploadUserAvatarRequest {
  /**
   * User name
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiUploadUserAvatar
   */
  readonly name: string;

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

/**
 * Request parameters for verifyEmail operation in ApiConsoleHaloRunV1alpha1UserApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1UserApiVerifyEmailRequest
 */
export interface ApiConsoleHaloRunV1alpha1UserApiVerifyEmailRequest {
  /**
   *
   * @type {VerifyCodeRequest}
   * @memberof ApiConsoleHaloRunV1alpha1UserApiVerifyEmail
   */
  readonly verifyCodeRequest: VerifyCodeRequest;
}

/**
 * ApiConsoleHaloRunV1alpha1UserApi - object-oriented interface
 * @export
 * @class ApiConsoleHaloRunV1alpha1UserApi
 * @extends {BaseAPI}
 */
export class ApiConsoleHaloRunV1alpha1UserApi extends BaseAPI {
  /**
   * Change password of user.
   * @param {ApiConsoleHaloRunV1alpha1UserApiChangePasswordRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public changePassword(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiChangePasswordRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .changePassword(
        requestParameters.name,
        requestParameters.changePasswordRequest,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Creates a new user.
   * @param {ApiConsoleHaloRunV1alpha1UserApiCreateUserRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public createUser(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiCreateUserRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .createUser(requestParameters.createUserRequest, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * delete user avatar
   * @param {ApiConsoleHaloRunV1alpha1UserApiDeleteUserAvatarRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public deleteUserAvatar(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiDeleteUserAvatarRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .deleteUserAvatar(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Get current user detail
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public getCurrentUserDetail(options?: AxiosRequestConfig) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .getCurrentUserDetail(options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Get permissions of user
   * @param {ApiConsoleHaloRunV1alpha1UserApiGetPermissionsRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public getPermissions(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiGetPermissionsRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .getPermissions(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Get user detail by name
   * @param {ApiConsoleHaloRunV1alpha1UserApiGetUserDetailRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public getUserDetail(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiGetUserDetailRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .getUserDetail(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Grant permissions to user
   * @param {ApiConsoleHaloRunV1alpha1UserApiGrantPermissionRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public grantPermission(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiGrantPermissionRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .grantPermission(
        requestParameters.name,
        requestParameters.grantRequest,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * List users
   * @param {ApiConsoleHaloRunV1alpha1UserApiListUsersRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public listUsers(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiListUsersRequest = {},
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .listUsers(
        requestParameters.fieldSelector,
        requestParameters.keyword,
        requestParameters.labelSelector,
        requestParameters.page,
        requestParameters.role,
        requestParameters.size,
        requestParameters.sort,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Send email verification code for user
   * @param {ApiConsoleHaloRunV1alpha1UserApiSendEmailVerificationCodeRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public sendEmailVerificationCode(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiSendEmailVerificationCodeRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .sendEmailVerificationCode(requestParameters.emailVerifyRequest, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Update current user profile, but password.
   * @param {ApiConsoleHaloRunV1alpha1UserApiUpdateCurrentUserRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public updateCurrentUser(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiUpdateCurrentUserRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .updateCurrentUser(requestParameters.user, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * upload user avatar
   * @param {ApiConsoleHaloRunV1alpha1UserApiUploadUserAvatarRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public uploadUserAvatar(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiUploadUserAvatarRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .uploadUserAvatar(requestParameters.name, requestParameters.file, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Verify email for user by code.
   * @param {ApiConsoleHaloRunV1alpha1UserApiVerifyEmailRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1UserApi
   */
  public verifyEmail(
    requestParameters: ApiConsoleHaloRunV1alpha1UserApiVerifyEmailRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1UserApiFp(this.configuration)
      .verifyEmail(requestParameters.verifyCodeRequest, options)
      .then((request) => request(this.axios, this.basePath));
  }
}
