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