module TD.Query.ForwardMessages
(ForwardMessages(..)
, defaultForwardMessages
) 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.MessageSendOptions as MessageSendOptions
data ForwardMessages
= ForwardMessages
{ ForwardMessages -> Maybe Int
chat_id :: Maybe Int
, ForwardMessages -> Maybe Int
message_thread_id :: Maybe Int
, ForwardMessages -> Maybe Int
from_chat_id :: Maybe Int
, ForwardMessages -> Maybe [Int]
message_ids :: Maybe [Int]
, ForwardMessages -> Maybe MessageSendOptions
options :: Maybe MessageSendOptions.MessageSendOptions
, ForwardMessages -> Maybe Bool
send_copy :: Maybe Bool
, ForwardMessages -> Maybe Bool
remove_caption :: Maybe Bool
}
deriving (ForwardMessages -> ForwardMessages -> Bool
(ForwardMessages -> ForwardMessages -> Bool)
-> (ForwardMessages -> ForwardMessages -> Bool)
-> Eq ForwardMessages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ForwardMessages -> ForwardMessages -> Bool
== :: ForwardMessages -> ForwardMessages -> Bool
$c/= :: ForwardMessages -> ForwardMessages -> Bool
/= :: ForwardMessages -> ForwardMessages -> Bool
Eq, Int -> ForwardMessages -> ShowS
[ForwardMessages] -> ShowS
ForwardMessages -> String
(Int -> ForwardMessages -> ShowS)
-> (ForwardMessages -> String)
-> ([ForwardMessages] -> ShowS)
-> Show ForwardMessages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ForwardMessages -> ShowS
showsPrec :: Int -> ForwardMessages -> ShowS
$cshow :: ForwardMessages -> String
show :: ForwardMessages -> String
$cshowList :: [ForwardMessages] -> ShowS
showList :: [ForwardMessages] -> ShowS
Show)
instance I.ShortShow ForwardMessages where
shortShow :: ForwardMessages -> String
shortShow
ForwardMessages
{ chat_id :: ForwardMessages -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_thread_id :: ForwardMessages -> Maybe Int
message_thread_id = Maybe Int
message_thread_id_
, from_chat_id :: ForwardMessages -> Maybe Int
from_chat_id = Maybe Int
from_chat_id_
, message_ids :: ForwardMessages -> Maybe [Int]
message_ids = Maybe [Int]
message_ids_
, options :: ForwardMessages -> Maybe MessageSendOptions
options = Maybe MessageSendOptions
options_
, send_copy :: ForwardMessages -> Maybe Bool
send_copy = Maybe Bool
send_copy_
, remove_caption :: ForwardMessages -> Maybe Bool
remove_caption = Maybe Bool
remove_caption_
}
= String
"ForwardMessages"
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
"from_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
from_chat_id_
, String
"message_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
message_ids_
, String
"options" String -> Maybe MessageSendOptions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSendOptions
options_
, String
"send_copy" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
send_copy_
, String
"remove_caption" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
remove_caption_
]
instance AT.ToJSON ForwardMessages where
toJSON :: ForwardMessages -> Value
toJSON
ForwardMessages
{ chat_id :: ForwardMessages -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_thread_id :: ForwardMessages -> Maybe Int
message_thread_id = Maybe Int
message_thread_id_
, from_chat_id :: ForwardMessages -> Maybe Int
from_chat_id = Maybe Int
from_chat_id_
, message_ids :: ForwardMessages -> Maybe [Int]
message_ids = Maybe [Int]
message_ids_
, options :: ForwardMessages -> Maybe MessageSendOptions
options = Maybe MessageSendOptions
options_
, send_copy :: ForwardMessages -> Maybe Bool
send_copy = Maybe Bool
send_copy_
, remove_caption :: ForwardMessages -> Maybe Bool
remove_caption = Maybe Bool
remove_caption_
}
= [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
"forwardMessages"
, 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
"from_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
from_chat_id_
, Key
"message_ids" 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_ids_
, 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
"send_copy" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
send_copy_
, Key
"remove_caption" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
remove_caption_
]
defaultForwardMessages :: ForwardMessages
defaultForwardMessages :: ForwardMessages
defaultForwardMessages =
ForwardMessages
{ 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
, from_chat_id :: Maybe Int
from_chat_id = Maybe Int
forall a. Maybe a
Nothing
, message_ids :: Maybe [Int]
message_ids = Maybe [Int]
forall a. Maybe a
Nothing
, options :: Maybe MessageSendOptions
options = Maybe MessageSendOptions
forall a. Maybe a
Nothing
, send_copy :: Maybe Bool
send_copy = Maybe Bool
forall a. Maybe a
Nothing
, remove_caption :: Maybe Bool
remove_caption = Maybe Bool
forall a. Maybe a
Nothing
}