packages feed

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

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

import Data.Bugsnag.Types.Prelude

-- | A category which describes the breadcrumb, from the list of allowed
-- values.
--
-- -   @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.
data BreadcrumbType
  = Navigation
  | Request
  | Process
  | Log
  | User
  | State
  | Error
  | Manual
  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 = Navigation