module TD.Query.EnableProxy
(EnableProxy(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data EnableProxy
= EnableProxy
{ EnableProxy -> Maybe Int
proxy_id :: Maybe Int
}
deriving (EnableProxy -> EnableProxy -> Bool
(EnableProxy -> EnableProxy -> Bool)
-> (EnableProxy -> EnableProxy -> Bool) -> Eq EnableProxy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EnableProxy -> EnableProxy -> Bool
== :: EnableProxy -> EnableProxy -> Bool
$c/= :: EnableProxy -> EnableProxy -> Bool
/= :: EnableProxy -> EnableProxy -> Bool
Eq, Int -> EnableProxy -> ShowS
[EnableProxy] -> ShowS
EnableProxy -> String
(Int -> EnableProxy -> ShowS)
-> (EnableProxy -> String)
-> ([EnableProxy] -> ShowS)
-> Show EnableProxy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EnableProxy -> ShowS
showsPrec :: Int -> EnableProxy -> ShowS
$cshow :: EnableProxy -> String
show :: EnableProxy -> String
$cshowList :: [EnableProxy] -> ShowS
showList :: [EnableProxy] -> ShowS
Show)
instance I.ShortShow EnableProxy where
shortShow :: EnableProxy -> String
shortShow
EnableProxy
{ proxy_id :: EnableProxy -> Maybe Int
proxy_id = Maybe Int
proxy_id_
}
= String
"EnableProxy"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"proxy_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
proxy_id_
]
instance AT.ToJSON EnableProxy where
toJSON :: EnableProxy -> Value
toJSON
EnableProxy
{ proxy_id :: EnableProxy -> Maybe Int
proxy_id = Maybe Int
proxy_id_
}
= [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
"enableProxy"
, Key
"proxy_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
proxy_id_
]