module TD.Data.ChatEventAction
  (ChatEventAction(..)) 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.Message as Message
import qualified TD.Data.ChatInviteLink as ChatInviteLink
import qualified TD.Data.ChatMemberStatus as ChatMemberStatus
import qualified TD.Data.MessageSender as MessageSender
import qualified TD.Data.ChatAvailableReactions as ChatAvailableReactions
import qualified TD.Data.ChatBackground as ChatBackground
import qualified Data.Text as T
import qualified TD.Data.EmojiStatus as EmojiStatus
import qualified TD.Data.ChatLocation as ChatLocation
import qualified TD.Data.ChatPermissions as ChatPermissions
import qualified TD.Data.ChatPhoto as ChatPhoto
import qualified TD.Data.ForumTopicInfo as ForumTopicInfo

-- | Represents a chat event
data ChatEventAction
  = ChatEventMessageEdited -- ^ A message was edited
    { ChatEventAction -> Maybe Message
old_message :: Maybe Message.Message -- ^ The original message before the edit
    , ChatEventAction -> Maybe Message
new_message :: Maybe Message.Message -- ^ The message after it was edited
    }
  | ChatEventMessageDeleted -- ^ A message was deleted
    { ChatEventAction -> Maybe Message
message                             :: Maybe Message.Message -- ^ Deleted message
    , ChatEventAction -> Maybe Bool
can_report_anti_spam_false_positive :: Maybe Bool            -- ^ True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive
    }
  | ChatEventMessagePinned -- ^ A message was pinned
    { message :: Maybe Message.Message -- ^ Pinned message
    }
  | ChatEventMessageUnpinned -- ^ A message was unpinned
    { message :: Maybe Message.Message -- ^ Unpinned message
    }
  | ChatEventPollStopped -- ^ A poll in a message was stopped
    { message :: Maybe Message.Message -- ^ The message with the poll
    }
  | ChatEventMemberJoined -- ^ A new member joined the chat
  | ChatEventMemberJoinedByInviteLink -- ^ A new member joined the chat via an invite link
    { ChatEventAction -> Maybe ChatInviteLink
invite_link                 :: Maybe ChatInviteLink.ChatInviteLink -- ^ Invite link used to join the chat
    , ChatEventAction -> Maybe Bool
via_chat_folder_invite_link :: Maybe Bool                          -- ^ True, if the user has joined the chat using an invite link for a chat folder
    }
  | ChatEventMemberJoinedByRequest -- ^ A new member was accepted to the chat by an administrator
    { ChatEventAction -> Maybe Int
approver_user_id :: Maybe Int                           -- ^ User identifier of the chat administrator, approved user join request
    , invite_link      :: Maybe ChatInviteLink.ChatInviteLink -- ^ Invite link used to join the chat; may be null
    }
  | ChatEventMemberInvited -- ^ A new chat member was invited
    { ChatEventAction -> Maybe Int
user_id :: Maybe Int                               -- ^ New member user identifier
    , ChatEventAction -> Maybe ChatMemberStatus
status  :: Maybe ChatMemberStatus.ChatMemberStatus -- ^ New member status
    }
  | ChatEventMemberLeft -- ^ A member left the chat
  | ChatEventMemberPromoted -- ^ A chat member has gained/lost administrator status, or the list of their administrator privileges has changed
    { user_id    :: Maybe Int                               -- ^ Affected chat member user identifier
    , ChatEventAction -> Maybe ChatMemberStatus
old_status :: Maybe ChatMemberStatus.ChatMemberStatus -- ^ Previous status of the chat member
    , ChatEventAction -> Maybe ChatMemberStatus
new_status :: Maybe ChatMemberStatus.ChatMemberStatus -- ^ New status of the chat member
    }
  | ChatEventMemberRestricted -- ^ A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed
    { ChatEventAction -> Maybe MessageSender
member_id  :: Maybe MessageSender.MessageSender       -- ^ Affected chat member identifier
    , old_status :: Maybe ChatMemberStatus.ChatMemberStatus -- ^ Previous status of the chat member
    , new_status :: Maybe ChatMemberStatus.ChatMemberStatus -- ^ New status of the chat member
    }
  | ChatEventMemberSubscriptionExtended -- ^ A chat member extended their subscription to the chat
    { user_id    :: Maybe Int                               -- ^ Affected chat member user identifier
    , old_status :: Maybe ChatMemberStatus.ChatMemberStatus -- ^ Previous status of the chat member
    , new_status :: Maybe ChatMemberStatus.ChatMemberStatus -- ^ New status of the chat member
    }
  | ChatEventAvailableReactionsChanged -- ^ The chat available reactions were changed
    { ChatEventAction -> Maybe ChatAvailableReactions
old_available_reactions :: Maybe ChatAvailableReactions.ChatAvailableReactions -- ^ Previous chat available reactions
    , ChatEventAction -> Maybe ChatAvailableReactions
new_available_reactions :: Maybe ChatAvailableReactions.ChatAvailableReactions -- ^ New chat available reactions
    }
  | ChatEventBackgroundChanged -- ^ The chat background was changed
    { ChatEventAction -> Maybe ChatBackground
old_background :: Maybe ChatBackground.ChatBackground -- ^ Previous background; may be null if none
    , ChatEventAction -> Maybe ChatBackground
new_background :: Maybe ChatBackground.ChatBackground -- ^ New background; may be null if none
    }
  | ChatEventDescriptionChanged -- ^ The chat description was changed
    { ChatEventAction -> Maybe Text
old_description :: Maybe T.Text -- ^ Previous chat description
    , ChatEventAction -> Maybe Text
new_description :: Maybe T.Text -- ^ New chat description
    }
  | ChatEventEmojiStatusChanged -- ^ The chat emoji status was changed
    { ChatEventAction -> Maybe EmojiStatus
old_emoji_status :: Maybe EmojiStatus.EmojiStatus -- ^ Previous emoji status; may be null if none
    , ChatEventAction -> Maybe EmojiStatus
new_emoji_status :: Maybe EmojiStatus.EmojiStatus -- ^ New emoji status; may be null if none
    }
  | ChatEventLinkedChatChanged -- ^ The linked chat of a supergroup was changed
    { ChatEventAction -> Maybe Int
old_linked_chat_id :: Maybe Int -- ^ Previous supergroup linked chat identifier
    , ChatEventAction -> Maybe Int
new_linked_chat_id :: Maybe Int -- ^ New supergroup linked chat identifier
    }
  | ChatEventLocationChanged -- ^ The supergroup location was changed
    { ChatEventAction -> Maybe ChatLocation
old_location :: Maybe ChatLocation.ChatLocation -- ^ Previous location; may be null
    , ChatEventAction -> Maybe ChatLocation
new_location :: Maybe ChatLocation.ChatLocation -- ^ New location; may be null
    }
  | ChatEventMessageAutoDeleteTimeChanged -- ^ The message auto-delete timer was changed
    { ChatEventAction -> Maybe Int
old_message_auto_delete_time :: Maybe Int -- ^ Previous value of message_auto_delete_time
    , ChatEventAction -> Maybe Int
new_message_auto_delete_time :: Maybe Int -- ^ New value of message_auto_delete_time
    }
  | ChatEventPermissionsChanged -- ^ The chat permissions were changed
    { ChatEventAction -> Maybe ChatPermissions
old_permissions :: Maybe ChatPermissions.ChatPermissions -- ^ Previous chat permissions
    , ChatEventAction -> Maybe ChatPermissions
new_permissions :: Maybe ChatPermissions.ChatPermissions -- ^ New chat permissions
    }
  | ChatEventPhotoChanged -- ^ The chat photo was changed
    { ChatEventAction -> Maybe ChatPhoto
old_photo :: Maybe ChatPhoto.ChatPhoto -- ^ Previous chat photo value; may be null
    , ChatEventAction -> Maybe ChatPhoto
new_photo :: Maybe ChatPhoto.ChatPhoto -- ^ New chat photo value; may be null
    }
  | ChatEventSlowModeDelayChanged -- ^ The slow_mode_delay setting of a supergroup was changed
    { ChatEventAction -> Maybe Int
old_slow_mode_delay :: Maybe Int -- ^ Previous value of slow_mode_delay, in seconds
    , ChatEventAction -> Maybe Int
new_slow_mode_delay :: Maybe Int -- ^ New value of slow_mode_delay, in seconds
    }
  | ChatEventStickerSetChanged -- ^ The supergroup sticker set was changed
    { ChatEventAction -> Maybe Int
old_sticker_set_id :: Maybe Int -- ^ Previous identifier of the chat sticker set; 0 if none
    , ChatEventAction -> Maybe Int
new_sticker_set_id :: Maybe Int -- ^ New identifier of the chat sticker set; 0 if none
    }
  | ChatEventCustomEmojiStickerSetChanged -- ^ The supergroup sticker set with allowed custom emoji was changed
    { old_sticker_set_id :: Maybe Int -- ^ Previous identifier of the chat sticker set; 0 if none
    , new_sticker_set_id :: Maybe Int -- ^ New identifier of the chat sticker set; 0 if none
    }
  | ChatEventTitleChanged -- ^ The chat title was changed
    { ChatEventAction -> Maybe Text
old_title :: Maybe T.Text -- ^ Previous chat title
    , ChatEventAction -> Maybe Text
new_title :: Maybe T.Text -- ^ New chat title
    }
  | ChatEventUsernameChanged -- ^ The chat editable username was changed
    { ChatEventAction -> Maybe Text
old_username :: Maybe T.Text -- ^ Previous chat username
    , ChatEventAction -> Maybe Text
new_username :: Maybe T.Text -- ^ New chat username
    }
  | ChatEventActiveUsernamesChanged -- ^ The chat active usernames were changed
    { ChatEventAction -> Maybe [Text]
old_usernames :: Maybe [T.Text] -- ^ Previous list of active usernames
    , ChatEventAction -> Maybe [Text]
new_usernames :: Maybe [T.Text] -- ^ New list of active usernames
    }
  | ChatEventAccentColorChanged -- ^ The chat accent color or background custom emoji were changed
    { ChatEventAction -> Maybe Int
old_accent_color_id            :: Maybe Int -- ^ Previous identifier of chat accent color
    , ChatEventAction -> Maybe Int
old_background_custom_emoji_id :: Maybe Int -- ^ Previous identifier of the custom emoji; 0 if none
    , ChatEventAction -> Maybe Int
new_accent_color_id            :: Maybe Int -- ^ New identifier of chat accent color
    , ChatEventAction -> Maybe Int
new_background_custom_emoji_id :: Maybe Int -- ^ New identifier of the custom emoji; 0 if none
    }
  | ChatEventProfileAccentColorChanged -- ^ The chat's profile accent color or profile background custom emoji were changed
    { ChatEventAction -> Maybe Int
old_profile_accent_color_id            :: Maybe Int -- ^ Previous identifier of chat's profile accent color; -1 if none
    , ChatEventAction -> Maybe Int
old_profile_background_custom_emoji_id :: Maybe Int -- ^ Previous identifier of the custom emoji; 0 if none
    , ChatEventAction -> Maybe Int
new_profile_accent_color_id            :: Maybe Int -- ^ New identifier of chat's profile accent color; -1 if none
    , ChatEventAction -> Maybe Int
new_profile_background_custom_emoji_id :: Maybe Int -- ^ New identifier of the custom emoji; 0 if none
    }
  | ChatEventHasProtectedContentToggled -- ^ The has_protected_content setting of a channel was toggled
    { ChatEventAction -> Maybe Bool
has_protected_content :: Maybe Bool -- ^ New value of has_protected_content
    }
  | ChatEventInvitesToggled -- ^ The can_invite_users permission of a supergroup chat was toggled
    { ChatEventAction -> Maybe Bool
can_invite_users :: Maybe Bool -- ^ New value of can_invite_users permission
    }
  | ChatEventIsAllHistoryAvailableToggled -- ^ The is_all_history_available setting of a supergroup was toggled
    { ChatEventAction -> Maybe Bool
is_all_history_available :: Maybe Bool -- ^ New value of is_all_history_available
    }
  | ChatEventHasAggressiveAntiSpamEnabledToggled -- ^ The has_aggressive_anti_spam_enabled setting of a supergroup was toggled
    { ChatEventAction -> Maybe Bool
has_aggressive_anti_spam_enabled :: Maybe Bool -- ^ New value of has_aggressive_anti_spam_enabled
    }
  | ChatEventSignMessagesToggled -- ^ The sign_messages setting of a channel was toggled
    { ChatEventAction -> Maybe Bool
sign_messages :: Maybe Bool -- ^ New value of sign_messages
    }
  | ChatEventShowMessageSenderToggled -- ^ The show_message_sender setting of a channel was toggled
    { ChatEventAction -> Maybe Bool
show_message_sender :: Maybe Bool -- ^ New value of show_message_sender
    }
  | ChatEventInviteLinkEdited -- ^ A chat invite link was edited
    { ChatEventAction -> Maybe ChatInviteLink
old_invite_link :: Maybe ChatInviteLink.ChatInviteLink -- ^ Previous information about the invite link
    , ChatEventAction -> Maybe ChatInviteLink
new_invite_link :: Maybe ChatInviteLink.ChatInviteLink -- ^ New information about the invite link
    }
  | ChatEventInviteLinkRevoked -- ^ A chat invite link was revoked
    { invite_link :: Maybe ChatInviteLink.ChatInviteLink -- ^ The invite link
    }
  | ChatEventInviteLinkDeleted -- ^ A revoked chat invite link was deleted
    { invite_link :: Maybe ChatInviteLink.ChatInviteLink -- ^ The invite link
    }
  | ChatEventVideoChatCreated -- ^ A video chat was created
    { ChatEventAction -> Maybe Int
group_call_id :: Maybe Int -- ^ Identifier of the video chat. The video chat can be received through the method getGroupCall
    }
  | ChatEventVideoChatEnded -- ^ A video chat was ended
    { group_call_id :: Maybe Int -- ^ Identifier of the video chat. The video chat can be received through the method getGroupCall
    }
  | ChatEventVideoChatMuteNewParticipantsToggled -- ^ The mute_new_participants setting of a video chat was toggled
    { ChatEventAction -> Maybe Bool
mute_new_participants :: Maybe Bool -- ^ New value of the mute_new_participants setting
    }
  | ChatEventVideoChatParticipantIsMutedToggled -- ^ A video chat participant was muted or unmuted
    { ChatEventAction -> Maybe MessageSender
participant_id :: Maybe MessageSender.MessageSender -- ^ Identifier of the affected group call participant
    , ChatEventAction -> Maybe Bool
is_muted       :: Maybe Bool                        -- ^ New value of is_muted
    }
  | ChatEventVideoChatParticipantVolumeLevelChanged -- ^ A video chat participant volume level was changed
    { participant_id :: Maybe MessageSender.MessageSender -- ^ Identifier of the affected group call participant
    , ChatEventAction -> Maybe Int
volume_level   :: Maybe Int                         -- ^ New value of volume_level; 1-20000 in hundreds of percents
    }
  | ChatEventIsForumToggled -- ^ The is_forum setting of a channel was toggled
    { ChatEventAction -> Maybe Bool
is_forum :: Maybe Bool -- ^ New value of is_forum
    }
  | ChatEventForumTopicCreated -- ^ A new forum topic was created
    { ChatEventAction -> Maybe ForumTopicInfo
topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ Information about the topic
    }
  | ChatEventForumTopicEdited -- ^ A forum topic was edited
    { ChatEventAction -> Maybe ForumTopicInfo
old_topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ Old information about the topic
    , ChatEventAction -> Maybe ForumTopicInfo
new_topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ New information about the topic
    }
  | ChatEventForumTopicToggleIsClosed -- ^ A forum topic was closed or reopened
    { topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ New information about the topic
    }
  | ChatEventForumTopicToggleIsHidden -- ^ The General forum topic was hidden or unhidden
    { topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ New information about the topic
    }
  | ChatEventForumTopicDeleted -- ^ A forum topic was deleted
    { topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ Information about the topic
    }
  | ChatEventForumTopicPinned -- ^ A pinned forum topic was changed
    { old_topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ Information about the old pinned topic; may be null
    , new_topic_info :: Maybe ForumTopicInfo.ForumTopicInfo -- ^ Information about the new pinned topic; may be null
    }
  deriving (ChatEventAction -> ChatEventAction -> Bool
(ChatEventAction -> ChatEventAction -> Bool)
-> (ChatEventAction -> ChatEventAction -> Bool)
-> Eq ChatEventAction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ChatEventAction -> ChatEventAction -> Bool
== :: ChatEventAction -> ChatEventAction -> Bool
$c/= :: ChatEventAction -> ChatEventAction -> Bool
/= :: ChatEventAction -> ChatEventAction -> Bool
Eq, Int -> ChatEventAction -> ShowS
[ChatEventAction] -> ShowS
ChatEventAction -> String
(Int -> ChatEventAction -> ShowS)
-> (ChatEventAction -> String)
-> ([ChatEventAction] -> ShowS)
-> Show ChatEventAction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ChatEventAction -> ShowS
showsPrec :: Int -> ChatEventAction -> ShowS
$cshow :: ChatEventAction -> String
show :: ChatEventAction -> String
$cshowList :: [ChatEventAction] -> ShowS
showList :: [ChatEventAction] -> ShowS
Show)

