{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaLive.ListOfferings
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- List offerings available for purchase.
--
-- This operation returns paginated results.
module Amazonka.MediaLive.ListOfferings
  ( -- * Creating a Request
    ListOfferings (..),
    newListOfferings,

    -- * Request Lenses
    listOfferings_videoQuality,
    listOfferings_maximumFramerate,
    listOfferings_resourceType,
    listOfferings_channelConfiguration,
    listOfferings_resolution,
    listOfferings_codec,
    listOfferings_nextToken,
    listOfferings_specialFeature,
    listOfferings_channelClass,
    listOfferings_maximumBitrate,
    listOfferings_duration,
    listOfferings_maxResults,

    -- * Destructuring the Response
    ListOfferingsResponse (..),
    newListOfferingsResponse,

    -- * Response Lenses
    listOfferingsResponse_nextToken,
    listOfferingsResponse_offerings,
    listOfferingsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Placeholder documentation for ListOfferingsRequest
--
-- /See:/ 'newListOfferings' smart constructor.
data ListOfferings = ListOfferings'
  { -- | Filter by video quality, \'STANDARD\', \'ENHANCED\', or \'PREMIUM\'
    ListOfferings -> Maybe Text
videoQuality :: Prelude.Maybe Prelude.Text,
    -- | Filter by framerate, \'MAX_30_FPS\' or \'MAX_60_FPS\'
    ListOfferings -> Maybe Text
maximumFramerate :: Prelude.Maybe Prelude.Text,
    -- | Filter by resource type, \'INPUT\', \'OUTPUT\', \'MULTIPLEX\', or
    -- \'CHANNEL\'
    ListOfferings -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text,
    -- | Filter to offerings that match the configuration of an existing channel,
    -- e.g. \'2345678\' (a channel ID)
    ListOfferings -> Maybe Text
channelConfiguration :: Prelude.Maybe Prelude.Text,
    -- | Filter by resolution, \'SD\', \'HD\', \'FHD\', or \'UHD\'
    ListOfferings -> Maybe Text
resolution :: Prelude.Maybe Prelude.Text,
    -- | Filter by codec, \'AVC\', \'HEVC\', \'MPEG2\', \'AUDIO\', or \'LINK\'
    ListOfferings -> Maybe Text
codec :: Prelude.Maybe Prelude.Text,
    ListOfferings -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filter by special feature, \'ADVANCED_AUDIO\' or \'AUDIO_NORMALIZATION\'
    ListOfferings -> Maybe Text
specialFeature :: Prelude.Maybe Prelude.Text,
    -- | Filter by channel class, \'STANDARD\' or \'SINGLE_PIPELINE\'
    ListOfferings -> Maybe Text
channelClass :: Prelude.Maybe Prelude.Text,
    -- | Filter by bitrate, \'MAX_10_MBPS\', \'MAX_20_MBPS\', or \'MAX_50_MBPS\'
    ListOfferings -> Maybe Text
maximumBitrate :: Prelude.Maybe Prelude.Text,
    -- | Filter by offering duration, e.g. \'12\'
    ListOfferings -> Maybe Text
duration :: Prelude.Maybe Prelude.Text,
    ListOfferings -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListOfferings -> ListOfferings -> Bool
(ListOfferings -> ListOfferings -> Bool)
-> (ListOfferings -> ListOfferings -> Bool) -> Eq ListOfferings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOfferings -> ListOfferings -> Bool
$c/= :: ListOfferings -> ListOfferings -> Bool
== :: ListOfferings -> ListOfferings -> Bool
$c== :: ListOfferings -> ListOfferings -> Bool
Prelude.Eq, ReadPrec [ListOfferings]
ReadPrec ListOfferings
Int -> ReadS ListOfferings
ReadS [ListOfferings]
(Int -> ReadS ListOfferings)
-> ReadS [ListOfferings]
-> ReadPrec ListOfferings
-> ReadPrec [ListOfferings]
-> Read ListOfferings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOfferings]
$creadListPrec :: ReadPrec [ListOfferings]
readPrec :: ReadPrec ListOfferings
$creadPrec :: ReadPrec ListOfferings
readList :: ReadS [ListOfferings]
$creadList :: ReadS [ListOfferings]
readsPrec :: Int -> ReadS ListOfferings
$creadsPrec :: Int -> ReadS ListOfferings
Prelude.Read, Int -> ListOfferings -> ShowS
[ListOfferings] -> ShowS
ListOfferings -> String
(Int -> ListOfferings -> ShowS)
-> (ListOfferings -> String)
-> ([ListOfferings] -> ShowS)
-> Show ListOfferings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOfferings] -> ShowS
$cshowList :: [ListOfferings] -> ShowS
show :: ListOfferings -> String
$cshow :: ListOfferings -> String
showsPrec :: Int -> ListOfferings -> ShowS
$cshowsPrec :: Int -> ListOfferings -> ShowS
Prelude.Show, (forall x. ListOfferings -> Rep ListOfferings x)
-> (forall x. Rep ListOfferings x -> ListOfferings)
-> Generic ListOfferings
forall x. Rep ListOfferings x -> ListOfferings
forall x. ListOfferings -> Rep ListOfferings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListOfferings x -> ListOfferings
$cfrom :: forall x. ListOfferings -> Rep ListOfferings x
Prelude.Generic)

