{-# 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.DynamoDB.Types.ItemResponse where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.AttributeValue
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ItemResponse = ItemResponse'
{
ItemResponse -> Maybe (HashMap Text AttributeValue)
item :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue)
}
deriving (ItemResponse -> ItemResponse -> Bool
(ItemResponse -> ItemResponse -> Bool)
-> (ItemResponse -> ItemResponse -> Bool) -> Eq ItemResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ItemResponse -> ItemResponse -> Bool
$c/= :: ItemResponse -> ItemResponse -> Bool
== :: ItemResponse -> ItemResponse -> Bool
$c== :: ItemResponse -> ItemResponse -> Bool
Prelude.Eq, ReadPrec [ItemResponse]
ReadPrec ItemResponse
Int -> ReadS ItemResponse
ReadS [ItemResponse]
(Int -> ReadS ItemResponse)
-> ReadS [ItemResponse]
-> ReadPrec ItemResponse
-> ReadPrec [ItemResponse]
-> Read ItemResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ItemResponse]
$creadListPrec :: ReadPrec [ItemResponse]
readPrec :: ReadPrec ItemResponse
$creadPrec :: ReadPrec ItemResponse
readList :: ReadS [ItemResponse]
$creadList :: ReadS [ItemResponse]
readsPrec :: Int -> ReadS ItemResponse
$creadsPrec :: Int -> ReadS ItemResponse
Prelude.Read, Int -> ItemResponse -> ShowS
[ItemResponse] -> ShowS
ItemResponse -> String
(Int -> ItemResponse -> ShowS)
-> (ItemResponse -> String)
-> ([ItemResponse] -> ShowS)
-> Show ItemResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ItemResponse] -> ShowS
$cshowList :: [ItemResponse] -> ShowS
show :: ItemResponse -> String
$cshow :: ItemResponse -> String
showsPrec :: Int -> ItemResponse -> ShowS
$cshowsPrec :: Int -> ItemResponse -> ShowS
Prelude.Show, (forall x. ItemResponse -> Rep ItemResponse x)
-> (forall x. Rep ItemResponse x -> ItemResponse)
-> Generic ItemResponse
forall x. Rep ItemResponse x -> ItemResponse
forall x. ItemResponse -> Rep ItemResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ItemResponse x -> ItemResponse
$cfrom :: forall x. ItemResponse -> Rep ItemResponse x
Prelude.Generic)
newItemResponse ::
ItemResponse
newItemResponse :: ItemResponse
newItemResponse =
ItemResponse' :: Maybe (HashMap Text AttributeValue) -> ItemResponse
ItemResponse' {$sel:item:ItemResponse' :: Maybe (HashMap Text AttributeValue)
item = Maybe (HashMap Text AttributeValue)
forall a. Maybe a
Prelude.Nothing}
itemResponse_item :: Lens.Lens' ItemResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
itemResponse_item :: (Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> ItemResponse -> f ItemResponse
itemResponse_item = (ItemResponse -> Maybe (HashMap Text AttributeValue))
-> (ItemResponse
-> Maybe (HashMap Text AttributeValue) -> ItemResponse)
-> Lens
ItemResponse
ItemResponse
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemResponse' {Maybe (HashMap Text AttributeValue)
item :: Maybe (HashMap Text AttributeValue)
$sel:item:ItemResponse' :: ItemResponse -> Maybe (HashMap Text AttributeValue)
item} -> Maybe (HashMap Text AttributeValue)
item) (\s :: ItemResponse
s@ItemResponse' {} Maybe (HashMap Text AttributeValue)
a -> ItemResponse
s {$sel:item:ItemResponse' :: Maybe (HashMap Text AttributeValue)
item = Maybe (HashMap Text AttributeValue)
a} :: ItemResponse) ((Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> ItemResponse -> f ItemResponse)
-> ((Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> (Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> ItemResponse
-> f ItemResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
-> Iso
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ItemResponse where
parseJSON :: Value -> Parser ItemResponse
parseJSON =
String
-> (Object -> Parser ItemResponse) -> Value -> Parser ItemResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ItemResponse"
( \Object
x ->
Maybe (HashMap Text AttributeValue) -> ItemResponse
ItemResponse'
(Maybe (HashMap Text AttributeValue) -> ItemResponse)
-> Parser (Maybe (HashMap Text AttributeValue))
-> Parser ItemResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text AttributeValue)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Item" Parser (Maybe (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> Parser (Maybe (HashMap Text AttributeValue))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text AttributeValue)
forall a. Monoid a => a
Prelude.mempty)
)
instance Prelude.Hashable ItemResponse
instance Prelude.NFData ItemResponse