module TD.Query.TestCallString
(TestCallString(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified Data.Text as T
data TestCallString
= TestCallString
{ TestCallString -> Maybe Text
x :: Maybe T.Text
}
deriving (TestCallString -> TestCallString -> Bool
(TestCallString -> TestCallString -> Bool)
-> (TestCallString -> TestCallString -> Bool) -> Eq TestCallString
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TestCallString -> TestCallString -> Bool
== :: TestCallString -> TestCallString -> Bool
$c/= :: TestCallString -> TestCallString -> Bool
/= :: TestCallString -> TestCallString -> Bool
Eq, Int -> TestCallString -> ShowS
[TestCallString] -> ShowS
TestCallString -> String
(Int -> TestCallString -> ShowS)
-> (TestCallString -> String)
-> ([TestCallString] -> ShowS)
-> Show TestCallString
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TestCallString -> ShowS
showsPrec :: Int -> TestCallString -> ShowS
$cshow :: TestCallString -> String
show :: TestCallString -> String
$cshowList :: [TestCallString] -> ShowS
showList :: [TestCallString] -> ShowS
Show)
instance I.ShortShow TestCallString where
shortShow :: TestCallString -> String
shortShow
TestCallString
{ x :: TestCallString -> Maybe Text
x = Maybe Text
x_
}
= String
"TestCallString"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"x" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
x_
]
instance AT.ToJSON TestCallString where
toJSON :: TestCallString -> Value
toJSON
TestCallString
{ x :: TestCallString -> Maybe Text
x = Maybe Text
x_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"testCallString"
, Key
"x" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
x_
]