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

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Trans.PagerDuty

Contents

Synopsis

Transformer

type PagerDuty s = PagerDutyT s IO

A convenient alias for PagerDutyT IO.

data PagerDutyT s m a

Instances

Monad m => MonadError Error (PagerDutyT s m) 
MonadBaseControl b m => MonadBaseControl b (PagerDutyT s m) 
MonadBase b m => MonadBase b (PagerDutyT s m) 
MonadTrans (PagerDutyT s) 
MonadTransControl (PagerDutyT s) 
MMonad (PagerDutyT s) 
MFunctor (PagerDutyT s) 
Monad m => MonadReader (Env s) (PagerDutyT s m) 
Monad m => Monad (PagerDutyT s m) 
Functor m => Functor (PagerDutyT s m) 
(Monad m, Functor m) => Applicative (PagerDutyT s m) 
MonadIO m => MonadIO (PagerDutyT s m) 
MonadThrow m => MonadThrow (PagerDutyT s m) 
MonadCatch m => MonadCatch (PagerDutyT s m) 
type StT (PagerDutyT s) a = StT (ExceptT Error) (StT (ReaderT (Env s)) a) 
type StM (PagerDutyT s m) a = ComposeSt (PagerDutyT s) m a 

Running

runPagerDutyT :: PagerDutyT s m a -> Env s -> m (Either Error a)

Integration events

submit :: (MonadIO m, MonadReader (Env s) m, MonadError Error m) => Event -> m Response

submitCatch :: (MonadIO m, MonadReader (Env s) m) => Event -> m (Either Error Response)

REST requests

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

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

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

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

Lifting errors

hoistError :: MonadError Error m => Either Error a -> m a

Configuration

Environment

data Env s

The environment containing the parameters required to make PagerDuty requests.

Instances

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

envDomain :: forall s. Lens' (Env s) SubDomain

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

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

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

Logging

data Logger

The log level and associated logger function.

Constructors

None 
Debug (Text -> IO ()) 

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

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

Types

Requests

class Paginate a

Exists primarily to obtain a constraint for the paginate function.

data Request a s b

Instances

ToJSON (Request a s b) 
(QueryLike a, ToJSON a, HasUserInfo a) => HasUserInfo (Request a s b) 
(QueryLike a, ToJSON a, HasEmailFilterInfo a) => HasEmailFilterInfo (Request a s b) 

Errors

data Error

Instances

Eq Error 
Show Error 
FromJSON Error 
HasMessage Error Text 
Monad m => MonadError Error (PagerDutyT s m) 

_Internal :: Prism' Error Text

Messages

class HasMessage s a | s -> a where

Methods

message :: Lens' s a

A short human-readable message describing the error.

Fields

class HasErrors s a | s -> a where

Methods

errors :: Lens' s a

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

Instances

Integration

status :: Lens' IntegrationError Text

REST

data Code

Instances

Eq Code 
Num Code 
Show Code 
ToJSON Code 
FromJSON Code 

code :: Lens' RESTError Code

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

See: description

description :: Code -> Text

Authentication

data Security

Constructors

Basic 
Token 

Instances

data Auth a where

Instances

Eq (Auth a) 
Show (Auth a) 

Keys

mkKey :: Text -> Key a

Aliases

type ServiceKey = Key "service"

type IncidentKey = Key "incident"

Identifiers

data Id a

Instances

Eq (Id a) 
Show (Id a) 
IsString (Id a) 
ToJSON (Id a) 
FromJSON (Id a) 
ToByteString (Id a) 
QueryValueLike (Id a) 

mkId :: Text -> Id a

Aliases

type AlertId = Id "alert"

type ContactId = Id "contact"

type EmailFilterId = Id "email-filter"

type EscalationPolicyId = Id "escalation-policy"

type EscalationRuleId = Id "escalation-rule"

type IncidentId = Id "incident"

type LogEntryId = Id "log-entry"

type NoteId = Id "note"

type NotificationRuleId = Id "notification-rule"

type OverrideId = Id "schedule-override"

type RequesterId = Id "requester"

type ScheduleId = Id "schedule"

type ServiceId = Id "service"

type UserId = Id "user"

type VendorId = Id "vendor"

type WebhookId = Id "webhook"

type WindowId = Id "maintenance-window"

SubDomain

Address

data Address

Instances

Eq Address 
Show Address 
IsString Address 
ToJSON Address 
FromJSON Address 
ToByteString Address 

mkAddress :: Text -> Address

Miscellaneous

data Empty

Constructors

Empty 

Instances

ToJSON Empty 
FromJSON Empty 
QueryLike Empty