/* 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 { PersonalAccessToken } from "../models";
// @ts-ignore
import { PersonalAccessTokenList } from "../models";
/**
 * SecurityHaloRunV1alpha1PersonalAccessTokenApi - axios parameter creator
 * @export
 */
export const SecurityHaloRunV1alpha1PersonalAccessTokenApiAxiosParamCreator =
  function (configuration?: Configuration) {
    return {
      /**
       * Create security.halo.run/v1alpha1/PersonalAccessToken
       * @param {PersonalAccessToken} [personalAccessToken] Fresh personalaccesstoken
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      createsecurityHaloRunV1alpha1PersonalAccessToken: async (
        personalAccessToken?: PersonalAccessToken,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        const localVarPath = `/apis/security.halo.run/v1alpha1/personalaccesstokens`;
        // 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(
          personalAccessToken,
          localVarRequestOptions,
          configuration
        );

        return {
          url: toPathString(localVarUrlObj),
          options: localVarRequestOptions,
        };
      },
      /**
       * Delete security.halo.run/v1alpha1/PersonalAccessToken
       * @param {string} name Name of personalaccesstoken
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      deletesecurityHaloRunV1alpha1PersonalAccessToken: async (
        name: string,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists(
          "deletesecurityHaloRunV1alpha1PersonalAccessToken",
          "name",
          name
        );
        const localVarPath =
          `/apis/security.halo.run/v1alpha1/personalaccesstokens/{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: "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 security.halo.run/v1alpha1/PersonalAccessToken
       * @param {string} name Name of personalaccesstoken
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      getsecurityHaloRunV1alpha1PersonalAccessToken: async (
        name: string,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists(
          "getsecurityHaloRunV1alpha1PersonalAccessToken",
          "name",
          name
        );
        const localVarPath =
          `/apis/security.halo.run/v1alpha1/personalaccesstokens/{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,
        };
      },
      /**
       * List security.halo.run/v1alpha1/PersonalAccessToken
       * @param {Array<string>} [fieldSelector] Field selector for filtering.
       * @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. Support sorting based on attribute name path.
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      listsecurityHaloRunV1alpha1PersonalAccessToken: async (
        fieldSelector?: Array<string>,
        labelSelector?: Array<string>,
        page?: number,
        size?: number,
        sort?: Array<string>,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        const localVarPath = `/apis/security.halo.run/v1alpha1/personalaccesstokens`;
        // 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 (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,
        };
      },
      /**
       * Update security.halo.run/v1alpha1/PersonalAccessToken
       * @param {string} name Name of personalaccesstoken
       * @param {PersonalAccessToken} [personalAccessToken] Updated personalaccesstoken
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      updatesecurityHaloRunV1alpha1PersonalAccessToken: async (
        name: string,
        personalAccessToken?: PersonalAccessToken,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists(
          "updatesecurityHaloRunV1alpha1PersonalAccessToken",
          "name",
          name
        );
        const localVarPath =
          `/apis/security.halo.run/v1alpha1/personalaccesstokens/{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: "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(
          personalAccessToken,
          localVarRequestOptions,
          configuration
        );

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

/**
 * SecurityHaloRunV1alpha1PersonalAccessTokenApi - functional programming interface
 * @export
 */
export const SecurityHaloRunV1alpha1PersonalAccessTokenApiFp = function (
  configuration?: Configuration
) {
  const localVarAxiosParamCreator =
    SecurityHaloRunV1alpha1PersonalAccessTokenApiAxiosParamCreator(
      configuration
    );
  return {
    /**
     * Create security.halo.run/v1alpha1/PersonalAccessToken
     * @param {PersonalAccessToken} [personalAccessToken] Fresh personalaccesstoken
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async createsecurityHaloRunV1alpha1PersonalAccessToken(
      personalAccessToken?: PersonalAccessToken,
      options?: AxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<PersonalAccessToken>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.createsecurityHaloRunV1alpha1PersonalAccessToken(
          personalAccessToken,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Delete security.halo.run/v1alpha1/PersonalAccessToken
     * @param {string} name Name of personalaccesstoken
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async deletesecurityHaloRunV1alpha1PersonalAccessToken(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.deletesecurityHaloRunV1alpha1PersonalAccessToken(
          name,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Get security.halo.run/v1alpha1/PersonalAccessToken
     * @param {string} name Name of personalaccesstoken
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async getsecurityHaloRunV1alpha1PersonalAccessToken(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<PersonalAccessToken>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.getsecurityHaloRunV1alpha1PersonalAccessToken(
          name,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * List security.halo.run/v1alpha1/PersonalAccessToken
     * @param {Array<string>} [fieldSelector] Field selector for filtering.
     * @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. Support sorting based on attribute name path.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async listsecurityHaloRunV1alpha1PersonalAccessToken(
      fieldSelector?: Array<string>,
      labelSelector?: Array<string>,
      page?: number,
      size?: number,
      sort?: Array<string>,
      options?: AxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<PersonalAccessTokenList>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.listsecurityHaloRunV1alpha1PersonalAccessToken(
          fieldSelector,
          labelSelector,
          page,
          size,
          sort,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Update security.halo.run/v1alpha1/PersonalAccessToken
     * @param {string} name Name of personalaccesstoken
     * @param {PersonalAccessToken} [personalAccessToken] Updated personalaccesstoken
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async updatesecurityHaloRunV1alpha1PersonalAccessToken(
      name: string,
      personalAccessToken?: PersonalAccessToken,
      options?: AxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<PersonalAccessToken>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.updatesecurityHaloRunV1alpha1PersonalAccessToken(
          name,
          personalAccessToken,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
  };
};

/**
 * SecurityHaloRunV1alpha1PersonalAccessTokenApi - factory interface
 * @export
 */
export const SecurityHaloRunV1alpha1PersonalAccessTokenApiFactory = function (
  configuration?: Configuration,
  basePath?: string,
  axios?: AxiosInstance
) {
  const localVarFp =
    SecurityHaloRunV1alpha1PersonalAccessTokenApiFp(configuration);
  return {
    /**
     * Create security.halo.run/v1alpha1/PersonalAccessToken
     * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiCreatesecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    createsecurityHaloRunV1alpha1PersonalAccessToken(
      requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiCreatesecurityHaloRunV1alpha1PersonalAccessTokenRequest = {},
      options?: AxiosRequestConfig
    ): AxiosPromise<PersonalAccessToken> {
      return localVarFp
        .createsecurityHaloRunV1alpha1PersonalAccessToken(
          requestParameters.personalAccessToken,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Delete security.halo.run/v1alpha1/PersonalAccessToken
     * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiDeletesecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    deletesecurityHaloRunV1alpha1PersonalAccessToken(
      requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiDeletesecurityHaloRunV1alpha1PersonalAccessTokenRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<void> {
      return localVarFp
        .deletesecurityHaloRunV1alpha1PersonalAccessToken(
          requestParameters.name,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Get security.halo.run/v1alpha1/PersonalAccessToken
     * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiGetsecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    getsecurityHaloRunV1alpha1PersonalAccessToken(
      requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiGetsecurityHaloRunV1alpha1PersonalAccessTokenRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<PersonalAccessToken> {
      return localVarFp
        .getsecurityHaloRunV1alpha1PersonalAccessToken(
          requestParameters.name,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * List security.halo.run/v1alpha1/PersonalAccessToken
     * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    listsecurityHaloRunV1alpha1PersonalAccessToken(
      requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessTokenRequest = {},
      options?: AxiosRequestConfig
    ): AxiosPromise<PersonalAccessTokenList> {
      return localVarFp
        .listsecurityHaloRunV1alpha1PersonalAccessToken(
          requestParameters.fieldSelector,
          requestParameters.labelSelector,
          requestParameters.page,
          requestParameters.size,
          requestParameters.sort,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Update security.halo.run/v1alpha1/PersonalAccessToken
     * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    updatesecurityHaloRunV1alpha1PersonalAccessToken(
      requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessTokenRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<PersonalAccessToken> {
      return localVarFp
        .updatesecurityHaloRunV1alpha1PersonalAccessToken(
          requestParameters.name,
          requestParameters.personalAccessToken,
          options
        )
        .then((request) => request(axios, basePath));
    },
  };
};

/**
 * Request parameters for createsecurityHaloRunV1alpha1PersonalAccessToken operation in SecurityHaloRunV1alpha1PersonalAccessTokenApi.
 * @export
 * @interface SecurityHaloRunV1alpha1PersonalAccessTokenApiCreatesecurityHaloRunV1alpha1PersonalAccessTokenRequest
 */
export interface SecurityHaloRunV1alpha1PersonalAccessTokenApiCreatesecurityHaloRunV1alpha1PersonalAccessTokenRequest {
  /**
   * Fresh personalaccesstoken
   * @type {PersonalAccessToken}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApiCreatesecurityHaloRunV1alpha1PersonalAccessToken
   */
  readonly personalAccessToken?: PersonalAccessToken;
}

/**
 * Request parameters for deletesecurityHaloRunV1alpha1PersonalAccessToken operation in SecurityHaloRunV1alpha1PersonalAccessTokenApi.
 * @export
 * @interface SecurityHaloRunV1alpha1PersonalAccessTokenApiDeletesecurityHaloRunV1alpha1PersonalAccessTokenRequest
 */
export interface SecurityHaloRunV1alpha1PersonalAccessTokenApiDeletesecurityHaloRunV1alpha1PersonalAccessTokenRequest {
  /**
   * Name of personalaccesstoken
   * @type {string}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApiDeletesecurityHaloRunV1alpha1PersonalAccessToken
   */
  readonly name: string;
}

/**
 * Request parameters for getsecurityHaloRunV1alpha1PersonalAccessToken operation in SecurityHaloRunV1alpha1PersonalAccessTokenApi.
 * @export
 * @interface SecurityHaloRunV1alpha1PersonalAccessTokenApiGetsecurityHaloRunV1alpha1PersonalAccessTokenRequest
 */
export interface SecurityHaloRunV1alpha1PersonalAccessTokenApiGetsecurityHaloRunV1alpha1PersonalAccessTokenRequest {
  /**
   * Name of personalaccesstoken
   * @type {string}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApiGetsecurityHaloRunV1alpha1PersonalAccessToken
   */
  readonly name: string;
}

/**
 * Request parameters for listsecurityHaloRunV1alpha1PersonalAccessToken operation in SecurityHaloRunV1alpha1PersonalAccessTokenApi.
 * @export
 * @interface SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessTokenRequest
 */
export interface SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessTokenRequest {
  /**
   * Field selector for filtering.
   * @type {Array<string>}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessToken
   */
  readonly fieldSelector?: Array<string>;

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

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

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

  /**
   * Sort property and direction of the list result. Support sorting based on attribute name path.
   * @type {Array<string>}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessToken
   */
  readonly sort?: Array<string>;
}

/**
 * Request parameters for updatesecurityHaloRunV1alpha1PersonalAccessToken operation in SecurityHaloRunV1alpha1PersonalAccessTokenApi.
 * @export
 * @interface SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessTokenRequest
 */
export interface SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessTokenRequest {
  /**
   * Name of personalaccesstoken
   * @type {string}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessToken
   */
  readonly name: string;

  /**
   * Updated personalaccesstoken
   * @type {PersonalAccessToken}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessToken
   */
  readonly personalAccessToken?: PersonalAccessToken;
}

/**
 * SecurityHaloRunV1alpha1PersonalAccessTokenApi - object-oriented interface
 * @export
 * @class SecurityHaloRunV1alpha1PersonalAccessTokenApi
 * @extends {BaseAPI}
 */
export class SecurityHaloRunV1alpha1PersonalAccessTokenApi extends BaseAPI {
  /**
   * Create security.halo.run/v1alpha1/PersonalAccessToken
   * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiCreatesecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApi
   */
  public createsecurityHaloRunV1alpha1PersonalAccessToken(
    requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiCreatesecurityHaloRunV1alpha1PersonalAccessTokenRequest = {},
    options?: AxiosRequestConfig
  ) {
    return SecurityHaloRunV1alpha1PersonalAccessTokenApiFp(this.configuration)
      .createsecurityHaloRunV1alpha1PersonalAccessToken(
        requestParameters.personalAccessToken,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Delete security.halo.run/v1alpha1/PersonalAccessToken
   * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiDeletesecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApi
   */
  public deletesecurityHaloRunV1alpha1PersonalAccessToken(
    requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiDeletesecurityHaloRunV1alpha1PersonalAccessTokenRequest,
    options?: AxiosRequestConfig
  ) {
    return SecurityHaloRunV1alpha1PersonalAccessTokenApiFp(this.configuration)
      .deletesecurityHaloRunV1alpha1PersonalAccessToken(
        requestParameters.name,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Get security.halo.run/v1alpha1/PersonalAccessToken
   * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiGetsecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApi
   */
  public getsecurityHaloRunV1alpha1PersonalAccessToken(
    requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiGetsecurityHaloRunV1alpha1PersonalAccessTokenRequest,
    options?: AxiosRequestConfig
  ) {
    return SecurityHaloRunV1alpha1PersonalAccessTokenApiFp(this.configuration)
      .getsecurityHaloRunV1alpha1PersonalAccessToken(
        requestParameters.name,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * List security.halo.run/v1alpha1/PersonalAccessToken
   * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApi
   */
  public listsecurityHaloRunV1alpha1PersonalAccessToken(
    requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiListsecurityHaloRunV1alpha1PersonalAccessTokenRequest = {},
    options?: AxiosRequestConfig
  ) {
    return SecurityHaloRunV1alpha1PersonalAccessTokenApiFp(this.configuration)
      .listsecurityHaloRunV1alpha1PersonalAccessToken(
        requestParameters.fieldSelector,
        requestParameters.labelSelector,
        requestParameters.page,
        requestParameters.size,
        requestParameters.sort,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Update security.halo.run/v1alpha1/PersonalAccessToken
   * @param {SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessTokenRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof SecurityHaloRunV1alpha1PersonalAccessTokenApi
   */
  public updatesecurityHaloRunV1alpha1PersonalAccessToken(
    requestParameters: SecurityHaloRunV1alpha1PersonalAccessTokenApiUpdatesecurityHaloRunV1alpha1PersonalAccessTokenRequest,
    options?: AxiosRequestConfig
  ) {
    return SecurityHaloRunV1alpha1PersonalAccessTokenApiFp(this.configuration)
      .updatesecurityHaloRunV1alpha1PersonalAccessToken(
        requestParameters.name,
        requestParameters.personalAccessToken,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }
}