instance I.ShortShow ChatEventAction where
  shortShow :: ChatEventAction -> String
shortShow ChatEventMessageEdited
    { old_message :: ChatEventAction -> Maybe Message
old_message = Maybe Message
old_message_
    , new_message :: ChatEventAction -> Maybe Message
new_message = Maybe Message
new_message_
    }
      = String
"ChatEventMessageEdited"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_message" String -> Maybe Message -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Message
old_message_
        , String
"new_message" String -> Maybe Message -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Message
new_message_
        ]
  shortShow ChatEventMessageDeleted
    { message :: ChatEventAction -> Maybe Message
message                             = Maybe Message
message_
    , can_report_anti_spam_false_positive :: ChatEventAction -> Maybe Bool
can_report_anti_spam_false_positive = Maybe Bool
can_report_anti_spam_false_positive_
    }
      = String
"ChatEventMessageDeleted"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"message"                             String -> Maybe Message -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Message
message_
        , String
"can_report_anti_spam_false_positive" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_report_anti_spam_false_positive_
        ]
  shortShow ChatEventMessagePinned
    { message :: ChatEventAction -> Maybe Message
message = Maybe Message
message_
    }
      = String
"ChatEventMessagePinned"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"message" String -> Maybe Message -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Message
message_
        ]
  shortShow ChatEventMessageUnpinned
    { message :: ChatEventAction -> Maybe Message
message = Maybe Message
message_
    }
      = String
