-- | Run an AWS transaction, /with/ an HTTP manager and without metadata.
-- Cause really this is what you are going to do like all the f'en time.
-- Metadata is logged at level 'Info'.
-- Usage:
-- @
--     resp <- mgrAws cfg serviceCfg mgr request
-- @
mgrAws :: (Transaction r a, AsMemoryResponse a, MonadIO io)
            => Configuration
            -> ServiceConfiguration r NormalQuery
            -> HTTP.Manager
            -> r
            -> io (MemoryResponse a)
mgrAws cfg scfg mgr request
  = liftIO $ runResourceT $ do
      loadToMemory =<< readResponseIO =<< aws cfg scfg mgr request

-- | Run an AWS transaction, without enforcing that response and request type form a valid transaction pair.
--
-- This is especially useful for debugging and development, you should not have to use it in production.
--
-- All errors are caught and wrapped in the 'Response' value.
--
-- Metadata is wrapped in the Response, and also logged at level 'Info'.
mgrAws :: (Transaction r a, AsMemoryResponse a, MonadIO io)
            => Configuration
            -> ServiceConfiguration r NormalQuery
            -> HTTP.Manager
            -> r
            -> io (MemoryResponse a)
mgrAws cfg scfg mgr request
  = liftIO $ runResourceT $ do
      loadToMemory =<< readResponseIO =<< aws cfg scfg mgr request

-- | Run an AWS transaction, without enforcing that response and request type form a valid transaction pair.
--
-- This is especially useful for debugging and development, you should not have to use it in production.
--
-- All errors are caught and wrapped in the 'Response' value.
--
-- Metadata is wrapped in the Response, and also logged at level 'Info'.
mgrAws cfg scfg mgr request
  = liftIO $ runResourceT $ do
      loadToMemory =<< readResponseIO =<< aws cfg scfg mgr request

-- | Run an AWS transaction, without enforcing that response and request type form a valid transaction pair.
--
-- This is especially useful for debugging and development, you should not have to use it in production.
--
-- All errors are caught and wrapped in the 'Response' value.
--
-- Metadata is wrapped in the Response, and also logged at level 'Info'.