@@ -1,12 +1,13 @@
1−{-# LANGUAGE DataKinds #-}
1+{-# LANGUAGE DataKinds #-}
2−{-# LANGUAGE ExtendedDefaultRules #-}
2+{-# LANGUAGE ExtendedDefaultRules #-}
3−{-# LANGUAGE OverloadedStrings #-}
3+{-# LANGUAGE OverloadedStrings #-}
4−{-# LANGUAGE TemplateHaskell #-}
4+{-# LANGUAGE TemplateHaskell #-}
5+{-# LANGUAGE TypeFamilies #-}
6{-# OPTIONS_GHC -fno-warn-type-defaults #-}
7{-# OPTIONS_GHC -fno-warn-type-defaults #-}
8-- Module : Network.PagerDuty.REST.Services
9-- Module : Network.PagerDuty.REST.Services
9−-- Copyright : (c) 2013-2014 Brendan Hay <brendan.g.hay@gmail.com>
10+-- Copyright : (c) 2013-2015 Brendan Hay <brendan.g.hay@gmail.com>
10-- License : This Source Code Form is subject to the terms of
11-- License : This Source Code Form is subject to the terms of
11-- the Mozilla Public License, v. 2.0.
12-- the Mozilla Public License, v. 2.0.
12-- A copy of the MPL can be found in the LICENSE file or
13-- A copy of the MPL can be found in the LICENSE file or
@@ -23,14 +24,16 @@
23-- When a service is shown inlined in other resources, a deleted service will
24-- When a service is shown inlined in other resources, a deleted service will
24-- have its @html_url@ attribute set to 'Nothing'.
25-- have its @html_url@ attribute set to 'Nothing'.
26−-- See: <http://developer.pagerduty.com/documentation/rest/services>
27+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services>
27module Network.PagerDuty.REST.Services
28module Network.PagerDuty.REST.Services
29 -- * List Services
30 -- * List Services
30− listServices
32+ , listServices
31 , lsTimeZone
33 , lsTimeZone
33 -- * Create Service
35 -- * Create Service
34 , createService
37 , createService
36 , csDescription
39 , csDescription
@@ -45,6 +48,7 @@ module Network.PagerDuty.REST.Services
45 , getService
48 , getService
47 -- * Update Service
50 -- * Update Service
48 , updateService
52 , updateService
50 , usEscalationPolicyId
54 , usEscalationPolicyId
@@ -68,7 +72,6 @@ module Network.PagerDuty.REST.Services
68 -- * Types
72 -- * Types
69 , EmailFilterMode (..)
73 , EmailFilterMode (..)
70 , EmailIncidentCreation (..)
74 , EmailIncidentCreation (..)
72 , ServiceStatus (..)
75 , ServiceStatus (..)
73 , ServiceType (..)
76 , ServiceType (..)
74 , SeverityFilter (..)
77 , SeverityFilter (..)
@@ -79,15 +82,6 @@ module Network.PagerDuty.REST.Services
79 , cntResolved
82 , cntResolved
80 , cntTotal
83 , cntTotal
91 , PolicyInfo
85 , PolicyInfo
93 , pinfoName
87 , pinfoName
@@ -112,15 +106,16 @@ module Network.PagerDuty.REST.Services
112 , svcSeverityFilter
106 , svcSeverityFilter
115−import Control.Lens
109+import Control.Lens hiding (Empty)
116−import Data.Aeson.Lens
110+import Data.Aeson.Lens
117−import Data.ByteString.Builder (Builder)
111+import Data.Text (Text)
118−import Data.Text (Text)
112+import Data.Time
119−import Network.HTTP.Types
113+import Network.HTTP.Types
120−import Network.PagerDuty.TH
114+import Network.PagerDuty.Internal.TH
121−import Network.PagerDuty.Types
115+import Network.PagerDuty.Internal.Types
116+import Network.PagerDuty.REST.Services.EmailFilters
123−default (Builder)
118+default (Path)
125services :: Path
120services :: Path
126services = "services"
121services = "services"
@@ -138,8 +133,7 @@ data IncidentCounts = IncidentCounts
138 , _cntTotal :: !Int
133 , _cntTotal :: !Int
139 } deriving (Eq, Show)
134 } deriving (Eq, Show)
141−deriveJSON ''IncidentCounts
142−makeLenses ''IncidentCounts
136+deriveRecord ''IncidentCounts
144data EmailIncidentCreation
138data EmailIncidentCreation
145 = OnNewEmail
139 = OnNewEmail
@@ -150,7 +144,7 @@ data EmailIncidentCreation
150 -- ^ Open a new incident only if an open incident does not already exist.
144 -- ^ Open a new incident only if an open incident does not already exist.
151 deriving (Eq, Show)
145 deriving (Eq, Show)
153−deriveJSON ''EmailIncidentCreation
147+deriveNullary ''EmailIncidentCreation
155data EmailFilterMode
149data EmailFilterMode
156 = AllEmail
150 = AllEmail
@@ -161,7 +155,7 @@ data EmailFilterMode
161 -- ^ Accept email only if it matches ALL of the rules below
155 -- ^ Accept email only if it matches ALL of the rules below
162 deriving (Eq, Show)
156 deriving (Eq, Show)
164−deriveJSONWith hyphenated ''EmailFilterMode
158+deriveNullaryWith hyphenated ''EmailFilterMode
166data ServiceStatus
160data ServiceStatus
@@ -177,7 +171,7 @@ data ServiceStatus
177 -- ^ The service is disabled and will not have any new triggered incidents.
171 -- ^ The service is disabled and will not have any new triggered incidents.
178 deriving (Eq, Show)
172 deriving (Eq, Show)
180−deriveJSON ''ServiceStatus
174+deriveNullary ''ServiceStatus
182data ServiceType
176data ServiceType
183 = CloudKick
177 = CloudKick
@@ -190,72 +184,14 @@ data ServiceType
190 | SqlMonitor
184 | SqlMonitor
191 deriving (Eq, Show)
185 deriving (Eq, Show)
193−deriveJSON ''ServiceType
187+deriveNullary ''ServiceType
195data PolicyInfo = PolicyInfo
189data PolicyInfo = PolicyInfo
196− { _pinfoId :: PolicyId
190+ { _pinfoId :: EscalationPolicyId
197 , _pinfoName :: Text
191 , _pinfoName :: Text
198 } deriving (Eq, Show)
192 } deriving (Eq, Show)
200−makeLenses ''PolicyInfo
194+deriveRecord ''PolicyInfo
201−deriveJSON ''PolicyInfo
209−deriveJSONWith hyphenated ''MatchMode
211−-- FIXME: Tighten up this type! Make the regex required for match/no-match.
212−data EmailFilters = EmailFilters
213− { _efsId :: EmailFilterId
214− , _efsSubjectMode :: Maybe MatchMode
215− , _efsSubjectRegex :: Maybe Text
216− , _efsBodyMode :: Maybe MatchMode
217− , _efsBodyRegex :: Maybe Text
218− , _efsFromEmailMode :: Maybe MatchMode
219− , _efsFromEmailRegex :: Maybe Text
220− } deriving (Eq, Show)
222−deriveJSON ''EmailFilters
224−-- | The email filter ID.
225−makeLens "_efsId" ''EmailFilters
227−-- | One of always, match, no-match, which, respectively, means to not filter
228−-- the email trigger by subject, filter it if the email subject matches the
229−-- given regex, or filter if it doesn't match the given regex.
231−-- Defaults to always.
232−makeLens "_efsSubjectMode" ''EmailFilters
234−-- | The regex to be used when subject_mode is match or no-match.
235−-- It is a required parameter on such cases.
236−makeLens "_efsSubjectRegex" ''EmailFilters
238−-- | One of always, match, no-match, which, respectively, means to not filter
239−-- the email trigger by body, filter it if the body email matches the given regex,
240−-- or filter if it doesn't match the given regex.
242−-- Defaults to always.
243−makeLens "_efsBodyMode" ''EmailFilters
245−-- | The regex to be used when body_mode is match or no-match.
246−-- It is a required parameter on such cases.
247−makeLens "_efsBodyRegex" ''EmailFilters
249−-- | One of always, match, no-match, which, respectively, means to not filter
250−-- the email trigger by its from address, filter it if the email from address
251−-- matches the given regex, or filter if it doesn't match the given regex.
253−-- Defaults to always.
254−makeLens "_efsFromEmailMode" ''EmailFilters
256−-- | The regex to be used when from_email_mode is match or no-match.
257−-- It is a required parameter on such cases.
258−makeLens "_efsFromEmailRegex" ''EmailFilters
260data SeverityFilter
196data SeverityFilter
261 = SevCritical
197 = SevCritical
@@ -270,7 +206,7 @@ data SeverityFilter
270 -- ^ SQL Monitor: Incidents are created for with high or medium severity
206 -- ^ SQL Monitor: Incidents are created for with high or medium severity
271 deriving (Eq, Show)
207 deriving (Eq, Show)
273−deriveJSONWith (dropped 3 underscored) ''SeverityFilter
209+deriveNullaryWith (dropped 3 underscored) ''SeverityFilter
275data Service = Service
211data Service = Service
276 { _svcId :: ServiceId
212 { _svcId :: ServiceId
@@ -287,8 +223,8 @@ data Service = Service
287 , _svcIncidentCounts :: IncidentCounts
223 , _svcIncidentCounts :: IncidentCounts
288 , _svcEmailFilterMode :: EmailFilterMode
224 , _svcEmailFilterMode :: EmailFilterMode
289 , _svcType :: ServiceType
225 , _svcType :: ServiceType
290− , _svcEscalationPolicy :: Maybe PolicyInfo -- FIXME: extract from inline.
226+ , _svcEscalationPolicy :: Maybe PolicyInfo -- FIXME: extract from inline.
291− , _svcEmailFilters :: Maybe EmailFilters -- FIXME: extract from inline.
227+ , _svcEmailFilters :: Maybe [EmailFilterInfo] -- FIXME: extract from inline.
292 , _svcSeverityFilter :: Maybe SeverityFilter
228 , _svcSeverityFilter :: Maybe SeverityFilter
293 } deriving (Eq, Show)
229 } deriving (Eq, Show)
@@ -320,13 +256,17 @@ makeLens "_svcAutoResolveTimeout" ''Service
320makeLens "_svcAcknowledgementTimeout" ''Service
256makeLens "_svcAcknowledgementTimeout" ''Service
322-- | The date/time when this service was created.
258-- | The date/time when this service was created.
323−makeLens "_svcCreatedAt" ''Service
259+svcCreatedAt :: Lens' Service UTCTime
260+svcCreatedAt = lens _svcCreatedAt (\s x -> s { _svcCreatedAt = x }) . _D
325-- | The current state of the Service.
262-- | The current state of the Service.
326makeLens "_svcStatus" ''Service
263makeLens "_svcStatus" ''Service
328-- | The date/time when the most recent incident was created for this service.
265-- | The date/time when the most recent incident was created for this service.
329−makeLens "_svcLastIncidentTimestamp" ''Service
266+svcLastIncidentTimestamp :: Lens' Service (Maybe UTCTime)
267+svcLastIncidentTimestamp =
268+ lens _svcLastIncidentTimestamp
269+ (\s x -> s { _svcLastIncidentTimestamp = x }) . mapping _D
331-- | If the service is a Generic Email service, this describes what kind of
271-- | If the service is a Generic Email service, this describes what kind of
332-- emails create an incident.
272-- emails create an incident.
@@ -354,19 +294,24 @@ makeLens "_svcEmailFilters" ''Service
354makeLens "_svcSeverityFilter" ''Service
294makeLens "_svcSeverityFilter" ''Service
356newtype ListServices = ListServices
296newtype ListServices = ListServices
357− { _lsTimeZone' :: Maybe TimeZone
297+ { _lsTimeZone' :: Maybe TZ
358 } deriving (Eq, Show)
298 } deriving (Eq, Show)
360instance Paginate ListServices
300instance Paginate ListServices
362−deriveJSON ''ListServices
302+queryRequest ''ListServices
363−makeLenses ''ListServices
303+
304+-- | Time zone in which dates in the result will be rendered.
306+-- /Default:/ account default time zone.
307+lsTimeZone :: Lens' (Request ListServices s r) (Maybe TimeZone)
308+lsTimeZone = upd.lsTimeZone'.mapping _TZ
365-- | List existing services.
310-- | List existing services.
367-- @GET \/services@
312-- @GET \/services@
369−-- See: <http://developer.pagerduty.com/documentation/rest/services/list>
314+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/list>
370listServices :: Request ListServices s [Service]
315listServices :: Request ListServices s [Service]
371listServices =
316listServices =
372 mk ListServices
317 mk ListServices
@@ -375,15 +320,9 @@ listServices =
375 & query .~ includes
320 & query .~ includes
376 & unwrap .~ key "escalation_policies"
321 & unwrap .~ key "escalation_policies"
378−-- | Time zone in which dates in the result will be rendered.
380−-- Defaults to account default time zone.
381−lsTimeZone :: Lens' (Request ListServices s r) (Maybe TimeZone)
382−lsTimeZone = upd.lsTimeZone'
384data CreateService = CreateService
323data CreateService = CreateService
385 { _csName' :: Text
324 { _csName' :: Text
386− , _csEscalationPolicyId' :: PolicyId
325+ , _csEscalationPolicyId' :: EscalationPolicyId
387 , _csType' :: !ServiceType
326 , _csType' :: !ServiceType
388 , _csVendorId' :: Maybe VendorId
327 , _csVendorId' :: Maybe VendorId
389 , _csDescription' :: Maybe Text
328 , _csDescription' :: Maybe Text
@@ -392,30 +331,7 @@ data CreateService = CreateService
392 , _csSeverityFilter' :: Maybe SeverityFilter
331 , _csSeverityFilter' :: Maybe SeverityFilter
393 } deriving (Eq, Show)
332 } deriving (Eq, Show)
395−deriveJSON ''CreateService
396−makeLenses ''CreateService
334+jsonRequest ''CreateService
398−-- | Creates a new service.
402−-- See: <http://developer.pagerduty.com/documentation/rest/services/create>
403−createService :: Text
406− -> Request CreateService s Service
407−createService n p t =
410− , _csEscalationPolicyId' = p
412− , _csVendorId' = Nothing
413− , _csDescription' = Nothing
414− , _csAcknowledgementTimeout' = Nothing
415− , _csAutoResolveTimeout' = Nothing
416− , _csSeverityFilter' = Nothing
417− } & path .~ services
418− & unwrap .~ key "service"
420-- | The name of the service.
336-- | The name of the service.
421csName :: Lens' (Request CreateService s r) Text
337csName :: Lens' (Request CreateService s r) Text
@@ -435,19 +351,19 @@ csVendorId :: Lens' (Request CreateService s r) (Maybe VendorId)
435csVendorId = upd.csVendorId'
351csVendorId = upd.csVendorId'
437-- | The id of the escalation policy to be used by this service.
353-- | The id of the escalation policy to be used by this service.
438−csEscalationPolicyId :: Lens' (Request CreateService s r) PolicyId
354+csEscalationPolicyId :: Lens' (Request CreateService s r) EscalationPolicyId
439csEscalationPolicyId = upd.csEscalationPolicyId'
355csEscalationPolicyId = upd.csEscalationPolicyId'
441-- | The duration in seconds before an incidents acknowledged in this service
357-- | The duration in seconds before an incidents acknowledged in this service
442-- become triggered again.
358-- become triggered again.
444−-- Defaults to 30 minutes.
360+-- /Default:/ 30 minutes.
445csAcknowledgementTimeout :: Lens' (Request CreateService s r) (Maybe Int)
361csAcknowledgementTimeout :: Lens' (Request CreateService s r) (Maybe Int)
446csAcknowledgementTimeout = upd.csAcknowledgementTimeout'
362csAcknowledgementTimeout = upd.csAcknowledgementTimeout'
448-- | The duration in seconds before a triggered incident auto-resolves itself.
364-- | The duration in seconds before a triggered incident auto-resolves itself.
450−-- Defaults to 4 hours.
366+-- /Default:/ 4 hours.
451csAutoResolveTimeout :: Lens' (Request CreateService s r) (Maybe Int)
367csAutoResolveTimeout :: Lens' (Request CreateService s r) (Maybe Int)
452csAutoResolveTimeout = upd.csAutoResolveTimeout'
368csAutoResolveTimeout = upd.csAutoResolveTimeout'
@@ -455,11 +371,33 @@ csAutoResolveTimeout = upd.csAutoResolveTimeout'
455csSeverityFilter :: Lens' (Request CreateService s r) (Maybe SeverityFilter)
371csSeverityFilter :: Lens' (Request CreateService s r) (Maybe SeverityFilter)
456csSeverityFilter = upd.csSeverityFilter'
372csSeverityFilter = upd.csSeverityFilter'
374+-- | Creates a new service.
378+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/create>
379+createService :: Text
380+ -> EscalationPolicyId
382+ -> Request CreateService s Service
383+createService n p t =
386+ , _csEscalationPolicyId' = p
388+ , _csVendorId' = Nothing
389+ , _csDescription' = Nothing
390+ , _csAcknowledgementTimeout' = Nothing
391+ , _csAutoResolveTimeout' = Nothing
392+ , _csSeverityFilter' = Nothing
393+ } & path .~ services
394+ & unwrap .~ key "service"
458-- | Get details about an existing service.
396-- | Get details about an existing service.
460-- @GET services\/\:id@
398-- @GET services\/\:id@
462−-- See: <http://developer.pagerduty.com/documentation/rest/services/show>
400+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/show>
463getService :: ServiceId -> Request Empty s Service
401getService :: ServiceId -> Request Empty s Service
464getService i = empty
402getService i = empty
465 & path .~ services % i
403 & path .~ services % i
@@ -469,32 +407,13 @@ getService i = empty
469data UpdateService = UpdateService
407data UpdateService = UpdateService
470 { _usName' :: Maybe Text
408 { _usName' :: Maybe Text
471 , _usDescription' :: Maybe Text
409 , _usDescription' :: Maybe Text
472− , _usEscalationPolicyId' :: Maybe PolicyId
410+ , _usEscalationPolicyId' :: Maybe EscalationPolicyId
473 , _usAcknowledgementTimeout' :: Maybe Int
411 , _usAcknowledgementTimeout' :: Maybe Int
474 , _usAutoResolveTimeout' :: Maybe Int
412 , _usAutoResolveTimeout' :: Maybe Int
475 , _usSeverityFilter' :: Maybe SeverityFilter
413 , _usSeverityFilter' :: Maybe SeverityFilter
476 } deriving (Eq, Show)
414 } deriving (Eq, Show)
478−deriveJSON ''UpdateService
479−makeLenses ''UpdateService
416+jsonRequest ''UpdateService
481−-- | Update an existing service.
483−-- @PUT services\/\:id@
485−-- See: <http://developer.pagerduty.com/documentation/rest/services/update>
486−updateService :: ServiceId -> Request UpdateService s Service
489− { _usName' = Nothing
490− , _usEscalationPolicyId' = Nothing
491− , _usDescription' = Nothing
492− , _usAcknowledgementTimeout' = Nothing
493− , _usAutoResolveTimeout' = Nothing
494− , _usSeverityFilter' = Nothing
496− & path .~ services % i
497− & unwrap .~ key "service"
499-- | The name of the service.
418-- | The name of the service.
500usName :: Lens' (Request UpdateService s r) (Maybe Text)
419usName :: Lens' (Request UpdateService s r) (Maybe Text)
@@ -505,19 +424,19 @@ usDescription :: Lens' (Request UpdateService s r) (Maybe Text)
505usDescription = upd.usDescription'
424usDescription = upd.usDescription'
507-- | The id of the escalation policy to be used by this service.
426-- | The id of the escalation policy to be used by this service.
508−usEscalationPolicyId :: Lens' (Request UpdateService s r) (Maybe PolicyId)
427+usEscalationPolicyId :: Lens' (Request UpdateService s r) (Maybe EscalationPolicyId)
509usEscalationPolicyId = upd.usEscalationPolicyId'
428usEscalationPolicyId = upd.usEscalationPolicyId'
511-- | The duration in seconds before an incidents acknowledged in this service
430-- | The duration in seconds before an incidents acknowledged in this service
512-- become triggered again.
431-- become triggered again.
514−-- Defaults to 30 minutes.
433+-- /Default:/ 30 minutes.
515usAcknowledgementTimeout :: Lens' (Request UpdateService s r) (Maybe Int)
434usAcknowledgementTimeout :: Lens' (Request UpdateService s r) (Maybe Int)
516usAcknowledgementTimeout = upd.usAcknowledgementTimeout'
435usAcknowledgementTimeout = upd.usAcknowledgementTimeout'
518-- | The duration in seconds before a triggered incident auto-resolves itself.
437-- | The duration in seconds before a triggered incident auto-resolves itself.
520−-- Defaults to 4 hours.
439+-- /Default:/ 4 hours.
521usAutoResolveTimeout :: Lens' (Request UpdateService s r) (Maybe Int)
440usAutoResolveTimeout :: Lens' (Request UpdateService s r) (Maybe Int)
522usAutoResolveTimeout = upd.usAutoResolveTimeout'
441usAutoResolveTimeout = upd.usAutoResolveTimeout'
@@ -525,13 +444,31 @@ usAutoResolveTimeout = upd.usAutoResolveTimeout'
525usSeverityFilter :: Lens' (Request UpdateService s r) (Maybe SeverityFilter)
444usSeverityFilter :: Lens' (Request UpdateService s r) (Maybe SeverityFilter)
526usSeverityFilter = upd.usSeverityFilter'
445usSeverityFilter = upd.usSeverityFilter'
447+-- | Update an existing service.
449+-- @PUT services\/\:id@
451+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/update>
452+updateService :: ServiceId -> Request UpdateService s Service
455+ { _usName' = Nothing
456+ , _usEscalationPolicyId' = Nothing
457+ , _usDescription' = Nothing
458+ , _usAcknowledgementTimeout' = Nothing
459+ , _usAutoResolveTimeout' = Nothing
460+ , _usSeverityFilter' = Nothing
462+ & path .~ services % i
463+ & unwrap .~ key "service"
528-- | Delete an existing service. Once the service is deleted, it will not be
465-- | Delete an existing service. Once the service is deleted, it will not be
529-- accessible from the web UI and new incidents won't be able to be created
466-- accessible from the web UI and new incidents won't be able to be created
530-- for this service.
467-- for this service.
532-- @DELETE \/services/:id@
469-- @DELETE \/services/:id@
534−-- See: <http://developer.pagerduty.com/documentation/rest/services/delete>
471+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/delete>
535deleteService :: ServiceId -> Request Empty s Empty
472deleteService :: ServiceId -> Request Empty s Empty
536deleteService i = empty & meth .~ DELETE & path .~ services % i
473deleteService i = empty & meth .~ DELETE & path .~ services % i
@@ -539,13 +476,14 @@ deleteService i = empty & meth .~ DELETE & path .~ services % i
540-- @PUT services\/\:id\/enable@
477-- @PUT services\/\:id\/enable@
542−-- See: <http://developer.pagerduty.com/documentation/rest/services/enable>
479+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/enable>
543enableService :: RequesterId -> ServiceId -> Request Empty s Empty
480enableService :: RequesterId -> ServiceId -> Request Empty s Empty
544−enableService r i = auth (enableServiceBasic i) & query .~ [("requester_id", r)]
482+ auth (enableServiceBasic i) & query .~ [("requester_id", r)]
546-- | A version of 'enableService' which uses HTTP Basic authentication and
484-- | A version of 'enableService' which uses HTTP Basic authentication and
547-- doesn't require a 'RequesterId'.
485-- doesn't require a 'RequesterId'.
548−enableServiceBasic :: ServiceId -> Request Empty Basic Empty
486+enableServiceBasic :: ServiceId -> Request Empty 'Basic Empty
549enableServiceBasic i = empty & meth .~ PUT & path .~ services % i % "enable"
487enableServiceBasic i = empty & meth .~ PUT & path .~ services % i % "enable"
551-- | Disable a service. Once a service is disabled, it will not be able to
489-- | Disable a service. Once a service is disabled, it will not be able to
@@ -553,13 +491,14 @@ enableServiceBasic i = empty & meth .~ PUT & path .~ services % i % "enable"
554-- @PUT services\/\:id\/disable@
492-- @PUT services\/\:id\/disable@
556−-- See: <http://developer.pagerduty.com/documentation/rest/services/disable>
494+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/disable>
557disableService :: RequesterId -> ServiceId -> Request Empty s Empty
495disableService :: RequesterId -> ServiceId -> Request Empty s Empty
558−disableService r i = auth (disableServiceBasic i) & query .~ [("requester_id", r)]
497+ auth (disableServiceBasic i) & query .~ [("requester_id", r)]
560-- | A version of 'disableService' which uses HTTP Basic authentication and
499-- | A version of 'disableService' which uses HTTP Basic authentication and
561-- doesn't require a 'RequesterId'.
500-- doesn't require a 'RequesterId'.
562−disableServiceBasic :: ServiceId -> Request Empty Basic Empty
501+disableServiceBasic :: ServiceId -> Request Empty 'Basic Empty
563disableServiceBasic i = empty & meth .~ PUT & path .~ services % i % "disable"
502disableServiceBasic i = empty & meth .~ PUT & path .~ services % i % "disable"
565-- | Regenerate a new service key for an existing service.
504-- | Regenerate a new service key for an existing service.
@@ -569,6 +508,6 @@ disableServiceBasic i = empty & meth .~ PUT & path .~ services % i % "disable"
570-- @POST services\/\:id\/regenerate_key@
509-- @POST services\/\:id\/regenerate_key@
572−-- See: <http://developer.pagerduty.com/documentation/rest/services/regenerate_key>
511+-- /See:/ <http://developer.pagerduty.com/documentation/rest/services/regenerate_key>
573regenerateKey :: ServiceId -> Request Empty s Service
512regenerateKey :: ServiceId -> Request Empty s Service
574regenerateKey i = empty & meth .~ POST & path .~ services % i % "regenerate_key"
513regenerateKey i = empty & meth .~ POST & path .~ services % i % "regenerate_key"