packages feed

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

module Data.Bugsnag.Types.BreadcrumbType
  ( BreadcrumbType (..)
  , exampleBreadcrumbType
  ) where

import Data.Bugsnag.Types.Prelude


data BreadcrumbType
  = Navigation
  -- ^ Changing screens or content being displayed, with a defined destination and optionally a previous location.
  | Request
  -- ^ Sending and receiving requests and responses.
  | Process
  -- ^ Performing an intensive task or query.
  | Log
  -- ^ Messages and severity sent to a logging platform.
  | User
  -- ^ Actions performed by the user, like text input, button presses, or confirming/cancelling an alert dialog.
  | State
  -- ^ Changing the overall state of an app, such as closing, pausing, or being moved to the background, as well as device state changes like memory or battery warnings and network connectivity changes.
  | Error
  -- ^ An error which was reported to Bugsnag encountered in the same session.
  | Manual
  -- ^ User-defined, manually added breadcrumbs.
  deriving stock (Bounded, Enum, Eq, Show, Generic)

instance FromJSON BreadcrumbType where
  parseJSON = genericParseJSON aesonOptions

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

exampleBreadcrumbType :: BreadcrumbType
exampleBreadcrumbType = toEnum 0