pagerduty-0.0.1.1: 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]

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

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

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)

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

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)

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)

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

Constructors

SMS 
Phone 
Email 

Instances

class HasContact c where

Minimal complete definition

contact

Methods

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

Instances