Safe Haskell | None |
---|---|
Language | Haskell2010 |
Contact methods describe the various channels (phone numbers, SMS numbers and email addresses) used to contact a user when an incident is assigned to the user.
Access and manipulate the contact methods for a user.
See: http://developer.pagerduty.com/documentation/rest/users/contact_methods
- listContacts :: UserId -> Request Empty s [Contact]
- data CreateContact
- createContact :: UserId -> ContactType -> Address -> Request CreateContact s Contact
- ccType :: Lens' (Request CreateContact s b) ContactType
- ccAddress :: Lens' (Request CreateContact s b) Address
- ccCountryCode :: Lens' (Request CreateContact s b) (Maybe Int)
- ccLabel :: Lens' (Request CreateContact s b) (Maybe Text)
- ccSendShortEmail :: Lens' (Request CreateContact s b) (Maybe Bool)
- getContact :: UserId -> ContactId -> Request Empty s Contact
- data UpdateContact
- updateContact :: UserId -> ContactId -> Request UpdateContact s Contact
- ucAddress :: Lens' (Request UpdateContact s b) (Maybe Address)
- ucCountryCode :: Lens' (Request UpdateContact s b) (Maybe Int)
- ucLabel :: Lens' (Request UpdateContact s b) (Maybe Text)
- ucSendShortEmail :: Lens' (Request UpdateContact s b) (Maybe Bool)
- deleteContact :: UserId -> ContactId -> Request Empty s Empty
- data ContactType
- class HasContact c where
- contact :: Lens' c Contact
- cAddress :: Lens' c Address
- cBlacklisted :: Lens' c (Maybe Bool')
- cCountryCode :: Lens' c (Maybe Int)
- cId :: Lens' c ContactId
- cLabel :: Lens' c Text
- cSendShortEmail :: Lens' c (Maybe Bool')
- cType :: Lens' c ContactType
- cUserId :: Lens' c UserId
- data Contact
List Contacts
listContacts :: UserId -> Request Empty s [Contact]
List existing contact methods for the specified user.
GET /users/:user_id/contact_methods
See: http://developer.pagerduty.com/documentation/rest/users/contact_methods/list
Create Contact
data CreateContact
Eq CreateContact | |
Show CreateContact | |
ToJSON CreateContact | |
FromJSON CreateContact | |
QueryLike CreateContact |
createContact :: UserId -> ContactType -> Address -> Request CreateContact s Contact
Create a new contact method for a given user. A contact method can be one of the following types: SMS, email, and phone. push_notification contact methods cannot be created using this API, they are added automatically during device registration.
POST /users/:user_id/contact_methods
Note: The contact info must be unique.
See: http://developer.pagerduty.com/documentation/rest/users/contact_methods/create
ccType :: Lens' (Request CreateContact s b) ContactType
The type of the contact method.
ccAddress :: Lens' (Request CreateContact s b) Address
ccCountryCode :: Lens' (Request CreateContact s b) (Maybe Int)
The number code for your country. Not used for Email
.
Default: 1
ccLabel :: Lens' (Request CreateContact s b) (Maybe Text)
A human friendly label for the contact method.
Example: "Home Phone", "Work Email", etc.
Default: The type of the contact method and the address (with country code for phone numbers).
ccSendShortEmail :: Lens' (Request CreateContact s b) (Maybe Bool)
Send an abbreviated email message instead of the standard email
output. Useful for email-to-SMS gateways and email based pagers. Only valid for
Email
contact methods.
Default: false.
Get Contact
getContact :: UserId -> ContactId -> Request Empty s Contact
Get details for a contact method.
GET /users/:user_id/contact_methods/:id
See: http://developer.pagerduty.com/documentation/rest/users/contact_methods/show
Update Contact
data UpdateContact
Eq UpdateContact | |
Show UpdateContact | |
ToJSON UpdateContact | |
FromJSON UpdateContact | |
QueryLike UpdateContact |
updateContact :: UserId -> ContactId -> Request UpdateContact s Contact
Update an existing contact method of a given user. Note that you cannot change the type of an existing method.
PUT /users/:user_id/contact_methods/:id
See: http://developer.pagerduty.com/documentation/rest/users/contact_methods/update
ucAddress :: Lens' (Request UpdateContact s b) (Maybe Address)
ucCountryCode :: Lens' (Request UpdateContact s b) (Maybe Int)
The number code for your country. Not used for Email
.
Default: 1
ucLabel :: Lens' (Request UpdateContact s b) (Maybe Text)
A human friendly label for the contact method.
Example: "Home Phone", "Work Email", etc.
Default: The type of the contact method and the address (with country code for phone numbers).
ucSendShortEmail :: Lens' (Request UpdateContact s b) (Maybe Bool)
Send an abbreviated email message instead of the standard email
output. Useful for email-to-SMS gateways and email based pagers. Only valid for
Email
contact methods.
Default: false.
Delete Contact
deleteContact :: UserId -> ContactId -> Request Empty s Empty
Remove a contact method and any corresponding notification rules.
DELETE /users/:user_id/contact_methods/:id
See: http://developer.pagerduty.com/documentation/rest/users/contact_methods/delete
Types
data ContactType
Eq ContactType | |
Show ContactType | |
ToJSON ContactType | |
FromJSON ContactType |
class HasContact c where
cBlacklisted :: Lens' c (Maybe Bool')
cCountryCode :: Lens' c (Maybe Int)
cLabel :: Lens' c Text
cSendShortEmail :: Lens' c (Maybe Bool')
cType :: Lens' c ContactType