{-# 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.MediaTailor.ListPlaybackConfigurations
-- 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)
--
-- Returns a list of the playback configurations defined in AWS Elemental
-- MediaTailor. You can specify a maximum number of configurations to
-- return at a time. The default maximum is 50. Results are returned in
-- pagefuls. If MediaTailor has more configurations than the specified
-- maximum, it provides parameters in the response that you can use to
-- retrieve the next pageful.
--
-- This operation returns paginated results.
module Amazonka.MediaTailor.ListPlaybackConfigurations
  ( -- * Creating a Request
    ListPlaybackConfigurations (..),
    newListPlaybackConfigurations,

    -- * Request Lenses
    listPlaybackConfigurations_nextToken,
    listPlaybackConfigurations_maxResults,

    -- * Destructuring the Response
    ListPlaybackConfigurationsResponse (..),
    newListPlaybackConfigurationsResponse,

    -- * Response Lenses
    listPlaybackConfigurationsResponse_items,
    listPlaybackConfigurationsResponse_nextToken,
    listPlaybackConfigurationsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListPlaybackConfigurations' smart constructor.
data ListPlaybackConfigurations = ListPlaybackConfigurations'
  { -- | Pagination token returned by the GET list request when results exceed
    -- the maximum allowed. Use the token to fetch the next page of results.
    ListPlaybackConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of records to return.
    ListPlaybackConfigurations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListPlaybackConfigurations -> ListPlaybackConfigurations -> Bool
(ListPlaybackConfigurations -> ListPlaybackConfigurations -> Bool)
-> (ListPlaybackConfigurations
    -> ListPlaybackConfigurations -> Bool)
-> Eq ListPlaybackConfigurations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlaybackConfigurations -> ListPlaybackConfigurations -> Bool
$c/= :: ListPlaybackConfigurations -> ListPlaybackConfigurations -> Bool
== :: ListPlaybackConfigurations -> ListPlaybackConfigurations -> Bool
$c== :: ListPlaybackConfigurations -> ListPlaybackConfigurations -> Bool
Prelude.Eq, ReadPrec [ListPlaybackConfigurations]
ReadPrec ListPlaybackConfigurations
Int -> ReadS ListPlaybackConfigurations
ReadS [ListPlaybackConfigurations]
(Int -> ReadS ListPlaybackConfigurations)
-> ReadS [ListPlaybackConfigurations]
-> ReadPrec ListPlaybackConfigurations
-> ReadPrec [ListPlaybackConfigurations]
-> Read ListPlaybackConfigurations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlaybackConfigurations]
$creadListPrec :: ReadPrec [ListPlaybackConfigurations]
readPrec :: ReadPrec ListPlaybackConfigurations
$creadPrec :: ReadPrec ListPlaybackConfigurations
readList :: ReadS [ListPlaybackConfigurations]
$creadList :: ReadS [ListPlaybackConfigurations]
readsPrec :: Int -> ReadS ListPlaybackConfigurations
$creadsPrec :: Int -> ReadS ListPlaybackConfigurations
Prelude.Read, Int -> ListPlaybackConfigurations -> ShowS
[ListPlaybackConfigurations] -> ShowS
ListPlaybackConfigurations -> String
(Int -> ListPlaybackConfigurations -> ShowS)
-> (ListPlaybackConfigurations -> String)
-> ([ListPlaybackConfigurations] -> ShowS)
-> Show ListPlaybackConfigurations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlaybackConfigurations] -> ShowS
$cshowList :: [ListPlaybackConfigurations] -> ShowS
show :: ListPlaybackConfigurations -> String
$cshow :: ListPlaybackConfigurations -> String
showsPrec :: Int -> ListPlaybackConfigurations -> ShowS
$cshowsPrec :: Int -> ListPlaybackConfigurations -> ShowS
Prelude.Show, (forall x.
 ListPlaybackConfigurations -> Rep ListPlaybackConfigurations x)
-> (forall x.
    Rep ListPlaybackConfigurations x -> ListPlaybackConfigurations)
-> Generic ListPlaybackConfigurations
forall x.
Rep ListPlaybackConfigurations x -> ListPlaybackConfigurations
forall x.
ListPlaybackConfigurations -> Rep ListPlaybackConfigurations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPlaybackConfigurations x -> ListPlaybackConfigurations
$cfrom :: forall x.
ListPlaybackConfigurations -> Rep ListPlaybackConfigurations x
Prelude.Generic)

