@@ -78,8 +78,8 @@ import Network.PagerDuty.EscalationPolicies.Types
7878import Network.PagerDuty.TH
7979import Network.PagerDuty.Types
8080
81−policies :: Setter (Request a s r) (Request a s r) Path [Path]
82−policies = base "policies"
81+policies :: Path
82+policies = "policies"
8383
8484newtype ListPolicies = ListPolicies
8585 { _lpQuery' :: Maybe Text
@@ -95,12 +95,12 @@ makeLenses ''ListPolicies
9595-- @GET \/escalation_policies@
9696--
9797-- See: <http://developer.pagerduty.com/documentation/rest/escalation_policies/list>
98−listPolicies :: Request ListPolicies Token [Policy]
98+listPolicies :: Request ListPolicies s [Policy]
9999listPolicies =
100100 mk ListPolicies
101101 { _lpQuery' = Nothing
102− } & policies .~ []
103− & unwrap .~ key "escalation_policies"
102+ } & path .~ policies
103+ & unwrap .~ key "escalation_policies"
104104
105105-- | Filters the result, showing only the escalation policies
106106-- whose names match the query.
@@ -125,16 +125,16 @@ makeLenses ''CreatePolicy
125125createPolicy :: PolicyId
126126 -> Text -- ^ 'creName'
127127 -> [Rule] -- ^ 'creEscalationRules'
128− -> Request CreatePolicy Token Policy
128+ -> Request CreatePolicy s Policy
129129createPolicy i n rs =
130130 mk CreatePolicy
131131 { _cpName' = n
132132 , _cpRepeatEnabled' = Nothing
133133 , _cpNumLoops' = Nothing
134134 , _cpEscalationRules' = rs
135− } & policies .~ [P i]
136− & meth .~ PUT
137− & unwrap .~ key "escalation_policy"
135+ } & meth .~ PUT
136+ & path .~ policies % i
137+ & unwrap .~ key "escalation_policy"
138138
139139-- | The name of the escalation policy.
140140cpName :: Lens' (Request CreatePolicy s r) Text
@@ -160,8 +160,8 @@ cpEscalationRules = upd.cpEscalationRules'
160160-- @GET \/escalation_policies\/\:id@
161161--
162162-- See: <http://developer.pagerduty.com/documentation/rest/escalation_policies/show>
163−getPolicy :: PolicyId -> Request Empty Token Policy
164−getPolicy i = mk Empty & policies .~ [P i] & unwrap .~ key "escalation_policy"
163+getPolicy :: PolicyId -> Request Empty s Policy
164+getPolicy i = empty & path .~ policies % i & unwrap .~ key "escalation_policy"
165165
166166data UpdatePolicy = UpdatePolicy
167167 { _upName' :: Maybe Text
@@ -178,16 +178,16 @@ makeLenses ''UpdatePolicy
178178-- @PUT \/escalation_policies\/\:id@
179179--
180180-- See: <http://developer.pagerduty.com/documentation/rest/escalation_policies/update>
181−updatePolicy :: PolicyId -> Request UpdatePolicy Token Policy
181+updatePolicy :: PolicyId -> Request UpdatePolicy s Policy
182182updatePolicy i =
183183 mk UpdatePolicy
184184 { _upName' = Nothing
185185 , _upRepeatEnabled' = Nothing
186186 , _upNumLoops' = Nothing
187187 , _upEscalationRules' = []
188− } & policies .~ [P i]
189− & meth .~ PUT
190− & unwrap .~ key "escalation_policy"
188+ } & meth .~ PUT
189+ & path .~ policies % i
190+ & unwrap .~ key "escalation_policy"
191191
192192-- | The name of the escalation policy.
193193upName :: Lens' (Request UpdatePolicy s r) (Maybe Text)
@@ -212,5 +212,5 @@ upEscalationRules = upd.upEscalationRules'
212212-- @DELETE \/escalation_policies\/\:id@
213213--
214214-- See: <http://developer.pagerduty.com/documentation/rest/escalation_policies/delete>
215−deletePolicy :: PolicyId -> Request Empty Token Empty
216−deletePolicy i = mk Empty & policies .~ [P i] & meth .~ DELETE
215+deletePolicy :: PolicyId -> Request Empty s Empty
216+deletePolicy i = empty & meth .~ DELETE & path .~ policies % i