module Patrol.Type.BreadcrumbType where

import qualified Data.Aeson as Aeson

data BreadcrumbType
  = Default
  | Http
  | Navigation
  deriving (BreadcrumbType -> BreadcrumbType -> Bool
(BreadcrumbType -> BreadcrumbType -> Bool)
-> (BreadcrumbType -> BreadcrumbType -> Bool) -> Eq BreadcrumbType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BreadcrumbType -> BreadcrumbType -> Bool
== :: BreadcrumbType -> BreadcrumbType -> Bool
$c/= :: BreadcrumbType -> BreadcrumbType -> Bool
/= :: BreadcrumbType -> BreadcrumbType -> Bool
Eq, Int -> BreadcrumbType -> ShowS
[BreadcrumbType] -> ShowS
BreadcrumbType -> String
(Int -> BreadcrumbType -> ShowS)
-> (BreadcrumbType -> String)
-> ([BreadcrumbType] -> ShowS)
-> Show BreadcrumbType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BreadcrumbType -> ShowS
showsPrec :: Int -> BreadcrumbType -> ShowS
$cshow :: BreadcrumbType -> String
show :: BreadcrumbType -> String
$cshowList :: [BreadcrumbType] -> ShowS
showList :: [BreadcrumbType] -> ShowS
Show)

instance Aeson.ToJSON BreadcrumbType where
  toJSON :: BreadcrumbType -> Value
toJSON BreadcrumbType
breadcrumbType = String -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON (String -> Value) -> String -> Value
forall a b. (a -> b) -> a -> b
$ case BreadcrumbType
breadcrumbType of
    BreadcrumbType
Default -> String
"default"
    BreadcrumbType
Http -> String
"http"
    BreadcrumbType
Navigation -> String
"navigation"