-- |
-- Create a value of 'ListPlaybackConfigurations' 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', 'listPlaybackConfigurations_nextToken' - Pagination token returned by the GET list request when results exceed
-- the maximum allowed. Use the token to fetch the next page of results.
--
-- 'maxResults', 'listPlaybackConfigurations_maxResults' - Maximum number of records to return.
newListPlaybackConfigurations ::
  ListPlaybackConfigurations
newListPlaybackConfigurations :: ListPlaybackConfigurations
newListPlaybackConfigurations =
  ListPlaybackConfigurations' :: Maybe Text -> Maybe Natural -> ListPlaybackConfigurations
ListPlaybackConfigurations'
    { $sel:nextToken:ListPlaybackConfigurations' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListPlaybackConfigurations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Pagination token returned by the GET list request when results exceed
-- the maximum allowed. Use the token to fetch the next page of results.
listPlaybackConfigurations_nextToken :: Lens.Lens' ListPlaybackConfigurations (Prelude.Maybe Prelude.Text)
listPlaybackConfigurations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPlaybackConfigurations -> f ListPlaybackConfigurations
listPlaybackConfigurations_nextToken = (ListPlaybackConfigurations -> Maybe Text)
-> (ListPlaybackConfigurations
    -> Maybe Text -> ListPlaybackConfigurations)
-> Lens
     ListPlaybackConfigurations
     ListPlaybackConfigurations
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackConfigurations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlaybackConfigurations
s@ListPlaybackConfigurations' {} Maybe Text
a -> ListPlaybackConfigurations
s {$sel:nextToken:ListPlaybackConfigurations' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlaybackConfigurations)

-- | Maximum number of records to return.
listPlaybackConfigurations_maxResults :: Lens.Lens' ListPlaybackConfigurations (Prelude.Maybe Prelude.Natural)
listPlaybackConfigurations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListPlaybackConfigurations -> f ListPlaybackConfigurations
listPlaybackConfigurations_maxResults = (ListPlaybackConfigurations -> Maybe Natural)
-> (ListPlaybackConfigurations
    -> Maybe Natural -> ListPlaybackConfigurations)
-> Lens
     ListPlaybackConfigurations
     ListPlaybackConfigurations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackConfigurations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListPlaybackConfigurations
s@ListPlaybackConfigurations' {} Maybe Natural
a -> ListPlaybackConfigurations
s {$sel:maxResults:ListPlaybackConfigurations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListPlaybackConfigurations)

instance Core.AWSPager ListPlaybackConfigurations where
  page :: ListPlaybackConfigurations
-> AWSResponse ListPlaybackConfigurations
-> Maybe ListPlaybackConfigurations
page ListPlaybackConfigurations
rq AWSResponse ListPlaybackConfigurations
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlaybackConfigurations
ListPlaybackConfigurationsResponse
rs
            ListPlaybackConfigurationsResponse
-> Getting (First Text) ListPlaybackConfigurationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlaybackConfigurationsResponse
-> Const (First Text) ListPlaybackConfigurationsResponse
Lens' ListPlaybackConfigurationsResponse (Maybe Text)
listPlaybackConfigurationsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlaybackConfigurationsResponse
 -> Const (First Text) ListPlaybackConfigurationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlaybackConfigurationsResponse 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 ListPlaybackConfigurations
forall a. Maybe a
Prelude.Nothing
    | Maybe [PlaybackConfiguration] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListPlaybackConfigurations
ListPlaybackConfigurationsResponse
rs
            ListPlaybackConfigurationsResponse
-> Getting
     (First [PlaybackConfiguration])
     ListPlaybackConfigurationsResponse
     [PlaybackConfiguration]
-> Maybe [PlaybackConfiguration]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [PlaybackConfiguration]
 -> Const
      (First [PlaybackConfiguration]) (Maybe [PlaybackConfiguration]))
-> ListPlaybackConfigurationsResponse
-> Const
     (First [PlaybackConfiguration]) ListPlaybackConfigurationsResponse
Lens'
  ListPlaybackConfigurationsResponse (Maybe [PlaybackConfiguration])
listPlaybackConfigurationsResponse_items
              ((Maybe [PlaybackConfiguration]
  -> Const
       (First [PlaybackConfiguration]) (Maybe [PlaybackConfiguration]))
 -> ListPlaybackConfigurationsResponse
 -> Const
      (First [PlaybackConfiguration]) ListPlaybackConfigurationsResponse)
-> (([PlaybackConfiguration]
     -> Const (First [PlaybackConfiguration]) [PlaybackConfiguration])
    -> Maybe [PlaybackConfiguration]
    -> Const
         (First [PlaybackConfiguration]) (Maybe [PlaybackConfiguration]))
-> Getting
     (First [PlaybackConfiguration])
     ListPlaybackConfigurationsResponse
     [PlaybackConfiguration]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PlaybackConfiguration]
 -> Const (First [PlaybackConfiguration]) [PlaybackConfiguration])
