pagerduty-0.0.1.1: Client library for PagerDuty Integration and REST APIs.

Safe HaskellNone
LanguageHaskell2010

Network.PagerDuty.REST.Users.NotificationRules

Contents

Description

When a user is assigned an incident, the user's notification rules are used to determine which contact method will be used to alert the user and how long after the incident to do so.

Access and manipulate the notification rules for a user.

See: http://developer.pagerduty.com/documentation/rest/users/notification_rules

Synopsis

List Rules

listRules :: UserId -> Request Empty s Rule

List existing notification rules for the specified user.

GET /users/:user_id/notification_rules

See: http://developer.pagerduty.com/documentation/rest/users/notification_rules/list

Create Rule

data CreateRule

Instances

Eq CreateRule 
Show CreateRule 
ToJSON CreateRule 
FromJSON CreateRule 
QueryLike CreateRule 

createRule :: UserId -> ContactId -> Int -> Request CreateRule s Rule

Create a new notification rule for the specified user.

POST /users/:user_id/notification_rules

See: http://developer.pagerduty.com/documentation/rest/users/notification_rules/create

crStartDelayInMinutes :: Lens' (Request CreateRule s b) Int

Number of minutes it will take for the notification rule to be activated (from the time the incident is assigned to the owning user) and an alert be fired.

crContactMethodId :: Lens' (Request CreateRule s b) ContactId

The id of the contact method.

Get Rule

getRule :: UserId -> NotificationRuleId -> Request Empty s Rule

Get details for a notification rule.

GET /users/:user_id/notification_rules/:id

See: http://developer.pagerduty.com/documentation/rest/users/notification_rules/show

Update Rule

data UpdateRule

Instances

Eq UpdateRule 
Show UpdateRule 
ToJSON UpdateRule 
FromJSON UpdateRule 
QueryLike UpdateRule 

updateRule :: UserId -> NotificationRuleId -> Request UpdateRule s Rule

Update an existing notification rule.

PUT /users/:user_id/notification_rules/:id

See: http://developer.pagerduty.com/documentation/rest/users/notification_rules/update

urStartDelayInMinutes :: Lens' (Request UpdateRule s b) (Maybe Int)

Number of minutes it will take for the notification rule to be activated (from the time the incident is assigned to the owning user) and an alert be fired.

urContactMethodId :: Lens' (Request UpdateRule s b) (Maybe ContactId)

The id of the contact method.

Delete Rule

deleteRule :: UserId -> NotificationRuleId -> Request Empty s Empty

Remove a notification rule.

DELETE /users/:user_id/notification_rules/:id

See: http://developer.pagerduty.com/documentation/rest/users/notification_rules/delete

Types

data Rule

Instances

Eq Rule 
Show Rule 
ToJSON Rule 
FromJSON Rule 
HasContact Rule