module TD.Data.MessageProperties
(MessageProperties(..)) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data MessageProperties
= MessageProperties
{ MessageProperties -> Maybe Bool
can_be_copied_to_secret_chat :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_deleted_only_for_self :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_deleted_for_all_users :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_edited :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_forwarded :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_paid :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_pinned :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_replied :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_replied_in_another_chat :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_saved :: Maybe Bool
, MessageProperties -> Maybe Bool
can_be_shared_in_story :: Maybe Bool
, MessageProperties -> Maybe Bool
can_edit_media :: Maybe Bool
, MessageProperties -> Maybe Bool
can_edit_scheduling_state :: Maybe Bool
, MessageProperties -> Maybe Bool
can_get_embedding_code :: Maybe Bool
, MessageProperties -> Maybe Bool
can_get_link :: Maybe Bool
, MessageProperties -> Maybe Bool
can_get_media_timestamp_links :: Maybe Bool
, MessageProperties -> Maybe Bool
can_get_message_thread :: Maybe Bool
, MessageProperties -> Maybe Bool
can_get_read_date :: Maybe Bool
, MessageProperties -> Maybe Bool
can_get_statistics :: Maybe Bool
, MessageProperties -> Maybe Bool
can_get_viewers :: Maybe Bool
, MessageProperties -> Maybe Bool
can_recognize_speech :: Maybe Bool
, MessageProperties -> Maybe Bool
can_report_chat :: Maybe Bool
, MessageProperties -> Maybe Bool
can_report_reactions :: Maybe Bool
, MessageProperties -> Maybe Bool
can_report_supergroup_spam :: Maybe Bool
, MessageProperties -> Maybe Bool
can_set_fact_check :: Maybe Bool
, MessageProperties -> Maybe Bool
need_show_statistics :: Maybe Bool
}
deriving (MessageProperties -> MessageProperties -> Bool
(MessageProperties -> MessageProperties -> Bool)
-> (MessageProperties -> MessageProperties -> Bool)
-> Eq MessageProperties
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MessageProperties -> MessageProperties -> Bool
== :: MessageProperties -> MessageProperties -> Bool
$c/= :: MessageProperties -> MessageProperties -> Bool
/= :: MessageProperties -> MessageProperties -> Bool
Eq, Int -> MessageProperties -> ShowS
[MessageProperties] -> ShowS
MessageProperties -> String
(Int -> MessageProperties -> ShowS)
-> (MessageProperties -> String)
-> ([MessageProperties] -> ShowS)
-> Show MessageProperties
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MessageProperties -> ShowS
showsPrec :: Int -> MessageProperties -> ShowS
$cshow :: MessageProperties -> String
show :: MessageProperties -> String
$cshowList :: [MessageProperties] -> ShowS
showList :: [MessageProperties] -> ShowS
Show)
instance I.ShortShow MessageProperties where
shortShow :: MessageProperties -> String
shortShow MessageProperties
{ can_be_copied_to_secret_chat :: MessageProperties -> Maybe Bool
can_be_copied_to_secret_chat = Maybe Bool
can_be_copied_to_secret_chat_
, can_be_deleted_only_for_self :: MessageProperties -> Maybe Bool
can_be_deleted_only_for_self = Maybe Bool
can_be_deleted_only_for_self_
, can_be_deleted_for_all_users :: MessageProperties -> Maybe Bool
can_be_deleted_for_all_users = Maybe Bool
can_be_deleted_for_all_users_
, can_be_edited :: MessageProperties -> Maybe Bool
can_be_edited = Maybe Bool
can_be_edited_
, can_be_forwarded :: MessageProperties -> Maybe Bool
can_be_forwarded = Maybe Bool
can_be_forwarded_
, can_be_paid :: MessageProperties -> Maybe Bool
can_be_paid = Maybe Bool
can_be_paid_
, can_be_pinned :: MessageProperties -> Maybe Bool
can_be_pinned = Maybe Bool
can_be_pinned_
, can_be_replied :: MessageProperties -> Maybe Bool
can_be_replied = Maybe Bool
can_be_replied_
, can_be_replied_in_another_chat :: MessageProperties -> Maybe Bool
can_be_replied_in_another_chat = Maybe Bool
can_be_replied_in_another_chat_
, can_be_saved :: MessageProperties -> Maybe Bool
can_be_saved = Maybe Bool
can_be_saved_
, can_be_shared_in_story :: MessageProperties -> Maybe Bool
can_be_shared_in_story = Maybe Bool
can_be_shared_in_story_
, can_edit_media :: MessageProperties -> Maybe Bool
can_edit_media = Maybe Bool
can_edit_media_
, can_edit_scheduling_state :: MessageProperties -> Maybe Bool
can_edit_scheduling_state = Maybe Bool
can_edit_scheduling_state_
, can_get_embedding_code :: MessageProperties -> Maybe Bool
can_get_embedding_code = Maybe Bool
can_get_embedding_code_
, can_get_link :: MessageProperties -> Maybe Bool
can_get_link = Maybe Bool
can_get_link_
, can_get_media_timestamp_links :: MessageProperties -> Maybe Bool
can_get_media_timestamp_links = Maybe Bool
can_get_media_timestamp_links_
, can_get_message_thread :: MessageProperties -> Maybe Bool
can_get_message_thread = Maybe Bool
can_get_message_thread_
, can_get_read_date :: MessageProperties -> Maybe Bool
can_get_read_date = Maybe Bool
can_get_read_date_
, can_get_statistics :: MessageProperties -> Maybe Bool
can_get_statistics = Maybe Bool
can_get_statistics_
, can_get_viewers :: MessageProperties -> Maybe Bool
can_get_viewers = Maybe Bool
can_get_viewers_
, can_recognize_speech :: MessageProperties -> Maybe Bool
can_recognize_speech = Maybe Bool
can_recognize_speech_
, can_report_chat :: MessageProperties -> Maybe Bool
can_report_chat = Maybe Bool
can_report_chat_
, can_report_reactions :: MessageProperties -> Maybe Bool
can_report_reactions = Maybe Bool
can_report_reactions_
, can_report_supergroup_spam :: MessageProperties -> Maybe Bool
can_report_supergroup_spam = Maybe Bool
can_report_supergroup_spam_
, can_set_fact_check :: MessageProperties -> Maybe Bool
can_set_fact_check = Maybe Bool
can_set_fact_check_
, need_show_statistics :: MessageProperties -> Maybe Bool
need_show_statistics = Maybe Bool
need_show_statistics_
}
= String
"MessageProperties"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"can_be_copied_to_secret_chat" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_copied_to_secret_chat_
, String
"can_be_deleted_only_for_self" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_deleted_only_for_self_
, String
"can_be_deleted_for_all_users" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_deleted_for_all_users_
, String
"can_be_edited" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_edited_
, String
"can_be_forwarded" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_forwarded_
, String
"can_be_paid" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_paid_
, String
"can_be_pinned" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_pinned_
, String
"can_be_replied" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_replied_
, String
"can_be_replied_in_another_chat" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_replied_in_another_chat_
, String
"can_be_saved" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_saved_
, String
"can_be_shared_in_story" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_shared_in_story_
, String
"can_edit_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_edit_media_
, String
"can_edit_scheduling_state" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_edit_scheduling_state_
, String
"can_get_embedding_code" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_embedding_code_
, String
"can_get_link" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_link_
, String
"can_get_media_timestamp_links" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_media_timestamp_links_
, String
"can_get_message_thread" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_message_thread_
, String
"can_get_read_date" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_read_date_
, String
"can_get_statistics" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_statistics_
, String
"can_get_viewers" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_get_viewers_
, String
"can_recognize_speech" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_recognize_speech_
, String
"can_report_chat" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_report_chat_
, String
"can_report_reactions" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_report_reactions_
, String
"can_report_supergroup_spam" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_report_supergroup_spam_
, String
"can_set_fact_check" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_set_fact_check_
, String
"need_show_statistics" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
need_show_statistics_
]
instance AT.FromJSON MessageProperties where
parseJSON :: Value -> Parser MessageProperties
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
"messageProperties" -> Value -> Parser MessageProperties
parseMessageProperties Value
v
String
_ -> Parser MessageProperties
forall a. Monoid a => a
mempty
where
parseMessageProperties :: A.Value -> AT.Parser MessageProperties
parseMessageProperties :: Value -> Parser MessageProperties
parseMessageProperties = String
-> (Object -> Parser MessageProperties)
-> Value
-> Parser MessageProperties
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageProperties" ((Object -> Parser MessageProperties)
-> Value -> Parser MessageProperties)
-> (Object -> Parser MessageProperties)
-> Value
-> Parser MessageProperties
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Bool
can_be_copied_to_secret_chat_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_copied_to_secret_chat"
Maybe Bool
can_be_deleted_only_for_self_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_deleted_only_for_self"
Maybe Bool
can_be_deleted_for_all_users_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_deleted_for_all_users"
Maybe Bool
can_be_edited_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_edited"
Maybe Bool
can_be_forwarded_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_forwarded"
Maybe Bool
can_be_paid_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_paid"
Maybe Bool
can_be_pinned_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_pinned"
Maybe Bool
can_be_replied_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_replied"
Maybe Bool
can_be_replied_in_another_chat_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_replied_in_another_chat"
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
can_be_shared_in_story_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_shared_in_story"
Maybe Bool
can_edit_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_edit_media"
Maybe Bool
can_edit_scheduling_state_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_edit_scheduling_state"
Maybe Bool
can_get_embedding_code_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_get_embedding_code"
Maybe Bool
can_get_link_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_get_link"
Maybe Bool
can_get_media_timestamp_links_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_get_media_timestamp_links"
Maybe Bool
can_get_message_thread_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_get_message_thread"
Maybe Bool
can_get_read_date_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_get_read_date"
Maybe Bool
can_get_statistics_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_get_statistics"
Maybe Bool
can_get_viewers_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_get_viewers"
Maybe Bool
can_recognize_speech_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_recognize_speech"
Maybe Bool
can_report_chat_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_report_chat"
Maybe Bool
can_report_reactions_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_report_reactions"
Maybe Bool
can_report_supergroup_spam_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_report_supergroup_spam"
Maybe Bool
can_set_fact_check_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_set_fact_check"
Maybe Bool
need_show_statistics_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"need_show_statistics"
MessageProperties -> Parser MessageProperties
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageProperties -> Parser MessageProperties)
-> MessageProperties -> Parser MessageProperties
forall a b. (a -> b) -> a -> b
$ MessageProperties
{ can_be_copied_to_secret_chat :: Maybe Bool
can_be_copied_to_secret_chat = Maybe Bool
can_be_copied_to_secret_chat_
, can_be_deleted_only_for_self :: Maybe Bool
can_be_deleted_only_for_self = Maybe Bool
can_be_deleted_only_for_self_
, can_be_deleted_for_all_users :: Maybe Bool
can_be_deleted_for_all_users = Maybe Bool
can_be_deleted_for_all_users_
, can_be_edited :: Maybe Bool
can_be_edited = Maybe Bool
can_be_edited_
, can_be_forwarded :: Maybe Bool
can_be_forwarded = Maybe Bool
can_be_forwarded_
, can_be_paid :: Maybe Bool
can_be_paid = Maybe Bool
can_be_paid_
, can_be_pinned :: Maybe Bool
can_be_pinned = Maybe Bool
can_be_pinned_
, can_be_replied :: Maybe Bool
can_be_replied = Maybe Bool
can_be_replied_
, can_be_replied_in_another_chat :: Maybe Bool
can_be_replied_in_another_chat = Maybe Bool
can_be_replied_in_another_chat_
, can_be_saved :: Maybe Bool
can_be_saved = Maybe Bool
can_be_saved_
, can_be_shared_in_story :: Maybe Bool
can_be_shared_in_story = Maybe Bool
can_be_shared_in_story_
, can_edit_media :: Maybe Bool
can_edit_media = Maybe Bool
can_edit_media_
, can_edit_scheduling_state :: Maybe Bool
can_edit_scheduling_state = Maybe Bool
can_edit_scheduling_state_
, can_get_embedding_code :: Maybe Bool
can_get_embedding_code = Maybe Bool
can_get_embedding_code_
, can_get_link :: Maybe Bool
can_get_link = Maybe Bool
can_get_link_
, can_get_media_timestamp_links :: Maybe Bool
can_get_media_timestamp_links = Maybe Bool
can_get_media_timestamp_links_
, can_get_message_thread :: Maybe Bool
can_get_message_thread = Maybe Bool
can_get_message_thread_
, can_get_read_date :: Maybe Bool
can_get_read_date = Maybe Bool
can_get_read_date_
, can_get_statistics :: Maybe Bool
can_get_statistics = Maybe Bool
can_get_statistics_
, can_get_viewers :: Maybe Bool
can_get_viewers = Maybe Bool
can_get_viewers_
, can_recognize_speech :: Maybe Bool
can_recognize_speech = Maybe Bool
can_recognize_speech_
, can_report_chat :: Maybe Bool
can_report_chat = Maybe Bool
can_report_chat_
, can_report_reactions :: Maybe Bool
can_report_reactions = Maybe Bool
can_report_reactions_
, can_report_supergroup_spam :: Maybe Bool
can_report_supergroup_spam = Maybe Bool
can_report_supergroup_spam_
, can_set_fact_check :: Maybe Bool
can_set_fact_check = Maybe Bool
can_set_fact_check_
, need_show_statistics :: Maybe Bool
need_show_statistics = Maybe Bool
need_show_statistics_
}
parseJSON Value
_ = Parser MessageProperties
forall a. Monoid a => a
mempty