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

Safe HaskellNone
LanguageHaskell2010

Network.PagerDuty.REST

Contents

Synopsis

Sending requests

send :: (MonadIO m, FromJSON b) => SubDomain -> Auth s -> Manager -> Request a s b -> m (Either Error b) #

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

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

Configuration

Environment

data Env (s :: Security) #

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 #

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.

Errors

data Error #

Instances

Messages

class HasMessage s a | s -> a where #

Minimal complete definition

message

Methods

message :: Lens' s a #

A short human-readable message describing the error.

Fields

class HasErrors s a | s -> a where #

Minimal complete definition

errors

Methods

errors :: Lens' s a #

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

Integration

REST

data Code #

Instances

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

Authentication

data Security #

Constructors

Basic 
Token 

data Auth (a :: Security) where #

Instances

Eq (Auth a) # 

Methods

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

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

Show (Auth a) # 

Methods

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

show :: Auth a -> String #

showList :: [Auth a] -> ShowS #

Keys

mkKey :: Text -> Key a #

Aliases

type ServiceKey = Key "service" #

type IncidentKey = Key "incident" #

Identifiers

data Id (a :: Symbol) #

Instances

Eq (Id a) # 

Methods

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

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

Show (Id a) # 

Methods

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

show :: Id a -> String #

showList :: [Id a] -> ShowS #

IsString (Id a) # 

Methods

fromString :: String -> Id a #

ToJSON (Id a) # 

Methods

toJSON :: Id a -> Value #

toEncoding :: Id a -> Encoding #

toJSONList :: [Id a] -> Value #

toEncodingList :: [Id a] -> Encoding #

FromJSON (Id a) # 

Methods

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

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

ToByteString (Id a) # 

Methods

builder :: Id a -> Builder #

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

Miscellaneous