module TD.Query.SendBotStartMessage
(SendBotStartMessage(..)
, defaultSendBotStartMessage
) 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 SendBotStartMessage
= SendBotStartMessage
{ SendBotStartMessage -> Maybe Int
bot_user_id :: Maybe Int
, SendBotStartMessage -> Maybe Int
chat_id :: Maybe Int
, SendBotStartMessage -> Maybe Text
parameter :: Maybe T.Text
}
deriving (SendBotStartMessage -> SendBotStartMessage -> Bool
(SendBotStartMessage -> SendBotStartMessage -> Bool)
-> (SendBotStartMessage -> SendBotStartMessage -> Bool)
-> Eq SendBotStartMessage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendBotStartMessage -> SendBotStartMessage -> Bool
== :: SendBotStartMessage -> SendBotStartMessage -> Bool
$c/= :: SendBotStartMessage -> SendBotStartMessage -> Bool
/= :: SendBotStartMessage -> SendBotStartMessage -> Bool
Eq, Int -> SendBotStartMessage -> ShowS
[SendBotStartMessage] -> ShowS
SendBotStartMessage -> String
(Int -> SendBotStartMessage -> ShowS)
-> (SendBotStartMessage -> String)
-> ([SendBotStartMessage] -> ShowS)
-> Show SendBotStartMessage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SendBotStartMessage -> ShowS
showsPrec :: Int -> SendBotStartMessage -> ShowS
$cshow :: SendBotStartMessage -> String
show :: SendBotStartMessage -> String
$cshowList :: [SendBotStartMessage] -> ShowS
showList :: [SendBotStartMessage] -> ShowS
Show)
instance I.ShortShow SendBotStartMessage where
shortShow :: SendBotStartMessage -> String
shortShow
SendBotStartMessage
{ bot_user_id :: SendBotStartMessage -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, chat_id :: SendBotStartMessage -> Maybe Int
chat_id = Maybe Int
chat_id_
, parameter :: SendBotStartMessage -> Maybe Text
parameter = Maybe Text
parameter_
}
= String
"SendBotStartMessage"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
bot_user_id_
, String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"parameter" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
parameter_
]
instance AT.ToJSON SendBotStartMessage where
toJSON :: SendBotStartMessage -> Value
toJSON
SendBotStartMessage
{ bot_user_id :: SendBotStartMessage -> Maybe Int
bot_user_id = Maybe Int
bot_user_id_
, chat_id :: SendBotStartMessage -> Maybe Int
chat_id = Maybe Int
chat_id_
, parameter :: SendBotStartMessage -> Maybe Text
parameter = Maybe Text
parameter_
}
= [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
"sendBotStartMessage"
, Key
"bot_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
bot_user_id_
, 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
"parameter" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
parameter_
]
defaultSendBotStartMessage :: SendBotStartMessage
defaultSendBotStartMessage :: SendBotStartMessage
defaultSendBotStartMessage =
SendBotStartMessage
{ bot_user_id :: Maybe Int
bot_user_id = Maybe Int
forall a. Maybe a
Nothing
, chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, parameter :: Maybe Text
parameter = Maybe Text
forall a. Maybe a
Nothing
}