-- |
-- Create a value of 'ListOfferings' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'videoQuality', 'listOfferings_videoQuality' - Filter by video quality, \'STANDARD\', \'ENHANCED\', or \'PREMIUM\'
--
-- 'maximumFramerate', 'listOfferings_maximumFramerate' - Filter by framerate, \'MAX_30_FPS\' or \'MAX_60_FPS\'
--
-- 'resourceType', 'listOfferings_resourceType' - Filter by resource type, \'INPUT\', \'OUTPUT\', \'MULTIPLEX\', or
-- \'CHANNEL\'
--
-- 'channelConfiguration', 'listOfferings_channelConfiguration' - Filter to offerings that match the configuration of an existing channel,
-- e.g. \'2345678\' (a channel ID)
--
-- 'resolution', 'listOfferings_resolution' - Filter by resolution, \'SD\', \'HD\', \'FHD\', or \'UHD\'
--
-- 'codec', 'listOfferings_codec' - Filter by codec, \'AVC\', \'HEVC\', \'MPEG2\', \'AUDIO\', or \'LINK\'
--
-- 'nextToken', 'listOfferings_nextToken' - Undocumented member.
--
-- 'specialFeature', 'listOfferings_specialFeature' - Filter by special feature, \'ADVANCED_AUDIO\' or \'AUDIO_NORMALIZATION\'
--
-- 'channelClass', 'listOfferings_channelClass' - Filter by channel class, \'STANDARD\' or \'SINGLE_PIPELINE\'
--
-- 'maximumBitrate', 'listOfferings_maximumBitrate' - Filter by bitrate, \'MAX_10_MBPS\', \'MAX_20_MBPS\', or \'MAX_50_MBPS\'
--
-- 'duration', 'listOfferings_duration' - Filter by offering duration, e.g. \'12\'
--
-- 'maxResults', 'listOfferings_maxResults' - Undocumented member.
newListOfferings ::
  ListOfferings
newListOfferings :: ListOfferings
newListOfferings =
  ListOfferings' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> ListOfferings
ListOfferings'
    { $sel:videoQuality:ListOfferings' :: Maybe Text
videoQuality = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumFramerate:ListOfferings' :: Maybe Text
maximumFramerate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:ListOfferings' :: Maybe Text
resourceType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:channelConfiguration:ListOfferings' :: Maybe Text
channelConfiguration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resolution:ListOfferings' :: Maybe Text
resolution = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:codec:ListOfferings' :: Maybe Text
codec = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListOfferings' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:specialFeature:ListOfferings' :: Maybe Text
specialFeature = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:channelClass:ListOfferings' :: Maybe Text
channelClass = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maximumBitrate:ListOfferings' :: Maybe Text
maximumBitrate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:ListOfferings' :: Maybe Text
duration = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListOfferings' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Filter by video quality, \'STANDARD\', \'ENHANCED\', or \'PREMIUM\'
listOfferings_videoQuality :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_videoQuality :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_videoQuality = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
videoQuality :: Maybe Text
$sel:videoQuality:ListOfferings' :: ListOfferings -> Maybe Text
videoQuality} -> Maybe Text
videoQuality) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:videoQuality:ListOfferings' :: Maybe Text
videoQuality = Maybe Text
a} :: ListOfferings)

-- | Filter by framerate, \'MAX_30_FPS\' or \'MAX_60_FPS\'
listOfferings_maximumFramerate :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_maximumFramerate :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_maximumFramerate = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
maximumFramerate :: Maybe Text
$sel:maximumFramerate:ListOfferings' :: ListOfferings -> Maybe Text
maximumFramerate} -> Maybe Text
maximumFramerate) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:maximumFramerate:ListOfferings' :: Maybe Text
maximumFramerate = Maybe Text
a} :: ListOfferings)

