{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IoT.Types.DynamoDBv2Action where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types.PutItemInput
import qualified Amazonka.Prelude as Prelude
data DynamoDBv2Action = DynamoDBv2Action'
{
DynamoDBv2Action -> Text
roleArn :: Prelude.Text,
DynamoDBv2Action -> PutItemInput
putItem :: PutItemInput
}
deriving (DynamoDBv2Action -> DynamoDBv2Action -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DynamoDBv2Action -> DynamoDBv2Action -> Bool
$c/= :: DynamoDBv2Action -> DynamoDBv2Action -> Bool
== :: DynamoDBv2Action -> DynamoDBv2Action -> Bool
$c== :: DynamoDBv2Action -> DynamoDBv2Action -> Bool
Prelude.Eq, ReadPrec [DynamoDBv2Action]
ReadPrec DynamoDBv2Action
Int -> ReadS DynamoDBv2Action
ReadS [DynamoDBv2Action]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DynamoDBv2Action]
$creadListPrec :: ReadPrec [DynamoDBv2Action]
readPrec :: ReadPrec DynamoDBv2Action
$creadPrec :: ReadPrec DynamoDBv2Action
readList :: ReadS [DynamoDBv2Action]
$creadList :: ReadS [DynamoDBv2Action]
readsPrec :: Int -> ReadS DynamoDBv2Action
$creadsPrec :: Int -> ReadS DynamoDBv2Action
Prelude.Read, Int -> DynamoDBv2Action -> ShowS
[DynamoDBv2Action] -> ShowS
DynamoDBv2Action -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DynamoDBv2Action] -> ShowS
$cshowList :: [DynamoDBv2Action] -> ShowS
show :: DynamoDBv2Action -> String
$cshow :: DynamoDBv2Action -> String
showsPrec :: Int -> DynamoDBv2Action -> ShowS
$cshowsPrec :: Int -> DynamoDBv2Action -> ShowS
Prelude.Show, forall x. Rep DynamoDBv2Action x -> DynamoDBv2Action
forall x. DynamoDBv2Action -> Rep DynamoDBv2Action x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DynamoDBv2Action x -> DynamoDBv2Action
$cfrom :: forall x. DynamoDBv2Action -> Rep DynamoDBv2Action x
Prelude.Generic)
newDynamoDBv2Action ::
Prelude.Text ->
PutItemInput ->
DynamoDBv2Action
newDynamoDBv2Action :: Text -> PutItemInput -> DynamoDBv2Action
newDynamoDBv2Action Text
pRoleArn_ PutItemInput
pPutItem_ =
DynamoDBv2Action'
{ $sel:roleArn:DynamoDBv2Action' :: Text
roleArn = Text
pRoleArn_,
$sel:putItem:DynamoDBv2Action' :: PutItemInput
putItem = PutItemInput
pPutItem_
}
dynamoDBv2Action_roleArn :: Lens.Lens' DynamoDBv2Action Prelude.Text
dynamoDBv2Action_roleArn :: Lens' DynamoDBv2Action Text
dynamoDBv2Action_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DynamoDBv2Action' {Text
roleArn :: Text
$sel:roleArn:DynamoDBv2Action' :: DynamoDBv2Action -> Text
roleArn} -> Text
roleArn) (\s :: DynamoDBv2Action
s@DynamoDBv2Action' {} Text
a -> DynamoDBv2Action
s {$sel:roleArn:DynamoDBv2Action' :: Text
roleArn = Text
a} :: DynamoDBv2Action)
dynamoDBv2Action_putItem :: Lens.Lens' DynamoDBv2Action PutItemInput
dynamoDBv2Action_putItem :: Lens' DynamoDBv2Action PutItemInput
dynamoDBv2Action_putItem = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DynamoDBv2Action' {PutItemInput
putItem :: PutItemInput
$sel:putItem:DynamoDBv2Action' :: DynamoDBv2Action -> PutItemInput
putItem} -> PutItemInput
putItem) (\s :: DynamoDBv2Action
s@DynamoDBv2Action' {} PutItemInput
a -> DynamoDBv2Action
s {$sel:putItem:DynamoDBv2Action' :: PutItemInput
putItem = PutItemInput
a} :: DynamoDBv2Action)
instance Data.FromJSON DynamoDBv2Action where
parseJSON :: Value -> Parser DynamoDBv2Action
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DynamoDBv2Action"
( \Object
x ->
Text -> PutItemInput -> DynamoDBv2Action
DynamoDBv2Action'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"roleArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"putItem")
)
instance Prelude.Hashable DynamoDBv2Action where
hashWithSalt :: Int -> DynamoDBv2Action -> Int
hashWithSalt Int
_salt DynamoDBv2Action' {Text
PutItemInput
putItem :: PutItemInput
roleArn :: Text
$sel:putItem:DynamoDBv2Action' :: DynamoDBv2Action -> PutItemInput
$sel:roleArn:DynamoDBv2Action' :: DynamoDBv2Action -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` PutItemInput
putItem
instance Prelude.NFData DynamoDBv2Action where
rnf :: DynamoDBv2Action -> ()
rnf DynamoDBv2Action' {Text
PutItemInput
putItem :: PutItemInput
roleArn :: Text
$sel:putItem:DynamoDBv2Action' :: DynamoDBv2Action -> PutItemInput
$sel:roleArn:DynamoDBv2Action' :: DynamoDBv2Action -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf PutItemInput
putItem
instance Data.ToJSON DynamoDBv2Action where
toJSON :: DynamoDBv2Action -> Value
toJSON DynamoDBv2Action' {Text
PutItemInput
putItem :: PutItemInput
roleArn :: Text
$sel:putItem:DynamoDBv2Action' :: DynamoDBv2Action -> PutItemInput
$sel:roleArn:DynamoDBv2Action' :: DynamoDBv2Action -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
forall a. a -> Maybe a
Prelude.Just (Key
"putItem" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= PutItemInput
putItem)
]
)