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