/* 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 { Content } from "../models";
// @ts-ignore
import { ContentWrapper } from "../models";
// @ts-ignore
import { ListedSinglePageList } from "../models";
// @ts-ignore
import { Post } from "../models";
// @ts-ignore
import { SinglePage } from "../models";
// @ts-ignore
import { SinglePageRequest } from "../models";
/**
 * ApiConsoleHaloRunV1alpha1SinglePageApi - axios parameter creator
 * @export
 */
export const ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator =
  function (configuration?: Configuration) {
    return {
      /**
       * Draft a single page.
       * @param {SinglePageRequest} singlePageRequest
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      draftSinglePage: async (
        singlePageRequest: SinglePageRequest,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'singlePageRequest' is not null or undefined
        assertParamExists(
          "draftSinglePage",
          "singlePageRequest",
          singlePageRequest
        );
        const localVarPath = `/apis/api.console.halo.run/v1alpha1/singlepages`;
        // 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(
          singlePageRequest,
          localVarRequestOptions,
          configuration
        );

        return {
          url: toPathString(localVarUrlObj),
          options: localVarRequestOptions,
        };
      },
      /**
       * Fetch head content of single page.
       * @param {string} name
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      fetchSinglePageHeadContent: async (
        name: string,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists("fetchSinglePageHeadContent", "name", name);
        const localVarPath =
          `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/head-content`.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 release content of single page.
       * @param {string} name
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      fetchSinglePageReleaseContent: async (
        name: string,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists("fetchSinglePageReleaseContent", "name", name);
        const localVarPath =
          `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/release-content`.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 single pages.
       * @param {Array<string>} [contributor]
       * @param {Array<string>} [fieldSelector] Field selector for filtering.
       * @param {string} [keyword] SinglePages filtered by keyword.
       * @param {Array<string>} [labelSelector] Label selector for filtering.
       * @param {number} [page] The page number. Zero indicates no page.
       * @param {'DRAFT' | 'PENDING_APPROVAL' | 'PUBLISHED' | 'FAILED'} [publishPhase]
       * @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,publishTime
       * @param {'PUBLIC' | 'INTERNAL' | 'PRIVATE'} [visible]
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      listSinglePages: async (
        contributor?: Array<string>,
        fieldSelector?: Array<string>,
        keyword?: string,
        labelSelector?: Array<string>,
        page?: number,
        publishPhase?: "DRAFT" | "PENDING_APPROVAL" | "PUBLISHED" | "FAILED",
        size?: number,
        sort?: Array<string>,
        visible?: "PUBLIC" | "INTERNAL" | "PRIVATE",
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        const localVarPath = `/apis/api.console.halo.run/v1alpha1/singlepages`;
        // 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 (contributor) {
          localVarQueryParameter["contributor"] = Array.from(contributor);
        }

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

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

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

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

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

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

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

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

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

        return {
          url: toPathString(localVarUrlObj),
          options: localVarRequestOptions,
        };
      },
      /**
       * Publish a single page.
       * @param {string} name
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      publishSinglePage: async (
        name: string,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists("publishSinglePage", "name", name);
        const localVarPath =
          `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/publish`.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 a single page.
       * @param {string} name
       * @param {SinglePageRequest} singlePageRequest
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      updateDraftSinglePage: async (
        name: string,
        singlePageRequest: SinglePageRequest,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists("updateDraftSinglePage", "name", name);
        // verify required parameter 'singlePageRequest' is not null or undefined
        assertParamExists(
          "updateDraftSinglePage",
          "singlePageRequest",
          singlePageRequest
        );
        const localVarPath =
          `/apis/api.console.halo.run/v1alpha1/singlepages/{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(
          singlePageRequest,
          localVarRequestOptions,
          configuration
        );

        return {
          url: toPathString(localVarUrlObj),
          options: localVarRequestOptions,
        };
      },
      /**
       * Update a single page\'s content.
       * @param {string} name
       * @param {Content} content
       * @param {*} [options] Override http request option.
       * @throws {RequiredError}
       */
      updateSinglePageContent: async (
        name: string,
        content: Content,
        options: AxiosRequestConfig = {}
      ): Promise<RequestArgs> => {
        // verify required parameter 'name' is not null or undefined
        assertParamExists("updateSinglePageContent", "name", name);
        // verify required parameter 'content' is not null or undefined
        assertParamExists("updateSinglePageContent", "content", content);
        const localVarPath =
          `/apis/api.console.halo.run/v1alpha1/singlepages/{name}/content`.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(
          content,
          localVarRequestOptions,
          configuration
        );

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

/**
 * ApiConsoleHaloRunV1alpha1SinglePageApi - functional programming interface
 * @export
 */
export const ApiConsoleHaloRunV1alpha1SinglePageApiFp = function (
  configuration?: Configuration
) {
  const localVarAxiosParamCreator =
    ApiConsoleHaloRunV1alpha1SinglePageApiAxiosParamCreator(configuration);
  return {
    /**
     * Draft a single page.
     * @param {SinglePageRequest} singlePageRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async draftSinglePage(
      singlePageRequest: SinglePageRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<SinglePage>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.draftSinglePage(
        singlePageRequest,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Fetch head content of single page.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async fetchSinglePageHeadContent(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ContentWrapper>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.fetchSinglePageHeadContent(
          name,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Fetch release content of single page.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async fetchSinglePageReleaseContent(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<ContentWrapper>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.fetchSinglePageReleaseContent(
          name,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * List single pages.
     * @param {Array<string>} [contributor]
     * @param {Array<string>} [fieldSelector] Field selector for filtering.
     * @param {string} [keyword] SinglePages filtered by keyword.
     * @param {Array<string>} [labelSelector] Label selector for filtering.
     * @param {number} [page] The page number. Zero indicates no page.
     * @param {'DRAFT' | 'PENDING_APPROVAL' | 'PUBLISHED' | 'FAILED'} [publishPhase]
     * @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,publishTime
     * @param {'PUBLIC' | 'INTERNAL' | 'PRIVATE'} [visible]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async listSinglePages(
      contributor?: Array<string>,
      fieldSelector?: Array<string>,
      keyword?: string,
      labelSelector?: Array<string>,
      page?: number,
      publishPhase?: "DRAFT" | "PENDING_APPROVAL" | "PUBLISHED" | "FAILED",
      size?: number,
      sort?: Array<string>,
      visible?: "PUBLIC" | "INTERNAL" | "PRIVATE",
      options?: AxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<ListedSinglePageList>
    > {
      const localVarAxiosArgs = await localVarAxiosParamCreator.listSinglePages(
        contributor,
        fieldSelector,
        keyword,
        labelSelector,
        page,
        publishPhase,
        size,
        sort,
        visible,
        options
      );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Publish a single page.
     * @param {string} name
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async publishSinglePage(
      name: string,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<SinglePage>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.publishSinglePage(name, options);
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Update a single page.
     * @param {string} name
     * @param {SinglePageRequest} singlePageRequest
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async updateDraftSinglePage(
      name: string,
      singlePageRequest: SinglePageRequest,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<SinglePage>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.updateDraftSinglePage(
          name,
          singlePageRequest,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
    /**
     * Update a single page\'s content.
     * @param {string} name
     * @param {Content} content
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async updateSinglePageContent(
      name: string,
      content: Content,
      options?: AxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<Post>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.updateSinglePageContent(
          name,
          content,
          options
        );
      return createRequestFunction(
        localVarAxiosArgs,
        globalAxios,
        BASE_PATH,
        configuration
      );
    },
  };
};

/**
 * ApiConsoleHaloRunV1alpha1SinglePageApi - factory interface
 * @export
 */
export const ApiConsoleHaloRunV1alpha1SinglePageApiFactory = function (
  configuration?: Configuration,
  basePath?: string,
  axios?: AxiosInstance
) {
  const localVarFp = ApiConsoleHaloRunV1alpha1SinglePageApiFp(configuration);
  return {
    /**
     * Draft a single page.
     * @param {ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    draftSinglePage(
      requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<SinglePage> {
      return localVarFp
        .draftSinglePage(requestParameters.singlePageRequest, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Fetch head content of single page.
     * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchSinglePageHeadContent(
      requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<ContentWrapper> {
      return localVarFp
        .fetchSinglePageHeadContent(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Fetch release content of single page.
     * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    fetchSinglePageReleaseContent(
      requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContentRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<ContentWrapper> {
      return localVarFp
        .fetchSinglePageReleaseContent(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * List single pages.
     * @param {ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    listSinglePages(
      requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest = {},
      options?: AxiosRequestConfig
    ): AxiosPromise<ListedSinglePageList> {
      return localVarFp
        .listSinglePages(
          requestParameters.contributor,
          requestParameters.fieldSelector,
          requestParameters.keyword,
          requestParameters.labelSelector,
          requestParameters.page,
          requestParameters.publishPhase,
          requestParameters.size,
          requestParameters.sort,
          requestParameters.visible,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Publish a single page.
     * @param {ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    publishSinglePage(
      requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<SinglePage> {
      return localVarFp
        .publishSinglePage(requestParameters.name, options)
        .then((request) => request(axios, basePath));
    },
    /**
     * Update a single page.
     * @param {ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    updateDraftSinglePage(
      requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<SinglePage> {
      return localVarFp
        .updateDraftSinglePage(
          requestParameters.name,
          requestParameters.singlePageRequest,
          options
        )
        .then((request) => request(axios, basePath));
    },
    /**
     * Update a single page\'s content.
     * @param {ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContentRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    updateSinglePageContent(
      requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContentRequest,
      options?: AxiosRequestConfig
    ): AxiosPromise<Post> {
      return localVarFp
        .updateSinglePageContent(
          requestParameters.name,
          requestParameters.content,
          options
        )
        .then((request) => request(axios, basePath));
    },
  };
};

/**
 * Request parameters for draftSinglePage operation in ApiConsoleHaloRunV1alpha1SinglePageApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest
 */
export interface ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest {
  /**
   *
   * @type {SinglePageRequest}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePage
   */
  readonly singlePageRequest: SinglePageRequest;
}

/**
 * Request parameters for fetchSinglePageHeadContent operation in ApiConsoleHaloRunV1alpha1SinglePageApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest
 */
export interface ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContent
   */
  readonly name: string;
}

/**
 * Request parameters for fetchSinglePageReleaseContent operation in ApiConsoleHaloRunV1alpha1SinglePageApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContentRequest
 */
export interface ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContentRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContent
   */
  readonly name: string;
}

/**
 * Request parameters for listSinglePages operation in ApiConsoleHaloRunV1alpha1SinglePageApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest
 */
export interface ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest {
  /**
   *
   * @type {Array<string>}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePages
   */
  readonly contributor?: Array<string>;

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

  /**
   * SinglePages filtered by keyword.
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePages
   */
  readonly keyword?: string;

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

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

  /**
   *
   * @type {'DRAFT' | 'PENDING_APPROVAL' | 'PUBLISHED' | 'FAILED'}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePages
   */
  readonly publishPhase?: "DRAFT" | "PENDING_APPROVAL" | "PUBLISHED" | "FAILED";

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

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

  /**
   *
   * @type {'PUBLIC' | 'INTERNAL' | 'PRIVATE'}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePages
   */
  readonly visible?: "PUBLIC" | "INTERNAL" | "PRIVATE";
}

/**
 * Request parameters for publishSinglePage operation in ApiConsoleHaloRunV1alpha1SinglePageApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest
 */
export interface ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePage
   */
  readonly name: string;
}

/**
 * Request parameters for updateDraftSinglePage operation in ApiConsoleHaloRunV1alpha1SinglePageApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest
 */
export interface ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePage
   */
  readonly name: string;

  /**
   *
   * @type {SinglePageRequest}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePage
   */
  readonly singlePageRequest: SinglePageRequest;
}

/**
 * Request parameters for updateSinglePageContent operation in ApiConsoleHaloRunV1alpha1SinglePageApi.
 * @export
 * @interface ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContentRequest
 */
export interface ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContentRequest {
  /**
   *
   * @type {string}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContent
   */
  readonly name: string;

  /**
   *
   * @type {Content}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContent
   */
  readonly content: Content;
}

/**
 * ApiConsoleHaloRunV1alpha1SinglePageApi - object-oriented interface
 * @export
 * @class ApiConsoleHaloRunV1alpha1SinglePageApi
 * @extends {BaseAPI}
 */
export class ApiConsoleHaloRunV1alpha1SinglePageApi extends BaseAPI {
  /**
   * Draft a single page.
   * @param {ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi
   */
  public draftSinglePage(
    requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiDraftSinglePageRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration)
      .draftSinglePage(requestParameters.singlePageRequest, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Fetch head content of single page.
   * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi
   */
  public fetchSinglePageHeadContent(
    requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageHeadContentRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration)
      .fetchSinglePageHeadContent(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Fetch release content of single page.
   * @param {ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContentRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi
   */
  public fetchSinglePageReleaseContent(
    requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiFetchSinglePageReleaseContentRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration)
      .fetchSinglePageReleaseContent(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * List single pages.
   * @param {ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi
   */
  public listSinglePages(
    requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiListSinglePagesRequest = {},
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration)
      .listSinglePages(
        requestParameters.contributor,
        requestParameters.fieldSelector,
        requestParameters.keyword,
        requestParameters.labelSelector,
        requestParameters.page,
        requestParameters.publishPhase,
        requestParameters.size,
        requestParameters.sort,
        requestParameters.visible,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Publish a single page.
   * @param {ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi
   */
  public publishSinglePage(
    requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiPublishSinglePageRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration)
      .publishSinglePage(requestParameters.name, options)
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Update a single page.
   * @param {ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi
   */
  public updateDraftSinglePage(
    requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiUpdateDraftSinglePageRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration)
      .updateDraftSinglePage(
        requestParameters.name,
        requestParameters.singlePageRequest,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }

  /**
   * Update a single page\'s content.
   * @param {ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContentRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   * @memberof ApiConsoleHaloRunV1alpha1SinglePageApi
   */
  public updateSinglePageContent(
    requestParameters: ApiConsoleHaloRunV1alpha1SinglePageApiUpdateSinglePageContentRequest,
    options?: AxiosRequestConfig
  ) {
    return ApiConsoleHaloRunV1alpha1SinglePageApiFp(this.configuration)
      .updateSinglePageContent(
        requestParameters.name,
        requestParameters.content,
        options
      )
      .then((request) => request(this.axios, this.basePath));
  }
}