"ChatEventMessageUnpinned"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"message" String -> Maybe Message -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Message
message_
        ]
  shortShow ChatEventPollStopped
    { message :: ChatEventAction -> Maybe Message
message = Maybe Message
message_
    }
      = String
"ChatEventPollStopped"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"message" String -> Maybe Message -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Message
message_
        ]
  shortShow ChatEventAction
ChatEventMemberJoined
      = String
"ChatEventMemberJoined"
  shortShow ChatEventMemberJoinedByInviteLink
    { invite_link :: ChatEventAction -> Maybe ChatInviteLink
invite_link                 = Maybe ChatInviteLink
invite_link_
    , via_chat_folder_invite_link :: ChatEventAction -> Maybe Bool
via_chat_folder_invite_link = Maybe Bool
via_chat_folder_invite_link_
    }
      = String
"ChatEventMemberJoinedByInviteLink"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"invite_link"                 String -> Maybe ChatInviteLink -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatInviteLink
invite_link_
        , String
"via_chat_folder_invite_link" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
via_chat_folder_invite_link_
        ]
  shortShow ChatEventMemberJoinedByRequest
    { approver_user_id :: ChatEventAction -> Maybe Int
approver_user_id = Maybe Int
approver_user_id_
    , invite_link :: ChatEventAction -> Maybe ChatInviteLink
invite_link      = Maybe ChatInviteLink
invite_link_
    }
      = String
"ChatEventMemberJoinedByRequest"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"approver_user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
approver_user_id_
        , String
"invite_link"      String -> Maybe ChatInviteLink -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatInviteLink
invite_link_
        ]
  shortShow ChatEventMemberInvited
    { user_id :: ChatEventAction -> Maybe Int
user_id = Maybe Int
user_id_
    , status :: ChatEventAction -> Maybe ChatMemberStatus
status  = Maybe ChatMemberStatus
status_
    }
      = String
"ChatEventMemberInvited"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
        , String
"status"  String -> Maybe ChatMemberStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatMemberStatus
status_
        ]
  shortShow ChatEventAction
ChatEventMemberLeft
      = String
"ChatEventMemberLeft"
  shortShow ChatEventMemberPromoted
    { user_id :: ChatEventAction -> Maybe Int
user_id    = Maybe Int
user_id_
    , old_status :: ChatEventAction -> Maybe ChatMemberStatus
old_status = Maybe ChatMemberStatus
old_status_
    , new_status :: ChatEventAction -> Maybe ChatMemberStatus
new_status = Maybe ChatMemberStatus
new_status_
    }
      = String
"ChatEventMemberPromoted"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"user_id"    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
        , String
"old_status" String -> Maybe ChatMemberStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatMemberStatus
old_status_
        , String
"new_status" String -> Maybe ChatMemberStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatMemberStatus
new_status_
        ]
  shortShow ChatEventMemberRestricted
    { member_id :: ChatEventAction -> Maybe MessageSender
member_id  = Maybe MessageSender
member_id_
    , old_status :: ChatEventAction -> Maybe ChatMemberStatus
old_status = Maybe ChatMemberStatus
old_status_
    , new_status :: ChatEventAction -> Maybe ChatMemberStatus
new_status = Maybe ChatMemberStatus
new_status_
    }
      = String
"ChatEventMemberRestricted"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"member_id"  String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
member_id_
        , String
"old_status" String -> Maybe ChatMemberStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatMemberStatus
old_status_
        , String
"new_status" String -> Maybe ChatMemberStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatMemberStatus
new_status_
        ]
  shortShow ChatEventMemberSubscriptionExtended
    { user_id :: ChatEventAction -> Maybe Int
user_id    = Maybe Int
user_id_
    , old_status :: ChatEventAction -> Maybe ChatMemberStatus
old_status = Maybe ChatMemberStatus
old_status_
    , new_status :: ChatEventAction -> Maybe ChatMemberStatus
new_status = Maybe ChatMemberStatus
new_status_
    }
      = String
"ChatEventMemberSubscriptionExtended"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"user_id"    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
        , String
"old_status" String -> Maybe ChatMemberStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatMemberStatus
old_status_
        , String
"new_status" String -> Maybe ChatMemberStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatMemberStatus
new_status_
        ]
  shortShow ChatEventAvailableReactionsChanged
    { old_available_reactions :: ChatEventAction -> Maybe ChatAvailableReactions
old_available_reactions = Maybe ChatAvailableReactions
old_available_reactions_
    , new_available_reactions :: ChatEventAction -> Maybe ChatAvailableReactions
new_available_reactions = Maybe ChatAvailableReactions
new_available_reactions_
    }
      = String
"ChatEventAvailableReactionsChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_available_reactions" String -> Maybe ChatAvailableReactions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatAvailableReactions
old_available_reactions_
        , String
"new_available_reactions" String -> Maybe ChatAvailableReactions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatAvailableReactions
new_available_reactions_
        ]
  shortShow ChatEventBackgroundChanged
    { old_background :: ChatEventAction -> Maybe ChatBackground
old_background = Maybe ChatBackground
old_background_
    , new_background :: ChatEventAction -> Maybe ChatBackground
new_background = Maybe ChatBackground
new_background_
    }
      = String
"ChatEventBackgroundChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_background" String -> Maybe ChatBackground -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatBackground
old_background_
        , String
"new_background" String -> Maybe ChatBackground -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatBackground
new_background_
        ]
  shortShow ChatEventDescriptionChanged
    { old_description :: ChatEventAction -> Maybe Text
old_description = Maybe Text
old_description_
    , new_description :: ChatEventAction -> Maybe Text
new_description = Maybe Text
new_description_
    }
      = String
"ChatEventDescriptionChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_description" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
old_description_
        , String
"new_description" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
new_description_
        ]
  shortShow ChatEventEmojiStatusChanged
    { old_emoji_status :: ChatEventAction -> Maybe EmojiStatus
old_emoji_status = Maybe EmojiStatus
old_emoji_status_
    , new_emoji_status :: ChatEventAction -> Maybe EmojiStatus
new_emoji_status = Maybe EmojiStatus
new_emoji_status_
    }
      = String
"ChatEventEmojiStatusChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_emoji_status" String -> Maybe EmojiStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe EmojiStatus
old_emoji_status_
        , String
"new_emoji_status" String -> Maybe EmojiStatus -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe EmojiStatus
new_emoji_status_
        ]
  shortShow ChatEventLinkedChatChanged
    { old_linked_chat_id :: ChatEventAction -> Maybe Int
old_linked_chat_id = Maybe Int
old_linked_chat_id_
    , new_linked_chat_id :: ChatEventAction -> Maybe Int
new_linked_chat_id = Maybe Int
new_linked_chat_id_
    }
      = String
"ChatEventLinkedChatChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_linked_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_linked_chat_id_
        , String
"new_linked_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_linked_chat_id_
        ]
  shortShow ChatEventLocationChanged
    { old_location :: ChatEventAction -> Maybe ChatLocation
old_location = Maybe ChatLocation
old_location_
    , new_location :: ChatEventAction -> Maybe ChatLocation
new_location = Maybe ChatLocation
new_location_
    }
      = String
"ChatEventLocationChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_location" String -> Maybe ChatLocation -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatLocation
old_location_
        , String
"new_location" String -> Maybe ChatLocation -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatLocation
new_location_
        ]
  shortShow ChatEventMessageAutoDeleteTimeChanged
    { old_message_auto_delete_time :: ChatEventAction -> Maybe Int
old_message_auto_delete_time = Maybe Int
old_message_auto_delete_time_
    , new_message_auto_delete_time :: ChatEventAction -> Maybe Int
new_message_auto_delete_time = Maybe Int
new_message_auto_delete_time_
    }
      = String
"ChatEventMessageAutoDeleteTimeChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_message_auto_delete_time" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_message_auto_delete_time_
        , String
"new_message_auto_delete_time" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_message_auto_delete_time_
        ]
  shortShow ChatEventPermissionsChanged
    { old_permissions :: ChatEventAction -> Maybe ChatPermissions
old_permissions = Maybe ChatPermissions
old_permissions_
    , new_permissions :: ChatEventAction -> Maybe ChatPermissions
new_permissions = Maybe ChatPermissions
new_permissions_
    }
      = String
"ChatEventPermissionsChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_permissions" String -> Maybe ChatPermissions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPermissions
old_permissions_
        , String
"new_permissions" String -> Maybe ChatPermissions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPermissions
new_permissions_
        ]
  shortShow ChatEventPhotoChanged
    { old_photo :: ChatEventAction -> Maybe ChatPhoto
old_photo = Maybe ChatPhoto
old_photo_
    , new_photo :: ChatEventAction -> Maybe ChatPhoto
new_photo = Maybe ChatPhoto
new_photo_
    }
      = String
"ChatEventPhotoChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_photo" String -> Maybe ChatPhoto -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPhoto
old_photo_
        , String
"new_photo" String -> Maybe ChatPhoto -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPhoto
new_photo_
        ]
  shortShow ChatEventSlowModeDelayChanged
    { old_slow_mode_delay :: ChatEventAction -> Maybe Int
old_slow_mode_delay = Maybe Int
old_slow_mode_delay_
    , new_slow_mode_delay :: ChatEventAction -> Maybe Int
new_slow_mode_delay = Maybe Int
new_slow_mode_delay_
    }
      = String
"ChatEventSlowModeDelayChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_slow_mode_delay" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_slow_mode_delay_
        , String
