pagerduty-0.0.8: 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.

data PagerDutyT s m a Source #

Instances

Monad m => MonadError Error (PagerDutyT s m) Source # 

Methods

throwError :: Error -> PagerDutyT s m a #

catchError :: PagerDutyT s m a -> (Error -> PagerDutyT s m a) -> PagerDutyT s m a #

MonadBase b m => MonadBase b (PagerDutyT s m) Source # 

Methods

liftBase :: b α -> PagerDutyT s m α #

MonadBaseControl b m => MonadBaseControl b (PagerDutyT s m) Source # 

Associated Types

type StM (PagerDutyT s m :: * -> *) a :: * #

Methods

liftBaseWith :: (RunInBase (PagerDutyT s m) b -> b a) -> PagerDutyT s m a #

restoreM :: StM (PagerDutyT s m) a -> PagerDutyT s m a #

MFunctor (PagerDutyT s) Source # 

Methods

hoist :: Monad m => (forall a. m a -> n a) -> PagerDutyT s m b -> PagerDutyT s n b #

MMonad (PagerDutyT s) Source # 

Methods

embed :: Monad n => (forall a. m a -> PagerDutyT s n a) -> PagerDutyT s m b -> PagerDutyT s n b #

MonadTrans (PagerDutyT s) Source # 

Methods

lift :: Monad m => m a -> PagerDutyT s m a #

MonadTransControl (PagerDutyT s) Source # 

Associated Types

type StT (PagerDutyT s :: (* -> *) -> * -> *) a :: * #

Methods

liftWith :: Monad m => (Run (PagerDutyT s) -> m a) -> PagerDutyT s m a #

restoreT :: Monad m => m (StT (PagerDutyT s) a) -> PagerDutyT s m a #

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

Methods

ask :: PagerDutyT s m (Env s) #

local :: (Env s -> Env s) -> PagerDutyT s m a -> PagerDutyT s m a #

reader :: (Env s -> a) -> PagerDutyT s m a #

Monad m => Monad (PagerDutyT s m) Source # 

Methods

(>>=) :: PagerDutyT s m a -> (a -> PagerDutyT s m b) -> PagerDutyT s m b #

(>>) :: PagerDutyT s m a -> PagerDutyT s m b -> PagerDutyT s m b #

return :: a -> PagerDutyT s m a #

fail :: String -> PagerDutyT s m a #

Functor m => Functor (PagerDutyT s m) Source # 

Methods

fmap :: (a -> b) -> PagerDutyT s m a -> PagerDutyT s m b #

(<$) :: a -> PagerDutyT s m b -> PagerDutyT s m a #

Monad m => Applicative (PagerDutyT s m) Source # 

Methods

pure :: a -> PagerDutyT s m a #

(<*>) :: PagerDutyT s m (a -> b) -> PagerDutyT s m a -> PagerDutyT s m b #

(*>) :: PagerDutyT s m a -> PagerDutyT s m b -> PagerDutyT s m b #

(<*) :: PagerDutyT s m a -> PagerDutyT s m b -> PagerDutyT s m a #

MonadIO m => MonadIO (PagerDutyT s m) Source # 

Methods

liftIO :: IO a -> PagerDutyT s m a #

MonadThrow m => MonadThrow (PagerDutyT s m) Source # 

Methods

throwM :: Exception e => e -> PagerDutyT s m a #

MonadCatch m => MonadCatch (PagerDutyT s m) Source # 

Methods

catch :: Exception e => PagerDutyT s m a -> (e -> PagerDutyT s m a) -> PagerDutyT s m a #

type StT (PagerDutyT s) a Source # 
type StT (PagerDutyT s) a = StT (ExceptT Error) (StT (ReaderT * (Env s)) a)
type StM (PagerDutyT s m) a Source # 
type StM (PagerDutyT s m) a = ComposeSt (PagerDutyT s) m a

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

Methods

ask :: PagerDutyT s m (Env s) #

local :: (Env s -> Env s) -> PagerDutyT s m a -> PagerDutyT s m a #

reader :: (Env s -> a) -> PagerDutyT s m a #

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

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

class Paginate a Source #

Exists primarily to obtain a constraint for the paginate function.

Errors

Messages

class HasMessage s a | s -> a where Source #

Minimal complete definition

message

Methods

message :: Lens' s a Source #

A short human-readable message describing the error.

Fields

class HasErrors s a | s -> a where Source #

Minimal complete definition

errors

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 Auth a where Source #

Instances

Eq (Auth a) Source # 

Methods

(==) :: Auth a -> Auth a -> Bool #

(/=) :: Auth a -> Auth a -> Bool #

Show (Auth a) Source # 

Methods

showsPrec :: Int -> Auth a -> ShowS #

show :: Auth a -> String #

showList :: [Auth a] -> ShowS #

Keys

Aliases

type ServiceKey = Key "service" Source #

type IncidentKey = Key "incident" Source #

Identifiers

data Id a Source #

Instances

Eq (Id a) Source # 

Methods

(==) :: Id a -> Id a -> Bool #

(/=) :: Id a -> Id a -> Bool #

Show (Id a) Source # 

Methods

showsPrec :: Int -> Id a -> ShowS #

show :: Id a -> String #

showList :: [Id a] -> ShowS #

IsString (Id a) Source # 

Methods

fromString :: String -> Id a #

ToJSON (Id a) Source # 

Methods

toJSON :: Id a -> Value #

toEncoding :: Id a -> Encoding #

toJSONList :: [Id a] -> Value #

toEncodingList :: [Id a] -> Encoding #

FromJSON (Id a) Source # 

Methods

parseJSON :: Value -> Parser (Id a) #

parseJSONList :: Value -> Parser [Id a] #

ToByteString (Id a) Source # 

Methods

builder :: Id a -> Builder #

QueryValueLike (Id a) Source # 

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