{-# 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.CloudFront.ListStreamingDistributions
(
ListStreamingDistributions (..),
newListStreamingDistributions,
listStreamingDistributions_marker,
listStreamingDistributions_maxItems,
ListStreamingDistributionsResponse (..),
newListStreamingDistributionsResponse,
listStreamingDistributionsResponse_httpStatus,
listStreamingDistributionsResponse_streamingDistributionList,
)
where
import Amazonka.CloudFront.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListStreamingDistributions = ListStreamingDistributions'
{
ListStreamingDistributions -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListStreamingDistributions -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text
}
deriving (ListStreamingDistributions -> ListStreamingDistributions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStreamingDistributions -> ListStreamingDistributions -> Bool
$c/= :: ListStreamingDistributions -> ListStreamingDistributions -> Bool
== :: ListStreamingDistributions -> ListStreamingDistributions -> Bool
$c== :: ListStreamingDistributions -> ListStreamingDistributions -> Bool
Prelude.Eq, ReadPrec [ListStreamingDistributions]
ReadPrec ListStreamingDistributions
Int -> ReadS ListStreamingDistributions
ReadS [ListStreamingDistributions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStreamingDistributions]
$creadListPrec :: ReadPrec [ListStreamingDistributions]
readPrec :: ReadPrec ListStreamingDistributions
$creadPrec :: ReadPrec ListStreamingDistributions
readList :: ReadS [ListStreamingDistributions]
$creadList :: ReadS [ListStreamingDistributions]
readsPrec :: Int -> ReadS ListStreamingDistributions
$creadsPrec :: Int -> ReadS ListStreamingDistributions
Prelude.Read, Int -> ListStreamingDistributions -> ShowS
[ListStreamingDistributions] -> ShowS
ListStreamingDistributions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStreamingDistributions] -> ShowS
$cshowList :: [ListStreamingDistributions] -> ShowS
show :: ListStreamingDistributions -> String
$cshow :: ListStreamingDistributions -> String
showsPrec :: Int -> ListStreamingDistributions -> ShowS
$cshowsPrec :: Int -> ListStreamingDistributions -> ShowS
Prelude.Show, forall x.
Rep ListStreamingDistributions x -> ListStreamingDistributions
forall x.
ListStreamingDistributions -> Rep ListStreamingDistributions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListStreamingDistributions x -> ListStreamingDistributions
$cfrom :: forall x.
ListStreamingDistributions -> Rep ListStreamingDistributions x
Prelude.Generic)
newListStreamingDistributions ::
ListStreamingDistributions
newListStreamingDistributions :: ListStreamingDistributions
newListStreamingDistributions =
ListStreamingDistributions'
{ $sel:marker:ListStreamingDistributions' :: Maybe Text
marker =
forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListStreamingDistributions' :: Maybe Text
maxItems = forall a. Maybe a
Prelude.Nothing
}
listStreamingDistributions_marker :: Lens.Lens' ListStreamingDistributions (Prelude.Maybe Prelude.Text)
listStreamingDistributions_marker :: Lens' ListStreamingDistributions (Maybe Text)
listStreamingDistributions_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingDistributions' {Maybe Text
marker :: Maybe Text
$sel:marker:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListStreamingDistributions
s@ListStreamingDistributions' {} Maybe Text
a -> ListStreamingDistributions
s {$sel:marker:ListStreamingDistributions' :: Maybe Text
marker = Maybe Text
a} :: ListStreamingDistributions)
listStreamingDistributions_maxItems :: Lens.Lens' ListStreamingDistributions (Prelude.Maybe Prelude.Text)
listStreamingDistributions_maxItems :: Lens' ListStreamingDistributions (Maybe Text)
listStreamingDistributions_maxItems = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingDistributions' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListStreamingDistributions
s@ListStreamingDistributions' {} Maybe Text
a -> ListStreamingDistributions
s {$sel:maxItems:ListStreamingDistributions' :: Maybe Text
maxItems = Maybe Text
a} :: ListStreamingDistributions)
instance Core.AWSPager ListStreamingDistributions where
page :: ListStreamingDistributions
-> AWSResponse ListStreamingDistributions
-> Maybe ListStreamingDistributions
page ListStreamingDistributions
rq AWSResponse ListStreamingDistributions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListStreamingDistributions
rs
forall s a. s -> Getting a s a -> a
Lens.^. Lens' ListStreamingDistributionsResponse StreamingDistributionList
listStreamingDistributionsResponse_streamingDistributionList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Lens' StreamingDistributionList Bool
streamingDistributionList_isTruncated
) =
forall a. Maybe a
Prelude.Nothing
| forall a. Maybe a -> Bool
Prelude.isNothing
( AWSResponse ListStreamingDistributions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStreamingDistributionsResponse StreamingDistributionList
listStreamingDistributionsResponse_streamingDistributionList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Lens' StreamingDistributionList (Maybe Text)
streamingDistributionList_nextMarker
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.$ ListStreamingDistributions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListStreamingDistributions (Maybe Text)
listStreamingDistributions_marker
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListStreamingDistributions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListStreamingDistributionsResponse StreamingDistributionList
listStreamingDistributionsResponse_streamingDistributionList
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Lens' StreamingDistributionList (Maybe Text)
streamingDistributionList_nextMarker
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 ListStreamingDistributions where
type
AWSResponse ListStreamingDistributions =
ListStreamingDistributionsResponse
request :: (Service -> Service)
-> ListStreamingDistributions -> Request ListStreamingDistributions
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 ListStreamingDistributions
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListStreamingDistributions)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Int
-> StreamingDistributionList -> ListStreamingDistributionsResponse
ListStreamingDistributionsResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
)
instance Prelude.Hashable ListStreamingDistributions where
hashWithSalt :: Int -> ListStreamingDistributions -> Int
hashWithSalt Int
_salt ListStreamingDistributions' {Maybe Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:maxItems:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
$sel:marker:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxItems
instance Prelude.NFData ListStreamingDistributions where
rnf :: ListStreamingDistributions -> ()
rnf ListStreamingDistributions' {Maybe Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:maxItems:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
$sel:marker:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxItems
instance Data.ToHeaders ListStreamingDistributions where
toHeaders :: ListStreamingDistributions -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath ListStreamingDistributions where
toPath :: ListStreamingDistributions -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/2020-05-31/streaming-distribution"
instance Data.ToQuery ListStreamingDistributions where
toQuery :: ListStreamingDistributions -> QueryString
toQuery ListStreamingDistributions' {Maybe Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:maxItems:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
$sel:marker:ListStreamingDistributions' :: ListStreamingDistributions -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxItems
]
data ListStreamingDistributionsResponse = ListStreamingDistributionsResponse'
{
ListStreamingDistributionsResponse -> Int
httpStatus :: Prelude.Int,
ListStreamingDistributionsResponse -> StreamingDistributionList
streamingDistributionList :: StreamingDistributionList
}
deriving (ListStreamingDistributionsResponse
-> ListStreamingDistributionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListStreamingDistributionsResponse
-> ListStreamingDistributionsResponse -> Bool
$c/= :: ListStreamingDistributionsResponse
-> ListStreamingDistributionsResponse -> Bool
== :: ListStreamingDistributionsResponse
-> ListStreamingDistributionsResponse -> Bool
$c== :: ListStreamingDistributionsResponse
-> ListStreamingDistributionsResponse -> Bool
Prelude.Eq, ReadPrec [ListStreamingDistributionsResponse]
ReadPrec ListStreamingDistributionsResponse
Int -> ReadS ListStreamingDistributionsResponse
ReadS [ListStreamingDistributionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListStreamingDistributionsResponse]
$creadListPrec :: ReadPrec [ListStreamingDistributionsResponse]
readPrec :: ReadPrec ListStreamingDistributionsResponse
$creadPrec :: ReadPrec ListStreamingDistributionsResponse
readList :: ReadS [ListStreamingDistributionsResponse]
$creadList :: ReadS [ListStreamingDistributionsResponse]
readsPrec :: Int -> ReadS ListStreamingDistributionsResponse
$creadsPrec :: Int -> ReadS ListStreamingDistributionsResponse
Prelude.Read, Int -> ListStreamingDistributionsResponse -> ShowS
[ListStreamingDistributionsResponse] -> ShowS
ListStreamingDistributionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListStreamingDistributionsResponse] -> ShowS
$cshowList :: [ListStreamingDistributionsResponse] -> ShowS
show :: ListStreamingDistributionsResponse -> String
$cshow :: ListStreamingDistributionsResponse -> String
showsPrec :: Int -> ListStreamingDistributionsResponse -> ShowS
$cshowsPrec :: Int -> ListStreamingDistributionsResponse -> ShowS
Prelude.Show, forall x.
Rep ListStreamingDistributionsResponse x
-> ListStreamingDistributionsResponse
forall x.
ListStreamingDistributionsResponse
-> Rep ListStreamingDistributionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListStreamingDistributionsResponse x
-> ListStreamingDistributionsResponse
$cfrom :: forall x.
ListStreamingDistributionsResponse
-> Rep ListStreamingDistributionsResponse x
Prelude.Generic)
newListStreamingDistributionsResponse ::
Prelude.Int ->
StreamingDistributionList ->
ListStreamingDistributionsResponse
newListStreamingDistributionsResponse :: Int
-> StreamingDistributionList -> ListStreamingDistributionsResponse
newListStreamingDistributionsResponse
Int
pHttpStatus_
StreamingDistributionList
pStreamingDistributionList_ =
ListStreamingDistributionsResponse'
{ $sel:httpStatus:ListStreamingDistributionsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:streamingDistributionList:ListStreamingDistributionsResponse' :: StreamingDistributionList
streamingDistributionList =
StreamingDistributionList
pStreamingDistributionList_
}
listStreamingDistributionsResponse_httpStatus :: Lens.Lens' ListStreamingDistributionsResponse Prelude.Int
listStreamingDistributionsResponse_httpStatus :: Lens' ListStreamingDistributionsResponse Int
listStreamingDistributionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingDistributionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListStreamingDistributionsResponse' :: ListStreamingDistributionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListStreamingDistributionsResponse
s@ListStreamingDistributionsResponse' {} Int
a -> ListStreamingDistributionsResponse
s {$sel:httpStatus:ListStreamingDistributionsResponse' :: Int
httpStatus = Int
a} :: ListStreamingDistributionsResponse)
listStreamingDistributionsResponse_streamingDistributionList :: Lens.Lens' ListStreamingDistributionsResponse StreamingDistributionList
listStreamingDistributionsResponse_streamingDistributionList :: Lens' ListStreamingDistributionsResponse StreamingDistributionList
listStreamingDistributionsResponse_streamingDistributionList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListStreamingDistributionsResponse' {StreamingDistributionList
streamingDistributionList :: StreamingDistributionList
$sel:streamingDistributionList:ListStreamingDistributionsResponse' :: ListStreamingDistributionsResponse -> StreamingDistributionList
streamingDistributionList} -> StreamingDistributionList
streamingDistributionList) (\s :: ListStreamingDistributionsResponse
s@ListStreamingDistributionsResponse' {} StreamingDistributionList
a -> ListStreamingDistributionsResponse
s {$sel:streamingDistributionList:ListStreamingDistributionsResponse' :: StreamingDistributionList
streamingDistributionList = StreamingDistributionList
a} :: ListStreamingDistributionsResponse)
instance
Prelude.NFData
ListStreamingDistributionsResponse
where
rnf :: ListStreamingDistributionsResponse -> ()
rnf ListStreamingDistributionsResponse' {Int
StreamingDistributionList
streamingDistributionList :: StreamingDistributionList
httpStatus :: Int
$sel:streamingDistributionList:ListStreamingDistributionsResponse' :: ListStreamingDistributionsResponse -> StreamingDistributionList
$sel:httpStatus:ListStreamingDistributionsResponse' :: ListStreamingDistributionsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf StreamingDistributionList
streamingDistributionList