-> Maybe [PlaybackConfiguration]
-> Const
     (First [PlaybackConfiguration]) (Maybe [PlaybackConfiguration])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListPlaybackConfigurations
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListPlaybackConfigurations -> Maybe ListPlaybackConfigurations
forall a. a -> Maybe a
Prelude.Just (ListPlaybackConfigurations -> Maybe ListPlaybackConfigurations)
-> ListPlaybackConfigurations -> Maybe ListPlaybackConfigurations
forall a b. (a -> b) -> a -> b
Prelude.$
        ListPlaybackConfigurations
rq
          ListPlaybackConfigurations
-> (ListPlaybackConfigurations -> ListPlaybackConfigurations)
-> ListPlaybackConfigurations
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListPlaybackConfigurations
-> Identity ListPlaybackConfigurations
Lens
  ListPlaybackConfigurations
  ListPlaybackConfigurations
  (Maybe Text)
  (Maybe Text)
listPlaybackConfigurations_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListPlaybackConfigurations
 -> Identity ListPlaybackConfigurations)
-> Maybe Text
-> ListPlaybackConfigurations
-> ListPlaybackConfigurations
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPlaybackConfigurations
ListPlaybackConfigurationsResponse
rs
          ListPlaybackConfigurationsResponse
-> Getting (First Text) ListPlaybackConfigurationsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListPlaybackConfigurationsResponse
-> Const (First Text) ListPlaybackConfigurationsResponse
Lens' ListPlaybackConfigurationsResponse (Maybe Text)
listPlaybackConfigurationsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListPlaybackConfigurationsResponse
 -> Const (First Text) ListPlaybackConfigurationsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListPlaybackConfigurationsResponse 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 ListPlaybackConfigurations where
  type
    AWSResponse ListPlaybackConfigurations =
      ListPlaybackConfigurationsResponse
  request :: ListPlaybackConfigurations -> Request ListPlaybackConfigurations
request = Service
-> ListPlaybackConfigurations -> Request ListPlaybackConfigurations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListPlaybackConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlaybackConfigurations)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListPlaybackConfigurations))
-> Logger
-> Service
-> Proxy ListPlaybackConfigurations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListPlaybackConfigurations)))
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 [PlaybackConfiguration]
-> Maybe Text -> Int -> ListPlaybackConfigurationsResponse
ListPlaybackConfigurationsResponse'
            (Maybe [PlaybackConfiguration]
 -> Maybe Text -> Int -> ListPlaybackConfigurationsResponse)
-> Either String (Maybe [PlaybackConfiguration])
-> Either
     String (Maybe Text -> Int -> ListPlaybackConfigurationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [PlaybackConfiguration]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Items" Either String (Maybe (Maybe [PlaybackConfiguration]))
-> Maybe [PlaybackConfiguration]
-> Either String (Maybe [PlaybackConfiguration])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [PlaybackConfiguration]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String (Maybe Text -> Int -> ListPlaybackConfigurationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListPlaybackConfigurationsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> ListPlaybackConfigurationsResponse)
-> Either String Int
-> Either String ListPlaybackConfigurationsResponse
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 ListPlaybackConfigurations

instance Prelude.NFData ListPlaybackConfigurations

instance Core.ToHeaders ListPlaybackConfigurations where
  toHeaders :: ListPlaybackConfigurations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListPlaybackConfigurations -> 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 ListPlaybackConfigurations where
  toPath :: ListPlaybackConfigurations -> ByteString
toPath = ByteString -> ListPlaybackConfigurations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/playbackConfigurations"

instance Core.ToQuery ListPlaybackConfigurations where
  toQuery :: ListPlaybackConfigurations -> QueryString
toQuery ListPlaybackConfigurations' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:maxResults:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Natural
$sel:nextToken:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Text
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
        ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
      ]

