module TD.Query.SetMessageFactCheck
(SetMessageFactCheck(..)
, defaultSetMessageFactCheck
) 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.FormattedText as FormattedText
data SetMessageFactCheck
= SetMessageFactCheck
{ SetMessageFactCheck -> Maybe Int
chat_id :: Maybe Int
, SetMessageFactCheck -> Maybe Int
message_id :: Maybe Int
, SetMessageFactCheck -> Maybe FormattedText
text :: Maybe FormattedText.FormattedText
}
deriving (SetMessageFactCheck -> SetMessageFactCheck -> Bool
(SetMessageFactCheck -> SetMessageFactCheck -> Bool)
-> (SetMessageFactCheck -> SetMessageFactCheck -> Bool)
-> Eq SetMessageFactCheck
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetMessageFactCheck -> SetMessageFactCheck -> Bool
== :: SetMessageFactCheck -> SetMessageFactCheck -> Bool
$c/= :: SetMessageFactCheck -> SetMessageFactCheck -> Bool
/= :: SetMessageFactCheck -> SetMessageFactCheck -> Bool
Eq, Int -> SetMessageFactCheck -> ShowS
[SetMessageFactCheck] -> ShowS
SetMessageFactCheck -> String
(Int -> SetMessageFactCheck -> ShowS)
-> (SetMessageFactCheck -> String)
-> ([SetMessageFactCheck] -> ShowS)
-> Show SetMessageFactCheck
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetMessageFactCheck -> ShowS
showsPrec :: Int -> SetMessageFactCheck -> ShowS
$cshow :: SetMessageFactCheck -> String
show :: SetMessageFactCheck -> String
$cshowList :: [SetMessageFactCheck] -> ShowS
showList :: [SetMessageFactCheck] -> ShowS
Show)
instance I.ShortShow SetMessageFactCheck where
shortShow :: SetMessageFactCheck -> String
shortShow
SetMessageFactCheck
{ chat_id :: SetMessageFactCheck -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: SetMessageFactCheck -> Maybe Int
message_id = Maybe Int
message_id_
, text :: SetMessageFactCheck -> Maybe FormattedText
text = Maybe FormattedText
text_
}
= String
"SetMessageFactCheck"
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
"text" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
]
instance AT.ToJSON SetMessageFactCheck where
toJSON :: SetMessageFactCheck -> Value
toJSON
SetMessageFactCheck
{ chat_id :: SetMessageFactCheck -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: SetMessageFactCheck -> Maybe Int
message_id = Maybe Int
message_id_
, text :: SetMessageFactCheck -> Maybe FormattedText
text = Maybe FormattedText
text_
}
= [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
"setMessageFactCheck"
, 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
"text" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
text_
]
defaultSetMessageFactCheck :: SetMessageFactCheck
defaultSetMessageFactCheck :: SetMessageFactCheck
defaultSetMessageFactCheck =
SetMessageFactCheck
{ 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
, text :: Maybe FormattedText
text = Maybe FormattedText
forall a. Maybe a
Nothing
}