packages feed

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

module Data.Bugsnag.Types.Notifier
  ( Notifier (..)
  , exampleNotifier
  ) where

import Data.Bugsnag.Types.Prelude


import Data.Bugsnag.Types.DependentNotifier

data Notifier = Notifier
  { name :: Text
  -- ^ The notifier name.
  , version :: Text
  -- ^ The notifier's current version.
  , url :: Text
  -- ^ The URL associated with the notifier.
  , dependencies :: Maybe [DependentNotifier]
  -- ^ For platforms where multiple notifiers are used to capture an event, an optional
  -- array containing the details of the additional notifiers can be specified.
  }
  deriving stock (Eq, Show, Generic)

instance FromJSON Notifier where
  parseJSON = genericParseJSON aesonOptions

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

exampleNotifier :: Notifier
exampleNotifier = Notifier
  { name = "Bugsnag Ruby"
  , version = "1.0.11"
  , url = "https://github.com/bugsnag/bugsnag-ruby"
  , dependencies = Just [exampleDependentNotifier]
  }