module Patrol.Type.Context where import qualified Data.Aeson as Aeson import qualified Data.Map as Map import qualified Data.Text as Text import qualified Patrol.Type.AppContext as AppContext import qualified Patrol.Type.BrowserContext as BrowserContext import qualified Patrol.Type.DeviceContext as DeviceContext import qualified Patrol.Type.GpuContext as GpuContext import qualified Patrol.Type.OsContext as OsContext import qualified Patrol.Type.RuntimeContext as RuntimeContext import qualified Patrol.Type.TraceContext as TraceContext data Context = App AppContext.AppContext | Browser BrowserContext.BrowserContext | Device DeviceContext.DeviceContext | Gpu GpuContext.GpuContext | Os OsContext.OsContext | Runtime RuntimeContext.RuntimeContext | Trace TraceContext.TraceContext | Other (Map.Map Text.Text Aeson.Value) deriving (Context -> Context -> Bool (Context -> Context -> Bool) -> (Context -> Context -> Bool) -> Eq Context forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a $c== :: Context -> Context -> Bool == :: Context -> Context -> Bool $c/= :: Context -> Context -> Bool /= :: Context -> Context -> Bool Eq, Int -> Context -> ShowS [Context] -> ShowS Context -> String (Int -> Context -> ShowS) -> (Context -> String) -> ([Context] -> ShowS) -> Show Context forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a $cshowsPrec :: Int -> Context -> ShowS showsPrec :: Int -> Context -> ShowS $cshow :: Context -> String show :: Context -> String $cshowList :: [Context] -> ShowS showList :: [Context] -> ShowS Show) instance Aeson.ToJSON Context where toJSON :: Context -> Value toJSON Context context = case Context context of App AppContext appContext -> AppContext -> Value forall a. ToJSON a => a -> Value Aeson.toJSON AppContext appContext Browser BrowserContext browserContext -> BrowserContext -> Value forall a. ToJSON a => a -> Value Aeson.toJSON BrowserContext browserContext Device DeviceContext deviceContext -> DeviceContext -> Value forall a. ToJSON a => a -> Value Aeson.toJSON DeviceContext deviceContext Gpu GpuContext gpuContext -> GpuContext -> Value forall a. ToJSON a => a -> Value Aeson.toJSON GpuContext gpuContext Os OsContext osContext -> OsContext -> Value forall a. ToJSON a => a -> Value Aeson.toJSON OsContext osContext Runtime RuntimeContext runtimeContext -> RuntimeContext -> Value forall a. ToJSON a => a -> Value Aeson.toJSON RuntimeContext runtimeContext Trace TraceContext traceContext -> TraceContext -> Value forall a. ToJSON a => a -> Value Aeson.toJSON TraceContext traceContext Other Map Text Value other -> Map Text Value -> Value forall a. ToJSON a => a -> Value Aeson.toJSON Map Text Value other