module TD.Data.Message
(Message(..)) 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.MessageSender as MessageSender
import qualified TD.Data.MessageSendingState as MessageSendingState
import qualified TD.Data.MessageSchedulingState as MessageSchedulingState
import qualified TD.Data.MessageForwardInfo as MessageForwardInfo
import qualified TD.Data.MessageImportInfo as MessageImportInfo
import qualified TD.Data.MessageInteractionInfo as MessageInteractionInfo
import qualified TD.Data.UnreadReaction as UnreadReaction
import qualified TD.Data.FactCheck as FactCheck
import qualified TD.Data.MessageReplyTo as MessageReplyTo
import qualified TD.Data.MessageSelfDestructType as MessageSelfDestructType
import qualified Data.Text as T
import qualified TD.Data.MessageContent as MessageContent
import qualified TD.Data.ReplyMarkup as ReplyMarkup
data Message
= Message
{ Message -> Maybe Int
_id :: Maybe Int
, Message -> Maybe MessageSender
sender_id :: Maybe MessageSender.MessageSender
, Message -> Maybe Int
chat_id :: Maybe Int
, Message -> Maybe MessageSendingState
sending_state :: Maybe MessageSendingState.MessageSendingState
, Message -> Maybe MessageSchedulingState
scheduling_state :: Maybe MessageSchedulingState.MessageSchedulingState
, Message -> Maybe Bool
is_outgoing :: Maybe Bool
, Message -> Maybe Bool
is_pinned :: Maybe Bool
, Message -> Maybe Bool
is_from_offline :: Maybe Bool
, Message -> Maybe Bool
can_be_saved :: Maybe Bool
, Message -> Maybe Bool
has_timestamped_media :: Maybe Bool
, Message -> Maybe Bool
is_channel_post :: Maybe Bool
, Message -> Maybe Bool
is_topic_message :: Maybe Bool
, Message -> Maybe Bool
contains_unread_mention :: Maybe Bool
, Message -> Maybe Int
date :: Maybe Int
, Message -> Maybe Int
edit_date :: Maybe Int
, Message -> Maybe MessageForwardInfo
forward_info :: Maybe MessageForwardInfo.MessageForwardInfo
, Message -> Maybe MessageImportInfo
import_info :: Maybe MessageImportInfo.MessageImportInfo
, Message -> Maybe MessageInteractionInfo
interaction_info :: Maybe MessageInteractionInfo.MessageInteractionInfo
, Message -> Maybe [UnreadReaction]
unread_reactions :: Maybe [UnreadReaction.UnreadReaction]
, Message -> Maybe FactCheck
fact_check :: Maybe FactCheck.FactCheck
, Message -> Maybe MessageReplyTo
reply_to :: Maybe MessageReplyTo.MessageReplyTo
, Message -> Maybe Int
message_thread_id :: Maybe Int
, Message -> Maybe Int
saved_messages_topic_id :: Maybe Int
, Message -> Maybe MessageSelfDestructType
self_destruct_type :: Maybe MessageSelfDestructType.MessageSelfDestructType
, Message -> Maybe Double
self_destruct_in :: Maybe Double
, Message -> Maybe Double
auto_delete_in :: Maybe Double
, Message -> Maybe Int
via_bot_user_id :: Maybe Int
, Message -> Maybe Int
sender_business_bot_user_id :: Maybe Int
, Message -> Maybe Int
sender_boost_count :: Maybe Int
, Message -> Maybe Text
author_signature :: Maybe T.Text
, Message -> Maybe Int
media_album_id :: Maybe Int
, Message -> Maybe Int
effect_id :: Maybe Int
, Message -> Maybe Bool
has_sensitive_content :: Maybe Bool
, Message -> Maybe Text
restriction_reason :: Maybe T.Text
, Message -> Maybe MessageContent
content :: Maybe MessageContent.MessageContent
, Message -> Maybe ReplyMarkup
reply_markup :: Maybe ReplyMarkup.ReplyMarkup
}
deriving (Message -> Message -> Bool
(Message -> Message -> Bool)
-> (Message -> Message -> Bool) -> Eq Message
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Message -> Message -> Bool
== :: Message -> Message -> Bool
$c/= :: Message -> Message -> Bool
/= :: Message -> Message -> Bool
Eq, Int -> Message -> ShowS
[Message] -> ShowS
Message -> String
(Int -> Message -> ShowS)
-> (Message -> String) -> ([Message] -> ShowS) -> Show Message
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Message -> ShowS
showsPrec :: Int -> Message -> ShowS
$cshow :: Message -> String
show :: Message -> String
$cshowList :: [Message] -> ShowS
showList :: [Message] -> ShowS
Show)
instance I.ShortShow Message where
shortShow :: Message -> String
shortShow Message
{ _id :: Message -> Maybe Int
_id = Maybe Int
_id_
, sender_id :: Message -> Maybe MessageSender
sender_id = Maybe MessageSender
sender_id_
, chat_id :: Message -> Maybe Int
chat_id = Maybe Int
chat_id_
, sending_state :: Message -> Maybe MessageSendingState
sending_state = Maybe MessageSendingState
sending_state_
, scheduling_state :: Message -> Maybe MessageSchedulingState
scheduling_state = Maybe MessageSchedulingState
scheduling_state_
, is_outgoing :: Message -> Maybe Bool
is_outgoing = Maybe Bool
is_outgoing_
, is_pinned :: Message -> Maybe Bool
is_pinned = Maybe Bool
is_pinned_
, is_from_offline :: Message -> Maybe Bool
is_from_offline = Maybe Bool
is_from_offline_
, can_be_saved :: Message -> Maybe Bool
can_be_saved = Maybe Bool
can_be_saved_
, has_timestamped_media :: Message -> Maybe Bool
has_timestamped_media = Maybe Bool
has_timestamped_media_
, is_channel_post :: Message -> Maybe Bool
is_channel_post = Maybe Bool
is_channel_post_
, is_topic_message :: Message -> Maybe Bool
is_topic_message = Maybe Bool
is_topic_message_
, contains_unread_mention :: Message -> Maybe Bool
contains_unread_mention = Maybe Bool
contains_unread_mention_
, date :: Message -> Maybe Int
date = Maybe Int
date_
, edit_date :: Message -> Maybe Int
edit_date = Maybe Int
edit_date_
, forward_info :: Message -> Maybe MessageForwardInfo
forward_info = Maybe MessageForwardInfo
forward_info_
, import_info :: Message -> Maybe MessageImportInfo
import_info = Maybe MessageImportInfo
import_info_
, interaction_info :: Message -> Maybe MessageInteractionInfo
interaction_info = Maybe MessageInteractionInfo
interaction_info_
, unread_reactions :: Message -> Maybe [UnreadReaction]
unread_reactions = Maybe [UnreadReaction]
unread_reactions_
, fact_check :: Message -> Maybe FactCheck
fact_check = Maybe FactCheck
fact_check_
, reply_to :: Message -> Maybe MessageReplyTo
reply_to = Maybe MessageReplyTo
reply_to_
, message_thread_id :: Message -> Maybe Int
message_thread_id = Maybe Int
message_thread_id_
, saved_messages_topic_id :: Message -> Maybe Int
saved_messages_topic_id = Maybe Int
saved_messages_topic_id_
, self_destruct_type :: Message -> Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, self_destruct_in :: Message -> Maybe Double
self_destruct_in = Maybe Double
self_destruct_in_
, auto_delete_in :: Message -> Maybe Double
auto_delete_in = Maybe Double
auto_delete_in_
, via_bot_user_id :: Message -> Maybe Int
via_bot_user_id = Maybe Int
via_bot_user_id_
, sender_business_bot_user_id :: Message -> Maybe Int
sender_business_bot_user_id = Maybe Int
sender_business_bot_user_id_
, sender_boost_count :: Message -> Maybe Int
sender_boost_count = Maybe Int
sender_boost_count_
, author_signature :: Message -> Maybe Text
author_signature = Maybe Text
author_signature_
, media_album_id :: Message -> Maybe Int
media_album_id = Maybe Int
media_album_id_
, effect_id :: Message -> Maybe Int
effect_id = Maybe Int
effect_id_
, has_sensitive_content :: Message -> Maybe Bool
has_sensitive_content = Maybe Bool
has_sensitive_content_
, restriction_reason :: Message -> Maybe Text
restriction_reason = Maybe Text
restriction_reason_
, content :: Message -> Maybe MessageContent
content = Maybe MessageContent
content_
, reply_markup :: Message -> Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
}
= String
"Message"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
_id_
, String
"sender_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
sender_id_
, String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"sending_state" String -> Maybe MessageSendingState -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSendingState
sending_state_
, String
"scheduling_state" String -> Maybe MessageSchedulingState -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSchedulingState
scheduling_state_
, String
"is_outgoing" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_outgoing_
, String
"is_pinned" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_pinned_
, String
"is_from_offline" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_from_offline_
, String
"can_be_saved" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_saved_
, String
"has_timestamped_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_timestamped_media_
, String
"is_channel_post" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_channel_post_
, String
"is_topic_message" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_topic_message_
, String
"contains_unread_mention" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
contains_unread_mention_
, String
"date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
date_
, String
"edit_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
edit_date_
, String
"forward_info" String -> Maybe MessageForwardInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageForwardInfo
forward_info_
, String
"import_info" String -> Maybe MessageImportInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageImportInfo
import_info_
, String
"interaction_info" String -> Maybe MessageInteractionInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageInteractionInfo
interaction_info_
, String
"unread_reactions" String -> Maybe [UnreadReaction] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [UnreadReaction]
unread_reactions_
, String
"fact_check" String -> Maybe FactCheck -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FactCheck
fact_check_
, String
"reply_to" String -> Maybe MessageReplyTo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageReplyTo
reply_to_
, String
"message_thread_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_thread_id_
, String
"saved_messages_topic_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
saved_messages_topic_id_
, String
"self_destruct_type" String -> Maybe MessageSelfDestructType -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSelfDestructType
self_destruct_type_
, String
"self_destruct_in" String -> Maybe Double -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Double
self_destruct_in_
, String
"auto_delete_in" String -> Maybe Double -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Double
auto_delete_in_
, String
"via_bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
via_bot_user_id_
, String
"sender_business_bot_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
sender_business_bot_user_id_
, String
"sender_boost_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
sender_boost_count_
, String
"author_signature" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
author_signature_
, String
"media_album_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
media_album_id_
, String
"effect_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
effect_id_
, String
"has_sensitive_content" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_sensitive_content_
, String
"restriction_reason" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
restriction_reason_
, String
"content" String -> Maybe MessageContent -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageContent
content_
, String
"reply_markup" String -> Maybe ReplyMarkup -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ReplyMarkup
reply_markup_
]
instance AT.FromJSON Message where
parseJSON :: Value -> Parser Message
parseJSON v :: Value
v@(AT.Object Object
obj) = do
String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String
case String
t of
String
"message" -> Value -> Parser Message
parseMessage Value
v
String
_ -> Parser Message
forall a. Monoid a => a
mempty
where
parseMessage :: A.Value -> AT.Parser Message
parseMessage :: Value -> Parser Message
parseMessage = String -> (Object -> Parser Message) -> Value -> Parser Message
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"Message" ((Object -> Parser Message) -> Value -> Parser Message)
-> (Object -> Parser Message) -> Value -> Parser Message
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"id"
Maybe MessageSender
sender_id_ <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"sender_id"
Maybe Int
chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_id"
Maybe MessageSendingState
sending_state_ <- Object
o Object -> Key -> Parser (Maybe MessageSendingState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"sending_state"
Maybe MessageSchedulingState
scheduling_state_ <- Object
o Object -> Key -> Parser (Maybe MessageSchedulingState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"scheduling_state"
Maybe Bool
is_outgoing_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_outgoing"
Maybe Bool
is_pinned_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_pinned"
Maybe Bool
is_from_offline_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_from_offline"
Maybe Bool
can_be_saved_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_saved"
Maybe Bool
has_timestamped_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"has_timestamped_media"
Maybe Bool
is_channel_post_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_channel_post"
Maybe Bool
is_topic_message_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_topic_message"
Maybe Bool
contains_unread_mention_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"contains_unread_mention"
Maybe Int
date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"date"
Maybe Int
edit_date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"edit_date"
Maybe MessageForwardInfo
forward_info_ <- Object
o Object -> Key -> Parser (Maybe MessageForwardInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"forward_info"
Maybe MessageImportInfo
import_info_ <- Object
o Object -> Key -> Parser (Maybe MessageImportInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"import_info"
Maybe MessageInteractionInfo
interaction_info_ <- Object
o Object -> Key -> Parser (Maybe MessageInteractionInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"interaction_info"
Maybe [UnreadReaction]
unread_reactions_ <- Object
o Object -> Key -> Parser (Maybe [UnreadReaction])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"unread_reactions"
Maybe FactCheck
fact_check_ <- Object
o Object -> Key -> Parser (Maybe FactCheck)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"fact_check"
Maybe MessageReplyTo
reply_to_ <- Object
o Object -> Key -> Parser (Maybe MessageReplyTo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"reply_to"
Maybe Int
message_thread_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"message_thread_id"
Maybe Int
saved_messages_topic_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"saved_messages_topic_id"
Maybe MessageSelfDestructType
self_destruct_type_ <- Object
o Object -> Key -> Parser (Maybe MessageSelfDestructType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"self_destruct_type"
Maybe Double
self_destruct_in_ <- Object
o Object -> Key -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"self_destruct_in"
Maybe Double
auto_delete_in_ <- Object
o Object -> Key -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"auto_delete_in"
Maybe Int
via_bot_user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"via_bot_user_id"
Maybe Int
sender_business_bot_user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"sender_business_bot_user_id"
Maybe Int
sender_boost_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"sender_boost_count"
Maybe Text
author_signature_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"author_signature"
Maybe Int
media_album_id_ <- (String -> Int) -> Maybe String -> Maybe Int
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> Int
I.readInt64 (Maybe String -> Maybe Int)
-> Parser (Maybe String) -> Parser (Maybe Int)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"media_album_id"
Maybe Int
effect_id_ <- (String -> Int) -> Maybe String -> Maybe Int
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> Int
I.readInt64 (Maybe String -> Maybe Int)
-> Parser (Maybe String) -> Parser (Maybe Int)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"effect_id"
Maybe Bool
has_sensitive_content_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"has_sensitive_content"
Maybe Text
restriction_reason_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"restriction_reason"
Maybe MessageContent
content_ <- Object
o Object -> Key -> Parser (Maybe MessageContent)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"content"
Maybe ReplyMarkup
reply_markup_ <- Object
o Object -> Key -> Parser (Maybe ReplyMarkup)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"reply_markup"
Message -> Parser Message
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Message -> Parser Message) -> Message -> Parser Message
forall a b. (a -> b) -> a -> b
$ Message
{ _id :: Maybe Int
_id = Maybe Int
_id_
, sender_id :: Maybe MessageSender
sender_id = Maybe MessageSender
sender_id_
, chat_id :: Maybe Int
chat_id = Maybe Int
chat_id_
, sending_state :: Maybe MessageSendingState
sending_state = Maybe MessageSendingState
sending_state_
, scheduling_state :: Maybe MessageSchedulingState
scheduling_state = Maybe MessageSchedulingState
scheduling_state_
, is_outgoing :: Maybe Bool
is_outgoing = Maybe Bool
is_outgoing_
, is_pinned :: Maybe Bool
is_pinned = Maybe Bool
is_pinned_
, is_from_offline :: Maybe Bool
is_from_offline = Maybe Bool
is_from_offline_
, can_be_saved :: Maybe Bool
can_be_saved = Maybe Bool
can_be_saved_
, has_timestamped_media :: Maybe Bool
has_timestamped_media = Maybe Bool
has_timestamped_media_
, is_channel_post :: Maybe Bool
is_channel_post = Maybe Bool
is_channel_post_
, is_topic_message :: Maybe Bool
is_topic_message = Maybe Bool
is_topic_message_
, contains_unread_mention :: Maybe Bool
contains_unread_mention = Maybe Bool
contains_unread_mention_
, date :: Maybe Int
date = Maybe Int
date_
, edit_date :: Maybe Int
edit_date = Maybe Int
edit_date_
, forward_info :: Maybe MessageForwardInfo
forward_info = Maybe MessageForwardInfo
forward_info_
, import_info :: Maybe MessageImportInfo
import_info = Maybe MessageImportInfo
import_info_
, interaction_info :: Maybe MessageInteractionInfo
interaction_info = Maybe MessageInteractionInfo
interaction_info_
, unread_reactions :: Maybe [UnreadReaction]
unread_reactions = Maybe [UnreadReaction]
unread_reactions_
, fact_check :: Maybe FactCheck
fact_check = Maybe FactCheck
fact_check_
, reply_to :: Maybe MessageReplyTo
reply_to = Maybe MessageReplyTo
reply_to_
, message_thread_id :: Maybe Int
message_thread_id = Maybe Int
message_thread_id_
, saved_messages_topic_id :: Maybe Int
saved_messages_topic_id = Maybe Int
saved_messages_topic_id_
, self_destruct_type :: Maybe MessageSelfDestructType
self_destruct_type = Maybe MessageSelfDestructType
self_destruct_type_
, self_destruct_in :: Maybe Double
self_destruct_in = Maybe Double
self_destruct_in_
, auto_delete_in :: Maybe Double
auto_delete_in = Maybe Double
auto_delete_in_
, via_bot_user_id :: Maybe Int
via_bot_user_id = Maybe Int
via_bot_user_id_
, sender_business_bot_user_id :: Maybe Int
sender_business_bot_user_id = Maybe Int
sender_business_bot_user_id_
, sender_boost_count :: Maybe Int
sender_boost_count = Maybe Int
sender_boost_count_
, author_signature :: Maybe Text
author_signature = Maybe Text
author_signature_
, media_album_id :: Maybe Int
media_album_id = Maybe Int
media_album_id_
, effect_id :: Maybe Int
effect_id = Maybe Int
effect_id_
, has_sensitive_content :: Maybe Bool
has_sensitive_content = Maybe Bool
has_sensitive_content_
, restriction_reason :: Maybe Text
restriction_reason = Maybe Text
restriction_reason_
, content :: Maybe MessageContent
content = Maybe MessageContent
content_
, reply_markup :: Maybe ReplyMarkup
reply_markup = Maybe ReplyMarkup
reply_markup_
}
parseJSON Value
_ = Parser Message
forall a. Monoid a => a
mempty