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

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Trans.PagerDuty

Contents

Synopsis

Transformer

type PagerDuty s = PagerDutyT s IO Source

A convenient alias for PagerDutyT IO.

Running

Integration events

REST requests

send :: (MonadIO m, MonadReader (Env s) m, MonadError Error m, FromJSON b) => Request a s b -> m b Source

sendCatch :: (MonadIO m, MonadReader (Env s) m, FromJSON b) => Request a s b -> m (Either Error b) Source

Lifting errors

Configuration

Environment

data Env s Source

The environment containing the parameters required to make PagerDuty requests.

Instances

Monad m => MonadReader (Env s) (PagerDutyT s m) 

envAuth :: forall s s'. Lens (Env s) (Env s') (Auth s) (Auth s') Source

envManager :: forall s. Lens' (Env s) Manager Source

envLogger :: forall s. Lens' (Env s) Logger Source

Logging

data Logger Source

The log level and associated logger function.

Constructors

None 
Debug (Text -> IO ()) 

debug :: MonadIO m => Logger -> Text -> m () Source

Log a message using the debug logger, or if none is specified noop.

Types

Requests

Errors

Messages

class HasMessage s a | s -> a where Source

Methods

message :: Lens' s a Source

A short human-readable message describing the error.

Fields

class HasErrors s a | s -> a where Source

Methods

errors :: Lens' s a Source

A list of human-readable reasons for the error. These values, and even their format, are subject to change.

Integration

REST

code :: Lens' RESTError Code Source

In the case of an error, the PagerDuty error code can give further details on the nature of the error.

See: description

Authentication

data Security Source

Constructors

Basic 
Token 

data Auth a where Source

Instances

Keys

Aliases

type ServiceKey = Key "service" Source

type IncidentKey = Key "incident" Source

Identifiers

mkId :: Text -> Id a Source

Aliases

type AlertId = Id "alert" Source

type ContactId = Id "contact" Source

type EmailFilterId = Id "email-filter" Source

type EscalationPolicyId = Id "escalation-policy" Source

type EscalationRuleId = Id "escalation-rule" Source

type IncidentId = Id "incident" Source

type LogEntryId = Id "log-entry" Source

type NoteId = Id "note" Source

type NotificationRuleId = Id "notification-rule" Source

type OverrideId = Id "schedule-override" Source

type RequesterId = Id "requester" Source

type ScheduleId = Id "schedule" Source

type ServiceId = Id "service" Source

type UserId = Id "user" Source

type VendorId = Id "vendor" Source

type WebhookId = Id "webhook" Source

type WindowId = Id "maintenance-window" Source

SubDomain

Address

Miscellaneous