Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type PagerDuty s = PagerDutyT s IO
- data PagerDutyT s m a
- runPagerDutyT :: PagerDutyT s m a -> Env s -> m (Either Error a)
- 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)
- 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)
- hoistError :: MonadError Error m => Either Error a -> m a
- data Env s
- 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
- data Logger
- debug :: MonadIO m => Logger -> Text -> m ()
- class Paginate a
- data Request a s b
- data Error
- _Internal :: Prism' Error Text
- _Integration :: Prism' Error IntegrationError
- _REST :: Prism' Error RESTError
- class HasMessage s a | s -> a where
- class HasErrors s a | s -> a where
- data IntegrationError
- status :: Lens' IntegrationError Text
- data RESTError
- data Code
- code :: Lens' RESTError Code
- description :: Code -> Text
- data Security
- data Auth a where
- AuthBasic :: ByteString -> ByteString -> Auth Basic
- AuthToken :: ByteString -> Auth Token
- data Key a
- mkKey :: Text -> Key a
- type ServiceKey = Key "service"
- type IncidentKey = Key "incident"
- data Id a
- mkId :: Text -> Id a
- 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"
- data SubDomain
- mkSubDomain :: ByteString -> SubDomain
- data Address
- mkAddress :: Text -> Address
- data Empty = Empty
Transformer
type PagerDuty s = PagerDutyT s IO Source #
A convenient alias for PagerDutyT
IO
.
data PagerDutyT s m a Source #
Monad m => MonadError Error (PagerDutyT s m) Source # | |
MonadBase b m => MonadBase b (PagerDutyT s m) Source # | |
MonadBaseControl b m => MonadBaseControl b (PagerDutyT s m) Source # | |
MFunctor (PagerDutyT s) Source # | |
MMonad (PagerDutyT s) Source # | |
MonadTrans (PagerDutyT s) Source # | |
MonadTransControl (PagerDutyT s) Source # | |
Monad m => MonadReader (Env s) (PagerDutyT s m) Source # | |
Monad m => Monad (PagerDutyT s m) Source # | |
Functor m => Functor (PagerDutyT s m) Source # | |
Monad m => Applicative (PagerDutyT s m) Source # | |
MonadIO m => MonadIO (PagerDutyT s m) Source # | |
MonadThrow m => MonadThrow (PagerDutyT s m) Source # | |
MonadCatch m => MonadCatch (PagerDutyT s m) Source # | |
type StT (PagerDutyT s) a Source # | |
type StM (PagerDutyT s m) a Source # | |
Running
runPagerDutyT :: PagerDutyT s m a -> Env s -> m (Either Error a) Source #
Integration events
submit :: (MonadIO m, MonadReader (Env s) m, MonadError Error m) => Event -> m Response Source #
submitCatch :: (MonadIO m, MonadReader (Env s) m) => Event -> m (Either Error Response) Source #
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 #
paginate :: (MonadIO m, MonadReader (Env s) m, MonadError Error m, Paginate a, FromJSON b) => Request a s b -> Source m b Source #
paginateCatch :: (MonadIO m, MonadReader (Env s) m, Paginate a, FromJSON b) => Request a s b -> Source m (Either Error b) Source #
Lifting errors
hoistError :: MonadError Error m => Either Error a -> m a Source #
Configuration
Environment
The environment containing the parameters required to make PagerDuty requests.
Monad m => MonadReader (Env s) (PagerDutyT s m) # | |
Logging
debug :: MonadIO m => Logger -> Text -> m () Source #
Log a message using the debug logger, or if none is specified noop.
Types
Requests
Exists primarily to obtain a constraint for the paginate
function.
ToJSON (Request a s b) Source # | |
(QueryLike a, ToJSON a, HasEmailFilterInfo a) => HasEmailFilterInfo (Request a s b) Source # | |
(QueryLike a, ToJSON a, HasUserInfo a) => HasUserInfo (Request a s b) Source # | |
Errors
Messages
class HasMessage s a | s -> a where Source #
Fields
class HasErrors s a | s -> a where Source #
A list of human-readable reasons for the error. These values, and even their format, are subject to change.
Integration
data IntegrationError Source #
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
description :: Code -> Text Source #
Authentication
AuthBasic :: ByteString -> ByteString -> Auth Basic | |
AuthToken :: ByteString -> Auth Token |
Keys
Aliases
type ServiceKey = Key "service" Source #
type IncidentKey = Key "incident" Source #
Identifiers
Aliases
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 NotificationRuleId = Id "notification-rule" Source #
type OverrideId = Id "schedule-override" Source #
type RequesterId = Id "requester" Source #
type ScheduleId = Id "schedule" Source #
SubDomain
mkSubDomain :: ByteString -> SubDomain Source #