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

import { dvRsAddDeviceToDVR } from "../funcs/dvRsAddDeviceToDVR.js";
import { dvRsAddLineup } from "../funcs/dvRsAddLineup.js";
import { dvRsCreateDVR } from "../funcs/dvRsCreateDVR.js";
import { dvRsDeleteDVR } from "../funcs/dvRsDeleteDVR.js";
import { dvRsDeleteLineup } from "../funcs/dvRsDeleteLineup.js";
import { dvRsGetDVR } from "../funcs/dvRsGetDVR.js";
import { dvRsListDVRs } from "../funcs/dvRsListDVRs.js";
import { dvRsReloadGuide } from "../funcs/dvRsReloadGuide.js";
import { dvRsRemoveDeviceFromDVR } from "../funcs/dvRsRemoveDeviceFromDVR.js";
import { dvRsSetDVRPreferences } from "../funcs/dvRsSetDVRPreferences.js";
import { dvRsStopDVRReload } from "../funcs/dvRsStopDVRReload.js";
import { dvRsTuneChannel } from "../funcs/dvRsTuneChannel.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class DVRs extends ClientSDK {
  /**
   * Get DVRs
   *
   * @remarks
   * Get the list of all available DVRs
   */
  async listDVRs(
    options?: RequestOptions,
  ): Promise<operations.ListDVRsResponse> {
    return unwrapAsync(dvRsListDVRs(
      this,
      options,
    ));
  }

  /**
   * Create a DVR
   *
   * @remarks
   * Creation of a DVR, after creation of a devcie and a lineup is selected
   */
  async createDVR(
    request: operations.CreateDVRRequest,
    options?: RequestOptions,
  ): Promise<operations.CreateDVRResponse> {
    return unwrapAsync(dvRsCreateDVR(
      this,
      request,
      options,
    ));
  }

  /**
   * Delete a single DVR
   *
   * @remarks
   * Delete a single DVR by its id (key)
   */
  async deleteDVR(
    request: operations.DeleteDVRRequest,
    options?: RequestOptions,
  ): Promise<operations.DeleteDVRResponse> {
    return unwrapAsync(dvRsDeleteDVR(
      this,
      request,
      options,
    ));
  }

  /**
   * Get a single DVR
   *
   * @remarks
   * Get a single DVR by its id (key)
   */
  async getDVR(
    request: operations.GetDVRRequest,
    options?: RequestOptions,
  ): Promise<operations.GetDVRResponse> {
    return unwrapAsync(dvRsGetDVR(
      this,
      request,
      options,
    ));
  }

  /**
   * Delete a DVR Lineup
   *
   * @remarks
   * Deletes a DVR device's lineup.
   */
  async deleteLineup(
    request: operations.DeleteLineupRequest,
    options?: RequestOptions,
  ): Promise<operations.DeleteLineupResponse> {
    return unwrapAsync(dvRsDeleteLineup(
      this,
      request,
      options,
    ));
  }

  /**
   * Add a DVR Lineup
   *
   * @remarks
   * Add a lineup to a DVR device's set of lineups.
   */
  async addLineup(
    request: operations.AddLineupRequest,
    options?: RequestOptions,
  ): Promise<operations.AddLineupResponse> {
    return unwrapAsync(dvRsAddLineup(
      this,
      request,
      options,
    ));
  }

  /**
   * Set DVR preferences
   *
   * @remarks
   * Set DVR preferences by name avd value
   */
  async setDVRPreferences(
    request: operations.SetDVRPreferencesRequest,
    options?: RequestOptions,
  ): Promise<operations.SetDVRPreferencesResponse> {
    return unwrapAsync(dvRsSetDVRPreferences(
      this,
      request,
      options,
    ));
  }

  /**
   * Tell a DVR to stop reloading program guide
   *
   * @remarks
   * Tell a DVR to stop reloading program guide
   */
  async stopDVRReload(
    request: operations.StopDVRReloadRequest,
    options?: RequestOptions,
  ): Promise<operations.StopDVRReloadResponse> {
    return unwrapAsync(dvRsStopDVRReload(
      this,
      request,
      options,
    ));
  }

  /**
   * Tell a DVR to reload program guide
   *
   * @remarks
   * Tell a DVR to reload program guide
   */
  async reloadGuide(
    request: operations.ReloadGuideRequest,
    options?: RequestOptions,
  ): Promise<operations.ReloadGuideResponse> {
    return unwrapAsync(dvRsReloadGuide(
      this,
      request,
      options,
    ));
  }

  /**
   * Tune a channel on a DVR
   *
   * @remarks
   * Tune a channel on a DVR to the provided channel
   */
  async tuneChannel(
    request: operations.TuneChannelRequest,
    options?: RequestOptions,
  ): Promise<operations.TuneChannelResponse> {
    return unwrapAsync(dvRsTuneChannel(
      this,
      request,
      options,
    ));
  }

  /**
   * Remove a device from an existing DVR
   *
   * @remarks
   * Remove a device from an existing DVR
   */
  async removeDeviceFromDVR(
    request: operations.RemoveDeviceFromDVRRequest,
    options?: RequestOptions,
  ): Promise<operations.RemoveDeviceFromDVRResponse> {
    return unwrapAsync(dvRsRemoveDeviceFromDVR(
      this,
      request,
      options,
    ));
  }

  /**
   * Add a device to an existing DVR
   *
   * @remarks
   * Add a device to an existing DVR
   */
  async addDeviceToDVR(
    request: operations.AddDeviceToDVRRequest,
    options?: RequestOptions,
  ): Promise<operations.AddDeviceToDVRResponse> {
    return unwrapAsync(dvRsAddDeviceToDVR(
      this,
      request,
      options,
    ));
  }
}