"new_slow_mode_delay" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_slow_mode_delay_
        ]
  shortShow ChatEventStickerSetChanged
    { old_sticker_set_id :: ChatEventAction -> Maybe Int
old_sticker_set_id = Maybe Int
old_sticker_set_id_
    , new_sticker_set_id :: ChatEventAction -> Maybe Int
new_sticker_set_id = Maybe Int
new_sticker_set_id_
    }
      = String
"ChatEventStickerSetChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_sticker_set_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_sticker_set_id_
        , String
"new_sticker_set_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_sticker_set_id_
        ]
  shortShow ChatEventCustomEmojiStickerSetChanged
    { old_sticker_set_id :: ChatEventAction -> Maybe Int
old_sticker_set_id = Maybe Int
old_sticker_set_id_
    , new_sticker_set_id :: ChatEventAction -> Maybe Int
new_sticker_set_id = Maybe Int
new_sticker_set_id_
    }
      = String
"ChatEventCustomEmojiStickerSetChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_sticker_set_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_sticker_set_id_
        , String
"new_sticker_set_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_sticker_set_id_
        ]
  shortShow ChatEventTitleChanged
    { old_title :: ChatEventAction -> Maybe Text
old_title = Maybe Text
old_title_
    , new_title :: ChatEventAction -> Maybe Text
new_title = Maybe Text
new_title_
    }
      = String
"ChatEventTitleChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
old_title_
        , String
"new_title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
new_title_
        ]
  shortShow ChatEventUsernameChanged
    { old_username :: ChatEventAction -> Maybe Text
old_username = Maybe Text
old_username_
    , new_username :: ChatEventAction -> Maybe Text
new_username = Maybe Text
new_username_
    }
      = String
"ChatEventUsernameChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
old_username_
        , String
"new_username" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
new_username_
        ]
  shortShow ChatEventActiveUsernamesChanged
    { old_usernames :: ChatEventAction -> Maybe [Text]
old_usernames = Maybe [Text]
old_usernames_
    , new_usernames :: ChatEventAction -> Maybe [Text]
new_usernames = Maybe [Text]
new_usernames_
    }
      = String
"ChatEventActiveUsernamesChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_usernames" String -> Maybe [Text] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Text]
old_usernames_
        , String
"new_usernames" String -> Maybe [Text] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Text]
new_usernames_
        ]
  shortShow ChatEventAccentColorChanged
    { old_accent_color_id :: ChatEventAction -> Maybe Int
old_accent_color_id            = Maybe Int
old_accent_color_id_
    , old_background_custom_emoji_id :: ChatEventAction -> Maybe Int
old_background_custom_emoji_id = Maybe Int
old_background_custom_emoji_id_
    , new_accent_color_id :: ChatEventAction -> Maybe Int
new_accent_color_id            = Maybe Int
new_accent_color_id_
    , new_background_custom_emoji_id :: ChatEventAction -> Maybe Int
new_background_custom_emoji_id = Maybe Int
new_background_custom_emoji_id_
    }
      = String
"ChatEventAccentColorChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_accent_color_id"            String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_accent_color_id_
        , String
"old_background_custom_emoji_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_background_custom_emoji_id_
        , String
"new_accent_color_id"            String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_accent_color_id_
        , String
"new_background_custom_emoji_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_background_custom_emoji_id_
        ]
  shortShow ChatEventProfileAccentColorChanged
    { old_profile_accent_color_id :: ChatEventAction -> Maybe Int
old_profile_accent_color_id            = Maybe Int
old_profile_accent_color_id_
    , old_profile_background_custom_emoji_id :: ChatEventAction -> Maybe Int
old_profile_background_custom_emoji_id = Maybe Int
old_profile_background_custom_emoji_id_
    , new_profile_accent_color_id :: ChatEventAction -> Maybe Int
new_profile_accent_color_id            = Maybe Int
new_profile_accent_color_id_
    , new_profile_background_custom_emoji_id :: ChatEventAction -> Maybe Int
new_profile_background_custom_emoji_id = Maybe Int
new_profile_background_custom_emoji_id_
    }
      = String
"ChatEventProfileAccentColorChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_profile_accent_color_id"            String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_profile_accent_color_id_
        , String
"old_profile_background_custom_emoji_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_profile_background_custom_emoji_id_
        , String
"new_profile_accent_color_id"            String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_profile_accent_color_id_
        , String
"new_profile_background_custom_emoji_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
new_profile_background_custom_emoji_id_
        ]
  shortShow ChatEventHasProtectedContentToggled
    { has_protected_content :: ChatEventAction -> Maybe Bool
has_protected_content = Maybe Bool
has_protected_content_
    }
      = String
"ChatEventHasProtectedContentToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"has_protected_content" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_protected_content_
        ]
  shortShow ChatEventInvitesToggled
    { can_invite_users :: ChatEventAction -> Maybe Bool
can_invite_users = Maybe Bool
can_invite_users_
    }
      = String
"ChatEventInvitesToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"can_invite_users" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_invite_users_
        ]
  shortShow ChatEventIsAllHistoryAvailableToggled
    { is_all_history_available :: ChatEventAction -> Maybe Bool
is_all_history_available = Maybe Bool
is_all_history_available_
    }
      = String
"ChatEventIsAllHistoryAvailableToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"is_all_history_available" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_all_history_available_
        ]
  shortShow ChatEventHasAggressiveAntiSpamEnabledToggled
    { has_aggressive_anti_spam_enabled :: ChatEventAction -> Maybe Bool
has_aggressive_anti_spam_enabled = Maybe Bool
has_aggressive_anti_spam_enabled_
    }
      = String
"ChatEventHasAggressiveAntiSpamEnabledToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"has_aggressive_anti_spam_enabled" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_aggressive_anti_spam_enabled_
        ]
  shortShow ChatEventSignMessagesToggled
    { sign_messages :: ChatEventAction -> Maybe Bool
sign_messages = Maybe Bool
sign_messages_
    }
      = String
"ChatEventSignMessagesToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"sign_messages" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
sign_messages_
        ]
  shortShow ChatEventShowMessageSenderToggled
    { show_message_sender :: ChatEventAction -> Maybe Bool
show_message_sender = Maybe Bool
show_message_sender_
    }
      = String
"ChatEventShowMessageSenderToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"show_message_sender" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_message_sender_
        ]
  shortShow ChatEventInviteLinkEdited
    { old_invite_link :: ChatEventAction -> Maybe ChatInviteLink
old_invite_link = Maybe ChatInviteLink
old_invite_link_
    , new_invite_link :: ChatEventAction -> Maybe ChatInviteLink
new_invite_link = Maybe ChatInviteLink
new_invite_link_
    }
      = String
"ChatEventInviteLinkEdited"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_invite_link" String -> Maybe ChatInviteLink -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatInviteLink
old_invite_link_
        , String
"new_invite_link" String -> Maybe ChatInviteLink -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatInviteLink
new_invite_link_
        ]
  shortShow ChatEventInviteLinkRevoked
    { invite_link :: ChatEventAction -> Maybe ChatInviteLink
invite_link = Maybe ChatInviteLink
invite_link_
    }
      = String
"ChatEventInviteLinkRevoked"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"invite_link" String -> Maybe ChatInviteLink -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatInviteLink
invite_link_
        ]
  shortShow ChatEventInviteLinkDeleted
    { invite_link :: ChatEventAction -> Maybe ChatInviteLink
invite_link = Maybe ChatInviteLink
invite_link_
    }
      = String
"ChatEventInviteLinkDeleted"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"invite_link" String -> Maybe ChatInviteLink -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatInviteLink
invite_link_
        ]
  shortShow ChatEventVideoChatCreated
    { group_call_id :: ChatEventAction -> Maybe Int
group_call_id = Maybe Int
group_call_id_
    }
      = String
"ChatEventVideoChatCreated"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"group_call_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
group_call_id_
        ]
  shortShow ChatEventVideoChatEnded
    { group_call_id :: ChatEventAction -> Maybe Int
group_call_id = Maybe Int
group_call_id_
    }
      = String
"ChatEventVideoChatEnded"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"group_call_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
group_call_id_
        ]
  shortShow ChatEventVideoChatMuteNewParticipantsToggled
    { mute_new_participants :: ChatEventAction -> Maybe Bool
mute_new_participants = Maybe Bool
mute_new_participants_
    }
      = String
"ChatEventVideoChatMuteNewParticipantsToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"mute_new_participants" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
mute_new_participants_
        ]
  shortShow ChatEventVideoChatParticipantIsMutedToggled
    { participant_id :: ChatEventAction -> Maybe MessageSender
participant_id = Maybe MessageSender
participant_id_
    , is_muted :: ChatEventAction -> Maybe Bool
is_muted       = Maybe Bool
is_muted_
    }
      = String
"ChatEventVideoChatParticipantIsMutedToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"participant_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
participant_id_
        , String
"is_muted"       String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_muted_
        ]
  shortShow ChatEventVideoChatParticipantVolumeLevelChanged
    { participant_id :: ChatEventAction -> Maybe MessageSender
participant_id = Maybe MessageSender
participant_id_
    , volume_level :: ChatEventAction -> Maybe Int
volume_level   = Maybe Int
volume_level_
    }
      = String
"ChatEventVideoChatParticipantVolumeLevelChanged"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"participant_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
participant_id_
        , String
"volume_level"   String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
volume_level_
        ]
  shortShow ChatEventIsForumToggled
    { is_forum :: ChatEventAction -> Maybe Bool
is_forum = Maybe Bool
is_forum_
    }
      = String
"ChatEventIsForumToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"is_forum" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_forum_
        ]
  shortShow ChatEventForumTopicCreated
    { topic_info :: ChatEventAction -> Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
    }
      = String
"ChatEventForumTopicCreated"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
topic_info_
        ]
  shortShow ChatEventForumTopicEdited
    { old_topic_info :: ChatEventAction -> Maybe ForumTopicInfo
old_topic_info = Maybe ForumTopicInfo
old_topic_info_
    , new_topic_info :: ChatEventAction -> Maybe ForumTopicInfo
new_topic_info = Maybe ForumTopicInfo
new_topic_info_
    }
      = String
"ChatEventForumTopicEdited"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
old_topic_info_
        , String
"new_topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
new_topic_info_
        ]
  shortShow ChatEventForumTopicToggleIsClosed
    { topic_info :: ChatEventAction -> Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
    }
      = String
"ChatEventForumTopicToggleIsClosed"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
topic_info_
        ]
  shortShow ChatEventForumTopicToggleIsHidden
    { topic_info :: ChatEventAction -> Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
    }
      = String
"ChatEventForumTopicToggleIsHidden"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
topic_info_
        ]
  shortShow ChatEventForumTopicDeleted
    { topic_info :: ChatEventAction -> Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
    }
      = String
"ChatEventForumTopicDeleted"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
topic_info_
        ]
  shortShow ChatEventForumTopicPinned
    { old_topic_info :: ChatEventAction -> Maybe ForumTopicInfo
old_topic_info = Maybe ForumTopicInfo
old_topic_info_
    , new_topic_info :: ChatEventAction -> Maybe ForumTopicInfo
new_topic_info = Maybe ForumTopicInfo
new_topic_info_
    }
      = String
"ChatEventForumTopicPinned"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
old_topic_info_
        , String
"new_topic_info" String -> Maybe ForumTopicInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicInfo
new_topic_info_
        ]

instance AT.FromJSON ChatEventAction where
  parseJSON :: Value -> Parser ChatEventAction
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
"chatEventMessageEdited"                          -> Value -> Parser ChatEventAction
parseChatEventMessageEdited Value
v
      String
"chatEventMessageDeleted"                         -> Value -> Parser ChatEventAction
parseChatEventMessageDeleted Value
v
      String
"chatEventMessagePinned"                          -> Value -> Parser ChatEventAction
parseChatEventMessagePinned Value
v
      String
"chatEventMessageUnpinned"                        -> Value -> Parser ChatEventAction
parseChatEventMessageUnpinned Value
v
      String
"chatEventPollStopped"                            -> Value -> Parser ChatEventAction
parseChatEventPollStopped Value
v
      String
"chatEventMemberJoined"                           -> ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ChatEventAction
ChatEventMemberJoined
      String
"chatEventMemberJoinedByInviteLink"               -> Value -> Parser ChatEventAction
parseChatEventMemberJoinedByInviteLink Value
v
      String
"chatEventMemberJoinedByRequest"                  -> Value -> Parser ChatEventAction
parseChatEventMemberJoinedByRequest Value
v
      String
"chatEventMemberInvited"                          -> Value -> Parser ChatEventAction
parseChatEventMemberInvited Value
v
      String
"chatEventMemberLeft"                             -> ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure ChatEventAction
ChatEventMemberLeft
      String
"chatEventMemberPromoted"                         -> Value -> Parser ChatEventAction
parseChatEventMemberPromoted Value
v
      String
"chatEventMemberRestricted"                       -> Value -> Parser ChatEventAction
parseChatEventMemberRestricted Value
v
      String
"chatEventMemberSubscriptionExtended"             -> Value -> Parser ChatEventAction
parseChatEventMemberSubscriptionExtended Value
v
      String
"chatEventAvailableReactionsChanged"              -> Value -> Parser ChatEventAction
parseChatEventAvailableReactionsChanged Value
v
      String
"chatEventBackgroundChanged"                      -> Value -> Parser ChatEventAction
parseChatEventBackgroundChanged Value
v
      String
"chatEventDescriptionChanged"                     -> Value -> Parser ChatEventAction
parseChatEventDescriptionChanged Value
v
      String
"chatEventEmojiStatusChanged"                     -> Value -> Parser ChatEventAction
parseChatEventEmojiStatusChanged Value
v
      String
"chatEventLinkedChatChanged"                      -> Value -> Parser ChatEventAction
parseChatEventLinkedChatChanged Value
v
      String
"chatEventLocationChanged"                        -> Value -> Parser ChatEventAction
parseChatEventLocationChanged Value
v
      String
"chatEventMessageAutoDeleteTimeChanged"           -> Value -> Parser ChatEventAction
parseChatEventMessageAutoDeleteTimeChanged Value
v
      String
"chatEventPermissionsChanged"                     -> Value -> Parser ChatEventAction
parseChatEventPermissionsChanged Value
v
      String
"chatEventPhotoChanged"                           -> Value -> Parser ChatEventAction
parseChatEventPhotoChanged Value
v
      String
"chatEventSlowModeDelayChanged"                   -> Value -> Parser ChatEventAction
parseChatEventSlowModeDelayChanged Value
v
      String
"chatEventStickerSetChanged"                      -> Value -> Parser ChatEventAction
parseChatEventStickerSetChanged Value
v
      String
"chatEventCustomEmojiStickerSetChanged"           -> Value -> Parser ChatEventAction
parseChatEventCustomEmojiStickerSetChanged Value
v
      String
"chatEventTitleChanged"                           -> Value -> Parser ChatEventAction
parseChatEventTitleChanged Value
v
      String
"chatEventUsernameChanged"                        -> Value -> Parser ChatEventAction
parseChatEventUsernameChanged Value
v
      String
"chatEventActiveUsernamesChanged"                 -> Value -> Parser ChatEventAction
parseChatEventActiveUsernamesChanged Value
v
      String
"chatEventAccentColorChanged"                     -> Value -> Parser ChatEventAction
parseChatEventAccentColorChanged Value
v
      String
"chatEventProfileAccentColorChanged"              -> Value -> Parser ChatEventAction
parseChatEventProfileAccentColorChanged Value
v
      String
"chatEventHasProtectedContentToggled"             -> Value -> Parser ChatEventAction
parseChatEventHasProtectedContentToggled Value
v
      String
"chatEventInvitesToggled"                         -> Value -> Parser ChatEventAction
parseChatEventInvitesToggled Value
v
      String
"chatEventIsAllHistoryAvailableToggled"           -> Value -> Parser ChatEventAction
parseChatEventIsAllHistoryAvailableToggled Value
v
      String
"chatEventHasAggressiveAntiSpamEnabledToggled"    -> Value -> Parser ChatEventAction
parseChatEventHasAggressiveAntiSpamEnabledToggled Value
v
      String
"chatEventSignMessagesToggled"                    -> Value -> Parser ChatEventAction
parseChatEventSignMessagesToggled Value
v
      String
"chatEventShowMessageSenderToggled"               -> Value -> Parser ChatEventAction
parseChatEventShowMessageSenderToggled Value
v
      String
"chatEventInviteLinkEdited"                       -> Value -> Parser ChatEventAction
parseChatEventInviteLinkEdited Value
v
      String
"chatEventInviteLinkRevoked"                      -> Value -> Parser ChatEventAction
parseChatEventInviteLinkRevoked Value
v
      String
"chatEventInviteLinkDeleted"                      -> Value -> Parser ChatEventAction
parseChatEventInviteLinkDeleted Value
v
      String
"chatEventVideoChatCreated"                       -> Value -> Parser ChatEventAction
parseChatEventVideoChatCreated Value
v
      String
"chatEventVideoChatEnded"                         -> Value -> Parser ChatEventAction
parseChatEventVideoChatEnded Value
v
      String
"chatEventVideoChatMuteNewParticipantsToggled"    -> Value -> Parser ChatEventAction
parseChatEventVideoChatMuteNewParticipantsToggled Value
v
      String
"chatEventVideoChatParticipantIsMutedToggled"     -> Value -> Parser ChatEventAction
parseChatEventVideoChatParticipantIsMutedToggled Value
v
      String
"chatEventVideoChatParticipantVolumeLevelChanged" -> Value -> Parser ChatEventAction
parseChatEventVideoChatParticipantVolumeLevelChanged Value
v
      String
"chatEventIsForumToggled"                         -> Value -> Parser ChatEventAction
parseChatEventIsForumToggled Value
v
      String
"chatEventForumTopicCreated"                      -> Value -> Parser ChatEventAction
parseChatEventForumTopicCreated Value
v
      String
"chatEventForumTopicEdited"                       -> Value -> Parser ChatEventAction
parseChatEventForumTopicEdited Value
v
      String
"chatEventForumTopicToggleIsClosed"               -> Value -> Parser ChatEventAction
parseChatEventForumTopicToggleIsClosed Value
v
      String
"chatEventForumTopicToggleIsHidden"               -> Value -> Parser ChatEventAction
parseChatEventForumTopicToggleIsHidden Value
v
      String
"chatEventForumTopicDeleted"                      -> Value -> Parser ChatEventAction
parseChatEventForumTopicDeleted Value
v
      String
"chatEventForumTopicPinned"                       -> Value -> Parser ChatEventAction
parseChatEventForumTopicPinned Value
v
      String
_                                                 -> Parser ChatEventAction
forall a. Monoid a => a
mempty
    
    where
      parseChatEventMessageEdited :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMessageEdited :: Value -> Parser ChatEventAction
