{-# 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 #-}
module Amazonka.MediaTailor.ListPlaybackConfigurations
(
ListPlaybackConfigurations (..),
newListPlaybackConfigurations,
listPlaybackConfigurations_maxResults,
listPlaybackConfigurations_nextToken,
ListPlaybackConfigurationsResponse (..),
newListPlaybackConfigurationsResponse,
listPlaybackConfigurationsResponse_items,
listPlaybackConfigurationsResponse_nextToken,
listPlaybackConfigurationsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaTailor.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListPlaybackConfigurations = ListPlaybackConfigurations'
{
ListPlaybackConfigurations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListPlaybackConfigurations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListPlaybackConfigurations -> ListPlaybackConfigurations -> Bool
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]
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
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.
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)
newListPlaybackConfigurations ::
ListPlaybackConfigurations
newListPlaybackConfigurations :: ListPlaybackConfigurations
newListPlaybackConfigurations =
ListPlaybackConfigurations'
{ $sel:maxResults:ListPlaybackConfigurations' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPlaybackConfigurations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listPlaybackConfigurations_maxResults :: Lens.Lens' ListPlaybackConfigurations (Prelude.Maybe Prelude.Natural)
listPlaybackConfigurations_maxResults :: Lens' ListPlaybackConfigurations (Maybe Natural)
listPlaybackConfigurations_maxResults = 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)
listPlaybackConfigurations_nextToken :: Lens.Lens' ListPlaybackConfigurations (Prelude.Maybe Prelude.Text)
listPlaybackConfigurations_nextToken :: Lens' ListPlaybackConfigurations (Maybe Text)
listPlaybackConfigurations_nextToken = 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)
instance Core.AWSPager ListPlaybackConfigurations where
page :: ListPlaybackConfigurations
-> AWSResponse ListPlaybackConfigurations
-> Maybe ListPlaybackConfigurations
page ListPlaybackConfigurations
rq AWSResponse ListPlaybackConfigurations
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPlaybackConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPlaybackConfigurationsResponse (Maybe Text)
listPlaybackConfigurationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListPlaybackConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens'
ListPlaybackConfigurationsResponse (Maybe [PlaybackConfiguration])
listPlaybackConfigurationsResponse_items
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListPlaybackConfigurations
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListPlaybackConfigurations (Maybe Text)
listPlaybackConfigurations_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListPlaybackConfigurations
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListPlaybackConfigurationsResponse (Maybe Text)
listPlaybackConfigurationsResponse_nextToken
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListPlaybackConfigurations where
type
AWSResponse ListPlaybackConfigurations =
ListPlaybackConfigurationsResponse
request :: (Service -> Service)
-> ListPlaybackConfigurations -> Request ListPlaybackConfigurations
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListPlaybackConfigurations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListPlaybackConfigurations)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> 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'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Items" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListPlaybackConfigurations where
hashWithSalt :: Int -> ListPlaybackConfigurations -> Int
hashWithSalt Int
_salt ListPlaybackConfigurations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Text
$sel:maxResults:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListPlaybackConfigurations where
rnf :: ListPlaybackConfigurations -> ()
rnf ListPlaybackConfigurations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Text
$sel:maxResults:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
instance Data.ToHeaders ListPlaybackConfigurations where
toHeaders :: ListPlaybackConfigurations -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListPlaybackConfigurations where
toPath :: ListPlaybackConfigurations -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/playbackConfigurations"
instance Data.ToQuery ListPlaybackConfigurations where
toQuery :: ListPlaybackConfigurations -> QueryString
toQuery ListPlaybackConfigurations' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:nextToken:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Text
$sel:maxResults:ListPlaybackConfigurations' :: ListPlaybackConfigurations -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"MaxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"NextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListPlaybackConfigurationsResponse = ListPlaybackConfigurationsResponse'
{
ListPlaybackConfigurationsResponse -> Maybe [PlaybackConfiguration]
items :: Prelude.Maybe [PlaybackConfiguration],
ListPlaybackConfigurationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListPlaybackConfigurationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListPlaybackConfigurationsResponse
-> ListPlaybackConfigurationsResponse -> Bool
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]
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
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.
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)
newListPlaybackConfigurationsResponse ::
Prelude.Int ->
ListPlaybackConfigurationsResponse
newListPlaybackConfigurationsResponse :: Int -> ListPlaybackConfigurationsResponse
newListPlaybackConfigurationsResponse Int
pHttpStatus_ =
ListPlaybackConfigurationsResponse'
{ $sel:items:ListPlaybackConfigurationsResponse' :: Maybe [PlaybackConfiguration]
items =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListPlaybackConfigurationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListPlaybackConfigurationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listPlaybackConfigurationsResponse_items :: Lens.Lens' ListPlaybackConfigurationsResponse (Prelude.Maybe [PlaybackConfiguration])
listPlaybackConfigurationsResponse_items :: Lens'
ListPlaybackConfigurationsResponse (Maybe [PlaybackConfiguration])
listPlaybackConfigurationsResponse_items = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listPlaybackConfigurationsResponse_nextToken :: Lens.Lens' ListPlaybackConfigurationsResponse (Prelude.Maybe Prelude.Text)
listPlaybackConfigurationsResponse_nextToken :: Lens' ListPlaybackConfigurationsResponse (Maybe Text)
listPlaybackConfigurationsResponse_nextToken = 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)
listPlaybackConfigurationsResponse_httpStatus :: Lens.Lens' ListPlaybackConfigurationsResponse Prelude.Int
listPlaybackConfigurationsResponse_httpStatus :: Lens' ListPlaybackConfigurationsResponse Int
listPlaybackConfigurationsResponse_httpStatus = 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
where
rnf :: ListPlaybackConfigurationsResponse -> ()
rnf ListPlaybackConfigurationsResponse' {Int
Maybe [PlaybackConfiguration]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
items :: Maybe [PlaybackConfiguration]
$sel:httpStatus:ListPlaybackConfigurationsResponse' :: ListPlaybackConfigurationsResponse -> Int
$sel:nextToken:ListPlaybackConfigurationsResponse' :: ListPlaybackConfigurationsResponse -> Maybe Text
$sel:items:ListPlaybackConfigurationsResponse' :: ListPlaybackConfigurationsResponse -> Maybe [PlaybackConfiguration]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [PlaybackConfiguration]
items
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus