packages feed

bugsnag-types-1.1.0.0: src/Data/Bugsnag/Types/Severity.hs

module Data.Bugsnag.Types.Severity
  ( Severity (..)
  , exampleSeverity
  ) where

import Data.Bugsnag.Types.Prelude


data Severity
  = Error
  -- ^ The default for unhandled errors.
  | Warning
  -- ^ The default when Bugsnag.notify is called.
  | Info
  -- ^ Can be used in manual Bugsnag.notify calls.
  deriving stock (Bounded, Enum, Eq, Show, Generic)

instance FromJSON Severity where
  parseJSON = genericParseJSON aesonOptions

instance ToJSON Severity where
  toJSON = genericToJSON aesonOptions
  toEncoding = genericToEncoding aesonOptions

exampleSeverity :: Severity
exampleSeverity = toEnum 0