module TD.Query.GetInlineGameHighScores
(GetInlineGameHighScores(..)
, defaultGetInlineGameHighScores
) 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 GetInlineGameHighScores
= GetInlineGameHighScores
{ GetInlineGameHighScores -> Maybe Text
inline_message_id :: Maybe T.Text
, GetInlineGameHighScores -> Maybe Int
user_id :: Maybe Int
}
deriving (GetInlineGameHighScores -> GetInlineGameHighScores -> Bool
(GetInlineGameHighScores -> GetInlineGameHighScores -> Bool)
-> (GetInlineGameHighScores -> GetInlineGameHighScores -> Bool)
-> Eq GetInlineGameHighScores
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetInlineGameHighScores -> GetInlineGameHighScores -> Bool
== :: GetInlineGameHighScores -> GetInlineGameHighScores -> Bool
$c/= :: GetInlineGameHighScores -> GetInlineGameHighScores -> Bool
/= :: GetInlineGameHighScores -> GetInlineGameHighScores -> Bool
Eq, Int -> GetInlineGameHighScores -> ShowS
[GetInlineGameHighScores] -> ShowS
GetInlineGameHighScores -> String
(Int -> GetInlineGameHighScores -> ShowS)
-> (GetInlineGameHighScores -> String)
-> ([GetInlineGameHighScores] -> ShowS)
-> Show GetInlineGameHighScores
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetInlineGameHighScores -> ShowS
showsPrec :: Int -> GetInlineGameHighScores -> ShowS
$cshow :: GetInlineGameHighScores -> String
show :: GetInlineGameHighScores -> String
$cshowList :: [GetInlineGameHighScores] -> ShowS
showList :: [GetInlineGameHighScores] -> ShowS
Show)
instance I.ShortShow GetInlineGameHighScores where
shortShow :: GetInlineGameHighScores -> String
shortShow
GetInlineGameHighScores
{ inline_message_id :: GetInlineGameHighScores -> Maybe Text
inline_message_id = Maybe Text
inline_message_id_
, user_id :: GetInlineGameHighScores -> Maybe Int
user_id = Maybe Int
user_id_
}
= String
"GetInlineGameHighScores"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"inline_message_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
inline_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 GetInlineGameHighScores where
toJSON :: GetInlineGameHighScores -> Value
toJSON
GetInlineGameHighScores
{ inline_message_id :: GetInlineGameHighScores -> Maybe Text
inline_message_id = Maybe Text
inline_message_id_
, user_id :: GetInlineGameHighScores -> 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
"getInlineGameHighScores"
, Key
"inline_message_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
inline_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_
]
defaultGetInlineGameHighScores :: GetInlineGameHighScores
defaultGetInlineGameHighScores :: GetInlineGameHighScores
defaultGetInlineGameHighScores =
GetInlineGameHighScores
{ inline_message_id :: Maybe Text
inline_message_id = Maybe Text
forall a. Maybe a
Nothing
, user_id :: Maybe Int
user_id = Maybe Int
forall a. Maybe a
Nothing
}