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

import { liveTVGetLiveTVSession } from "../funcs/liveTVGetLiveTVSession.js";
import { liveTVGetSessionPlaylistIndex } from "../funcs/liveTVGetSessionPlaylistIndex.js";
import { liveTVGetSessions } from "../funcs/liveTVGetSessions.js";
import { liveTVGetSessionSegment } from "../funcs/liveTVGetSessionSegment.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class LiveTV extends ClientSDK {
  /**
   * Get all sessions
   *
   * @remarks
   * Get all livetv sessions and metadata
   */
  async getSessions(
    options?: RequestOptions,
  ): Promise<operations.GetSessionsResponse> {
    return unwrapAsync(liveTVGetSessions(
      this,
      options,
    ));
  }

  /**
   * Get a single session
   *
   * @remarks
   * Get a single livetv session and metadata
   */
  async getLiveTVSession(
    request: operations.GetLiveTVSessionRequest,
    options?: RequestOptions,
  ): Promise<operations.GetLiveTVSessionResponse> {
    return unwrapAsync(liveTVGetLiveTVSession(
      this,
      request,
      options,
    ));
  }

  /**
   * Get a session playlist index
   *
   * @remarks
   * Get a playlist index for playing this session
   */
  async getSessionPlaylistIndex(
    request: operations.GetSessionPlaylistIndexRequest,
    options?: RequestOptions,
  ): Promise<operations.GetSessionPlaylistIndexResponse> {
    return unwrapAsync(liveTVGetSessionPlaylistIndex(
      this,
      request,
      options,
    ));
  }

  /**
   * Get a single session segment
   *
   * @remarks
   * Get a single LiveTV session segment
   */
  async getSessionSegment(
    request: operations.GetSessionSegmentRequest,
    options?: RequestOptions,
  ): Promise<operations.GetSessionSegmentResponse> {
    return unwrapAsync(liveTVGetSessionSegment(
      this,
      request,
      options,
    ));
  }
}
