module TD.Query.AddNetworkStatistics
(AddNetworkStatistics(..)
) 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.NetworkStatisticsEntry as NetworkStatisticsEntry
data AddNetworkStatistics
= AddNetworkStatistics
{ AddNetworkStatistics -> Maybe NetworkStatisticsEntry
entry :: Maybe NetworkStatisticsEntry.NetworkStatisticsEntry
}
deriving (AddNetworkStatistics -> AddNetworkStatistics -> Bool
(AddNetworkStatistics -> AddNetworkStatistics -> Bool)
-> (AddNetworkStatistics -> AddNetworkStatistics -> Bool)
-> Eq AddNetworkStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AddNetworkStatistics -> AddNetworkStatistics -> Bool
== :: AddNetworkStatistics -> AddNetworkStatistics -> Bool
$c/= :: AddNetworkStatistics -> AddNetworkStatistics -> Bool
/= :: AddNetworkStatistics -> AddNetworkStatistics -> Bool
Eq, Int -> AddNetworkStatistics -> ShowS
[AddNetworkStatistics] -> ShowS
AddNetworkStatistics -> String
(Int -> AddNetworkStatistics -> ShowS)
-> (AddNetworkStatistics -> String)
-> ([AddNetworkStatistics] -> ShowS)
-> Show AddNetworkStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AddNetworkStatistics -> ShowS
showsPrec :: Int -> AddNetworkStatistics -> ShowS
$cshow :: AddNetworkStatistics -> String
show :: AddNetworkStatistics -> String
$cshowList :: [AddNetworkStatistics] -> ShowS
showList :: [AddNetworkStatistics] -> ShowS
Show)
instance I.ShortShow AddNetworkStatistics where
shortShow :: AddNetworkStatistics -> String
shortShow
AddNetworkStatistics
{ entry :: AddNetworkStatistics -> Maybe NetworkStatisticsEntry
entry = Maybe NetworkStatisticsEntry
entry_
}
= String
"AddNetworkStatistics"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"entry" String -> Maybe NetworkStatisticsEntry -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe NetworkStatisticsEntry
entry_
]
instance AT.ToJSON AddNetworkStatistics where
toJSON :: AddNetworkStatistics -> Value
toJSON
AddNetworkStatistics
{ entry :: AddNetworkStatistics -> Maybe NetworkStatisticsEntry
entry = Maybe NetworkStatisticsEntry
entry_
}
= [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
"addNetworkStatistics"
, Key
"entry" Key -> Maybe NetworkStatisticsEntry -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe NetworkStatisticsEntry
entry_
]