@@ -22,7 +22,7 @@ import Network.HTTP.Conduit
23-- | The environment containing the parameters required to make Google requests.
23-- | The environment containing the parameters required to make Google requests.
24data Env = Env
24data Env = Env
25− { _envOverride :: !(Dual (Endo Service))
25+ { _envOverride :: !(Dual (Endo ServiceConfig))
26 , _envLogger :: !Logger
26 , _envLogger :: !Logger
27 , _envManager :: !Manager
27 , _envManager :: !Manager
28 , _envStore :: !Store
28 , _envStore :: !Store
@@ -36,7 +36,7 @@ class HasEnv a where
36 {-# MINIMAL environment #-}
36 {-# MINIMAL environment #-}
38 -- | The currently applied overrides to all 'Service' configuration.
38 -- | The currently applied overrides to all 'Service' configuration.
39− envOverride :: Lens' a (Dual (Endo Service))
39+ envOverride :: Lens' a (Dual (Endo ServiceConfig))
41 -- | The function used to output log messages.
41 -- | The function used to output log messages.
42 envLogger :: Lens' a Logger
42 envLogger :: Lens' a Logger
@@ -61,7 +61,7 @@ instance HasEnv Env where
61-- To override a specific service, it's suggested you use
61-- To override a specific service, it's suggested you use
62-- either 'configure' or 'reconfigure' with a modified version of the default
62-- either 'configure' or 'reconfigure' with a modified version of the default
63-- service, such as @Network.Google.Gmail.gmailService@.
63-- service, such as @Network.Google.Gmail.gmailService@.
64−override :: HasEnv a => (Service -> Service) -> a -> a
64+override :: HasEnv a => (ServiceConfig -> ServiceConfig) -> a -> a
65override f = envOverride <>~ Dual (Endo f)
65override f = envOverride <>~ Dual (Endo f)
67-- | Configure a specific service. All requests belonging to the
67-- | Configure a specific service. All requests belonging to the
@@ -71,7 +71,7 @@ override f = envOverride <>~ Dual (Endo f)
71-- as @Network.Google.Gmail.gmailService@.
71-- as @Network.Google.Gmail.gmailService@.
73-- /See:/ 'reconfigure'.
73-- /See:/ 'reconfigure'.
74−configure :: HasEnv a => Service -> a -> a
74+configure :: HasEnv a => ServiceConfig -> a -> a
75configure s = override f
75configure s = override f
77 f x | on (==) _svcId s x = s
77 f x | on (==) _svcId s x = s
@@ -84,7 +84,7 @@ configure s = override f
84-- as @Network.Google.Gmail.gmailService@.
84-- as @Network.Google.Gmail.gmailService@.
86-- /See:/ 'configure'.
86-- /See:/ 'configure'.
87−reconfigure :: (MonadReader r m, HasEnv r) => Service -> m a -> m a
87+reconfigure :: (MonadReader r m, HasEnv r) => ServiceConfig -> m a -> m a
88reconfigure = local . configure
88reconfigure = local . configure
90-- | Scope an action such that any HTTP response will use this timeout value.
90-- | Scope an action such that any HTTP response will use this timeout value.