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

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

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

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