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

import { contentGetAlbums } from "../funcs/contentGetAlbums.js";
import { contentGetAllLeaves } from "../funcs/contentGetAllLeaves.js";
import { contentGetArts } from "../funcs/contentGetArts.js";
import { contentGetCategories } from "../funcs/contentGetCategories.js";
import { contentGetCluster } from "../funcs/contentGetCluster.js";
import { contentGetCollectionImage } from "../funcs/contentGetCollectionImage.js";
import { contentGetCollectionItems } from "../funcs/contentGetCollectionItems.js";
import { contentGetFolders } from "../funcs/contentGetFolders.js";
import { contentGetMetadataItem } from "../funcs/contentGetMetadataItem.js";
import { contentGetSonicallySimilar } from "../funcs/contentGetSonicallySimilar.js";
import { contentGetSonicPath } from "../funcs/contentGetSonicPath.js";
import { contentListContent } from "../funcs/contentListContent.js";
import { contentListMoments } from "../funcs/contentListMoments.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class Content extends ClientSDK {
  /**
   * Get items in a collection
   *
   * @remarks
   * Get items in a collection.  Note if this collection contains more than 100 items, paging must be used.
   */
  async getCollectionItems(
    request: operations.GetCollectionItemsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetCollectionItemsResponse> {
    return unwrapAsync(contentGetCollectionItems(
      this,
      request,
      options,
    ));
  }

  /**
   * Get a metadata item
   *
   * @remarks
   * Get one or more metadata items.
   */
  async getMetadataItem(
    request: operations.GetMetadataItemRequest,
    options?: RequestOptions,
  ): Promise<operations.GetMetadataItemResponse> {
    return unwrapAsync(contentGetMetadataItem(
      this,
      request,
      options,
    ));
  }

  /**
   * Set section albums
   *
   * @remarks
   * Get all albums in a music section
   */
  async getAlbums(
    request: operations.GetAlbumsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetAlbumsResponse> {
    return unwrapAsync(contentGetAlbums(
      this,
      request,
      options,
    ));
  }

  /**
   * Get items in the section
   *
   * @remarks
   * Get the items in a section, potentially filtering them
   */
  async listContent(
    request: operations.ListContentRequest,
    options?: RequestOptions,
  ): Promise<operations.ListContentResponse> {
    return unwrapAsync(contentListContent(
      this,
      request,
      options,
    ));
  }

  /**
   * Set section leaves
   *
   * @remarks
   * Get all leaves in a section (such as episodes in a show section)
   */
  async getAllLeaves(
    request: operations.GetAllLeavesRequest,
    options?: RequestOptions,
  ): Promise<operations.GetAllLeavesResponse> {
    return unwrapAsync(contentGetAllLeaves(
      this,
      request,
      options,
    ));
  }

  /**
   * Set section artwork
   *
   * @remarks
   * Get artwork for a library section
   */
  async getArts(
    request: operations.GetArtsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetArtsResponse> {
    return unwrapAsync(contentGetArts(
      this,
      request,
      options,
    ));
  }

  /**
   * Set section categories
   *
   * @remarks
   * Get categories in a library section
   */
  async getCategories(
    request: operations.GetCategoriesRequest,
    options?: RequestOptions,
  ): Promise<operations.GetCategoriesResponse> {
    return unwrapAsync(contentGetCategories(
      this,
      request,
      options,
    ));
  }

  /**
   * Set section clusters
   *
   * @remarks
   * Get clusters in a library section (typically for photos)
   */
  async getCluster(
    request: operations.GetClusterRequest,
    options?: RequestOptions,
  ): Promise<operations.GetClusterResponse> {
    return unwrapAsync(contentGetCluster(
      this,
      request,
      options,
    ));
  }

  /**
   * Similar tracks to transition from one to another
   *
   * @remarks
   * Get a list of audio tracks starting at one and ending at another which are similar across the path
   */
  async getSonicPath(
    request: operations.GetSonicPathRequest,
    options?: RequestOptions,
  ): Promise<operations.GetSonicPathResponse> {
    return unwrapAsync(contentGetSonicPath(
      this,
      request,
      options,
    ));
  }

  /**
   * Get all folder locations
   *
   * @remarks
   * Get all folder locations of the media in a section
   */
  async getFolders(
    request: operations.GetFoldersRequest,
    options?: RequestOptions,
  ): Promise<operations.GetFoldersResponse> {
    return unwrapAsync(contentGetFolders(
      this,
      request,
      options,
    ));
  }

  /**
   * Set section moments
   *
   * @remarks
   * Get moments in a library section (typically for photos)
   */
  async listMoments(
    request: operations.ListMomentsRequest,
    options?: RequestOptions,
  ): Promise<operations.ListMomentsResponse> {
    return unwrapAsync(contentListMoments(
      this,
      request,
      options,
    ));
  }

  /**
   * The nearest audio tracks
   *
   * @remarks
   * Get the nearest audio tracks to a particular analysis
   */
  async getSonicallySimilar(
    request: operations.GetSonicallySimilarRequest,
    options?: RequestOptions,
  ): Promise<operations.GetSonicallySimilarResponse> {
    return unwrapAsync(contentGetSonicallySimilar(
      this,
      request,
      options,
    ));
  }

  /**
   * Get a collection's image
   *
   * @remarks
   * Get an image for the collection based on the items within
   */
  async getCollectionImage(
    request: operations.GetCollectionImageRequest,
    options?: RequestOptions,
  ): Promise<operations.GetCollectionImageResponse> {
    return unwrapAsync(contentGetCollectionImage(
      this,
      request,
      options,
    ));
  }
}
