Skip to content
Browse files

some small fixes so the route53 branch compiles

  • Loading branch information...
1 parent c89ba39 commit b9384ed3573d79eb4f3866ebf94fead380af5fea @aristidb committed Aug 28, 2012
View
1 Aws/Route53/Commands/CreateHostedZone.hs
@@ -61,4 +61,3 @@ instance ResponseConsumer r CreateHostedZoneResponse where
return $ CreateHostedZoneResponse zone changeInfo delegationSet
instance Transaction CreateHostedZone CreateHostedZoneResponse
-
View
2 Aws/Route53/Commands/GetDate.hs
@@ -11,6 +11,7 @@
--
module Aws.Route53.Commands.GetDate where
+{-
import Aws.Core
import Aws.Route53.Core
import Data.Maybe
@@ -59,3 +60,4 @@ getDate = GetDate
instance Transaction GetDate GetDateResponse
+-}
View
2 Aws/Route53/Commands/ListHostedZones.hs
@@ -58,5 +58,5 @@ instance Transaction ListHostedZones ListHostedZonesResponse
instance IteratedTransaction ListHostedZones ListHostedZonesResponse where
nextIteratedRequest req ListHostedZonesResponse{ lhzrNextToken = nt } = req { lhzNextToken = nt } <$ nt
- combineIteratedResponse (ListHostedZonesResponse z0 _) (ListHostedZonesResponse z1 nt) = ListHostedZonesResponse (z0 ++ z1) nt
+-- combineIteratedResponse (ListHostedZonesResponse z0 _) (ListHostedZonesResponse z1 nt) = ListHostedZonesResponse (z0 ++ z1) nt
View
4 Aws/Route53/Commands/ListResourceRecordSets.hs
@@ -85,12 +85,12 @@ instance IteratedTransaction ListResourceRecordSets ListResourceRecordSetsRespon
lrrsrNextRecordType
lrrsrNextRecordIdentifier
lrrsrMaxItems
- combineIteratedResponse a b = ListResourceRecordSetsResponse
+{- combineIteratedResponse a b = ListResourceRecordSetsResponse
{ lrrsrResourceRecordSets = lrrsrResourceRecordSets a ++ lrrsrResourceRecordSets b
, lrrsrIsTruncated = lrrsrIsTruncated b
, lrrsrNextRecordName = lrrsrNextRecordName b
, lrrsrNextRecordType = lrrsrNextRecordType b
, lrrsrNextRecordIdentifier = lrrsrNextRecordIdentifier b
, lrrsrMaxItems = lrrsrMaxItems b
- }
+ }-}
View
13 Aws/Route53/Core.hs
@@ -72,7 +72,7 @@ import Data.Typeable
import Control.Monad (MonadPlus, mzero, mplus, liftM)
import Data.List (find)
import Data.Map (insert, empty)
-import Data.Maybe (listToMaybe, fromJust)
+import Data.Maybe (listToMaybe, fromJust, fromMaybe)
import Data.Text (Text, unpack)
import Data.Text.Encoding (decodeUtf8)
import Data.Time (UTCTime)
@@ -155,6 +155,9 @@ instance Monoid Route53Metadata where
mempty = Route53Metadata Nothing
Route53Metadata r1 `mappend` Route53Metadata r2 = Route53Metadata (r1 `mplus` r2)
+instance Loggable Route53Metadata where
+ toLogText (Route53Metadata rid) = "Route53: " `mappend` fromMaybe "<none>" rid
+
-- -------------------------------------------------------------------------- --
-- Query
@@ -212,19 +215,19 @@ route53SignQuery method resource query body Route53Configuration{..} sd
route53ResponseConsumer :: (Cu.Cursor -> Response Route53Metadata a)
-> IORef Route53Metadata
-> HTTPResponseConsumer a
-route53ResponseConsumer inner metadataRef status headers =
- xmlCursorConsumer parse metadataRef status headers
+route53ResponseConsumer inner metadataRef resp =
+ xmlCursorConsumer parse metadataRef resp
where
parse cursor = do
- tellMetadata . Route53Metadata . fmap decodeUtf8 $ findHeaderValue headers hRequestId
+ tellMetadata . Route53Metadata . fmap decodeUtf8 $ findHeaderValue (HTTP.responseHeaders resp) hRequestId
case cursor $/ Cu.laxElement "Error" of
[] -> inner cursor
(err:_) -> fromError err
fromError cursor = do
errCode <- force "Missing Error Code" $ cursor $// elContent "Code"
errMessage <- force "Missing Error Message" $ cursor $// elContent "Message"
- F.failure $ Route53Error status errCode errMessage
+ F.failure $ Route53Error (HTTP.responseStatus resp) errCode errMessage
route53CheckResponseType :: F.Failure XmlException m => a -> Text -> Cu.Cursor -> m a
View
1 ghci.hs
@@ -1,6 +1,7 @@
-- GHCI convenience code
import Aws
+import qualified Aws.Route53 as R53
import qualified Aws.S3 as S3
import qualified Aws.Ses as Ses
import qualified Aws.SimpleDb as Sdb

0 comments on commit b9384ed

Please sign in to comment.
Something went wrong with that request. Please try again.