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