{-# 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.PutItemInput where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PutItemInput = PutItemInput'
{
PutItemInput -> Text
tableName :: Prelude.Text
}
deriving (PutItemInput -> PutItemInput -> Bool
(PutItemInput -> PutItemInput -> Bool)
-> (PutItemInput -> PutItemInput -> Bool) -> Eq PutItemInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutItemInput -> PutItemInput -> Bool
$c/= :: PutItemInput -> PutItemInput -> Bool
== :: PutItemInput -> PutItemInput -> Bool
$c== :: PutItemInput -> PutItemInput -> Bool
Prelude.Eq, ReadPrec [PutItemInput]
ReadPrec PutItemInput
Int -> ReadS PutItemInput
ReadS [PutItemInput]
(Int -> ReadS PutItemInput)
-> ReadS [PutItemInput]
-> ReadPrec PutItemInput
-> ReadPrec [PutItemInput]
-> Read PutItemInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutItemInput]
$creadListPrec :: ReadPrec [PutItemInput]
readPrec :: ReadPrec PutItemInput
$creadPrec :: ReadPrec PutItemInput
readList :: ReadS [PutItemInput]
$creadList :: ReadS [PutItemInput]
readsPrec :: Int -> ReadS PutItemInput
$creadsPrec :: Int -> ReadS PutItemInput
Prelude.Read, Int -> PutItemInput -> ShowS
[PutItemInput] -> ShowS
PutItemInput -> String
(Int -> PutItemInput -> ShowS)
-> (PutItemInput -> String)
-> ([PutItemInput] -> ShowS)
-> Show PutItemInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutItemInput] -> ShowS
$cshowList :: [PutItemInput] -> ShowS
show :: PutItemInput -> String
$cshow :: PutItemInput -> String
showsPrec :: Int -> PutItemInput -> ShowS
$cshowsPrec :: Int -> PutItemInput -> ShowS
Prelude.Show, (forall x. PutItemInput -> Rep PutItemInput x)
-> (forall x. Rep PutItemInput x -> PutItemInput)
-> Generic PutItemInput
forall x. Rep PutItemInput x -> PutItemInput
forall x. PutItemInput -> Rep PutItemInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutItemInput x -> PutItemInput
$cfrom :: forall x. PutItemInput -> Rep PutItemInput x
Prelude.Generic)
newPutItemInput ::
Prelude.Text ->
PutItemInput
newPutItemInput :: Text -> PutItemInput
newPutItemInput Text
pTableName_ =
PutItemInput' :: Text -> PutItemInput
PutItemInput' {$sel:tableName:PutItemInput' :: Text
tableName = Text
pTableName_}
putItemInput_tableName :: Lens.Lens' PutItemInput Prelude.Text
putItemInput_tableName :: (Text -> f Text) -> PutItemInput -> f PutItemInput
putItemInput_tableName = (PutItemInput -> Text)
-> (PutItemInput -> Text -> PutItemInput)
-> Lens PutItemInput PutItemInput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutItemInput' {Text
tableName :: Text
$sel:tableName:PutItemInput' :: PutItemInput -> Text
tableName} -> Text
tableName) (\s :: PutItemInput
s@PutItemInput' {} Text
a -> PutItemInput
s {$sel:tableName:PutItemInput' :: Text
tableName = Text
a} :: PutItemInput)
instance Core.FromJSON PutItemInput where
parseJSON :: Value -> Parser PutItemInput
parseJSON =
String
-> (Object -> Parser PutItemInput) -> Value -> Parser PutItemInput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PutItemInput"
( \Object
x ->
Text -> PutItemInput
PutItemInput' (Text -> PutItemInput) -> Parser Text -> Parser PutItemInput
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"tableName")
)
instance Prelude.Hashable PutItemInput
instance Prelude.NFData PutItemInput
instance Core.ToJSON PutItemInput where
toJSON :: PutItemInput -> Value
toJSON PutItemInput' {Text
tableName :: Text
$sel:tableName:PutItemInput' :: PutItemInput -> 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)]
)