-- | Filter by resource type, \'INPUT\', \'OUTPUT\', \'MULTIPLEX\', or
-- \'CHANNEL\'
listOfferings_resourceType :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_resourceType :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_resourceType = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:ListOfferings' :: ListOfferings -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:resourceType:ListOfferings' :: Maybe Text
resourceType = Maybe Text
a} :: ListOfferings)

-- | Filter to offerings that match the configuration of an existing channel,
-- e.g. \'2345678\' (a channel ID)
listOfferings_channelConfiguration :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_channelConfiguration :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_channelConfiguration = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
channelConfiguration :: Maybe Text
$sel:channelConfiguration:ListOfferings' :: ListOfferings -> Maybe Text
channelConfiguration} -> Maybe Text
channelConfiguration) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:channelConfiguration:ListOfferings' :: Maybe Text
channelConfiguration = Maybe Text
a} :: ListOfferings)

-- | Filter by resolution, \'SD\', \'HD\', \'FHD\', or \'UHD\'
listOfferings_resolution :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_resolution :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_resolution = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
resolution :: Maybe Text
$sel:resolution:ListOfferings' :: ListOfferings -> Maybe Text
resolution} -> Maybe Text
resolution) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:resolution:ListOfferings' :: Maybe Text
resolution = Maybe Text
a} :: ListOfferings)

-- | Filter by codec, \'AVC\', \'HEVC\', \'MPEG2\', \'AUDIO\', or \'LINK\'
listOfferings_codec :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_codec :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_codec = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
codec :: Maybe Text
$sel:codec:ListOfferings' :: ListOfferings -> Maybe Text
codec} -> Maybe Text
codec) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:codec:ListOfferings' :: Maybe Text
codec = Maybe Text
a} :: ListOfferings)

-- | Undocumented member.
listOfferings_nextToken :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_nextToken :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_nextToken = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOfferings' :: ListOfferings -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:nextToken:ListOfferings' :: Maybe Text
nextToken = Maybe Text
a} :: ListOfferings)

-- | Filter by special feature, \'ADVANCED_AUDIO\' or \'AUDIO_NORMALIZATION\'
listOfferings_specialFeature :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_specialFeature :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_specialFeature = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
specialFeature :: Maybe Text
$sel:specialFeature:ListOfferings' :: ListOfferings -> Maybe Text
specialFeature} -> Maybe Text
specialFeature) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:specialFeature:ListOfferings' :: Maybe Text
specialFeature = Maybe Text
a} :: ListOfferings)

-- | Filter by channel class, \'STANDARD\' or \'SINGLE_PIPELINE\'
listOfferings_channelClass :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_channelClass :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_channelClass = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
channelClass :: Maybe Text
$sel:channelClass:ListOfferings' :: ListOfferings -> Maybe Text
channelClass} -> Maybe Text
channelClass) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:channelClass:ListOfferings' :: Maybe Text
channelClass = Maybe Text
a} :: ListOfferings)

-- | Filter by bitrate, \'MAX_10_MBPS\', \'MAX_20_MBPS\', or \'MAX_50_MBPS\'
listOfferings_maximumBitrate :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_maximumBitrate :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_maximumBitrate = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
maximumBitrate :: Maybe Text
$sel:maximumBitrate:ListOfferings' :: ListOfferings -> Maybe Text
maximumBitrate} -> Maybe Text
maximumBitrate) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:maximumBitrate:ListOfferings' :: Maybe Text
maximumBitrate = Maybe Text
a} :: ListOfferings)

-- | Filter by offering duration, e.g. \'12\'
listOfferings_duration :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Text)
listOfferings_duration :: (Maybe Text -> f (Maybe Text)) -> ListOfferings -> f ListOfferings
listOfferings_duration = (ListOfferings -> Maybe Text)
-> (ListOfferings -> Maybe Text -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Text
duration :: Maybe Text
$sel:duration:ListOfferings' :: ListOfferings -> Maybe Text
duration} -> Maybe Text
duration) (\s :: ListOfferings
s@ListOfferings' {} Maybe Text
a -> ListOfferings
s {$sel:duration:ListOfferings' :: Maybe Text
duration = Maybe Text
a} :: ListOfferings)

