/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */

import { hubsGetGlobalHubs } from "../funcs/hubsGetGlobalHubs.js";
import { hubsGetLibraryHubs } from "../funcs/hubsGetLibraryHubs.js";
import { hubsGetRecentlyAdded } from "../funcs/hubsGetRecentlyAdded.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class Hubs extends ClientSDK {
  /**
   * Get Global Hubs
   *
   * @remarks
   * Get Global Hubs filtered by the parameters provided.
   */
  async getGlobalHubs(
    count?: number | undefined,
    onlyTransient?: operations.OnlyTransient | undefined,
    options?: RequestOptions,
  ): Promise<operations.GetGlobalHubsResponse> {
    return unwrapAsync(hubsGetGlobalHubs(
      this,
      count,
      onlyTransient,
      options,
    ));
  }

  /**
   * Get Recently Added
   *
   * @remarks
   * This endpoint will return the recently added content.
   */
  async getRecentlyAdded(
    request: operations.GetRecentlyAddedRequest,
    options?: RequestOptions,
  ): Promise<operations.GetRecentlyAddedResponse> {
    return unwrapAsync(hubsGetRecentlyAdded(
      this,
      request,
      options,
    ));
  }

  /**
   * Get library specific hubs
   *
   * @remarks
   * This endpoint will return a list of library specific hubs
   */
  async getLibraryHubs(
    sectionId: number,
    count?: number | undefined,
    onlyTransient?: operations.QueryParamOnlyTransient | undefined,
    options?: RequestOptions,
  ): Promise<operations.GetLibraryHubsResponse> {
    return unwrapAsync(hubsGetLibraryHubs(
      this,
      sectionId,
      count,
      onlyTransient,
      options,
    ));
  }
}
