module TD.Query.EditBusinessMessageCaption
(EditBusinessMessageCaption(..)
, defaultEditBusinessMessageCaption
) 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
import qualified TD.Data.ReplyMarkup as ReplyMarkup
import qualified TD.Data.FormattedText as FormattedText
data EditBusinessMessageCaption
= EditBusinessMessageCaption
{ EditBusinessMessageCaption -> Maybe Text
business_connection_id :: Maybe T.Text
, EditBusinessMessageCaption -> Maybe Int
chat_id :: Maybe Int
, EditBusinessMessageCaption -> Maybe Int
message_id :: Maybe Int
, EditBusinessMessageCaption -> Maybe ReplyMarkup
reply_markup :: Maybe ReplyMarkup.ReplyMarkup
, EditBusinessMessageCaption -> Maybe FormattedText
caption :: Maybe FormattedText.FormattedText
, EditBusinessMessageCaption -> Maybe Bool
show_caption_above_media :: Maybe Bool
}
deriving (EditBusinessMessageCaption -> EditBusinessMessageCaption -> Bool
(EditBusinessMessageCaption -> EditBusinessMessageCaption -> Bool)
-> (EditBusinessMessageCaption
-> EditBusinessMessageCaption -> Bool)
-> Eq EditBusinessMessageCaption
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: EditBusinessMessageCaption -> EditBusinessMessageCaption -> Bool
== :: EditBusinessMessageCaption -> EditBusinessMessageCaption -> Bool
$c/= :: EditBusinessMessageCaption -> EditBusinessMessageCaption -> Bool
/= :: EditBusinessMessageCaption -> EditBusinessMessageCaption -> Bool
Eq, Int -> EditBusinessMessageCaption -> ShowS
[EditBusinessMessageCaption] -> ShowS
EditBusinessMessageCaption -> String
(Int -> EditBusinessMessageCaption -> ShowS)
-> (EditBusinessMessageCaption -> String)
-> ([EditBusinessMessageCaption] -> ShowS)
-> Show EditBusinessMessageCaption
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> EditBusinessMessageCaption -> ShowS
showsPrec :: Int -> EditBusinessMessageCaption -> ShowS
$cshow :: EditBusinessMessageCaption -> String
show :: EditBusinessMessageCaption -> String
$cshowList :: [EditBusinessMessageCaption] -> ShowS
showList :: [EditBusinessMessageCaption] -> ShowS
Show)
instance I.ShortShow EditBusinessMessageCaption where
shortShow :: EditBusinessMessageCaption -> String
shortShow
EditBusinessMessageCaption
{ business_connection_id :: EditBusinessMessageCaption -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, chat_id :: EditBusinessMessageCaption -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: EditBusinessMessageCaption -> Maybe Int
message_id = Maybe Int
message_id_
, reply_markup :: EditBusinessMessageCaption -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
, caption :: EditBusinessMessageCaption -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: EditBusinessMessageCaption -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
}
= String
"EditBusinessMessageCaption"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"business_connection_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
business_connection_id_
, 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
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
, String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
]
instance AT.ToJSON EditBusinessMessageCaption where
toJSON :: EditBusinessMessageCaption -> Value
toJSON
EditBusinessMessageCaption
{ business_connection_id :: EditBusinessMessageCaption -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
, chat_id :: EditBusinessMessageCaption -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: EditBusinessMessageCaption -> Maybe Int
message_id = Maybe Int
message_id_
, reply_markup :: EditBusinessMessageCaption -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
, caption :: EditBusinessMessageCaption -> Maybe FormattedText
caption = Maybe FormattedText
caption_
, show_caption_above_media :: EditBusinessMessageCaption -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
}
= [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
"editBusinessMessageCaption"
, Key
"business_connection_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
business_connection_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
"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
"caption" Key -> Maybe FormattedText -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe FormattedText
caption_
, Key
"show_caption_above_media" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
show_caption_above_media_
]
defaultEditBusinessMessageCaption :: EditBusinessMessageCaption
defaultEditBusinessMessageCaption :: EditBusinessMessageCaption
defaultEditBusinessMessageCaption =
EditBusinessMessageCaption
{ business_connection_id :: Maybe Text
business_connection_id = Maybe Text
forall a. Maybe a
Nothing
, 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
, caption :: Maybe FormattedText
caption = Maybe FormattedText
forall a. Maybe a
Nothing
, show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
forall a. Maybe a
Nothing
}