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

import { epgComputeChannelMap } from "../funcs/epgComputeChannelMap.js";
import { epgGetAllLanguages } from "../funcs/epgGetAllLanguages.js";
import { epgGetChannels } from "../funcs/epgGetChannels.js";
import { epgGetCountries } from "../funcs/epgGetCountries.js";
import { epgGetCountriesLineups } from "../funcs/epgGetCountriesLineups.js";
import { epgGetCountryRegions } from "../funcs/epgGetCountryRegions.js";
import { epgGetLineup } from "../funcs/epgGetLineup.js";
import { epgGetLineupChannels } from "../funcs/epgGetLineupChannels.js";
import { epgListLineups } from "../funcs/epgListLineups.js";
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
import * as operations from "./models/operations/index.js";
import { unwrapAsync } from "./types/fp.js";

export class Epg extends ClientSDK {
  /**
   * Compute the best channel map
   *
   * @remarks
   * Compute the best channel map, given device and lineup
   */
  async computeChannelMap(
    request: operations.ComputeChannelMapRequest,
    options?: RequestOptions,
  ): Promise<operations.ComputeChannelMapResponse> {
    return unwrapAsync(epgComputeChannelMap(
      this,
      request,
      options,
    ));
  }

  /**
   * Get channels for a lineup
   *
   * @remarks
   * Get channels for a lineup within an EPG provider
   */
  async getChannels(
    request: operations.GetChannelsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetChannelsResponse> {
    return unwrapAsync(epgGetChannels(
      this,
      request,
      options,
    ));
  }

  /**
   * Get all countries
   *
   * @remarks
   * This endpoint returns a list of countries which EPG data is available for. There are three flavors, as specfied by the `flavor` attribute
   */
  async getCountries(
    options?: RequestOptions,
  ): Promise<operations.GetCountriesResponse> {
    return unwrapAsync(epgGetCountries(
      this,
      options,
    ));
  }

  /**
   * Get all languages
   *
   * @remarks
   * Returns a list of all possible languages for EPG data.
   */
  async getAllLanguages(
    options?: RequestOptions,
  ): Promise<operations.GetAllLanguagesResponse> {
    return unwrapAsync(epgGetAllLanguages(
      this,
      options,
    ));
  }

  /**
   * Compute the best lineup
   *
   * @remarks
   * Compute the best lineup, given lineup group and device
   */
  async getLineup(
    request: operations.GetLineupRequest,
    options?: RequestOptions,
  ): Promise<operations.GetLineupResponse> {
    return unwrapAsync(epgGetLineup(
      this,
      request,
      options,
    ));
  }

  /**
   * Get the channels for mulitple lineups
   *
   * @remarks
   * Get the channels across multiple lineups
   */
  async getLineupChannels(
    request: operations.GetLineupChannelsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetLineupChannelsResponse> {
    return unwrapAsync(epgGetLineupChannels(
      this,
      request,
      options,
    ));
  }

  /**
   * Get lineups for a country via postal code
   *
   * @remarks
   * Returns a list of lineups for a given country, EPG provider and postal code
   */
  async getCountriesLineups(
    request: operations.GetCountriesLineupsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetCountriesLineupsResponse> {
    return unwrapAsync(epgGetCountriesLineups(
      this,
      request,
      options,
    ));
  }

  /**
   * Get regions for a country
   *
   * @remarks
   * Get regions for a country within an EPG provider
   */
  async getCountryRegions(
    request: operations.GetCountryRegionsRequest,
    options?: RequestOptions,
  ): Promise<operations.GetCountryRegionsResponse> {
    return unwrapAsync(epgGetCountryRegions(
      this,
      request,
      options,
    ));
  }

  /**
   * Get lineups for a region
   *
   * @remarks
   * Get lineups for a region within an EPG provider
   */
  async listLineups(
    request: operations.ListLineupsRequest,
    options?: RequestOptions,
  ): Promise<operations.ListLineupsResponse> {
    return unwrapAsync(epgListLineups(
      this,
      request,
      options,
    ));
  }
}
