{-# 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.GetItem
(
GetItem (..),
newGetItem,
getItem_projectionExpression,
getItem_attributesToGet,
getItem_expressionAttributeNames,
getItem_consistentRead,
getItem_returnConsumedCapacity,
getItem_tableName,
getItem_key,
GetItemResponse (..),
newGetItemResponse,
getItemResponse_consumedCapacity,
getItemResponse_item,
getItemResponse_httpStatus,
)
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 GetItem = GetItem'
{
GetItem -> Maybe Text
projectionExpression :: Prelude.Maybe Prelude.Text,
GetItem -> Maybe (NonEmpty Text)
attributesToGet :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
GetItem -> Maybe (HashMap Text Text)
expressionAttributeNames :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
GetItem -> Maybe Bool
consistentRead :: Prelude.Maybe Prelude.Bool,
GetItem -> Maybe ReturnConsumedCapacity
returnConsumedCapacity :: Prelude.Maybe ReturnConsumedCapacity,
GetItem -> Text
tableName :: Prelude.Text,
GetItem -> HashMap Text AttributeValue
key :: Prelude.HashMap Prelude.Text AttributeValue
}
deriving (GetItem -> GetItem -> Bool
(GetItem -> GetItem -> Bool)
-> (GetItem -> GetItem -> Bool) -> Eq GetItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetItem -> GetItem -> Bool
$c/= :: GetItem -> GetItem -> Bool
== :: GetItem -> GetItem -> Bool
$c== :: GetItem -> GetItem -> Bool
Prelude.Eq, ReadPrec [GetItem]
ReadPrec GetItem
Int -> ReadS GetItem
ReadS [GetItem]
(Int -> ReadS GetItem)
-> ReadS [GetItem]
-> ReadPrec GetItem
-> ReadPrec [GetItem]
-> Read GetItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetItem]
$creadListPrec :: ReadPrec [GetItem]
readPrec :: ReadPrec GetItem
$creadPrec :: ReadPrec GetItem
readList :: ReadS [GetItem]
$creadList :: ReadS [GetItem]
readsPrec :: Int -> ReadS GetItem
$creadsPrec :: Int -> ReadS GetItem
Prelude.Read, Int -> GetItem -> ShowS
[GetItem] -> ShowS
GetItem -> String
(Int -> GetItem -> ShowS)
-> (GetItem -> String) -> ([GetItem] -> ShowS) -> Show GetItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetItem] -> ShowS
$cshowList :: [GetItem] -> ShowS
show :: GetItem -> String
$cshow :: GetItem -> String
showsPrec :: Int -> GetItem -> ShowS
$cshowsPrec :: Int -> GetItem -> ShowS
Prelude.Show, (forall x. GetItem -> Rep GetItem x)
-> (forall x. Rep GetItem x -> GetItem) -> Generic GetItem
forall x. Rep GetItem x -> GetItem
forall x. GetItem -> Rep GetItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetItem x -> GetItem
$cfrom :: forall x. GetItem -> Rep GetItem x
Prelude.Generic)
newGetItem ::
Prelude.Text ->
GetItem
newGetItem :: Text -> GetItem
newGetItem Text
pTableName_ =
GetItem' :: Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe (HashMap Text Text)
-> Maybe Bool
-> Maybe ReturnConsumedCapacity
-> Text
-> HashMap Text AttributeValue
-> GetItem
GetItem'
{ $sel:projectionExpression:GetItem' :: Maybe Text
projectionExpression = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributesToGet:GetItem' :: Maybe (NonEmpty Text)
attributesToGet = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:expressionAttributeNames:GetItem' :: Maybe (HashMap Text Text)
expressionAttributeNames = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:consistentRead:GetItem' :: Maybe Bool
consistentRead = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:returnConsumedCapacity:GetItem' :: Maybe ReturnConsumedCapacity
returnConsumedCapacity = Maybe ReturnConsumedCapacity
forall a. Maybe a
Prelude.Nothing,
$sel:tableName:GetItem' :: Text
tableName = Text
pTableName_,
$sel:key:GetItem' :: HashMap Text AttributeValue
key = HashMap Text AttributeValue
forall a. Monoid a => a
Prelude.mempty
}
getItem_projectionExpression :: Lens.Lens' GetItem (Prelude.Maybe Prelude.Text)
getItem_projectionExpression :: (Maybe Text -> f (Maybe Text)) -> GetItem -> f GetItem
getItem_projectionExpression = (GetItem -> Maybe Text)
-> (GetItem -> Maybe Text -> GetItem)
-> Lens GetItem GetItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItem' {Maybe Text
projectionExpression :: Maybe Text
$sel:projectionExpression:GetItem' :: GetItem -> Maybe Text
projectionExpression} -> Maybe Text
projectionExpression) (\s :: GetItem
s@GetItem' {} Maybe Text
a -> GetItem
s {$sel:projectionExpression:GetItem' :: Maybe Text
projectionExpression = Maybe Text
a} :: GetItem)
getItem_attributesToGet :: Lens.Lens' GetItem (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getItem_attributesToGet :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetItem -> f GetItem
getItem_attributesToGet = (GetItem -> Maybe (NonEmpty Text))
-> (GetItem -> Maybe (NonEmpty Text) -> GetItem)
-> Lens
GetItem GetItem (Maybe (NonEmpty Text)) (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItem' {Maybe (NonEmpty Text)
attributesToGet :: Maybe (NonEmpty Text)
$sel:attributesToGet:GetItem' :: GetItem -> Maybe (NonEmpty Text)
attributesToGet} -> Maybe (NonEmpty Text)
attributesToGet) (\s :: GetItem
s@GetItem' {} Maybe (NonEmpty Text)
a -> GetItem
s {$sel:attributesToGet:GetItem' :: Maybe (NonEmpty Text)
attributesToGet = Maybe (NonEmpty Text)
a} :: GetItem) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetItem -> f GetItem)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> GetItem
-> f GetItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getItem_expressionAttributeNames :: Lens.Lens' GetItem (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
getItem_expressionAttributeNames :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetItem -> f GetItem
getItem_expressionAttributeNames = (GetItem -> Maybe (HashMap Text Text))
-> (GetItem -> Maybe (HashMap Text Text) -> GetItem)
-> Lens
GetItem
GetItem
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItem' {Maybe (HashMap Text Text)
expressionAttributeNames :: Maybe (HashMap Text Text)
$sel:expressionAttributeNames:GetItem' :: GetItem -> Maybe (HashMap Text Text)
expressionAttributeNames} -> Maybe (HashMap Text Text)
expressionAttributeNames) (\s :: GetItem
s@GetItem' {} Maybe (HashMap Text Text)
a -> GetItem
s {$sel:expressionAttributeNames:GetItem' :: Maybe (HashMap Text Text)
expressionAttributeNames = Maybe (HashMap Text Text)
a} :: GetItem) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetItem -> f GetItem)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> GetItem
-> f GetItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getItem_consistentRead :: Lens.Lens' GetItem (Prelude.Maybe Prelude.Bool)
getItem_consistentRead :: (Maybe Bool -> f (Maybe Bool)) -> GetItem -> f GetItem
getItem_consistentRead = (GetItem -> Maybe Bool)
-> (GetItem -> Maybe Bool -> GetItem)
-> Lens GetItem GetItem (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItem' {Maybe Bool
consistentRead :: Maybe Bool
$sel:consistentRead:GetItem' :: GetItem -> Maybe Bool
consistentRead} -> Maybe Bool
consistentRead) (\s :: GetItem
s@GetItem' {} Maybe Bool
a -> GetItem
s {$sel:consistentRead:GetItem' :: Maybe Bool
consistentRead = Maybe Bool
a} :: GetItem)
getItem_returnConsumedCapacity :: Lens.Lens' GetItem (Prelude.Maybe ReturnConsumedCapacity)
getItem_returnConsumedCapacity :: (Maybe ReturnConsumedCapacity -> f (Maybe ReturnConsumedCapacity))
-> GetItem -> f GetItem
getItem_returnConsumedCapacity = (GetItem -> Maybe ReturnConsumedCapacity)
-> (GetItem -> Maybe ReturnConsumedCapacity -> GetItem)
-> Lens
GetItem
GetItem
(Maybe ReturnConsumedCapacity)
(Maybe ReturnConsumedCapacity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItem' {Maybe ReturnConsumedCapacity
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
$sel:returnConsumedCapacity:GetItem' :: GetItem -> Maybe ReturnConsumedCapacity
returnConsumedCapacity} -> Maybe ReturnConsumedCapacity
returnConsumedCapacity) (\s :: GetItem
s@GetItem' {} Maybe ReturnConsumedCapacity
a -> GetItem
s {$sel:returnConsumedCapacity:GetItem' :: Maybe ReturnConsumedCapacity
returnConsumedCapacity = Maybe ReturnConsumedCapacity
a} :: GetItem)
getItem_tableName :: Lens.Lens' GetItem Prelude.Text
getItem_tableName :: (Text -> f Text) -> GetItem -> f GetItem
getItem_tableName = (GetItem -> Text)
-> (GetItem -> Text -> GetItem) -> Lens GetItem GetItem Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItem' {Text
tableName :: Text
$sel:tableName:GetItem' :: GetItem -> Text
tableName} -> Text
tableName) (\s :: GetItem
s@GetItem' {} Text
a -> GetItem
s {$sel:tableName:GetItem' :: Text
tableName = Text
a} :: GetItem)
getItem_key :: Lens.Lens' GetItem (Prelude.HashMap Prelude.Text AttributeValue)
getItem_key :: (HashMap Text AttributeValue -> f (HashMap Text AttributeValue))
-> GetItem -> f GetItem
getItem_key = (GetItem -> HashMap Text AttributeValue)
-> (GetItem -> HashMap Text AttributeValue -> GetItem)
-> Lens
GetItem
GetItem
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItem' {HashMap Text AttributeValue
key :: HashMap Text AttributeValue
$sel:key:GetItem' :: GetItem -> HashMap Text AttributeValue
key} -> HashMap Text AttributeValue
key) (\s :: GetItem
s@GetItem' {} HashMap Text AttributeValue
a -> GetItem
s {$sel:key:GetItem' :: HashMap Text AttributeValue
key = HashMap Text AttributeValue
a} :: GetItem) ((HashMap Text AttributeValue -> f (HashMap Text AttributeValue))
-> GetItem -> f GetItem)
-> ((HashMap Text AttributeValue
-> f (HashMap Text AttributeValue))
-> HashMap Text AttributeValue -> f (HashMap Text AttributeValue))
-> (HashMap Text AttributeValue -> f (HashMap Text AttributeValue))
-> GetItem
-> f GetItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text AttributeValue -> f (HashMap Text AttributeValue))
-> HashMap Text AttributeValue -> f (HashMap Text AttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest GetItem where
type AWSResponse GetItem = GetItemResponse
request :: GetItem -> Request GetItem
request = Service -> GetItem -> Request GetItem
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetItem
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetItem)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetItem))
-> Logger
-> Service
-> Proxy GetItem
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetItem)))
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 ->
Maybe ConsumedCapacity
-> Maybe (HashMap Text AttributeValue) -> Int -> GetItemResponse
GetItemResponse'
(Maybe ConsumedCapacity
-> Maybe (HashMap Text AttributeValue) -> Int -> GetItemResponse)
-> Either String (Maybe ConsumedCapacity)
-> Either
String
(Maybe (HashMap Text AttributeValue) -> Int -> GetItemResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ConsumedCapacity)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConsumedCapacity")
Either
String
(Maybe (HashMap Text AttributeValue) -> Int -> GetItemResponse)
-> Either String (Maybe (HashMap Text AttributeValue))
-> Either String (Int -> GetItemResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe (Maybe (HashMap Text AttributeValue)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Item" Either String (Maybe (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> Either String (Maybe (HashMap Text AttributeValue))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text AttributeValue)
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetItemResponse)
-> Either String Int -> Either String GetItemResponse
forall (f :: * -> *) a b. Applicative f => 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))
)
instance Prelude.Hashable GetItem
instance Prelude.NFData GetItem
instance Core.ToHeaders GetItem where
toHeaders :: GetItem -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetItem -> 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.GetItem" :: 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 GetItem where
toJSON :: GetItem -> Value
toJSON GetItem' {Maybe Bool
Maybe (NonEmpty Text)
Maybe Text
Maybe (HashMap Text Text)
Maybe ReturnConsumedCapacity
Text
HashMap Text AttributeValue
key :: HashMap Text AttributeValue
tableName :: Text
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
consistentRead :: Maybe Bool
expressionAttributeNames :: Maybe (HashMap Text Text)
attributesToGet :: Maybe (NonEmpty Text)
projectionExpression :: Maybe Text
$sel:key:GetItem' :: GetItem -> HashMap Text AttributeValue
$sel:tableName:GetItem' :: GetItem -> Text
$sel:returnConsumedCapacity:GetItem' :: GetItem -> Maybe ReturnConsumedCapacity
$sel:consistentRead:GetItem' :: GetItem -> Maybe Bool
$sel:expressionAttributeNames:GetItem' :: GetItem -> Maybe (HashMap Text Text)
$sel:attributesToGet:GetItem' :: GetItem -> Maybe (NonEmpty Text)
$sel:projectionExpression:GetItem' :: GetItem -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"ProjectionExpression" 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
projectionExpression,
(Text
"AttributesToGet" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
attributesToGet,
(Text
"ExpressionAttributeNames" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
expressionAttributeNames,
(Text
"ConsistentRead" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
consistentRead,
(Text
"ReturnConsumedCapacity" Text -> ReturnConsumedCapacity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ReturnConsumedCapacity -> Pair)
-> Maybe ReturnConsumedCapacity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReturnConsumedCapacity
returnConsumedCapacity,
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
"Key" Text -> HashMap Text AttributeValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text AttributeValue
key)
]
)
instance Core.ToPath GetItem where
toPath :: GetItem -> ByteString
toPath = ByteString -> GetItem -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetItem where
toQuery :: GetItem -> QueryString
toQuery = QueryString -> GetItem -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetItemResponse = GetItemResponse'
{
GetItemResponse -> Maybe ConsumedCapacity
consumedCapacity :: Prelude.Maybe ConsumedCapacity,
GetItemResponse -> Maybe (HashMap Text AttributeValue)
item :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue),
GetItemResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetItemResponse -> GetItemResponse -> Bool
(GetItemResponse -> GetItemResponse -> Bool)
-> (GetItemResponse -> GetItemResponse -> Bool)
-> Eq GetItemResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetItemResponse -> GetItemResponse -> Bool
$c/= :: GetItemResponse -> GetItemResponse -> Bool
== :: GetItemResponse -> GetItemResponse -> Bool
$c== :: GetItemResponse -> GetItemResponse -> Bool
Prelude.Eq, ReadPrec [GetItemResponse]
ReadPrec GetItemResponse
Int -> ReadS GetItemResponse
ReadS [GetItemResponse]
(Int -> ReadS GetItemResponse)
-> ReadS [GetItemResponse]
-> ReadPrec GetItemResponse
-> ReadPrec [GetItemResponse]
-> Read GetItemResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetItemResponse]
$creadListPrec :: ReadPrec [GetItemResponse]
readPrec :: ReadPrec GetItemResponse
$creadPrec :: ReadPrec GetItemResponse
readList :: ReadS [GetItemResponse]
$creadList :: ReadS [GetItemResponse]
readsPrec :: Int -> ReadS GetItemResponse
$creadsPrec :: Int -> ReadS GetItemResponse
Prelude.Read, Int -> GetItemResponse -> ShowS
[GetItemResponse] -> ShowS
GetItemResponse -> String
(Int -> GetItemResponse -> ShowS)
-> (GetItemResponse -> String)
-> ([GetItemResponse] -> ShowS)
-> Show GetItemResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetItemResponse] -> ShowS
$cshowList :: [GetItemResponse] -> ShowS
show :: GetItemResponse -> String
$cshow :: GetItemResponse -> String
showsPrec :: Int -> GetItemResponse -> ShowS
$cshowsPrec :: Int -> GetItemResponse -> ShowS
Prelude.Show, (forall x. GetItemResponse -> Rep GetItemResponse x)
-> (forall x. Rep GetItemResponse x -> GetItemResponse)
-> Generic GetItemResponse
forall x. Rep GetItemResponse x -> GetItemResponse
forall x. GetItemResponse -> Rep GetItemResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetItemResponse x -> GetItemResponse
$cfrom :: forall x. GetItemResponse -> Rep GetItemResponse x
Prelude.Generic)
newGetItemResponse ::
Prelude.Int ->
GetItemResponse
newGetItemResponse :: Int -> GetItemResponse
newGetItemResponse Int
pHttpStatus_ =
GetItemResponse' :: Maybe ConsumedCapacity
-> Maybe (HashMap Text AttributeValue) -> Int -> GetItemResponse
GetItemResponse'
{ $sel:consumedCapacity:GetItemResponse' :: Maybe ConsumedCapacity
consumedCapacity =
Maybe ConsumedCapacity
forall a. Maybe a
Prelude.Nothing,
$sel:item:GetItemResponse' :: Maybe (HashMap Text AttributeValue)
item = Maybe (HashMap Text AttributeValue)
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetItemResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getItemResponse_consumedCapacity :: Lens.Lens' GetItemResponse (Prelude.Maybe ConsumedCapacity)
getItemResponse_consumedCapacity :: (Maybe ConsumedCapacity -> f (Maybe ConsumedCapacity))
-> GetItemResponse -> f GetItemResponse
getItemResponse_consumedCapacity = (GetItemResponse -> Maybe ConsumedCapacity)
-> (GetItemResponse -> Maybe ConsumedCapacity -> GetItemResponse)
-> Lens
GetItemResponse
GetItemResponse
(Maybe ConsumedCapacity)
(Maybe ConsumedCapacity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItemResponse' {Maybe ConsumedCapacity
consumedCapacity :: Maybe ConsumedCapacity
$sel:consumedCapacity:GetItemResponse' :: GetItemResponse -> Maybe ConsumedCapacity
consumedCapacity} -> Maybe ConsumedCapacity
consumedCapacity) (\s :: GetItemResponse
s@GetItemResponse' {} Maybe ConsumedCapacity
a -> GetItemResponse
s {$sel:consumedCapacity:GetItemResponse' :: Maybe ConsumedCapacity
consumedCapacity = Maybe ConsumedCapacity
a} :: GetItemResponse)
getItemResponse_item :: Lens.Lens' GetItemResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
getItemResponse_item :: (Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> GetItemResponse -> f GetItemResponse
getItemResponse_item = (GetItemResponse -> Maybe (HashMap Text AttributeValue))
-> (GetItemResponse
-> Maybe (HashMap Text AttributeValue) -> GetItemResponse)
-> Lens
GetItemResponse
GetItemResponse
(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 (\GetItemResponse' {Maybe (HashMap Text AttributeValue)
item :: Maybe (HashMap Text AttributeValue)
$sel:item:GetItemResponse' :: GetItemResponse -> Maybe (HashMap Text AttributeValue)
item} -> Maybe (HashMap Text AttributeValue)
item) (\s :: GetItemResponse
s@GetItemResponse' {} Maybe (HashMap Text AttributeValue)
a -> GetItemResponse
s {$sel:item:GetItemResponse' :: Maybe (HashMap Text AttributeValue)
item = Maybe (HashMap Text AttributeValue)
a} :: GetItemResponse) ((Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> GetItemResponse -> f GetItemResponse)
-> ((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)))
-> GetItemResponse
-> f GetItemResponse
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
getItemResponse_httpStatus :: Lens.Lens' GetItemResponse Prelude.Int
getItemResponse_httpStatus :: (Int -> f Int) -> GetItemResponse -> f GetItemResponse
getItemResponse_httpStatus = (GetItemResponse -> Int)
-> (GetItemResponse -> Int -> GetItemResponse)
-> Lens GetItemResponse GetItemResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetItemResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetItemResponse' :: GetItemResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetItemResponse
s@GetItemResponse' {} Int
a -> GetItemResponse
s {$sel:httpStatus:GetItemResponse' :: Int
httpStatus = Int
a} :: GetItemResponse)
instance Prelude.NFData GetItemResponse