{-# 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.BatchWriteItem
(
BatchWriteItem (..),
newBatchWriteItem,
batchWriteItem_returnConsumedCapacity,
batchWriteItem_returnItemCollectionMetrics,
batchWriteItem_requestItems,
BatchWriteItemResponse (..),
newBatchWriteItemResponse,
batchWriteItemResponse_itemCollectionMetrics,
batchWriteItemResponse_consumedCapacity,
batchWriteItemResponse_unprocessedItems,
batchWriteItemResponse_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 BatchWriteItem = BatchWriteItem'
{ BatchWriteItem -> Maybe ReturnConsumedCapacity
returnConsumedCapacity :: Prelude.Maybe ReturnConsumedCapacity,
BatchWriteItem -> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics :: Prelude.Maybe ReturnItemCollectionMetrics,
BatchWriteItem -> HashMap Text (NonEmpty WriteRequest)
requestItems :: Prelude.HashMap Prelude.Text (Prelude.NonEmpty WriteRequest)
}
deriving (BatchWriteItem -> BatchWriteItem -> Bool
(BatchWriteItem -> BatchWriteItem -> Bool)
-> (BatchWriteItem -> BatchWriteItem -> Bool) -> Eq BatchWriteItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchWriteItem -> BatchWriteItem -> Bool
$c/= :: BatchWriteItem -> BatchWriteItem -> Bool
== :: BatchWriteItem -> BatchWriteItem -> Bool
$c== :: BatchWriteItem -> BatchWriteItem -> Bool
Prelude.Eq, ReadPrec [BatchWriteItem]
ReadPrec BatchWriteItem
Int -> ReadS BatchWriteItem
ReadS [BatchWriteItem]
(Int -> ReadS BatchWriteItem)
-> ReadS [BatchWriteItem]
-> ReadPrec BatchWriteItem
-> ReadPrec [BatchWriteItem]
-> Read BatchWriteItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchWriteItem]
$creadListPrec :: ReadPrec [BatchWriteItem]
readPrec :: ReadPrec BatchWriteItem
$creadPrec :: ReadPrec BatchWriteItem
readList :: ReadS [BatchWriteItem]
$creadList :: ReadS [BatchWriteItem]
readsPrec :: Int -> ReadS BatchWriteItem
$creadsPrec :: Int -> ReadS BatchWriteItem
Prelude.Read, Int -> BatchWriteItem -> ShowS
[BatchWriteItem] -> ShowS
BatchWriteItem -> String
(Int -> BatchWriteItem -> ShowS)
-> (BatchWriteItem -> String)
-> ([BatchWriteItem] -> ShowS)
-> Show BatchWriteItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchWriteItem] -> ShowS
$cshowList :: [BatchWriteItem] -> ShowS
show :: BatchWriteItem -> String
$cshow :: BatchWriteItem -> String
showsPrec :: Int -> BatchWriteItem -> ShowS
$cshowsPrec :: Int -> BatchWriteItem -> ShowS
Prelude.Show, (forall x. BatchWriteItem -> Rep BatchWriteItem x)
-> (forall x. Rep BatchWriteItem x -> BatchWriteItem)
-> Generic BatchWriteItem
forall x. Rep BatchWriteItem x -> BatchWriteItem
forall x. BatchWriteItem -> Rep BatchWriteItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchWriteItem x -> BatchWriteItem
$cfrom :: forall x. BatchWriteItem -> Rep BatchWriteItem x
Prelude.Generic)
newBatchWriteItem ::
BatchWriteItem
newBatchWriteItem :: BatchWriteItem
newBatchWriteItem =
BatchWriteItem' :: Maybe ReturnConsumedCapacity
-> Maybe ReturnItemCollectionMetrics
-> HashMap Text (NonEmpty WriteRequest)
-> BatchWriteItem
BatchWriteItem'
{ $sel:returnConsumedCapacity:BatchWriteItem' :: Maybe ReturnConsumedCapacity
returnConsumedCapacity =
Maybe ReturnConsumedCapacity
forall a. Maybe a
Prelude.Nothing,
$sel:returnItemCollectionMetrics:BatchWriteItem' :: Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics = Maybe ReturnItemCollectionMetrics
forall a. Maybe a
Prelude.Nothing,
$sel:requestItems:BatchWriteItem' :: HashMap Text (NonEmpty WriteRequest)
requestItems = HashMap Text (NonEmpty WriteRequest)
forall a. Monoid a => a
Prelude.mempty
}
batchWriteItem_returnConsumedCapacity :: Lens.Lens' BatchWriteItem (Prelude.Maybe ReturnConsumedCapacity)
batchWriteItem_returnConsumedCapacity :: (Maybe ReturnConsumedCapacity -> f (Maybe ReturnConsumedCapacity))
-> BatchWriteItem -> f BatchWriteItem
batchWriteItem_returnConsumedCapacity = (BatchWriteItem -> Maybe ReturnConsumedCapacity)
-> (BatchWriteItem
-> Maybe ReturnConsumedCapacity -> BatchWriteItem)
-> Lens
BatchWriteItem
BatchWriteItem
(Maybe ReturnConsumedCapacity)
(Maybe ReturnConsumedCapacity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteItem' {Maybe ReturnConsumedCapacity
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
$sel:returnConsumedCapacity:BatchWriteItem' :: BatchWriteItem -> Maybe ReturnConsumedCapacity
returnConsumedCapacity} -> Maybe ReturnConsumedCapacity
returnConsumedCapacity) (\s :: BatchWriteItem
s@BatchWriteItem' {} Maybe ReturnConsumedCapacity
a -> BatchWriteItem
s {$sel:returnConsumedCapacity:BatchWriteItem' :: Maybe ReturnConsumedCapacity
returnConsumedCapacity = Maybe ReturnConsumedCapacity
a} :: BatchWriteItem)
batchWriteItem_returnItemCollectionMetrics :: Lens.Lens' BatchWriteItem (Prelude.Maybe ReturnItemCollectionMetrics)
batchWriteItem_returnItemCollectionMetrics :: (Maybe ReturnItemCollectionMetrics
-> f (Maybe ReturnItemCollectionMetrics))
-> BatchWriteItem -> f BatchWriteItem
batchWriteItem_returnItemCollectionMetrics = (BatchWriteItem -> Maybe ReturnItemCollectionMetrics)
-> (BatchWriteItem
-> Maybe ReturnItemCollectionMetrics -> BatchWriteItem)
-> Lens
BatchWriteItem
BatchWriteItem
(Maybe ReturnItemCollectionMetrics)
(Maybe ReturnItemCollectionMetrics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteItem' {Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics :: Maybe ReturnItemCollectionMetrics
$sel:returnItemCollectionMetrics:BatchWriteItem' :: BatchWriteItem -> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics} -> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics) (\s :: BatchWriteItem
s@BatchWriteItem' {} Maybe ReturnItemCollectionMetrics
a -> BatchWriteItem
s {$sel:returnItemCollectionMetrics:BatchWriteItem' :: Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics = Maybe ReturnItemCollectionMetrics
a} :: BatchWriteItem)
batchWriteItem_requestItems :: Lens.Lens' BatchWriteItem (Prelude.HashMap Prelude.Text (Prelude.NonEmpty WriteRequest))
batchWriteItem_requestItems :: (HashMap Text (NonEmpty WriteRequest)
-> f (HashMap Text (NonEmpty WriteRequest)))
-> BatchWriteItem -> f BatchWriteItem
batchWriteItem_requestItems = (BatchWriteItem -> HashMap Text (NonEmpty WriteRequest))
-> (BatchWriteItem
-> HashMap Text (NonEmpty WriteRequest) -> BatchWriteItem)
-> Lens
BatchWriteItem
BatchWriteItem
(HashMap Text (NonEmpty WriteRequest))
(HashMap Text (NonEmpty WriteRequest))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteItem' {HashMap Text (NonEmpty WriteRequest)
requestItems :: HashMap Text (NonEmpty WriteRequest)
$sel:requestItems:BatchWriteItem' :: BatchWriteItem -> HashMap Text (NonEmpty WriteRequest)
requestItems} -> HashMap Text (NonEmpty WriteRequest)
requestItems) (\s :: BatchWriteItem
s@BatchWriteItem' {} HashMap Text (NonEmpty WriteRequest)
a -> BatchWriteItem
s {$sel:requestItems:BatchWriteItem' :: HashMap Text (NonEmpty WriteRequest)
requestItems = HashMap Text (NonEmpty WriteRequest)
a} :: BatchWriteItem) ((HashMap Text (NonEmpty WriteRequest)
-> f (HashMap Text (NonEmpty WriteRequest)))
-> BatchWriteItem -> f BatchWriteItem)
-> ((HashMap Text (NonEmpty WriteRequest)
-> f (HashMap Text (NonEmpty WriteRequest)))
-> HashMap Text (NonEmpty WriteRequest)
-> f (HashMap Text (NonEmpty WriteRequest)))
-> (HashMap Text (NonEmpty WriteRequest)
-> f (HashMap Text (NonEmpty WriteRequest)))
-> BatchWriteItem
-> f BatchWriteItem
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text (NonEmpty WriteRequest)
-> f (HashMap Text (NonEmpty WriteRequest)))
-> HashMap Text (NonEmpty WriteRequest)
-> f (HashMap Text (NonEmpty WriteRequest))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest BatchWriteItem where
type
AWSResponse BatchWriteItem =
BatchWriteItemResponse
request :: BatchWriteItem -> Request BatchWriteItem
request = Service -> BatchWriteItem -> Request BatchWriteItem
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy BatchWriteItem
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchWriteItem)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse BatchWriteItem))
-> Logger
-> Service
-> Proxy BatchWriteItem
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse BatchWriteItem)))
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 (HashMap Text [ItemCollectionMetrics])
-> Maybe [ConsumedCapacity]
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> Int
-> BatchWriteItemResponse
BatchWriteItemResponse'
(Maybe (HashMap Text [ItemCollectionMetrics])
-> Maybe [ConsumedCapacity]
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> Int
-> BatchWriteItemResponse)
-> Either String (Maybe (HashMap Text [ItemCollectionMetrics]))
-> Either
String
(Maybe [ConsumedCapacity]
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> Int
-> BatchWriteItemResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text
-> Either
String (Maybe (Maybe (HashMap Text [ItemCollectionMetrics])))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ItemCollectionMetrics"
Either
String (Maybe (Maybe (HashMap Text [ItemCollectionMetrics])))
-> Maybe (HashMap Text [ItemCollectionMetrics])
-> Either String (Maybe (HashMap Text [ItemCollectionMetrics]))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text [ItemCollectionMetrics])
forall a. Monoid a => a
Prelude.mempty
)
Either
String
(Maybe [ConsumedCapacity]
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> Int
-> BatchWriteItemResponse)
-> Either String (Maybe [ConsumedCapacity])
-> Either
String
(Maybe (HashMap Text (NonEmpty WriteRequest))
-> Int -> BatchWriteItemResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ConsumedCapacity]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConsumedCapacity"
Either String (Maybe (Maybe [ConsumedCapacity]))
-> Maybe [ConsumedCapacity]
-> Either String (Maybe [ConsumedCapacity])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ConsumedCapacity]
forall a. Monoid a => a
Prelude.mempty
)
Either
String
(Maybe (HashMap Text (NonEmpty WriteRequest))
-> Int -> BatchWriteItemResponse)
-> Either String (Maybe (HashMap Text (NonEmpty WriteRequest)))
-> Either String (Int -> BatchWriteItemResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either
String (Maybe (Maybe (HashMap Text (NonEmpty WriteRequest))))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UnprocessedItems"
Either
String (Maybe (Maybe (HashMap Text (NonEmpty WriteRequest))))
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> Either String (Maybe (HashMap Text (NonEmpty WriteRequest)))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text (NonEmpty WriteRequest))
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> BatchWriteItemResponse)
-> Either String Int -> Either String BatchWriteItemResponse
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 BatchWriteItem
instance Prelude.NFData BatchWriteItem
instance Core.ToHeaders BatchWriteItem where
toHeaders :: BatchWriteItem -> ResponseHeaders
toHeaders =
ResponseHeaders -> BatchWriteItem -> 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.BatchWriteItem" ::
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 BatchWriteItem where
toJSON :: BatchWriteItem -> Value
toJSON BatchWriteItem' {Maybe ReturnConsumedCapacity
Maybe ReturnItemCollectionMetrics
HashMap Text (NonEmpty WriteRequest)
requestItems :: HashMap Text (NonEmpty WriteRequest)
returnItemCollectionMetrics :: Maybe ReturnItemCollectionMetrics
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
$sel:requestItems:BatchWriteItem' :: BatchWriteItem -> HashMap Text (NonEmpty WriteRequest)
$sel:returnItemCollectionMetrics:BatchWriteItem' :: BatchWriteItem -> Maybe ReturnItemCollectionMetrics
$sel:returnConsumedCapacity:BatchWriteItem' :: BatchWriteItem -> Maybe ReturnConsumedCapacity
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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,
(Text
"ReturnItemCollectionMetrics" Text -> ReturnItemCollectionMetrics -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(ReturnItemCollectionMetrics -> Pair)
-> Maybe ReturnItemCollectionMetrics -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"RequestItems" Text -> HashMap Text (NonEmpty WriteRequest) -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= HashMap Text (NonEmpty WriteRequest)
requestItems)
]
)
instance Core.ToPath BatchWriteItem where
toPath :: BatchWriteItem -> ByteString
toPath = ByteString -> BatchWriteItem -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery BatchWriteItem where
toQuery :: BatchWriteItem -> QueryString
toQuery = QueryString -> BatchWriteItem -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data BatchWriteItemResponse = BatchWriteItemResponse'
{
BatchWriteItemResponse
-> Maybe (HashMap Text [ItemCollectionMetrics])
itemCollectionMetrics :: Prelude.Maybe (Prelude.HashMap Prelude.Text [ItemCollectionMetrics]),
BatchWriteItemResponse -> Maybe [ConsumedCapacity]
consumedCapacity :: Prelude.Maybe [ConsumedCapacity],
BatchWriteItemResponse
-> Maybe (HashMap Text (NonEmpty WriteRequest))
unprocessedItems :: Prelude.Maybe (Prelude.HashMap Prelude.Text (Prelude.NonEmpty WriteRequest)),
BatchWriteItemResponse -> Int
httpStatus :: Prelude.Int
}
deriving (BatchWriteItemResponse -> BatchWriteItemResponse -> Bool
(BatchWriteItemResponse -> BatchWriteItemResponse -> Bool)
-> (BatchWriteItemResponse -> BatchWriteItemResponse -> Bool)
-> Eq BatchWriteItemResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchWriteItemResponse -> BatchWriteItemResponse -> Bool
$c/= :: BatchWriteItemResponse -> BatchWriteItemResponse -> Bool
== :: BatchWriteItemResponse -> BatchWriteItemResponse -> Bool
$c== :: BatchWriteItemResponse -> BatchWriteItemResponse -> Bool
Prelude.Eq, ReadPrec [BatchWriteItemResponse]
ReadPrec BatchWriteItemResponse
Int -> ReadS BatchWriteItemResponse
ReadS [BatchWriteItemResponse]
(Int -> ReadS BatchWriteItemResponse)
-> ReadS [BatchWriteItemResponse]
-> ReadPrec BatchWriteItemResponse
-> ReadPrec [BatchWriteItemResponse]
-> Read BatchWriteItemResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchWriteItemResponse]
$creadListPrec :: ReadPrec [BatchWriteItemResponse]
readPrec :: ReadPrec BatchWriteItemResponse
$creadPrec :: ReadPrec BatchWriteItemResponse
readList :: ReadS [BatchWriteItemResponse]
$creadList :: ReadS [BatchWriteItemResponse]
readsPrec :: Int -> ReadS BatchWriteItemResponse
$creadsPrec :: Int -> ReadS BatchWriteItemResponse
Prelude.Read, Int -> BatchWriteItemResponse -> ShowS
[BatchWriteItemResponse] -> ShowS
BatchWriteItemResponse -> String
(Int -> BatchWriteItemResponse -> ShowS)
-> (BatchWriteItemResponse -> String)
-> ([BatchWriteItemResponse] -> ShowS)
-> Show BatchWriteItemResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchWriteItemResponse] -> ShowS
$cshowList :: [BatchWriteItemResponse] -> ShowS
show :: BatchWriteItemResponse -> String
$cshow :: BatchWriteItemResponse -> String
showsPrec :: Int -> BatchWriteItemResponse -> ShowS
$cshowsPrec :: Int -> BatchWriteItemResponse -> ShowS
Prelude.Show, (forall x. BatchWriteItemResponse -> Rep BatchWriteItemResponse x)
-> (forall x.
Rep BatchWriteItemResponse x -> BatchWriteItemResponse)
-> Generic BatchWriteItemResponse
forall x. Rep BatchWriteItemResponse x -> BatchWriteItemResponse
forall x. BatchWriteItemResponse -> Rep BatchWriteItemResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchWriteItemResponse x -> BatchWriteItemResponse
$cfrom :: forall x. BatchWriteItemResponse -> Rep BatchWriteItemResponse x
Prelude.Generic)
newBatchWriteItemResponse ::
Prelude.Int ->
BatchWriteItemResponse
newBatchWriteItemResponse :: Int -> BatchWriteItemResponse
newBatchWriteItemResponse Int
pHttpStatus_ =
BatchWriteItemResponse' :: Maybe (HashMap Text [ItemCollectionMetrics])
-> Maybe [ConsumedCapacity]
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> Int
-> BatchWriteItemResponse
BatchWriteItemResponse'
{ $sel:itemCollectionMetrics:BatchWriteItemResponse' :: Maybe (HashMap Text [ItemCollectionMetrics])
itemCollectionMetrics =
Maybe (HashMap Text [ItemCollectionMetrics])
forall a. Maybe a
Prelude.Nothing,
$sel:consumedCapacity:BatchWriteItemResponse' :: Maybe [ConsumedCapacity]
consumedCapacity = Maybe [ConsumedCapacity]
forall a. Maybe a
Prelude.Nothing,
$sel:unprocessedItems:BatchWriteItemResponse' :: Maybe (HashMap Text (NonEmpty WriteRequest))
unprocessedItems = Maybe (HashMap Text (NonEmpty WriteRequest))
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:BatchWriteItemResponse' :: Int
httpStatus = Int
pHttpStatus_
}
batchWriteItemResponse_itemCollectionMetrics :: Lens.Lens' BatchWriteItemResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text [ItemCollectionMetrics]))
batchWriteItemResponse_itemCollectionMetrics :: (Maybe (HashMap Text [ItemCollectionMetrics])
-> f (Maybe (HashMap Text [ItemCollectionMetrics])))
-> BatchWriteItemResponse -> f BatchWriteItemResponse
batchWriteItemResponse_itemCollectionMetrics = (BatchWriteItemResponse
-> Maybe (HashMap Text [ItemCollectionMetrics]))
-> (BatchWriteItemResponse
-> Maybe (HashMap Text [ItemCollectionMetrics])
-> BatchWriteItemResponse)
-> Lens
BatchWriteItemResponse
BatchWriteItemResponse
(Maybe (HashMap Text [ItemCollectionMetrics]))
(Maybe (HashMap Text [ItemCollectionMetrics]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteItemResponse' {Maybe (HashMap Text [ItemCollectionMetrics])
itemCollectionMetrics :: Maybe (HashMap Text [ItemCollectionMetrics])
$sel:itemCollectionMetrics:BatchWriteItemResponse' :: BatchWriteItemResponse
-> Maybe (HashMap Text [ItemCollectionMetrics])
itemCollectionMetrics} -> Maybe (HashMap Text [ItemCollectionMetrics])
itemCollectionMetrics) (\s :: BatchWriteItemResponse
s@BatchWriteItemResponse' {} Maybe (HashMap Text [ItemCollectionMetrics])
a -> BatchWriteItemResponse
s {$sel:itemCollectionMetrics:BatchWriteItemResponse' :: Maybe (HashMap Text [ItemCollectionMetrics])
itemCollectionMetrics = Maybe (HashMap Text [ItemCollectionMetrics])
a} :: BatchWriteItemResponse) ((Maybe (HashMap Text [ItemCollectionMetrics])
-> f (Maybe (HashMap Text [ItemCollectionMetrics])))
-> BatchWriteItemResponse -> f BatchWriteItemResponse)
-> ((Maybe (HashMap Text [ItemCollectionMetrics])
-> f (Maybe (HashMap Text [ItemCollectionMetrics])))
-> Maybe (HashMap Text [ItemCollectionMetrics])
-> f (Maybe (HashMap Text [ItemCollectionMetrics])))
-> (Maybe (HashMap Text [ItemCollectionMetrics])
-> f (Maybe (HashMap Text [ItemCollectionMetrics])))
-> BatchWriteItemResponse
-> f BatchWriteItemResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text [ItemCollectionMetrics])
(HashMap Text [ItemCollectionMetrics])
(HashMap Text [ItemCollectionMetrics])
(HashMap Text [ItemCollectionMetrics])
-> Iso
(Maybe (HashMap Text [ItemCollectionMetrics]))
(Maybe (HashMap Text [ItemCollectionMetrics]))
(Maybe (HashMap Text [ItemCollectionMetrics]))
(Maybe (HashMap Text [ItemCollectionMetrics]))
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 [ItemCollectionMetrics])
(HashMap Text [ItemCollectionMetrics])
(HashMap Text [ItemCollectionMetrics])
(HashMap Text [ItemCollectionMetrics])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchWriteItemResponse_consumedCapacity :: Lens.Lens' BatchWriteItemResponse (Prelude.Maybe [ConsumedCapacity])
batchWriteItemResponse_consumedCapacity :: (Maybe [ConsumedCapacity] -> f (Maybe [ConsumedCapacity]))
-> BatchWriteItemResponse -> f BatchWriteItemResponse
batchWriteItemResponse_consumedCapacity = (BatchWriteItemResponse -> Maybe [ConsumedCapacity])
-> (BatchWriteItemResponse
-> Maybe [ConsumedCapacity] -> BatchWriteItemResponse)
-> Lens
BatchWriteItemResponse
BatchWriteItemResponse
(Maybe [ConsumedCapacity])
(Maybe [ConsumedCapacity])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteItemResponse' {Maybe [ConsumedCapacity]
consumedCapacity :: Maybe [ConsumedCapacity]
$sel:consumedCapacity:BatchWriteItemResponse' :: BatchWriteItemResponse -> Maybe [ConsumedCapacity]
consumedCapacity} -> Maybe [ConsumedCapacity]
consumedCapacity) (\s :: BatchWriteItemResponse
s@BatchWriteItemResponse' {} Maybe [ConsumedCapacity]
a -> BatchWriteItemResponse
s {$sel:consumedCapacity:BatchWriteItemResponse' :: Maybe [ConsumedCapacity]
consumedCapacity = Maybe [ConsumedCapacity]
a} :: BatchWriteItemResponse) ((Maybe [ConsumedCapacity] -> f (Maybe [ConsumedCapacity]))
-> BatchWriteItemResponse -> f BatchWriteItemResponse)
-> ((Maybe [ConsumedCapacity] -> f (Maybe [ConsumedCapacity]))
-> Maybe [ConsumedCapacity] -> f (Maybe [ConsumedCapacity]))
-> (Maybe [ConsumedCapacity] -> f (Maybe [ConsumedCapacity]))
-> BatchWriteItemResponse
-> f BatchWriteItemResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ConsumedCapacity]
[ConsumedCapacity]
[ConsumedCapacity]
[ConsumedCapacity]
-> Iso
(Maybe [ConsumedCapacity])
(Maybe [ConsumedCapacity])
(Maybe [ConsumedCapacity])
(Maybe [ConsumedCapacity])
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
[ConsumedCapacity]
[ConsumedCapacity]
[ConsumedCapacity]
[ConsumedCapacity]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchWriteItemResponse_unprocessedItems :: Lens.Lens' BatchWriteItemResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text (Prelude.NonEmpty WriteRequest)))
batchWriteItemResponse_unprocessedItems :: (Maybe (HashMap Text (NonEmpty WriteRequest))
-> f (Maybe (HashMap Text (NonEmpty WriteRequest))))
-> BatchWriteItemResponse -> f BatchWriteItemResponse
batchWriteItemResponse_unprocessedItems = (BatchWriteItemResponse
-> Maybe (HashMap Text (NonEmpty WriteRequest)))
-> (BatchWriteItemResponse
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> BatchWriteItemResponse)
-> Lens
BatchWriteItemResponse
BatchWriteItemResponse
(Maybe (HashMap Text (NonEmpty WriteRequest)))
(Maybe (HashMap Text (NonEmpty WriteRequest)))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteItemResponse' {Maybe (HashMap Text (NonEmpty WriteRequest))
unprocessedItems :: Maybe (HashMap Text (NonEmpty WriteRequest))
$sel:unprocessedItems:BatchWriteItemResponse' :: BatchWriteItemResponse
-> Maybe (HashMap Text (NonEmpty WriteRequest))
unprocessedItems} -> Maybe (HashMap Text (NonEmpty WriteRequest))
unprocessedItems) (\s :: BatchWriteItemResponse
s@BatchWriteItemResponse' {} Maybe (HashMap Text (NonEmpty WriteRequest))
a -> BatchWriteItemResponse
s {$sel:unprocessedItems:BatchWriteItemResponse' :: Maybe (HashMap Text (NonEmpty WriteRequest))
unprocessedItems = Maybe (HashMap Text (NonEmpty WriteRequest))
a} :: BatchWriteItemResponse) ((Maybe (HashMap Text (NonEmpty WriteRequest))
-> f (Maybe (HashMap Text (NonEmpty WriteRequest))))
-> BatchWriteItemResponse -> f BatchWriteItemResponse)
-> ((Maybe (HashMap Text (NonEmpty WriteRequest))
-> f (Maybe (HashMap Text (NonEmpty WriteRequest))))
-> Maybe (HashMap Text (NonEmpty WriteRequest))
-> f (Maybe (HashMap Text (NonEmpty WriteRequest))))
-> (Maybe (HashMap Text (NonEmpty WriteRequest))
-> f (Maybe (HashMap Text (NonEmpty WriteRequest))))
-> BatchWriteItemResponse
-> f BatchWriteItemResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text (NonEmpty WriteRequest))
(HashMap Text (NonEmpty WriteRequest))
(HashMap Text (NonEmpty WriteRequest))
(HashMap Text (NonEmpty WriteRequest))
-> Iso
(Maybe (HashMap Text (NonEmpty WriteRequest)))
(Maybe (HashMap Text (NonEmpty WriteRequest)))
(Maybe (HashMap Text (NonEmpty WriteRequest)))
(Maybe (HashMap Text (NonEmpty WriteRequest)))
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 (NonEmpty WriteRequest))
(HashMap Text (NonEmpty WriteRequest))
(HashMap Text (NonEmpty WriteRequest))
(HashMap Text (NonEmpty WriteRequest))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchWriteItemResponse_httpStatus :: Lens.Lens' BatchWriteItemResponse Prelude.Int
batchWriteItemResponse_httpStatus :: (Int -> f Int)
-> BatchWriteItemResponse -> f BatchWriteItemResponse
batchWriteItemResponse_httpStatus = (BatchWriteItemResponse -> Int)
-> (BatchWriteItemResponse -> Int -> BatchWriteItemResponse)
-> Lens BatchWriteItemResponse BatchWriteItemResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchWriteItemResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchWriteItemResponse' :: BatchWriteItemResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchWriteItemResponse
s@BatchWriteItemResponse' {} Int
a -> BatchWriteItemResponse
s {$sel:httpStatus:BatchWriteItemResponse' :: Int
httpStatus = Int
a} :: BatchWriteItemResponse)
instance Prelude.NFData BatchWriteItemResponse