-- | /See:/ 'newListPlaybackConfigurationsResponse' smart constructor.
data ListPlaybackConfigurationsResponse = ListPlaybackConfigurationsResponse'
  { -- | Array of playback configurations. This might be all the available
    -- configurations or a subset, depending on the settings that you provide
    -- and the total number of configurations stored.
    ListPlaybackConfigurationsResponse -> Maybe [PlaybackConfiguration]
items :: Prelude.Maybe [PlaybackConfiguration],
    -- | Pagination token returned by the GET list request when results exceed
    -- the maximum allowed. Use the token to fetch the next page of results.
    ListPlaybackConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListPlaybackConfigurationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListPlaybackConfigurationsResponse
-> ListPlaybackConfigurationsResponse -> Bool
(ListPlaybackConfigurationsResponse
 -> ListPlaybackConfigurationsResponse -> Bool)
-> (ListPlaybackConfigurationsResponse
    -> ListPlaybackConfigurationsResponse -> Bool)
-> Eq ListPlaybackConfigurationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListPlaybackConfigurationsResponse
-> ListPlaybackConfigurationsResponse -> Bool
$c/= :: ListPlaybackConfigurationsResponse
-> ListPlaybackConfigurationsResponse -> Bool
== :: ListPlaybackConfigurationsResponse
-> ListPlaybackConfigurationsResponse -> Bool
$c== :: ListPlaybackConfigurationsResponse
-> ListPlaybackConfigurationsResponse -> Bool
Prelude.Eq, ReadPrec [ListPlaybackConfigurationsResponse]
ReadPrec ListPlaybackConfigurationsResponse
Int -> ReadS ListPlaybackConfigurationsResponse
ReadS [ListPlaybackConfigurationsResponse]
(Int -> ReadS ListPlaybackConfigurationsResponse)
-> ReadS [ListPlaybackConfigurationsResponse]
-> ReadPrec ListPlaybackConfigurationsResponse
-> ReadPrec [ListPlaybackConfigurationsResponse]
-> Read ListPlaybackConfigurationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListPlaybackConfigurationsResponse]
$creadListPrec :: ReadPrec [ListPlaybackConfigurationsResponse]
readPrec :: ReadPrec ListPlaybackConfigurationsResponse
$creadPrec :: ReadPrec ListPlaybackConfigurationsResponse
readList :: ReadS [ListPlaybackConfigurationsResponse]
$creadList :: ReadS [ListPlaybackConfigurationsResponse]
readsPrec :: Int -> ReadS ListPlaybackConfigurationsResponse
$creadsPrec :: Int -> ReadS ListPlaybackConfigurationsResponse
Prelude.Read, Int -> ListPlaybackConfigurationsResponse -> ShowS
[ListPlaybackConfigurationsResponse] -> ShowS
ListPlaybackConfigurationsResponse -> String
(Int -> ListPlaybackConfigurationsResponse -> ShowS)
-> (ListPlaybackConfigurationsResponse -> String)
-> ([ListPlaybackConfigurationsResponse] -> ShowS)
-> Show ListPlaybackConfigurationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListPlaybackConfigurationsResponse] -> ShowS
$cshowList :: [ListPlaybackConfigurationsResponse] -> ShowS
show :: ListPlaybackConfigurationsResponse -> String
$cshow :: ListPlaybackConfigurationsResponse -> String
showsPrec :: Int -> ListPlaybackConfigurationsResponse -> ShowS
$cshowsPrec :: Int -> ListPlaybackConfigurationsResponse -> ShowS
Prelude.Show, (forall x.
 ListPlaybackConfigurationsResponse
 -> Rep ListPlaybackConfigurationsResponse x)
-> (forall x.
    Rep ListPlaybackConfigurationsResponse x
    -> ListPlaybackConfigurationsResponse)
-> Generic ListPlaybackConfigurationsResponse
forall x.
Rep ListPlaybackConfigurationsResponse x
-> ListPlaybackConfigurationsResponse
forall x.
ListPlaybackConfigurationsResponse
-> Rep ListPlaybackConfigurationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListPlaybackConfigurationsResponse x
-> ListPlaybackConfigurationsResponse
$cfrom :: forall x.
ListPlaybackConfigurationsResponse
-> Rep ListPlaybackConfigurationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListPlaybackConfigurationsResponse' 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:
--
-- 'items', 'listPlaybackConfigurationsResponse_items' - Array of playback configurations. This might be all the available
-- configurations or a subset, depending on the settings that you provide
-- and the total number of configurations stored.
--
-- 'nextToken', 'listPlaybackConfigurationsResponse_nextToken' - Pagination token returned by the GET list request when results exceed
-- the maximum allowed. Use the token to fetch the next page of results.
--
-- 'httpStatus', 'listPlaybackConfigurationsResponse_httpStatus' - The response's http status code.
newListPlaybackConfigurationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListPlaybackConfigurationsResponse
newListPlaybackConfigurationsResponse :: Int -> ListPlaybackConfigurationsResponse
newListPlaybackConfigurationsResponse Int
pHttpStatus_ =
  ListPlaybackConfigurationsResponse' :: Maybe [PlaybackConfiguration]
