{-# 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.Firehose.ListDeliveryStreams
(
ListDeliveryStreams (..),
newListDeliveryStreams,
listDeliveryStreams_deliveryStreamType,
listDeliveryStreams_exclusiveStartDeliveryStreamName,
listDeliveryStreams_limit,
ListDeliveryStreamsResponse (..),
newListDeliveryStreamsResponse,
listDeliveryStreamsResponse_httpStatus,
listDeliveryStreamsResponse_deliveryStreamNames,
listDeliveryStreamsResponse_hasMoreDeliveryStreams,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Firehose.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListDeliveryStreams = ListDeliveryStreams'
{
ListDeliveryStreams -> Maybe DeliveryStreamType
deliveryStreamType :: Prelude.Maybe DeliveryStreamType,
ListDeliveryStreams -> Maybe Text
exclusiveStartDeliveryStreamName :: Prelude.Maybe Prelude.Text,
ListDeliveryStreams -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural
}
deriving (ListDeliveryStreams -> ListDeliveryStreams -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeliveryStreams -> ListDeliveryStreams -> Bool
$c/= :: ListDeliveryStreams -> ListDeliveryStreams -> Bool
== :: ListDeliveryStreams -> ListDeliveryStreams -> Bool
$c== :: ListDeliveryStreams -> ListDeliveryStreams -> Bool
Prelude.Eq, ReadPrec [ListDeliveryStreams]
ReadPrec ListDeliveryStreams
Int -> ReadS ListDeliveryStreams
ReadS [ListDeliveryStreams]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeliveryStreams]
$creadListPrec :: ReadPrec [ListDeliveryStreams]
readPrec :: ReadPrec ListDeliveryStreams
$creadPrec :: ReadPrec ListDeliveryStreams
readList :: ReadS [ListDeliveryStreams]
$creadList :: ReadS [ListDeliveryStreams]
readsPrec :: Int -> ReadS ListDeliveryStreams
$creadsPrec :: Int -> ReadS ListDeliveryStreams
Prelude.Read, Int -> ListDeliveryStreams -> ShowS
[ListDeliveryStreams] -> ShowS
ListDeliveryStreams -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeliveryStreams] -> ShowS
$cshowList :: [ListDeliveryStreams] -> ShowS
show :: ListDeliveryStreams -> String
$cshow :: ListDeliveryStreams -> String
showsPrec :: Int -> ListDeliveryStreams -> ShowS
$cshowsPrec :: Int -> ListDeliveryStreams -> ShowS
Prelude.Show, forall x. Rep ListDeliveryStreams x -> ListDeliveryStreams
forall x. ListDeliveryStreams -> Rep ListDeliveryStreams x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDeliveryStreams x -> ListDeliveryStreams
$cfrom :: forall x. ListDeliveryStreams -> Rep ListDeliveryStreams x
Prelude.Generic)
newListDeliveryStreams ::
ListDeliveryStreams
newListDeliveryStreams :: ListDeliveryStreams
newListDeliveryStreams =
ListDeliveryStreams'
{ $sel:deliveryStreamType:ListDeliveryStreams' :: Maybe DeliveryStreamType
deliveryStreamType =
forall a. Maybe a
Prelude.Nothing,
$sel:exclusiveStartDeliveryStreamName:ListDeliveryStreams' :: Maybe Text
exclusiveStartDeliveryStreamName = forall a. Maybe a
Prelude.Nothing,
$sel:limit:ListDeliveryStreams' :: Maybe Natural
limit = forall a. Maybe a
Prelude.Nothing
}
listDeliveryStreams_deliveryStreamType :: Lens.Lens' ListDeliveryStreams (Prelude.Maybe DeliveryStreamType)
listDeliveryStreams_deliveryStreamType :: Lens' ListDeliveryStreams (Maybe DeliveryStreamType)
listDeliveryStreams_deliveryStreamType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliveryStreams' {Maybe DeliveryStreamType
deliveryStreamType :: Maybe DeliveryStreamType
$sel:deliveryStreamType:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe DeliveryStreamType
deliveryStreamType} -> Maybe DeliveryStreamType
deliveryStreamType) (\s :: ListDeliveryStreams
s@ListDeliveryStreams' {} Maybe DeliveryStreamType
a -> ListDeliveryStreams
s {$sel:deliveryStreamType:ListDeliveryStreams' :: Maybe DeliveryStreamType
deliveryStreamType = Maybe DeliveryStreamType
a} :: ListDeliveryStreams)
listDeliveryStreams_exclusiveStartDeliveryStreamName :: Lens.Lens' ListDeliveryStreams (Prelude.Maybe Prelude.Text)
listDeliveryStreams_exclusiveStartDeliveryStreamName :: Lens' ListDeliveryStreams (Maybe Text)
listDeliveryStreams_exclusiveStartDeliveryStreamName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliveryStreams' {Maybe Text
exclusiveStartDeliveryStreamName :: Maybe Text
$sel:exclusiveStartDeliveryStreamName:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Text
exclusiveStartDeliveryStreamName} -> Maybe Text
exclusiveStartDeliveryStreamName) (\s :: ListDeliveryStreams
s@ListDeliveryStreams' {} Maybe Text
a -> ListDeliveryStreams
s {$sel:exclusiveStartDeliveryStreamName:ListDeliveryStreams' :: Maybe Text
exclusiveStartDeliveryStreamName = Maybe Text
a} :: ListDeliveryStreams)
listDeliveryStreams_limit :: Lens.Lens' ListDeliveryStreams (Prelude.Maybe Prelude.Natural)
listDeliveryStreams_limit :: Lens' ListDeliveryStreams (Maybe Natural)
listDeliveryStreams_limit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliveryStreams' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListDeliveryStreams
s@ListDeliveryStreams' {} Maybe Natural
a -> ListDeliveryStreams
s {$sel:limit:ListDeliveryStreams' :: Maybe Natural
limit = Maybe Natural
a} :: ListDeliveryStreams)
instance Core.AWSRequest ListDeliveryStreams where
type
AWSResponse ListDeliveryStreams =
ListDeliveryStreamsResponse
request :: (Service -> Service)
-> ListDeliveryStreams -> Request ListDeliveryStreams
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListDeliveryStreams
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDeliveryStreams)))
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 ->
Int -> [Text] -> Bool -> ListDeliveryStreamsResponse
ListDeliveryStreamsResponse'
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.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"DeliveryStreamNames"
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 a
Data..:> Key
"HasMoreDeliveryStreams")
)
instance Prelude.Hashable ListDeliveryStreams where
hashWithSalt :: Int -> ListDeliveryStreams -> Int
hashWithSalt Int
_salt ListDeliveryStreams' {Maybe Natural
Maybe Text
Maybe DeliveryStreamType
limit :: Maybe Natural
exclusiveStartDeliveryStreamName :: Maybe Text
deliveryStreamType :: Maybe DeliveryStreamType
$sel:limit:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Natural
$sel:exclusiveStartDeliveryStreamName:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Text
$sel:deliveryStreamType:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe DeliveryStreamType
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeliveryStreamType
deliveryStreamType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
exclusiveStartDeliveryStreamName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
limit
instance Prelude.NFData ListDeliveryStreams where
rnf :: ListDeliveryStreams -> ()
rnf ListDeliveryStreams' {Maybe Natural
Maybe Text
Maybe DeliveryStreamType
limit :: Maybe Natural
exclusiveStartDeliveryStreamName :: Maybe Text
deliveryStreamType :: Maybe DeliveryStreamType
$sel:limit:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Natural
$sel:exclusiveStartDeliveryStreamName:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Text
$sel:deliveryStreamType:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe DeliveryStreamType
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DeliveryStreamType
deliveryStreamType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
exclusiveStartDeliveryStreamName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
limit
instance Data.ToHeaders ListDeliveryStreams where
toHeaders :: ListDeliveryStreams -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Firehose_20150804.ListDeliveryStreams" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListDeliveryStreams where
toJSON :: ListDeliveryStreams -> Value
toJSON ListDeliveryStreams' {Maybe Natural
Maybe Text
Maybe DeliveryStreamType
limit :: Maybe Natural
exclusiveStartDeliveryStreamName :: Maybe Text
deliveryStreamType :: Maybe DeliveryStreamType
$sel:limit:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Natural
$sel:exclusiveStartDeliveryStreamName:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe Text
$sel:deliveryStreamType:ListDeliveryStreams' :: ListDeliveryStreams -> Maybe DeliveryStreamType
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DeliveryStreamType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeliveryStreamType
deliveryStreamType,
(Key
"ExclusiveStartDeliveryStreamName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
exclusiveStartDeliveryStreamName,
(Key
"Limit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit
]
)
instance Data.ToPath ListDeliveryStreams where
toPath :: ListDeliveryStreams -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListDeliveryStreams where
toQuery :: ListDeliveryStreams -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListDeliveryStreamsResponse = ListDeliveryStreamsResponse'
{
ListDeliveryStreamsResponse -> Int
httpStatus :: Prelude.Int,
ListDeliveryStreamsResponse -> [Text]
deliveryStreamNames :: [Prelude.Text],
ListDeliveryStreamsResponse -> Bool
hasMoreDeliveryStreams :: Prelude.Bool
}
deriving (ListDeliveryStreamsResponse -> ListDeliveryStreamsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDeliveryStreamsResponse -> ListDeliveryStreamsResponse -> Bool
$c/= :: ListDeliveryStreamsResponse -> ListDeliveryStreamsResponse -> Bool
== :: ListDeliveryStreamsResponse -> ListDeliveryStreamsResponse -> Bool
$c== :: ListDeliveryStreamsResponse -> ListDeliveryStreamsResponse -> Bool
Prelude.Eq, ReadPrec [ListDeliveryStreamsResponse]
ReadPrec ListDeliveryStreamsResponse
Int -> ReadS ListDeliveryStreamsResponse
ReadS [ListDeliveryStreamsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDeliveryStreamsResponse]
$creadListPrec :: ReadPrec [ListDeliveryStreamsResponse]
readPrec :: ReadPrec ListDeliveryStreamsResponse
$creadPrec :: ReadPrec ListDeliveryStreamsResponse
readList :: ReadS [ListDeliveryStreamsResponse]
$creadList :: ReadS [ListDeliveryStreamsResponse]
readsPrec :: Int -> ReadS ListDeliveryStreamsResponse
$creadsPrec :: Int -> ReadS ListDeliveryStreamsResponse
Prelude.Read, Int -> ListDeliveryStreamsResponse -> ShowS
[ListDeliveryStreamsResponse] -> ShowS
ListDeliveryStreamsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDeliveryStreamsResponse] -> ShowS
$cshowList :: [ListDeliveryStreamsResponse] -> ShowS
show :: ListDeliveryStreamsResponse -> String
$cshow :: ListDeliveryStreamsResponse -> String
showsPrec :: Int -> ListDeliveryStreamsResponse -> ShowS
$cshowsPrec :: Int -> ListDeliveryStreamsResponse -> ShowS
Prelude.Show, forall x.
Rep ListDeliveryStreamsResponse x -> ListDeliveryStreamsResponse
forall x.
ListDeliveryStreamsResponse -> Rep ListDeliveryStreamsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDeliveryStreamsResponse x -> ListDeliveryStreamsResponse
$cfrom :: forall x.
ListDeliveryStreamsResponse -> Rep ListDeliveryStreamsResponse x
Prelude.Generic)
newListDeliveryStreamsResponse ::
Prelude.Int ->
Prelude.Bool ->
ListDeliveryStreamsResponse
newListDeliveryStreamsResponse :: Int -> Bool -> ListDeliveryStreamsResponse
newListDeliveryStreamsResponse
Int
pHttpStatus_
Bool
pHasMoreDeliveryStreams_ =
ListDeliveryStreamsResponse'
{ $sel:httpStatus:ListDeliveryStreamsResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:deliveryStreamNames:ListDeliveryStreamsResponse' :: [Text]
deliveryStreamNames = forall a. Monoid a => a
Prelude.mempty,
$sel:hasMoreDeliveryStreams:ListDeliveryStreamsResponse' :: Bool
hasMoreDeliveryStreams =
Bool
pHasMoreDeliveryStreams_
}
listDeliveryStreamsResponse_httpStatus :: Lens.Lens' ListDeliveryStreamsResponse Prelude.Int
listDeliveryStreamsResponse_httpStatus :: Lens' ListDeliveryStreamsResponse Int
listDeliveryStreamsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliveryStreamsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDeliveryStreamsResponse' :: ListDeliveryStreamsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDeliveryStreamsResponse
s@ListDeliveryStreamsResponse' {} Int
a -> ListDeliveryStreamsResponse
s {$sel:httpStatus:ListDeliveryStreamsResponse' :: Int
httpStatus = Int
a} :: ListDeliveryStreamsResponse)
listDeliveryStreamsResponse_deliveryStreamNames :: Lens.Lens' ListDeliveryStreamsResponse [Prelude.Text]
listDeliveryStreamsResponse_deliveryStreamNames :: Lens' ListDeliveryStreamsResponse [Text]
listDeliveryStreamsResponse_deliveryStreamNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliveryStreamsResponse' {[Text]
deliveryStreamNames :: [Text]
$sel:deliveryStreamNames:ListDeliveryStreamsResponse' :: ListDeliveryStreamsResponse -> [Text]
deliveryStreamNames} -> [Text]
deliveryStreamNames) (\s :: ListDeliveryStreamsResponse
s@ListDeliveryStreamsResponse' {} [Text]
a -> ListDeliveryStreamsResponse
s {$sel:deliveryStreamNames:ListDeliveryStreamsResponse' :: [Text]
deliveryStreamNames = [Text]
a} :: ListDeliveryStreamsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listDeliveryStreamsResponse_hasMoreDeliveryStreams :: Lens.Lens' ListDeliveryStreamsResponse Prelude.Bool
listDeliveryStreamsResponse_hasMoreDeliveryStreams :: Lens' ListDeliveryStreamsResponse Bool
listDeliveryStreamsResponse_hasMoreDeliveryStreams = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDeliveryStreamsResponse' {Bool
hasMoreDeliveryStreams :: Bool
$sel:hasMoreDeliveryStreams:ListDeliveryStreamsResponse' :: ListDeliveryStreamsResponse -> Bool
hasMoreDeliveryStreams} -> Bool
hasMoreDeliveryStreams) (\s :: ListDeliveryStreamsResponse
s@ListDeliveryStreamsResponse' {} Bool
a -> ListDeliveryStreamsResponse
s {$sel:hasMoreDeliveryStreams:ListDeliveryStreamsResponse' :: Bool
hasMoreDeliveryStreams = Bool
a} :: ListDeliveryStreamsResponse)
instance Prelude.NFData ListDeliveryStreamsResponse where
rnf :: ListDeliveryStreamsResponse -> ()
rnf ListDeliveryStreamsResponse' {Bool
Int
[Text]
hasMoreDeliveryStreams :: Bool
deliveryStreamNames :: [Text]
httpStatus :: Int
$sel:hasMoreDeliveryStreams:ListDeliveryStreamsResponse' :: ListDeliveryStreamsResponse -> Bool
$sel:deliveryStreamNames:ListDeliveryStreamsResponse' :: ListDeliveryStreamsResponse -> [Text]
$sel:httpStatus:ListDeliveryStreamsResponse' :: ListDeliveryStreamsResponse -> 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 [Text]
deliveryStreamNames
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
hasMoreDeliveryStreams