-- | Undocumented member.
listOfferings_maxResults :: Lens.Lens' ListOfferings (Prelude.Maybe Prelude.Natural)
listOfferings_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListOfferings -> f ListOfferings
listOfferings_maxResults = (ListOfferings -> Maybe Natural)
-> (ListOfferings -> Maybe Natural -> ListOfferings)
-> Lens ListOfferings ListOfferings (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferings' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListOfferings' :: ListOfferings -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListOfferings
s@ListOfferings' {} Maybe Natural
a -> ListOfferings
s {$sel:maxResults:ListOfferings' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListOfferings)

instance Core.AWSPager ListOfferings where
  page :: ListOfferings -> AWSResponse ListOfferings -> Maybe ListOfferings
page ListOfferings
rq AWSResponse ListOfferings
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOfferings
ListOfferingsResponse
rs
            ListOfferingsResponse
-> Getting (First Text) ListOfferingsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListOfferingsResponse
-> Const (First Text) ListOfferingsResponse
Lens' ListOfferingsResponse (Maybe Text)
listOfferingsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListOfferingsResponse
 -> Const (First Text) ListOfferingsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListOfferingsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListOfferings
forall a. Maybe a
Prelude.Nothing
    | Maybe [Offering] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListOfferings
ListOfferingsResponse
rs
            ListOfferingsResponse
-> Getting (First [Offering]) ListOfferingsResponse [Offering]
-> Maybe [Offering]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Offering] -> Const (First [Offering]) (Maybe [Offering]))
-> ListOfferingsResponse
-> Const (First [Offering]) ListOfferingsResponse
Lens' ListOfferingsResponse (Maybe [Offering])
listOfferingsResponse_offerings ((Maybe [Offering] -> Const (First [Offering]) (Maybe [Offering]))
 -> ListOfferingsResponse
 -> Const (First [Offering]) ListOfferingsResponse)
-> (([Offering] -> Const (First [Offering]) [Offering])
    -> Maybe [Offering] -> Const (First [Offering]) (Maybe [Offering]))
-> Getting (First [Offering]) ListOfferingsResponse [Offering]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Offering] -> Const (First [Offering]) [Offering])
-> Maybe [Offering] -> Const (First [Offering]) (Maybe [Offering])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListOfferings
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListOfferings -> Maybe ListOfferings
forall a. a -> Maybe a
Prelude.Just (ListOfferings -> Maybe ListOfferings)
-> ListOfferings -> Maybe ListOfferings
forall a b. (a -> b) -> a -> b
Prelude.$
        ListOfferings
rq
          ListOfferings -> (ListOfferings -> ListOfferings) -> ListOfferings
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListOfferings -> Identity ListOfferings
Lens ListOfferings ListOfferings (Maybe Text) (Maybe Text)
listOfferings_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListOfferings -> Identity ListOfferings)
-> Maybe Text -> ListOfferings -> ListOfferings
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListOfferings
ListOfferingsResponse
rs
          ListOfferingsResponse
-> Getting (First Text) ListOfferingsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListOfferingsResponse
-> Const (First Text) ListOfferingsResponse
Lens' ListOfferingsResponse (Maybe Text)
listOfferingsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListOfferingsResponse
 -> Const (First Text) ListOfferingsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListOfferingsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListOfferings where
  type
    AWSResponse ListOfferings =
      ListOfferingsResponse
  request :: ListOfferings -> Request ListOfferings
request = Service -> ListOfferings -> Request ListOfferings
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListOfferings
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListOfferings)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListOfferings))
-> Logger
-> Service
-> Proxy ListOfferings
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListOfferings)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text -> Maybe [Offering] -> Int -> ListOfferingsResponse
ListOfferingsResponse'
            (Maybe Text -> Maybe [Offering] -> Int -> ListOfferingsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Offering] -> Int -> ListOfferingsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either String (Maybe [Offering] -> Int -> ListOfferingsResponse)
-> Either String (Maybe [Offering])
-> Either String (Int -> ListOfferingsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Offering]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"offerings" Either String (Maybe (Maybe [Offering]))
-> Maybe [Offering] -> Either String (Maybe [Offering])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Offering]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> ListOfferingsResponse)
-> Either String Int -> Either String ListOfferingsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListOfferings

instance Prelude.NFData ListOfferings

instance Core.ToHeaders ListOfferings where
  toHeaders :: ListOfferings -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListOfferings -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToPath ListOfferings where
  toPath :: ListOfferings -> ByteString
toPath = ByteString -> ListOfferings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/prod/offerings"

instance Core.ToQuery ListOfferings where
  toQuery :: ListOfferings -> QueryString