-> Maybe Text -> Int -> ListPlaybackConfigurationsResponse
ListPlaybackConfigurationsResponse'
    { $sel:items:ListPlaybackConfigurationsResponse' :: Maybe [PlaybackConfiguration]
items =
        Maybe [PlaybackConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListPlaybackConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListPlaybackConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Array of playback configurations. This might be all the available
-- configurations or a subset, depending on the settings that you provide
-- and the total number of configurations stored.
listPlaybackConfigurationsResponse_items :: Lens.Lens' ListPlaybackConfigurationsResponse (Prelude.Maybe [PlaybackConfiguration])
listPlaybackConfigurationsResponse_items :: (Maybe [PlaybackConfiguration]
 -> f (Maybe [PlaybackConfiguration]))
-> ListPlaybackConfigurationsResponse
-> f ListPlaybackConfigurationsResponse
listPlaybackConfigurationsResponse_items = (ListPlaybackConfigurationsResponse
 -> Maybe [PlaybackConfiguration])
-> (ListPlaybackConfigurationsResponse
    -> Maybe [PlaybackConfiguration]
    -> ListPlaybackConfigurationsResponse)
-> Lens'
     ListPlaybackConfigurationsResponse (Maybe [PlaybackConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackConfigurationsResponse' {Maybe [PlaybackConfiguration]
items :: Maybe [PlaybackConfiguration]
$sel:items:ListPlaybackConfigurationsResponse' :: ListPlaybackConfigurationsResponse -> Maybe [PlaybackConfiguration]
items} -> Maybe [PlaybackConfiguration]
items) (\s :: ListPlaybackConfigurationsResponse
s@ListPlaybackConfigurationsResponse' {} Maybe [PlaybackConfiguration]
a -> ListPlaybackConfigurationsResponse
s {$sel:items:ListPlaybackConfigurationsResponse' :: Maybe [PlaybackConfiguration]
items = Maybe [PlaybackConfiguration]
a} :: ListPlaybackConfigurationsResponse) ((Maybe [PlaybackConfiguration]
  -> f (Maybe [PlaybackConfiguration]))
 -> ListPlaybackConfigurationsResponse
 -> f ListPlaybackConfigurationsResponse)
-> ((Maybe [PlaybackConfiguration]
     -> f (Maybe [PlaybackConfiguration]))
    -> Maybe [PlaybackConfiguration]
    -> f (Maybe [PlaybackConfiguration]))
-> (Maybe [PlaybackConfiguration]
    -> f (Maybe [PlaybackConfiguration]))
-> ListPlaybackConfigurationsResponse
-> f ListPlaybackConfigurationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [PlaybackConfiguration]
  [PlaybackConfiguration]
  [PlaybackConfiguration]
  [PlaybackConfiguration]
-> Iso
     (Maybe [PlaybackConfiguration])
     (Maybe [PlaybackConfiguration])
     (Maybe [PlaybackConfiguration])
     (Maybe [PlaybackConfiguration])
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
  [PlaybackConfiguration]
  [PlaybackConfiguration]
  [PlaybackConfiguration]
  [PlaybackConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Pagination token returned by the GET list request when results exceed
-- the maximum allowed. Use the token to fetch the next page of results.
listPlaybackConfigurationsResponse_nextToken :: Lens.Lens' ListPlaybackConfigurationsResponse (Prelude.Maybe Prelude.Text)
listPlaybackConfigurationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListPlaybackConfigurationsResponse
-> f ListPlaybackConfigurationsResponse
listPlaybackConfigurationsResponse_nextToken = (ListPlaybackConfigurationsResponse -> Maybe Text)
-> (ListPlaybackConfigurationsResponse
    -> Maybe Text -> ListPlaybackConfigurationsResponse)
-> Lens' ListPlaybackConfigurationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListPlaybackConfigurationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListPlaybackConfigurationsResponse' :: ListPlaybackConfigurationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListPlaybackConfigurationsResponse
s@ListPlaybackConfigurationsResponse' {} Maybe Text
a -> ListPlaybackConfigurationsResponse
s {$sel:nextToken:ListPlaybackConfigurationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListPlaybackConfigurationsResponse)

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

instance
  Prelude.NFData
    ListPlaybackConfigurationsResponse