packages feed

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

module Data.Bugsnag.Types.SeverityReason
  ( SeverityReason (..)
  , exampleSeverityReason
  ) where

import Data.Bugsnag.Types.Prelude


import Data.Bugsnag.Types.SeverityReasonType
import Data.Bugsnag.Types.SeverityReasonAttributes

data SeverityReason = SeverityReason
  { type_ :: Maybe SeverityReasonType
  -- ^ A type key that represents the reason for the assigned severity.
  , attributes :: Maybe SeverityReasonAttributes
  -- ^ Optional attributes to provide extra information about the severity reason.
  , unhandledOverridden :: Maybe Bool
  -- ^ Whether the event's `unhandled` flag was overridden from the notifier's default value.
  }
  deriving stock (Eq, Show, Generic)

instance FromJSON SeverityReason where
  parseJSON = genericParseJSON aesonOptions

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

exampleSeverityReason :: SeverityReason
exampleSeverityReason = SeverityReason
  { type_ = Just exampleSeverityReasonType
  , attributes = Just exampleSeverityReasonAttributes
  , unhandledOverridden = Just False
  }