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