module Patrol.Type.TransactionSource where
import qualified Data.Aeson as Aeson
data TransactionSource
= Component
| Custom
| Route
| Task
| Url
| Unknown
| View
deriving (TransactionSource -> TransactionSource -> Bool
(TransactionSource -> TransactionSource -> Bool)
-> (TransactionSource -> TransactionSource -> Bool)
-> Eq TransactionSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TransactionSource -> TransactionSource -> Bool
== :: TransactionSource -> TransactionSource -> Bool
$c/= :: TransactionSource -> TransactionSource -> Bool
/= :: TransactionSource -> TransactionSource -> Bool
Eq, Int -> TransactionSource -> ShowS
[TransactionSource] -> ShowS
TransactionSource -> String
(Int -> TransactionSource -> ShowS)
-> (TransactionSource -> String)
-> ([TransactionSource] -> ShowS)
-> Show TransactionSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TransactionSource -> ShowS
showsPrec :: Int -> TransactionSource -> ShowS
$cshow :: TransactionSource -> String
show :: TransactionSource -> String
$cshowList :: [TransactionSource] -> ShowS
showList :: [TransactionSource] -> ShowS
Show)
instance Aeson.ToJSON TransactionSource where
toJSON :: TransactionSource -> Value
toJSON TransactionSource
transactionSource = String -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON (String -> Value) -> String -> Value
forall a b. (a -> b) -> a -> b
$ case TransactionSource
transactionSource of
TransactionSource
Component -> String
"component"
TransactionSource
Custom -> String
"custom"
TransactionSource
Route -> String
"route"
TransactionSource
Task -> String
"task"
TransactionSource
Url -> String
"url"
TransactionSource
Unknown -> String
"unknown"
TransactionSource
View -> String
"view"