parseChatEventMessageEdited = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMessageEdited" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Message
old_message_ <- Object
o Object -> Key -> Parser (Maybe Message)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_message"
        Maybe Message
new_message_ <- Object
o Object -> Key -> Parser (Maybe Message)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_message"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMessageEdited
          { old_message :: Maybe Message
old_message = Maybe Message
old_message_
          , new_message :: Maybe Message
new_message = Maybe Message
new_message_
          }
      parseChatEventMessageDeleted :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMessageDeleted :: Value -> Parser ChatEventAction
parseChatEventMessageDeleted = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMessageDeleted" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Message
message_                             <- Object
o Object -> Key -> Parser (Maybe Message)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"message"
        Maybe Bool
can_report_anti_spam_false_positive_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_report_anti_spam_false_positive"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMessageDeleted
          { message :: Maybe Message
message                             = Maybe Message
message_
          , can_report_anti_spam_false_positive :: Maybe Bool
can_report_anti_spam_false_positive = Maybe Bool
can_report_anti_spam_false_positive_
          }
      parseChatEventMessagePinned :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMessagePinned :: Value -> Parser ChatEventAction
parseChatEventMessagePinned = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMessagePinned" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Message
message_ <- Object
o Object -> Key -> Parser (Maybe Message)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"message"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMessagePinned
          { message :: Maybe Message
message = Maybe Message
message_
          }
      parseChatEventMessageUnpinned :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMessageUnpinned :: Value -> Parser ChatEventAction
parseChatEventMessageUnpinned = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMessageUnpinned" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Message
message_ <- Object
o Object -> Key -> Parser (Maybe Message)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"message"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMessageUnpinned
          { message :: Maybe Message
message = Maybe Message
message_
          }
      parseChatEventPollStopped :: A.Value -> AT.Parser ChatEventAction
      parseChatEventPollStopped :: Value -> Parser ChatEventAction
parseChatEventPollStopped = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventPollStopped" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Message
message_ <- Object
o Object -> Key -> Parser (Maybe Message)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"message"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventPollStopped
          { message :: Maybe Message
message = Maybe Message
message_
          }
      parseChatEventMemberJoinedByInviteLink :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMemberJoinedByInviteLink :: Value -> Parser ChatEventAction
parseChatEventMemberJoinedByInviteLink = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMemberJoinedByInviteLink" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatInviteLink
invite_link_                 <- Object
o Object -> Key -> Parser (Maybe ChatInviteLink)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"invite_link"
        Maybe Bool
via_chat_folder_invite_link_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"via_chat_folder_invite_link"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMemberJoinedByInviteLink
          { invite_link :: Maybe ChatInviteLink
invite_link                 = Maybe ChatInviteLink
invite_link_
          , via_chat_folder_invite_link :: Maybe Bool
via_chat_folder_invite_link = Maybe Bool
via_chat_folder_invite_link_
          }
      parseChatEventMemberJoinedByRequest :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMemberJoinedByRequest :: Value -> Parser ChatEventAction
parseChatEventMemberJoinedByRequest = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMemberJoinedByRequest" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
approver_user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"approver_user_id"
        Maybe ChatInviteLink
invite_link_      <- Object
o Object -> Key -> Parser (Maybe ChatInviteLink)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"invite_link"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMemberJoinedByRequest
          { approver_user_id :: Maybe Int
approver_user_id = Maybe Int
approver_user_id_
          , invite_link :: Maybe ChatInviteLink
invite_link      = Maybe ChatInviteLink
invite_link_
          }
      parseChatEventMemberInvited :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMemberInvited :: Value -> Parser ChatEventAction
parseChatEventMemberInvited = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMemberInvited" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"user_id"
        Maybe ChatMemberStatus
