{-# 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.DescribeDeliveryStream
(
DescribeDeliveryStream (..),
newDescribeDeliveryStream,
describeDeliveryStream_exclusiveStartDestinationId,
describeDeliveryStream_limit,
describeDeliveryStream_deliveryStreamName,
DescribeDeliveryStreamResponse (..),
newDescribeDeliveryStreamResponse,
describeDeliveryStreamResponse_httpStatus,
describeDeliveryStreamResponse_deliveryStreamDescription,
)
where
import qualified Amazonka.Core as Core
import Amazonka.Firehose.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DescribeDeliveryStream = DescribeDeliveryStream'
{
DescribeDeliveryStream -> Maybe Text
exclusiveStartDestinationId :: Prelude.Maybe Prelude.Text,
DescribeDeliveryStream -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
DescribeDeliveryStream -> Text
deliveryStreamName :: Prelude.Text
}
deriving (DescribeDeliveryStream -> DescribeDeliveryStream -> Bool
(DescribeDeliveryStream -> DescribeDeliveryStream -> Bool)
-> (DescribeDeliveryStream -> DescribeDeliveryStream -> Bool)
-> Eq DescribeDeliveryStream
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDeliveryStream -> DescribeDeliveryStream -> Bool
$c/= :: DescribeDeliveryStream -> DescribeDeliveryStream -> Bool
== :: DescribeDeliveryStream -> DescribeDeliveryStream -> Bool
$c== :: DescribeDeliveryStream -> DescribeDeliveryStream -> Bool
Prelude.Eq, ReadPrec [DescribeDeliveryStream]
ReadPrec DescribeDeliveryStream
Int -> ReadS DescribeDeliveryStream
ReadS [DescribeDeliveryStream]
(Int -> ReadS DescribeDeliveryStream)
-> ReadS [DescribeDeliveryStream]
-> ReadPrec DescribeDeliveryStream
-> ReadPrec [DescribeDeliveryStream]
-> Read DescribeDeliveryStream
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDeliveryStream]
$creadListPrec :: ReadPrec [DescribeDeliveryStream]
readPrec :: ReadPrec DescribeDeliveryStream
$creadPrec :: ReadPrec DescribeDeliveryStream
readList :: ReadS [DescribeDeliveryStream]
$creadList :: ReadS [DescribeDeliveryStream]
readsPrec :: Int -> ReadS DescribeDeliveryStream
$creadsPrec :: Int -> ReadS DescribeDeliveryStream
Prelude.Read, Int -> DescribeDeliveryStream -> ShowS
[DescribeDeliveryStream] -> ShowS
DescribeDeliveryStream -> String
(Int -> DescribeDeliveryStream -> ShowS)
-> (DescribeDeliveryStream -> String)
-> ([DescribeDeliveryStream] -> ShowS)
-> Show DescribeDeliveryStream
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDeliveryStream] -> ShowS
$cshowList :: [DescribeDeliveryStream] -> ShowS
show :: DescribeDeliveryStream -> String
$cshow :: DescribeDeliveryStream -> String
showsPrec :: Int -> DescribeDeliveryStream -> ShowS
$cshowsPrec :: Int -> DescribeDeliveryStream -> ShowS
Prelude.Show, (forall x. DescribeDeliveryStream -> Rep DescribeDeliveryStream x)
-> (forall x.
Rep DescribeDeliveryStream x -> DescribeDeliveryStream)
-> Generic DescribeDeliveryStream
forall x. Rep DescribeDeliveryStream x -> DescribeDeliveryStream
forall x. DescribeDeliveryStream -> Rep DescribeDeliveryStream x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDeliveryStream x -> DescribeDeliveryStream
$cfrom :: forall x. DescribeDeliveryStream -> Rep DescribeDeliveryStream x
Prelude.Generic)
newDescribeDeliveryStream ::
Prelude.Text ->
DescribeDeliveryStream
newDescribeDeliveryStream :: Text -> DescribeDeliveryStream
newDescribeDeliveryStream Text
pDeliveryStreamName_ =
DescribeDeliveryStream' :: Maybe Text -> Maybe Natural -> Text -> DescribeDeliveryStream
DescribeDeliveryStream'
{ $sel:exclusiveStartDestinationId:DescribeDeliveryStream' :: Maybe Text
exclusiveStartDestinationId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:DescribeDeliveryStream' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:deliveryStreamName:DescribeDeliveryStream' :: Text
deliveryStreamName = Text
pDeliveryStreamName_
}
describeDeliveryStream_exclusiveStartDestinationId :: Lens.Lens' DescribeDeliveryStream (Prelude.Maybe Prelude.Text)
describeDeliveryStream_exclusiveStartDestinationId :: (Maybe Text -> f (Maybe Text))
-> DescribeDeliveryStream -> f DescribeDeliveryStream
describeDeliveryStream_exclusiveStartDestinationId = (DescribeDeliveryStream -> Maybe Text)
-> (DescribeDeliveryStream -> Maybe Text -> DescribeDeliveryStream)
-> Lens
DescribeDeliveryStream
DescribeDeliveryStream
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeliveryStream' {Maybe Text
exclusiveStartDestinationId :: Maybe Text
$sel:exclusiveStartDestinationId:DescribeDeliveryStream' :: DescribeDeliveryStream -> Maybe Text
exclusiveStartDestinationId} -> Maybe Text
exclusiveStartDestinationId) (\s :: DescribeDeliveryStream
s@DescribeDeliveryStream' {} Maybe Text
a -> DescribeDeliveryStream
s {$sel:exclusiveStartDestinationId:DescribeDeliveryStream' :: Maybe Text
exclusiveStartDestinationId = Maybe Text
a} :: DescribeDeliveryStream)
describeDeliveryStream_limit :: Lens.Lens' DescribeDeliveryStream (Prelude.Maybe Prelude.Natural)
describeDeliveryStream_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeDeliveryStream -> f DescribeDeliveryStream
describeDeliveryStream_limit = (DescribeDeliveryStream -> Maybe Natural)
-> (DescribeDeliveryStream
-> Maybe Natural -> DescribeDeliveryStream)
-> Lens
DescribeDeliveryStream
DescribeDeliveryStream
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeliveryStream' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeDeliveryStream' :: DescribeDeliveryStream -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeDeliveryStream
s@DescribeDeliveryStream' {} Maybe Natural
a -> DescribeDeliveryStream
s {$sel:limit:DescribeDeliveryStream' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeDeliveryStream)
describeDeliveryStream_deliveryStreamName :: Lens.Lens' DescribeDeliveryStream Prelude.Text
describeDeliveryStream_deliveryStreamName :: (Text -> f Text)
-> DescribeDeliveryStream -> f DescribeDeliveryStream
describeDeliveryStream_deliveryStreamName = (DescribeDeliveryStream -> Text)
-> (DescribeDeliveryStream -> Text -> DescribeDeliveryStream)
-> Lens DescribeDeliveryStream DescribeDeliveryStream Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeliveryStream' {Text
deliveryStreamName :: Text
$sel:deliveryStreamName:DescribeDeliveryStream' :: DescribeDeliveryStream -> Text
deliveryStreamName} -> Text
deliveryStreamName) (\s :: DescribeDeliveryStream
s@DescribeDeliveryStream' {} Text
a -> DescribeDeliveryStream
s {$sel:deliveryStreamName:DescribeDeliveryStream' :: Text
deliveryStreamName = Text
a} :: DescribeDeliveryStream)
instance Core.AWSRequest DescribeDeliveryStream where
type
AWSResponse DescribeDeliveryStream =
DescribeDeliveryStreamResponse
request :: DescribeDeliveryStream -> Request DescribeDeliveryStream
request = Service -> DescribeDeliveryStream -> Request DescribeDeliveryStream
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DescribeDeliveryStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDeliveryStream)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DescribeDeliveryStream))
-> Logger
-> Service
-> Proxy DescribeDeliveryStream
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DescribeDeliveryStream)))
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 ->
Int -> DeliveryStreamDescription -> DescribeDeliveryStreamResponse
DescribeDeliveryStreamResponse'
(Int
-> DeliveryStreamDescription -> DescribeDeliveryStreamResponse)
-> Either String Int
-> Either
String
(DeliveryStreamDescription -> DescribeDeliveryStreamResponse)
forall (f :: * -> *) a b. Functor 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))
Either
String
(DeliveryStreamDescription -> DescribeDeliveryStreamResponse)
-> Either String DeliveryStreamDescription
-> Either String DescribeDeliveryStreamResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DeliveryStreamDescription
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"DeliveryStreamDescription")
)
instance Prelude.Hashable DescribeDeliveryStream
instance Prelude.NFData DescribeDeliveryStream
instance Core.ToHeaders DescribeDeliveryStream where
toHeaders :: DescribeDeliveryStream -> ResponseHeaders
toHeaders =
ResponseHeaders -> DescribeDeliveryStream -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Firehose_20150804.DescribeDeliveryStream" ::
Prelude.ByteString
),
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.ToJSON DescribeDeliveryStream where
toJSON :: DescribeDeliveryStream -> Value
toJSON DescribeDeliveryStream' {Maybe Natural
Maybe Text
Text
deliveryStreamName :: Text
limit :: Maybe Natural
exclusiveStartDestinationId :: Maybe Text
$sel:deliveryStreamName:DescribeDeliveryStream' :: DescribeDeliveryStream -> Text
$sel:limit:DescribeDeliveryStream' :: DescribeDeliveryStream -> Maybe Natural
$sel:exclusiveStartDestinationId:DescribeDeliveryStream' :: DescribeDeliveryStream -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ExclusiveStartDestinationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
exclusiveStartDestinationId,
(Text
"Limit" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
limit,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DeliveryStreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deliveryStreamName)
]
)
instance Core.ToPath DescribeDeliveryStream where
toPath :: DescribeDeliveryStream -> ByteString
toPath = ByteString -> DescribeDeliveryStream -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DescribeDeliveryStream where
toQuery :: DescribeDeliveryStream -> QueryString
toQuery = QueryString -> DescribeDeliveryStream -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DescribeDeliveryStreamResponse = DescribeDeliveryStreamResponse'
{
DescribeDeliveryStreamResponse -> Int
httpStatus :: Prelude.Int,
DescribeDeliveryStreamResponse -> DeliveryStreamDescription
deliveryStreamDescription :: DeliveryStreamDescription
}
deriving (DescribeDeliveryStreamResponse
-> DescribeDeliveryStreamResponse -> Bool
(DescribeDeliveryStreamResponse
-> DescribeDeliveryStreamResponse -> Bool)
-> (DescribeDeliveryStreamResponse
-> DescribeDeliveryStreamResponse -> Bool)
-> Eq DescribeDeliveryStreamResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDeliveryStreamResponse
-> DescribeDeliveryStreamResponse -> Bool
$c/= :: DescribeDeliveryStreamResponse
-> DescribeDeliveryStreamResponse -> Bool
== :: DescribeDeliveryStreamResponse
-> DescribeDeliveryStreamResponse -> Bool
$c== :: DescribeDeliveryStreamResponse
-> DescribeDeliveryStreamResponse -> Bool
Prelude.Eq, Int -> DescribeDeliveryStreamResponse -> ShowS
[DescribeDeliveryStreamResponse] -> ShowS
DescribeDeliveryStreamResponse -> String
(Int -> DescribeDeliveryStreamResponse -> ShowS)
-> (DescribeDeliveryStreamResponse -> String)
-> ([DescribeDeliveryStreamResponse] -> ShowS)
-> Show DescribeDeliveryStreamResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDeliveryStreamResponse] -> ShowS
$cshowList :: [DescribeDeliveryStreamResponse] -> ShowS
show :: DescribeDeliveryStreamResponse -> String
$cshow :: DescribeDeliveryStreamResponse -> String
showsPrec :: Int -> DescribeDeliveryStreamResponse -> ShowS
$cshowsPrec :: Int -> DescribeDeliveryStreamResponse -> ShowS
Prelude.Show, (forall x.
DescribeDeliveryStreamResponse
-> Rep DescribeDeliveryStreamResponse x)
-> (forall x.
Rep DescribeDeliveryStreamResponse x
-> DescribeDeliveryStreamResponse)
-> Generic DescribeDeliveryStreamResponse
forall x.
Rep DescribeDeliveryStreamResponse x
-> DescribeDeliveryStreamResponse
forall x.
DescribeDeliveryStreamResponse
-> Rep DescribeDeliveryStreamResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDeliveryStreamResponse x
-> DescribeDeliveryStreamResponse
$cfrom :: forall x.
DescribeDeliveryStreamResponse
-> Rep DescribeDeliveryStreamResponse x
Prelude.Generic)
newDescribeDeliveryStreamResponse ::
Prelude.Int ->
DeliveryStreamDescription ->
DescribeDeliveryStreamResponse
newDescribeDeliveryStreamResponse :: Int -> DeliveryStreamDescription -> DescribeDeliveryStreamResponse
newDescribeDeliveryStreamResponse
Int
pHttpStatus_
DeliveryStreamDescription
pDeliveryStreamDescription_ =
DescribeDeliveryStreamResponse' :: Int -> DeliveryStreamDescription -> DescribeDeliveryStreamResponse
DescribeDeliveryStreamResponse'
{ $sel:httpStatus:DescribeDeliveryStreamResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:deliveryStreamDescription:DescribeDeliveryStreamResponse' :: DeliveryStreamDescription
deliveryStreamDescription =
DeliveryStreamDescription
pDeliveryStreamDescription_
}
describeDeliveryStreamResponse_httpStatus :: Lens.Lens' DescribeDeliveryStreamResponse Prelude.Int
describeDeliveryStreamResponse_httpStatus :: (Int -> f Int)
-> DescribeDeliveryStreamResponse
-> f DescribeDeliveryStreamResponse
describeDeliveryStreamResponse_httpStatus = (DescribeDeliveryStreamResponse -> Int)
-> (DescribeDeliveryStreamResponse
-> Int -> DescribeDeliveryStreamResponse)
-> Lens
DescribeDeliveryStreamResponse
DescribeDeliveryStreamResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeliveryStreamResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeDeliveryStreamResponse' :: DescribeDeliveryStreamResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeDeliveryStreamResponse
s@DescribeDeliveryStreamResponse' {} Int
a -> DescribeDeliveryStreamResponse
s {$sel:httpStatus:DescribeDeliveryStreamResponse' :: Int
httpStatus = Int
a} :: DescribeDeliveryStreamResponse)
describeDeliveryStreamResponse_deliveryStreamDescription :: Lens.Lens' DescribeDeliveryStreamResponse DeliveryStreamDescription
describeDeliveryStreamResponse_deliveryStreamDescription :: (DeliveryStreamDescription -> f DeliveryStreamDescription)
-> DescribeDeliveryStreamResponse
-> f DescribeDeliveryStreamResponse
describeDeliveryStreamResponse_deliveryStreamDescription = (DescribeDeliveryStreamResponse -> DeliveryStreamDescription)
-> (DescribeDeliveryStreamResponse
-> DeliveryStreamDescription -> DescribeDeliveryStreamResponse)
-> Lens
DescribeDeliveryStreamResponse
DescribeDeliveryStreamResponse
DeliveryStreamDescription
DeliveryStreamDescription
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDeliveryStreamResponse' {DeliveryStreamDescription
deliveryStreamDescription :: DeliveryStreamDescription
$sel:deliveryStreamDescription:DescribeDeliveryStreamResponse' :: DescribeDeliveryStreamResponse -> DeliveryStreamDescription
deliveryStreamDescription} -> DeliveryStreamDescription
deliveryStreamDescription) (\s :: DescribeDeliveryStreamResponse
s@DescribeDeliveryStreamResponse' {} DeliveryStreamDescription
a -> DescribeDeliveryStreamResponse
s {$sel:deliveryStreamDescription:DescribeDeliveryStreamResponse' :: DeliveryStreamDescription
deliveryStreamDescription = DeliveryStreamDescription
a} :: DescribeDeliveryStreamResponse)
instance
Prelude.NFData
DescribeDeliveryStreamResponse