    {-# LANGUAGE DeriveDataTypeable        #-}
    {-# LANGUAGE FlexibleContexts          #-}
    {-# LANGUAGE FlexibleInstances         #-}
    {-# LANGUAGE MultiParamTypeClasses     #-}
    {-# LANGUAGE NoMonomorphismRestriction #-}
    {-# LANGUAGE OverloadedStrings         #-}
    {-# LANGUAGE RecordWildCards           #-}
    {-# LANGUAGE ScopedTypeVariables       #-}
    {-# LANGUAGE TypeFamilies              #-}
    -----------------------------------------------------------------------------
    -- |
    -- Module      :  Aws.DynamoDb.Commands.BatchGetItem
    -- Copyright   :  Soostone Inc
    -- License     :  BSD3
    --
    -- Maintainer  :  Justin Dawson <jtdawso@gmail.com>
    -- Stability   :  experimental
    --
    -- @http:\/\/docs.aws.amazon.com\/amazondynamodb\/latest\/APIReference\/API_BatchGetItem.html@
    ----------------------------------------------------------------------------

    module Aws.DynamoDb.Commands.BatchGetItem where

    -------------------------------------------------------------------------------
    import           Control.Applicative
    import           Data.Aeson
    import           Data.Default
    import qualified Data.HashMap.Strict as HM
    import qualified Data.Text           as T
    import           Prelude
    -------------------------------------------------------------------------------
    import           Aws.Core
    import           Aws.DynamoDb.Core
    import           Aws.DynamoDb.Commands.GetItem
    -------------------------------------------------------------------------------

    data GetRequestItem = GetRequestItem{
             GetRequestItem -> Maybe Text
    griProjExpr :: Maybe T.Text
           , GetRequestItem -> Bool
    griConsistent ::Bool
           , GetRequestItem -> [PrimaryKey]
    griKeys :: [PrimaryKey]
         } deriving (GetRequestItem -> GetRequestItem -> Bool
    (GetRequestItem -> GetRequestItem -> Bool)
    -> (GetRequestItem -> GetRequestItem -> Bool) -> Eq GetRequestItem
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: GetRequestItem -> GetRequestItem -> Bool
    == :: GetRequestItem -> GetRequestItem -> Bool
    $c/= :: GetRequestItem -> GetRequestItem -> Bool
    /= :: GetRequestItem -> GetRequestItem -> Bool
    Eq,Int -> GetRequestItem -> ShowS
    [GetRequestItem] -> ShowS
    GetRequestItem -> String
    (Int -> GetRequestItem -> ShowS)
    -> (GetRequestItem -> String)
    -> ([GetRequestItem] -> ShowS)
    -> Show GetRequestItem
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> GetRequestItem -> ShowS
    showsPrec :: Int -> GetRequestItem -> ShowS
    $cshow :: GetRequestItem -> String
    show :: GetRequestItem -> String
    $cshowList :: [GetRequestItem] -> ShowS
    showList :: [GetRequestItem] -> ShowS
    Show,ReadPrec [GetRequestItem]
    ReadPrec GetRequestItem
    Int -> ReadS GetRequestItem
    ReadS [GetRequestItem]
    (Int -> ReadS GetRequestItem)
    -> ReadS [GetRequestItem]
    -> ReadPrec GetRequestItem
    -> ReadPrec [GetRequestItem]
    -> Read GetRequestItem
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS GetRequestItem
    readsPrec :: Int -> ReadS GetRequestItem
    $creadList :: ReadS [GetRequestItem]
    readList :: ReadS [GetRequestItem]
    $creadPrec :: ReadPrec GetRequestItem
    readPrec :: ReadPrec GetRequestItem
    $creadListPrec :: ReadPrec [GetRequestItem]
    readListPrec :: ReadPrec [GetRequestItem]
    Read,Eq GetRequestItem
    Eq GetRequestItem =>
    (GetRequestItem -> GetRequestItem -> Ordering)
    -> (GetRequestItem -> GetRequestItem -> Bool)
    -> (GetRequestItem -> GetRequestItem -> Bool)
    -> (GetRequestItem -> GetRequestItem -> Bool)
    -> (GetRequestItem -> GetRequestItem -> Bool)
    -> (GetRequestItem -> GetRequestItem -> GetRequestItem)
    -> (GetRequestItem -> GetRequestItem -> GetRequestItem)
    -> Ord GetRequestItem
    GetRequestItem -> GetRequestItem -> Bool
    GetRequestItem -> GetRequestItem -> Ordering
    GetRequestItem -> GetRequestItem -> GetRequestItem
    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 :: GetRequestItem -> GetRequestItem -> Ordering
    compare :: GetRequestItem -> GetRequestItem -> Ordering
    $c< :: GetRequestItem -> GetRequestItem -> Bool
    < :: GetRequestItem -> GetRequestItem -> Bool
    $c<= :: GetRequestItem -> GetRequestItem -> Bool
    <= :: GetRequestItem -> GetRequestItem -> Bool
    $c> :: GetRequestItem -> GetRequestItem -> Bool
    > :: GetRequestItem -> GetRequestItem -> Bool
    $c>= :: GetRequestItem -> GetRequestItem -> Bool
    >= :: GetRequestItem -> GetRequestItem -> Bool
    $cmax :: GetRequestItem -> GetRequestItem -> GetRequestItem
    max :: GetRequestItem -> GetRequestItem -> GetRequestItem
    $cmin :: GetRequestItem -> GetRequestItem -> GetRequestItem
    min :: GetRequestItem -> GetRequestItem -> GetRequestItem
    Ord)

    data BatchGetItem = BatchGetItem {
          BatchGetItem -> [(Text, GetRequestItem)]
    bgRequests :: [(T.Text,GetRequestItem)]
        -- ^ Get Requests for a specified table
        , BatchGetItem -> ReturnConsumption
    bgRetCons :: ReturnConsumption
        } deriving (BatchGetItem -> BatchGetItem -> Bool
    (BatchGetItem -> BatchGetItem -> Bool)
    -> (BatchGetItem -> BatchGetItem -> Bool) -> Eq BatchGetItem
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: BatchGetItem -> BatchGetItem -> Bool
    == :: BatchGetItem -> BatchGetItem -> Bool
    $c/= :: BatchGetItem -> BatchGetItem -> Bool
    /= :: BatchGetItem -> BatchGetItem -> Bool
    Eq,Int -> BatchGetItem -> ShowS
    [BatchGetItem] -> ShowS
    BatchGetItem -> String
    (Int -> BatchGetItem -> ShowS)
    -> (BatchGetItem -> String)
    -> ([BatchGetItem] -> ShowS)
    -> Show BatchGetItem
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> BatchGetItem -> ShowS
    showsPrec :: Int -> BatchGetItem -> ShowS
    $cshow :: BatchGetItem -> String
    show :: BatchGetItem -> String
    $cshowList :: [BatchGetItem] -> ShowS
    showList :: [BatchGetItem] -> ShowS
    Show,ReadPrec [BatchGetItem]
    ReadPrec BatchGetItem
    Int -> ReadS BatchGetItem
    ReadS [BatchGetItem]
    (Int -> ReadS BatchGetItem)
    -> ReadS [BatchGetItem]
    -> ReadPrec BatchGetItem
    -> ReadPrec [BatchGetItem]
    -> Read BatchGetItem
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS BatchGetItem
    readsPrec :: Int -> ReadS BatchGetItem
    $creadList :: ReadS [BatchGetItem]
    readList :: ReadS [BatchGetItem]
    $creadPrec :: ReadPrec BatchGetItem
    readPrec :: ReadPrec BatchGetItem
    $creadListPrec :: ReadPrec [BatchGetItem]
    readListPrec :: ReadPrec [BatchGetItem]
    Read,Eq BatchGetItem
    Eq BatchGetItem =>
    (BatchGetItem -> BatchGetItem -> Ordering)
    -> (BatchGetItem -> BatchGetItem -> Bool)
    -> (BatchGetItem -> BatchGetItem -> Bool)
    -> (BatchGetItem -> BatchGetItem -> Bool)
    -> (BatchGetItem -> BatchGetItem -> Bool)
    -> (BatchGetItem -> BatchGetItem -> BatchGetItem)
    -> (BatchGetItem -> BatchGetItem -> BatchGetItem)
    -> Ord BatchGetItem
    BatchGetItem -> BatchGetItem -> Bool
    BatchGetItem -> BatchGetItem -> Ordering
    BatchGetItem -> BatchGetItem -> BatchGetItem
    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 :: BatchGetItem -> BatchGetItem -> Ordering
    compare :: BatchGetItem -> BatchGetItem -> Ordering
    $c< :: BatchGetItem -> BatchGetItem -> Bool
    < :: BatchGetItem -> BatchGetItem -> Bool
    $c<= :: BatchGetItem -> BatchGetItem -> Bool
    <= :: BatchGetItem -> BatchGetItem -> Bool
    $c> :: BatchGetItem -> BatchGetItem -> Bool
    > :: BatchGetItem -> BatchGetItem -> Bool
    $c>= :: BatchGetItem -> BatchGetItem -> Bool
    >= :: BatchGetItem -> BatchGetItem -> Bool
    $cmax :: BatchGetItem -> BatchGetItem -> BatchGetItem
    max :: BatchGetItem -> BatchGetItem -> BatchGetItem
    $cmin :: BatchGetItem -> BatchGetItem -> BatchGetItem
    min :: BatchGetItem -> BatchGetItem -> BatchGetItem
    Ord)

    -------------------------------------------------------------------------------

    -- | Construct a RequestItem .
    batchGetRequestItem :: Maybe T.Text
                   -- ^ Projection Expression
                   -> Bool
                   -- ^ Consistent Read
                   -> [PrimaryKey]
                   -- ^ Items to be deleted
                   -> GetRequestItem
    batchGetRequestItem :: Maybe Text -> Bool -> [PrimaryKey] -> GetRequestItem
    batchGetRequestItem Maybe Text
    expr Bool
    consistent [PrimaryKey]
    keys = Maybe Text -> Bool -> [PrimaryKey] -> GetRequestItem
    GetRequestItem Maybe Text
    expr Bool
    consistent [PrimaryKey]
    keys

    toBatchGet :: [GetItem] -> BatchGetItem
    toBatchGet :: [GetItem] -> BatchGetItem
    toBatchGet [GetItem]
    gs = [(Text, GetRequestItem)] -> ReturnConsumption -> BatchGetItem
    BatchGetItem ([GetItem] -> [(Text, GetRequestItem)]
    convert [GetItem]
    gs) ReturnConsumption
    forall a. Default a => a
    def

      where
        groupItems :: [GetItem]-> HM.HashMap T.Text [GetItem] -> HM.HashMap T.Text [GetItem]
        groupItems :: [GetItem] -> HashMap Text [GetItem] -> HashMap Text [GetItem]
    groupItems [] HashMap Text [GetItem]
    hm = HashMap Text [GetItem]
    hm
        groupItems (GetItem
    x:[GetItem]
    xs) HashMap Text [GetItem]
    hm = let key :: Text
    key = GetItem -> Text
    giTableName GetItem
    x
                                 in [GetItem] -> HashMap Text [GetItem] -> HashMap Text [GetItem]
    groupItems [GetItem]
    xs (Text
    -> [GetItem] -> HashMap Text [GetItem] -> HashMap Text [GetItem]
    forall k v.
    (Eq k, Hashable k) =>
    k -> v -> HashMap k v -> HashMap k v
    HM.insert Text
    key (GetItem
    x GetItem -> [GetItem] -> [GetItem]
    forall a. a -> [a] -> [a]
    : ([GetItem] -> Text -> HashMap Text [GetItem] -> [GetItem]
    forall k v. (Eq k, Hashable k) => v -> k -> HashMap k v -> v
    HM.lookupDefault [] Text
    key HashMap Text [GetItem]
    hm)) HashMap Text [GetItem]
    hm)

        convert :: [GetItem] -> [(T.Text,GetRequestItem)]
        convert :: [GetItem] -> [(Text, GetRequestItem)]
    convert [GetItem]
    gs' = let l :: [(Text, [GetItem])]
    l = HashMap Text [GetItem] -> [(Text, [GetItem])]
    forall k v. HashMap k v -> [(k, v)]
    HM.toList (HashMap Text [GetItem] -> [(Text, [GetItem])])
    -> HashMap Text [GetItem] -> [(Text, [GetItem])]
    forall a b. (a -> b) -> a -> b
    $ [GetItem] -> HashMap Text [GetItem] -> HashMap Text [GetItem]
    groupItems [GetItem]
    gs' HashMap Text [GetItem]
    forall k v. HashMap k v
    HM.empty
                        -- Uses one GetItem to specify ProjectionExpression
                        -- and ConsistentRead for the entire batch
                        in ((Text, [GetItem]) -> (Text, GetRequestItem))
    -> [(Text, [GetItem])] -> [(Text, GetRequestItem)]
    forall a b. (a -> b) -> [a] -> [b]
    map (\(Text
    table,items :: [GetItem]
    items@(GetItem
    i:[GetItem]
    _)) ->(Text
    table,Maybe Text -> Bool -> [PrimaryKey] -> GetRequestItem
    GetRequestItem
                                                        (Text -> [Text] -> Text
    T.intercalate Text
    "," ([Text] -> Text) -> Maybe [Text] -> Maybe Text
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> GetItem -> Maybe [Text]
    giAttrs GetItem
    i)
                                                        (GetItem -> Bool
    giConsistent GetItem
    i)
                                                        ((GetItem -> PrimaryKey) -> [GetItem] -> [PrimaryKey]
    forall a b. (a -> b) -> [a] -> [b]
    map GetItem -> PrimaryKey
    giKey [GetItem]
    items)) ) [(Text, [GetItem])]
    l

    -- | Construct a BatchGetItem
    batchGetItem :: [(T.Text, GetRequestItem)]
                   -> BatchGetItem
    batchGetItem :: [(Text, GetRequestItem)] -> BatchGetItem
    batchGetItem [(Text, GetRequestItem)]
    reqs = [(Text, GetRequestItem)] -> ReturnConsumption -> BatchGetItem
    BatchGetItem [(Text, GetRequestItem)]
    reqs ReturnConsumption
    forall a. Default a => a
    def

    instance ToJSON GetRequestItem where
       toJSON :: GetRequestItem -> Value
    toJSON GetRequestItem{Bool
    [PrimaryKey]
    Maybe Text
    griProjExpr :: GetRequestItem -> Maybe Text
    griConsistent :: GetRequestItem -> Bool
    griKeys :: GetRequestItem -> [PrimaryKey]
    griProjExpr :: Maybe Text
    griConsistent :: Bool
    griKeys :: [PrimaryKey]
    ..} =
           ([Pair] -> Value
    object ([Pair] -> Value) -> [Pair] -> Value
    forall a b. (a -> b) -> a -> b
    $ [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
    forall b a. b -> (a -> b) -> Maybe a -> b
    maybe [] (Pair -> [Pair]
    forall a. a -> [a]
    forall (m :: * -> *) a. Monad m => a -> m a
    return (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Key
    "ProjectionExpression" Key -> Text -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .=)) Maybe Text
    griProjExpr [Pair] -> [Pair] -> [Pair]
    forall a. [a] -> [a] -> [a]
    ++
                     [Key
    "ConsistentRead" Key -> Bool -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= Bool
    griConsistent
                     , Key
    "Keys" Key -> [PrimaryKey] -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= [PrimaryKey]
    griKeys])

    instance ToJSON BatchGetItem where
        toJSON :: BatchGetItem -> Value
    toJSON BatchGetItem{[(Text, GetRequestItem)]
    ReturnConsumption
    bgRequests :: BatchGetItem -> [(Text, GetRequestItem)]
    bgRetCons :: BatchGetItem -> ReturnConsumption
    bgRequests :: [(Text, GetRequestItem)]
    bgRetCons :: ReturnConsumption
    ..} =
            [Pair] -> Value
    object ([Pair] -> Value) -> [Pair] -> Value
    forall a b. (a -> b) -> a -> b
    $
              [ Key
    "RequestItems" Key -> HashMap Text GetRequestItem -> Pair
    forall v. ToJSON v => Key -> v -> Pair
    forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
    .= [(Text, GetRequestItem)] -> HashMap Text GetRequestItem
    forall k v. (Eq k, Hashable k) => [(k, v)] -> HashMap k v
    HM.fromList [(Text, GetRequestItem)]
    bgRequests
              , 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
    bgRetCons
              ]

    instance FromJSON GetRequestItem where
        parseJSON :: Value -> Parser GetRequestItem
    parseJSON (Object Object
    p) = do
                     Maybe Text -> Bool -> [PrimaryKey] -> GetRequestItem
    GetRequestItem (Maybe Text -> Bool -> [PrimaryKey] -> GetRequestItem)
    -> Parser (Maybe Text)
    -> Parser (Bool -> [PrimaryKey] -> GetRequestItem)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> Object
    p Object -> Key -> Parser (Maybe Text)
    forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
    .:? Key
    "ProjectionExpression"
                                    Parser (Bool -> [PrimaryKey] -> GetRequestItem)
    -> Parser Bool -> Parser ([PrimaryKey] -> GetRequestItem)
    forall a b. Parser (a -> b) -> Parser a -> Parser b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Object
    p Object -> Key -> Parser Bool
    forall a. FromJSON a => Object -> Key -> Parser a
    .: Key
    "ConsistentRead"
                                    Parser ([PrimaryKey] -> GetRequestItem)
    -> Parser [PrimaryKey] -> Parser GetRequestItem
    forall a b. Parser (a -> b) -> Parser a -> Parser b
    forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
    <*> Object
    p Object -> Key -> Parser [PrimaryKey]
    forall a. FromJSON a => Object -> Key -> Parser a
    .: Key
    "Keys"
        parseJSON Value
    _ = String -> Parser GetRequestItem
    forall a. String -> Parser a
    forall (m :: * -> *) a. MonadFail m => String -> m a
    fail String
    "unable to parse GetRequestItem"

    data BatchGetItemResponse = BatchGetItemResponse {
          BatchGetItemResponse -> [(Text, [Item])]
    bgResponses :: [(T.Text, [Item])]
        , BatchGetItemResponse -> Maybe [(Text, GetRequestItem)]
    bgUnprocessed    :: Maybe [(T.Text,GetRequestItem)]
        -- ^ Unprocessed Requests on failure
        , BatchGetItemResponse -> Maybe ConsumedCapacity
    bgConsumed :: Maybe ConsumedCapacity
        -- ^ Amount of capacity consumed
        } deriving (BatchGetItemResponse -> BatchGetItemResponse -> Bool
    (BatchGetItemResponse -> BatchGetItemResponse -> Bool)
    -> (BatchGetItemResponse -> BatchGetItemResponse -> Bool)
    -> Eq BatchGetItemResponse
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    == :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    $c/= :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    /= :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    Eq,Int -> BatchGetItemResponse -> ShowS
    [BatchGetItemResponse] -> ShowS
    BatchGetItemResponse -> String
    (Int -> BatchGetItemResponse -> ShowS)
    -> (BatchGetItemResponse -> String)
    -> ([BatchGetItemResponse] -> ShowS)
    -> Show BatchGetItemResponse
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> BatchGetItemResponse -> ShowS
    showsPrec :: Int -> BatchGetItemResponse -> ShowS
    $cshow :: BatchGetItemResponse -> String
    show :: BatchGetItemResponse -> String
    $cshowList :: [BatchGetItemResponse] -> ShowS
    showList :: [BatchGetItemResponse] -> ShowS
    Show,ReadPrec [BatchGetItemResponse]
    ReadPrec BatchGetItemResponse
    Int -> ReadS BatchGetItemResponse
    ReadS [BatchGetItemResponse]
    (Int -> ReadS BatchGetItemResponse)
    -> ReadS [BatchGetItemResponse]
    -> ReadPrec BatchGetItemResponse
    -> ReadPrec [BatchGetItemResponse]
    -> Read BatchGetItemResponse
    forall a.
    (Int -> ReadS a)
    -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
    $creadsPrec :: Int -> ReadS BatchGetItemResponse
    readsPrec :: Int -> ReadS BatchGetItemResponse
    $creadList :: ReadS [BatchGetItemResponse]
    readList :: ReadS [BatchGetItemResponse]
    $creadPrec :: ReadPrec BatchGetItemResponse
    readPrec :: ReadPrec BatchGetItemResponse
    $creadListPrec :: ReadPrec [BatchGetItemResponse]
    readListPrec :: ReadPrec [BatchGetItemResponse]
    Read,Eq BatchGetItemResponse
    Eq BatchGetItemResponse =>
    (BatchGetItemResponse -> BatchGetItemResponse -> Ordering)
    -> (BatchGetItemResponse -> BatchGetItemResponse -> Bool)
    -> (BatchGetItemResponse -> BatchGetItemResponse -> Bool)
    -> (BatchGetItemResponse -> BatchGetItemResponse -> Bool)
    -> (BatchGetItemResponse -> BatchGetItemResponse -> Bool)
    -> (BatchGetItemResponse
        -> BatchGetItemResponse -> BatchGetItemResponse)
    -> (BatchGetItemResponse
        -> BatchGetItemResponse -> BatchGetItemResponse)
    -> Ord BatchGetItemResponse
    BatchGetItemResponse -> BatchGetItemResponse -> Bool
    BatchGetItemResponse -> BatchGetItemResponse -> Ordering
    BatchGetItemResponse
    -> BatchGetItemResponse -> BatchGetItemResponse
    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 :: BatchGetItemResponse -> BatchGetItemResponse -> Ordering
    compare :: BatchGetItemResponse -> BatchGetItemResponse -> Ordering
    $c< :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    < :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    $c<= :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    <= :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    $c> :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    > :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    $c>= :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    >= :: BatchGetItemResponse -> BatchGetItemResponse -> Bool
    $cmax :: BatchGetItemResponse
    -> BatchGetItemResponse -> BatchGetItemResponse
    max :: BatchGetItemResponse
    -> BatchGetItemResponse -> BatchGetItemResponse
    $cmin :: BatchGetItemResponse
    -> BatchGetItemResponse -> BatchGetItemResponse
    min :: BatchGetItemResponse
    -> BatchGetItemResponse -> BatchGetItemResponse
    Ord)

    instance Transaction BatchGetItem BatchGetItemResponse

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

    instance FromJSON BatchGetItemResponse where
        parseJSON :: Value -> Parser BatchGetItemResponse
    parseJSON (Object Object
    v) = [(Text, [Item])]
    -> Maybe [(Text, GetRequestItem)]
    -> Maybe ConsumedCapacity
    -> BatchGetItemResponse
    BatchGetItemResponse
            ([(Text, [Item])]
     -> Maybe [(Text, GetRequestItem)]
     -> Maybe ConsumedCapacity
     -> BatchGetItemResponse)
    -> Parser [(Text, [Item])]
    -> Parser
         (Maybe [(Text, GetRequestItem)]
          -> Maybe ConsumedCapacity -> BatchGetItemResponse)
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (HashMap Text [Item] -> [(Text, [Item])]
    forall k v. HashMap k v -> [(k, v)]
    HM.toList (HashMap Text [Item] -> [(Text, [Item])])
    -> Parser (HashMap Text [Item]) -> Parser [(Text, [Item])]
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    <$> (Object
    v Object -> Key -> Parser (HashMap Text [Item])
    forall a. FromJSON a => Object -> Key -> Parser a
    .: Key
    "Responses"))
            Parser
      (Maybe [(Text, GetRequestItem)]
       -> Maybe ConsumedCapacity -> BatchGetItemResponse)
    -> Parser (Maybe [(Text, GetRequestItem)])
    -> Parser (Maybe ConsumedCapacity -> BatchGetItemResponse)
    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 [(Text, GetRequestItem)])
    forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
    .:? Key
    "UnprocessedItems"
            Parser (Maybe ConsumedCapacity -> BatchGetItemResponse)
    -> Parser (Maybe ConsumedCapacity) -> Parser BatchGetItemResponse
    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 BatchGetItemResponse
    forall a. String -> Parser a
    forall (m :: * -> *) a. MonadFail m => String -> m a
    fail String
    "BatchGetItemResponse must be an object."

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

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