status_  <- Object
o Object -> Key -> Parser (Maybe ChatMemberStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"status"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMemberInvited
          { user_id :: Maybe Int
user_id = Maybe Int
user_id_
          , status :: Maybe ChatMemberStatus
status  = Maybe ChatMemberStatus
status_
          }
      parseChatEventMemberPromoted :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMemberPromoted :: Value -> Parser ChatEventAction
parseChatEventMemberPromoted = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMemberPromoted" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
user_id_    <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"user_id"
        Maybe ChatMemberStatus
old_status_ <- Object
o Object -> Key -> Parser (Maybe ChatMemberStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_status"
        Maybe ChatMemberStatus
new_status_ <- Object
o Object -> Key -> Parser (Maybe ChatMemberStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_status"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMemberPromoted
          { user_id :: Maybe Int
user_id    = Maybe Int
user_id_
          , old_status :: Maybe ChatMemberStatus
old_status = Maybe ChatMemberStatus
old_status_
          , new_status :: Maybe ChatMemberStatus
new_status = Maybe ChatMemberStatus
new_status_
          }
      parseChatEventMemberRestricted :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMemberRestricted :: Value -> Parser ChatEventAction
parseChatEventMemberRestricted = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMemberRestricted" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe MessageSender
member_id_  <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"member_id"
        Maybe ChatMemberStatus
old_status_ <- Object
o Object -> Key -> Parser (Maybe ChatMemberStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_status"
        Maybe ChatMemberStatus
new_status_ <- Object
o Object -> Key -> Parser (Maybe ChatMemberStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_status"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMemberRestricted
          { member_id :: Maybe MessageSender
member_id  = Maybe MessageSender
member_id_
          , old_status :: Maybe ChatMemberStatus
old_status = Maybe ChatMemberStatus
old_status_
          , new_status :: Maybe ChatMemberStatus
new_status = Maybe ChatMemberStatus
new_status_
          }
      parseChatEventMemberSubscriptionExtended :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMemberSubscriptionExtended :: Value -> Parser ChatEventAction
parseChatEventMemberSubscriptionExtended = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMemberSubscriptionExtended" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
user_id_    <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"user_id"
        Maybe ChatMemberStatus
old_status_ <- Object
o Object -> Key -> Parser (Maybe ChatMemberStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_status"
        Maybe ChatMemberStatus
new_status_ <- Object
o Object -> Key -> Parser (Maybe ChatMemberStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_status"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMemberSubscriptionExtended
          { user_id :: Maybe Int
user_id    = Maybe Int
user_id_
          , old_status :: Maybe ChatMemberStatus
old_status = Maybe ChatMemberStatus
old_status_
          , new_status :: Maybe ChatMemberStatus
new_status = Maybe ChatMemberStatus
new_status_
          }
      parseChatEventAvailableReactionsChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventAvailableReactionsChanged :: Value -> Parser ChatEventAction
parseChatEventAvailableReactionsChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventAvailableReactionsChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatAvailableReactions
old_available_reactions_ <- Object
o Object -> Key -> Parser (Maybe ChatAvailableReactions)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_available_reactions"
        Maybe ChatAvailableReactions
new_available_reactions_ <- Object
o Object -> Key -> Parser (Maybe ChatAvailableReactions)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_available_reactions"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventAvailableReactionsChanged
          { old_available_reactions :: Maybe ChatAvailableReactions
old_available_reactions = Maybe ChatAvailableReactions
old_available_reactions_
          , new_available_reactions :: Maybe ChatAvailableReactions
new_available_reactions = Maybe ChatAvailableReactions
new_available_reactions_
          }
      parseChatEventBackgroundChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventBackgroundChanged :: Value -> Parser ChatEventAction
parseChatEventBackgroundChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventBackgroundChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatBackground
old_background_ <- Object
o Object -> Key -> Parser (Maybe ChatBackground)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_background"
        Maybe ChatBackground
new_background_ <- Object
o Object -> Key -> Parser (Maybe ChatBackground)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_background"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventBackgroundChanged
          { old_background :: Maybe ChatBackground
old_background = Maybe ChatBackground
old_background_
          , new_background :: Maybe ChatBackground
new_background = Maybe ChatBackground
new_background_
          }
      parseChatEventDescriptionChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventDescriptionChanged :: Value -> Parser ChatEventAction
parseChatEventDescriptionChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventDescriptionChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
old_description_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_description"
        Maybe Text
new_description_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_description"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventDescriptionChanged
          { old_description :: Maybe Text
old_description = Maybe Text
old_description_
          , new_description :: Maybe Text
new_description = Maybe Text
new_description_
          }
      parseChatEventEmojiStatusChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventEmojiStatusChanged :: Value -> Parser ChatEventAction
parseChatEventEmojiStatusChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventEmojiStatusChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe EmojiStatus
old_emoji_status_ <- Object
o Object -> Key -> Parser (Maybe EmojiStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_emoji_status"
        Maybe EmojiStatus
new_emoji_status_ <- Object
o Object -> Key -> Parser (Maybe EmojiStatus)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_emoji_status"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventEmojiStatusChanged
          { old_emoji_status :: Maybe EmojiStatus
old_emoji_status = Maybe EmojiStatus
old_emoji_status_
          , new_emoji_status :: Maybe EmojiStatus
new_emoji_status = Maybe EmojiStatus
new_emoji_status_
          }
      parseChatEventLinkedChatChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventLinkedChatChanged :: Value -> Parser ChatEventAction
parseChatEventLinkedChatChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventLinkedChatChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_linked_chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_linked_chat_id"
        Maybe Int
new_linked_chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_linked_chat_id"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventLinkedChatChanged
          { old_linked_chat_id :: Maybe Int
old_linked_chat_id = Maybe Int
old_linked_chat_id_
          , new_linked_chat_id :: Maybe Int
new_linked_chat_id = Maybe Int
new_linked_chat_id_
          }
      parseChatEventLocationChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventLocationChanged :: Value -> Parser ChatEventAction
parseChatEventLocationChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventLocationChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatLocation
old_location_ <- Object
o Object -> Key -> Parser (Maybe ChatLocation)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_location"
        Maybe ChatLocation
new_location_ <- Object
o Object -> Key -> Parser (Maybe ChatLocation)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_location"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventLocationChanged
          { old_location :: Maybe ChatLocation
old_location = Maybe ChatLocation
old_location_
          , new_location :: Maybe ChatLocation
new_location = Maybe ChatLocation
new_location_
          }
      parseChatEventMessageAutoDeleteTimeChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventMessageAutoDeleteTimeChanged :: Value -> Parser ChatEventAction
parseChatEventMessageAutoDeleteTimeChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventMessageAutoDeleteTimeChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_message_auto_delete_time_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_message_auto_delete_time"
        Maybe Int
new_message_auto_delete_time_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_message_auto_delete_time"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventMessageAutoDeleteTimeChanged
          { old_message_auto_delete_time :: Maybe Int
old_message_auto_delete_time = Maybe Int
old_message_auto_delete_time_
          , new_message_auto_delete_time :: Maybe Int
new_message_auto_delete_time = Maybe Int
new_message_auto_delete_time_
          }
      parseChatEventPermissionsChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventPermissionsChanged :: Value -> Parser ChatEventAction
parseChatEventPermissionsChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventPermissionsChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatPermissions
old_permissions_ <- Object
o Object -> Key -> Parser (Maybe ChatPermissions)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_permissions"
        Maybe ChatPermissions
new_permissions_ <- Object
o Object -> Key -> Parser (Maybe ChatPermissions)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_permissions"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventPermissionsChanged
          { old_permissions :: Maybe ChatPermissions
old_permissions = Maybe ChatPermissions
old_permissions_
          , new_permissions :: Maybe ChatPermissions
new_permissions = Maybe ChatPermissions
new_permissions_
          }
      parseChatEventPhotoChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventPhotoChanged :: Value -> Parser ChatEventAction
parseChatEventPhotoChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventPhotoChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatPhoto
old_photo_ <- Object
o Object -> Key -> Parser (Maybe ChatPhoto)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_photo"
        Maybe ChatPhoto
new_photo_ <- Object
o Object -> Key -> Parser (Maybe ChatPhoto)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_photo"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventPhotoChanged
          { old_photo :: Maybe ChatPhoto
old_photo = Maybe ChatPhoto
old_photo_
          , new_photo :: Maybe ChatPhoto
new_photo = Maybe ChatPhoto
new_photo_
          }
      parseChatEventSlowModeDelayChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventSlowModeDelayChanged :: Value -> Parser ChatEventAction
parseChatEventSlowModeDelayChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventSlowModeDelayChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_slow_mode_delay_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_slow_mode_delay"
        Maybe Int
new_slow_mode_delay_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_slow_mode_delay"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventSlowModeDelayChanged
          { old_slow_mode_delay :: Maybe Int
old_slow_mode_delay = Maybe Int
old_slow_mode_delay_
          , new_slow_mode_delay :: Maybe Int
new_slow_mode_delay = Maybe Int
new_slow_mode_delay_
          }
      parseChatEventStickerSetChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventStickerSetChanged :: Value -> Parser ChatEventAction
parseChatEventStickerSetChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventStickerSetChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_sticker_set_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
"old_sticker_set_id"
        Maybe Int
new_sticker_set_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
"new_sticker_set_id"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventStickerSetChanged
          { old_sticker_set_id :: Maybe Int
old_sticker_set_id = Maybe Int
old_sticker_set_id_
          , new_sticker_set_id :: Maybe Int
new_sticker_set_id = Maybe Int
new_sticker_set_id_
          }
      parseChatEventCustomEmojiStickerSetChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventCustomEmojiStickerSetChanged :: Value -> Parser ChatEventAction
parseChatEventCustomEmojiStickerSetChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventCustomEmojiStickerSetChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_sticker_set_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
"old_sticker_set_id"
        Maybe Int
new_sticker_set_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
"new_sticker_set_id"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventCustomEmojiStickerSetChanged
          { old_sticker_set_id :: Maybe Int
old_sticker_set_id = Maybe Int
old_sticker_set_id_
          , new_sticker_set_id :: Maybe Int
new_sticker_set_id = Maybe Int
new_sticker_set_id_
          }
      parseChatEventTitleChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventTitleChanged :: Value -> Parser ChatEventAction
parseChatEventTitleChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventTitleChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
old_title_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_title"
        Maybe Text
new_title_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_title"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventTitleChanged
          { old_title :: Maybe Text
old_title = Maybe Text
old_title_
          , new_title :: Maybe Text
new_title = Maybe Text
new_title_
          }
      parseChatEventUsernameChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventUsernameChanged :: Value -> Parser ChatEventAction
parseChatEventUsernameChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventUsernameChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
old_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_username"
        Maybe Text
new_username_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_username"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventUsernameChanged
          { old_username :: Maybe Text
old_username = Maybe Text
old_username_
          , new_username :: Maybe Text
new_username = Maybe Text
new_username_
          }
      parseChatEventActiveUsernamesChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventActiveUsernamesChanged :: Value -> Parser ChatEventAction
parseChatEventActiveUsernamesChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventActiveUsernamesChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [Text]
old_usernames_ <- Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_usernames"
        Maybe [Text]
new_usernames_ <- Object
o Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_usernames"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventActiveUsernamesChanged
          { old_usernames :: Maybe [Text]
old_usernames = Maybe [Text]
old_usernames_
          , new_usernames :: Maybe [Text]
new_usernames = Maybe [Text]
new_usernames_
          }
      parseChatEventAccentColorChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventAccentColorChanged :: Value -> Parser ChatEventAction
parseChatEventAccentColorChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventAccentColorChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_accent_color_id_            <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"old_accent_color_id"
        Maybe Int
old_background_custom_emoji_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
"old_background_custom_emoji_id"
        Maybe Int
new_accent_color_id_            <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"new_accent_color_id"
        Maybe Int
new_background_custom_emoji_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
"new_background_custom_emoji_id"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventAccentColorChanged
          { old_accent_color_id :: Maybe Int
old_accent_color_id            = Maybe Int
old_accent_color_id_
          , old_background_custom_emoji_id :: Maybe Int
old_background_custom_emoji_id = Maybe Int
old_background_custom_emoji_id_
          , new_accent_color_id :: Maybe Int
new_accent_color_id            = Maybe Int
new_accent_color_id_
          , new_background_custom_emoji_id :: Maybe Int
new_background_custom_emoji_id = Maybe Int
new_background_custom_emoji_id_
          }
      parseChatEventProfileAccentColorChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventProfileAccentColorChanged :: Value -> Parser ChatEventAction
parseChatEventProfileAccentColorChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventProfileAccentColorChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_profile_accent_color_id_            <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"old_profile_accent_color_id"
        Maybe Int
old_profile_background_custom_emoji_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
"old_profile_background_custom_emoji_id"
        Maybe Int
new_profile_accent_color_id_            <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"new_profile_accent_color_id"
        Maybe Int
new_profile_background_custom_emoji_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
"new_profile_background_custom_emoji_id"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventProfileAccentColorChanged
          { old_profile_accent_color_id :: Maybe Int
old_profile_accent_color_id            = Maybe Int
old_profile_accent_color_id_
          , old_profile_background_custom_emoji_id :: Maybe Int
old_profile_background_custom_emoji_id = Maybe Int
old_profile_background_custom_emoji_id_
          , new_profile_accent_color_id :: Maybe Int
new_profile_accent_color_id            = Maybe Int
new_profile_accent_color_id_
          , new_profile_background_custom_emoji_id :: Maybe Int
new_profile_background_custom_emoji_id = Maybe Int
new_profile_background_custom_emoji_id_
          }
      parseChatEventHasProtectedContentToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventHasProtectedContentToggled :: Value -> Parser ChatEventAction
parseChatEventHasProtectedContentToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventHasProtectedContentToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
has_protected_content_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_protected_content"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventHasProtectedContentToggled
          { has_protected_content :: Maybe Bool
has_protected_content = Maybe Bool
has_protected_content_
          }
      parseChatEventInvitesToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventInvitesToggled :: Value -> Parser ChatEventAction
parseChatEventInvitesToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventInvitesToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
can_invite_users_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"can_invite_users"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventInvitesToggled
          { can_invite_users :: Maybe Bool
can_invite_users = Maybe Bool
can_invite_users_
          }
      parseChatEventIsAllHistoryAvailableToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventIsAllHistoryAvailableToggled :: Value -> Parser ChatEventAction
parseChatEventIsAllHistoryAvailableToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventIsAllHistoryAvailableToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
is_all_history_available_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_all_history_available"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventIsAllHistoryAvailableToggled
          { is_all_history_available :: Maybe Bool
is_all_history_available = Maybe Bool
is_all_history_available_
          }
      parseChatEventHasAggressiveAntiSpamEnabledToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventHasAggressiveAntiSpamEnabledToggled :: Value -> Parser ChatEventAction
parseChatEventHasAggressiveAntiSpamEnabledToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventHasAggressiveAntiSpamEnabledToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
has_aggressive_anti_spam_enabled_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_aggressive_anti_spam_enabled"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventHasAggressiveAntiSpamEnabledToggled
          { has_aggressive_anti_spam_enabled :: Maybe Bool
has_aggressive_anti_spam_enabled = Maybe Bool
has_aggressive_anti_spam_enabled_
          }
      parseChatEventSignMessagesToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventSignMessagesToggled :: Value -> Parser ChatEventAction
parseChatEventSignMessagesToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventSignMessagesToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
sign_messages_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"sign_messages"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventSignMessagesToggled
          { sign_messages :: Maybe Bool
sign_messages = Maybe Bool
sign_messages_
          }
      parseChatEventShowMessageSenderToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventShowMessageSenderToggled :: Value -> Parser ChatEventAction
parseChatEventShowMessageSenderToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventShowMessageSenderToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
show_message_sender_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"show_message_sender"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventShowMessageSenderToggled
          { show_message_sender :: Maybe Bool
show_message_sender = Maybe Bool
show_message_sender_
          }
      parseChatEventInviteLinkEdited :: A.Value -> AT.Parser ChatEventAction
      parseChatEventInviteLinkEdited :: Value -> Parser ChatEventAction
parseChatEventInviteLinkEdited = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventInviteLinkEdited" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatInviteLink
old_invite_link_ <- Object
o Object -> Key -> Parser (Maybe ChatInviteLink)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_invite_link"
        Maybe ChatInviteLink
new_invite_link_ <- Object
o Object -> Key -> Parser (Maybe ChatInviteLink)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_invite_link"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventInviteLinkEdited
          { old_invite_link :: Maybe ChatInviteLink
old_invite_link = Maybe ChatInviteLink
old_invite_link_
          , new_invite_link :: Maybe ChatInviteLink
new_invite_link = Maybe ChatInviteLink
new_invite_link_
          }
      parseChatEventInviteLinkRevoked :: A.Value -> AT.Parser ChatEventAction
      parseChatEventInviteLinkRevoked :: Value -> Parser ChatEventAction
parseChatEventInviteLinkRevoked = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventInviteLinkRevoked" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatInviteLink
invite_link_ <- Object
o Object -> Key -> Parser (Maybe ChatInviteLink)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"invite_link"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventInviteLinkRevoked
          { invite_link :: Maybe ChatInviteLink
invite_link = Maybe ChatInviteLink
invite_link_
          }
      parseChatEventInviteLinkDeleted :: A.Value -> AT.Parser ChatEventAction
      parseChatEventInviteLinkDeleted :: Value -> Parser ChatEventAction
parseChatEventInviteLinkDeleted = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventInviteLinkDeleted" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatInviteLink
invite_link_ <- Object
o Object -> Key -> Parser (Maybe ChatInviteLink)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"invite_link"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventInviteLinkDeleted
          { invite_link :: Maybe ChatInviteLink
invite_link = Maybe ChatInviteLink
invite_link_
          }
      parseChatEventVideoChatCreated :: A.Value -> AT.Parser ChatEventAction
      parseChatEventVideoChatCreated :: Value -> Parser ChatEventAction
parseChatEventVideoChatCreated = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventVideoChatCreated" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
group_call_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"group_call_id"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventVideoChatCreated
          { group_call_id :: Maybe Int
group_call_id = Maybe Int
group_call_id_
          }
      parseChatEventVideoChatEnded :: A.Value -> AT.Parser ChatEventAction
      parseChatEventVideoChatEnded :: Value -> Parser ChatEventAction
parseChatEventVideoChatEnded = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventVideoChatEnded" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
group_call_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"group_call_id"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventVideoChatEnded
          { group_call_id :: Maybe Int
group_call_id = Maybe Int
group_call_id_
          }
      parseChatEventVideoChatMuteNewParticipantsToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventVideoChatMuteNewParticipantsToggled :: Value -> Parser ChatEventAction
parseChatEventVideoChatMuteNewParticipantsToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventVideoChatMuteNewParticipantsToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
mute_new_participants_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"mute_new_participants"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventVideoChatMuteNewParticipantsToggled
          { mute_new_participants :: Maybe Bool
mute_new_participants = Maybe Bool
mute_new_participants_
          }
      parseChatEventVideoChatParticipantIsMutedToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventVideoChatParticipantIsMutedToggled :: Value -> Parser ChatEventAction
parseChatEventVideoChatParticipantIsMutedToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventVideoChatParticipantIsMutedToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe MessageSender
participant_id_ <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"participant_id"
        Maybe Bool
is_muted_       <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_muted"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventVideoChatParticipantIsMutedToggled
          { participant_id :: Maybe MessageSender
participant_id = Maybe MessageSender
participant_id_
          , is_muted :: Maybe Bool
is_muted       = Maybe Bool
is_muted_
          }
      parseChatEventVideoChatParticipantVolumeLevelChanged :: A.Value -> AT.Parser ChatEventAction
      parseChatEventVideoChatParticipantVolumeLevelChanged :: Value -> Parser ChatEventAction
parseChatEventVideoChatParticipantVolumeLevelChanged = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventVideoChatParticipantVolumeLevelChanged" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe MessageSender
participant_id_ <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"participant_id"
        Maybe Int
volume_level_   <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"volume_level"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventVideoChatParticipantVolumeLevelChanged
          { participant_id :: Maybe MessageSender
participant_id = Maybe MessageSender
participant_id_
          , volume_level :: Maybe Int
volume_level   = Maybe Int
volume_level_
          }
      parseChatEventIsForumToggled :: A.Value -> AT.Parser ChatEventAction
      parseChatEventIsForumToggled :: Value -> Parser ChatEventAction
parseChatEventIsForumToggled = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventIsForumToggled" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
is_forum_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_forum"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventIsForumToggled
          { is_forum :: Maybe Bool
is_forum = Maybe Bool
is_forum_
          }
      parseChatEventForumTopicCreated :: A.Value -> AT.Parser ChatEventAction
      parseChatEventForumTopicCreated :: Value -> Parser ChatEventAction
parseChatEventForumTopicCreated = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventForumTopicCreated" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ForumTopicInfo
topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"topic_info"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventForumTopicCreated
          { topic_info :: Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
          }
      parseChatEventForumTopicEdited :: A.Value -> AT.Parser ChatEventAction
      parseChatEventForumTopicEdited :: Value -> Parser ChatEventAction
parseChatEventForumTopicEdited = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventForumTopicEdited" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ForumTopicInfo
old_topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_topic_info"
        Maybe ForumTopicInfo
new_topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_topic_info"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventForumTopicEdited
          { old_topic_info :: Maybe ForumTopicInfo
old_topic_info = Maybe ForumTopicInfo
old_topic_info_
          , new_topic_info :: Maybe ForumTopicInfo
new_topic_info = Maybe ForumTopicInfo
new_topic_info_
          }
      parseChatEventForumTopicToggleIsClosed :: A.Value -> AT.Parser ChatEventAction
      parseChatEventForumTopicToggleIsClosed :: Value -> Parser ChatEventAction
parseChatEventForumTopicToggleIsClosed = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventForumTopicToggleIsClosed" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ForumTopicInfo
topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"topic_info"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventForumTopicToggleIsClosed
          { topic_info :: Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
          }
      parseChatEventForumTopicToggleIsHidden :: A.Value -> AT.Parser ChatEventAction
      parseChatEventForumTopicToggleIsHidden :: Value -> Parser ChatEventAction
parseChatEventForumTopicToggleIsHidden = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventForumTopicToggleIsHidden" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ForumTopicInfo
topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"topic_info"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventForumTopicToggleIsHidden
          { topic_info :: Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
          }
      parseChatEventForumTopicDeleted :: A.Value -> AT.Parser ChatEventAction
      parseChatEventForumTopicDeleted :: Value -> Parser ChatEventAction
parseChatEventForumTopicDeleted = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventForumTopicDeleted" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ForumTopicInfo
topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"topic_info"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventForumTopicDeleted
          { topic_info :: Maybe ForumTopicInfo
topic_info = Maybe ForumTopicInfo
topic_info_
          }
      parseChatEventForumTopicPinned :: A.Value -> AT.Parser ChatEventAction
      parseChatEventForumTopicPinned :: Value -> Parser ChatEventAction
parseChatEventForumTopicPinned = String
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"ChatEventForumTopicPinned" ((Object -> Parser ChatEventAction)
 -> Value -> Parser ChatEventAction)
-> (Object -> Parser ChatEventAction)
-> Value
-> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ForumTopicInfo
old_topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_topic_info"
        Maybe ForumTopicInfo
new_topic_info_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"new_topic_info"
        ChatEventAction -> Parser ChatEventAction
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (ChatEventAction -> Parser ChatEventAction)
-> ChatEventAction -> Parser ChatEventAction
forall a b. (a -> b) -> a -> b
$ ChatEventForumTopicPinned
          { old_topic_info :: Maybe ForumTopicInfo
old_topic_info = Maybe ForumTopicInfo
old_topic_info_
          , new_topic_info :: Maybe ForumTopicInfo
new_topic_info = Maybe ForumTopicInfo
new_topic_info_
          }
  parseJSON Value
_ = Parser ChatEventAction
forall a. Monoid a => a
mempty