{-# 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.DynamoDB.EnableKinesisStreamingDestination
(
EnableKinesisStreamingDestination (..),
newEnableKinesisStreamingDestination,
enableKinesisStreamingDestination_tableName,
enableKinesisStreamingDestination_streamArn,
KinesisStreamingDestinationOutput (..),
newKinesisStreamingDestinationOutput,
kinesisStreamingDestinationOutput_destinationStatus,
kinesisStreamingDestinationOutput_streamArn,
kinesisStreamingDestinationOutput_tableName,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.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 EnableKinesisStreamingDestination = EnableKinesisStreamingDestination'
{
EnableKinesisStreamingDestination -> Text
tableName :: Prelude.Text,
EnableKinesisStreamingDestination -> Text
streamArn :: Prelude.Text
}
deriving (EnableKinesisStreamingDestination
-> EnableKinesisStreamingDestination -> Bool
(EnableKinesisStreamingDestination
-> EnableKinesisStreamingDestination -> Bool)
-> (EnableKinesisStreamingDestination
-> EnableKinesisStreamingDestination -> Bool)
-> Eq EnableKinesisStreamingDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableKinesisStreamingDestination
-> EnableKinesisStreamingDestination -> Bool
$c/= :: EnableKinesisStreamingDestination
-> EnableKinesisStreamingDestination -> Bool
== :: EnableKinesisStreamingDestination
-> EnableKinesisStreamingDestination -> Bool
$c== :: EnableKinesisStreamingDestination
-> EnableKinesisStreamingDestination -> Bool
Prelude.Eq, ReadPrec [EnableKinesisStreamingDestination]
ReadPrec EnableKinesisStreamingDestination
Int -> ReadS EnableKinesisStreamingDestination
ReadS [EnableKinesisStreamingDestination]
(Int -> ReadS EnableKinesisStreamingDestination)
-> ReadS [EnableKinesisStreamingDestination]
-> ReadPrec EnableKinesisStreamingDestination
-> ReadPrec [EnableKinesisStreamingDestination]
-> Read EnableKinesisStreamingDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableKinesisStreamingDestination]
$creadListPrec :: ReadPrec [EnableKinesisStreamingDestination]
readPrec :: ReadPrec EnableKinesisStreamingDestination
$creadPrec :: ReadPrec EnableKinesisStreamingDestination
readList :: ReadS [EnableKinesisStreamingDestination]
$creadList :: ReadS [EnableKinesisStreamingDestination]
readsPrec :: Int -> ReadS EnableKinesisStreamingDestination
$creadsPrec :: Int -> ReadS EnableKinesisStreamingDestination
Prelude.Read, Int -> EnableKinesisStreamingDestination -> ShowS
[EnableKinesisStreamingDestination] -> ShowS
EnableKinesisStreamingDestination -> String
(Int -> EnableKinesisStreamingDestination -> ShowS)
-> (EnableKinesisStreamingDestination -> String)
-> ([EnableKinesisStreamingDestination] -> ShowS)
-> Show EnableKinesisStreamingDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableKinesisStreamingDestination] -> ShowS
$cshowList :: [EnableKinesisStreamingDestination] -> ShowS
show :: EnableKinesisStreamingDestination -> String
$cshow :: EnableKinesisStreamingDestination -> String
showsPrec :: Int -> EnableKinesisStreamingDestination -> ShowS
$cshowsPrec :: Int -> EnableKinesisStreamingDestination -> ShowS
Prelude.Show, (forall x.
EnableKinesisStreamingDestination
-> Rep EnableKinesisStreamingDestination x)
-> (forall x.
Rep EnableKinesisStreamingDestination x
-> EnableKinesisStreamingDestination)
-> Generic EnableKinesisStreamingDestination
forall x.
Rep EnableKinesisStreamingDestination x
-> EnableKinesisStreamingDestination
forall x.
EnableKinesisStreamingDestination
-> Rep EnableKinesisStreamingDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep EnableKinesisStreamingDestination x
-> EnableKinesisStreamingDestination
$cfrom :: forall x.
EnableKinesisStreamingDestination
-> Rep EnableKinesisStreamingDestination x
Prelude.Generic)
newEnableKinesisStreamingDestination ::
Prelude.Text ->
Prelude.Text ->
EnableKinesisStreamingDestination
newEnableKinesisStreamingDestination :: Text -> Text -> EnableKinesisStreamingDestination
newEnableKinesisStreamingDestination
Text
pTableName_
Text
pStreamArn_ =
EnableKinesisStreamingDestination' :: Text -> Text -> EnableKinesisStreamingDestination
EnableKinesisStreamingDestination'
{ $sel:tableName:EnableKinesisStreamingDestination' :: Text
tableName =
Text
pTableName_,
$sel:streamArn:EnableKinesisStreamingDestination' :: Text
streamArn = Text
pStreamArn_
}
enableKinesisStreamingDestination_tableName :: Lens.Lens' EnableKinesisStreamingDestination Prelude.Text
enableKinesisStreamingDestination_tableName :: (Text -> f Text)
-> EnableKinesisStreamingDestination
-> f EnableKinesisStreamingDestination
enableKinesisStreamingDestination_tableName = (EnableKinesisStreamingDestination -> Text)
-> (EnableKinesisStreamingDestination
-> Text -> EnableKinesisStreamingDestination)
-> Lens
EnableKinesisStreamingDestination
EnableKinesisStreamingDestination
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableKinesisStreamingDestination' {Text
tableName :: Text
$sel:tableName:EnableKinesisStreamingDestination' :: EnableKinesisStreamingDestination -> Text
tableName} -> Text
tableName) (\s :: EnableKinesisStreamingDestination
s@EnableKinesisStreamingDestination' {} Text
a -> EnableKinesisStreamingDestination
s {$sel:tableName:EnableKinesisStreamingDestination' :: Text
tableName = Text
a} :: EnableKinesisStreamingDestination)
enableKinesisStreamingDestination_streamArn :: Lens.Lens' EnableKinesisStreamingDestination Prelude.Text
enableKinesisStreamingDestination_streamArn :: (Text -> f Text)
-> EnableKinesisStreamingDestination
-> f EnableKinesisStreamingDestination
enableKinesisStreamingDestination_streamArn = (EnableKinesisStreamingDestination -> Text)
-> (EnableKinesisStreamingDestination
-> Text -> EnableKinesisStreamingDestination)
-> Lens
EnableKinesisStreamingDestination
EnableKinesisStreamingDestination
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableKinesisStreamingDestination' {Text
streamArn :: Text
$sel:streamArn:EnableKinesisStreamingDestination' :: EnableKinesisStreamingDestination -> Text
streamArn} -> Text
streamArn) (\s :: EnableKinesisStreamingDestination
s@EnableKinesisStreamingDestination' {} Text
a -> EnableKinesisStreamingDestination
s {$sel:streamArn:EnableKinesisStreamingDestination' :: Text
streamArn = Text
a} :: EnableKinesisStreamingDestination)
instance
Core.AWSRequest
EnableKinesisStreamingDestination
where
type
AWSResponse EnableKinesisStreamingDestination =
KinesisStreamingDestinationOutput
request :: EnableKinesisStreamingDestination
-> Request EnableKinesisStreamingDestination
request = Service
-> EnableKinesisStreamingDestination
-> Request EnableKinesisStreamingDestination
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy EnableKinesisStreamingDestination
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse EnableKinesisStreamingDestination)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse EnableKinesisStreamingDestination))
-> Logger
-> Service
-> Proxy EnableKinesisStreamingDestination
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse EnableKinesisStreamingDestination)))
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 -> Object -> Either String KinesisStreamingDestinationOutput
forall a. FromJSON a => Object -> Either String a
Core.eitherParseJSON Object
x)
instance
Prelude.Hashable
EnableKinesisStreamingDestination
instance
Prelude.NFData
EnableKinesisStreamingDestination
instance
Core.ToHeaders
EnableKinesisStreamingDestination
where
toHeaders :: EnableKinesisStreamingDestination -> ResponseHeaders
toHeaders =
ResponseHeaders
-> EnableKinesisStreamingDestination -> 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
"DynamoDB_20120810.EnableKinesisStreamingDestination" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance
Core.ToJSON
EnableKinesisStreamingDestination
where
toJSON :: EnableKinesisStreamingDestination -> Value
toJSON EnableKinesisStreamingDestination' {Text
streamArn :: Text
tableName :: Text
$sel:streamArn:EnableKinesisStreamingDestination' :: EnableKinesisStreamingDestination -> Text
$sel:tableName:EnableKinesisStreamingDestination' :: EnableKinesisStreamingDestination -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TableName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tableName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StreamArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
streamArn)
]
)
instance
Core.ToPath
EnableKinesisStreamingDestination
where
toPath :: EnableKinesisStreamingDestination -> ByteString
toPath = ByteString -> EnableKinesisStreamingDestination -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
EnableKinesisStreamingDestination
where
toQuery :: EnableKinesisStreamingDestination -> QueryString
toQuery = QueryString -> EnableKinesisStreamingDestination -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty