aws 0.22 → 0.22.1
raw patch · 6 files changed
+40/−31 lines, 6 filesdep ~aesondep ~bytestringdep ~http-clientnew-uploaderPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: aeson, bytestring, http-client
API changes (from Hackage documentation)
Files
- Aws/DynamoDb/Commands/Table.hs +2/−2
- Aws/DynamoDb/Commands/UpdateItem.hs +3/−2
- Aws/DynamoDb/Core.hs +20/−19
- CHANGELOG.md +6/−0
- README.md +1/−0
- aws.cabal +8/−8
Aws/DynamoDb/Commands/Table.hs view
@@ -35,9 +35,9 @@ import Control.Applicative import Data.Aeson ((.!=), (.:), (.:?), (.=)) import qualified Data.Aeson as A+import qualified Data.Aeson.KeyMap as KM import qualified Data.Aeson.Types as A import Data.Char (toUpper)-import qualified Data.HashMap.Strict as M import Data.Scientific (Scientific) import qualified Data.Text as T import Data.Time@@ -281,7 +281,7 @@ instance A.FromJSON TableDescription where parseJSON = A.withObject "Table must be an object" $ \o -> do- t <- case (M.lookup "Table" o, M.lookup "TableDescription" o) of+ t <- case (KM.lookup "Table" o, KM.lookup "TableDescription" o) of (Just (A.Object t), _) -> return t (_, Just (A.Object t)) -> return t _ -> fail "Table description must have key 'Table' or 'TableDescription'"
Aws/DynamoDb/Commands/UpdateItem.hs view
@@ -31,6 +31,7 @@ ------------------------------------------------------------------------------- import Control.Applicative import Data.Aeson+import qualified Data.Aeson.Key as AK import Data.Default import qualified Data.Text as T import Prelude@@ -91,9 +92,9 @@ toJSON = object . map mk . getAttributeUpdates where mk AttributeUpdate { auAction = UDelete, auAttr = auAttr } =- (attrName auAttr) .= object+ (AK.fromText (attrName auAttr)) .= object ["Action" .= UDelete]- mk AttributeUpdate { .. } = (attrName auAttr) .= object+ mk AttributeUpdate { .. } = AK.fromText (attrName auAttr) .= object ["Value" .= (attrVal auAttr), "Action" .= auAction]
Aws/DynamoDb/Core.hs view
@@ -128,6 +128,8 @@ import qualified Crypto.Hash as CH import Data.Aeson import qualified Data.Aeson as A+import qualified Data.Aeson.Key as AK+import qualified Data.Aeson.KeyMap as KM import Data.Aeson.Types (Pair, parseEither) import qualified Data.Aeson.Types as A import qualified Data.Attoparsec.ByteString as AttoB (endOfInput)@@ -141,7 +143,6 @@ import Data.Conduit.Attoparsec (sinkParser) import Data.Default import Data.Function (on)-import qualified Data.HashMap.Strict as HM import Data.Int import Data.IORef import Data.List@@ -536,7 +537,7 @@ toJSON (PrimaryKey h (Just r)) = let Object p1 = toJSON h Object p2 = toJSON r- in Object (p1 `HM.union` p2)+ in Object (p1 `KM.union` p2) instance FromJSON PrimaryKey where parseJSON p = do@@ -544,8 +545,8 @@ case length l of 1 -> return $ head l _ -> fail "Unable to parse PrimaryKey" - where listPKey p'= map (\(txt,dval)-> hk txt dval)- . HM.toList <$> parseJSON p'+ where listPKey p'= map (\(k,dval)-> hk (AK.toText k) dval)+ . KM.toList <$> parseJSON p' -- | A key-value pair@@ -661,9 +662,9 @@ ------------------------------------------------------------------------------- -- | Parse a JSON object that contains attributes parseAttributeJson :: Value -> A.Parser [Attribute]-parseAttributeJson (Object v) = mapM conv $ HM.toList v+parseAttributeJson (Object v) = mapM conv $ KM.toList v where- conv (k, o) = Attribute k <$> parseJSON o+ conv (k, o) = Attribute (AK.toText k) <$> parseJSON o parseAttributeJson _ = error "Attribute JSON must be an Object" @@ -674,7 +675,7 @@ -- | Convert into JSON pair attributeJson :: Attribute -> Pair-attributeJson (Attribute nm v) = nm .= v+attributeJson (Attribute nm v) = AK.fromText nm .= v -------------------------------------------------------------------------------@@ -962,7 +963,7 @@ where a = if null es then []- else [key .= object (map conditionJson es)]+ else [AK.fromText key .= object (map conditionJson es)] b = if length (take 2 es) > 1 then ["ConditionalOperator" .= String (rendCondOp op) ]@@ -1046,7 +1047,7 @@ conditionJson :: Condition -> Pair-conditionJson Condition{..} = condAttr .= condOp+conditionJson Condition{..} = AK.fromText condAttr .= condOp instance ToJSON CondOp where@@ -1076,12 +1077,12 @@ instance FromJSON ConsumedCapacity where- parseJSON (Object v) = ConsumedCapacity- <$> v .: "CapacityUnits"- <*> (HM.toList <$> v .:? "GlobalSecondaryIndexes" .!= mempty)- <*> (HM.toList <$> v .:? "LocalSecondaryIndexes" .!= mempty)- <*> (v .:? "Table" >>= maybe (return Nothing) (.: "CapacityUnits"))- <*> v .: "TableName"+ parseJSON (Object o) = ConsumedCapacity+ <$> o .: "CapacityUnits"+ <*> (map (\(k, v) -> (AK.toText k, v)) . KM.toList <$> o .:? "GlobalSecondaryIndexes" .!= mempty)+ <*> (map (\(k, v) -> (AK.toText k, v)) . KM.toList <$> o .:? "LocalSecondaryIndexes" .!= mempty)+ <*> (o .:? "Table" >>= maybe (return Nothing) (.: "CapacityUnits"))+ <*> o .: "TableName" parseJSON _ = fail "ConsumedCapacity must be an Object." @@ -1115,10 +1116,10 @@ instance FromJSON ItemCollectionMetrics where- parseJSON (Object v) = ItemCollectionMetrics- <$> (do m <- v .: "ItemCollectionKey"- return $ head $ HM.toList m)- <*> v .: "SizeEstimateRangeGB"+ parseJSON (Object o) = ItemCollectionMetrics+ <$> (do m <- o .: "ItemCollectionKey"+ return $ (\(k, v) -> (AK.toText k, v)) $ head $ KM.toList m)+ <*> o .: "SizeEstimateRangeGB" parseJSON _ = fail "ItemCollectionMetrics must be an Object."
CHANGELOG.md view
@@ -1,6 +1,12 @@ 0.22 series ----------- +- 0.22.1+ - Update to aeson-2+ - Support http-client 0.7+ - Support base64-bytestring 1.2+ - Support attoparsec 0.14+ - Support base16-bytestring 1.0 - 0.22 - Support GHC 8.8 - Support network-3
README.md view
@@ -136,5 +136,6 @@ John Wiegley |[jwiegley](https://github.com/jwiegley) |johnw@fpcomplete.com |[FP Complete](http://fpcomplete.com) |Co-Maintainer, S3 Chris Dornan |[cdornan](https://github.com/cdornan) |chris.dornan@irisconnect.co.uk |[Iris Connect](http://irisconnect.co.uk) |Core John Lenz |[wuzzeb](https://github/com/wuzzeb) | | |DynamoDB, Core+ Joey Hess |[joeyh](https://github.com/joeyh) |id@joeyh.name |- |Co-Maintainer, S3
aws.cabal view
@@ -1,5 +1,5 @@ Name: aws-Version: 0.22+Version: 0.22.1 Synopsis: Amazon Web Services (AWS) for Haskell Description: Bindings for Amazon Web Services (AWS), with the aim of supporting all AWS services. To see a high level overview of the library, see the README at <https://github.com/aristidb/aws/blob/master/README.md>. Homepage: http://github.com/aristidb/aws@@ -19,7 +19,7 @@ Source-repository this type: git location: https://github.com/aristidb/aws.git- tag: 0.22+ tag: 0.22.1 Source-repository head type: git@@ -128,11 +128,11 @@ Aws.Sqs.Core Build-depends:- aeson >= 0.6,- attoparsec >= 0.11 && < 0.14,+ aeson >= 2.0.0.0,+ attoparsec >= 0.11 && < 0.15, base >= 4.6 && < 5,- base16-bytestring == 0.1.*,- base64-bytestring == 1.0.*,+ base16-bytestring >= 0.1 && < 1.1,+ base64-bytestring >= 1.0 && < 1.3, blaze-builder >= 0.2.1.4 && < 0.5, byteable == 0.1.*, bytestring >= 0.9 && < 0.11,@@ -396,7 +396,7 @@ base == 4.*, bytestring >= 0.10, errors >= 2.0,- http-client >= 0.3 && < 0.7,+ http-client >= 0.3 && < 0.8, lifted-base >= 0.2, monad-control >= 0.3, mtl >= 2.1,@@ -464,7 +464,7 @@ lifted-base >= 0.2, monad-control >= 0.3, mtl >= 2.1,- http-client < 0.7,+ http-client < 0.8, http-client-tls < 0.5, http-types, resourcet,