diff --git a/ms-azure-api/CHANGELOG.md b/ms-azure-api/CHANGELOG.md index e440396..722ad9a 100644 --- a/ms-azure-api/CHANGELOG.md +++ b/ms-azure-api/CHANGELOG.md @@ -14,6 +14,13 @@ ToJSON instance of Location renders the full name e.g. "West Europe" MSAzureAPI.ServiceBus +add 'http-client' as an explicit dependency + +* breaking changes + +Fixed definition of 'put' to use the correct HTTP verb +Add constructor to 'APIPlane' to reflect service bus usage + ## 0.4 TLS support diff --git a/ms-azure-api/src/MSAzureAPI/ServiceBus.hs b/ms-azure-api/src/MSAzureAPI/ServiceBus.hs index 6ddec45..deb2edf 100644 --- a/ms-azure-api/src/MSAzureAPI/ServiceBus.hs +++ b/ms-azure-api/src/MSAzureAPI/ServiceBus.hs @@ -1,5 +1,7 @@ +{-# LANGUAGE TypeFamilies #-} module MSAzureAPI.ServiceBus where +import GHC.Exts (IsList(..)) import GHC.Generics (Generic(..)) -- aeson @@ -37,8 +39,11 @@ sendMessageBatch sn qname topic = postSBMessage sn [ where qpt = qname <> "|" <> topic - newtype MessageBatch a = MessageBatch [a] deriving (Eq, Show) +instance IsList (MessageBatch a) where + type Item (MessageBatch a) = a + fromList = MessageBatch + toList (MessageBatch xs) = xs instance A.ToJSON a => A.ToJSON (MessageBatch a) where toJSON (MessageBatch xs) = A.toJSON $ map (\x -> M.singleton ("Body" :: String) x) xs