module TD.Query.GetGameHighScores
(GetGameHighScores(..)
, defaultGetGameHighScores
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data GetGameHighScores
= GetGameHighScores
{ GetGameHighScores -> Maybe Int
chat_id :: Maybe Int
, GetGameHighScores -> Maybe Int
message_id :: Maybe Int
, GetGameHighScores -> Maybe Int
user_id :: Maybe Int
}
deriving (GetGameHighScores -> GetGameHighScores -> Bool
(GetGameHighScores -> GetGameHighScores -> Bool)
-> (GetGameHighScores -> GetGameHighScores -> Bool)
-> Eq GetGameHighScores
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetGameHighScores -> GetGameHighScores -> Bool
== :: GetGameHighScores -> GetGameHighScores -> Bool
$c/= :: GetGameHighScores -> GetGameHighScores -> Bool
/= :: GetGameHighScores -> GetGameHighScores -> Bool
Eq, Int -> GetGameHighScores -> ShowS
[GetGameHighScores] -> ShowS
GetGameHighScores -> String
(Int -> GetGameHighScores -> ShowS)
-> (GetGameHighScores -> String)
-> ([GetGameHighScores] -> ShowS)
-> Show GetGameHighScores
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetGameHighScores -> ShowS
showsPrec :: Int -> GetGameHighScores -> ShowS
$cshow :: GetGameHighScores -> String
show :: GetGameHighScores -> String
$cshowList :: [GetGameHighScores] -> ShowS
showList :: [GetGameHighScores] -> ShowS
Show)
instance I.ShortShow GetGameHighScores where
shortShow :: GetGameHighScores -> String
shortShow
GetGameHighScores
{ chat_id :: GetGameHighScores -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetGameHighScores -> Maybe Int
message_id = Maybe Int
message_id_
, user_id :: GetGameHighScores -> Maybe Int
user_id = Maybe Int
user_id_
}
= String
"GetGameHighScores"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
, String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
]
instance AT.ToJSON GetGameHighScores where
toJSON :: GetGameHighScores -> Value
toJSON
GetGameHighScores
{ chat_id :: GetGameHighScores -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: GetGameHighScores -> Maybe Int
message_id = Maybe Int
message_id_
, user_id :: GetGameHighScores -> Maybe Int
user_id = Maybe Int
user_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
"getGameHighScores"
, Key
"chat_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
chat_id_
, Key
"message_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
message_id_
, Key
"user_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
user_id_
]
defaultGetGameHighScores :: GetGameHighScores
defaultGetGameHighScores :: GetGameHighScores
defaultGetGameHighScores =
GetGameHighScores
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_id :: Maybe Int
message_id = Maybe Int
forall a. Maybe a
Nothing
, user_id :: Maybe Int
user_id = Maybe Int
forall a. Maybe a
Nothing
}