module TD.Query.SendMessageAlbum
(SendMessageAlbum(..)
, defaultSendMessageAlbum
) 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.InputMessageReplyTo as InputMessageReplyTo
import qualified TD.Data.MessageSendOptions as MessageSendOptions
import qualified TD.Data.InputMessageContent as InputMessageContent
data SendMessageAlbum
= SendMessageAlbum
{ SendMessageAlbum -> Maybe Int
chat_id :: Maybe Int
, SendMessageAlbum -> Maybe Int
message_thread_id :: Maybe Int
, SendMessageAlbum -> Maybe InputMessageReplyTo
reply_to :: Maybe InputMessageReplyTo.InputMessageReplyTo
, SendMessageAlbum -> Maybe MessageSendOptions
options :: Maybe MessageSendOptions.MessageSendOptions
, SendMessageAlbum -> Maybe [InputMessageContent]
input_message_contents :: Maybe [InputMessageContent.InputMessageContent]
}
deriving (SendMessageAlbum -> SendMessageAlbum -> Bool
(SendMessageAlbum -> SendMessageAlbum -> Bool)
-> (SendMessageAlbum -> SendMessageAlbum -> Bool)
-> Eq SendMessageAlbum
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SendMessageAlbum -> SendMessageAlbum -> Bool
== :: SendMessageAlbum -> SendMessageAlbum -> Bool
$c/= :: SendMessageAlbum -> SendMessageAlbum -> Bool
/= :: SendMessageAlbum -> SendMessageAlbum -> Bool
Eq, Int -> SendMessageAlbum -> ShowS
[SendMessageAlbum] -> ShowS
SendMessageAlbum -> String
(Int -> SendMessageAlbum -> ShowS)
-> (SendMessageAlbum -> String)
-> ([SendMessageAlbum] -> ShowS)
-> Show SendMessageAlbum
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SendMessageAlbum -> ShowS
showsPrec :: Int -> SendMessageAlbum -> ShowS
$cshow :: SendMessageAlbum -> String
show :: SendMessageAlbum -> String
$cshowList :: [SendMessageAlbum] -> ShowS
showList :: [SendMessageAlbum] -> ShowS
Show)
instance I.ShortShow SendMessageAlbum where
shortShow :: SendMessageAlbum -> String
shortShow
SendMessageAlbum
{ chat_id :: SendMessageAlbum -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_thread_id :: SendMessageAlbum -> Maybe Int
message_thread_id = Maybe Int
message_thread_id_
, reply_to :: SendMessageAlbum -> Maybe InputMessageReplyTo
reply_to = Maybe InputMessageReplyTo
reply_to_
, options :: SendMessageAlbum -> Maybe MessageSendOptions
options = Maybe MessageSendOptions
options_
, input_message_contents :: SendMessageAlbum -> Maybe [InputMessageContent]
input_message_contents = Maybe [InputMessageContent]
input_message_contents_
}
= String
"SendMessageAlbum"
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_thread_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_thread_id_
, String
"reply_to" String -> Maybe InputMessageReplyTo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe InputMessageReplyTo
reply_to_
, String
"options" String -> Maybe MessageSendOptions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSendOptions
options_
, String
"input_message_contents" String -> Maybe [InputMessageContent] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [InputMessageContent]
input_message_contents_
]
instance AT.ToJSON SendMessageAlbum where
toJSON :: SendMessageAlbum -> Value
toJSON
SendMessageAlbum
{ chat_id :: SendMessageAlbum -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_thread_id :: SendMessageAlbum -> Maybe Int
message_thread_id = Maybe Int
message_thread_id_
, reply_to :: SendMessageAlbum -> Maybe InputMessageReplyTo
reply_to = Maybe InputMessageReplyTo
reply_to_
, options :: SendMessageAlbum -> Maybe MessageSendOptions
options = Maybe MessageSendOptions
options_
, input_message_contents :: SendMessageAlbum -> Maybe [InputMessageContent]
input_message_contents = Maybe [InputMessageContent]
input_message_contents_
}
= [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
"sendMessageAlbum"
, 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_thread_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_thread_id_
, Key
"reply_to" Key -> Maybe InputMessageReplyTo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe InputMessageReplyTo
reply_to_
, Key
"options" Key -> Maybe MessageSendOptions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSendOptions
options_
, Key
"input_message_contents" 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_contents_
]
defaultSendMessageAlbum :: SendMessageAlbum
defaultSendMessageAlbum :: SendMessageAlbum
defaultSendMessageAlbum =
SendMessageAlbum
{ chat_id :: Maybe Int
chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_thread_id :: Maybe Int
message_thread_id = Maybe Int
forall a. Maybe a
Nothing
, reply_to :: Maybe InputMessageReplyTo
reply_to = Maybe InputMessageReplyTo
forall a. Maybe a
Nothing
, options :: Maybe MessageSendOptions
options = Maybe MessageSendOptions
forall a. Maybe a
Nothing
, input_message_contents :: Maybe [InputMessageContent]
input_message_contents = Maybe [InputMessageContent]
forall a. Maybe a
Nothing
}