{-# 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.DeleteItem
(
DeleteItem (..),
newDeleteItem,
deleteItem_conditionExpression,
deleteItem_conditionalOperator,
deleteItem_expected,
deleteItem_expressionAttributeNames,
deleteItem_expressionAttributeValues,
deleteItem_returnConsumedCapacity,
deleteItem_returnItemCollectionMetrics,
deleteItem_returnValues,
deleteItem_tableName,
deleteItem_key,
DeleteItemResponse (..),
newDeleteItemResponse,
deleteItemResponse_attributes,
deleteItemResponse_consumedCapacity,
deleteItemResponse_itemCollectionMetrics,
deleteItemResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DynamoDB.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteItem = DeleteItem'
{
DeleteItem -> Maybe Text
conditionExpression :: Prelude.Maybe Prelude.Text,
DeleteItem -> Maybe ConditionalOperator
conditionalOperator :: Prelude.Maybe ConditionalOperator,
DeleteItem -> Maybe (HashMap Text ExpectedAttributeValue)
expected :: Prelude.Maybe (Prelude.HashMap Prelude.Text ExpectedAttributeValue),
DeleteItem -> Maybe (HashMap Text Text)
expressionAttributeNames :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DeleteItem -> Maybe (HashMap Text AttributeValue)
expressionAttributeValues :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue),
DeleteItem -> Maybe ReturnConsumedCapacity
returnConsumedCapacity :: Prelude.Maybe ReturnConsumedCapacity,
DeleteItem -> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics :: Prelude.Maybe ReturnItemCollectionMetrics,
DeleteItem -> Maybe ReturnValue
returnValues :: Prelude.Maybe ReturnValue,
DeleteItem -> Text
tableName :: Prelude.Text,
DeleteItem -> HashMap Text AttributeValue
key :: Prelude.HashMap Prelude.Text AttributeValue
}
deriving (DeleteItem -> DeleteItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteItem -> DeleteItem -> Bool
$c/= :: DeleteItem -> DeleteItem -> Bool
== :: DeleteItem -> DeleteItem -> Bool
$c== :: DeleteItem -> DeleteItem -> Bool
Prelude.Eq, ReadPrec [DeleteItem]
ReadPrec DeleteItem
Int -> ReadS DeleteItem
ReadS [DeleteItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteItem]
$creadListPrec :: ReadPrec [DeleteItem]
readPrec :: ReadPrec DeleteItem
$creadPrec :: ReadPrec DeleteItem
readList :: ReadS [DeleteItem]
$creadList :: ReadS [DeleteItem]
readsPrec :: Int -> ReadS DeleteItem
$creadsPrec :: Int -> ReadS DeleteItem
Prelude.Read, Int -> DeleteItem -> ShowS
[DeleteItem] -> ShowS
DeleteItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteItem] -> ShowS
$cshowList :: [DeleteItem] -> ShowS
show :: DeleteItem -> String
$cshow :: DeleteItem -> String
showsPrec :: Int -> DeleteItem -> ShowS
$cshowsPrec :: Int -> DeleteItem -> ShowS
Prelude.Show, forall x. Rep DeleteItem x -> DeleteItem
forall x. DeleteItem -> Rep DeleteItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteItem x -> DeleteItem
$cfrom :: forall x. DeleteItem -> Rep DeleteItem x
Prelude.Generic)
newDeleteItem ::
Prelude.Text ->
DeleteItem
newDeleteItem :: Text -> DeleteItem
newDeleteItem Text
pTableName_ =
DeleteItem'
{ $sel:conditionExpression:DeleteItem' :: Maybe Text
conditionExpression = forall a. Maybe a
Prelude.Nothing,
$sel:conditionalOperator:DeleteItem' :: Maybe ConditionalOperator
conditionalOperator = forall a. Maybe a
Prelude.Nothing,
$sel:expected:DeleteItem' :: Maybe (HashMap Text ExpectedAttributeValue)
expected = forall a. Maybe a
Prelude.Nothing,
$sel:expressionAttributeNames:DeleteItem' :: Maybe (HashMap Text Text)
expressionAttributeNames = forall a. Maybe a
Prelude.Nothing,
$sel:expressionAttributeValues:DeleteItem' :: Maybe (HashMap Text AttributeValue)
expressionAttributeValues = forall a. Maybe a
Prelude.Nothing,
$sel:returnConsumedCapacity:DeleteItem' :: Maybe ReturnConsumedCapacity
returnConsumedCapacity = forall a. Maybe a
Prelude.Nothing,
$sel:returnItemCollectionMetrics:DeleteItem' :: Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics = forall a. Maybe a
Prelude.Nothing,
$sel:returnValues:DeleteItem' :: Maybe ReturnValue
returnValues = forall a. Maybe a
Prelude.Nothing,
$sel:tableName:DeleteItem' :: Text
tableName = Text
pTableName_,
$sel:key:DeleteItem' :: HashMap Text AttributeValue
key = forall a. Monoid a => a
Prelude.mempty
}
deleteItem_conditionExpression :: Lens.Lens' DeleteItem (Prelude.Maybe Prelude.Text)
deleteItem_conditionExpression :: Lens' DeleteItem (Maybe Text)
deleteItem_conditionExpression = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe Text
conditionExpression :: Maybe Text
$sel:conditionExpression:DeleteItem' :: DeleteItem -> Maybe Text
conditionExpression} -> Maybe Text
conditionExpression) (\s :: DeleteItem
s@DeleteItem' {} Maybe Text
a -> DeleteItem
s {$sel:conditionExpression:DeleteItem' :: Maybe Text
conditionExpression = Maybe Text
a} :: DeleteItem)
deleteItem_conditionalOperator :: Lens.Lens' DeleteItem (Prelude.Maybe ConditionalOperator)
deleteItem_conditionalOperator :: Lens' DeleteItem (Maybe ConditionalOperator)
deleteItem_conditionalOperator = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe ConditionalOperator
conditionalOperator :: Maybe ConditionalOperator
$sel:conditionalOperator:DeleteItem' :: DeleteItem -> Maybe ConditionalOperator
conditionalOperator} -> Maybe ConditionalOperator
conditionalOperator) (\s :: DeleteItem
s@DeleteItem' {} Maybe ConditionalOperator
a -> DeleteItem
s {$sel:conditionalOperator:DeleteItem' :: Maybe ConditionalOperator
conditionalOperator = Maybe ConditionalOperator
a} :: DeleteItem)
deleteItem_expected :: Lens.Lens' DeleteItem (Prelude.Maybe (Prelude.HashMap Prelude.Text ExpectedAttributeValue))
deleteItem_expected :: Lens' DeleteItem (Maybe (HashMap Text ExpectedAttributeValue))
deleteItem_expected = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe (HashMap Text ExpectedAttributeValue)
expected :: Maybe (HashMap Text ExpectedAttributeValue)
$sel:expected:DeleteItem' :: DeleteItem -> Maybe (HashMap Text ExpectedAttributeValue)
expected} -> Maybe (HashMap Text ExpectedAttributeValue)
expected) (\s :: DeleteItem
s@DeleteItem' {} Maybe (HashMap Text ExpectedAttributeValue)
a -> DeleteItem
s {$sel:expected:DeleteItem' :: Maybe (HashMap Text ExpectedAttributeValue)
expected = Maybe (HashMap Text ExpectedAttributeValue)
a} :: DeleteItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteItem_expressionAttributeNames :: Lens.Lens' DeleteItem (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
deleteItem_expressionAttributeNames :: Lens' DeleteItem (Maybe (HashMap Text Text))
deleteItem_expressionAttributeNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe (HashMap Text Text)
expressionAttributeNames :: Maybe (HashMap Text Text)
$sel:expressionAttributeNames:DeleteItem' :: DeleteItem -> Maybe (HashMap Text Text)
expressionAttributeNames} -> Maybe (HashMap Text Text)
expressionAttributeNames) (\s :: DeleteItem
s@DeleteItem' {} Maybe (HashMap Text Text)
a -> DeleteItem
s {$sel:expressionAttributeNames:DeleteItem' :: Maybe (HashMap Text Text)
expressionAttributeNames = Maybe (HashMap Text Text)
a} :: DeleteItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteItem_expressionAttributeValues :: Lens.Lens' DeleteItem (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
deleteItem_expressionAttributeValues :: Lens' DeleteItem (Maybe (HashMap Text AttributeValue))
deleteItem_expressionAttributeValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe (HashMap Text AttributeValue)
expressionAttributeValues :: Maybe (HashMap Text AttributeValue)
$sel:expressionAttributeValues:DeleteItem' :: DeleteItem -> Maybe (HashMap Text AttributeValue)
expressionAttributeValues} -> Maybe (HashMap Text AttributeValue)
expressionAttributeValues) (\s :: DeleteItem
s@DeleteItem' {} Maybe (HashMap Text AttributeValue)
a -> DeleteItem
s {$sel:expressionAttributeValues:DeleteItem' :: Maybe (HashMap Text AttributeValue)
expressionAttributeValues = Maybe (HashMap Text AttributeValue)
a} :: DeleteItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteItem_returnConsumedCapacity :: Lens.Lens' DeleteItem (Prelude.Maybe ReturnConsumedCapacity)
deleteItem_returnConsumedCapacity :: Lens' DeleteItem (Maybe ReturnConsumedCapacity)
deleteItem_returnConsumedCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe ReturnConsumedCapacity
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
$sel:returnConsumedCapacity:DeleteItem' :: DeleteItem -> Maybe ReturnConsumedCapacity
returnConsumedCapacity} -> Maybe ReturnConsumedCapacity
returnConsumedCapacity) (\s :: DeleteItem
s@DeleteItem' {} Maybe ReturnConsumedCapacity
a -> DeleteItem
s {$sel:returnConsumedCapacity:DeleteItem' :: Maybe ReturnConsumedCapacity
returnConsumedCapacity = Maybe ReturnConsumedCapacity
a} :: DeleteItem)
deleteItem_returnItemCollectionMetrics :: Lens.Lens' DeleteItem (Prelude.Maybe ReturnItemCollectionMetrics)
deleteItem_returnItemCollectionMetrics :: Lens' DeleteItem (Maybe ReturnItemCollectionMetrics)
deleteItem_returnItemCollectionMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics :: Maybe ReturnItemCollectionMetrics
$sel:returnItemCollectionMetrics:DeleteItem' :: DeleteItem -> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics} -> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics) (\s :: DeleteItem
s@DeleteItem' {} Maybe ReturnItemCollectionMetrics
a -> DeleteItem
s {$sel:returnItemCollectionMetrics:DeleteItem' :: Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics = Maybe ReturnItemCollectionMetrics
a} :: DeleteItem)
deleteItem_returnValues :: Lens.Lens' DeleteItem (Prelude.Maybe ReturnValue)
deleteItem_returnValues :: Lens' DeleteItem (Maybe ReturnValue)
deleteItem_returnValues = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Maybe ReturnValue
returnValues :: Maybe ReturnValue
$sel:returnValues:DeleteItem' :: DeleteItem -> Maybe ReturnValue
returnValues} -> Maybe ReturnValue
returnValues) (\s :: DeleteItem
s@DeleteItem' {} Maybe ReturnValue
a -> DeleteItem
s {$sel:returnValues:DeleteItem' :: Maybe ReturnValue
returnValues = Maybe ReturnValue
a} :: DeleteItem)
deleteItem_tableName :: Lens.Lens' DeleteItem Prelude.Text
deleteItem_tableName :: Lens' DeleteItem Text
deleteItem_tableName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {Text
tableName :: Text
$sel:tableName:DeleteItem' :: DeleteItem -> Text
tableName} -> Text
tableName) (\s :: DeleteItem
s@DeleteItem' {} Text
a -> DeleteItem
s {$sel:tableName:DeleteItem' :: Text
tableName = Text
a} :: DeleteItem)
deleteItem_key :: Lens.Lens' DeleteItem (Prelude.HashMap Prelude.Text AttributeValue)
deleteItem_key :: Lens' DeleteItem (HashMap Text AttributeValue)
deleteItem_key = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItem' {HashMap Text AttributeValue
key :: HashMap Text AttributeValue
$sel:key:DeleteItem' :: DeleteItem -> HashMap Text AttributeValue
key} -> HashMap Text AttributeValue
key) (\s :: DeleteItem
s@DeleteItem' {} HashMap Text AttributeValue
a -> DeleteItem
s {$sel:key:DeleteItem' :: HashMap Text AttributeValue
key = HashMap Text AttributeValue
a} :: DeleteItem) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest DeleteItem where
type AWSResponse DeleteItem = DeleteItemResponse
request :: (Service -> Service) -> DeleteItem -> Request DeleteItem
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteItem
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteItem)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe (HashMap Text AttributeValue)
-> Maybe ConsumedCapacity
-> Maybe ItemCollectionMetrics
-> Int
-> DeleteItemResponse
DeleteItemResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Attributes" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ConsumedCapacity")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ItemCollectionMetrics")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteItem where
hashWithSalt :: Int -> DeleteItem -> Int
hashWithSalt Int
_salt DeleteItem' {Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text AttributeValue)
Maybe (HashMap Text ExpectedAttributeValue)
Maybe ReturnValue
Maybe ReturnItemCollectionMetrics
Maybe ReturnConsumedCapacity
Maybe ConditionalOperator
Text
HashMap Text AttributeValue
key :: HashMap Text AttributeValue
tableName :: Text
returnValues :: Maybe ReturnValue
returnItemCollectionMetrics :: Maybe ReturnItemCollectionMetrics
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
expressionAttributeValues :: Maybe (HashMap Text AttributeValue)
expressionAttributeNames :: Maybe (HashMap Text Text)
expected :: Maybe (HashMap Text ExpectedAttributeValue)
conditionalOperator :: Maybe ConditionalOperator
conditionExpression :: Maybe Text
$sel:key:DeleteItem' :: DeleteItem -> HashMap Text AttributeValue
$sel:tableName:DeleteItem' :: DeleteItem -> Text
$sel:returnValues:DeleteItem' :: DeleteItem -> Maybe ReturnValue
$sel:returnItemCollectionMetrics:DeleteItem' :: DeleteItem -> Maybe ReturnItemCollectionMetrics
$sel:returnConsumedCapacity:DeleteItem' :: DeleteItem -> Maybe ReturnConsumedCapacity
$sel:expressionAttributeValues:DeleteItem' :: DeleteItem -> Maybe (HashMap Text AttributeValue)
$sel:expressionAttributeNames:DeleteItem' :: DeleteItem -> Maybe (HashMap Text Text)
$sel:expected:DeleteItem' :: DeleteItem -> Maybe (HashMap Text ExpectedAttributeValue)
$sel:conditionalOperator:DeleteItem' :: DeleteItem -> Maybe ConditionalOperator
$sel:conditionExpression:DeleteItem' :: DeleteItem -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
conditionExpression
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ConditionalOperator
conditionalOperator
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text ExpectedAttributeValue)
expected
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
expressionAttributeNames
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text AttributeValue)
expressionAttributeValues
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReturnConsumedCapacity
returnConsumedCapacity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ReturnValue
returnValues
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
tableName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text AttributeValue
key
instance Prelude.NFData DeleteItem where
rnf :: DeleteItem -> ()
rnf DeleteItem' {Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text AttributeValue)
Maybe (HashMap Text ExpectedAttributeValue)
Maybe ReturnValue
Maybe ReturnItemCollectionMetrics
Maybe ReturnConsumedCapacity
Maybe ConditionalOperator
Text
HashMap Text AttributeValue
key :: HashMap Text AttributeValue
tableName :: Text
returnValues :: Maybe ReturnValue
returnItemCollectionMetrics :: Maybe ReturnItemCollectionMetrics
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
expressionAttributeValues :: Maybe (HashMap Text AttributeValue)
expressionAttributeNames :: Maybe (HashMap Text Text)
expected :: Maybe (HashMap Text ExpectedAttributeValue)
conditionalOperator :: Maybe ConditionalOperator
conditionExpression :: Maybe Text
$sel:key:DeleteItem' :: DeleteItem -> HashMap Text AttributeValue
$sel:tableName:DeleteItem' :: DeleteItem -> Text
$sel:returnValues:DeleteItem' :: DeleteItem -> Maybe ReturnValue
$sel:returnItemCollectionMetrics:DeleteItem' :: DeleteItem -> Maybe ReturnItemCollectionMetrics
$sel:returnConsumedCapacity:DeleteItem' :: DeleteItem -> Maybe ReturnConsumedCapacity
$sel:expressionAttributeValues:DeleteItem' :: DeleteItem -> Maybe (HashMap Text AttributeValue)
$sel:expressionAttributeNames:DeleteItem' :: DeleteItem -> Maybe (HashMap Text Text)
$sel:expected:DeleteItem' :: DeleteItem -> Maybe (HashMap Text ExpectedAttributeValue)
$sel:conditionalOperator:DeleteItem' :: DeleteItem -> Maybe ConditionalOperator
$sel:conditionExpression:DeleteItem' :: DeleteItem -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
conditionExpression
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConditionalOperator
conditionalOperator
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text ExpectedAttributeValue)
expected
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
expressionAttributeNames
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text AttributeValue)
expressionAttributeValues
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReturnConsumedCapacity
returnConsumedCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ReturnValue
returnValues
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
tableName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HashMap Text AttributeValue
key
instance Data.ToHeaders DeleteItem where
toHeaders :: DeleteItem -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"DynamoDB_20120810.DeleteItem" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteItem where
toJSON :: DeleteItem -> Value
toJSON DeleteItem' {Maybe Text
Maybe (HashMap Text Text)
Maybe (HashMap Text AttributeValue)
Maybe (HashMap Text ExpectedAttributeValue)
Maybe ReturnValue
Maybe ReturnItemCollectionMetrics
Maybe ReturnConsumedCapacity
Maybe ConditionalOperator
Text
HashMap Text AttributeValue
key :: HashMap Text AttributeValue
tableName :: Text
returnValues :: Maybe ReturnValue
returnItemCollectionMetrics :: Maybe ReturnItemCollectionMetrics
returnConsumedCapacity :: Maybe ReturnConsumedCapacity
expressionAttributeValues :: Maybe (HashMap Text AttributeValue)
expressionAttributeNames :: Maybe (HashMap Text Text)
expected :: Maybe (HashMap Text ExpectedAttributeValue)
conditionalOperator :: Maybe ConditionalOperator
conditionExpression :: Maybe Text
$sel:key:DeleteItem' :: DeleteItem -> HashMap Text AttributeValue
$sel:tableName:DeleteItem' :: DeleteItem -> Text
$sel:returnValues:DeleteItem' :: DeleteItem -> Maybe ReturnValue
$sel:returnItemCollectionMetrics:DeleteItem' :: DeleteItem -> Maybe ReturnItemCollectionMetrics
$sel:returnConsumedCapacity:DeleteItem' :: DeleteItem -> Maybe ReturnConsumedCapacity
$sel:expressionAttributeValues:DeleteItem' :: DeleteItem -> Maybe (HashMap Text AttributeValue)
$sel:expressionAttributeNames:DeleteItem' :: DeleteItem -> Maybe (HashMap Text Text)
$sel:expected:DeleteItem' :: DeleteItem -> Maybe (HashMap Text ExpectedAttributeValue)
$sel:conditionalOperator:DeleteItem' :: DeleteItem -> Maybe ConditionalOperator
$sel:conditionExpression:DeleteItem' :: DeleteItem -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ConditionExpression" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
conditionExpression,
(Key
"ConditionalOperator" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ConditionalOperator
conditionalOperator,
(Key
"Expected" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text ExpectedAttributeValue)
expected,
(Key
"ExpressionAttributeNames" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
expressionAttributeNames,
(Key
"ExpressionAttributeValues" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text AttributeValue)
expressionAttributeValues,
(Key
"ReturnConsumedCapacity" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReturnConsumedCapacity
returnConsumedCapacity,
(Key
"ReturnItemCollectionMetrics" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReturnItemCollectionMetrics
returnItemCollectionMetrics,
(Key
"ReturnValues" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ReturnValue
returnValues,
forall a. a -> Maybe a
Prelude.Just (Key
"TableName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
tableName),
forall a. a -> Maybe a
Prelude.Just (Key
"Key" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text AttributeValue
key)
]
)
instance Data.ToPath DeleteItem where
toPath :: DeleteItem -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteItem where
toQuery :: DeleteItem -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteItemResponse = DeleteItemResponse'
{
DeleteItemResponse -> Maybe (HashMap Text AttributeValue)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue),
DeleteItemResponse -> Maybe ConsumedCapacity
consumedCapacity :: Prelude.Maybe ConsumedCapacity,
DeleteItemResponse -> Maybe ItemCollectionMetrics
itemCollectionMetrics :: Prelude.Maybe ItemCollectionMetrics,
DeleteItemResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteItemResponse -> DeleteItemResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteItemResponse -> DeleteItemResponse -> Bool
$c/= :: DeleteItemResponse -> DeleteItemResponse -> Bool
== :: DeleteItemResponse -> DeleteItemResponse -> Bool
$c== :: DeleteItemResponse -> DeleteItemResponse -> Bool
Prelude.Eq, ReadPrec [DeleteItemResponse]
ReadPrec DeleteItemResponse
Int -> ReadS DeleteItemResponse
ReadS [DeleteItemResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteItemResponse]
$creadListPrec :: ReadPrec [DeleteItemResponse]
readPrec :: ReadPrec DeleteItemResponse
$creadPrec :: ReadPrec DeleteItemResponse
readList :: ReadS [DeleteItemResponse]
$creadList :: ReadS [DeleteItemResponse]
readsPrec :: Int -> ReadS DeleteItemResponse
$creadsPrec :: Int -> ReadS DeleteItemResponse
Prelude.Read, Int -> DeleteItemResponse -> ShowS
[DeleteItemResponse] -> ShowS
DeleteItemResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteItemResponse] -> ShowS
$cshowList :: [DeleteItemResponse] -> ShowS
show :: DeleteItemResponse -> String
$cshow :: DeleteItemResponse -> String
showsPrec :: Int -> DeleteItemResponse -> ShowS
$cshowsPrec :: Int -> DeleteItemResponse -> ShowS
Prelude.Show, forall x. Rep DeleteItemResponse x -> DeleteItemResponse
forall x. DeleteItemResponse -> Rep DeleteItemResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteItemResponse x -> DeleteItemResponse
$cfrom :: forall x. DeleteItemResponse -> Rep DeleteItemResponse x
Prelude.Generic)
newDeleteItemResponse ::
Prelude.Int ->
DeleteItemResponse
newDeleteItemResponse :: Int -> DeleteItemResponse
newDeleteItemResponse Int
pHttpStatus_ =
DeleteItemResponse'
{ $sel:attributes:DeleteItemResponse' :: Maybe (HashMap Text AttributeValue)
attributes = forall a. Maybe a
Prelude.Nothing,
$sel:consumedCapacity:DeleteItemResponse' :: Maybe ConsumedCapacity
consumedCapacity = forall a. Maybe a
Prelude.Nothing,
$sel:itemCollectionMetrics:DeleteItemResponse' :: Maybe ItemCollectionMetrics
itemCollectionMetrics = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteItemResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteItemResponse_attributes :: Lens.Lens' DeleteItemResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
deleteItemResponse_attributes :: Lens' DeleteItemResponse (Maybe (HashMap Text AttributeValue))
deleteItemResponse_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItemResponse' {Maybe (HashMap Text AttributeValue)
attributes :: Maybe (HashMap Text AttributeValue)
$sel:attributes:DeleteItemResponse' :: DeleteItemResponse -> Maybe (HashMap Text AttributeValue)
attributes} -> Maybe (HashMap Text AttributeValue)
attributes) (\s :: DeleteItemResponse
s@DeleteItemResponse' {} Maybe (HashMap Text AttributeValue)
a -> DeleteItemResponse
s {$sel:attributes:DeleteItemResponse' :: Maybe (HashMap Text AttributeValue)
attributes = Maybe (HashMap Text AttributeValue)
a} :: DeleteItemResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
deleteItemResponse_consumedCapacity :: Lens.Lens' DeleteItemResponse (Prelude.Maybe ConsumedCapacity)
deleteItemResponse_consumedCapacity :: Lens' DeleteItemResponse (Maybe ConsumedCapacity)
deleteItemResponse_consumedCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItemResponse' {Maybe ConsumedCapacity
consumedCapacity :: Maybe ConsumedCapacity
$sel:consumedCapacity:DeleteItemResponse' :: DeleteItemResponse -> Maybe ConsumedCapacity
consumedCapacity} -> Maybe ConsumedCapacity
consumedCapacity) (\s :: DeleteItemResponse
s@DeleteItemResponse' {} Maybe ConsumedCapacity
a -> DeleteItemResponse
s {$sel:consumedCapacity:DeleteItemResponse' :: Maybe ConsumedCapacity
consumedCapacity = Maybe ConsumedCapacity
a} :: DeleteItemResponse)
deleteItemResponse_itemCollectionMetrics :: Lens.Lens' DeleteItemResponse (Prelude.Maybe ItemCollectionMetrics)
deleteItemResponse_itemCollectionMetrics :: Lens' DeleteItemResponse (Maybe ItemCollectionMetrics)
deleteItemResponse_itemCollectionMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItemResponse' {Maybe ItemCollectionMetrics
itemCollectionMetrics :: Maybe ItemCollectionMetrics
$sel:itemCollectionMetrics:DeleteItemResponse' :: DeleteItemResponse -> Maybe ItemCollectionMetrics
itemCollectionMetrics} -> Maybe ItemCollectionMetrics
itemCollectionMetrics) (\s :: DeleteItemResponse
s@DeleteItemResponse' {} Maybe ItemCollectionMetrics
a -> DeleteItemResponse
s {$sel:itemCollectionMetrics:DeleteItemResponse' :: Maybe ItemCollectionMetrics
itemCollectionMetrics = Maybe ItemCollectionMetrics
a} :: DeleteItemResponse)
deleteItemResponse_httpStatus :: Lens.Lens' DeleteItemResponse Prelude.Int
deleteItemResponse_httpStatus :: Lens' DeleteItemResponse Int
deleteItemResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteItemResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteItemResponse' :: DeleteItemResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteItemResponse
s@DeleteItemResponse' {} Int
a -> DeleteItemResponse
s {$sel:httpStatus:DeleteItemResponse' :: Int
httpStatus = Int
a} :: DeleteItemResponse)
instance Prelude.NFData DeleteItemResponse where
rnf :: DeleteItemResponse -> ()
rnf DeleteItemResponse' {Int
Maybe (HashMap Text AttributeValue)
Maybe ItemCollectionMetrics
Maybe ConsumedCapacity
httpStatus :: Int
itemCollectionMetrics :: Maybe ItemCollectionMetrics
consumedCapacity :: Maybe ConsumedCapacity
attributes :: Maybe (HashMap Text AttributeValue)
$sel:httpStatus:DeleteItemResponse' :: DeleteItemResponse -> Int
$sel:itemCollectionMetrics:DeleteItemResponse' :: DeleteItemResponse -> Maybe ItemCollectionMetrics
$sel:consumedCapacity:DeleteItemResponse' :: DeleteItemResponse -> Maybe ConsumedCapacity
$sel:attributes:DeleteItemResponse' :: DeleteItemResponse -> Maybe (HashMap Text AttributeValue)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text AttributeValue)
attributes
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ConsumedCapacity
consumedCapacity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ItemCollectionMetrics
itemCollectionMetrics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus