    {-# LANGUAGE DeriveDataTypeable        #-}
    {-# LANGUAGE FlexibleContexts          #-}
    {-# LANGUAGE FlexibleInstances         #-}
    {-# LANGUAGE MultiParamTypeClasses     #-}
    {-# LANGUAGE NoMonomorphismRestriction #-}
    {-# LANGUAGE OverloadedStrings         #-}
    {-# LANGUAGE RecordWildCards           #-}
    {-# LANGUAGE ScopedTypeVariables       #-}
    {-# LANGUAGE TypeFamilies              #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  Aws.DynamoDb.Commands.UpdateItem
    -- Copyright   :  Soostone Inc
    -- License     :  BSD3
    --
    -- Maintainer  :  Ozgun Ataman <ozgun.ataman@soostone.com>
    -- Stability   :  experimental
    --
    --
    ----------------------------------------------------------------------------

    module Aws.DynamoDb.Commands.UpdateItem
        ( UpdateItem(..)
        , updateItem
        , AttributeUpdate(..)
        , au
        , UpdateAction(..)
        , UpdateItemResponse(..)
        ) where

    -------------------------------------------------------------------------------
    import           Control.Applicative
    import           Data.Aeson
    import qualified Data.Aeson.Key      as AK
    import           Data.Default
    import qualified Data.Text           as T
    import           Prelude
    -------------------------------------------------------------------------------
    import           Aws.Core
    import           Aws.DynamoDb.Core
    -------------------------------------------------------------------------------

    -- | An @UpdateItem@ request.
    data UpdateItem = UpdateItem {
          UpdateItem -> Text
    uiTable   :: T.Text
        , UpdateItem -> PrimaryKey
    uiKey     :: PrimaryKey
        , UpdateItem -> [AttributeUpdate]
    uiUpdates :: [AttributeUpdate]
        , UpdateItem -> Conditions
    uiExpect  :: Conditions
        -- ^ Conditional update - see DynamoDb documentation
        , UpdateItem -> UpdateReturn
    uiReturn  :: UpdateReturn
        , UpdateItem -> ReturnConsumption
    uiRetCons :: ReturnConsumption
        , UpdateItem -> ReturnItemCollectionMetrics
    uiRetMet  :: ReturnItemCollectionMetrics
        } deriving (UpdateItem -> UpdateItem -> Bool
    (UpdateItem -> UpdateItem -> Bool)
    -> (UpdateItem -> UpdateItem -> Bool) -> Eq UpdateItem
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UpdateItem -> UpdateItem -> Bool
    == :: UpdateItem -> UpdateItem -> Bool
    $c/= :: UpdateItem -> UpdateItem -> Bool
    /= :: UpdateItem -> UpdateItem -> Bool
    Eq,Int -> UpdateItem -> ShowS
    [UpdateItem] -> ShowS
    UpdateItem -> String
    (Int -> UpdateItem -> ShowS)
    -> (UpdateItem -> String)
    -> ([UpdateItem] -> ShowS)
    -> Show UpdateItem
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> UpdateItem -> ShowS
    showsPrec :: Int -> UpdateItem -> ShowS
    $cshow :: UpdateItem -> String
    show :: UpdateItem -> String
    $cshowList :: [UpdateItem] -> ShowS
    showList :: [UpdateItem] -> ShowS
    Show,ReadPrec [UpdateItem]
    ReadPrec UpdateItem
    Int -> ReadS UpdateItem
    ReadS [UpdateItem]
    (Int -> ReadS UpdateItem)
    -> ReadS [UpdateItem]
    -> ReadPrec UpdateItem
    -> ReadPrec [UpdateItem]
    -> Read UpdateItem
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS UpdateItem
    readsPrec :: Int -> ReadS UpdateItem
    $creadList :: ReadS [UpdateItem]
    readList :: ReadS [UpdateItem]
    $creadPrec :: ReadPrec UpdateItem
    readPrec :: ReadPrec UpdateItem
    $creadListPrec :: ReadPrec [UpdateItem]
    readListPrec :: ReadPrec [UpdateItem]
    Read,Eq UpdateItem
    Eq UpdateItem =>
    (UpdateItem -> UpdateItem -> Ordering)
    -> (UpdateItem -> UpdateItem -> Bool)
    -> (UpdateItem -> UpdateItem -> Bool)
    -> (UpdateItem -> UpdateItem -> Bool)
    -> (UpdateItem -> UpdateItem -> Bool)
    -> (UpdateItem -> UpdateItem -> UpdateItem)
    -> (UpdateItem -> UpdateItem -> UpdateItem)
    -> Ord UpdateItem
    UpdateItem -> UpdateItem -> Bool
    UpdateItem -> UpdateItem -> Ordering
    UpdateItem -> UpdateItem -> UpdateItem
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: UpdateItem -> UpdateItem -> Ordering
    compare :: UpdateItem -> UpdateItem -> Ordering
    $c< :: UpdateItem -> UpdateItem -> Bool
    < :: UpdateItem -> UpdateItem -> Bool
    $c<= :: UpdateItem -> UpdateItem -> Bool
    <= :: UpdateItem -> UpdateItem -> Bool
    $c> :: UpdateItem -> UpdateItem -> Bool
    > :: UpdateItem -> UpdateItem -> Bool
    $c>= :: UpdateItem -> UpdateItem -> Bool
    >= :: UpdateItem -> UpdateItem -> Bool
    $cmax :: UpdateItem -> UpdateItem -> UpdateItem
    max :: UpdateItem -> UpdateItem -> UpdateItem
    $cmin :: UpdateItem -> UpdateItem -> UpdateItem
    min :: UpdateItem -> UpdateItem -> UpdateItem
    Ord)

    -------------------------------------------------------------------------------
    -- | Construct a minimal 'UpdateItem' request.
    updateItem
        :: T.Text                   -- ^ Table name
        -> PrimaryKey               -- ^ Primary key for item
        -> [AttributeUpdate]        -- ^ Updates for this item
        -> UpdateItem
    updateItem :: Text -> PrimaryKey -> [AttributeUpdate] -> UpdateItem
    updateItem Text
    tn PrimaryKey
    key [AttributeUpdate]
    ups = Text
    -> PrimaryKey
    -> [AttributeUpdate]
    -> Conditions
    -> UpdateReturn
    -> ReturnConsumption
    -> ReturnItemCollectionMetrics
    -> UpdateItem
    UpdateItem Text
    tn PrimaryKey
    key [AttributeUpdate]
    ups Conditions
    forall a. Default a => a
    def UpdateReturn
    forall a. Default a => a
    def ReturnConsumption
    forall a. Default a => a
    def ReturnItemCollectionMetrics
    forall a. Default a => a
    def

    -- | A helper to avoid overlapping instances for 'ToJSON'.
    newtype AttributeUpdates = AttributeUpdates {
        AttributeUpdates -> [AttributeUpdate]
    getAttributeUpdates :: [AttributeUpdate]
        }

    data AttributeUpdate = AttributeUpdate {
          AttributeUpdate -> Attribute
    auAttr   :: Attribute
        -- ^ Attribute key-value
        , AttributeUpdate -> UpdateAction
    auAction :: UpdateAction
        -- ^ Type of update operation.
        } deriving (AttributeUpdate -> AttributeUpdate -> Bool
    (AttributeUpdate -> AttributeUpdate -> Bool)
    -> (AttributeUpdate -> AttributeUpdate -> Bool)
    -> Eq AttributeUpdate
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: AttributeUpdate -> AttributeUpdate -> Bool
    == :: AttributeUpdate -> AttributeUpdate -> Bool
    $c/= :: AttributeUpdate -> AttributeUpdate -> Bool
    /= :: AttributeUpdate -> AttributeUpdate -> Bool
    Eq,Int -> AttributeUpdate -> ShowS
    [AttributeUpdate] -> ShowS
    AttributeUpdate -> String
    (Int -> AttributeUpdate -> ShowS)
    -> (AttributeUpdate -> String)
    -> ([AttributeUpdate] -> ShowS)
    -> Show AttributeUpdate
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> AttributeUpdate -> ShowS
    showsPrec :: Int -> AttributeUpdate -> ShowS
    $cshow :: AttributeUpdate -> String
    show :: AttributeUpdate -> String
    $cshowList :: [AttributeUpdate] -> ShowS
    showList :: [AttributeUpdate] -> ShowS
    Show,ReadPrec [AttributeUpdate]
    ReadPrec AttributeUpdate
    Int -> ReadS AttributeUpdate
    ReadS [AttributeUpdate]
    (Int -> ReadS AttributeUpdate)
    -> ReadS [AttributeUpdate]
    -> ReadPrec AttributeUpdate
    -> ReadPrec [AttributeUpdate]
    -> Read AttributeUpdate
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS AttributeUpdate
    readsPrec :: Int -> ReadS AttributeUpdate
    $creadList :: ReadS [AttributeUpdate]
    readList :: ReadS [AttributeUpdate]
    $creadPrec :: ReadPrec AttributeUpdate
    readPrec :: ReadPrec AttributeUpdate
    $creadListPrec :: ReadPrec [AttributeUpdate]
    readListPrec :: ReadPrec [AttributeUpdate]
    Read,Eq AttributeUpdate
    Eq AttributeUpdate =>
    (AttributeUpdate -> AttributeUpdate -> Ordering)
    -> (AttributeUpdate -> AttributeUpdate -> Bool)
    -> (AttributeUpdate -> AttributeUpdate -> Bool)
    -> (AttributeUpdate -> AttributeUpdate -> Bool)
    -> (AttributeUpdate -> AttributeUpdate -> Bool)
    -> (AttributeUpdate -> AttributeUpdate -> AttributeUpdate)
    -> (AttributeUpdate -> AttributeUpdate -> AttributeUpdate)
    -> Ord AttributeUpdate
    AttributeUpdate -> AttributeUpdate -> Bool
    AttributeUpdate -> AttributeUpdate -> Ordering
    AttributeUpdate -> AttributeUpdate -> AttributeUpdate
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: AttributeUpdate -> AttributeUpdate -> Ordering
    compare :: AttributeUpdate -> AttributeUpdate -> Ordering
    $c< :: AttributeUpdate -> AttributeUpdate -> Bool
    < :: AttributeUpdate -> AttributeUpdate -> Bool
    $c<= :: AttributeUpdate -> AttributeUpdate -> Bool
    <= :: AttributeUpdate -> AttributeUpdate -> Bool
    $c> :: AttributeUpdate -> AttributeUpdate -> Bool
    > :: AttributeUpdate -> AttributeUpdate -> Bool
    $c>= :: AttributeUpdate -> AttributeUpdate -> Bool
    >= :: AttributeUpdate -> AttributeUpdate -> Bool
    $cmax :: AttributeUpdate -> AttributeUpdate -> AttributeUpdate
    max :: AttributeUpdate -> AttributeUpdate -> AttributeUpdate
    $cmin :: AttributeUpdate -> AttributeUpdate -> AttributeUpdate
    min :: AttributeUpdate -> AttributeUpdate -> AttributeUpdate
    Ord)

    instance DynSize AttributeUpdate where
        dynSize :: AttributeUpdate -> Int
    dynSize (AttributeUpdate Attribute
    a UpdateAction
    _) = Attribute -> Int
    forall a. DynSize a => a -> Int
    dynSize Attribute
    a

    -------------------------------------------------------------------------------
    -- | Shorthand for the 'AttributeUpdate' constructor. Defaults to PUT
    -- for the update action.
    au :: Attribute -> AttributeUpdate
    au :: Attribute -> AttributeUpdate
    au Attribute
    a = Attribute -> UpdateAction -> AttributeUpdate
    AttributeUpdate Attribute
    a UpdateAction
    forall a. Default a => a
    def

    instance ToJSON AttributeUpdates where
        toJSON :: AttributeUpdates -> Value
    toJSON = [Pair] -> Value
    object ([Pair] -> Value)
    -> (AttributeUpdates -> [Pair]) -> AttributeUpdates -> Value
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (AttributeUpdate -> Pair) -> [AttributeUpdate] -> [Pair]
    forall a b. (a -> b) -> [a] -> [b]
    map AttributeUpdate -> Pair
    forall {e} {kv}. KeyValue e kv => AttributeUpdate -> kv
    mk ([AttributeUpdate] -> [Pair])
    -> (AttributeUpdates -> [AttributeUpdate])
    -> AttributeUpdates
    -> [Pair]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . AttributeUpdates -> [AttributeUpdate]
    getAttributeUpdates
            where
              mk :: AttributeUpdate -> kv
    mk AttributeUpdate { auAction :: AttributeUpdate -> UpdateAction
    auAction = UpdateAction
    UDelete, auAttr :: AttributeUpdate -> Attribute
    auAttr = Attribute
    auAttr } =
                (Text -> Key
    AK.fromText (Attribute -> Text
    attrName Attribute
    auAttr)) Key -> Value -> kv
    forall v. ToJSON v => Key -> v -> kv
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= [Pair] -> Value
    object
                [Key
    "Action" Key -> UpdateAction -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= UpdateAction
    UDelete]
              mk AttributeUpdate { Attribute
    UpdateAction
    auAttr :: AttributeUpdate -> Attribute
    auAction :: AttributeUpdate -> UpdateAction
    auAttr :: Attribute
    auAction :: UpdateAction
    .. } = Text -> Key
    AK.fromText (Attribute -> Text
    attrName Attribute
    auAttr) Key -> Value -> kv
    forall v. ToJSON v => Key -> v -> kv
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= [Pair] -> Value
    object
                [Key
    "Value" Key -> DValue -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= (Attribute -> DValue
    attrVal Attribute
    auAttr), Key
    "Action" Key -> UpdateAction -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= UpdateAction
    auAction]

    -------------------------------------------------------------------------------
    -- | Type of attribute update to perform.
    --
    -- See AWS docs at:
    --
    -- @http:\/\/docs.aws.amazon.com\/amazondynamodb\/latest\/APIReference\/API_UpdateItem.html@
    data UpdateAction
        = UPut                      -- ^ Simpley write, overwriting any previous value
        | UAdd                      -- ^ Numerical add or add to set.
        | UDelete                   -- ^ Empty value: remove; Set value: Subtract from set.
        deriving (UpdateAction -> UpdateAction -> Bool
    (UpdateAction -> UpdateAction -> Bool)
    -> (UpdateAction -> UpdateAction -> Bool) -> Eq UpdateAction
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UpdateAction -> UpdateAction -> Bool
    == :: UpdateAction -> UpdateAction -> Bool
    $c/= :: UpdateAction -> UpdateAction -> Bool
    /= :: UpdateAction -> UpdateAction -> Bool
    Eq,Int -> UpdateAction -> ShowS
    [UpdateAction] -> ShowS
    UpdateAction -> String
    (Int -> UpdateAction -> ShowS)
    -> (UpdateAction -> String)
    -> ([UpdateAction] -> ShowS)
    -> Show UpdateAction
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> UpdateAction -> ShowS
    showsPrec :: Int -> UpdateAction -> ShowS
    $cshow :: UpdateAction -> String
    show :: UpdateAction -> String
    $cshowList :: [UpdateAction] -> ShowS
    showList :: [UpdateAction] -> ShowS
    Show,ReadPrec [UpdateAction]
    ReadPrec UpdateAction
    Int -> ReadS UpdateAction
    ReadS [UpdateAction]
    (Int -> ReadS UpdateAction)
    -> ReadS [UpdateAction]
    -> ReadPrec UpdateAction
    -> ReadPrec [UpdateAction]
    -> Read UpdateAction
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS UpdateAction
    readsPrec :: Int -> ReadS UpdateAction
    $creadList :: ReadS [UpdateAction]
    readList :: ReadS [UpdateAction]
    $creadPrec :: ReadPrec UpdateAction
    readPrec :: ReadPrec UpdateAction
    $creadListPrec :: ReadPrec [UpdateAction]
    readListPrec :: ReadPrec [UpdateAction]
    Read,Eq UpdateAction
    Eq UpdateAction =>
    (UpdateAction -> UpdateAction -> Ordering)
    -> (UpdateAction -> UpdateAction -> Bool)
    -> (UpdateAction -> UpdateAction -> Bool)
    -> (UpdateAction -> UpdateAction -> Bool)
    -> (UpdateAction -> UpdateAction -> Bool)
    -> (UpdateAction -> UpdateAction -> UpdateAction)
    -> (UpdateAction -> UpdateAction -> UpdateAction)
    -> Ord UpdateAction
    UpdateAction -> UpdateAction -> Bool
    UpdateAction -> UpdateAction -> Ordering
    UpdateAction -> UpdateAction -> UpdateAction
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: UpdateAction -> UpdateAction -> Ordering
    compare :: UpdateAction -> UpdateAction -> Ordering
    $c< :: UpdateAction -> UpdateAction -> Bool
    < :: UpdateAction -> UpdateAction -> Bool
    $c<= :: UpdateAction -> UpdateAction -> Bool
    <= :: UpdateAction -> UpdateAction -> Bool
    $c> :: UpdateAction -> UpdateAction -> Bool
    > :: UpdateAction -> UpdateAction -> Bool
    $c>= :: UpdateAction -> UpdateAction -> Bool
    >= :: UpdateAction -> UpdateAction -> Bool
    $cmax :: UpdateAction -> UpdateAction -> UpdateAction
    max :: UpdateAction -> UpdateAction -> UpdateAction
    $cmin :: UpdateAction -> UpdateAction -> UpdateAction
    min :: UpdateAction -> UpdateAction -> UpdateAction
    Ord)

    instance ToJSON UpdateAction where
        toJSON :: UpdateAction -> Value
    toJSON UpdateAction
    UPut = Text -> Value
    String Text
    "PUT"
        toJSON UpdateAction
    UAdd = Text -> Value
    String Text
    "ADD"
        toJSON UpdateAction
    UDelete = Text -> Value
    String Text
    "DELETE"

    instance Default UpdateAction where
        def :: UpdateAction
    def = UpdateAction
    UPut

    instance ToJSON UpdateItem where
        toJSON :: UpdateItem -> Value
    toJSON UpdateItem{[AttributeUpdate]
    Text
    UpdateReturn
    ReturnItemCollectionMetrics
    ReturnConsumption
    Conditions
    PrimaryKey
    uiTable :: UpdateItem -> Text
    uiKey :: UpdateItem -> PrimaryKey
    uiUpdates :: UpdateItem -> [AttributeUpdate]
    uiExpect :: UpdateItem -> Conditions
    uiReturn :: UpdateItem -> UpdateReturn
    uiRetCons :: UpdateItem -> ReturnConsumption
    uiRetMet :: UpdateItem -> ReturnItemCollectionMetrics
    uiTable :: Text
    uiKey :: PrimaryKey
    uiUpdates :: [AttributeUpdate]
    uiExpect :: Conditions
    uiReturn :: UpdateReturn
    uiRetCons :: ReturnConsumption
    uiRetMet :: ReturnItemCollectionMetrics
    ..} =
            [Pair] -> Value
    object ([Pair] -> Value) -> [Pair] -> Value
    forall a b. (a -> b) -> a -> b
    $ Conditions -> [Pair]
    expectsJson Conditions
    uiExpect [Pair] -> [Pair] -> [Pair]
    forall a. [a] -> [a] -> [a]
    ++
              [ Key
    "TableName" Key -> Text -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= Text
    uiTable
              , Key
    "Key" Key -> PrimaryKey -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= PrimaryKey
    uiKey
              , Key
    "AttributeUpdates" Key -> AttributeUpdates -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= [AttributeUpdate] -> AttributeUpdates
    AttributeUpdates [AttributeUpdate]
    uiUpdates
              , Key
    "ReturnValues" Key -> UpdateReturn -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= UpdateReturn
    uiReturn
              , Key
    "ReturnConsumedCapacity" Key -> ReturnConsumption -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= ReturnConsumption
    uiRetCons
              , Key
    "ReturnItemCollectionMetrics" Key -> ReturnItemCollectionMetrics -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= ReturnItemCollectionMetrics
    uiRetMet
              ]

    data UpdateItemResponse = UpdateItemResponse {
          UpdateItemResponse -> Maybe Item
    uirAttrs    :: Maybe Item
        -- ^ Old attributes, if requested
        , UpdateItemResponse -> Maybe ConsumedCapacity
    uirConsumed :: Maybe ConsumedCapacity
        -- ^ Amount of capacity consumed
        } deriving (UpdateItemResponse -> UpdateItemResponse -> Bool
    (UpdateItemResponse -> UpdateItemResponse -> Bool)
    -> (UpdateItemResponse -> UpdateItemResponse -> Bool)
    -> Eq UpdateItemResponse
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UpdateItemResponse -> UpdateItemResponse -> Bool
    == :: UpdateItemResponse -> UpdateItemResponse -> Bool
    $c/= :: UpdateItemResponse -> UpdateItemResponse -> Bool
    /= :: UpdateItemResponse -> UpdateItemResponse -> Bool
    Eq,Int -> UpdateItemResponse -> ShowS
    [UpdateItemResponse] -> ShowS
    UpdateItemResponse -> String
    (Int -> UpdateItemResponse -> ShowS)
    -> (UpdateItemResponse -> String)
    -> ([UpdateItemResponse] -> ShowS)
    -> Show UpdateItemResponse
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> UpdateItemResponse -> ShowS
    showsPrec :: Int -> UpdateItemResponse -> ShowS
    $cshow :: UpdateItemResponse -> String
    show :: UpdateItemResponse -> String
    $cshowList :: [UpdateItemResponse] -> ShowS
    showList :: [UpdateItemResponse] -> ShowS
    Show,ReadPrec [UpdateItemResponse]
    ReadPrec UpdateItemResponse
    Int -> ReadS UpdateItemResponse
    ReadS [UpdateItemResponse]
    (Int -> ReadS UpdateItemResponse)
    -> ReadS [UpdateItemResponse]
    -> ReadPrec UpdateItemResponse
    -> ReadPrec [UpdateItemResponse]
    -> Read UpdateItemResponse
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS UpdateItemResponse
    readsPrec :: Int -> ReadS UpdateItemResponse
    $creadList :: ReadS [UpdateItemResponse]
    readList :: ReadS [UpdateItemResponse]
    $creadPrec :: ReadPrec UpdateItemResponse
    readPrec :: ReadPrec UpdateItemResponse
    $creadListPrec :: ReadPrec [UpdateItemResponse]
    readListPrec :: ReadPrec [UpdateItemResponse]
    Read,Eq UpdateItemResponse
    Eq UpdateItemResponse =>
    (UpdateItemResponse -> UpdateItemResponse -> Ordering)
    -> (UpdateItemResponse -> UpdateItemResponse -> Bool)
    -> (UpdateItemResponse -> UpdateItemResponse -> Bool)
    -> (UpdateItemResponse -> UpdateItemResponse -> Bool)
    -> (UpdateItemResponse -> UpdateItemResponse -> Bool)
    -> (UpdateItemResponse -> UpdateItemResponse -> UpdateItemResponse)
    -> (UpdateItemResponse -> UpdateItemResponse -> UpdateItemResponse)
    -> Ord UpdateItemResponse
    UpdateItemResponse -> UpdateItemResponse -> Bool
    UpdateItemResponse -> UpdateItemResponse -> Ordering
    UpdateItemResponse -> UpdateItemResponse -> UpdateItemResponse
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: UpdateItemResponse -> UpdateItemResponse -> Ordering
    compare :: UpdateItemResponse -> UpdateItemResponse -> Ordering
    $c< :: UpdateItemResponse -> UpdateItemResponse -> Bool
    < :: UpdateItemResponse -> UpdateItemResponse -> Bool
    $c<= :: UpdateItemResponse -> UpdateItemResponse -> Bool
    <= :: UpdateItemResponse -> UpdateItemResponse -> Bool
    $c> :: UpdateItemResponse -> UpdateItemResponse -> Bool
    > :: UpdateItemResponse -> UpdateItemResponse -> Bool
    $c>= :: UpdateItemResponse -> UpdateItemResponse -> Bool
    >= :: UpdateItemResponse -> UpdateItemResponse -> Bool
    $cmax :: UpdateItemResponse -> UpdateItemResponse -> UpdateItemResponse
    max :: UpdateItemResponse -> UpdateItemResponse -> UpdateItemResponse
    $cmin :: UpdateItemResponse -> UpdateItemResponse -> UpdateItemResponse
    min :: UpdateItemResponse -> UpdateItemResponse -> UpdateItemResponse
    Ord)

    instance Transaction UpdateItem UpdateItemResponse

    instance SignQuery UpdateItem where
        type ServiceConfiguration UpdateItem = DdbConfiguration
        signQuery :: forall queryType.
    UpdateItem
    -> ServiceConfiguration UpdateItem queryType
    -> SignatureData
    -> SignedQuery
    signQuery UpdateItem
    gi = ByteString
    -> UpdateItem
    -> DdbConfiguration queryType
    -> SignatureData
    -> SignedQuery
    forall a qt.
    ToJSON a =>
    ByteString
    -> a -> DdbConfiguration qt -> SignatureData -> SignedQuery
    ddbSignQuery ByteString
    "UpdateItem" UpdateItem
    gi

    instance FromJSON UpdateItemResponse where
        parseJSON :: Value -> Parser UpdateItemResponse
    parseJSON (Object Object
    v) = Maybe Item -> Maybe ConsumedCapacity -> UpdateItemResponse
    UpdateItemResponse
            (Maybe Item -> Maybe ConsumedCapacity -> UpdateItemResponse)
    -> Parser (Maybe Item)
    -> Parser (Maybe ConsumedCapacity -> UpdateItemResponse)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Object
    v Object -> Key -> Parser (Maybe Item)
    forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
    .:? Key
    "Attributes"
            Parser (Maybe ConsumedCapacity -> UpdateItemResponse)
    -> Parser (Maybe ConsumedCapacity) -> Parser UpdateItemResponse
    forall a b. Parser (a -> b) -> Parser a -> Parser b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Object
    v Object -> Key -> Parser (Maybe ConsumedCapacity)
    forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
    .:? Key
    "ConsumedCapacity"
        parseJSON Value
    _ = String -> Parser UpdateItemResponse
    forall a. String -> Parser a
    forall (m :: * -> *) a. MonadFail m => String -> m a
    fail String
    "UpdateItemResponse expected a JSON object"

    instance ResponseConsumer r UpdateItemResponse where
        type ResponseMetadata UpdateItemResponse = DdbResponse
        responseConsumer :: Request
    -> r
    -> IORef (ResponseMetadata UpdateItemResponse)
    -> HTTPResponseConsumer UpdateItemResponse
    responseConsumer Request
    _ r
    _ IORef (ResponseMetadata UpdateItemResponse)
    ref Response (ConduitM () ByteString (ResourceT IO) ())
    resp = IORef DdbResponse -> HTTPResponseConsumer UpdateItemResponse
    forall a. FromJSON a => IORef DdbResponse -> HTTPResponseConsumer a
    ddbResponseConsumer IORef (ResponseMetadata UpdateItemResponse)
    IORef DdbResponse
    ref Response (ConduitM () ByteString (ResourceT IO) ())
    resp

    instance AsMemoryResponse UpdateItemResponse where
        type MemoryResponse UpdateItemResponse = UpdateItemResponse
        loadToMemory :: UpdateItemResponse
    -> ResourceT IO (MemoryResponse UpdateItemResponse)
    loadToMemory = UpdateItemResponse
    -> ResourceT IO (MemoryResponse UpdateItemResponse)
    UpdateItemResponse -> ResourceT IO UpdateItemResponse
    forall a. a -> ResourceT IO a
    forall (m :: * -> *) a. Monad m => a -> m a
    return