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

Safe HaskellNone
LanguageHaskell2010

Network.PagerDuty.REST.Users.ContactMethods

Contents

Description

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

Synopsis

List Contacts

listContacts :: UserId -> Request Empty s [Contact] Source #

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

createContact :: UserId -> ContactType -> Address -> Request CreateContact s Contact Source #

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 Source #

The type of the contact method.

ccAddress :: Lens' (Request CreateContact s b) Address Source #

The id of the contact method. For SMS and Phone it is the number, and for Email it is the email address.

ccCountryCode :: Lens' (Request CreateContact s b) (Maybe Int) Source #

The number code for your country. Not used for Email.

Default: 1

ccLabel :: Lens' (Request CreateContact s b) (Maybe Text) Source #

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) Source #

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 Source #

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

updateContact :: UserId -> ContactId -> Request UpdateContact s Contact Source #

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) Source #

The id of the contact method. For SMS and Phone it is the number, and for Email it is the email address.

ucCountryCode :: Lens' (Request UpdateContact s b) (Maybe Int) Source #

The number code for your country. Not used for Email.

Default: 1

ucLabel :: Lens' (Request UpdateContact s b) (Maybe Text) Source #

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) Source #

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 Source #

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