module WebDriverPreCore.BiDi.Script
(
AddPreloadScript (..),
ContextTarget (..),
RemoteValue (..),
PrimitiveProtocolValue (..),
SpecialNumber (..),
WindowProxyProperties (..),
CallFunction (..),
LocalValue (..),
ListLocalValue (..),
ArrayLocalValue (..),
DateLocalValue (..),
MappingLocalValue (..),
MapLocalValue (..),
ObjectLocalValue (..),
IncludeShadowTree (..),
RegExpValue (..),
RegExpLocalValue (..),
SetLocalValue (..),
ResultOwnership (..),
SerializationOptions (..),
RealmType (..),
Disown (..),
Target (..),
Realm (..),
RealmDestroyed (..),
Sandbox (..),
Evaluate (..),
GetRealms (..),
RemovePreloadScript (..),
AddPreloadScriptResult (..),
GetRealmsResult (..),
RealmInfo (..),
BaseRealmInfo (..),
EvaluateResult (..),
ExceptionDetails (..),
StackTrace (..),
StackFrame (..),
ScriptEvent (..),
Message (..),
Channel (..),
Source (..),
ChannelValue (..),
ChannelProperties (..),
PreloadScript (..),
RemoteReference (..),
SharedReference (..),
RemoteObjectReference (..),
)
where
import Control.Applicative ((<|>))
import Data.Aeson (FromJSON (..), ToJSON (..), Value (..), defaultOptions, genericToJSON, object, withObject, (.:), (.:?), (.=))
import Data.Aeson.Types (Parser, omitNothingFields)
import Data.Map.Strict qualified as Map
import Data.Maybe (catMaybes)
import Data.Text (Text, unpack)
import Data.Vector qualified as V
import GHC.Generics
import WebDriverPreCore.BiDi.CoreTypes (BrowsingContext, Handle, InternalId (..), JSUInt, NodeRemoteValue (..), SharedId, StringValue (..), UserContext)
import AesonUtils (jsonToText, opt, parseJSONOmitNothing, toJSONOmitNothing)
data AddPreloadScript = MkAddPreloadScript
{ AddPreloadScript -> Text
functionDeclaration :: Text,
AddPreloadScript -> Maybe [ChannelValue]
arguments :: Maybe [ChannelValue],
AddPreloadScript -> Maybe [BrowsingContext]
contexts :: Maybe [BrowsingContext],
AddPreloadScript -> Maybe [UserContext]
userContexts :: Maybe [UserContext],
AddPreloadScript -> Maybe Text
sandbox :: Maybe Text
}
deriving (Int -> AddPreloadScript -> ShowS
[AddPreloadScript] -> ShowS
AddPreloadScript -> String
(Int -> AddPreloadScript -> ShowS)
-> (AddPreloadScript -> String)
-> ([AddPreloadScript] -> ShowS)
-> Show AddPreloadScript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddPreloadScript -> ShowS
showsPrec :: Int -> AddPreloadScript -> ShowS
$cshow :: AddPreloadScript -> String
show :: AddPreloadScript -> String
$cshowList :: [AddPreloadScript] -> ShowS
showList :: [AddPreloadScript] -> ShowS
Show, AddPreloadScript -> AddPreloadScript -> Bool
(AddPreloadScript -> AddPreloadScript -> Bool)
-> (AddPreloadScript -> AddPreloadScript -> Bool)
-> Eq AddPreloadScript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddPreloadScript -> AddPreloadScript -> Bool
== :: AddPreloadScript -> AddPreloadScript -> Bool
$c/= :: AddPreloadScript -> AddPreloadScript -> Bool
/= :: AddPreloadScript -> AddPreloadScript -> Bool
Eq, (forall x. AddPreloadScript -> Rep AddPreloadScript x)
-> (forall x. Rep AddPreloadScript x -> AddPreloadScript)
-> Generic AddPreloadScript
forall x. Rep AddPreloadScript x -> AddPreloadScript
forall x. AddPreloadScript -> Rep AddPreloadScript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AddPreloadScript -> Rep AddPreloadScript x
from :: forall x. AddPreloadScript -> Rep AddPreloadScript x
$cto :: forall x. Rep AddPreloadScript x -> AddPreloadScript
to :: forall x. Rep AddPreloadScript x -> AddPreloadScript
Generic)
data RemoteValue
= PrimitiveValue PrimitiveProtocolValue
| SymbolValue
{
RemoteValue -> Maybe Handle
handle :: Maybe Handle,
RemoteValue -> Maybe InternalId
internalId :: Maybe InternalId
}
| ArrayValue
{
handle :: Maybe Handle,
internalId :: Maybe InternalId,
RemoteValue -> Maybe [RemoteValue]
value :: Maybe [RemoteValue]
}
| ObjectValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId,
RemoteValue -> Maybe [(Either RemoteValue Text, RemoteValue)]
values :: Maybe [(Either RemoteValue Text, RemoteValue)]
}
| FunctionValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| RegExpValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId,
RemoteValue -> Text
pattern' :: Text,
RemoteValue -> Maybe Text
flags :: Maybe Text
}
| DateValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId,
RemoteValue -> Text
dateValue :: Text
}
| MapValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId,
values :: Maybe [(Either RemoteValue Text, RemoteValue)]
}
| SetValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId,
value :: Maybe [RemoteValue]
}
| WeakMapValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| WeakSetValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| GeneratorValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| ErrorValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| ProxyValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| PromiseValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| TypedArrayValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| ArrayBufferValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId
}
| NodeListValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId,
value :: Maybe [RemoteValue]
}
| HTMLCollectionValue
{ handle :: Maybe Handle,
internalId :: Maybe InternalId,
value :: Maybe [RemoteValue]
}
| NodeValue NodeRemoteValue
| WindowProxyValue
{
RemoteValue -> WindowProxyProperties
winProxyValue :: WindowProxyProperties,
handle :: Maybe Handle,
internalId :: Maybe InternalId
}
deriving (Int -> RemoteValue -> ShowS
[RemoteValue] -> ShowS
RemoteValue -> String
(Int -> RemoteValue -> ShowS)
-> (RemoteValue -> String)
-> ([RemoteValue] -> ShowS)
-> Show RemoteValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoteValue -> ShowS
showsPrec :: Int -> RemoteValue -> ShowS
$cshow :: RemoteValue -> String
show :: RemoteValue -> String
$cshowList :: [RemoteValue] -> ShowS
showList :: [RemoteValue] -> ShowS
Show, RemoteValue -> RemoteValue -> Bool
(RemoteValue -> RemoteValue -> Bool)
-> (RemoteValue -> RemoteValue -> Bool) -> Eq RemoteValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoteValue -> RemoteValue -> Bool
== :: RemoteValue -> RemoteValue -> Bool
$c/= :: RemoteValue -> RemoteValue -> Bool
/= :: RemoteValue -> RemoteValue -> Bool
Eq, (forall x. RemoteValue -> Rep RemoteValue x)
-> (forall x. Rep RemoteValue x -> RemoteValue)
-> Generic RemoteValue
forall x. Rep RemoteValue x -> RemoteValue
forall x. RemoteValue -> Rep RemoteValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RemoteValue -> Rep RemoteValue x
from :: forall x. RemoteValue -> Rep RemoteValue x
$cto :: forall x. Rep RemoteValue x -> RemoteValue
to :: forall x. Rep RemoteValue x -> RemoteValue
Generic)
instance FromJSON RemoteValue where
parseJSON :: Value -> Parser RemoteValue
parseJSON :: Value -> Parser RemoteValue
parseJSON = String
-> (Object -> Parser RemoteValue) -> Value -> Parser RemoteValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"RemoteValue" ((Object -> Parser RemoteValue) -> Value -> Parser RemoteValue)
-> (Object -> Parser RemoteValue) -> Value -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ \Object
obj -> do
typ <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type"
handle <- obj .:? "handle"
internalId <- obj .:? "internalId"
case typ of
String
"undefined" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ PrimitiveProtocolValue -> RemoteValue
PrimitiveValue PrimitiveProtocolValue
UndefinedValue
String
"null" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ PrimitiveProtocolValue -> RemoteValue
PrimitiveValue PrimitiveProtocolValue
NullValue
String
"string" -> PrimitiveProtocolValue -> RemoteValue
PrimitiveValue (PrimitiveProtocolValue -> RemoteValue)
-> (Text -> PrimitiveProtocolValue) -> Text -> RemoteValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
. StringValue -> PrimitiveProtocolValue
StringValue (StringValue -> PrimitiveProtocolValue)
-> (Text -> StringValue) -> Text -> PrimitiveProtocolValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> StringValue
MkStringValue (Text -> RemoteValue) -> Parser Text -> Parser RemoteValue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
String
"number" ->
PrimitiveProtocolValue -> RemoteValue
PrimitiveValue (PrimitiveProtocolValue -> RemoteValue)
-> (Either Double SpecialNumber -> PrimitiveProtocolValue)
-> Either Double SpecialNumber
-> RemoteValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Either Double SpecialNumber -> PrimitiveProtocolValue
NumberValue (Either Double SpecialNumber -> RemoteValue)
-> Parser (Either Double SpecialNumber) -> Parser RemoteValue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> do
v <- Object
obj Object -> Key -> Parser Value
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
case v of
Number Scientific
n -> Either Double SpecialNumber -> Parser (Either Double SpecialNumber)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either Double SpecialNumber
-> Parser (Either Double SpecialNumber))
-> Either Double SpecialNumber
-> Parser (Either Double SpecialNumber)
forall a b. (a -> b) -> a -> b
$ Double -> Either Double SpecialNumber
forall a b. a -> Either a b
Left (Scientific -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac Scientific
n)
String Text
s -> case Text
s of
Text
"NaN" -> Either Double SpecialNumber -> Parser (Either Double SpecialNumber)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either Double SpecialNumber
-> Parser (Either Double SpecialNumber))
-> Either Double SpecialNumber
-> Parser (Either Double SpecialNumber)
forall a b. (a -> b) -> a -> b
$ SpecialNumber -> Either Double SpecialNumber
forall a b. b -> Either a b
Right SpecialNumber
NaN
Text
"-0" -> Either Double SpecialNumber -> Parser (Either Double SpecialNumber)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either Double SpecialNumber
-> Parser (Either Double SpecialNumber))
-> Either Double SpecialNumber
-> Parser (Either Double SpecialNumber)
forall a b. (a -> b) -> a -> b
$ SpecialNumber -> Either Double SpecialNumber
forall a b. b -> Either a b
Right SpecialNumber
NegativeZero
Text
"Infinity" -> Either Double SpecialNumber -> Parser (Either Double SpecialNumber)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either Double SpecialNumber
-> Parser (Either Double SpecialNumber))
-> Either Double SpecialNumber
-> Parser (Either Double SpecialNumber)
forall a b. (a -> b) -> a -> b
$ SpecialNumber -> Either Double SpecialNumber
forall a b. b -> Either a b
Right SpecialNumber
Infinity
Text
"-Infinity" -> Either Double SpecialNumber -> Parser (Either Double SpecialNumber)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Either Double SpecialNumber
-> Parser (Either Double SpecialNumber))
-> Either Double SpecialNumber
-> Parser (Either Double SpecialNumber)
forall a b. (a -> b) -> a -> b
$ SpecialNumber -> Either Double SpecialNumber
forall a b. b -> Either a b
Right SpecialNumber
NegativeInfinity
Text
_ -> String -> Parser (Either Double SpecialNumber)
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser (Either Double SpecialNumber))
-> String -> Parser (Either Double SpecialNumber)
forall a b. (a -> b) -> a -> b
$ String
"Unknown SpecialNumber string: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
unpack Text
s
Value
_ -> String -> Parser (Either Double SpecialNumber)
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser (Either Double SpecialNumber))
-> String -> Parser (Either Double SpecialNumber)
forall a b. (a -> b) -> a -> b
$ String
"Expected number or special number string, got: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Value -> String
forall a. Show a => a -> String
show Value
v
String
"boolean" -> PrimitiveProtocolValue -> RemoteValue
PrimitiveValue (PrimitiveProtocolValue -> RemoteValue)
-> (Bool -> PrimitiveProtocolValue) -> Bool -> RemoteValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> PrimitiveProtocolValue
BooleanValue (Bool -> RemoteValue) -> Parser Bool -> Parser RemoteValue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Key -> Parser Bool
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
String
"bigint" -> PrimitiveProtocolValue -> RemoteValue
PrimitiveValue (PrimitiveProtocolValue -> RemoteValue)
-> (Text -> PrimitiveProtocolValue) -> Text -> RemoteValue
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> PrimitiveProtocolValue
BigIntValue (Text -> RemoteValue) -> Parser Text -> Parser RemoteValue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
obj Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
String
"node" -> NodeRemoteValue -> RemoteValue
NodeValue (NodeRemoteValue -> RemoteValue)
-> Parser NodeRemoteValue -> Parser RemoteValue
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser NodeRemoteValue
forall a. FromJSON a => Value -> Parser a
parseJSON (Object -> Value
Object Object
obj)
String
"array" -> do
value <- Object
obj Object -> Key -> Parser (Maybe [RemoteValue])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"value"
pure $ ArrayValue {..}
String
"object" -> do
values <- Object
obj Object
-> Key -> Parser (Maybe [(Either RemoteValue Text, RemoteValue)])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"values"
pure $ ObjectValue {..}
String
"regexp" -> do
value <- Object
obj Object -> Key -> Parser Object
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
pattern' <- value .: "pattern"
flags <- value .:? "flags"
pure $ RegExpValue {..}
String
"date" -> do
dateValue <- Object
obj Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
pure $ DateValue {..}
String
"map" -> do
maybeValues <- Object
obj Object -> Key -> Parser (Maybe [Value])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"value"
values <- traverse (mapM parseMapEntry) maybeValues
pure $ MapValue {..}
where
parseMapEntry :: Value -> Parser (Either RemoteValue Text, RemoteValue)
parseMapEntry :: Value -> Parser (Either RemoteValue Text, RemoteValue)
parseMapEntry Value
val = case Value
val of
Array Array
arr -> case Array -> [Value]
forall a. Vector a -> [a]
V.toList Array
arr of
[Value
keyVal, Value
valueVal] -> do
key <- (Text -> Either RemoteValue Text
forall a b. b -> Either a b
Right (Text -> Either RemoteValue Text)
-> Parser Text -> Parser (Either RemoteValue Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser Text
forall a. FromJSON a => Value -> Parser a
parseJSON Value
keyVal) Parser (Either RemoteValue Text)
-> Parser (Either RemoteValue Text)
-> Parser (Either RemoteValue Text)
forall a. Parser a -> Parser a -> Parser a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (RemoteValue -> Either RemoteValue Text
forall a b. a -> Either a b
Left (RemoteValue -> Either RemoteValue Text)
-> Parser RemoteValue -> Parser (Either RemoteValue Text)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser RemoteValue
forall a. FromJSON a => Value -> Parser a
parseJSON Value
keyVal)
value <- parseJSON valueVal
pure (key, value)
[Value]
_ -> String -> Parser (Either RemoteValue Text, RemoteValue)
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"Map entry must be an array with exactly 2 elements"
Value
_ -> String -> Parser (Either RemoteValue Text, RemoteValue)
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"Map entry must be an array"
String
"set" -> do
value <- Object
obj Object -> Key -> Parser (Maybe [RemoteValue])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"value"
pure $ SetValue {..}
String
"window" -> do
winProxyValue <- Object
obj Object -> Key -> Parser WindowProxyProperties
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
pure $ WindowProxyValue {..}
String
"nodelist" -> do
value <- Object
obj Object -> Key -> Parser (Maybe [RemoteValue])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"value"
pure $ NodeListValue {..}
String
"htmlcollection" -> do
value <- Object
obj Object -> Key -> Parser (Maybe [RemoteValue])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"value"
pure $ HTMLCollectionValue {..}
String
"function" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ FunctionValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"symbol" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ SymbolValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"weakmap" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ WeakMapValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"weakset" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ WeakSetValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"generator" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ GeneratorValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"error" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ ErrorValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"proxy" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ ProxyValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"promise" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ PromiseValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"typedarray" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ TypedArrayValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
"arraybuffer" -> RemoteValue -> Parser RemoteValue
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RemoteValue -> Parser RemoteValue)
-> RemoteValue -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ ArrayBufferValue {Maybe Handle
Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
handle :: Maybe Handle
internalId :: Maybe InternalId
..}
String
_ -> String -> Parser RemoteValue
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser RemoteValue) -> String -> Parser RemoteValue
forall a b. (a -> b) -> a -> b
$ String
"Unknown RemoteValue type: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> ShowS
forall a. Show a => a -> String
show String
typ String -> ShowS
forall a. Semigroup a => a -> a -> a
<> String
"\n" String -> ShowS
forall a. Semigroup a => a -> a -> a
<> (Text -> String
unpack (Text -> String) -> Text -> String
forall a b. (a -> b) -> a -> b
$ Value -> Text
jsonToText (Value -> Text) -> Value -> Text
forall a b. (a -> b) -> a -> b
$ Object -> Value
Object Object
obj)
data PrimitiveProtocolValue
= UndefinedValue
| NullValue
| StringValue StringValue
| NumberValue (Either Double SpecialNumber)
| BooleanValue Bool
| BigIntValue Text
deriving (Int -> PrimitiveProtocolValue -> ShowS
[PrimitiveProtocolValue] -> ShowS
PrimitiveProtocolValue -> String
(Int -> PrimitiveProtocolValue -> ShowS)
-> (PrimitiveProtocolValue -> String)
-> ([PrimitiveProtocolValue] -> ShowS)
-> Show PrimitiveProtocolValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PrimitiveProtocolValue -> ShowS
showsPrec :: Int -> PrimitiveProtocolValue -> ShowS
$cshow :: PrimitiveProtocolValue -> String
show :: PrimitiveProtocolValue -> String
$cshowList :: [PrimitiveProtocolValue] -> ShowS
showList :: [PrimitiveProtocolValue] -> ShowS
Show, PrimitiveProtocolValue -> PrimitiveProtocolValue -> Bool
(PrimitiveProtocolValue -> PrimitiveProtocolValue -> Bool)
-> (PrimitiveProtocolValue -> PrimitiveProtocolValue -> Bool)
-> Eq PrimitiveProtocolValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PrimitiveProtocolValue -> PrimitiveProtocolValue -> Bool
== :: PrimitiveProtocolValue -> PrimitiveProtocolValue -> Bool
$c/= :: PrimitiveProtocolValue -> PrimitiveProtocolValue -> Bool
/= :: PrimitiveProtocolValue -> PrimitiveProtocolValue -> Bool
Eq, (forall x. PrimitiveProtocolValue -> Rep PrimitiveProtocolValue x)
-> (forall x.
Rep PrimitiveProtocolValue x -> PrimitiveProtocolValue)
-> Generic PrimitiveProtocolValue
forall x. Rep PrimitiveProtocolValue x -> PrimitiveProtocolValue
forall x. PrimitiveProtocolValue -> Rep PrimitiveProtocolValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PrimitiveProtocolValue -> Rep PrimitiveProtocolValue x
from :: forall x. PrimitiveProtocolValue -> Rep PrimitiveProtocolValue x
$cto :: forall x. Rep PrimitiveProtocolValue x -> PrimitiveProtocolValue
to :: forall x. Rep PrimitiveProtocolValue x -> PrimitiveProtocolValue
Generic)
data SpecialNumber
= NaN
| NegativeZero
| Infinity
| NegativeInfinity
deriving (Int -> SpecialNumber -> ShowS
[SpecialNumber] -> ShowS
SpecialNumber -> String
(Int -> SpecialNumber -> ShowS)
-> (SpecialNumber -> String)
-> ([SpecialNumber] -> ShowS)
-> Show SpecialNumber
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SpecialNumber -> ShowS
showsPrec :: Int -> SpecialNumber -> ShowS
$cshow :: SpecialNumber -> String
show :: SpecialNumber -> String
$cshowList :: [SpecialNumber] -> ShowS
showList :: [SpecialNumber] -> ShowS
Show, SpecialNumber -> SpecialNumber -> Bool
(SpecialNumber -> SpecialNumber -> Bool)
-> (SpecialNumber -> SpecialNumber -> Bool) -> Eq SpecialNumber
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SpecialNumber -> SpecialNumber -> Bool
== :: SpecialNumber -> SpecialNumber -> Bool
$c/= :: SpecialNumber -> SpecialNumber -> Bool
/= :: SpecialNumber -> SpecialNumber -> Bool
Eq, (forall x. SpecialNumber -> Rep SpecialNumber x)
-> (forall x. Rep SpecialNumber x -> SpecialNumber)
-> Generic SpecialNumber
forall x. Rep SpecialNumber x -> SpecialNumber
forall x. SpecialNumber -> Rep SpecialNumber x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SpecialNumber -> Rep SpecialNumber x
from :: forall x. SpecialNumber -> Rep SpecialNumber x
$cto :: forall x. Rep SpecialNumber x -> SpecialNumber
to :: forall x. Rep SpecialNumber x -> SpecialNumber
Generic)
instance FromJSON SpecialNumber
instance ToJSON SpecialNumber where
toJSON :: SpecialNumber -> Value
toJSON :: SpecialNumber -> Value
toJSON = \case
SpecialNumber
NaN -> Value
"NaN"
SpecialNumber
NegativeZero -> Value
"-0"
SpecialNumber
Infinity -> Value
"Infinity"
SpecialNumber
NegativeInfinity -> Value
"-Infinity"
newtype WindowProxyProperties = MkWindowProxyProperties
{ WindowProxyProperties -> BrowsingContext
context :: BrowsingContext
}
deriving (Int -> WindowProxyProperties -> ShowS
[WindowProxyProperties] -> ShowS
WindowProxyProperties -> String
(Int -> WindowProxyProperties -> ShowS)
-> (WindowProxyProperties -> String)
-> ([WindowProxyProperties] -> ShowS)
-> Show WindowProxyProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WindowProxyProperties -> ShowS
showsPrec :: Int -> WindowProxyProperties -> ShowS
$cshow :: WindowProxyProperties -> String
show :: WindowProxyProperties -> String
$cshowList :: [WindowProxyProperties] -> ShowS
showList :: [WindowProxyProperties] -> ShowS
Show, WindowProxyProperties -> WindowProxyProperties -> Bool
(WindowProxyProperties -> WindowProxyProperties -> Bool)
-> (WindowProxyProperties -> WindowProxyProperties -> Bool)
-> Eq WindowProxyProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WindowProxyProperties -> WindowProxyProperties -> Bool
== :: WindowProxyProperties -> WindowProxyProperties -> Bool
$c/= :: WindowProxyProperties -> WindowProxyProperties -> Bool
/= :: WindowProxyProperties -> WindowProxyProperties -> Bool
Eq, (forall x. WindowProxyProperties -> Rep WindowProxyProperties x)
-> (forall x. Rep WindowProxyProperties x -> WindowProxyProperties)
-> Generic WindowProxyProperties
forall x. Rep WindowProxyProperties x -> WindowProxyProperties
forall x. WindowProxyProperties -> Rep WindowProxyProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WindowProxyProperties -> Rep WindowProxyProperties x
from :: forall x. WindowProxyProperties -> Rep WindowProxyProperties x
$cto :: forall x. Rep WindowProxyProperties x -> WindowProxyProperties
to :: forall x. Rep WindowProxyProperties x -> WindowProxyProperties
Generic)
instance FromJSON WindowProxyProperties
instance ToJSON WindowProxyProperties
data CallFunction = MkCallFunction
{ CallFunction -> Text
functionDeclaration :: Text,
CallFunction -> Bool
awaitPromise :: Bool,
CallFunction -> Target
target :: Target,
CallFunction -> Maybe [LocalValue]
arguments :: Maybe [LocalValue],
CallFunction -> Maybe ResultOwnership
resultOwnership :: Maybe ResultOwnership,
CallFunction -> Maybe SerializationOptions
serializationOptions :: Maybe SerializationOptions,
CallFunction -> Maybe LocalValue
this :: Maybe LocalValue
}
deriving (Int -> CallFunction -> ShowS
[CallFunction] -> ShowS
CallFunction -> String
(Int -> CallFunction -> ShowS)
-> (CallFunction -> String)
-> ([CallFunction] -> ShowS)
-> Show CallFunction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CallFunction -> ShowS
showsPrec :: Int -> CallFunction -> ShowS
$cshow :: CallFunction -> String
show :: CallFunction -> String
$cshowList :: [CallFunction] -> ShowS
showList :: [CallFunction] -> ShowS
Show, CallFunction -> CallFunction -> Bool
(CallFunction -> CallFunction -> Bool)
-> (CallFunction -> CallFunction -> Bool) -> Eq CallFunction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CallFunction -> CallFunction -> Bool
== :: CallFunction -> CallFunction -> Bool
$c/= :: CallFunction -> CallFunction -> Bool
/= :: CallFunction -> CallFunction -> Bool
Eq, (forall x. CallFunction -> Rep CallFunction x)
-> (forall x. Rep CallFunction x -> CallFunction)
-> Generic CallFunction
forall x. Rep CallFunction x -> CallFunction
forall x. CallFunction -> Rep CallFunction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CallFunction -> Rep CallFunction x
from :: forall x. CallFunction -> Rep CallFunction x
$cto :: forall x. Rep CallFunction x -> CallFunction
to :: forall x. Rep CallFunction x -> CallFunction
Generic)
data LocalValue
= RemoteReference RemoteReference
| PrimitiveLocalValue PrimitiveProtocolValue
| ChannelValue ChannelValue
| ArrayLocalValue ArrayLocalValue
| DateLocalValue DateLocalValue
| MapLocalValue MapLocalValue
| ObjectLocalValue ObjectLocalValue
| RegExpLocalValue RegExpLocalValue
| SetLocalValue SetLocalValue
deriving (Int -> LocalValue -> ShowS
[LocalValue] -> ShowS
LocalValue -> String
(Int -> LocalValue -> ShowS)
-> (LocalValue -> String)
-> ([LocalValue] -> ShowS)
-> Show LocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LocalValue -> ShowS
showsPrec :: Int -> LocalValue -> ShowS
$cshow :: LocalValue -> String
show :: LocalValue -> String
$cshowList :: [LocalValue] -> ShowS
showList :: [LocalValue] -> ShowS
Show, LocalValue -> LocalValue -> Bool
(LocalValue -> LocalValue -> Bool)
-> (LocalValue -> LocalValue -> Bool) -> Eq LocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LocalValue -> LocalValue -> Bool
== :: LocalValue -> LocalValue -> Bool
$c/= :: LocalValue -> LocalValue -> Bool
/= :: LocalValue -> LocalValue -> Bool
Eq, (forall x. LocalValue -> Rep LocalValue x)
-> (forall x. Rep LocalValue x -> LocalValue) -> Generic LocalValue
forall x. Rep LocalValue x -> LocalValue
forall x. LocalValue -> Rep LocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. LocalValue -> Rep LocalValue x
from :: forall x. LocalValue -> Rep LocalValue x
$cto :: forall x. Rep LocalValue x -> LocalValue
to :: forall x. Rep LocalValue x -> LocalValue
Generic)
data RemoteReference = MkRemoteReference
{ RemoteReference -> SharedReference
sharedreference :: SharedReference,
RemoteReference -> RemoteObjectReference
remoteObjectReference :: RemoteObjectReference
}
deriving (Int -> RemoteReference -> ShowS
[RemoteReference] -> ShowS
RemoteReference -> String
(Int -> RemoteReference -> ShowS)
-> (RemoteReference -> String)
-> ([RemoteReference] -> ShowS)
-> Show RemoteReference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoteReference -> ShowS
showsPrec :: Int -> RemoteReference -> ShowS
$cshow :: RemoteReference -> String
show :: RemoteReference -> String
$cshowList :: [RemoteReference] -> ShowS
showList :: [RemoteReference] -> ShowS
Show, RemoteReference -> RemoteReference -> Bool
(RemoteReference -> RemoteReference -> Bool)
-> (RemoteReference -> RemoteReference -> Bool)
-> Eq RemoteReference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoteReference -> RemoteReference -> Bool
== :: RemoteReference -> RemoteReference -> Bool
$c/= :: RemoteReference -> RemoteReference -> Bool
/= :: RemoteReference -> RemoteReference -> Bool
Eq, (forall x. RemoteReference -> Rep RemoteReference x)
-> (forall x. Rep RemoteReference x -> RemoteReference)
-> Generic RemoteReference
forall x. Rep RemoteReference x -> RemoteReference
forall x. RemoteReference -> Rep RemoteReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RemoteReference -> Rep RemoteReference x
from :: forall x. RemoteReference -> Rep RemoteReference x
$cto :: forall x. Rep RemoteReference x -> RemoteReference
to :: forall x. Rep RemoteReference x -> RemoteReference
Generic)
data SharedReference = MkSharedReference
{ SharedReference -> SharedId
sharedId :: SharedId,
SharedReference -> Maybe Handle
handle :: Maybe Handle,
SharedReference -> Maybe (Map Text Value)
extensions :: Maybe (Map.Map Text Value)
}
deriving (Int -> SharedReference -> ShowS
[SharedReference] -> ShowS
SharedReference -> String
(Int -> SharedReference -> ShowS)
-> (SharedReference -> String)
-> ([SharedReference] -> ShowS)
-> Show SharedReference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SharedReference -> ShowS
showsPrec :: Int -> SharedReference -> ShowS
$cshow :: SharedReference -> String
show :: SharedReference -> String
$cshowList :: [SharedReference] -> ShowS
showList :: [SharedReference] -> ShowS
Show, SharedReference -> SharedReference -> Bool
(SharedReference -> SharedReference -> Bool)
-> (SharedReference -> SharedReference -> Bool)
-> Eq SharedReference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SharedReference -> SharedReference -> Bool
== :: SharedReference -> SharedReference -> Bool
$c/= :: SharedReference -> SharedReference -> Bool
/= :: SharedReference -> SharedReference -> Bool
Eq, (forall x. SharedReference -> Rep SharedReference x)
-> (forall x. Rep SharedReference x -> SharedReference)
-> Generic SharedReference
forall x. Rep SharedReference x -> SharedReference
forall x. SharedReference -> Rep SharedReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SharedReference -> Rep SharedReference x
from :: forall x. SharedReference -> Rep SharedReference x
$cto :: forall x. Rep SharedReference x -> SharedReference
to :: forall x. Rep SharedReference x -> SharedReference
Generic)
instance FromJSON SharedReference where
parseJSON :: Value -> Parser SharedReference
parseJSON :: Value -> Parser SharedReference
parseJSON = Value -> Parser SharedReference
forall a. (Generic a, GFromJSON Zero (Rep a)) => Value -> Parser a
parseJSONOmitNothing
data RemoteObjectReference = MkRemoteObjectReference
{ RemoteObjectReference -> Handle
handle :: Handle,
RemoteObjectReference -> Maybe SharedId
shartedId :: Maybe SharedId,
RemoteObjectReference -> Maybe (Map Text Value)
extensions :: Maybe (Map.Map Text Value)
}
deriving (Int -> RemoteObjectReference -> ShowS
[RemoteObjectReference] -> ShowS
RemoteObjectReference -> String
(Int -> RemoteObjectReference -> ShowS)
-> (RemoteObjectReference -> String)
-> ([RemoteObjectReference] -> ShowS)
-> Show RemoteObjectReference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemoteObjectReference -> ShowS
showsPrec :: Int -> RemoteObjectReference -> ShowS
$cshow :: RemoteObjectReference -> String
show :: RemoteObjectReference -> String
$cshowList :: [RemoteObjectReference] -> ShowS
showList :: [RemoteObjectReference] -> ShowS
Show, RemoteObjectReference -> RemoteObjectReference -> Bool
(RemoteObjectReference -> RemoteObjectReference -> Bool)
-> (RemoteObjectReference -> RemoteObjectReference -> Bool)
-> Eq RemoteObjectReference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemoteObjectReference -> RemoteObjectReference -> Bool
== :: RemoteObjectReference -> RemoteObjectReference -> Bool
$c/= :: RemoteObjectReference -> RemoteObjectReference -> Bool
/= :: RemoteObjectReference -> RemoteObjectReference -> Bool
Eq, (forall x. RemoteObjectReference -> Rep RemoteObjectReference x)
-> (forall x. Rep RemoteObjectReference x -> RemoteObjectReference)
-> Generic RemoteObjectReference
forall x. Rep RemoteObjectReference x -> RemoteObjectReference
forall x. RemoteObjectReference -> Rep RemoteObjectReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RemoteObjectReference -> Rep RemoteObjectReference x
from :: forall x. RemoteObjectReference -> Rep RemoteObjectReference x
$cto :: forall x. Rep RemoteObjectReference x -> RemoteObjectReference
to :: forall x. Rep RemoteObjectReference x -> RemoteObjectReference
Generic)
newtype ListLocalValue = MkListLocalValue [LocalValue]
deriving (Int -> ListLocalValue -> ShowS
[ListLocalValue] -> ShowS
ListLocalValue -> String
(Int -> ListLocalValue -> ShowS)
-> (ListLocalValue -> String)
-> ([ListLocalValue] -> ShowS)
-> Show ListLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ListLocalValue -> ShowS
showsPrec :: Int -> ListLocalValue -> ShowS
$cshow :: ListLocalValue -> String
show :: ListLocalValue -> String
$cshowList :: [ListLocalValue] -> ShowS
showList :: [ListLocalValue] -> ShowS
Show, ListLocalValue -> ListLocalValue -> Bool
(ListLocalValue -> ListLocalValue -> Bool)
-> (ListLocalValue -> ListLocalValue -> Bool) -> Eq ListLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ListLocalValue -> ListLocalValue -> Bool
== :: ListLocalValue -> ListLocalValue -> Bool
$c/= :: ListLocalValue -> ListLocalValue -> Bool
/= :: ListLocalValue -> ListLocalValue -> Bool
Eq, (forall x. ListLocalValue -> Rep ListLocalValue x)
-> (forall x. Rep ListLocalValue x -> ListLocalValue)
-> Generic ListLocalValue
forall x. Rep ListLocalValue x -> ListLocalValue
forall x. ListLocalValue -> Rep ListLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ListLocalValue -> Rep ListLocalValue x
from :: forall x. ListLocalValue -> Rep ListLocalValue x
$cto :: forall x. Rep ListLocalValue x -> ListLocalValue
to :: forall x. Rep ListLocalValue x -> ListLocalValue
Generic)
data ArrayLocalValue = MkArrayLocalValue
{ ArrayLocalValue -> Text
typ :: Text,
ArrayLocalValue -> ListLocalValue
value :: ListLocalValue
}
deriving (Int -> ArrayLocalValue -> ShowS
[ArrayLocalValue] -> ShowS
ArrayLocalValue -> String
(Int -> ArrayLocalValue -> ShowS)
-> (ArrayLocalValue -> String)
-> ([ArrayLocalValue] -> ShowS)
-> Show ArrayLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ArrayLocalValue -> ShowS
showsPrec :: Int -> ArrayLocalValue -> ShowS
$cshow :: ArrayLocalValue -> String
show :: ArrayLocalValue -> String
$cshowList :: [ArrayLocalValue] -> ShowS
showList :: [ArrayLocalValue] -> ShowS
Show, ArrayLocalValue -> ArrayLocalValue -> Bool
(ArrayLocalValue -> ArrayLocalValue -> Bool)
-> (ArrayLocalValue -> ArrayLocalValue -> Bool)
-> Eq ArrayLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ArrayLocalValue -> ArrayLocalValue -> Bool
== :: ArrayLocalValue -> ArrayLocalValue -> Bool
$c/= :: ArrayLocalValue -> ArrayLocalValue -> Bool
/= :: ArrayLocalValue -> ArrayLocalValue -> Bool
Eq, (forall x. ArrayLocalValue -> Rep ArrayLocalValue x)
-> (forall x. Rep ArrayLocalValue x -> ArrayLocalValue)
-> Generic ArrayLocalValue
forall x. Rep ArrayLocalValue x -> ArrayLocalValue
forall x. ArrayLocalValue -> Rep ArrayLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ArrayLocalValue -> Rep ArrayLocalValue x
from :: forall x. ArrayLocalValue -> Rep ArrayLocalValue x
$cto :: forall x. Rep ArrayLocalValue x -> ArrayLocalValue
to :: forall x. Rep ArrayLocalValue x -> ArrayLocalValue
Generic)
newtype DateLocalValue = MkDateLocalValue
{ DateLocalValue -> Text
value :: Text
}
deriving (Int -> DateLocalValue -> ShowS
[DateLocalValue] -> ShowS
DateLocalValue -> String
(Int -> DateLocalValue -> ShowS)
-> (DateLocalValue -> String)
-> ([DateLocalValue] -> ShowS)
-> Show DateLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DateLocalValue -> ShowS
showsPrec :: Int -> DateLocalValue -> ShowS
$cshow :: DateLocalValue -> String
show :: DateLocalValue -> String
$cshowList :: [DateLocalValue] -> ShowS
showList :: [DateLocalValue] -> ShowS
Show, DateLocalValue -> DateLocalValue -> Bool
(DateLocalValue -> DateLocalValue -> Bool)
-> (DateLocalValue -> DateLocalValue -> Bool) -> Eq DateLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DateLocalValue -> DateLocalValue -> Bool
== :: DateLocalValue -> DateLocalValue -> Bool
$c/= :: DateLocalValue -> DateLocalValue -> Bool
/= :: DateLocalValue -> DateLocalValue -> Bool
Eq, (forall x. DateLocalValue -> Rep DateLocalValue x)
-> (forall x. Rep DateLocalValue x -> DateLocalValue)
-> Generic DateLocalValue
forall x. Rep DateLocalValue x -> DateLocalValue
forall x. DateLocalValue -> Rep DateLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DateLocalValue -> Rep DateLocalValue x
from :: forall x. DateLocalValue -> Rep DateLocalValue x
$cto :: forall x. Rep DateLocalValue x -> DateLocalValue
to :: forall x. Rep DateLocalValue x -> DateLocalValue
Generic)
newtype MappingLocalValue = MkMappingLocalValue [(Either LocalValue Text, LocalValue)]
deriving (Int -> MappingLocalValue -> ShowS
[MappingLocalValue] -> ShowS
MappingLocalValue -> String
(Int -> MappingLocalValue -> ShowS)
-> (MappingLocalValue -> String)
-> ([MappingLocalValue] -> ShowS)
-> Show MappingLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MappingLocalValue -> ShowS
showsPrec :: Int -> MappingLocalValue -> ShowS
$cshow :: MappingLocalValue -> String
show :: MappingLocalValue -> String
$cshowList :: [MappingLocalValue] -> ShowS
showList :: [MappingLocalValue] -> ShowS
Show, MappingLocalValue -> MappingLocalValue -> Bool
(MappingLocalValue -> MappingLocalValue -> Bool)
-> (MappingLocalValue -> MappingLocalValue -> Bool)
-> Eq MappingLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MappingLocalValue -> MappingLocalValue -> Bool
== :: MappingLocalValue -> MappingLocalValue -> Bool
$c/= :: MappingLocalValue -> MappingLocalValue -> Bool
/= :: MappingLocalValue -> MappingLocalValue -> Bool
Eq, (forall x. MappingLocalValue -> Rep MappingLocalValue x)
-> (forall x. Rep MappingLocalValue x -> MappingLocalValue)
-> Generic MappingLocalValue
forall x. Rep MappingLocalValue x -> MappingLocalValue
forall x. MappingLocalValue -> Rep MappingLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MappingLocalValue -> Rep MappingLocalValue x
from :: forall x. MappingLocalValue -> Rep MappingLocalValue x
$cto :: forall x. Rep MappingLocalValue x -> MappingLocalValue
to :: forall x. Rep MappingLocalValue x -> MappingLocalValue
Generic)
data MapLocalValue = MkMapLocalValue
{ MapLocalValue -> MappingLocalValue
value :: MappingLocalValue
}
deriving (Int -> MapLocalValue -> ShowS
[MapLocalValue] -> ShowS
MapLocalValue -> String
(Int -> MapLocalValue -> ShowS)
-> (MapLocalValue -> String)
-> ([MapLocalValue] -> ShowS)
-> Show MapLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MapLocalValue -> ShowS
showsPrec :: Int -> MapLocalValue -> ShowS
$cshow :: MapLocalValue -> String
show :: MapLocalValue -> String
$cshowList :: [MapLocalValue] -> ShowS
showList :: [MapLocalValue] -> ShowS
Show, MapLocalValue -> MapLocalValue -> Bool
(MapLocalValue -> MapLocalValue -> Bool)
-> (MapLocalValue -> MapLocalValue -> Bool) -> Eq MapLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MapLocalValue -> MapLocalValue -> Bool
== :: MapLocalValue -> MapLocalValue -> Bool
$c/= :: MapLocalValue -> MapLocalValue -> Bool
/= :: MapLocalValue -> MapLocalValue -> Bool
Eq, (forall x. MapLocalValue -> Rep MapLocalValue x)
-> (forall x. Rep MapLocalValue x -> MapLocalValue)
-> Generic MapLocalValue
forall x. Rep MapLocalValue x -> MapLocalValue
forall x. MapLocalValue -> Rep MapLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MapLocalValue -> Rep MapLocalValue x
from :: forall x. MapLocalValue -> Rep MapLocalValue x
$cto :: forall x. Rep MapLocalValue x -> MapLocalValue
to :: forall x. Rep MapLocalValue x -> MapLocalValue
Generic)
data ObjectLocalValue = MkObjectLocalValue
{ ObjectLocalValue -> MappingLocalValue
value :: MappingLocalValue
}
deriving (Int -> ObjectLocalValue -> ShowS
[ObjectLocalValue] -> ShowS
ObjectLocalValue -> String
(Int -> ObjectLocalValue -> ShowS)
-> (ObjectLocalValue -> String)
-> ([ObjectLocalValue] -> ShowS)
-> Show ObjectLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ObjectLocalValue -> ShowS
showsPrec :: Int -> ObjectLocalValue -> ShowS
$cshow :: ObjectLocalValue -> String
show :: ObjectLocalValue -> String
$cshowList :: [ObjectLocalValue] -> ShowS
showList :: [ObjectLocalValue] -> ShowS
Show, ObjectLocalValue -> ObjectLocalValue -> Bool
(ObjectLocalValue -> ObjectLocalValue -> Bool)
-> (ObjectLocalValue -> ObjectLocalValue -> Bool)
-> Eq ObjectLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ObjectLocalValue -> ObjectLocalValue -> Bool
== :: ObjectLocalValue -> ObjectLocalValue -> Bool
$c/= :: ObjectLocalValue -> ObjectLocalValue -> Bool
/= :: ObjectLocalValue -> ObjectLocalValue -> Bool
Eq, (forall x. ObjectLocalValue -> Rep ObjectLocalValue x)
-> (forall x. Rep ObjectLocalValue x -> ObjectLocalValue)
-> Generic ObjectLocalValue
forall x. Rep ObjectLocalValue x -> ObjectLocalValue
forall x. ObjectLocalValue -> Rep ObjectLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ObjectLocalValue -> Rep ObjectLocalValue x
from :: forall x. ObjectLocalValue -> Rep ObjectLocalValue x
$cto :: forall x. Rep ObjectLocalValue x -> ObjectLocalValue
to :: forall x. Rep ObjectLocalValue x -> ObjectLocalValue
Generic)
data RegExpValue = MkRegExpValue
{ RegExpValue -> Text
regExpPattern :: Text,
RegExpValue -> Maybe Text
flags :: Maybe Text
}
deriving (Int -> RegExpValue -> ShowS
[RegExpValue] -> ShowS
RegExpValue -> String
(Int -> RegExpValue -> ShowS)
-> (RegExpValue -> String)
-> ([RegExpValue] -> ShowS)
-> Show RegExpValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RegExpValue -> ShowS
showsPrec :: Int -> RegExpValue -> ShowS
$cshow :: RegExpValue -> String
show :: RegExpValue -> String
$cshowList :: [RegExpValue] -> ShowS
showList :: [RegExpValue] -> ShowS
Show, RegExpValue -> RegExpValue -> Bool
(RegExpValue -> RegExpValue -> Bool)
-> (RegExpValue -> RegExpValue -> Bool) -> Eq RegExpValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RegExpValue -> RegExpValue -> Bool
== :: RegExpValue -> RegExpValue -> Bool
$c/= :: RegExpValue -> RegExpValue -> Bool
/= :: RegExpValue -> RegExpValue -> Bool
Eq, (forall x. RegExpValue -> Rep RegExpValue x)
-> (forall x. Rep RegExpValue x -> RegExpValue)
-> Generic RegExpValue
forall x. Rep RegExpValue x -> RegExpValue
forall x. RegExpValue -> Rep RegExpValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RegExpValue -> Rep RegExpValue x
from :: forall x. RegExpValue -> Rep RegExpValue x
$cto :: forall x. Rep RegExpValue x -> RegExpValue
to :: forall x. Rep RegExpValue x -> RegExpValue
Generic)
data RegExpLocalValue = MkRegExpLocalValue
{ RegExpLocalValue -> RegExpValue
value :: RegExpValue
}
deriving (Int -> RegExpLocalValue -> ShowS
[RegExpLocalValue] -> ShowS
RegExpLocalValue -> String
(Int -> RegExpLocalValue -> ShowS)
-> (RegExpLocalValue -> String)
-> ([RegExpLocalValue] -> ShowS)
-> Show RegExpLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RegExpLocalValue -> ShowS
showsPrec :: Int -> RegExpLocalValue -> ShowS
$cshow :: RegExpLocalValue -> String
show :: RegExpLocalValue -> String
$cshowList :: [RegExpLocalValue] -> ShowS
showList :: [RegExpLocalValue] -> ShowS
Show, RegExpLocalValue -> RegExpLocalValue -> Bool
(RegExpLocalValue -> RegExpLocalValue -> Bool)
-> (RegExpLocalValue -> RegExpLocalValue -> Bool)
-> Eq RegExpLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RegExpLocalValue -> RegExpLocalValue -> Bool
== :: RegExpLocalValue -> RegExpLocalValue -> Bool
$c/= :: RegExpLocalValue -> RegExpLocalValue -> Bool
/= :: RegExpLocalValue -> RegExpLocalValue -> Bool
Eq, (forall x. RegExpLocalValue -> Rep RegExpLocalValue x)
-> (forall x. Rep RegExpLocalValue x -> RegExpLocalValue)
-> Generic RegExpLocalValue
forall x. Rep RegExpLocalValue x -> RegExpLocalValue
forall x. RegExpLocalValue -> Rep RegExpLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RegExpLocalValue -> Rep RegExpLocalValue x
from :: forall x. RegExpLocalValue -> Rep RegExpLocalValue x
$cto :: forall x. Rep RegExpLocalValue x -> RegExpLocalValue
to :: forall x. Rep RegExpLocalValue x -> RegExpLocalValue
Generic)
data SetLocalValue = MkSetLocalValue
{ SetLocalValue -> Text
typ :: Text,
SetLocalValue -> ListLocalValue
value :: ListLocalValue
}
deriving (Int -> SetLocalValue -> ShowS
[SetLocalValue] -> ShowS
SetLocalValue -> String
(Int -> SetLocalValue -> ShowS)
-> (SetLocalValue -> String)
-> ([SetLocalValue] -> ShowS)
-> Show SetLocalValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetLocalValue -> ShowS
showsPrec :: Int -> SetLocalValue -> ShowS
$cshow :: SetLocalValue -> String
show :: SetLocalValue -> String
$cshowList :: [SetLocalValue] -> ShowS
showList :: [SetLocalValue] -> ShowS
Show, SetLocalValue -> SetLocalValue -> Bool
(SetLocalValue -> SetLocalValue -> Bool)
-> (SetLocalValue -> SetLocalValue -> Bool) -> Eq SetLocalValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetLocalValue -> SetLocalValue -> Bool
== :: SetLocalValue -> SetLocalValue -> Bool
$c/= :: SetLocalValue -> SetLocalValue -> Bool
/= :: SetLocalValue -> SetLocalValue -> Bool
Eq, (forall x. SetLocalValue -> Rep SetLocalValue x)
-> (forall x. Rep SetLocalValue x -> SetLocalValue)
-> Generic SetLocalValue
forall x. Rep SetLocalValue x -> SetLocalValue
forall x. SetLocalValue -> Rep SetLocalValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SetLocalValue -> Rep SetLocalValue x
from :: forall x. SetLocalValue -> Rep SetLocalValue x
$cto :: forall x. Rep SetLocalValue x -> SetLocalValue
to :: forall x. Rep SetLocalValue x -> SetLocalValue
Generic)
data ResultOwnership = Root | OwnershipNone deriving (Int -> ResultOwnership -> ShowS
[ResultOwnership] -> ShowS
ResultOwnership -> String
(Int -> ResultOwnership -> ShowS)
-> (ResultOwnership -> String)
-> ([ResultOwnership] -> ShowS)
-> Show ResultOwnership
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ResultOwnership -> ShowS
showsPrec :: Int -> ResultOwnership -> ShowS
$cshow :: ResultOwnership -> String
show :: ResultOwnership -> String
$cshowList :: [ResultOwnership] -> ShowS
showList :: [ResultOwnership] -> ShowS
Show, ResultOwnership -> ResultOwnership -> Bool
(ResultOwnership -> ResultOwnership -> Bool)
-> (ResultOwnership -> ResultOwnership -> Bool)
-> Eq ResultOwnership
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ResultOwnership -> ResultOwnership -> Bool
== :: ResultOwnership -> ResultOwnership -> Bool
$c/= :: ResultOwnership -> ResultOwnership -> Bool
/= :: ResultOwnership -> ResultOwnership -> Bool
Eq, (forall x. ResultOwnership -> Rep ResultOwnership x)
-> (forall x. Rep ResultOwnership x -> ResultOwnership)
-> Generic ResultOwnership
forall x. Rep ResultOwnership x -> ResultOwnership
forall x. ResultOwnership -> Rep ResultOwnership x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ResultOwnership -> Rep ResultOwnership x
from :: forall x. ResultOwnership -> Rep ResultOwnership x
$cto :: forall x. Rep ResultOwnership x -> ResultOwnership
to :: forall x. Rep ResultOwnership x -> ResultOwnership
Generic)
instance FromJSON ResultOwnership where
parseJSON :: Value -> Parser ResultOwnership
parseJSON :: Value -> Parser ResultOwnership
parseJSON = String
-> (Object -> Parser ResultOwnership)
-> Value
-> Parser ResultOwnership
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"ResultOwnership" ((Object -> Parser ResultOwnership)
-> Value -> Parser ResultOwnership)
-> (Object -> Parser ResultOwnership)
-> Value
-> Parser ResultOwnership
forall a b. (a -> b) -> a -> b
$ \Object
obj -> do
typ <- Object
obj Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type"
case typ of
Text
"root" -> ResultOwnership -> Parser ResultOwnership
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ResultOwnership
Root
Text
"none" -> ResultOwnership -> Parser ResultOwnership
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ResultOwnership
OwnershipNone
Text
_ -> String -> Parser ResultOwnership
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser ResultOwnership)
-> String -> Parser ResultOwnership
forall a b. (a -> b) -> a -> b
$ String
"Unknown ResultOwnership type: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
unpack Text
typ
instance ToJSON ResultOwnership where
toJSON :: ResultOwnership -> Value
toJSON :: ResultOwnership -> Value
toJSON = \case
ResultOwnership
Root -> Value
"root"
ResultOwnership
OwnershipNone -> Value
"none"
data RealmType
= WindowRealm
| DedicatedWorkerRealm
| SharedWorkerRealm
| ServiceWorkerRealm
| WorkerRealm
| PaintWorkletRealm
| AudioWorkletRealm
| WorkletRealm
deriving (Int -> RealmType -> ShowS
[RealmType] -> ShowS
RealmType -> String
(Int -> RealmType -> ShowS)
-> (RealmType -> String)
-> ([RealmType] -> ShowS)
-> Show RealmType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RealmType -> ShowS
showsPrec :: Int -> RealmType -> ShowS
$cshow :: RealmType -> String
show :: RealmType -> String
$cshowList :: [RealmType] -> ShowS
showList :: [RealmType] -> ShowS
Show, RealmType -> RealmType -> Bool
(RealmType -> RealmType -> Bool)
-> (RealmType -> RealmType -> Bool) -> Eq RealmType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RealmType -> RealmType -> Bool
== :: RealmType -> RealmType -> Bool
$c/= :: RealmType -> RealmType -> Bool
/= :: RealmType -> RealmType -> Bool
Eq, (forall x. RealmType -> Rep RealmType x)
-> (forall x. Rep RealmType x -> RealmType) -> Generic RealmType
forall x. Rep RealmType x -> RealmType
forall x. RealmType -> Rep RealmType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RealmType -> Rep RealmType x
from :: forall x. RealmType -> Rep RealmType x
$cto :: forall x. Rep RealmType x -> RealmType
to :: forall x. Rep RealmType x -> RealmType
Generic)
instance FromJSON RealmType
instance ToJSON RealmType where
toJSON :: RealmType -> Value
toJSON :: RealmType -> Value
toJSON = \case
RealmType
WindowRealm -> Value
"window"
RealmType
DedicatedWorkerRealm -> Value
"dedicated-worker"
RealmType
SharedWorkerRealm -> Value
"shared-worker"
RealmType
ServiceWorkerRealm -> Value
"service-worker"
RealmType
WorkerRealm -> Value
"worker"
RealmType
PaintWorkletRealm -> Value
"paint-worklet"
RealmType
AudioWorkletRealm -> Value
"audio-worklet"
RealmType
WorkletRealm -> Value
"worklet"
data SerializationOptions = MkSerializationOptions
{ SerializationOptions -> Maybe (Maybe JSUInt)
maxDomDepth :: Maybe (Maybe JSUInt),
SerializationOptions -> Maybe (Maybe JSUInt)
maxObjectDepth :: Maybe (Maybe JSUInt),
SerializationOptions -> Maybe IncludeShadowTree
includeShadowTree :: Maybe IncludeShadowTree
}
deriving (Int -> SerializationOptions -> ShowS
[SerializationOptions] -> ShowS
SerializationOptions -> String
(Int -> SerializationOptions -> ShowS)
-> (SerializationOptions -> String)
-> ([SerializationOptions] -> ShowS)
-> Show SerializationOptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SerializationOptions -> ShowS
showsPrec :: Int -> SerializationOptions -> ShowS
$cshow :: SerializationOptions -> String
show :: SerializationOptions -> String
$cshowList :: [SerializationOptions] -> ShowS
showList :: [SerializationOptions] -> ShowS
Show, SerializationOptions -> SerializationOptions -> Bool
(SerializationOptions -> SerializationOptions -> Bool)
-> (SerializationOptions -> SerializationOptions -> Bool)
-> Eq SerializationOptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SerializationOptions -> SerializationOptions -> Bool
== :: SerializationOptions -> SerializationOptions -> Bool
$c/= :: SerializationOptions -> SerializationOptions -> Bool
/= :: SerializationOptions -> SerializationOptions -> Bool
Eq, (forall x. SerializationOptions -> Rep SerializationOptions x)
-> (forall x. Rep SerializationOptions x -> SerializationOptions)
-> Generic SerializationOptions
forall x. Rep SerializationOptions x -> SerializationOptions
forall x. SerializationOptions -> Rep SerializationOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. SerializationOptions -> Rep SerializationOptions x
from :: forall x. SerializationOptions -> Rep SerializationOptions x
$cto :: forall x. Rep SerializationOptions x -> SerializationOptions
to :: forall x. Rep SerializationOptions x -> SerializationOptions
Generic)
instance ToJSON SerializationOptions where
toJSON :: SerializationOptions -> Value
toJSON :: SerializationOptions -> Value
toJSON = Options -> SerializationOptions -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions {omitNothingFields = True}
data IncludeShadowTree = ShadowTreeNone | Open | All deriving (Int -> IncludeShadowTree -> ShowS
[IncludeShadowTree] -> ShowS
IncludeShadowTree -> String
(Int -> IncludeShadowTree -> ShowS)
-> (IncludeShadowTree -> String)
-> ([IncludeShadowTree] -> ShowS)
-> Show IncludeShadowTree
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IncludeShadowTree -> ShowS
showsPrec :: Int -> IncludeShadowTree -> ShowS
$cshow :: IncludeShadowTree -> String
show :: IncludeShadowTree -> String
$cshowList :: [IncludeShadowTree] -> ShowS
showList :: [IncludeShadowTree] -> ShowS
Show, IncludeShadowTree -> IncludeShadowTree -> Bool
(IncludeShadowTree -> IncludeShadowTree -> Bool)
-> (IncludeShadowTree -> IncludeShadowTree -> Bool)
-> Eq IncludeShadowTree
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IncludeShadowTree -> IncludeShadowTree -> Bool
== :: IncludeShadowTree -> IncludeShadowTree -> Bool
$c/= :: IncludeShadowTree -> IncludeShadowTree -> Bool
/= :: IncludeShadowTree -> IncludeShadowTree -> Bool
Eq, (forall x. IncludeShadowTree -> Rep IncludeShadowTree x)
-> (forall x. Rep IncludeShadowTree x -> IncludeShadowTree)
-> Generic IncludeShadowTree
forall x. Rep IncludeShadowTree x -> IncludeShadowTree
forall x. IncludeShadowTree -> Rep IncludeShadowTree x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IncludeShadowTree -> Rep IncludeShadowTree x
from :: forall x. IncludeShadowTree -> Rep IncludeShadowTree x
$cto :: forall x. Rep IncludeShadowTree x -> IncludeShadowTree
to :: forall x. Rep IncludeShadowTree x -> IncludeShadowTree
Generic)
instance ToJSON IncludeShadowTree where
toJSON :: IncludeShadowTree -> Value
toJSON :: IncludeShadowTree -> Value
toJSON = \case
IncludeShadowTree
ShadowTreeNone -> Value
"none"
IncludeShadowTree
Open -> Value
"open"
IncludeShadowTree
All -> Value
"all"
data Disown = MkDisown
{ Disown -> [Handle]
handles :: [Handle],
Disown -> Target
target :: Target
}
deriving (Int -> Disown -> ShowS
[Disown] -> ShowS
Disown -> String
(Int -> Disown -> ShowS)
-> (Disown -> String) -> ([Disown] -> ShowS) -> Show Disown
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Disown -> ShowS
showsPrec :: Int -> Disown -> ShowS
$cshow :: Disown -> String
show :: Disown -> String
$cshowList :: [Disown] -> ShowS
showList :: [Disown] -> ShowS
Show, Disown -> Disown -> Bool
(Disown -> Disown -> Bool)
-> (Disown -> Disown -> Bool) -> Eq Disown
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Disown -> Disown -> Bool
== :: Disown -> Disown -> Bool
$c/= :: Disown -> Disown -> Bool
/= :: Disown -> Disown -> Bool
Eq, (forall x. Disown -> Rep Disown x)
-> (forall x. Rep Disown x -> Disown) -> Generic Disown
forall x. Rep Disown x -> Disown
forall x. Disown -> Rep Disown x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Disown -> Rep Disown x
from :: forall x. Disown -> Rep Disown x
$cto :: forall x. Rep Disown x -> Disown
to :: forall x. Rep Disown x -> Disown
Generic)
data Target
= RealmTarget Realm
| ContextTarget ContextTarget
deriving (Int -> Target -> ShowS
[Target] -> ShowS
Target -> String
(Int -> Target -> ShowS)
-> (Target -> String) -> ([Target] -> ShowS) -> Show Target
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Target -> ShowS
showsPrec :: Int -> Target -> ShowS
$cshow :: Target -> String
show :: Target -> String
$cshowList :: [Target] -> ShowS
showList :: [Target] -> ShowS
Show, Target -> Target -> Bool
(Target -> Target -> Bool)
-> (Target -> Target -> Bool) -> Eq Target
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Target -> Target -> Bool
== :: Target -> Target -> Bool
$c/= :: Target -> Target -> Bool
/= :: Target -> Target -> Bool
Eq, (forall x. Target -> Rep Target x)
-> (forall x. Rep Target x -> Target) -> Generic Target
forall x. Rep Target x -> Target
forall x. Target -> Rep Target x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Target -> Rep Target x
from :: forall x. Target -> Rep Target x
$cto :: forall x. Rep Target x -> Target
to :: forall x. Rep Target x -> Target
Generic)
newtype Realm = MkRealm {Realm -> Text
realm :: Text} deriving (Int -> Realm -> ShowS
[Realm] -> ShowS
Realm -> String
(Int -> Realm -> ShowS)
-> (Realm -> String) -> ([Realm] -> ShowS) -> Show Realm
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Realm -> ShowS
showsPrec :: Int -> Realm -> ShowS
$cshow :: Realm -> String
show :: Realm -> String
$cshowList :: [Realm] -> ShowS
showList :: [Realm] -> ShowS
Show, Realm -> Realm -> Bool
(Realm -> Realm -> Bool) -> (Realm -> Realm -> Bool) -> Eq Realm
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Realm -> Realm -> Bool
== :: Realm -> Realm -> Bool
$c/= :: Realm -> Realm -> Bool
/= :: Realm -> Realm -> Bool
Eq, (forall x. Realm -> Rep Realm x)
-> (forall x. Rep Realm x -> Realm) -> Generic Realm
forall x. Rep Realm x -> Realm
forall x. Realm -> Rep Realm x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Realm -> Rep Realm x
from :: forall x. Realm -> Rep Realm x
$cto :: forall x. Rep Realm x -> Realm
to :: forall x. Rep Realm x -> Realm
Generic, Maybe Realm
Value -> Parser [Realm]
Value -> Parser Realm
(Value -> Parser Realm)
-> (Value -> Parser [Realm]) -> Maybe Realm -> FromJSON Realm
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser Realm
parseJSON :: Value -> Parser Realm
$cparseJSONList :: Value -> Parser [Realm]
parseJSONList :: Value -> Parser [Realm]
$comittedField :: Maybe Realm
omittedField :: Maybe Realm
FromJSON)
data ContextTarget = MkContextTarget
{ ContextTarget -> BrowsingContext
context :: BrowsingContext,
ContextTarget -> Maybe Sandbox
sandbox :: Maybe Sandbox
}
deriving (Int -> ContextTarget -> ShowS
[ContextTarget] -> ShowS
ContextTarget -> String
(Int -> ContextTarget -> ShowS)
-> (ContextTarget -> String)
-> ([ContextTarget] -> ShowS)
-> Show ContextTarget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ContextTarget -> ShowS
showsPrec :: Int -> ContextTarget -> ShowS
$cshow :: ContextTarget -> String
show :: ContextTarget -> String
$cshowList :: [ContextTarget] -> ShowS
showList :: [ContextTarget] -> ShowS
Show, ContextTarget -> ContextTarget -> Bool
(ContextTarget -> ContextTarget -> Bool)
-> (ContextTarget -> ContextTarget -> Bool) -> Eq ContextTarget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ContextTarget -> ContextTarget -> Bool
== :: ContextTarget -> ContextTarget -> Bool
$c/= :: ContextTarget -> ContextTarget -> Bool
/= :: ContextTarget -> ContextTarget -> Bool
Eq, (forall x. ContextTarget -> Rep ContextTarget x)
-> (forall x. Rep ContextTarget x -> ContextTarget)
-> Generic ContextTarget
forall x. Rep ContextTarget x -> ContextTarget
forall x. ContextTarget -> Rep ContextTarget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ContextTarget -> Rep ContextTarget x
from :: forall x. ContextTarget -> Rep ContextTarget x
$cto :: forall x. Rep ContextTarget x -> ContextTarget
to :: forall x. Rep ContextTarget x -> ContextTarget
Generic)
instance FromJSON ContextTarget
instance ToJSON ContextTarget where
toJSON :: ContextTarget -> Value
toJSON :: ContextTarget -> Value
toJSON = Options -> ContextTarget -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions {omitNothingFields = True}
newtype Sandbox = MkSandbox Text
deriving (Int -> Sandbox -> ShowS
[Sandbox] -> ShowS
Sandbox -> String
(Int -> Sandbox -> ShowS)
-> (Sandbox -> String) -> ([Sandbox] -> ShowS) -> Show Sandbox
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Sandbox -> ShowS
showsPrec :: Int -> Sandbox -> ShowS
$cshow :: Sandbox -> String
show :: Sandbox -> String
$cshowList :: [Sandbox] -> ShowS
showList :: [Sandbox] -> ShowS
Show, Sandbox -> Sandbox -> Bool
(Sandbox -> Sandbox -> Bool)
-> (Sandbox -> Sandbox -> Bool) -> Eq Sandbox
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Sandbox -> Sandbox -> Bool
== :: Sandbox -> Sandbox -> Bool
$c/= :: Sandbox -> Sandbox -> Bool
/= :: Sandbox -> Sandbox -> Bool
Eq)
deriving newtype ([Sandbox] -> Value
[Sandbox] -> Encoding
Sandbox -> Bool
Sandbox -> Value
Sandbox -> Encoding
(Sandbox -> Value)
-> (Sandbox -> Encoding)
-> ([Sandbox] -> Value)
-> ([Sandbox] -> Encoding)
-> (Sandbox -> Bool)
-> ToJSON Sandbox
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: Sandbox -> Value
toJSON :: Sandbox -> Value
$ctoEncoding :: Sandbox -> Encoding
toEncoding :: Sandbox -> Encoding
$ctoJSONList :: [Sandbox] -> Value
toJSONList :: [Sandbox] -> Value
$ctoEncodingList :: [Sandbox] -> Encoding
toEncodingList :: [Sandbox] -> Encoding
$comitField :: Sandbox -> Bool
omitField :: Sandbox -> Bool
ToJSON, Maybe Sandbox
Value -> Parser [Sandbox]
Value -> Parser Sandbox
(Value -> Parser Sandbox)
-> (Value -> Parser [Sandbox]) -> Maybe Sandbox -> FromJSON Sandbox
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser Sandbox
parseJSON :: Value -> Parser Sandbox
$cparseJSONList :: Value -> Parser [Sandbox]
parseJSONList :: Value -> Parser [Sandbox]
$comittedField :: Maybe Sandbox
omittedField :: Maybe Sandbox
FromJSON)
instance ToJSON Realm
instance ToJSON Target where
toJSON :: Target -> Value
toJSON :: Target -> Value
toJSON = \case
RealmTarget Realm
r -> Realm -> Value
forall a. ToJSON a => a -> Value
toJSON Realm
r
ContextTarget ContextTarget
ct -> ContextTarget -> Value
forall a. ToJSON a => a -> Value
toJSON ContextTarget
ct
data Evaluate = MkEvaluate
{ Evaluate -> Text
expression :: Text,
Evaluate -> Target
target :: Target,
Evaluate -> Bool
awaitPromise :: Bool,
Evaluate -> Maybe ResultOwnership
resultOwnership :: Maybe ResultOwnership,
Evaluate -> Maybe SerializationOptions
serializationOptions :: Maybe SerializationOptions
}
deriving (Int -> Evaluate -> ShowS
[Evaluate] -> ShowS
Evaluate -> String
(Int -> Evaluate -> ShowS)
-> (Evaluate -> String) -> ([Evaluate] -> ShowS) -> Show Evaluate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Evaluate -> ShowS
showsPrec :: Int -> Evaluate -> ShowS
$cshow :: Evaluate -> String
show :: Evaluate -> String
$cshowList :: [Evaluate] -> ShowS
showList :: [Evaluate] -> ShowS
Show, Evaluate -> Evaluate -> Bool
(Evaluate -> Evaluate -> Bool)
-> (Evaluate -> Evaluate -> Bool) -> Eq Evaluate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Evaluate -> Evaluate -> Bool
== :: Evaluate -> Evaluate -> Bool
$c/= :: Evaluate -> Evaluate -> Bool
/= :: Evaluate -> Evaluate -> Bool
Eq, (forall x. Evaluate -> Rep Evaluate x)
-> (forall x. Rep Evaluate x -> Evaluate) -> Generic Evaluate
forall x. Rep Evaluate x -> Evaluate
forall x. Evaluate -> Rep Evaluate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Evaluate -> Rep Evaluate x
from :: forall x. Evaluate -> Rep Evaluate x
$cto :: forall x. Rep Evaluate x -> Evaluate
to :: forall x. Rep Evaluate x -> Evaluate
Generic)
instance ToJSON Evaluate where
toJSON :: Evaluate -> Value
toJSON :: Evaluate -> Value
toJSON = Options -> Evaluate -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions {omitNothingFields = True}
data GetRealms = MkGetRealms
{ GetRealms -> Maybe BrowsingContext
context :: Maybe BrowsingContext,
GetRealms -> Maybe RealmType
realmType :: Maybe RealmType
}
deriving (Int -> GetRealms -> ShowS
[GetRealms] -> ShowS
GetRealms -> String
(Int -> GetRealms -> ShowS)
-> (GetRealms -> String)
-> ([GetRealms] -> ShowS)
-> Show GetRealms
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetRealms -> ShowS
showsPrec :: Int -> GetRealms -> ShowS
$cshow :: GetRealms -> String
show :: GetRealms -> String
$cshowList :: [GetRealms] -> ShowS
showList :: [GetRealms] -> ShowS
Show, GetRealms -> GetRealms -> Bool
(GetRealms -> GetRealms -> Bool)
-> (GetRealms -> GetRealms -> Bool) -> Eq GetRealms
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetRealms -> GetRealms -> Bool
== :: GetRealms -> GetRealms -> Bool
$c/= :: GetRealms -> GetRealms -> Bool
/= :: GetRealms -> GetRealms -> Bool
Eq, (forall x. GetRealms -> Rep GetRealms x)
-> (forall x. Rep GetRealms x -> GetRealms) -> Generic GetRealms
forall x. Rep GetRealms x -> GetRealms
forall x. GetRealms -> Rep GetRealms x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. GetRealms -> Rep GetRealms x
from :: forall x. GetRealms -> Rep GetRealms x
$cto :: forall x. Rep GetRealms x -> GetRealms
to :: forall x. Rep GetRealms x -> GetRealms
Generic)
newtype RemovePreloadScript = MkRemovePreloadScript
{ RemovePreloadScript -> PreloadScript
script :: PreloadScript
}
deriving (Int -> RemovePreloadScript -> ShowS
[RemovePreloadScript] -> ShowS
RemovePreloadScript -> String
(Int -> RemovePreloadScript -> ShowS)
-> (RemovePreloadScript -> String)
-> ([RemovePreloadScript] -> ShowS)
-> Show RemovePreloadScript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RemovePreloadScript -> ShowS
showsPrec :: Int -> RemovePreloadScript -> ShowS
$cshow :: RemovePreloadScript -> String
show :: RemovePreloadScript -> String
$cshowList :: [RemovePreloadScript] -> ShowS
showList :: [RemovePreloadScript] -> ShowS
Show, RemovePreloadScript -> RemovePreloadScript -> Bool
(RemovePreloadScript -> RemovePreloadScript -> Bool)
-> (RemovePreloadScript -> RemovePreloadScript -> Bool)
-> Eq RemovePreloadScript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RemovePreloadScript -> RemovePreloadScript -> Bool
== :: RemovePreloadScript -> RemovePreloadScript -> Bool
$c/= :: RemovePreloadScript -> RemovePreloadScript -> Bool
/= :: RemovePreloadScript -> RemovePreloadScript -> Bool
Eq, (forall x. RemovePreloadScript -> Rep RemovePreloadScript x)
-> (forall x. Rep RemovePreloadScript x -> RemovePreloadScript)
-> Generic RemovePreloadScript
forall x. Rep RemovePreloadScript x -> RemovePreloadScript
forall x. RemovePreloadScript -> Rep RemovePreloadScript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RemovePreloadScript -> Rep RemovePreloadScript x
from :: forall x. RemovePreloadScript -> Rep RemovePreloadScript x
$cto :: forall x. Rep RemovePreloadScript x -> RemovePreloadScript
to :: forall x. Rep RemovePreloadScript x -> RemovePreloadScript
Generic)
newtype PreloadScript = MkPreloadScript Text deriving (Int -> PreloadScript -> ShowS
[PreloadScript] -> ShowS
PreloadScript -> String
(Int -> PreloadScript -> ShowS)
-> (PreloadScript -> String)
-> ([PreloadScript] -> ShowS)
-> Show PreloadScript
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PreloadScript -> ShowS
showsPrec :: Int -> PreloadScript -> ShowS
$cshow :: PreloadScript -> String
show :: PreloadScript -> String
$cshowList :: [PreloadScript] -> ShowS
showList :: [PreloadScript] -> ShowS
Show, (forall x. PreloadScript -> Rep PreloadScript x)
-> (forall x. Rep PreloadScript x -> PreloadScript)
-> Generic PreloadScript
forall x. Rep PreloadScript x -> PreloadScript
forall x. PreloadScript -> Rep PreloadScript x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PreloadScript -> Rep PreloadScript x
from :: forall x. PreloadScript -> Rep PreloadScript x
$cto :: forall x. Rep PreloadScript x -> PreloadScript
to :: forall x. Rep PreloadScript x -> PreloadScript
Generic, PreloadScript -> PreloadScript -> Bool
(PreloadScript -> PreloadScript -> Bool)
-> (PreloadScript -> PreloadScript -> Bool) -> Eq PreloadScript
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PreloadScript -> PreloadScript -> Bool
== :: PreloadScript -> PreloadScript -> Bool
$c/= :: PreloadScript -> PreloadScript -> Bool
/= :: PreloadScript -> PreloadScript -> Bool
Eq)
instance FromJSON PreloadScript
instance ToJSON PreloadScript
newtype AddPreloadScriptResult = MkAddPreloadScriptResult
{ AddPreloadScriptResult -> PreloadScript
script :: PreloadScript
}
deriving (Int -> AddPreloadScriptResult -> ShowS
[AddPreloadScriptResult] -> ShowS
AddPreloadScriptResult -> String
(Int -> AddPreloadScriptResult -> ShowS)
-> (AddPreloadScriptResult -> String)
-> ([AddPreloadScriptResult] -> ShowS)
-> Show AddPreloadScriptResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddPreloadScriptResult -> ShowS
showsPrec :: Int -> AddPreloadScriptResult -> ShowS
$cshow :: AddPreloadScriptResult -> String
show :: AddPreloadScriptResult -> String
$cshowList :: [AddPreloadScriptResult] -> ShowS
showList :: [AddPreloadScriptResult] -> ShowS
Show, AddPreloadScriptResult -> AddPreloadScriptResult -> Bool
(AddPreloadScriptResult -> AddPreloadScriptResult -> Bool)
-> (AddPreloadScriptResult -> AddPreloadScriptResult -> Bool)
-> Eq AddPreloadScriptResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddPreloadScriptResult -> AddPreloadScriptResult -> Bool
== :: AddPreloadScriptResult -> AddPreloadScriptResult -> Bool
$c/= :: AddPreloadScriptResult -> AddPreloadScriptResult -> Bool
/= :: AddPreloadScriptResult -> AddPreloadScriptResult -> Bool
Eq, (forall x. AddPreloadScriptResult -> Rep AddPreloadScriptResult x)
-> (forall x.
Rep AddPreloadScriptResult x -> AddPreloadScriptResult)
-> Generic AddPreloadScriptResult
forall x. Rep AddPreloadScriptResult x -> AddPreloadScriptResult
forall x. AddPreloadScriptResult -> Rep AddPreloadScriptResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. AddPreloadScriptResult -> Rep AddPreloadScriptResult x
from :: forall x. AddPreloadScriptResult -> Rep AddPreloadScriptResult x
$cto :: forall x. Rep AddPreloadScriptResult x -> AddPreloadScriptResult
to :: forall x. Rep AddPreloadScriptResult x -> AddPreloadScriptResult
Generic)
newtype GetRealmsResult = MkGetRealmsResult
{ GetRealmsResult -> [RealmInfo]
realms :: [RealmInfo]
}
deriving (Int -> GetRealmsResult -> ShowS
[GetRealmsResult] -> ShowS
GetRealmsResult -> String
(Int -> GetRealmsResult -> ShowS)
-> (GetRealmsResult -> String)
-> ([GetRealmsResult] -> ShowS)
-> Show GetRealmsResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetRealmsResult -> ShowS
showsPrec :: Int -> GetRealmsResult -> ShowS
$cshow :: GetRealmsResult -> String
show :: GetRealmsResult -> String
$cshowList :: [GetRealmsResult] -> ShowS
showList :: [GetRealmsResult] -> ShowS
Show, GetRealmsResult -> GetRealmsResult -> Bool
(GetRealmsResult -> GetRealmsResult -> Bool)
-> (GetRealmsResult -> GetRealmsResult -> Bool)
-> Eq GetRealmsResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetRealmsResult -> GetRealmsResult -> Bool
== :: GetRealmsResult -> GetRealmsResult -> Bool
$c/= :: GetRealmsResult -> GetRealmsResult -> Bool
/= :: GetRealmsResult -> GetRealmsResult -> Bool
Eq, (forall x. GetRealmsResult -> Rep GetRealmsResult x)
-> (forall x. Rep GetRealmsResult x -> GetRealmsResult)
-> Generic GetRealmsResult
forall x. Rep GetRealmsResult x -> GetRealmsResult
forall x. GetRealmsResult -> Rep GetRealmsResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. GetRealmsResult -> Rep GetRealmsResult x
from :: forall x. GetRealmsResult -> Rep GetRealmsResult x
$cto :: forall x. Rep GetRealmsResult x -> GetRealmsResult
to :: forall x. Rep GetRealmsResult x -> GetRealmsResult
Generic)
data RealmInfo
= WindowRealmInfo
{ RealmInfo -> BaseRealmInfo
base :: BaseRealmInfo,
RealmInfo -> BrowsingContext
context :: BrowsingContext,
RealmInfo -> Maybe Text
sandbox :: Maybe Text
}
| DedicatedWorker {base :: BaseRealmInfo, RealmInfo -> [Realm]
owners :: [Realm]}
| SharedWorker {base :: BaseRealmInfo}
| ServiceWorker {base :: BaseRealmInfo}
| Worker {base :: BaseRealmInfo}
| PaintWorklet {base :: BaseRealmInfo}
| AudioWorklet {base :: BaseRealmInfo}
| Worklet {base :: BaseRealmInfo}
deriving (Int -> RealmInfo -> ShowS
[RealmInfo] -> ShowS
RealmInfo -> String
(Int -> RealmInfo -> ShowS)
-> (RealmInfo -> String)
-> ([RealmInfo] -> ShowS)
-> Show RealmInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RealmInfo -> ShowS
showsPrec :: Int -> RealmInfo -> ShowS
$cshow :: RealmInfo -> String
show :: RealmInfo -> String
$cshowList :: [RealmInfo] -> ShowS
showList :: [RealmInfo] -> ShowS
Show, RealmInfo -> RealmInfo -> Bool
(RealmInfo -> RealmInfo -> Bool)
-> (RealmInfo -> RealmInfo -> Bool) -> Eq RealmInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RealmInfo -> RealmInfo -> Bool
== :: RealmInfo -> RealmInfo -> Bool
$c/= :: RealmInfo -> RealmInfo -> Bool
/= :: RealmInfo -> RealmInfo -> Bool
Eq, (forall x. RealmInfo -> Rep RealmInfo x)
-> (forall x. Rep RealmInfo x -> RealmInfo) -> Generic RealmInfo
forall x. Rep RealmInfo x -> RealmInfo
forall x. RealmInfo -> Rep RealmInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RealmInfo -> Rep RealmInfo x
from :: forall x. RealmInfo -> Rep RealmInfo x
$cto :: forall x. Rep RealmInfo x -> RealmInfo
to :: forall x. Rep RealmInfo x -> RealmInfo
Generic)
instance FromJSON RealmInfo where
parseJSON :: Value -> Parser RealmInfo
parseJSON :: Value -> Parser RealmInfo
parseJSON = String -> (Object -> Parser RealmInfo) -> Value -> Parser RealmInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"RealmInfo" ((Object -> Parser RealmInfo) -> Value -> Parser RealmInfo)
-> (Object -> Parser RealmInfo) -> Value -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
typ <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type"
base <- BaseRealmInfo <$> o .: "realm" <*> o .: "origin"
case typ of
Text
"window" -> do
context <- Object
o Object -> Key -> Parser BrowsingContext
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"context"
sandbox <- o .:? "sandbox"
pure $ WindowRealmInfo {base, context, sandbox}
Text
"dedicated-worker" -> do
owners <- Object
o Object -> Key -> Parser [Realm]
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"owners"
pure $ DedicatedWorker {base, owners}
Text
"shared-worker" -> RealmInfo -> Parser RealmInfo
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RealmInfo -> Parser RealmInfo) -> RealmInfo -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ SharedWorker {BaseRealmInfo
base :: BaseRealmInfo
base :: BaseRealmInfo
base}
Text
"service-worker" -> RealmInfo -> Parser RealmInfo
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RealmInfo -> Parser RealmInfo) -> RealmInfo -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ ServiceWorker {BaseRealmInfo
base :: BaseRealmInfo
base :: BaseRealmInfo
base}
Text
"worker" -> RealmInfo -> Parser RealmInfo
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RealmInfo -> Parser RealmInfo) -> RealmInfo -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ Worker {BaseRealmInfo
base :: BaseRealmInfo
base :: BaseRealmInfo
base}
Text
"paint-worklet" -> RealmInfo -> Parser RealmInfo
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RealmInfo -> Parser RealmInfo) -> RealmInfo -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ PaintWorklet {BaseRealmInfo
base :: BaseRealmInfo
base :: BaseRealmInfo
base}
Text
"audio-worklet" -> RealmInfo -> Parser RealmInfo
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RealmInfo -> Parser RealmInfo) -> RealmInfo -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ AudioWorklet {BaseRealmInfo
base :: BaseRealmInfo
base :: BaseRealmInfo
base}
Text
"worklet" -> RealmInfo -> Parser RealmInfo
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (RealmInfo -> Parser RealmInfo) -> RealmInfo -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ Worklet {BaseRealmInfo
base :: BaseRealmInfo
base :: BaseRealmInfo
base}
Text
_ -> String -> Parser RealmInfo
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser RealmInfo) -> String -> Parser RealmInfo
forall a b. (a -> b) -> a -> b
$ String
"Unknown RealmInfo type: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
unpack Text
typ
data BaseRealmInfo = BaseRealmInfo
{ BaseRealmInfo -> Realm
realm :: Realm,
BaseRealmInfo -> Text
origin :: Text
}
deriving (Int -> BaseRealmInfo -> ShowS
[BaseRealmInfo] -> ShowS
BaseRealmInfo -> String
(Int -> BaseRealmInfo -> ShowS)
-> (BaseRealmInfo -> String)
-> ([BaseRealmInfo] -> ShowS)
-> Show BaseRealmInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BaseRealmInfo -> ShowS
showsPrec :: Int -> BaseRealmInfo -> ShowS
$cshow :: BaseRealmInfo -> String
show :: BaseRealmInfo -> String
$cshowList :: [BaseRealmInfo] -> ShowS
showList :: [BaseRealmInfo] -> ShowS
Show, BaseRealmInfo -> BaseRealmInfo -> Bool
(BaseRealmInfo -> BaseRealmInfo -> Bool)
-> (BaseRealmInfo -> BaseRealmInfo -> Bool) -> Eq BaseRealmInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BaseRealmInfo -> BaseRealmInfo -> Bool
== :: BaseRealmInfo -> BaseRealmInfo -> Bool
$c/= :: BaseRealmInfo -> BaseRealmInfo -> Bool
/= :: BaseRealmInfo -> BaseRealmInfo -> Bool
Eq, (forall x. BaseRealmInfo -> Rep BaseRealmInfo x)
-> (forall x. Rep BaseRealmInfo x -> BaseRealmInfo)
-> Generic BaseRealmInfo
forall x. Rep BaseRealmInfo x -> BaseRealmInfo
forall x. BaseRealmInfo -> Rep BaseRealmInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. BaseRealmInfo -> Rep BaseRealmInfo x
from :: forall x. BaseRealmInfo -> Rep BaseRealmInfo x
$cto :: forall x. Rep BaseRealmInfo x -> BaseRealmInfo
to :: forall x. Rep BaseRealmInfo x -> BaseRealmInfo
Generic)
data EvaluateResult
= EvaluateResultSuccess
{ EvaluateResult -> RemoteValue
result :: RemoteValue,
EvaluateResult -> Realm
realm :: Realm
}
| EvaluateResultException
{ EvaluateResult -> ExceptionDetails
exceptionDetails :: ExceptionDetails,
realm :: Realm
}
deriving (Int -> EvaluateResult -> ShowS
[EvaluateResult] -> ShowS
EvaluateResult -> String
(Int -> EvaluateResult -> ShowS)
-> (EvaluateResult -> String)
-> ([EvaluateResult] -> ShowS)
-> Show EvaluateResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EvaluateResult -> ShowS
showsPrec :: Int -> EvaluateResult -> ShowS
$cshow :: EvaluateResult -> String
show :: EvaluateResult -> String
$cshowList :: [EvaluateResult] -> ShowS
showList :: [EvaluateResult] -> ShowS
Show, EvaluateResult -> EvaluateResult -> Bool
(EvaluateResult -> EvaluateResult -> Bool)
-> (EvaluateResult -> EvaluateResult -> Bool) -> Eq EvaluateResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EvaluateResult -> EvaluateResult -> Bool
== :: EvaluateResult -> EvaluateResult -> Bool
$c/= :: EvaluateResult -> EvaluateResult -> Bool
/= :: EvaluateResult -> EvaluateResult -> Bool
Eq, (forall x. EvaluateResult -> Rep EvaluateResult x)
-> (forall x. Rep EvaluateResult x -> EvaluateResult)
-> Generic EvaluateResult
forall x. Rep EvaluateResult x -> EvaluateResult
forall x. EvaluateResult -> Rep EvaluateResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. EvaluateResult -> Rep EvaluateResult x
from :: forall x. EvaluateResult -> Rep EvaluateResult x
$cto :: forall x. Rep EvaluateResult x -> EvaluateResult
to :: forall x. Rep EvaluateResult x -> EvaluateResult
Generic)
instance FromJSON EvaluateResult where
parseJSON :: Value -> Parser EvaluateResult
parseJSON :: Value -> Parser EvaluateResult
parseJSON = String
-> (Object -> Parser EvaluateResult)
-> Value
-> Parser EvaluateResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"EvaluateResult" ((Object -> Parser EvaluateResult)
-> Value -> Parser EvaluateResult)
-> (Object -> Parser EvaluateResult)
-> Value
-> Parser EvaluateResult
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
typ <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type"
case typ of
Text
"success" -> do
result <- Object
o Object -> Key -> Parser RemoteValue
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"result"
realm <- o .: "realm"
pure $ EvaluateResultSuccess {result, realm}
Text
"exception" -> do
exceptionDetails <- Object
o Object -> Key -> Parser ExceptionDetails
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"exceptionDetails"
realm <- o .: "realm"
pure $ EvaluateResultException {exceptionDetails, realm}
Text
_ -> String -> Parser EvaluateResult
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser EvaluateResult)
-> String -> Parser EvaluateResult
forall a b. (a -> b) -> a -> b
$ String
"Unknown EvaluateResult type: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
unpack Text
typ
data ExceptionDetails = MkExceptionDetails
{ ExceptionDetails -> JSUInt
columnNumber :: JSUInt,
ExceptionDetails -> RemoteValue
exception :: RemoteValue,
ExceptionDetails -> JSUInt
lineNumber :: JSUInt,
ExceptionDetails -> StackTrace
stackTrace :: StackTrace,
ExceptionDetails -> Text
text :: Text
}
deriving (Int -> ExceptionDetails -> ShowS
[ExceptionDetails] -> ShowS
ExceptionDetails -> String
(Int -> ExceptionDetails -> ShowS)
-> (ExceptionDetails -> String)
-> ([ExceptionDetails] -> ShowS)
-> Show ExceptionDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ExceptionDetails -> ShowS
showsPrec :: Int -> ExceptionDetails -> ShowS
$cshow :: ExceptionDetails -> String
show :: ExceptionDetails -> String
$cshowList :: [ExceptionDetails] -> ShowS
showList :: [ExceptionDetails] -> ShowS
Show, ExceptionDetails -> ExceptionDetails -> Bool
(ExceptionDetails -> ExceptionDetails -> Bool)
-> (ExceptionDetails -> ExceptionDetails -> Bool)
-> Eq ExceptionDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ExceptionDetails -> ExceptionDetails -> Bool
== :: ExceptionDetails -> ExceptionDetails -> Bool
$c/= :: ExceptionDetails -> ExceptionDetails -> Bool
/= :: ExceptionDetails -> ExceptionDetails -> Bool
Eq, (forall x. ExceptionDetails -> Rep ExceptionDetails x)
-> (forall x. Rep ExceptionDetails x -> ExceptionDetails)
-> Generic ExceptionDetails
forall x. Rep ExceptionDetails x -> ExceptionDetails
forall x. ExceptionDetails -> Rep ExceptionDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ExceptionDetails -> Rep ExceptionDetails x
from :: forall x. ExceptionDetails -> Rep ExceptionDetails x
$cto :: forall x. Rep ExceptionDetails x -> ExceptionDetails
to :: forall x. Rep ExceptionDetails x -> ExceptionDetails
Generic)
data StackTrace = MkStackTrace
{ StackTrace -> [StackFrame]
callFrames :: [StackFrame]
}
deriving (Int -> StackTrace -> ShowS
[StackTrace] -> ShowS
StackTrace -> String
(Int -> StackTrace -> ShowS)
-> (StackTrace -> String)
-> ([StackTrace] -> ShowS)
-> Show StackTrace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StackTrace -> ShowS
showsPrec :: Int -> StackTrace -> ShowS
$cshow :: StackTrace -> String
show :: StackTrace -> String
$cshowList :: [StackTrace] -> ShowS
showList :: [StackTrace] -> ShowS
Show, StackTrace -> StackTrace -> Bool
(StackTrace -> StackTrace -> Bool)
-> (StackTrace -> StackTrace -> Bool) -> Eq StackTrace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StackTrace -> StackTrace -> Bool
== :: StackTrace -> StackTrace -> Bool
$c/= :: StackTrace -> StackTrace -> Bool
/= :: StackTrace -> StackTrace -> Bool
Eq, (forall x. StackTrace -> Rep StackTrace x)
-> (forall x. Rep StackTrace x -> StackTrace) -> Generic StackTrace
forall x. Rep StackTrace x -> StackTrace
forall x. StackTrace -> Rep StackTrace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StackTrace -> Rep StackTrace x
from :: forall x. StackTrace -> Rep StackTrace x
$cto :: forall x. Rep StackTrace x -> StackTrace
to :: forall x. Rep StackTrace x -> StackTrace
Generic)
data StackFrame = StackFrame
{ StackFrame -> JSUInt
columnNumber :: JSUInt,
StackFrame -> Text
functionName :: Text,
StackFrame -> JSUInt
lineNumber :: JSUInt,
StackFrame -> Text
url :: Text
}
deriving (Int -> StackFrame -> ShowS
[StackFrame] -> ShowS
StackFrame -> String
(Int -> StackFrame -> ShowS)
-> (StackFrame -> String)
-> ([StackFrame] -> ShowS)
-> Show StackFrame
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StackFrame -> ShowS
showsPrec :: Int -> StackFrame -> ShowS
$cshow :: StackFrame -> String
show :: StackFrame -> String
$cshowList :: [StackFrame] -> ShowS
showList :: [StackFrame] -> ShowS
Show, StackFrame -> StackFrame -> Bool
(StackFrame -> StackFrame -> Bool)
-> (StackFrame -> StackFrame -> Bool) -> Eq StackFrame
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StackFrame -> StackFrame -> Bool
== :: StackFrame -> StackFrame -> Bool
$c/= :: StackFrame -> StackFrame -> Bool
/= :: StackFrame -> StackFrame -> Bool
Eq, (forall x. StackFrame -> Rep StackFrame x)
-> (forall x. Rep StackFrame x -> StackFrame) -> Generic StackFrame
forall x. Rep StackFrame x -> StackFrame
forall x. StackFrame -> Rep StackFrame x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StackFrame -> Rep StackFrame x
from :: forall x. StackFrame -> Rep StackFrame x
$cto :: forall x. Rep StackFrame x -> StackFrame
to :: forall x. Rep StackFrame x -> StackFrame
Generic)
data ScriptEvent
= MessageEvent Message
| RealmCreatedEvent RealmInfo
| RealmDestroyed RealmDestroyed
deriving (Int -> ScriptEvent -> ShowS
[ScriptEvent] -> ShowS
ScriptEvent -> String
(Int -> ScriptEvent -> ShowS)
-> (ScriptEvent -> String)
-> ([ScriptEvent] -> ShowS)
-> Show ScriptEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ScriptEvent -> ShowS
showsPrec :: Int -> ScriptEvent -> ShowS
$cshow :: ScriptEvent -> String
show :: ScriptEvent -> String
$cshowList :: [ScriptEvent] -> ShowS
showList :: [ScriptEvent] -> ShowS
Show, ScriptEvent -> ScriptEvent -> Bool
(ScriptEvent -> ScriptEvent -> Bool)
-> (ScriptEvent -> ScriptEvent -> Bool) -> Eq ScriptEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ScriptEvent -> ScriptEvent -> Bool
== :: ScriptEvent -> ScriptEvent -> Bool
$c/= :: ScriptEvent -> ScriptEvent -> Bool
/= :: ScriptEvent -> ScriptEvent -> Bool
Eq, (forall x. ScriptEvent -> Rep ScriptEvent x)
-> (forall x. Rep ScriptEvent x -> ScriptEvent)
-> Generic ScriptEvent
forall x. Rep ScriptEvent x -> ScriptEvent
forall x. ScriptEvent -> Rep ScriptEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ScriptEvent -> Rep ScriptEvent x
from :: forall x. ScriptEvent -> Rep ScriptEvent x
$cto :: forall x. Rep ScriptEvent x -> ScriptEvent
to :: forall x. Rep ScriptEvent x -> ScriptEvent
Generic)
instance FromJSON ScriptEvent where
parseJSON :: Value -> Parser ScriptEvent
parseJSON :: Value -> Parser ScriptEvent
parseJSON = String
-> (Object -> Parser ScriptEvent) -> Value -> Parser ScriptEvent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"ScriptEvent" ((Object -> Parser ScriptEvent) -> Value -> Parser ScriptEvent)
-> (Object -> Parser ScriptEvent) -> Value -> Parser ScriptEvent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
typ <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"method"
case typ of
Text
"script.message" -> do
params <- Object
o Object -> Key -> Parser Message
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"params"
pure $ MessageEvent params
Text
"script.realmCreated" -> do
params <- Object
o Object -> Key -> Parser Value
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"params"
realmInfo <- parseJSON params
pure $ RealmCreatedEvent realmInfo
Text
"script.realmDestroyed" -> do
params <- Object
o Object -> Key -> Parser Object
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"params"
realmid <- params .: "realm"
pure . RealmDestroyed $ MkRealmDestroyed realmid
Text
_ -> String -> Parser ScriptEvent
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail (String -> Parser ScriptEvent) -> String -> Parser ScriptEvent
forall a b. (a -> b) -> a -> b
$ String
"Unknown ScriptEvent method: " String -> ShowS
forall a. Semigroup a => a -> a -> a
<> Text -> String
unpack Text
typ
data Message = MkMessage
{ Message -> Channel
channel :: Channel,
Message -> RemoteValue
messageData :: RemoteValue,
Message -> Source
source :: Source
}
deriving (Int -> Message -> ShowS
[Message] -> ShowS
Message -> String
(Int -> Message -> ShowS)
-> (Message -> String) -> ([Message] -> ShowS) -> Show Message
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Message -> ShowS
showsPrec :: Int -> Message -> ShowS
$cshow :: Message -> String
show :: Message -> String
$cshowList :: [Message] -> ShowS
showList :: [Message] -> ShowS
Show, Message -> Message -> Bool
(Message -> Message -> Bool)
-> (Message -> Message -> Bool) -> Eq Message
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Message -> Message -> Bool
== :: Message -> Message -> Bool
$c/= :: Message -> Message -> Bool
/= :: Message -> Message -> Bool
Eq, (forall x. Message -> Rep Message x)
-> (forall x. Rep Message x -> Message) -> Generic Message
forall x. Rep Message x -> Message
forall x. Message -> Rep Message x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Message -> Rep Message x
from :: forall x. Message -> Rep Message x
$cto :: forall x. Rep Message x -> Message
to :: forall x. Rep Message x -> Message
Generic)
instance FromJSON Message where
parseJSON :: Value -> Parser Message
parseJSON :: Value -> Parser Message
parseJSON = String -> (Object -> Parser Message) -> Value -> Parser Message
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"Message" ((Object -> Parser Message) -> Value -> Parser Message)
-> (Object -> Parser Message) -> Value -> Parser Message
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
channel <- Object
o Object -> Key -> Parser Channel
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"channel"
messageData <- o .: "data"
source <- o .: "source"
pure $ MkMessage {channel, messageData, source}
newtype Channel = Channel {Channel -> Text
channelId :: Text}
deriving newtype
( Int -> Channel -> ShowS
[Channel] -> ShowS
Channel -> String
(Int -> Channel -> ShowS)
-> (Channel -> String) -> ([Channel] -> ShowS) -> Show Channel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Channel -> ShowS
showsPrec :: Int -> Channel -> ShowS
$cshow :: Channel -> String
show :: Channel -> String
$cshowList :: [Channel] -> ShowS
showList :: [Channel] -> ShowS
Show,
Channel -> Channel -> Bool
(Channel -> Channel -> Bool)
-> (Channel -> Channel -> Bool) -> Eq Channel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Channel -> Channel -> Bool
== :: Channel -> Channel -> Bool
$c/= :: Channel -> Channel -> Bool
/= :: Channel -> Channel -> Bool
Eq,
[Channel] -> Value
[Channel] -> Encoding
Channel -> Bool
Channel -> Value
Channel -> Encoding
(Channel -> Value)
-> (Channel -> Encoding)
-> ([Channel] -> Value)
-> ([Channel] -> Encoding)
-> (Channel -> Bool)
-> ToJSON Channel
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: Channel -> Value
toJSON :: Channel -> Value
$ctoEncoding :: Channel -> Encoding
toEncoding :: Channel -> Encoding
$ctoJSONList :: [Channel] -> Value
toJSONList :: [Channel] -> Value
$ctoEncodingList :: [Channel] -> Encoding
toEncodingList :: [Channel] -> Encoding
$comitField :: Channel -> Bool
omitField :: Channel -> Bool
ToJSON,
Maybe Channel
Value -> Parser [Channel]
Value -> Parser Channel
(Value -> Parser Channel)
-> (Value -> Parser [Channel]) -> Maybe Channel -> FromJSON Channel
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser Channel
parseJSON :: Value -> Parser Channel
$cparseJSONList :: Value -> Parser [Channel]
parseJSONList :: Value -> Parser [Channel]
$comittedField :: Maybe Channel
omittedField :: Maybe Channel
FromJSON
)
data Source = MkSource
{ Source -> Realm
realm :: Realm,
Source -> Maybe BrowsingContext
context :: Maybe BrowsingContext
}
deriving (Int -> Source -> ShowS
[Source] -> ShowS
Source -> String
(Int -> Source -> ShowS)
-> (Source -> String) -> ([Source] -> ShowS) -> Show Source
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Source -> ShowS
showsPrec :: Int -> Source -> ShowS
$cshow :: Source -> String
show :: Source -> String
$cshowList :: [Source] -> ShowS
showList :: [Source] -> ShowS
Show, Source -> Source -> Bool
(Source -> Source -> Bool)
-> (Source -> Source -> Bool) -> Eq Source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Source -> Source -> Bool
== :: Source -> Source -> Bool
$c/= :: Source -> Source -> Bool
/= :: Source -> Source -> Bool
Eq, (forall x. Source -> Rep Source x)
-> (forall x. Rep Source x -> Source) -> Generic Source
forall x. Rep Source x -> Source
forall x. Source -> Rep Source x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Source -> Rep Source x
from :: forall x. Source -> Rep Source x
$cto :: forall x. Rep Source x -> Source
to :: forall x. Rep Source x -> Source
Generic)
instance FromJSON Source where
parseJSON :: Value -> Parser Source
parseJSON :: Value -> Parser Source
parseJSON = Value -> Parser Source
forall a. (Generic a, GFromJSON Zero (Rep a)) => Value -> Parser a
parseJSONOmitNothing
newtype ChannelValue = MkChannelValue
{ ChannelValue -> ChannelProperties
value :: ChannelProperties
}
deriving (Int -> ChannelValue -> ShowS
[ChannelValue] -> ShowS
ChannelValue -> String
(Int -> ChannelValue -> ShowS)
-> (ChannelValue -> String)
-> ([ChannelValue] -> ShowS)
-> Show ChannelValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChannelValue -> ShowS
showsPrec :: Int -> ChannelValue -> ShowS
$cshow :: ChannelValue -> String
show :: ChannelValue -> String
$cshowList :: [ChannelValue] -> ShowS
showList :: [ChannelValue] -> ShowS
Show, ChannelValue -> ChannelValue -> Bool
(ChannelValue -> ChannelValue -> Bool)
-> (ChannelValue -> ChannelValue -> Bool) -> Eq ChannelValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChannelValue -> ChannelValue -> Bool
== :: ChannelValue -> ChannelValue -> Bool
$c/= :: ChannelValue -> ChannelValue -> Bool
/= :: ChannelValue -> ChannelValue -> Bool
Eq, (forall x. ChannelValue -> Rep ChannelValue x)
-> (forall x. Rep ChannelValue x -> ChannelValue)
-> Generic ChannelValue
forall x. Rep ChannelValue x -> ChannelValue
forall x. ChannelValue -> Rep ChannelValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChannelValue -> Rep ChannelValue x
from :: forall x. ChannelValue -> Rep ChannelValue x
$cto :: forall x. Rep ChannelValue x -> ChannelValue
to :: forall x. Rep ChannelValue x -> ChannelValue
Generic)
data ChannelProperties = MkChannelProperties
{ ChannelProperties -> Channel
channel :: Channel,
ChannelProperties -> Maybe SerializationOptions
serializationOptions :: Maybe SerializationOptions,
ChannelProperties -> Maybe ResultOwnership
ownership :: Maybe ResultOwnership
}
deriving (Int -> ChannelProperties -> ShowS
[ChannelProperties] -> ShowS
ChannelProperties -> String
(Int -> ChannelProperties -> ShowS)
-> (ChannelProperties -> String)
-> ([ChannelProperties] -> ShowS)
-> Show ChannelProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChannelProperties -> ShowS
showsPrec :: Int -> ChannelProperties -> ShowS
$cshow :: ChannelProperties -> String
show :: ChannelProperties -> String
$cshowList :: [ChannelProperties] -> ShowS
showList :: [ChannelProperties] -> ShowS
Show, ChannelProperties -> ChannelProperties -> Bool
(ChannelProperties -> ChannelProperties -> Bool)
-> (ChannelProperties -> ChannelProperties -> Bool)
-> Eq ChannelProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChannelProperties -> ChannelProperties -> Bool
== :: ChannelProperties -> ChannelProperties -> Bool
$c/= :: ChannelProperties -> ChannelProperties -> Bool
/= :: ChannelProperties -> ChannelProperties -> Bool
Eq, (forall x. ChannelProperties -> Rep ChannelProperties x)
-> (forall x. Rep ChannelProperties x -> ChannelProperties)
-> Generic ChannelProperties
forall x. Rep ChannelProperties x -> ChannelProperties
forall x. ChannelProperties -> Rep ChannelProperties x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ChannelProperties -> Rep ChannelProperties x
from :: forall x. ChannelProperties -> Rep ChannelProperties x
$cto :: forall x. Rep ChannelProperties x -> ChannelProperties
to :: forall x. Rep ChannelProperties x -> ChannelProperties
Generic)
instance ToJSON AddPreloadScript where
toJSON :: AddPreloadScript -> Value
toJSON :: AddPreloadScript -> Value
toJSON = AddPreloadScript -> Value
forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
toJSONOmitNothing
instance ToJSON CallFunction where
toJSON :: CallFunction -> Value
toJSON :: CallFunction -> Value
toJSON = CallFunction -> Value
forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
toJSONOmitNothing
instance ToJSON GetRealms where
toJSON :: GetRealms -> Value
toJSON :: GetRealms -> Value
toJSON MkGetRealms {Maybe BrowsingContext
context :: GetRealms -> Maybe BrowsingContext
context :: Maybe BrowsingContext
context, Maybe RealmType
realmType :: GetRealms -> Maybe RealmType
realmType :: Maybe RealmType
realmType} =
[Pair] -> Value
object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ Key -> Maybe BrowsingContext -> Maybe Pair
forall (f :: * -> *) e b a.
(Functor f, KeyValue e b, ToJSON a) =>
Key -> f a -> f b
opt Key
"context" Maybe BrowsingContext
context,
Key -> Maybe RealmType -> Maybe Pair
forall (f :: * -> *) e b a.
(Functor f, KeyValue e b, ToJSON a) =>
Key -> f a -> f b
opt Key
"type" Maybe RealmType
realmType
]
instance ToJSON Disown
instance ToJSON RemovePreloadScript
instance ToJSON PrimitiveProtocolValue where
toJSON :: PrimitiveProtocolValue -> Value
toJSON :: PrimitiveProtocolValue -> Value
toJSON = \case
PrimitiveProtocolValue
UndefinedValue -> [Pair] -> Value
object [Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"undefined"]
PrimitiveProtocolValue
NullValue -> [Pair] -> Value
object [Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"null"]
StringValue StringValue
str ->
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"string",
Key
"value" Key -> StringValue -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= StringValue
str
]
NumberValue (Left Double
num) ->
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"number",
Key
"value" Key -> Double -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Double
num
]
NumberValue (Right SpecialNumber
special) ->
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"number",
Key
"value" Key -> SpecialNumber -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= SpecialNumber
special
]
BooleanValue Bool
bool ->
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"boolean",
Key
"value" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Bool
bool
]
BigIntValue Text
str ->
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"bigint",
Key
"value" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
str
]
instance ToJSON LocalValue where
toJSON :: LocalValue -> Value
toJSON :: LocalValue -> Value
toJSON = \case
RemoteReference RemoteReference
ref -> RemoteReference -> Value
forall a. ToJSON a => a -> Value
toJSON RemoteReference
ref
PrimitiveLocalValue PrimitiveProtocolValue
prim -> PrimitiveProtocolValue -> Value
forall a. ToJSON a => a -> Value
toJSON PrimitiveProtocolValue
prim
ChannelValue ChannelValue
channel -> ChannelValue -> Value
forall a. ToJSON a => a -> Value
toJSON ChannelValue
channel
ArrayLocalValue ArrayLocalValue
arr -> ArrayLocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON ArrayLocalValue
arr
DateLocalValue DateLocalValue
date -> DateLocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON DateLocalValue
date
MapLocalValue MapLocalValue
mapVal -> MapLocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON MapLocalValue
mapVal
ObjectLocalValue ObjectLocalValue
obj -> ObjectLocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON ObjectLocalValue
obj
RegExpLocalValue RegExpLocalValue
regex -> RegExpLocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON RegExpLocalValue
regex
SetLocalValue SetLocalValue
set -> SetLocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON SetLocalValue
set
instance ToJSON RemoteReference
instance ToJSON SharedReference where
toJSON :: SharedReference -> Value
toJSON :: SharedReference -> Value
toJSON = SharedReference -> Value
forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
toJSONOmitNothing
instance ToJSON RemoteObjectReference
instance ToJSON ListLocalValue
instance ToJSON ArrayLocalValue where
toJSON :: ArrayLocalValue -> Value
toJSON (MkArrayLocalValue Text
_ ListLocalValue
value) =
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"array",
Key
"value" Key -> ListLocalValue -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ListLocalValue
value
]
instance ToJSON DateLocalValue where
toJSON :: DateLocalValue -> Value
toJSON (MkDateLocalValue Text
value) =
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"date",
Key
"value" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
value
]
instance ToJSON MappingLocalValue where
toJSON :: MappingLocalValue -> Value
toJSON :: MappingLocalValue -> Value
toJSON (MkMappingLocalValue [(Either LocalValue Text, LocalValue)]
pairs) =
[[Value]] -> Value
forall a. ToJSON a => a -> Value
toJSON ([[Value]] -> Value) -> [[Value]] -> Value
forall a b. (a -> b) -> a -> b
$ (Either LocalValue Text, LocalValue) -> [Value]
pairToArray ((Either LocalValue Text, LocalValue) -> [Value])
-> [(Either LocalValue Text, LocalValue)] -> [[Value]]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Either LocalValue Text, LocalValue)]
pairs
where
pairToArray :: (Either LocalValue Text, LocalValue) -> [Value]
pairToArray :: (Either LocalValue Text, LocalValue) -> [Value]
pairToArray (Either LocalValue Text
key, LocalValue
value) = [Either LocalValue Text -> Value
keyToJson Either LocalValue Text
key, LocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON LocalValue
value]
keyToJson :: Either LocalValue Text -> Value
keyToJson :: Either LocalValue Text -> Value
keyToJson (Left LocalValue
localVal) = LocalValue -> Value
forall a. ToJSON a => a -> Value
toJSON LocalValue
localVal
keyToJson (Right Text
text) = Text -> Value
forall a. ToJSON a => a -> Value
toJSON Text
text
instance ToJSON MapLocalValue where
toJSON :: MapLocalValue -> Value
toJSON :: MapLocalValue -> Value
toJSON (MkMapLocalValue MappingLocalValue
value) =
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"map",
Key
"value" Key -> MappingLocalValue -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= MappingLocalValue
value
]
instance ToJSON ObjectLocalValue where
toJSON :: ObjectLocalValue -> Value
toJSON :: ObjectLocalValue -> Value
toJSON (MkObjectLocalValue MappingLocalValue
value) =
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"object",
Key
"value" Key -> MappingLocalValue -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= MappingLocalValue
value
]
instance ToJSON RegExpValue
instance ToJSON RegExpLocalValue where
toJSON :: RegExpLocalValue -> Value
toJSON (MkRegExpLocalValue RegExpValue
value) =
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"regexp",
Key
"value" Key -> RegExpValue -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= RegExpValue
value
]
instance ToJSON SetLocalValue where
toJSON :: SetLocalValue -> Value
toJSON (MkSetLocalValue Text
_ ListLocalValue
value) =
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"set",
Key
"value" Key -> ListLocalValue -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ListLocalValue
value
]
instance ToJSON ChannelValue where
toJSON :: ChannelValue -> Value
toJSON :: ChannelValue -> Value
toJSON (MkChannelValue ChannelProperties
value) =
[Pair] -> Value
object
[ Key
"type" Key -> String -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= String
"channel",
Key
"value" Key -> ChannelProperties -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= ChannelProperties
value
]
instance ToJSON ChannelProperties where
toJSON :: ChannelProperties -> Value
toJSON :: ChannelProperties -> Value
toJSON = ChannelProperties -> Value
forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
toJSONOmitNothing
instance FromJSON PrimitiveProtocolValue
instance FromJSON AddPreloadScriptResult
instance FromJSON GetRealmsResult
instance FromJSON BaseRealmInfo
instance FromJSON ExceptionDetails
instance FromJSON StackTrace
instance FromJSON StackFrame
newtype RealmDestroyed = MkRealmDestroyed {RealmDestroyed -> Realm
realm :: Realm} deriving (Int -> RealmDestroyed -> ShowS
[RealmDestroyed] -> ShowS
RealmDestroyed -> String
(Int -> RealmDestroyed -> ShowS)
-> (RealmDestroyed -> String)
-> ([RealmDestroyed] -> ShowS)
-> Show RealmDestroyed
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RealmDestroyed -> ShowS
showsPrec :: Int -> RealmDestroyed -> ShowS
$cshow :: RealmDestroyed -> String
show :: RealmDestroyed -> String
$cshowList :: [RealmDestroyed] -> ShowS
showList :: [RealmDestroyed] -> ShowS
Show, RealmDestroyed -> RealmDestroyed -> Bool
(RealmDestroyed -> RealmDestroyed -> Bool)
-> (RealmDestroyed -> RealmDestroyed -> Bool) -> Eq RealmDestroyed
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RealmDestroyed -> RealmDestroyed -> Bool
== :: RealmDestroyed -> RealmDestroyed -> Bool
$c/= :: RealmDestroyed -> RealmDestroyed -> Bool
/= :: RealmDestroyed -> RealmDestroyed -> Bool
Eq, (forall x. RealmDestroyed -> Rep RealmDestroyed x)
-> (forall x. Rep RealmDestroyed x -> RealmDestroyed)
-> Generic RealmDestroyed
forall x. Rep RealmDestroyed x -> RealmDestroyed
forall x. RealmDestroyed -> Rep RealmDestroyed x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RealmDestroyed -> Rep RealmDestroyed x
from :: forall x. RealmDestroyed -> Rep RealmDestroyed x
$cto :: forall x. Rep RealmDestroyed x -> RealmDestroyed
to :: forall x. Rep RealmDestroyed x -> RealmDestroyed
Generic)
instance FromJSON RealmDestroyed