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