toQuery ListOfferings' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
duration :: Maybe Text
maximumBitrate :: Maybe Text
channelClass :: Maybe Text
specialFeature :: Maybe Text
nextToken :: Maybe Text
codec :: Maybe Text
resolution :: Maybe Text
channelConfiguration :: Maybe Text
resourceType :: Maybe Text
maximumFramerate :: Maybe Text
videoQuality :: Maybe Text
$sel:maxResults:ListOfferings' :: ListOfferings -> Maybe Natural
$sel:duration:ListOfferings' :: ListOfferings -> Maybe Text
$sel:maximumBitrate:ListOfferings' :: ListOfferings -> Maybe Text
$sel:channelClass:ListOfferings' :: ListOfferings -> Maybe Text
$sel:specialFeature:ListOfferings' :: ListOfferings -> Maybe Text
$sel:nextToken:ListOfferings' :: ListOfferings -> Maybe Text
$sel:codec:ListOfferings' :: ListOfferings -> Maybe Text
$sel:resolution:ListOfferings' :: ListOfferings -> Maybe Text
$sel:channelConfiguration:ListOfferings' :: ListOfferings -> Maybe Text
$sel:resourceType:ListOfferings' :: ListOfferings -> Maybe Text
$sel:maximumFramerate:ListOfferings' :: ListOfferings -> Maybe Text
$sel:videoQuality:ListOfferings' :: ListOfferings -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"videoQuality" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
videoQuality,
        ByteString
"maximumFramerate" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maximumFramerate,
        ByteString
"resourceType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
resourceType,
        ByteString
"channelConfiguration" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
channelConfiguration,
        ByteString
"resolution" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
resolution,
        ByteString
"codec" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
codec,
        ByteString
"nextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"specialFeature" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
specialFeature,
        ByteString
"channelClass" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
channelClass,
        ByteString
"maximumBitrate" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maximumBitrate,
        ByteString
"duration" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
duration,
        ByteString
"maxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | Placeholder documentation for ListOfferingsResponse
--
-- /See:/ 'newListOfferingsResponse' smart constructor.
data ListOfferingsResponse = ListOfferingsResponse'
  { -- | Token to retrieve the next page of results
    ListOfferingsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | List of offerings
    ListOfferingsResponse -> Maybe [Offering]
offerings :: Prelude.Maybe [Offering],
    -- | The response's http status code.
    ListOfferingsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListOfferingsResponse -> ListOfferingsResponse -> Bool
(ListOfferingsResponse -> ListOfferingsResponse -> Bool)
-> (ListOfferingsResponse -> ListOfferingsResponse -> Bool)
-> Eq ListOfferingsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOfferingsResponse -> ListOfferingsResponse -> Bool
$c/= :: ListOfferingsResponse -> ListOfferingsResponse -> Bool
== :: ListOfferingsResponse -> ListOfferingsResponse -> Bool
$c== :: ListOfferingsResponse -> ListOfferingsResponse -> Bool
Prelude.Eq, ReadPrec [ListOfferingsResponse]
ReadPrec ListOfferingsResponse
Int -> ReadS ListOfferingsResponse
ReadS [ListOfferingsResponse]
(Int -> ReadS ListOfferingsResponse)
-> ReadS [ListOfferingsResponse]
-> ReadPrec ListOfferingsResponse
-> ReadPrec [ListOfferingsResponse]
-> Read ListOfferingsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOfferingsResponse]
$creadListPrec :: ReadPrec [ListOfferingsResponse]
readPrec :: ReadPrec ListOfferingsResponse
$creadPrec :: ReadPrec ListOfferingsResponse
readList :: ReadS [ListOfferingsResponse]
$creadList :: ReadS [ListOfferingsResponse]
readsPrec :: Int -> ReadS ListOfferingsResponse
$creadsPrec :: Int -> ReadS ListOfferingsResponse
Prelude.Read, Int -> ListOfferingsResponse -> ShowS
[ListOfferingsResponse] -> ShowS
ListOfferingsResponse -> String
(Int -> ListOfferingsResponse -> ShowS)
-> (ListOfferingsResponse -> String)
-> ([ListOfferingsResponse] -> ShowS)
-> Show ListOfferingsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOfferingsResponse] -> ShowS
$cshowList :: [ListOfferingsResponse] -> ShowS
show :: ListOfferingsResponse -> String
$cshow :: ListOfferingsResponse -> String
showsPrec :: Int -> ListOfferingsResponse -> ShowS
$cshowsPrec :: Int -> ListOfferingsResponse -> ShowS
Prelude.Show, (forall x. ListOfferingsResponse -> Rep ListOfferingsResponse x)
-> (forall x. Rep ListOfferingsResponse x -> ListOfferingsResponse)
-> Generic ListOfferingsResponse
forall x. Rep ListOfferingsResponse x -> ListOfferingsResponse
forall x. ListOfferingsResponse -> Rep ListOfferingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListOfferingsResponse x -> ListOfferingsResponse
$cfrom :: forall x. ListOfferingsResponse -> Rep ListOfferingsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListOfferingsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'listOfferingsResponse_nextToken' - Token to retrieve the next page of results
--
-- 'offerings', 'listOfferingsResponse_offerings' - List of offerings
--
-- 'httpStatus', 'listOfferingsResponse_httpStatus' - The response's http status code.
newListOfferingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListOfferingsResponse
newListOfferingsResponse :: Int -> ListOfferingsResponse
newListOfferingsResponse Int
pHttpStatus_ =
  ListOfferingsResponse' :: Maybe Text -> Maybe [Offering] -> Int -> ListOfferingsResponse
