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

import { libraryCollectionsAddCollectionItems } from "../funcs/libraryCollectionsAddCollectionItems.js";
import { libraryCollectionsDeleteCollectionItem } from "../funcs/libraryCollectionsDeleteCollectionItem.js";
import { libraryCollectionsMoveCollectionItem } from "../funcs/libraryCollectionsMoveCollectionItem.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class LibraryCollections extends ClientSDK {
  /**
   * Add items to a collection
   *
   * @remarks
   * Add items to a collection by uri
   */
  async addCollectionItems(
    request: operations.AddCollectionItemsRequest,
    options?: RequestOptions,
  ): Promise<operations.AddCollectionItemsResponse> {
    return unwrapAsync(libraryCollectionsAddCollectionItems(
      this,
      request,
      options,
    ));
  }

  /**
   * Delete an item from a collection
   *
   * @remarks
   * Delete an item from a collection
   */
  async deleteCollectionItem(
    request: operations.DeleteCollectionItemRequest,
    options?: RequestOptions,
  ): Promise<operations.DeleteCollectionItemResponse> {
    return unwrapAsync(libraryCollectionsDeleteCollectionItem(
      this,
      request,
      options,
    ));
  }

  /**
   * Reorder an item in the collection
   *
   * @remarks
   * Reorder items in a collection with one item after another
   */
  async moveCollectionItem(
    request: operations.MoveCollectionItemRequest,
    options?: RequestOptions,
  ): Promise<operations.MoveCollectionItemResponse> {
    return unwrapAsync(libraryCollectionsMoveCollectionItem(
      this,
      request,
      options,
    ));
  }
}