ListOfferingsResponse'
    { $sel:nextToken:ListOfferingsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:offerings:ListOfferingsResponse' :: Maybe [Offering]
offerings = Maybe [Offering]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListOfferingsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Token to retrieve the next page of results
listOfferingsResponse_nextToken :: Lens.Lens' ListOfferingsResponse (Prelude.Maybe Prelude.Text)
listOfferingsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListOfferingsResponse -> f ListOfferingsResponse
listOfferingsResponse_nextToken = (ListOfferingsResponse -> Maybe Text)
-> (ListOfferingsResponse -> Maybe Text -> ListOfferingsResponse)
-> Lens' ListOfferingsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferingsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListOfferingsResponse' :: ListOfferingsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListOfferingsResponse
s@ListOfferingsResponse' {} Maybe Text
a -> ListOfferingsResponse
s {$sel:nextToken:ListOfferingsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListOfferingsResponse)

-- | List of offerings
listOfferingsResponse_offerings :: Lens.Lens' ListOfferingsResponse (Prelude.Maybe [Offering])
listOfferingsResponse_offerings :: (Maybe [Offering] -> f (Maybe [Offering]))
-> ListOfferingsResponse -> f ListOfferingsResponse
listOfferingsResponse_offerings = (ListOfferingsResponse -> Maybe [Offering])
-> (ListOfferingsResponse
    -> Maybe [Offering] -> ListOfferingsResponse)
-> Lens' ListOfferingsResponse (Maybe [Offering])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferingsResponse' {Maybe [Offering]
offerings :: Maybe [Offering]
$sel:offerings:ListOfferingsResponse' :: ListOfferingsResponse -> Maybe [Offering]
offerings} -> Maybe [Offering]
offerings) (\s :: ListOfferingsResponse
s@ListOfferingsResponse' {} Maybe [Offering]
a -> ListOfferingsResponse
s {$sel:offerings:ListOfferingsResponse' :: Maybe [Offering]
offerings = Maybe [Offering]
a} :: ListOfferingsResponse) ((Maybe [Offering] -> f (Maybe [Offering]))
 -> ListOfferingsResponse -> f ListOfferingsResponse)
-> ((Maybe [Offering] -> f (Maybe [Offering]))
    -> Maybe [Offering] -> f (Maybe [Offering]))
-> (Maybe [Offering] -> f (Maybe [Offering]))
-> ListOfferingsResponse
-> f ListOfferingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Offering] [Offering] [Offering] [Offering]
-> Iso
     (Maybe [Offering])
     (Maybe [Offering])
     (Maybe [Offering])
     (Maybe [Offering])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Offering] [Offering] [Offering] [Offering]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
listOfferingsResponse_httpStatus :: Lens.Lens' ListOfferingsResponse Prelude.Int
listOfferingsResponse_httpStatus :: (Int -> f Int) -> ListOfferingsResponse -> f ListOfferingsResponse
listOfferingsResponse_httpStatus = (ListOfferingsResponse -> Int)
-> (ListOfferingsResponse -> Int -> ListOfferingsResponse)
-> Lens ListOfferingsResponse ListOfferingsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOfferingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListOfferingsResponse' :: ListOfferingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListOfferingsResponse
s@ListOfferingsResponse' {} Int
a -> ListOfferingsResponse
s {$sel:httpStatus:ListOfferingsResponse' :: Int
httpStatus = Int
a} :: ListOfferingsResponse)

instance Prelude.NFData ListOfferingsResponse