module TD.Data.MessageContent
  (MessageContent(..)) 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.FormattedText as FormattedText
import qualified TD.Data.LinkPreview as LinkPreview
import qualified TD.Data.LinkPreviewOptions as LinkPreviewOptions
import qualified TD.Data.Animation as Animation
import qualified TD.Data.Audio as Audio
import qualified TD.Data.Document as Document
import qualified TD.Data.PaidMedia as PaidMedia
import qualified TD.Data.Photo as Photo
import qualified TD.Data.Sticker as Sticker
import qualified TD.Data.Video as Video
import qualified TD.Data.AlternativeVideo as AlternativeVideo
import qualified TD.Data.VideoNote as VideoNote
import qualified TD.Data.VoiceNote as VoiceNote
import qualified TD.Data.Location as Location
import qualified TD.Data.Venue as Venue
import qualified TD.Data.Contact as Contact
import qualified TD.Data.AnimatedEmoji as AnimatedEmoji
import qualified Data.Text as T
import qualified TD.Data.DiceStickers as DiceStickers
import qualified TD.Data.Game as Game
import qualified TD.Data.Poll as Poll
import qualified TD.Data.ProductInfo as ProductInfo
import qualified TD.Data.CallDiscardReason as CallDiscardReason
import qualified TD.Data.ChatPhoto as ChatPhoto
import qualified TD.Data.ChatBackground as ChatBackground
import qualified TD.Data.ForumTopicIcon as ForumTopicIcon
import qualified Data.ByteString as BS
import qualified TD.Data.OrderInfo as OrderInfo
import qualified TD.Data.MessageSender as MessageSender
import qualified TD.Data.GiveawayParameters as GiveawayParameters
import qualified TD.Data.GiveawayPrize as GiveawayPrize
import qualified TD.Data.Gift as Gift
import qualified TD.Data.SharedUser as SharedUser
import qualified TD.Data.SharedChat as SharedChat
import qualified TD.Data.BotWriteAccessAllowReason as BotWriteAccessAllowReason
import qualified TD.Data.PassportElementType as PassportElementType
import qualified TD.Data.EncryptedPassportElement as EncryptedPassportElement
import qualified TD.Data.EncryptedCredentials as EncryptedCredentials

-- | Contains the content of a message
data MessageContent
  = MessageText -- ^ A text message
    { MessageContent -> Maybe FormattedText
text                 :: Maybe FormattedText.FormattedText           -- ^ Text of the message
    , MessageContent -> Maybe LinkPreview
link_preview         :: Maybe LinkPreview.LinkPreview               -- ^ A link preview attached to the message; may be null
    , MessageContent -> Maybe LinkPreviewOptions
link_preview_options :: Maybe LinkPreviewOptions.LinkPreviewOptions -- ^ Options which were used for generation of the link preview; may be null if default options were used
    }
  | MessageAnimation -- ^ An animation message (GIF-style).
    { MessageContent -> Maybe Animation
animation                :: Maybe Animation.Animation         -- ^ The animation description
    , MessageContent -> Maybe FormattedText
caption                  :: Maybe FormattedText.FormattedText -- ^ Animation caption
    , MessageContent -> Maybe Bool
show_caption_above_media :: Maybe Bool                        -- ^ True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation
    , MessageContent -> Maybe Bool
has_spoiler              :: Maybe Bool                        -- ^ True, if the animation preview must be covered by a spoiler animation
    , MessageContent -> Maybe Bool
is_secret                :: Maybe Bool                        -- ^ True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
    }
  | MessageAudio -- ^ An audio message
    { MessageContent -> Maybe Audio
audio   :: Maybe Audio.Audio                 -- ^ The audio description
    , caption :: Maybe FormattedText.FormattedText -- ^ Audio caption
    }
  | MessageDocument -- ^ A document message (general file)
    { MessageContent -> Maybe Document
document :: Maybe Document.Document           -- ^ The document description
    , caption  :: Maybe FormattedText.FormattedText -- ^ Document caption
    }
  | MessagePaidMedia -- ^ A message with paid media
    { MessageContent -> Maybe Int
star_count               :: Maybe Int                         -- ^ Number of Telegram Stars needed to buy access to the media in the message
    , MessageContent -> Maybe [PaidMedia]
media                    :: Maybe [PaidMedia.PaidMedia]       -- ^ Information about the media
    , caption                  :: Maybe FormattedText.FormattedText -- ^ Media caption
    , show_caption_above_media :: Maybe Bool                        -- ^ True, if the caption must be shown above the media; otherwise, the caption must be shown below the media
    }
  | MessagePhoto -- ^ A photo message
    { MessageContent -> Maybe Photo
photo                    :: Maybe Photo.Photo                 -- ^ The photo
    , caption                  :: Maybe FormattedText.FormattedText -- ^ Photo caption
    , show_caption_above_media :: Maybe Bool                        -- ^ True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo
    , has_spoiler              :: Maybe Bool                        -- ^ True, if the photo preview must be covered by a spoiler animation
    , is_secret                :: Maybe Bool                        -- ^ True, if the photo must be blurred and must be shown only while tapped
    }
  | MessageSticker -- ^ A sticker message
    { MessageContent -> Maybe Sticker
sticker    :: Maybe Sticker.Sticker -- ^ The sticker description
    , MessageContent -> Maybe Bool
is_premium :: Maybe Bool            -- ^ True, if premium animation of the sticker must be played
    }
  | MessageVideo -- ^ A video message
    { MessageContent -> Maybe Video
video                    :: Maybe Video.Video                         -- ^ The video description
    , MessageContent -> Maybe [AlternativeVideo]
alternative_videos       :: Maybe [AlternativeVideo.AlternativeVideo] -- ^ Alternative qualities of the video
    , caption                  :: Maybe FormattedText.FormattedText         -- ^ Video caption
    , show_caption_above_media :: Maybe Bool                                -- ^ True, if the caption must be shown above the video; otherwise, the caption must be shown below the video
    , has_spoiler              :: Maybe Bool                                -- ^ True, if the video preview must be covered by a spoiler animation
    , is_secret                :: Maybe Bool                                -- ^ True, if the video thumbnail must be blurred and the video must be shown only while tapped
    }
  | MessageVideoNote -- ^ A video note message
    { MessageContent -> Maybe VideoNote
video_note :: Maybe VideoNote.VideoNote -- ^ The video note description
    , MessageContent -> Maybe Bool
is_viewed  :: Maybe Bool                -- ^ True, if at least one of the recipients has viewed the video note
    , is_secret  :: Maybe Bool                -- ^ True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
    }
  | MessageVoiceNote -- ^ A voice note message
    { MessageContent -> Maybe VoiceNote
voice_note  :: Maybe VoiceNote.VoiceNote         -- ^ The voice note description
    , caption     :: Maybe FormattedText.FormattedText -- ^ Voice note caption
    , MessageContent -> Maybe Bool
is_listened :: Maybe Bool                        -- ^ True, if at least one of the recipients has listened to the voice note
    }
  | MessageExpiredPhoto -- ^ A self-destructed photo message
  | MessageExpiredVideo -- ^ A self-destructed video message
  | MessageExpiredVideoNote -- ^ A self-destructed video note message
  | MessageExpiredVoiceNote -- ^ A self-destructed voice note message
  | MessageLocation -- ^ A message with a location
    { MessageContent -> Maybe Location
location               :: Maybe Location.Location -- ^ The location description
    , MessageContent -> Maybe Int
live_period            :: Maybe Int               -- ^ Time relative to the message send date, for which the location can be updated, in seconds; if 0x7FFFFFFF, then location can be updated forever
    , MessageContent -> Maybe Int
expires_in             :: Maybe Int               -- ^ Left time for which the location can be updated, in seconds. If 0, then the location can't be updated anymore. The update updateMessageContent is not sent when this field changes
    , MessageContent -> Maybe Int
heading                :: Maybe Int               -- ^ For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown
    , MessageContent -> Maybe Int
proximity_alert_radius :: Maybe Int               -- ^ For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender
    }
  | MessageVenue -- ^ A message with information about a venue
    { MessageContent -> Maybe Venue
venue :: Maybe Venue.Venue -- ^ The venue description
    }
  | MessageContact -- ^ A message with a user contact
    { MessageContent -> Maybe Contact
contact :: Maybe Contact.Contact -- ^ The contact description
    }
  | MessageAnimatedEmoji -- ^ A message with an animated emoji
    { MessageContent -> Maybe AnimatedEmoji
animated_emoji :: Maybe AnimatedEmoji.AnimatedEmoji -- ^ The animated emoji
    , MessageContent -> Maybe Text
emoji          :: Maybe T.Text                      -- ^ The corresponding emoji
    }
  | MessageDice -- ^ A dice message. The dice value is randomly generated by the server
    { MessageContent -> Maybe DiceStickers
initial_state                  :: Maybe DiceStickers.DiceStickers -- ^ The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known
    , MessageContent -> Maybe DiceStickers
final_state                    :: Maybe DiceStickers.DiceStickers -- ^ The animated stickers with the final dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known
    , emoji                          :: Maybe T.Text                    -- ^ Emoji on which the dice throw animation is based
    , MessageContent -> Maybe Int
value                          :: Maybe Int                       -- ^ The dice value. If the value is 0, the dice don't have final state yet
    , MessageContent -> Maybe Int
success_animation_frame_number :: Maybe Int                       -- ^ Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded
    }
  | MessageGame -- ^ A message with a game
    { MessageContent -> Maybe Game
game :: Maybe Game.Game -- ^ The game description
    }
  | MessagePoll -- ^ A message with a poll
    { MessageContent -> Maybe Poll
poll :: Maybe Poll.Poll -- ^ The poll description
    }
  | MessageStory -- ^ A message with a forwarded story
    { MessageContent -> Maybe Int
story_sender_chat_id :: Maybe Int  -- ^ Identifier of the chat that posted the story
    , MessageContent -> Maybe Int
story_id             :: Maybe Int  -- ^ Story identifier
    , MessageContent -> Maybe Bool
via_mention          :: Maybe Bool -- ^ True, if the story was automatically forwarded because of a mention of the user
    }
  | MessageInvoice -- ^ A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice
    { MessageContent -> Maybe ProductInfo
product_info          :: Maybe ProductInfo.ProductInfo     -- ^ Information about the product
    , MessageContent -> Maybe Text
currency              :: Maybe T.Text                      -- ^ Currency for the product price
    , MessageContent -> Maybe Int
total_amount          :: Maybe Int                         -- ^ Product total price in the smallest units of the currency
    , MessageContent -> Maybe Text
start_parameter       :: Maybe T.Text                      -- ^ Unique invoice bot start_parameter to be passed to getInternalLink
    , MessageContent -> Maybe Bool
is_test               :: Maybe Bool                        -- ^ True, if the invoice is a test invoice
    , MessageContent -> Maybe Bool
need_shipping_address :: Maybe Bool                        -- ^ True, if the shipping address must be specified
    , MessageContent -> Maybe Int
receipt_message_id    :: Maybe Int                         -- ^ The identifier of the message with the receipt, after the product has been purchased
    ,             :: Maybe PaidMedia.PaidMedia         -- ^ Extended media attached to the invoice; may be null if none
    ,     :: Maybe FormattedText.FormattedText -- ^ Extended media caption; may be null if none
    }
  | MessageCall -- ^ A message with information about an ended call
    { MessageContent -> Maybe Bool
is_video       :: Maybe Bool                                -- ^ True, if the call was a video call
    , MessageContent -> Maybe CallDiscardReason
discard_reason :: Maybe CallDiscardReason.CallDiscardReason -- ^ Reason why the call was discarded
    , MessageContent -> Maybe Int
duration       :: Maybe Int                                 -- ^ Call duration, in seconds
    }
  | MessageVideoChatScheduled -- ^ A new video chat was scheduled
    { MessageContent -> Maybe Int
group_call_id :: Maybe Int -- ^ Identifier of the video chat. The video chat can be received through the method getGroupCall
    , MessageContent -> Maybe Int
start_date    :: Maybe Int -- ^ Point in time (Unix timestamp) when the group call is expected to be started by an administrator
    }
  | MessageVideoChatStarted -- ^ A newly created video chat
    { group_call_id :: Maybe Int -- ^ Identifier of the video chat. The video chat can be received through the method getGroupCall
    }
  | MessageVideoChatEnded -- ^ A message with information about an ended video chat
    { duration :: Maybe Int -- ^ Call duration, in seconds
    }
  | MessageInviteVideoChatParticipants -- ^ A message with information about an invitation to a video chat
    { group_call_id :: Maybe Int   -- ^ Identifier of the video chat. The video chat can be received through the method getGroupCall
    , MessageContent -> Maybe [Int]
user_ids      :: Maybe [Int] -- ^ Invited user identifiers
    }
  | MessageBasicGroupChatCreate -- ^ A newly created basic group
    { MessageContent -> Maybe Text
title           :: Maybe T.Text -- ^ Title of the basic group
    , MessageContent -> Maybe [Int]
member_user_ids :: Maybe [Int]  -- ^ User identifiers of members in the basic group
    }
  | MessageSupergroupChatCreate -- ^ A newly created supergroup or channel
    { title :: Maybe T.Text -- ^ Title of the supergroup or channel
    }
  | MessageChatChangeTitle -- ^ An updated chat title
    { title :: Maybe T.Text -- ^ New chat title
    }
  | MessageChatChangePhoto -- ^ An updated chat photo
    { MessageContent -> Maybe ChatPhoto
_photo :: Maybe ChatPhoto.ChatPhoto -- ^ New chat photo
    }
  | MessageChatDeletePhoto -- ^ A deleted chat photo
  | MessageChatAddMembers -- ^ New chat members were added
    { member_user_ids :: Maybe [Int] -- ^ User identifiers of the new members
    }
  | MessageChatJoinByLink -- ^ A new member joined the chat via an invite link
  | MessageChatJoinByRequest -- ^ A new member was accepted to the chat by an administrator
  | MessageChatDeleteMember -- ^ A chat member was deleted
    { MessageContent -> Maybe Int
user_id :: Maybe Int -- ^ User identifier of the deleted chat member
    }
  | MessageChatUpgradeTo -- ^ A basic group was upgraded to a supergroup and was deactivated as the result
    { MessageContent -> Maybe Int
supergroup_id :: Maybe Int -- ^ Identifier of the supergroup to which the basic group was upgraded
    }
  | MessageChatUpgradeFrom -- ^ A supergroup has been created from a basic group
    { title          :: Maybe T.Text -- ^ Title of the newly created supergroup
    , MessageContent -> Maybe Int
basic_group_id :: Maybe Int    -- ^ The identifier of the original basic group
    }
  | MessagePinMessage -- ^ A message has been pinned
    { MessageContent -> Maybe Int
message_id :: Maybe Int -- ^ Identifier of the pinned message, can be an identifier of a deleted message or 0
    }
  | MessageScreenshotTaken -- ^ A screenshot of a message in the chat has been taken
  | MessageChatSetBackground -- ^ A new background was set in the chat
    { MessageContent -> Maybe Int
old_background_message_id :: Maybe Int                           -- ^ Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message
    , MessageContent -> Maybe ChatBackground
background                :: Maybe ChatBackground.ChatBackground -- ^ The new background
    , MessageContent -> Maybe Bool
only_for_self             :: Maybe Bool                          -- ^ True, if the background was set only for self
    }
  | MessageChatSetTheme -- ^ A theme in the chat has been changed
    { MessageContent -> Maybe Text
theme_name :: Maybe T.Text -- ^ If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one
    }
  | MessageChatSetMessageAutoDeleteTime -- ^ The auto-delete or self-destruct timer for messages in the chat has been changed
    { MessageContent -> Maybe Int
message_auto_delete_time :: Maybe Int -- ^ New value auto-delete or self-destruct time, in seconds; 0 if disabled
    , MessageContent -> Maybe Int
from_user_id             :: Maybe Int -- ^ If not 0, a user identifier, which default setting was automatically applied
    }
  | MessageChatBoost -- ^ The chat was boosted by the sender of the message
    { MessageContent -> Maybe Int
boost_count :: Maybe Int -- ^ Number of times the chat was boosted
    }
  | MessageForumTopicCreated -- ^ A forum topic has been created
    { MessageContent -> Maybe Text
name :: Maybe T.Text                        -- ^ Name of the topic
    , MessageContent -> Maybe ForumTopicIcon
icon :: Maybe ForumTopicIcon.ForumTopicIcon -- ^ Icon of the topic
    }
  | MessageForumTopicEdited -- ^ A forum topic has been edited
    { name                      :: Maybe T.Text -- ^ If non-empty, the new name of the topic
    , MessageContent -> Maybe Bool
edit_icon_custom_emoji_id :: Maybe Bool   -- ^ True, if icon's custom_emoji_id is changed
    , MessageContent -> Maybe Int
icon_custom_emoji_id      :: Maybe Int    -- ^ New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false
    }
  | MessageForumTopicIsClosedToggled -- ^ A forum topic has been closed or opened
    { MessageContent -> Maybe Bool
is_closed :: Maybe Bool -- ^ True, if the topic was closed; otherwise, the topic was reopened
    }
  | MessageForumTopicIsHiddenToggled -- ^ A General forum topic has been hidden or unhidden
    { MessageContent -> Maybe Bool
is_hidden :: Maybe Bool -- ^ True, if the topic was hidden; otherwise, the topic was unhidden
    }
  | MessageSuggestProfilePhoto -- ^ A profile photo was suggested to a user in a private chat
    { _photo :: Maybe ChatPhoto.ChatPhoto -- ^ The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo
    }
  | MessageCustomServiceAction -- ^ A non-standard action has happened in the chat
    { MessageContent -> Maybe Text
_text :: Maybe T.Text -- ^ Message text to be shown in the chat
    }
  | MessageGameScore -- ^ A new high score was achieved in a game
    { MessageContent -> Maybe Int
game_message_id :: Maybe Int -- ^ Identifier of the message with the game, can be an identifier of a deleted message
    , MessageContent -> Maybe Int
game_id         :: Maybe Int -- ^ Identifier of the game; may be different from the games presented in the message with the game
    , MessageContent -> Maybe Int
score           :: Maybe Int -- ^ New score
    }
  | MessagePaymentSuccessful -- ^ A payment has been completed
    { MessageContent -> Maybe Int
invoice_chat_id    :: Maybe Int    -- ^ Identifier of the chat, containing the corresponding invoice message
    , MessageContent -> Maybe Int
invoice_message_id :: Maybe Int    -- ^ Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message
    , currency           :: Maybe T.Text -- ^ Currency for the price of the product
    , total_amount       :: Maybe Int    -- ^ Total price for the product, in the smallest units of the currency
    , MessageContent -> Maybe Bool
is_recurring       :: Maybe Bool   -- ^ True, if this is a recurring payment
    , MessageContent -> Maybe Bool
is_first_recurring :: Maybe Bool   -- ^ True, if this is the first recurring payment
    , MessageContent -> Maybe Text
invoice_name       :: Maybe T.Text -- ^ Name of the invoice; may be empty if unknown
    }
  | MessagePaymentSuccessfulBot -- ^ A payment has been completed; for bots only
    { currency                   :: Maybe T.Text              -- ^ Currency for price of the product
    , total_amount               :: Maybe Int                 -- ^ Total price for the product, in the smallest units of the currency
    , is_recurring               :: Maybe Bool                -- ^ True, if this is a recurring payment
    , is_first_recurring         :: Maybe Bool                -- ^ True, if this is the first recurring payment
    , MessageContent -> Maybe ByteString
invoice_payload            :: Maybe BS.ByteString       -- ^ Invoice payload
    , MessageContent -> Maybe Text
shipping_option_id         :: Maybe T.Text              -- ^ Identifier of the shipping option chosen by the user; may be empty if not applicable
    , MessageContent -> Maybe OrderInfo
order_info                 :: Maybe OrderInfo.OrderInfo -- ^ Information about the order; may be null
    , MessageContent -> Maybe Text
telegram_payment_charge_id :: Maybe T.Text              -- ^ Telegram payment identifier
    , MessageContent -> Maybe Text
provider_payment_charge_id :: Maybe T.Text              -- ^ Provider payment identifier
    }
  | MessagePaymentRefunded -- ^ A payment has been refunded
    { MessageContent -> Maybe MessageSender
owner_id                   :: Maybe MessageSender.MessageSender -- ^ Identifier of the previous owner of the Telegram Stars that refunds them
    , currency                   :: Maybe T.Text                      -- ^ Currency for the price of the product
    , total_amount               :: Maybe Int                         -- ^ Total price for the product, in the smallest units of the currency
    , invoice_payload            :: Maybe BS.ByteString               -- ^ Invoice payload; only for bots
    , telegram_payment_charge_id :: Maybe T.Text                      -- ^ Telegram payment identifier
    , provider_payment_charge_id :: Maybe T.Text                      -- ^ Provider payment identifier
    }
  | MessageGiftedPremium -- ^ Telegram Premium was gifted to a user
    { MessageContent -> Maybe Int
gifter_user_id        :: Maybe Int                         -- ^ The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing
    , MessageContent -> Maybe Int
receiver_user_id      :: Maybe Int                         -- ^ The identifier of a user that received Telegram Premium; 0 if the gift is incoming
    , text                  :: Maybe FormattedText.FormattedText -- ^ Message added to the gifted Telegram Premium by the sender
    , currency              :: Maybe T.Text                      -- ^ Currency for the paid amount
    , MessageContent -> Maybe Int
amount                :: Maybe Int                         -- ^ The paid amount, in the smallest units of the currency
    , MessageContent -> Maybe Text
cryptocurrency        :: Maybe T.Text                      -- ^ Cryptocurrency used to pay for the gift; may be empty if none
    , MessageContent -> Maybe Int
cryptocurrency_amount :: Maybe Int                         -- ^ The paid amount, in the smallest units of the cryptocurrency; 0 if none
    , MessageContent -> Maybe Int
month_count           :: Maybe Int                         -- ^ Number of months the Telegram Premium subscription will be active
    , sticker               :: Maybe Sticker.Sticker             -- ^ A sticker to be shown in the message; may be null if unknown
    }
  | MessagePremiumGiftCode -- ^ A Telegram Premium gift code was created for the user
    { MessageContent -> Maybe MessageSender
creator_id            :: Maybe MessageSender.MessageSender -- ^ Identifier of a chat or a user that created the gift code; may be null if unknown
    , text                  :: Maybe FormattedText.FormattedText -- ^ Message added to the gift
    , MessageContent -> Maybe Bool
is_from_giveaway      :: Maybe Bool                        -- ^ True, if the gift code was created for a giveaway
    , MessageContent -> Maybe Bool
is_unclaimed          :: Maybe Bool                        -- ^ True, if the winner for the corresponding Telegram Premium subscription wasn't chosen
    , currency              :: Maybe T.Text                      -- ^ Currency for the paid amount; empty if unknown
    , amount                :: Maybe Int                         -- ^ The paid amount, in the smallest units of the currency; 0 if unknown
    , cryptocurrency        :: Maybe T.Text                      -- ^ Cryptocurrency used to pay for the gift; may be empty if none or unknown
    , cryptocurrency_amount :: Maybe Int                         -- ^ The paid amount, in the smallest units of the cryptocurrency; 0 if unknown
    , month_count           :: Maybe Int                         -- ^ Number of months the Telegram Premium subscription will be active after code activation
    , sticker               :: Maybe Sticker.Sticker             -- ^ A sticker to be shown in the message; may be null if unknown
    , MessageContent -> Maybe Text
code                  :: Maybe T.Text                      -- ^ The gift code
    }
  | MessageGiveawayCreated -- ^ A giveaway was created for the chat. Use telegramPaymentPurposePremiumGiveaway, storePaymentPurposePremiumGiveaway, telegramPaymentPurposeStarGiveaway, or storePaymentPurposeStarGiveaway to create a giveaway
    { star_count :: Maybe Int -- ^ Number of Telegram Stars that will be shared by winners of the giveaway; 0 for Telegram Premium giveaways
    }
  | MessageGiveaway -- ^ A giveaway
    { MessageContent -> Maybe GiveawayParameters
parameters   :: Maybe GiveawayParameters.GiveawayParameters -- ^ Giveaway parameters
    , MessageContent -> Maybe Int
winner_count :: Maybe Int                                   -- ^ Number of users which will receive Telegram Premium subscription gift codes
    , MessageContent -> Maybe GiveawayPrize
prize        :: Maybe GiveawayPrize.GiveawayPrize           -- ^ Prize of the giveaway
    , sticker      :: Maybe Sticker.Sticker                       -- ^ A sticker to be shown in the message; may be null if unknown
    }
  | MessageGiveawayCompleted -- ^ A giveaway without public winners has been completed for the chat
    { MessageContent -> Maybe Int
giveaway_message_id   :: Maybe Int  -- ^ Identifier of the message with the giveaway; can be 0 if the message was deleted
    , winner_count          :: Maybe Int  -- ^ Number of winners in the giveaway
    , MessageContent -> Maybe Bool
is_star_giveaway      :: Maybe Bool -- ^ True, if the giveaway is a Telegram Star giveaway
    , MessageContent -> Maybe Int
unclaimed_prize_count :: Maybe Int  -- ^ Number of undistributed prizes; for Telegram Premium giveaways only
    }
  | MessageGiveawayWinners -- ^ A giveaway with public winners has been completed for the chat
    { MessageContent -> Maybe Int
boosted_chat_id               :: Maybe Int                         -- ^ Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway
    , giveaway_message_id           :: Maybe Int                         -- ^ Identifier of the message with the giveaway in the boosted chat
    , MessageContent -> Maybe Int
additional_chat_count         :: Maybe Int                         -- ^ Number of other chats that participated in the giveaway
    , MessageContent -> Maybe Int
actual_winners_selection_date :: Maybe Int                         -- ^ Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway
    , MessageContent -> Maybe Bool
only_new_members              :: Maybe Bool                        -- ^ True, if only new members of the chats were eligible for the giveaway
    , MessageContent -> Maybe Bool
was_refunded                  :: Maybe Bool                        -- ^ True, if the giveaway was canceled and was fully refunded
    , prize                         :: Maybe GiveawayPrize.GiveawayPrize -- ^ Prize of the giveaway
    , MessageContent -> Maybe Text
prize_description             :: Maybe T.Text                      -- ^ Additional description of the giveaway prize
    , winner_count                  :: Maybe Int                         -- ^ Total number of winners in the giveaway
    , MessageContent -> Maybe [Int]
winner_user_ids               :: Maybe [Int]                       -- ^ Up to 100 user identifiers of the winners of the giveaway
    , unclaimed_prize_count         :: Maybe Int                         -- ^ Number of undistributed prizes; for Telegram Premium giveaways only
    }
  | MessageGiftedStars -- ^ Telegram Stars were gifted to a user
    { gifter_user_id        :: Maybe Int             -- ^ The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing
    , receiver_user_id      :: Maybe Int             -- ^ The identifier of a user that received Telegram Stars; 0 if the gift is incoming
    , currency              :: Maybe T.Text          -- ^ Currency for the paid amount
    , amount                :: Maybe Int             -- ^ The paid amount, in the smallest units of the currency
    , cryptocurrency        :: Maybe T.Text          -- ^ Cryptocurrency used to pay for the gift; may be empty if none
    , cryptocurrency_amount :: Maybe Int             -- ^ The paid amount, in the smallest units of the cryptocurrency; 0 if none
    , star_count            :: Maybe Int             -- ^ Number of Telegram Stars that were gifted
    , MessageContent -> Maybe Text
transaction_id        :: Maybe T.Text          -- ^ Identifier of the transaction for Telegram Stars purchase; for receiver only
    , sticker               :: Maybe Sticker.Sticker -- ^ A sticker to be shown in the message; may be null if unknown
    }
  | MessageGiveawayPrizeStars -- ^ A Telegram Stars were received by the current user from a giveaway
    { star_count          :: Maybe Int             -- ^ Number of Telegram Stars that were received
    , transaction_id      :: Maybe T.Text          -- ^ Identifier of the transaction for Telegram Stars credit
    , boosted_chat_id     :: Maybe Int             -- ^ Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway
    , giveaway_message_id :: Maybe Int             -- ^ Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted
    , is_unclaimed        :: Maybe Bool            -- ^ True, if the corresponding winner wasn't chosen and the Telegram Stars were received by the owner of the boosted chat
    , sticker             :: Maybe Sticker.Sticker -- ^ A sticker to be shown in the message; may be null if unknown
    }
  | MessageGift -- ^ A gift was received or sent by the current user
    { MessageContent -> Maybe Gift
gift            :: Maybe Gift.Gift                   -- ^ The gift
    , text            :: Maybe FormattedText.FormattedText -- ^ Message added to the gift
    , MessageContent -> Maybe Int
sell_star_count :: Maybe Int                         -- ^ Number of Telegram Stars that can be claimed by the receiver instead of the gift
    , MessageContent -> Maybe Bool
is_private      :: Maybe Bool                        -- ^ True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
    , MessageContent -> Maybe Bool
is_saved        :: Maybe Bool                        -- ^ True, if the gift is displayed on the user's profile page; only for the receiver of the gift
    , MessageContent -> Maybe Bool
was_converted   :: Maybe Bool                        -- ^ True, if the gift was converted to Telegram Stars; only for the receiver of the gift
    }
  | MessageContactRegistered -- ^ A contact has registered with Telegram
  | MessageUsersShared -- ^ The current user shared users, which were requested by the bot
    { MessageContent -> Maybe [SharedUser]
users     :: Maybe [SharedUser.SharedUser] -- ^ The shared users
    , MessageContent -> Maybe Int
button_id :: Maybe Int                     -- ^ Identifier of the keyboard button with the request
    }
  | MessageChatShared -- ^ The current user shared a chat, which was requested by the bot
    { MessageContent -> Maybe SharedChat
chat      :: Maybe SharedChat.SharedChat -- ^ The shared chat
    , button_id :: Maybe Int                   -- ^ Identifier of the keyboard button with the request
    }
  | MessageBotWriteAccessAllowed -- ^ The user allowed the bot to send messages
    { MessageContent -> Maybe BotWriteAccessAllowReason
reason :: Maybe BotWriteAccessAllowReason.BotWriteAccessAllowReason -- ^ The reason why the bot was allowed to write messages
    }
  | MessageWebAppDataSent -- ^ Data from a Web App has been sent to a bot
    { MessageContent -> Maybe Text
button_text :: Maybe T.Text -- ^ Text of the keyboardButtonTypeWebApp button, which opened the Web App
    }
  | MessageWebAppDataReceived -- ^ Data from a Web App has been received; for bots only
    { button_text :: Maybe T.Text -- ^ Text of the keyboardButtonTypeWebApp button, which opened the Web App
    , MessageContent -> Maybe Text
_data       :: Maybe T.Text -- ^ The data
    }
  | MessagePassportDataSent -- ^ Telegram Passport data has been sent to a bot
    { MessageContent -> Maybe [PassportElementType]
types :: Maybe [PassportElementType.PassportElementType] -- ^ List of Telegram Passport element types sent
    }
  | MessagePassportDataReceived -- ^ Telegram Passport data has been received; for bots only
    { MessageContent -> Maybe [EncryptedPassportElement]
elements    :: Maybe [EncryptedPassportElement.EncryptedPassportElement] -- ^ List of received Telegram Passport elements
    , MessageContent -> Maybe EncryptedCredentials
credentials :: Maybe EncryptedCredentials.EncryptedCredentials           -- ^ Encrypted data credentials
    }
  | MessageProximityAlertTriggered -- ^ A user in the chat came within proximity alert range
    { MessageContent -> Maybe MessageSender
traveler_id :: Maybe MessageSender.MessageSender -- ^ The identifier of a user or chat that triggered the proximity alert
    , MessageContent -> Maybe MessageSender
watcher_id  :: Maybe MessageSender.MessageSender -- ^ The identifier of a user or chat that subscribed for the proximity alert
    , MessageContent -> Maybe Int
distance    :: Maybe Int                         -- ^ The distance between the users
    }
  | MessageUnsupported -- ^ A message content that is not supported in the current TDLib version
  deriving (MessageContent -> MessageContent -> Bool
(MessageContent -> MessageContent -> Bool)
-> (MessageContent -> MessageContent -> Bool) -> Eq MessageContent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MessageContent -> MessageContent -> Bool
== :: MessageContent -> MessageContent -> Bool
$c/= :: MessageContent -> MessageContent -> Bool
/= :: MessageContent -> MessageContent -> Bool
Eq, Int -> MessageContent -> ShowS
[MessageContent] -> ShowS
MessageContent -> String
(Int -> MessageContent -> ShowS)
-> (MessageContent -> String)
-> ([MessageContent] -> ShowS)
-> Show MessageContent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MessageContent -> ShowS
showsPrec :: Int -> MessageContent -> ShowS
$cshow :: MessageContent -> String
show :: MessageContent -> String
$cshowList :: [MessageContent] -> ShowS
showList :: [MessageContent] -> ShowS
Show)

instance I.ShortShow MessageContent where
  shortShow :: MessageContent -> String
shortShow MessageText
    { text :: MessageContent -> Maybe FormattedText
text                 = Maybe FormattedText
text_
    , link_preview :: MessageContent -> Maybe LinkPreview
link_preview         = Maybe LinkPreview
link_preview_
    , link_preview_options :: MessageContent -> Maybe LinkPreviewOptions
link_preview_options = Maybe LinkPreviewOptions
link_preview_options_
    }
      = String
"MessageText"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"text"                 String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
        , String
"link_preview"         String -> Maybe LinkPreview -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe LinkPreview
link_preview_
        , String
"link_preview_options" String -> Maybe LinkPreviewOptions -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe LinkPreviewOptions
link_preview_options_
        ]
  shortShow MessageAnimation
    { animation :: MessageContent -> Maybe Animation
animation                = Maybe Animation
animation_
    , caption :: MessageContent -> Maybe FormattedText
caption                  = Maybe FormattedText
caption_
    , show_caption_above_media :: MessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
    , has_spoiler :: MessageContent -> Maybe Bool
has_spoiler              = Maybe Bool
has_spoiler_
    , is_secret :: MessageContent -> Maybe Bool
is_secret                = Maybe Bool
is_secret_
    }
      = String
"MessageAnimation"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"animation"                String -> Maybe Animation -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Animation
animation_
        , String
"caption"                  String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
        , String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
        , String
"has_spoiler"              String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        , String
"is_secret"                String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_secret_
        ]
  shortShow MessageAudio
    { audio :: MessageContent -> Maybe Audio
audio   = Maybe Audio
audio_
    , caption :: MessageContent -> Maybe FormattedText
caption = Maybe FormattedText
caption_
    }
      = String
"MessageAudio"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"audio"   String -> Maybe Audio -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Audio
audio_
        , String
"caption" String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
        ]
  shortShow MessageDocument
    { document :: MessageContent -> Maybe Document
document = Maybe Document
document_
    , caption :: MessageContent -> Maybe FormattedText
caption  = Maybe FormattedText
caption_
    }
      = String
"MessageDocument"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"document" String -> Maybe Document -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Document
document_
        , String
"caption"  String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
        ]
  shortShow MessagePaidMedia
    { star_count :: MessageContent -> Maybe Int
star_count               = Maybe Int
star_count_
    , media :: MessageContent -> Maybe [PaidMedia]
media                    = Maybe [PaidMedia]
media_
    , caption :: MessageContent -> Maybe FormattedText
caption                  = Maybe FormattedText
caption_
    , show_caption_above_media :: MessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
    }
      = String
"MessagePaidMedia"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"star_count"               String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
star_count_
        , String
"media"                    String -> Maybe [PaidMedia] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PaidMedia]
media_
        , String
"caption"                  String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
        , String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
        ]
  shortShow MessagePhoto
    { photo :: MessageContent -> Maybe Photo
photo                    = Maybe Photo
photo_
    , caption :: MessageContent -> Maybe FormattedText
caption                  = Maybe FormattedText
caption_
    , show_caption_above_media :: MessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
    , has_spoiler :: MessageContent -> Maybe Bool
has_spoiler              = Maybe Bool
has_spoiler_
    , is_secret :: MessageContent -> Maybe Bool
is_secret                = Maybe Bool
is_secret_
    }
      = String
"MessagePhoto"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"photo"                    String -> Maybe Photo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Photo
photo_
        , String
"caption"                  String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
        , String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
        , String
"has_spoiler"              String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        , String
"is_secret"                String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_secret_
        ]
  shortShow MessageSticker
    { sticker :: MessageContent -> Maybe Sticker
sticker    = Maybe Sticker
sticker_
    , is_premium :: MessageContent -> Maybe Bool
is_premium = Maybe Bool
is_premium_
    }
      = String
"MessageSticker"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"sticker"    String -> Maybe Sticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Sticker
sticker_
        , String
"is_premium" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_premium_
        ]
  shortShow MessageVideo
    { video :: MessageContent -> Maybe Video
video                    = Maybe Video
video_
    , alternative_videos :: MessageContent -> Maybe [AlternativeVideo]
alternative_videos       = Maybe [AlternativeVideo]
alternative_videos_
    , caption :: MessageContent -> Maybe FormattedText
caption                  = Maybe FormattedText
caption_
    , show_caption_above_media :: MessageContent -> Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
    , has_spoiler :: MessageContent -> Maybe Bool
has_spoiler              = Maybe Bool
has_spoiler_
    , is_secret :: MessageContent -> Maybe Bool
is_secret                = Maybe Bool
is_secret_
    }
      = String
"MessageVideo"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"video"                    String -> Maybe Video -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Video
video_
        , String
"alternative_videos"       String -> Maybe [AlternativeVideo] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [AlternativeVideo]
alternative_videos_
        , String
"caption"                  String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
        , String
"show_caption_above_media" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
show_caption_above_media_
        , String
"has_spoiler"              String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
has_spoiler_
        , String
"is_secret"                String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_secret_
        ]
  shortShow MessageVideoNote
    { video_note :: MessageContent -> Maybe VideoNote
video_note = Maybe VideoNote
video_note_
    , is_viewed :: MessageContent -> Maybe Bool
is_viewed  = Maybe Bool
is_viewed_
    , is_secret :: MessageContent -> Maybe Bool
is_secret  = Maybe Bool
is_secret_
    }
      = String
"MessageVideoNote"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"video_note" String -> Maybe VideoNote -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe VideoNote
video_note_
        , String
"is_viewed"  String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_viewed_
        , String
"is_secret"  String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_secret_
        ]
  shortShow MessageVoiceNote
    { voice_note :: MessageContent -> Maybe VoiceNote
voice_note  = Maybe VoiceNote
voice_note_
    , caption :: MessageContent -> Maybe FormattedText
caption     = Maybe FormattedText
caption_
    , is_listened :: MessageContent -> Maybe Bool
is_listened = Maybe Bool
is_listened_
    }
      = String
"MessageVoiceNote"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"voice_note"  String -> Maybe VoiceNote -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe VoiceNote
voice_note_
        , String
"caption"     String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
caption_
        , String
"is_listened" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_listened_
        ]
  shortShow MessageContent
MessageExpiredPhoto
      = String
"MessageExpiredPhoto"
  shortShow MessageContent
MessageExpiredVideo
      = String
"MessageExpiredVideo"
  shortShow MessageContent
MessageExpiredVideoNote
      = String
"MessageExpiredVideoNote"
  shortShow MessageContent
MessageExpiredVoiceNote
      = String
"MessageExpiredVoiceNote"
  shortShow MessageLocation
    { location :: MessageContent -> Maybe Location
location               = Maybe Location
location_
    , live_period :: MessageContent -> Maybe Int
live_period            = Maybe Int
live_period_
    , expires_in :: MessageContent -> Maybe Int
expires_in             = Maybe Int
expires_in_
    , heading :: MessageContent -> Maybe Int
heading                = Maybe Int
heading_
    , proximity_alert_radius :: MessageContent -> Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
    }
      = String
"MessageLocation"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"location"               String -> Maybe Location -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Location
location_
        , String
"live_period"            String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
live_period_
        , String
"expires_in"             String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
expires_in_
        , String
"heading"                String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
heading_
        , String
"proximity_alert_radius" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
proximity_alert_radius_
        ]
  shortShow MessageVenue
    { venue :: MessageContent -> Maybe Venue
venue = Maybe Venue
venue_
    }
      = String
"MessageVenue"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"venue" String -> Maybe Venue -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Venue
venue_
        ]
  shortShow MessageContact
    { contact :: MessageContent -> Maybe Contact
contact = Maybe Contact
contact_
    }
      = String
"MessageContact"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"contact" String -> Maybe Contact -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Contact
contact_
        ]
  shortShow MessageAnimatedEmoji
    { animated_emoji :: MessageContent -> Maybe AnimatedEmoji
animated_emoji = Maybe AnimatedEmoji
animated_emoji_
    , emoji :: MessageContent -> Maybe Text
emoji          = Maybe Text
emoji_
    }
      = String
"MessageAnimatedEmoji"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"animated_emoji" String -> Maybe AnimatedEmoji -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe AnimatedEmoji
animated_emoji_
        , String
"emoji"          String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
emoji_
        ]
  shortShow MessageDice
    { initial_state :: MessageContent -> Maybe DiceStickers
initial_state                  = Maybe DiceStickers
initial_state_
    , final_state :: MessageContent -> Maybe DiceStickers
final_state                    = Maybe DiceStickers
final_state_
    , emoji :: MessageContent -> Maybe Text
emoji                          = Maybe Text
emoji_
    , value :: MessageContent -> Maybe Int
value                          = Maybe Int
value_
    , success_animation_frame_number :: MessageContent -> Maybe Int
success_animation_frame_number = Maybe Int
success_animation_frame_number_
    }
      = String
"MessageDice"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"initial_state"                  String -> Maybe DiceStickers -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe DiceStickers
initial_state_
        , String
"final_state"                    String -> Maybe DiceStickers -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe DiceStickers
final_state_
        , String
"emoji"                          String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
emoji_
        , String
"value"                          String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
value_
        , String
"success_animation_frame_number" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
success_animation_frame_number_
        ]
  shortShow MessageGame
    { game :: MessageContent -> Maybe Game
game = Maybe Game
game_
    }
      = String
"MessageGame"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"game" String -> Maybe Game -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Game
game_
        ]
  shortShow MessagePoll
    { poll :: MessageContent -> Maybe Poll
poll = Maybe Poll
poll_
    }
      = String
"MessagePoll"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"poll" String -> Maybe Poll -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Poll
poll_
        ]
  shortShow MessageStory
    { story_sender_chat_id :: MessageContent -> Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
    , story_id :: MessageContent -> Maybe Int
story_id             = Maybe Int
story_id_
    , via_mention :: MessageContent -> Maybe Bool
via_mention          = Maybe Bool
via_mention_
    }
      = String
"MessageStory"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"story_sender_chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_sender_chat_id_
        , String
"story_id"             String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
story_id_
        , String
"via_mention"          String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
via_mention_
        ]
  shortShow MessageInvoice
    { product_info :: MessageContent -> Maybe ProductInfo
product_info          = Maybe ProductInfo
product_info_
    , currency :: MessageContent -> Maybe Text
currency              = Maybe Text
currency_
    , total_amount :: MessageContent -> Maybe Int
total_amount          = Maybe Int
total_amount_
    , start_parameter :: MessageContent -> Maybe Text
start_parameter       = Maybe Text
start_parameter_
    , is_test :: MessageContent -> Maybe Bool
is_test               = Maybe Bool
is_test_
    , need_shipping_address :: MessageContent -> Maybe Bool
need_shipping_address = Maybe Bool
need_shipping_address_
    , receipt_message_id :: MessageContent -> Maybe Int
receipt_message_id    = Maybe Int
receipt_message_id_
    , paid_media :: MessageContent -> Maybe PaidMedia
paid_media            = Maybe PaidMedia
paid_media_
    , paid_media_caption :: MessageContent -> Maybe FormattedText
paid_media_caption    = Maybe FormattedText
paid_media_caption_
    }
      = String
"MessageInvoice"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"product_info"          String -> Maybe ProductInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ProductInfo
product_info_
        , String
"currency"              String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
currency_
        , String
"total_amount"          String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
total_amount_
        , String
"start_parameter"       String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
start_parameter_
        , String
"is_test"               String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_test_
        , String
"need_shipping_address" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
need_shipping_address_
        , String
"receipt_message_id"    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
receipt_message_id_
        , String
"paid_media"            String -> Maybe PaidMedia -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe PaidMedia
paid_media_
        , String
"paid_media_caption"    String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
paid_media_caption_
        ]
  shortShow MessageCall
    { is_video :: MessageContent -> Maybe Bool
is_video       = Maybe Bool
is_video_
    , discard_reason :: MessageContent -> Maybe CallDiscardReason
discard_reason = Maybe CallDiscardReason
discard_reason_
    , duration :: MessageContent -> Maybe Int
duration       = Maybe Int
duration_
    }
      = String
"MessageCall"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"is_video"       String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_video_
        , String
"discard_reason" String -> Maybe CallDiscardReason -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe CallDiscardReason
discard_reason_
        , String
"duration"       String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
duration_
        ]
  shortShow MessageVideoChatScheduled
    { group_call_id :: MessageContent -> Maybe Int
group_call_id = Maybe Int
group_call_id_
    , start_date :: MessageContent -> Maybe Int
start_date    = Maybe Int
start_date_
    }
      = String
"MessageVideoChatScheduled"
        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_
        , String
"start_date"    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
start_date_
        ]
  shortShow MessageVideoChatStarted
    { group_call_id :: MessageContent -> Maybe Int
group_call_id = Maybe Int
group_call_id_
    }
      = String
"MessageVideoChatStarted"
        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 MessageVideoChatEnded
    { duration :: MessageContent -> Maybe Int
duration = Maybe Int
duration_
    }
      = String
"MessageVideoChatEnded"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"duration" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
duration_
        ]
  shortShow MessageInviteVideoChatParticipants
    { group_call_id :: MessageContent -> Maybe Int
group_call_id = Maybe Int
group_call_id_
    , user_ids :: MessageContent -> Maybe [Int]
user_ids      = Maybe [Int]
user_ids_
    }
      = String
"MessageInviteVideoChatParticipants"
        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_
        , String
"user_ids"      String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
user_ids_
        ]
  shortShow MessageBasicGroupChatCreate
    { title :: MessageContent -> Maybe Text
title           = Maybe Text
title_
    , member_user_ids :: MessageContent -> Maybe [Int]
member_user_ids = Maybe [Int]
member_user_ids_
    }
      = String
"MessageBasicGroupChatCreate"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"title"           String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
        , String
"member_user_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
member_user_ids_
        ]
  shortShow MessageSupergroupChatCreate
    { title :: MessageContent -> Maybe Text
title = Maybe Text
title_
    }
      = String
"MessageSupergroupChatCreate"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
        ]
  shortShow MessageChatChangeTitle
    { title :: MessageContent -> Maybe Text
title = Maybe Text
title_
    }
      = String
"MessageChatChangeTitle"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"title" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
        ]
  shortShow MessageChatChangePhoto
    { _photo :: MessageContent -> Maybe ChatPhoto
_photo = Maybe ChatPhoto
_photo_
    }
      = String
"MessageChatChangePhoto"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"_photo" String -> Maybe ChatPhoto -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPhoto
_photo_
        ]
  shortShow MessageContent
MessageChatDeletePhoto
      = String
"MessageChatDeletePhoto"
  shortShow MessageChatAddMembers
    { member_user_ids :: MessageContent -> Maybe [Int]
member_user_ids = Maybe [Int]
member_user_ids_
    }
      = String
"MessageChatAddMembers"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"member_user_ids" String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
member_user_ids_
        ]
  shortShow MessageContent
MessageChatJoinByLink
      = String
"MessageChatJoinByLink"
  shortShow MessageContent
MessageChatJoinByRequest
      = String
"MessageChatJoinByRequest"
  shortShow MessageChatDeleteMember
    { user_id :: MessageContent -> Maybe Int
user_id = Maybe Int
user_id_
    }
      = String
"MessageChatDeleteMember"
        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_
        ]
  shortShow MessageChatUpgradeTo
    { supergroup_id :: MessageContent -> Maybe Int
supergroup_id = Maybe Int
supergroup_id_
    }
      = String
"MessageChatUpgradeTo"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"supergroup_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
supergroup_id_
        ]
  shortShow MessageChatUpgradeFrom
    { title :: MessageContent -> Maybe Text
title          = Maybe Text
title_
    , basic_group_id :: MessageContent -> Maybe Int
basic_group_id = Maybe Int
basic_group_id_
    }
      = String
"MessageChatUpgradeFrom"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"title"          String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
title_
        , String
"basic_group_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
basic_group_id_
        ]
  shortShow MessagePinMessage
    { message_id :: MessageContent -> Maybe Int
message_id = Maybe Int
message_id_
    }
      = String
"MessagePinMessage"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
        ]
  shortShow MessageContent
MessageScreenshotTaken
      = String
"MessageScreenshotTaken"
  shortShow MessageChatSetBackground
    { old_background_message_id :: MessageContent -> Maybe Int
old_background_message_id = Maybe Int
old_background_message_id_
    , background :: MessageContent -> Maybe ChatBackground
background                = Maybe ChatBackground
background_
    , only_for_self :: MessageContent -> Maybe Bool
only_for_self             = Maybe Bool
only_for_self_
    }
      = String
"MessageChatSetBackground"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"old_background_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
old_background_message_id_
        , String
"background"                String -> Maybe ChatBackground -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatBackground
background_
        , String
"only_for_self"             String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
only_for_self_
        ]
  shortShow MessageChatSetTheme
    { theme_name :: MessageContent -> Maybe Text
theme_name = Maybe Text
theme_name_
    }
      = String
"MessageChatSetTheme"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"theme_name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
theme_name_
        ]
  shortShow MessageChatSetMessageAutoDeleteTime
    { message_auto_delete_time :: MessageContent -> Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
    , from_user_id :: MessageContent -> Maybe Int
from_user_id             = Maybe Int
from_user_id_
    }
      = String
"MessageChatSetMessageAutoDeleteTime"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"message_auto_delete_time" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_auto_delete_time_
        , String
"from_user_id"             String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
from_user_id_
        ]
  shortShow MessageChatBoost
    { boost_count :: MessageContent -> Maybe Int
boost_count = Maybe Int
boost_count_
    }
      = String
"MessageChatBoost"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"boost_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
boost_count_
        ]
  shortShow MessageForumTopicCreated
    { name :: MessageContent -> Maybe Text
name = Maybe Text
name_
    , icon :: MessageContent -> Maybe ForumTopicIcon
icon = Maybe ForumTopicIcon
icon_
    }
      = String
"MessageForumTopicCreated"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"name" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
        , String
"icon" String -> Maybe ForumTopicIcon -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ForumTopicIcon
icon_
        ]
  shortShow MessageForumTopicEdited
    { name :: MessageContent -> Maybe Text
name                      = Maybe Text
name_
    , edit_icon_custom_emoji_id :: MessageContent -> Maybe Bool
edit_icon_custom_emoji_id = Maybe Bool
edit_icon_custom_emoji_id_
    , icon_custom_emoji_id :: MessageContent -> Maybe Int
icon_custom_emoji_id      = Maybe Int
icon_custom_emoji_id_
    }
      = String
"MessageForumTopicEdited"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"name"                      String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
name_
        , String
"edit_icon_custom_emoji_id" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
edit_icon_custom_emoji_id_
        , String
"icon_custom_emoji_id"      String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
icon_custom_emoji_id_
        ]
  shortShow MessageForumTopicIsClosedToggled
    { is_closed :: MessageContent -> Maybe Bool
is_closed = Maybe Bool
is_closed_
    }
      = String
"MessageForumTopicIsClosedToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"is_closed" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_closed_
        ]
  shortShow MessageForumTopicIsHiddenToggled
    { is_hidden :: MessageContent -> Maybe Bool
is_hidden = Maybe Bool
is_hidden_
    }
      = String
"MessageForumTopicIsHiddenToggled"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"is_hidden" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_hidden_
        ]
  shortShow MessageSuggestProfilePhoto
    { _photo :: MessageContent -> Maybe ChatPhoto
_photo = Maybe ChatPhoto
_photo_
    }
      = String
"MessageSuggestProfilePhoto"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"_photo" String -> Maybe ChatPhoto -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ChatPhoto
_photo_
        ]
  shortShow MessageCustomServiceAction
    { _text :: MessageContent -> Maybe Text
_text = Maybe Text
_text_
    }
      = String
"MessageCustomServiceAction"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"_text" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
_text_
        ]
  shortShow MessageGameScore
    { game_message_id :: MessageContent -> Maybe Int
game_message_id = Maybe Int
game_message_id_
    , game_id :: MessageContent -> Maybe Int
game_id         = Maybe Int
game_id_
    , score :: MessageContent -> Maybe Int
score           = Maybe Int
score_
    }
      = String
"MessageGameScore"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"game_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
game_message_id_
        , String
"game_id"         String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
game_id_
        , String
"score"           String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
score_
        ]
  shortShow MessagePaymentSuccessful
    { invoice_chat_id :: MessageContent -> Maybe Int
invoice_chat_id    = Maybe Int
invoice_chat_id_
    , invoice_message_id :: MessageContent -> Maybe Int
invoice_message_id = Maybe Int
invoice_message_id_
    , currency :: MessageContent -> Maybe Text
currency           = Maybe Text
currency_
    , total_amount :: MessageContent -> Maybe Int
total_amount       = Maybe Int
total_amount_
    , is_recurring :: MessageContent -> Maybe Bool
is_recurring       = Maybe Bool
is_recurring_
    , is_first_recurring :: MessageContent -> Maybe Bool
is_first_recurring = Maybe Bool
is_first_recurring_
    , invoice_name :: MessageContent -> Maybe Text
invoice_name       = Maybe Text
invoice_name_
    }
      = String
"MessagePaymentSuccessful"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"invoice_chat_id"    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
invoice_chat_id_
        , String
"invoice_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
invoice_message_id_
        , String
"currency"           String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
currency_
        , String
"total_amount"       String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
total_amount_
        , String
"is_recurring"       String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_recurring_
        , String
"is_first_recurring" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_first_recurring_
        , String
"invoice_name"       String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
invoice_name_
        ]
  shortShow MessagePaymentSuccessfulBot
    { currency :: MessageContent -> Maybe Text
currency                   = Maybe Text
currency_
    , total_amount :: MessageContent -> Maybe Int
total_amount               = Maybe Int
total_amount_
    , is_recurring :: MessageContent -> Maybe Bool
is_recurring               = Maybe Bool
is_recurring_
    , is_first_recurring :: MessageContent -> Maybe Bool
is_first_recurring         = Maybe Bool
is_first_recurring_
    , invoice_payload :: MessageContent -> Maybe ByteString
invoice_payload            = Maybe ByteString
invoice_payload_
    , shipping_option_id :: MessageContent -> Maybe Text
shipping_option_id         = Maybe Text
shipping_option_id_
    , order_info :: MessageContent -> Maybe OrderInfo
order_info                 = Maybe OrderInfo
order_info_
    , telegram_payment_charge_id :: MessageContent -> Maybe Text
telegram_payment_charge_id = Maybe Text
telegram_payment_charge_id_
    , provider_payment_charge_id :: MessageContent -> Maybe Text
provider_payment_charge_id = Maybe Text
provider_payment_charge_id_
    }
      = String
"MessagePaymentSuccessfulBot"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"currency"                   String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
currency_
        , String
"total_amount"               String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
total_amount_
        , String
"is_recurring"               String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_recurring_
        , String
"is_first_recurring"         String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_first_recurring_
        , String
"invoice_payload"            String -> Maybe ByteString -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ByteString
invoice_payload_
        , String
"shipping_option_id"         String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
shipping_option_id_
        , String
"order_info"                 String -> Maybe OrderInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe OrderInfo
order_info_
        , String
"telegram_payment_charge_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
telegram_payment_charge_id_
        , String
"provider_payment_charge_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
provider_payment_charge_id_
        ]
  shortShow MessagePaymentRefunded
    { owner_id :: MessageContent -> Maybe MessageSender
owner_id                   = Maybe MessageSender
owner_id_
    , currency :: MessageContent -> Maybe Text
currency                   = Maybe Text
currency_
    , total_amount :: MessageContent -> Maybe Int
total_amount               = Maybe Int
total_amount_
    , invoice_payload :: MessageContent -> Maybe ByteString
invoice_payload            = Maybe ByteString
invoice_payload_
    , telegram_payment_charge_id :: MessageContent -> Maybe Text
telegram_payment_charge_id = Maybe Text
telegram_payment_charge_id_
    , provider_payment_charge_id :: MessageContent -> Maybe Text
provider_payment_charge_id = Maybe Text
provider_payment_charge_id_
    }
      = String
"MessagePaymentRefunded"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"owner_id"                   String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
owner_id_
        , String
"currency"                   String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
currency_
        , String
"total_amount"               String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
total_amount_
        , String
"invoice_payload"            String -> Maybe ByteString -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ByteString
invoice_payload_
        , String
"telegram_payment_charge_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
telegram_payment_charge_id_
        , String
"provider_payment_charge_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
provider_payment_charge_id_
        ]
  shortShow MessageGiftedPremium
    { gifter_user_id :: MessageContent -> Maybe Int
gifter_user_id        = Maybe Int
gifter_user_id_
    , receiver_user_id :: MessageContent -> Maybe Int
receiver_user_id      = Maybe Int
receiver_user_id_
    , text :: MessageContent -> Maybe FormattedText
text                  = Maybe FormattedText
text_
    , currency :: MessageContent -> Maybe Text
currency              = Maybe Text
currency_
    , amount :: MessageContent -> Maybe Int
amount                = Maybe Int
amount_
    , cryptocurrency :: MessageContent -> Maybe Text
cryptocurrency        = Maybe Text
cryptocurrency_
    , cryptocurrency_amount :: MessageContent -> Maybe Int
cryptocurrency_amount = Maybe Int
cryptocurrency_amount_
    , month_count :: MessageContent -> Maybe Int
month_count           = Maybe Int
month_count_
    , sticker :: MessageContent -> Maybe Sticker
sticker               = Maybe Sticker
sticker_
    }
      = String
"MessageGiftedPremium"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"gifter_user_id"        String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
gifter_user_id_
        , String
"receiver_user_id"      String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
receiver_user_id_
        , String
"text"                  String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
        , String
"currency"              String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
currency_
        , String
"amount"                String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
amount_
        , String
"cryptocurrency"        String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
cryptocurrency_
        , String
"cryptocurrency_amount" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
cryptocurrency_amount_
        , String
"month_count"           String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
month_count_
        , String
"sticker"               String -> Maybe Sticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Sticker
sticker_
        ]
  shortShow MessagePremiumGiftCode
    { creator_id :: MessageContent -> Maybe MessageSender
creator_id            = Maybe MessageSender
creator_id_
    , text :: MessageContent -> Maybe FormattedText
text                  = Maybe FormattedText
text_
    , is_from_giveaway :: MessageContent -> Maybe Bool
is_from_giveaway      = Maybe Bool
is_from_giveaway_
    , is_unclaimed :: MessageContent -> Maybe Bool
is_unclaimed          = Maybe Bool
is_unclaimed_
    , currency :: MessageContent -> Maybe Text
currency              = Maybe Text
currency_
    , amount :: MessageContent -> Maybe Int
amount                = Maybe Int
amount_
    , cryptocurrency :: MessageContent -> Maybe Text
cryptocurrency        = Maybe Text
cryptocurrency_
    , cryptocurrency_amount :: MessageContent -> Maybe Int
cryptocurrency_amount = Maybe Int
cryptocurrency_amount_
    , month_count :: MessageContent -> Maybe Int
month_count           = Maybe Int
month_count_
    , sticker :: MessageContent -> Maybe Sticker
sticker               = Maybe Sticker
sticker_
    , code :: MessageContent -> Maybe Text
code                  = Maybe Text
code_
    }
      = String
"MessagePremiumGiftCode"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"creator_id"            String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
creator_id_
        , String
"text"                  String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
        , String
"is_from_giveaway"      String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_from_giveaway_
        , String
"is_unclaimed"          String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_unclaimed_
        , String
"currency"              String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
currency_
        , String
"amount"                String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
amount_
        , String
"cryptocurrency"        String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
cryptocurrency_
        , String
"cryptocurrency_amount" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
cryptocurrency_amount_
        , String
"month_count"           String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
month_count_
        , String
"sticker"               String -> Maybe Sticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Sticker
sticker_
        , String
"code"                  String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
code_
        ]
  shortShow MessageGiveawayCreated
    { star_count :: MessageContent -> Maybe Int
star_count = Maybe Int
star_count_
    }
      = String
"MessageGiveawayCreated"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"star_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
star_count_
        ]
  shortShow MessageGiveaway
    { parameters :: MessageContent -> Maybe GiveawayParameters
parameters   = Maybe GiveawayParameters
parameters_
    , winner_count :: MessageContent -> Maybe Int
winner_count = Maybe Int
winner_count_
    , prize :: MessageContent -> Maybe GiveawayPrize
prize        = Maybe GiveawayPrize
prize_
    , sticker :: MessageContent -> Maybe Sticker
sticker      = Maybe Sticker
sticker_
    }
      = String
"MessageGiveaway"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"parameters"   String -> Maybe GiveawayParameters -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe GiveawayParameters
parameters_
        , String
"winner_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
winner_count_
        , String
"prize"        String -> Maybe GiveawayPrize -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe GiveawayPrize
prize_
        , String
"sticker"      String -> Maybe Sticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Sticker
sticker_
        ]
  shortShow MessageGiveawayCompleted
    { giveaway_message_id :: MessageContent -> Maybe Int
giveaway_message_id   = Maybe Int
giveaway_message_id_
    , winner_count :: MessageContent -> Maybe Int
winner_count          = Maybe Int
winner_count_
    , is_star_giveaway :: MessageContent -> Maybe Bool
is_star_giveaway      = Maybe Bool
is_star_giveaway_
    , unclaimed_prize_count :: MessageContent -> Maybe Int
unclaimed_prize_count = Maybe Int
unclaimed_prize_count_
    }
      = String
"MessageGiveawayCompleted"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"giveaway_message_id"   String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
giveaway_message_id_
        , String
"winner_count"          String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
winner_count_
        , String
"is_star_giveaway"      String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_star_giveaway_
        , String
"unclaimed_prize_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
unclaimed_prize_count_
        ]
  shortShow MessageGiveawayWinners
    { boosted_chat_id :: MessageContent -> Maybe Int
boosted_chat_id               = Maybe Int
boosted_chat_id_
    , giveaway_message_id :: MessageContent -> Maybe Int
giveaway_message_id           = Maybe Int
giveaway_message_id_
    , additional_chat_count :: MessageContent -> Maybe Int
additional_chat_count         = Maybe Int
additional_chat_count_
    , actual_winners_selection_date :: MessageContent -> Maybe Int
actual_winners_selection_date = Maybe Int
actual_winners_selection_date_
    , only_new_members :: MessageContent -> Maybe Bool
only_new_members              = Maybe Bool
only_new_members_
    , was_refunded :: MessageContent -> Maybe Bool
was_refunded                  = Maybe Bool
was_refunded_
    , prize :: MessageContent -> Maybe GiveawayPrize
prize                         = Maybe GiveawayPrize
prize_
    , prize_description :: MessageContent -> Maybe Text
prize_description             = Maybe Text
prize_description_
    , winner_count :: MessageContent -> Maybe Int
winner_count                  = Maybe Int
winner_count_
    , winner_user_ids :: MessageContent -> Maybe [Int]
winner_user_ids               = Maybe [Int]
winner_user_ids_
    , unclaimed_prize_count :: MessageContent -> Maybe Int
unclaimed_prize_count         = Maybe Int
unclaimed_prize_count_
    }
      = String
"MessageGiveawayWinners"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"boosted_chat_id"               String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
boosted_chat_id_
        , String
"giveaway_message_id"           String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
giveaway_message_id_
        , String
"additional_chat_count"         String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
additional_chat_count_
        , String
"actual_winners_selection_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
actual_winners_selection_date_
        , String
"only_new_members"              String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
only_new_members_
        , String
"was_refunded"                  String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
was_refunded_
        , String
"prize"                         String -> Maybe GiveawayPrize -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe GiveawayPrize
prize_
        , String
"prize_description"             String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
prize_description_
        , String
"winner_count"                  String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
winner_count_
        , String
"winner_user_ids"               String -> Maybe [Int] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [Int]
winner_user_ids_
        , String
"unclaimed_prize_count"         String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
unclaimed_prize_count_
        ]
  shortShow MessageGiftedStars
    { gifter_user_id :: MessageContent -> Maybe Int
gifter_user_id        = Maybe Int
gifter_user_id_
    , receiver_user_id :: MessageContent -> Maybe Int
receiver_user_id      = Maybe Int
receiver_user_id_
    , currency :: MessageContent -> Maybe Text
currency              = Maybe Text
currency_
    , amount :: MessageContent -> Maybe Int
amount                = Maybe Int
amount_
    , cryptocurrency :: MessageContent -> Maybe Text
cryptocurrency        = Maybe Text
cryptocurrency_
    , cryptocurrency_amount :: MessageContent -> Maybe Int
cryptocurrency_amount = Maybe Int
cryptocurrency_amount_
    , star_count :: MessageContent -> Maybe Int
star_count            = Maybe Int
star_count_
    , transaction_id :: MessageContent -> Maybe Text
transaction_id        = Maybe Text
transaction_id_
    , sticker :: MessageContent -> Maybe Sticker
sticker               = Maybe Sticker
sticker_
    }
      = String
"MessageGiftedStars"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"gifter_user_id"        String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
gifter_user_id_
        , String
"receiver_user_id"      String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
receiver_user_id_
        , String
"currency"              String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
currency_
        , String
"amount"                String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
amount_
        , String
"cryptocurrency"        String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
cryptocurrency_
        , String
"cryptocurrency_amount" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
cryptocurrency_amount_
        , String
"star_count"            String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
star_count_
        , String
"transaction_id"        String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
transaction_id_
        , String
"sticker"               String -> Maybe Sticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Sticker
sticker_
        ]
  shortShow MessageGiveawayPrizeStars
    { star_count :: MessageContent -> Maybe Int
star_count          = Maybe Int
star_count_
    , transaction_id :: MessageContent -> Maybe Text
transaction_id      = Maybe Text
transaction_id_
    , boosted_chat_id :: MessageContent -> Maybe Int
boosted_chat_id     = Maybe Int
boosted_chat_id_
    , giveaway_message_id :: MessageContent -> Maybe Int
giveaway_message_id = Maybe Int
giveaway_message_id_
    , is_unclaimed :: MessageContent -> Maybe Bool
is_unclaimed        = Maybe Bool
is_unclaimed_
    , sticker :: MessageContent -> Maybe Sticker
sticker             = Maybe Sticker
sticker_
    }
      = String
"MessageGiveawayPrizeStars"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"star_count"          String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
star_count_
        , String
"transaction_id"      String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
transaction_id_
        , String
"boosted_chat_id"     String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
boosted_chat_id_
        , String
"giveaway_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
giveaway_message_id_
        , String
"is_unclaimed"        String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_unclaimed_
        , String
"sticker"             String -> Maybe Sticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Sticker
sticker_
        ]
  shortShow MessageGift
    { gift :: MessageContent -> Maybe Gift
gift            = Maybe Gift
gift_
    , text :: MessageContent -> Maybe FormattedText
text            = Maybe FormattedText
text_
    , sell_star_count :: MessageContent -> Maybe Int
sell_star_count = Maybe Int
sell_star_count_
    , is_private :: MessageContent -> Maybe Bool
is_private      = Maybe Bool
is_private_
    , is_saved :: MessageContent -> Maybe Bool
is_saved        = Maybe Bool
is_saved_
    , was_converted :: MessageContent -> Maybe Bool
was_converted   = Maybe Bool
was_converted_
    }
      = String
"MessageGift"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"gift"            String -> Maybe Gift -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Gift
gift_
        , String
"text"            String -> Maybe FormattedText -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe FormattedText
text_
        , String
"sell_star_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
sell_star_count_
        , String
"is_private"      String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_private_
        , String
"is_saved"        String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_saved_
        , String
"was_converted"   String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
was_converted_
        ]
  shortShow MessageContent
MessageContactRegistered
      = String
"MessageContactRegistered"
  shortShow MessageUsersShared
    { users :: MessageContent -> Maybe [SharedUser]
users     = Maybe [SharedUser]
users_
    , button_id :: MessageContent -> Maybe Int
button_id = Maybe Int
button_id_
    }
      = String
"MessageUsersShared"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"users"     String -> Maybe [SharedUser] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [SharedUser]
users_
        , String
"button_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
button_id_
        ]
  shortShow MessageChatShared
    { chat :: MessageContent -> Maybe SharedChat
chat      = Maybe SharedChat
chat_
    , button_id :: MessageContent -> Maybe Int
button_id = Maybe Int
button_id_
    }
      = String
"MessageChatShared"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"chat"      String -> Maybe SharedChat -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe SharedChat
chat_
        , String
"button_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
button_id_
        ]
  shortShow MessageBotWriteAccessAllowed
    { reason :: MessageContent -> Maybe BotWriteAccessAllowReason
reason = Maybe BotWriteAccessAllowReason
reason_
    }
      = String
"MessageBotWriteAccessAllowed"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"reason" String -> Maybe BotWriteAccessAllowReason -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe BotWriteAccessAllowReason
reason_
        ]
  shortShow MessageWebAppDataSent
    { button_text :: MessageContent -> Maybe Text
button_text = Maybe Text
button_text_
    }
      = String
"MessageWebAppDataSent"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"button_text" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
button_text_
        ]
  shortShow MessageWebAppDataReceived
    { button_text :: MessageContent -> Maybe Text
button_text = Maybe Text
button_text_
    , _data :: MessageContent -> Maybe Text
_data       = Maybe Text
_data_
    }
      = String
"MessageWebAppDataReceived"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"button_text" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
button_text_
        , String
"_data"       String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
_data_
        ]
  shortShow MessagePassportDataSent
    { types :: MessageContent -> Maybe [PassportElementType]
types = Maybe [PassportElementType]
types_
    }
      = String
"MessagePassportDataSent"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"types" String -> Maybe [PassportElementType] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PassportElementType]
types_
        ]
  shortShow MessagePassportDataReceived
    { elements :: MessageContent -> Maybe [EncryptedPassportElement]
elements    = Maybe [EncryptedPassportElement]
elements_
    , credentials :: MessageContent -> Maybe EncryptedCredentials
credentials = Maybe EncryptedCredentials
credentials_
    }
      = String
"MessagePassportDataReceived"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"elements"    String -> Maybe [EncryptedPassportElement] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [EncryptedPassportElement]
elements_
        , String
"credentials" String -> Maybe EncryptedCredentials -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe EncryptedCredentials
credentials_
        ]
  shortShow MessageProximityAlertTriggered
    { traveler_id :: MessageContent -> Maybe MessageSender
traveler_id = Maybe MessageSender
traveler_id_
    , watcher_id :: MessageContent -> Maybe MessageSender
watcher_id  = Maybe MessageSender
watcher_id_
    , distance :: MessageContent -> Maybe Int
distance    = Maybe Int
distance_
    }
      = String
"MessageProximityAlertTriggered"
        String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
        [ String
"traveler_id" String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
traveler_id_
        , String
"watcher_id"  String -> Maybe MessageSender -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe MessageSender
watcher_id_
        , String
"distance"    String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
distance_
        ]
  shortShow MessageContent
MessageUnsupported
      = String
"MessageUnsupported"

instance AT.FromJSON MessageContent where
  parseJSON :: Value -> Parser MessageContent
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
"messageText"                         -> Value -> Parser MessageContent
parseMessageText Value
v
      String
"messageAnimation"                    -> Value -> Parser MessageContent
parseMessageAnimation Value
v
      String
"messageAudio"                        -> Value -> Parser MessageContent
parseMessageAudio Value
v
      String
"messageDocument"                     -> Value -> Parser MessageContent
parseMessageDocument Value
v
      String
"messagePaidMedia"                    -> Value -> Parser MessageContent
parseMessagePaidMedia Value
v
      String
"messagePhoto"                        -> Value -> Parser MessageContent
parseMessagePhoto Value
v
      String
"messageSticker"                      -> Value -> Parser MessageContent
parseMessageSticker Value
v
      String
"messageVideo"                        -> Value -> Parser MessageContent
parseMessageVideo Value
v
      String
"messageVideoNote"                    -> Value -> Parser MessageContent
parseMessageVideoNote Value
v
      String
"messageVoiceNote"                    -> Value -> Parser MessageContent
parseMessageVoiceNote Value
v
      String
"messageExpiredPhoto"                 -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageExpiredPhoto
      String
"messageExpiredVideo"                 -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageExpiredVideo
      String
"messageExpiredVideoNote"             -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageExpiredVideoNote
      String
"messageExpiredVoiceNote"             -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageExpiredVoiceNote
      String
"messageLocation"                     -> Value -> Parser MessageContent
parseMessageLocation Value
v
      String
"messageVenue"                        -> Value -> Parser MessageContent
parseMessageVenue Value
v
      String
"messageContact"                      -> Value -> Parser MessageContent
parseMessageContact Value
v
      String
"messageAnimatedEmoji"                -> Value -> Parser MessageContent
parseMessageAnimatedEmoji Value
v
      String
"messageDice"                         -> Value -> Parser MessageContent
parseMessageDice Value
v
      String
"messageGame"                         -> Value -> Parser MessageContent
parseMessageGame Value
v
      String
"messagePoll"                         -> Value -> Parser MessageContent
parseMessagePoll Value
v
      String
"messageStory"                        -> Value -> Parser MessageContent
parseMessageStory Value
v
      String
"messageInvoice"                      -> Value -> Parser MessageContent
parseMessageInvoice Value
v
      String
"messageCall"                         -> Value -> Parser MessageContent
parseMessageCall Value
v
      String
"messageVideoChatScheduled"           -> Value -> Parser MessageContent
parseMessageVideoChatScheduled Value
v
      String
"messageVideoChatStarted"             -> Value -> Parser MessageContent
parseMessageVideoChatStarted Value
v
      String
"messageVideoChatEnded"               -> Value -> Parser MessageContent
parseMessageVideoChatEnded Value
v
      String
"messageInviteVideoChatParticipants"  -> Value -> Parser MessageContent
parseMessageInviteVideoChatParticipants Value
v
      String
"messageBasicGroupChatCreate"         -> Value -> Parser MessageContent
parseMessageBasicGroupChatCreate Value
v
      String
"messageSupergroupChatCreate"         -> Value -> Parser MessageContent
parseMessageSupergroupChatCreate Value
v
      String
"messageChatChangeTitle"              -> Value -> Parser MessageContent
parseMessageChatChangeTitle Value
v
      String
"messageChatChangePhoto"              -> Value -> Parser MessageContent
parseMessageChatChangePhoto Value
v
      String
"messageChatDeletePhoto"              -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageChatDeletePhoto
      String
"messageChatAddMembers"               -> Value -> Parser MessageContent
parseMessageChatAddMembers Value
v
      String
"messageChatJoinByLink"               -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageChatJoinByLink
      String
"messageChatJoinByRequest"            -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageChatJoinByRequest
      String
"messageChatDeleteMember"             -> Value -> Parser MessageContent
parseMessageChatDeleteMember Value
v
      String
"messageChatUpgradeTo"                -> Value -> Parser MessageContent
parseMessageChatUpgradeTo Value
v
      String
"messageChatUpgradeFrom"              -> Value -> Parser MessageContent
parseMessageChatUpgradeFrom Value
v
      String
"messagePinMessage"                   -> Value -> Parser MessageContent
parseMessagePinMessage Value
v
      String
"messageScreenshotTaken"              -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageScreenshotTaken
      String
"messageChatSetBackground"            -> Value -> Parser MessageContent
parseMessageChatSetBackground Value
v
      String
"messageChatSetTheme"                 -> Value -> Parser MessageContent
parseMessageChatSetTheme Value
v
      String
"messageChatSetMessageAutoDeleteTime" -> Value -> Parser MessageContent
parseMessageChatSetMessageAutoDeleteTime Value
v
      String
"messageChatBoost"                    -> Value -> Parser MessageContent
parseMessageChatBoost Value
v
      String
"messageForumTopicCreated"            -> Value -> Parser MessageContent
parseMessageForumTopicCreated Value
v
      String
"messageForumTopicEdited"             -> Value -> Parser MessageContent
parseMessageForumTopicEdited Value
v
      String
"messageForumTopicIsClosedToggled"    -> Value -> Parser MessageContent
parseMessageForumTopicIsClosedToggled Value
v
      String
"messageForumTopicIsHiddenToggled"    -> Value -> Parser MessageContent
parseMessageForumTopicIsHiddenToggled Value
v
      String
"messageSuggestProfilePhoto"          -> Value -> Parser MessageContent
parseMessageSuggestProfilePhoto Value
v
      String
"messageCustomServiceAction"          -> Value -> Parser MessageContent
parseMessageCustomServiceAction Value
v
      String
"messageGameScore"                    -> Value -> Parser MessageContent
parseMessageGameScore Value
v
      String
"messagePaymentSuccessful"            -> Value -> Parser MessageContent
parseMessagePaymentSuccessful Value
v
      String
"messagePaymentSuccessfulBot"         -> Value -> Parser MessageContent
parseMessagePaymentSuccessfulBot Value
v
      String
"messagePaymentRefunded"              -> Value -> Parser MessageContent
parseMessagePaymentRefunded Value
v
      String
"messageGiftedPremium"                -> Value -> Parser MessageContent
parseMessageGiftedPremium Value
v
      String
"messagePremiumGiftCode"              -> Value -> Parser MessageContent
parseMessagePremiumGiftCode Value
v
      String
"messageGiveawayCreated"              -> Value -> Parser MessageContent
parseMessageGiveawayCreated Value
v
      String
"messageGiveaway"                     -> Value -> Parser MessageContent
parseMessageGiveaway Value
v
      String
"messageGiveawayCompleted"            -> Value -> Parser MessageContent
parseMessageGiveawayCompleted Value
v
      String
"messageGiveawayWinners"              -> Value -> Parser MessageContent
parseMessageGiveawayWinners Value
v
      String
"messageGiftedStars"                  -> Value -> Parser MessageContent
parseMessageGiftedStars Value
v
      String
"messageGiveawayPrizeStars"           -> Value -> Parser MessageContent
parseMessageGiveawayPrizeStars Value
v
      String
"messageGift"                         -> Value -> Parser MessageContent
parseMessageGift Value
v
      String
"messageContactRegistered"            -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageContactRegistered
      String
"messageUsersShared"                  -> Value -> Parser MessageContent
parseMessageUsersShared Value
v
      String
"messageChatShared"                   -> Value -> Parser MessageContent
parseMessageChatShared Value
v
      String
"messageBotWriteAccessAllowed"        -> Value -> Parser MessageContent
parseMessageBotWriteAccessAllowed Value
v
      String
"messageWebAppDataSent"               -> Value -> Parser MessageContent
parseMessageWebAppDataSent Value
v
      String
"messageWebAppDataReceived"           -> Value -> Parser MessageContent
parseMessageWebAppDataReceived Value
v
      String
"messagePassportDataSent"             -> Value -> Parser MessageContent
parseMessagePassportDataSent Value
v
      String
"messagePassportDataReceived"         -> Value -> Parser MessageContent
parseMessagePassportDataReceived Value
v
      String
"messageProximityAlertTriggered"      -> Value -> Parser MessageContent
parseMessageProximityAlertTriggered Value
v
      String
"messageUnsupported"                  -> MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure MessageContent
MessageUnsupported
      String
_                                     -> Parser MessageContent
forall a. Monoid a => a
mempty
    
    where
      parseMessageText :: A.Value -> AT.Parser MessageContent
      parseMessageText :: Value -> Parser MessageContent
parseMessageText = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageText" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe FormattedText
text_                 <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        Maybe LinkPreview
link_preview_         <- Object
o Object -> Key -> Parser (Maybe LinkPreview)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"link_preview"
        Maybe LinkPreviewOptions
link_preview_options_ <- Object
o Object -> Key -> Parser (Maybe LinkPreviewOptions)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"link_preview_options"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageText
          { text :: Maybe FormattedText
text                 = Maybe FormattedText
text_
          , link_preview :: Maybe LinkPreview
link_preview         = Maybe LinkPreview
link_preview_
          , link_preview_options :: Maybe LinkPreviewOptions
link_preview_options = Maybe LinkPreviewOptions
link_preview_options_
          }
      parseMessageAnimation :: A.Value -> AT.Parser MessageContent
      parseMessageAnimation :: Value -> Parser MessageContent
parseMessageAnimation = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageAnimation" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Animation
animation_                <- Object
o Object -> Key -> Parser (Maybe Animation)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"animation"
        Maybe FormattedText
caption_                  <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"show_caption_above_media"
        Maybe Bool
has_spoiler_              <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        Maybe Bool
is_secret_                <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_secret"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageAnimation
          { animation :: Maybe Animation
animation                = Maybe Animation
animation_
          , caption :: Maybe FormattedText
caption                  = Maybe FormattedText
caption_
          , show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
          , has_spoiler :: Maybe Bool
has_spoiler              = Maybe Bool
has_spoiler_
          , is_secret :: Maybe Bool
is_secret                = Maybe Bool
is_secret_
          }
      parseMessageAudio :: A.Value -> AT.Parser MessageContent
      parseMessageAudio :: Value -> Parser MessageContent
parseMessageAudio = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageAudio" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Audio
audio_   <- Object
o Object -> Key -> Parser (Maybe Audio)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"audio"
        Maybe FormattedText
caption_ <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageAudio
          { audio :: Maybe Audio
audio   = Maybe Audio
audio_
          , caption :: Maybe FormattedText
caption = Maybe FormattedText
caption_
          }
      parseMessageDocument :: A.Value -> AT.Parser MessageContent
      parseMessageDocument :: Value -> Parser MessageContent
parseMessageDocument = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageDocument" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Document
document_ <- Object
o Object -> Key -> Parser (Maybe Document)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"document"
        Maybe FormattedText
caption_  <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageDocument
          { document :: Maybe Document
document = Maybe Document
document_
          , caption :: Maybe FormattedText
caption  = Maybe FormattedText
caption_
          }
      parseMessagePaidMedia :: A.Value -> AT.Parser MessageContent
      parseMessagePaidMedia :: Value -> Parser MessageContent
parseMessagePaidMedia = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePaidMedia" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
star_count_               <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"star_count"
        Maybe [PaidMedia]
media_                    <- Object
o Object -> Key -> Parser (Maybe [PaidMedia])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"media"
        Maybe FormattedText
caption_                  <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"show_caption_above_media"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePaidMedia
          { star_count :: Maybe Int
star_count               = Maybe Int
star_count_
          , media :: Maybe [PaidMedia]
media                    = Maybe [PaidMedia]
media_
          , caption :: Maybe FormattedText
caption                  = Maybe FormattedText
caption_
          , show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
          }
      parseMessagePhoto :: A.Value -> AT.Parser MessageContent
      parseMessagePhoto :: Value -> Parser MessageContent
parseMessagePhoto = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePhoto" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Photo
photo_                    <- Object
o Object -> Key -> Parser (Maybe Photo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"photo"
        Maybe FormattedText
caption_                  <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"show_caption_above_media"
        Maybe Bool
has_spoiler_              <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        Maybe Bool
is_secret_                <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_secret"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePhoto
          { photo :: Maybe Photo
photo                    = Maybe Photo
photo_
          , caption :: Maybe FormattedText
caption                  = Maybe FormattedText
caption_
          , show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
          , has_spoiler :: Maybe Bool
has_spoiler              = Maybe Bool
has_spoiler_
          , is_secret :: Maybe Bool
is_secret                = Maybe Bool
is_secret_
          }
      parseMessageSticker :: A.Value -> AT.Parser MessageContent
      parseMessageSticker :: Value -> Parser MessageContent
parseMessageSticker = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageSticker" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Sticker
sticker_    <- Object
o Object -> Key -> Parser (Maybe Sticker)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"sticker"
        Maybe Bool
is_premium_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_premium"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageSticker
          { sticker :: Maybe Sticker
sticker    = Maybe Sticker
sticker_
          , is_premium :: Maybe Bool
is_premium = Maybe Bool
is_premium_
          }
      parseMessageVideo :: A.Value -> AT.Parser MessageContent
      parseMessageVideo :: Value -> Parser MessageContent
parseMessageVideo = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageVideo" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Video
video_                    <- Object
o Object -> Key -> Parser (Maybe Video)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"video"
        Maybe [AlternativeVideo]
alternative_videos_       <- Object
o Object -> Key -> Parser (Maybe [AlternativeVideo])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"alternative_videos"
        Maybe FormattedText
caption_                  <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
show_caption_above_media_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"show_caption_above_media"
        Maybe Bool
has_spoiler_              <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"has_spoiler"
        Maybe Bool
is_secret_                <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_secret"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageVideo
          { video :: Maybe Video
video                    = Maybe Video
video_
          , alternative_videos :: Maybe [AlternativeVideo]
alternative_videos       = Maybe [AlternativeVideo]
alternative_videos_
          , caption :: Maybe FormattedText
caption                  = Maybe FormattedText
caption_
          , show_caption_above_media :: Maybe Bool
show_caption_above_media = Maybe Bool
show_caption_above_media_
          , has_spoiler :: Maybe Bool
has_spoiler              = Maybe Bool
has_spoiler_
          , is_secret :: Maybe Bool
is_secret                = Maybe Bool
is_secret_
          }
      parseMessageVideoNote :: A.Value -> AT.Parser MessageContent
      parseMessageVideoNote :: Value -> Parser MessageContent
parseMessageVideoNote = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageVideoNote" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe VideoNote
video_note_ <- Object
o Object -> Key -> Parser (Maybe VideoNote)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"video_note"
        Maybe Bool
is_viewed_  <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_viewed"
        Maybe Bool
is_secret_  <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_secret"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageVideoNote
          { video_note :: Maybe VideoNote
video_note = Maybe VideoNote
video_note_
          , is_viewed :: Maybe Bool
is_viewed  = Maybe Bool
is_viewed_
          , is_secret :: Maybe Bool
is_secret  = Maybe Bool
is_secret_
          }
      parseMessageVoiceNote :: A.Value -> AT.Parser MessageContent
      parseMessageVoiceNote :: Value -> Parser MessageContent
parseMessageVoiceNote = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageVoiceNote" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe VoiceNote
voice_note_  <- Object
o Object -> Key -> Parser (Maybe VoiceNote)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"voice_note"
        Maybe FormattedText
caption_     <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"caption"
        Maybe Bool
is_listened_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_listened"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageVoiceNote
          { voice_note :: Maybe VoiceNote
voice_note  = Maybe VoiceNote
voice_note_
          , caption :: Maybe FormattedText
caption     = Maybe FormattedText
caption_
          , is_listened :: Maybe Bool
is_listened = Maybe Bool
is_listened_
          }
      parseMessageLocation :: A.Value -> AT.Parser MessageContent
      parseMessageLocation :: Value -> Parser MessageContent
parseMessageLocation = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageLocation" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Location
location_               <- Object
o Object -> Key -> Parser (Maybe Location)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"location"
        Maybe Int
live_period_            <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"live_period"
        Maybe Int
expires_in_             <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"expires_in"
        Maybe Int
heading_                <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"heading"
        Maybe Int
proximity_alert_radius_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"proximity_alert_radius"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageLocation
          { location :: Maybe Location
location               = Maybe Location
location_
          , live_period :: Maybe Int
live_period            = Maybe Int
live_period_
          , expires_in :: Maybe Int
expires_in             = Maybe Int
expires_in_
          , heading :: Maybe Int
heading                = Maybe Int
heading_
          , proximity_alert_radius :: Maybe Int
proximity_alert_radius = Maybe Int
proximity_alert_radius_
          }
      parseMessageVenue :: A.Value -> AT.Parser MessageContent
      parseMessageVenue :: Value -> Parser MessageContent
parseMessageVenue = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageVenue" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Venue
venue_ <- Object
o Object -> Key -> Parser (Maybe Venue)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"venue"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageVenue
          { venue :: Maybe Venue
venue = Maybe Venue
venue_
          }
      parseMessageContact :: A.Value -> AT.Parser MessageContent
      parseMessageContact :: Value -> Parser MessageContent
parseMessageContact = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageContact" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Contact
contact_ <- Object
o Object -> Key -> Parser (Maybe Contact)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"contact"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageContact
          { contact :: Maybe Contact
contact = Maybe Contact
contact_
          }
      parseMessageAnimatedEmoji :: A.Value -> AT.Parser MessageContent
      parseMessageAnimatedEmoji :: Value -> Parser MessageContent
parseMessageAnimatedEmoji = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageAnimatedEmoji" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe AnimatedEmoji
animated_emoji_ <- Object
o Object -> Key -> Parser (Maybe AnimatedEmoji)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"animated_emoji"
        Maybe Text
emoji_          <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"emoji"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageAnimatedEmoji
          { animated_emoji :: Maybe AnimatedEmoji
animated_emoji = Maybe AnimatedEmoji
animated_emoji_
          , emoji :: Maybe Text
emoji          = Maybe Text
emoji_
          }
      parseMessageDice :: A.Value -> AT.Parser MessageContent
      parseMessageDice :: Value -> Parser MessageContent
parseMessageDice = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageDice" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe DiceStickers
initial_state_                  <- Object
o Object -> Key -> Parser (Maybe DiceStickers)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"initial_state"
        Maybe DiceStickers
final_state_                    <- Object
o Object -> Key -> Parser (Maybe DiceStickers)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"final_state"
        Maybe Text
emoji_                          <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"emoji"
        Maybe Int
value_                          <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"value"
        Maybe Int
success_animation_frame_number_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"success_animation_frame_number"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageDice
          { initial_state :: Maybe DiceStickers
initial_state                  = Maybe DiceStickers
initial_state_
          , final_state :: Maybe DiceStickers
final_state                    = Maybe DiceStickers
final_state_
          , emoji :: Maybe Text
emoji                          = Maybe Text
emoji_
          , value :: Maybe Int
value                          = Maybe Int
value_
          , success_animation_frame_number :: Maybe Int
success_animation_frame_number = Maybe Int
success_animation_frame_number_
          }
      parseMessageGame :: A.Value -> AT.Parser MessageContent
      parseMessageGame :: Value -> Parser MessageContent
parseMessageGame = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGame" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Game
game_ <- Object
o Object -> Key -> Parser (Maybe Game)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"game"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGame
          { game :: Maybe Game
game = Maybe Game
game_
          }
      parseMessagePoll :: A.Value -> AT.Parser MessageContent
      parseMessagePoll :: Value -> Parser MessageContent
parseMessagePoll = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePoll" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Poll
poll_ <- Object
o Object -> Key -> Parser (Maybe Poll)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"poll"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePoll
          { poll :: Maybe Poll
poll = Maybe Poll
poll_
          }
      parseMessageStory :: A.Value -> AT.Parser MessageContent
      parseMessageStory :: Value -> Parser MessageContent
parseMessageStory = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageStory" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
story_sender_chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"story_sender_chat_id"
        Maybe Int
story_id_             <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"story_id"
        Maybe Bool
via_mention_          <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"via_mention"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageStory
          { story_sender_chat_id :: Maybe Int
story_sender_chat_id = Maybe Int
story_sender_chat_id_
          , story_id :: Maybe Int
story_id             = Maybe Int
story_id_
          , via_mention :: Maybe Bool
via_mention          = Maybe Bool
via_mention_
          }
      parseMessageInvoice :: A.Value -> AT.Parser MessageContent
      parseMessageInvoice :: Value -> Parser MessageContent
parseMessageInvoice = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageInvoice" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ProductInfo
product_info_          <- Object
o Object -> Key -> Parser (Maybe ProductInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"product_info"
        Maybe Text
currency_              <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"currency"
        Maybe Int
total_amount_          <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"total_amount"
        Maybe Text
start_parameter_       <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"start_parameter"
        Maybe Bool
is_test_               <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_test"
        Maybe Bool
need_shipping_address_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"need_shipping_address"
        Maybe Int
receipt_message_id_    <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"receipt_message_id"
        Maybe PaidMedia
paid_media_            <- Object
o Object -> Key -> Parser (Maybe PaidMedia)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"paid_media"
        Maybe FormattedText
paid_media_caption_    <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"paid_media_caption"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageInvoice
          { product_info :: Maybe ProductInfo
product_info          = Maybe ProductInfo
product_info_
          , currency :: Maybe Text
currency              = Maybe Text
currency_
          , total_amount :: Maybe Int
total_amount          = Maybe Int
total_amount_
          , start_parameter :: Maybe Text
start_parameter       = Maybe Text
start_parameter_
          , is_test :: Maybe Bool
is_test               = Maybe Bool
is_test_
          , need_shipping_address :: Maybe Bool
need_shipping_address = Maybe Bool
need_shipping_address_
          , receipt_message_id :: Maybe Int
receipt_message_id    = Maybe Int
receipt_message_id_
          , paid_media :: Maybe PaidMedia
paid_media            = Maybe PaidMedia
paid_media_
          , paid_media_caption :: Maybe FormattedText
paid_media_caption    = Maybe FormattedText
paid_media_caption_
          }
      parseMessageCall :: A.Value -> AT.Parser MessageContent
      parseMessageCall :: Value -> Parser MessageContent
parseMessageCall = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageCall" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
is_video_       <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_video"
        Maybe CallDiscardReason
discard_reason_ <- Object
o Object -> Key -> Parser (Maybe CallDiscardReason)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"discard_reason"
        Maybe Int
duration_       <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"duration"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageCall
          { is_video :: Maybe Bool
is_video       = Maybe Bool
is_video_
          , discard_reason :: Maybe CallDiscardReason
discard_reason = Maybe CallDiscardReason
discard_reason_
          , duration :: Maybe Int
duration       = Maybe Int
duration_
          }
      parseMessageVideoChatScheduled :: A.Value -> AT.Parser MessageContent
      parseMessageVideoChatScheduled :: Value -> Parser MessageContent
parseMessageVideoChatScheduled = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageVideoChatScheduled" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
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"
        Maybe Int
start_date_    <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"start_date"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageVideoChatScheduled
          { group_call_id :: Maybe Int
group_call_id = Maybe Int
group_call_id_
          , start_date :: Maybe Int
start_date    = Maybe Int
start_date_
          }
      parseMessageVideoChatStarted :: A.Value -> AT.Parser MessageContent
      parseMessageVideoChatStarted :: Value -> Parser MessageContent
parseMessageVideoChatStarted = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageVideoChatStarted" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
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"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageVideoChatStarted
          { group_call_id :: Maybe Int
group_call_id = Maybe Int
group_call_id_
          }
      parseMessageVideoChatEnded :: A.Value -> AT.Parser MessageContent
      parseMessageVideoChatEnded :: Value -> Parser MessageContent
parseMessageVideoChatEnded = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageVideoChatEnded" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
duration_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"duration"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageVideoChatEnded
          { duration :: Maybe Int
duration = Maybe Int
duration_
          }
      parseMessageInviteVideoChatParticipants :: A.Value -> AT.Parser MessageContent
      parseMessageInviteVideoChatParticipants :: Value -> Parser MessageContent
parseMessageInviteVideoChatParticipants = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageInviteVideoChatParticipants" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
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"
        Maybe [Int]
user_ids_      <- Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"user_ids"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageInviteVideoChatParticipants
          { group_call_id :: Maybe Int
group_call_id = Maybe Int
group_call_id_
          , user_ids :: Maybe [Int]
user_ids      = Maybe [Int]
user_ids_
          }
      parseMessageBasicGroupChatCreate :: A.Value -> AT.Parser MessageContent
      parseMessageBasicGroupChatCreate :: Value -> Parser MessageContent
parseMessageBasicGroupChatCreate = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageBasicGroupChatCreate" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
title_           <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"title"
        Maybe [Int]
member_user_ids_ <- Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"member_user_ids"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageBasicGroupChatCreate
          { title :: Maybe Text
title           = Maybe Text
title_
          , member_user_ids :: Maybe [Int]
member_user_ids = Maybe [Int]
member_user_ids_
          }
      parseMessageSupergroupChatCreate :: A.Value -> AT.Parser MessageContent
      parseMessageSupergroupChatCreate :: Value -> Parser MessageContent
parseMessageSupergroupChatCreate = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageSupergroupChatCreate" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
title_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"title"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageSupergroupChatCreate
          { title :: Maybe Text
title = Maybe Text
title_
          }
      parseMessageChatChangeTitle :: A.Value -> AT.Parser MessageContent
      parseMessageChatChangeTitle :: Value -> Parser MessageContent
parseMessageChatChangeTitle = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatChangeTitle" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
title_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"title"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatChangeTitle
          { title :: Maybe Text
title = Maybe Text
title_
          }
      parseMessageChatChangePhoto :: A.Value -> AT.Parser MessageContent
      parseMessageChatChangePhoto :: Value -> Parser MessageContent
parseMessageChatChangePhoto = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatChangePhoto" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatPhoto
_photo_ <- Object
o Object -> Key -> Parser (Maybe ChatPhoto)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"photo"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatChangePhoto
          { _photo :: Maybe ChatPhoto
_photo = Maybe ChatPhoto
_photo_
          }
      parseMessageChatAddMembers :: A.Value -> AT.Parser MessageContent
      parseMessageChatAddMembers :: Value -> Parser MessageContent
parseMessageChatAddMembers = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatAddMembers" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [Int]
member_user_ids_ <- Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"member_user_ids"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatAddMembers
          { member_user_ids :: Maybe [Int]
member_user_ids = Maybe [Int]
member_user_ids_
          }
      parseMessageChatDeleteMember :: A.Value -> AT.Parser MessageContent
      parseMessageChatDeleteMember :: Value -> Parser MessageContent
parseMessageChatDeleteMember = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatDeleteMember" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
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"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatDeleteMember
          { user_id :: Maybe Int
user_id = Maybe Int
user_id_
          }
      parseMessageChatUpgradeTo :: A.Value -> AT.Parser MessageContent
      parseMessageChatUpgradeTo :: Value -> Parser MessageContent
parseMessageChatUpgradeTo = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatUpgradeTo" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
supergroup_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"supergroup_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatUpgradeTo
          { supergroup_id :: Maybe Int
supergroup_id = Maybe Int
supergroup_id_
          }
      parseMessageChatUpgradeFrom :: A.Value -> AT.Parser MessageContent
      parseMessageChatUpgradeFrom :: Value -> Parser MessageContent
parseMessageChatUpgradeFrom = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatUpgradeFrom" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
title_          <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"title"
        Maybe Int
basic_group_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"basic_group_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatUpgradeFrom
          { title :: Maybe Text
title          = Maybe Text
title_
          , basic_group_id :: Maybe Int
basic_group_id = Maybe Int
basic_group_id_
          }
      parseMessagePinMessage :: A.Value -> AT.Parser MessageContent
      parseMessagePinMessage :: Value -> Parser MessageContent
parseMessagePinMessage = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePinMessage" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"message_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePinMessage
          { message_id :: Maybe Int
message_id = Maybe Int
message_id_
          }
      parseMessageChatSetBackground :: A.Value -> AT.Parser MessageContent
      parseMessageChatSetBackground :: Value -> Parser MessageContent
parseMessageChatSetBackground = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatSetBackground" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
old_background_message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"old_background_message_id"
        Maybe ChatBackground
background_                <- Object
o Object -> Key -> Parser (Maybe ChatBackground)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"background"
        Maybe Bool
only_for_self_             <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"only_for_self"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatSetBackground
          { old_background_message_id :: Maybe Int
old_background_message_id = Maybe Int
old_background_message_id_
          , background :: Maybe ChatBackground
background                = Maybe ChatBackground
background_
          , only_for_self :: Maybe Bool
only_for_self             = Maybe Bool
only_for_self_
          }
      parseMessageChatSetTheme :: A.Value -> AT.Parser MessageContent
      parseMessageChatSetTheme :: Value -> Parser MessageContent
parseMessageChatSetTheme = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatSetTheme" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
theme_name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"theme_name"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatSetTheme
          { theme_name :: Maybe Text
theme_name = Maybe Text
theme_name_
          }
      parseMessageChatSetMessageAutoDeleteTime :: A.Value -> AT.Parser MessageContent
      parseMessageChatSetMessageAutoDeleteTime :: Value -> Parser MessageContent
parseMessageChatSetMessageAutoDeleteTime = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatSetMessageAutoDeleteTime" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
message_auto_delete_time_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"message_auto_delete_time"
        Maybe Int
from_user_id_             <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"from_user_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatSetMessageAutoDeleteTime
          { message_auto_delete_time :: Maybe Int
message_auto_delete_time = Maybe Int
message_auto_delete_time_
          , from_user_id :: Maybe Int
from_user_id             = Maybe Int
from_user_id_
          }
      parseMessageChatBoost :: A.Value -> AT.Parser MessageContent
      parseMessageChatBoost :: Value -> Parser MessageContent
parseMessageChatBoost = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatBoost" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
boost_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"boost_count"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatBoost
          { boost_count :: Maybe Int
boost_count = Maybe Int
boost_count_
          }
      parseMessageForumTopicCreated :: A.Value -> AT.Parser MessageContent
      parseMessageForumTopicCreated :: Value -> Parser MessageContent
parseMessageForumTopicCreated = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageForumTopicCreated" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
name_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"name"
        Maybe ForumTopicIcon
icon_ <- Object
o Object -> Key -> Parser (Maybe ForumTopicIcon)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"icon"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageForumTopicCreated
          { name :: Maybe Text
name = Maybe Text
name_
          , icon :: Maybe ForumTopicIcon
icon = Maybe ForumTopicIcon
icon_
          }
      parseMessageForumTopicEdited :: A.Value -> AT.Parser MessageContent
      parseMessageForumTopicEdited :: Value -> Parser MessageContent
parseMessageForumTopicEdited = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageForumTopicEdited" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
name_                      <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"name"
        Maybe Bool
edit_icon_custom_emoji_id_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"edit_icon_custom_emoji_id"
        Maybe Int
icon_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
"icon_custom_emoji_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageForumTopicEdited
          { name :: Maybe Text
name                      = Maybe Text
name_
          , edit_icon_custom_emoji_id :: Maybe Bool
edit_icon_custom_emoji_id = Maybe Bool
edit_icon_custom_emoji_id_
          , icon_custom_emoji_id :: Maybe Int
icon_custom_emoji_id      = Maybe Int
icon_custom_emoji_id_
          }
      parseMessageForumTopicIsClosedToggled :: A.Value -> AT.Parser MessageContent
      parseMessageForumTopicIsClosedToggled :: Value -> Parser MessageContent
parseMessageForumTopicIsClosedToggled = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageForumTopicIsClosedToggled" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
is_closed_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_closed"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageForumTopicIsClosedToggled
          { is_closed :: Maybe Bool
is_closed = Maybe Bool
is_closed_
          }
      parseMessageForumTopicIsHiddenToggled :: A.Value -> AT.Parser MessageContent
      parseMessageForumTopicIsHiddenToggled :: Value -> Parser MessageContent
parseMessageForumTopicIsHiddenToggled = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageForumTopicIsHiddenToggled" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Bool
is_hidden_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_hidden"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageForumTopicIsHiddenToggled
          { is_hidden :: Maybe Bool
is_hidden = Maybe Bool
is_hidden_
          }
      parseMessageSuggestProfilePhoto :: A.Value -> AT.Parser MessageContent
      parseMessageSuggestProfilePhoto :: Value -> Parser MessageContent
parseMessageSuggestProfilePhoto = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageSuggestProfilePhoto" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe ChatPhoto
_photo_ <- Object
o Object -> Key -> Parser (Maybe ChatPhoto)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"photo"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageSuggestProfilePhoto
          { _photo :: Maybe ChatPhoto
_photo = Maybe ChatPhoto
_photo_
          }
      parseMessageCustomServiceAction :: A.Value -> AT.Parser MessageContent
      parseMessageCustomServiceAction :: Value -> Parser MessageContent
parseMessageCustomServiceAction = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageCustomServiceAction" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
_text_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageCustomServiceAction
          { _text :: Maybe Text
_text = Maybe Text
_text_
          }
      parseMessageGameScore :: A.Value -> AT.Parser MessageContent
      parseMessageGameScore :: Value -> Parser MessageContent
parseMessageGameScore = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGameScore" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
game_message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"game_message_id"
        Maybe Int
game_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
"game_id"
        Maybe Int
score_           <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"score"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGameScore
          { game_message_id :: Maybe Int
game_message_id = Maybe Int
game_message_id_
          , game_id :: Maybe Int
game_id         = Maybe Int
game_id_
          , score :: Maybe Int
score           = Maybe Int
score_
          }
      parseMessagePaymentSuccessful :: A.Value -> AT.Parser MessageContent
      parseMessagePaymentSuccessful :: Value -> Parser MessageContent
parseMessagePaymentSuccessful = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePaymentSuccessful" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
invoice_chat_id_    <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"invoice_chat_id"
        Maybe Int
invoice_message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"invoice_message_id"
        Maybe Text
currency_           <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"currency"
        Maybe Int
total_amount_       <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"total_amount"
        Maybe Bool
is_recurring_       <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_recurring"
        Maybe Bool
is_first_recurring_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_first_recurring"
        Maybe Text
invoice_name_       <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"invoice_name"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePaymentSuccessful
          { invoice_chat_id :: Maybe Int
invoice_chat_id    = Maybe Int
invoice_chat_id_
          , invoice_message_id :: Maybe Int
invoice_message_id = Maybe Int
invoice_message_id_
          , currency :: Maybe Text
currency           = Maybe Text
currency_
          , total_amount :: Maybe Int
total_amount       = Maybe Int
total_amount_
          , is_recurring :: Maybe Bool
is_recurring       = Maybe Bool
is_recurring_
          , is_first_recurring :: Maybe Bool
is_first_recurring = Maybe Bool
is_first_recurring_
          , invoice_name :: Maybe Text
invoice_name       = Maybe Text
invoice_name_
          }
      parseMessagePaymentSuccessfulBot :: A.Value -> AT.Parser MessageContent
      parseMessagePaymentSuccessfulBot :: Value -> Parser MessageContent
parseMessagePaymentSuccessfulBot = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePaymentSuccessfulBot" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
currency_                   <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"currency"
        Maybe Int
total_amount_               <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"total_amount"
        Maybe Bool
is_recurring_               <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"is_recurring"
        Maybe Bool
is_first_recurring_         <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"is_first_recurring"
        Maybe ByteString
invoice_payload_            <- (String -> ByteString) -> Maybe String -> Maybe ByteString
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ByteString
I.readBytes (Maybe String -> Maybe ByteString)
-> Parser (Maybe String) -> Parser (Maybe ByteString)
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
"invoice_payload"
        Maybe Text
shipping_option_id_         <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"shipping_option_id"
        Maybe OrderInfo
order_info_                 <- Object
o Object -> Key -> Parser (Maybe OrderInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"order_info"
        Maybe Text
telegram_payment_charge_id_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"telegram_payment_charge_id"
        Maybe Text
provider_payment_charge_id_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"provider_payment_charge_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePaymentSuccessfulBot
          { currency :: Maybe Text
currency                   = Maybe Text
currency_
          , total_amount :: Maybe Int
total_amount               = Maybe Int
total_amount_
          , is_recurring :: Maybe Bool
is_recurring               = Maybe Bool
is_recurring_
          , is_first_recurring :: Maybe Bool
is_first_recurring         = Maybe Bool
is_first_recurring_
          , invoice_payload :: Maybe ByteString
invoice_payload            = Maybe ByteString
invoice_payload_
          , shipping_option_id :: Maybe Text
shipping_option_id         = Maybe Text
shipping_option_id_
          , order_info :: Maybe OrderInfo
order_info                 = Maybe OrderInfo
order_info_
          , telegram_payment_charge_id :: Maybe Text
telegram_payment_charge_id = Maybe Text
telegram_payment_charge_id_
          , provider_payment_charge_id :: Maybe Text
provider_payment_charge_id = Maybe Text
provider_payment_charge_id_
          }
      parseMessagePaymentRefunded :: A.Value -> AT.Parser MessageContent
      parseMessagePaymentRefunded :: Value -> Parser MessageContent
parseMessagePaymentRefunded = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePaymentRefunded" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe MessageSender
owner_id_                   <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"owner_id"
        Maybe Text
currency_                   <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"currency"
        Maybe Int
total_amount_               <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"total_amount"
        Maybe ByteString
invoice_payload_            <- (String -> ByteString) -> Maybe String -> Maybe ByteString
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ByteString
I.readBytes (Maybe String -> Maybe ByteString)
-> Parser (Maybe String) -> Parser (Maybe ByteString)
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
"invoice_payload"
        Maybe Text
telegram_payment_charge_id_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"telegram_payment_charge_id"
        Maybe Text
provider_payment_charge_id_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"provider_payment_charge_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePaymentRefunded
          { owner_id :: Maybe MessageSender
owner_id                   = Maybe MessageSender
owner_id_
          , currency :: Maybe Text
currency                   = Maybe Text
currency_
          , total_amount :: Maybe Int
total_amount               = Maybe Int
total_amount_
          , invoice_payload :: Maybe ByteString
invoice_payload            = Maybe ByteString
invoice_payload_
          , telegram_payment_charge_id :: Maybe Text
telegram_payment_charge_id = Maybe Text
telegram_payment_charge_id_
          , provider_payment_charge_id :: Maybe Text
provider_payment_charge_id = Maybe Text
provider_payment_charge_id_
          }
      parseMessageGiftedPremium :: A.Value -> AT.Parser MessageContent
      parseMessageGiftedPremium :: Value -> Parser MessageContent
parseMessageGiftedPremium = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGiftedPremium" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
gifter_user_id_        <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"gifter_user_id"
        Maybe Int
receiver_user_id_      <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"receiver_user_id"
        Maybe FormattedText
text_                  <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"text"
        Maybe Text
currency_              <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"currency"
        Maybe Int
amount_                <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"amount"
        Maybe Text
cryptocurrency_        <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"cryptocurrency"
        Maybe Int
cryptocurrency_amount_ <- (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
"cryptocurrency_amount"
        Maybe Int
month_count_           <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"month_count"
        Maybe Sticker
sticker_               <- Object
o Object -> Key -> Parser (Maybe Sticker)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"sticker"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGiftedPremium
          { gifter_user_id :: Maybe Int
gifter_user_id        = Maybe Int
gifter_user_id_
          , receiver_user_id :: Maybe Int
receiver_user_id      = Maybe Int
receiver_user_id_
          , text :: Maybe FormattedText
text                  = Maybe FormattedText
text_
          , currency :: Maybe Text
currency              = Maybe Text
currency_
          , amount :: Maybe Int
amount                = Maybe Int
amount_
          , cryptocurrency :: Maybe Text
cryptocurrency        = Maybe Text
cryptocurrency_
          , cryptocurrency_amount :: Maybe Int
cryptocurrency_amount = Maybe Int
cryptocurrency_amount_
          , month_count :: Maybe Int
month_count           = Maybe Int
month_count_
          , sticker :: Maybe Sticker
sticker               = Maybe Sticker
sticker_
          }
      parseMessagePremiumGiftCode :: A.Value -> AT.Parser MessageContent
      parseMessagePremiumGiftCode :: Value -> Parser MessageContent
parseMessagePremiumGiftCode = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePremiumGiftCode" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe MessageSender
creator_id_            <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"creator_id"
        Maybe FormattedText
text_                  <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"text"
        Maybe Bool
is_from_giveaway_      <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"is_from_giveaway"
        Maybe Bool
is_unclaimed_          <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"is_unclaimed"
        Maybe Text
currency_              <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"currency"
        Maybe Int
amount_                <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"amount"
        Maybe Text
cryptocurrency_        <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"cryptocurrency"
        Maybe Int
cryptocurrency_amount_ <- (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
"cryptocurrency_amount"
        Maybe Int
month_count_           <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"month_count"
        Maybe Sticker
sticker_               <- Object
o Object -> Key -> Parser (Maybe Sticker)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"sticker"
        Maybe Text
code_                  <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"code"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePremiumGiftCode
          { creator_id :: Maybe MessageSender
creator_id            = Maybe MessageSender
creator_id_
          , text :: Maybe FormattedText
text                  = Maybe FormattedText
text_
          , is_from_giveaway :: Maybe Bool
is_from_giveaway      = Maybe Bool
is_from_giveaway_
          , is_unclaimed :: Maybe Bool
is_unclaimed          = Maybe Bool
is_unclaimed_
          , currency :: Maybe Text
currency              = Maybe Text
currency_
          , amount :: Maybe Int
amount                = Maybe Int
amount_
          , cryptocurrency :: Maybe Text
cryptocurrency        = Maybe Text
cryptocurrency_
          , cryptocurrency_amount :: Maybe Int
cryptocurrency_amount = Maybe Int
cryptocurrency_amount_
          , month_count :: Maybe Int
month_count           = Maybe Int
month_count_
          , sticker :: Maybe Sticker
sticker               = Maybe Sticker
sticker_
          , code :: Maybe Text
code                  = Maybe Text
code_
          }
      parseMessageGiveawayCreated :: A.Value -> AT.Parser MessageContent
      parseMessageGiveawayCreated :: Value -> Parser MessageContent
parseMessageGiveawayCreated = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGiveawayCreated" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
star_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"star_count"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGiveawayCreated
          { star_count :: Maybe Int
star_count = Maybe Int
star_count_
          }
      parseMessageGiveaway :: A.Value -> AT.Parser MessageContent
      parseMessageGiveaway :: Value -> Parser MessageContent
parseMessageGiveaway = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGiveaway" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe GiveawayParameters
parameters_   <- Object
o Object -> Key -> Parser (Maybe GiveawayParameters)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"parameters"
        Maybe Int
winner_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"winner_count"
        Maybe GiveawayPrize
prize_        <- Object
o Object -> Key -> Parser (Maybe GiveawayPrize)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"prize"
        Maybe Sticker
sticker_      <- Object
o Object -> Key -> Parser (Maybe Sticker)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"sticker"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGiveaway
          { parameters :: Maybe GiveawayParameters
parameters   = Maybe GiveawayParameters
parameters_
          , winner_count :: Maybe Int
winner_count = Maybe Int
winner_count_
          , prize :: Maybe GiveawayPrize
prize        = Maybe GiveawayPrize
prize_
          , sticker :: Maybe Sticker
sticker      = Maybe Sticker
sticker_
          }
      parseMessageGiveawayCompleted :: A.Value -> AT.Parser MessageContent
      parseMessageGiveawayCompleted :: Value -> Parser MessageContent
parseMessageGiveawayCompleted = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGiveawayCompleted" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
giveaway_message_id_   <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"giveaway_message_id"
        Maybe Int
winner_count_          <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"winner_count"
        Maybe Bool
is_star_giveaway_      <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_star_giveaway"
        Maybe Int
unclaimed_prize_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"unclaimed_prize_count"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGiveawayCompleted
          { giveaway_message_id :: Maybe Int
giveaway_message_id   = Maybe Int
giveaway_message_id_
          , winner_count :: Maybe Int
winner_count          = Maybe Int
winner_count_
          , is_star_giveaway :: Maybe Bool
is_star_giveaway      = Maybe Bool
is_star_giveaway_
          , unclaimed_prize_count :: Maybe Int
unclaimed_prize_count = Maybe Int
unclaimed_prize_count_
          }
      parseMessageGiveawayWinners :: A.Value -> AT.Parser MessageContent
      parseMessageGiveawayWinners :: Value -> Parser MessageContent
parseMessageGiveawayWinners = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGiveawayWinners" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
boosted_chat_id_               <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"boosted_chat_id"
        Maybe Int
giveaway_message_id_           <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"giveaway_message_id"
        Maybe Int
additional_chat_count_         <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"additional_chat_count"
        Maybe Int
actual_winners_selection_date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"actual_winners_selection_date"
        Maybe Bool
only_new_members_              <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"only_new_members"
        Maybe Bool
was_refunded_                  <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"was_refunded"
        Maybe GiveawayPrize
prize_                         <- Object
o Object -> Key -> Parser (Maybe GiveawayPrize)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"prize"
        Maybe Text
prize_description_             <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"prize_description"
        Maybe Int
winner_count_                  <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"winner_count"
        Maybe [Int]
winner_user_ids_               <- Object
o Object -> Key -> Parser (Maybe [Int])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"winner_user_ids"
        Maybe Int
unclaimed_prize_count_         <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"unclaimed_prize_count"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGiveawayWinners
          { boosted_chat_id :: Maybe Int
boosted_chat_id               = Maybe Int
boosted_chat_id_
          , giveaway_message_id :: Maybe Int
giveaway_message_id           = Maybe Int
giveaway_message_id_
          , additional_chat_count :: Maybe Int
additional_chat_count         = Maybe Int
additional_chat_count_
          , actual_winners_selection_date :: Maybe Int
actual_winners_selection_date = Maybe Int
actual_winners_selection_date_
          , only_new_members :: Maybe Bool
only_new_members              = Maybe Bool
only_new_members_
          , was_refunded :: Maybe Bool
was_refunded                  = Maybe Bool
was_refunded_
          , prize :: Maybe GiveawayPrize
prize                         = Maybe GiveawayPrize
prize_
          , prize_description :: Maybe Text
prize_description             = Maybe Text
prize_description_
          , winner_count :: Maybe Int
winner_count                  = Maybe Int
winner_count_
          , winner_user_ids :: Maybe [Int]
winner_user_ids               = Maybe [Int]
winner_user_ids_
          , unclaimed_prize_count :: Maybe Int
unclaimed_prize_count         = Maybe Int
unclaimed_prize_count_
          }
      parseMessageGiftedStars :: A.Value -> AT.Parser MessageContent
      parseMessageGiftedStars :: Value -> Parser MessageContent
parseMessageGiftedStars = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGiftedStars" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
gifter_user_id_        <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"gifter_user_id"
        Maybe Int
receiver_user_id_      <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"receiver_user_id"
        Maybe Text
currency_              <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"currency"
        Maybe Int
amount_                <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"amount"
        Maybe Text
cryptocurrency_        <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"cryptocurrency"
        Maybe Int
cryptocurrency_amount_ <- (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
"cryptocurrency_amount"
        Maybe Int
star_count_            <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"star_count"
        Maybe Text
transaction_id_        <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"transaction_id"
        Maybe Sticker
sticker_               <- Object
o Object -> Key -> Parser (Maybe Sticker)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?                       Key
"sticker"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGiftedStars
          { gifter_user_id :: Maybe Int
gifter_user_id        = Maybe Int
gifter_user_id_
          , receiver_user_id :: Maybe Int
receiver_user_id      = Maybe Int
receiver_user_id_
          , currency :: Maybe Text
currency              = Maybe Text
currency_
          , amount :: Maybe Int
amount                = Maybe Int
amount_
          , cryptocurrency :: Maybe Text
cryptocurrency        = Maybe Text
cryptocurrency_
          , cryptocurrency_amount :: Maybe Int
cryptocurrency_amount = Maybe Int
cryptocurrency_amount_
          , star_count :: Maybe Int
star_count            = Maybe Int
star_count_
          , transaction_id :: Maybe Text
transaction_id        = Maybe Text
transaction_id_
          , sticker :: Maybe Sticker
sticker               = Maybe Sticker
sticker_
          }
      parseMessageGiveawayPrizeStars :: A.Value -> AT.Parser MessageContent
      parseMessageGiveawayPrizeStars :: Value -> Parser MessageContent
parseMessageGiveawayPrizeStars = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGiveawayPrizeStars" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Int
star_count_          <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"star_count"
        Maybe Text
transaction_id_      <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"transaction_id"
        Maybe Int
boosted_chat_id_     <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"boosted_chat_id"
        Maybe Int
giveaway_message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"giveaway_message_id"
        Maybe Bool
is_unclaimed_        <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_unclaimed"
        Maybe Sticker
sticker_             <- Object
o Object -> Key -> Parser (Maybe Sticker)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"sticker"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGiveawayPrizeStars
          { star_count :: Maybe Int
star_count          = Maybe Int
star_count_
          , transaction_id :: Maybe Text
transaction_id      = Maybe Text
transaction_id_
          , boosted_chat_id :: Maybe Int
boosted_chat_id     = Maybe Int
boosted_chat_id_
          , giveaway_message_id :: Maybe Int
giveaway_message_id = Maybe Int
giveaway_message_id_
          , is_unclaimed :: Maybe Bool
is_unclaimed        = Maybe Bool
is_unclaimed_
          , sticker :: Maybe Sticker
sticker             = Maybe Sticker
sticker_
          }
      parseMessageGift :: A.Value -> AT.Parser MessageContent
      parseMessageGift :: Value -> Parser MessageContent
parseMessageGift = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageGift" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Gift
gift_            <- Object
o Object -> Key -> Parser (Maybe Gift)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"gift"
        Maybe FormattedText
text_            <- Object
o Object -> Key -> Parser (Maybe FormattedText)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"text"
        Maybe Int
sell_star_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"sell_star_count"
        Maybe Bool
is_private_      <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_private"
        Maybe Bool
is_saved_        <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"is_saved"
        Maybe Bool
was_converted_   <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"was_converted"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageGift
          { gift :: Maybe Gift
gift            = Maybe Gift
gift_
          , text :: Maybe FormattedText
text            = Maybe FormattedText
text_
          , sell_star_count :: Maybe Int
sell_star_count = Maybe Int
sell_star_count_
          , is_private :: Maybe Bool
is_private      = Maybe Bool
is_private_
          , is_saved :: Maybe Bool
is_saved        = Maybe Bool
is_saved_
          , was_converted :: Maybe Bool
was_converted   = Maybe Bool
was_converted_
          }
      parseMessageUsersShared :: A.Value -> AT.Parser MessageContent
      parseMessageUsersShared :: Value -> Parser MessageContent
parseMessageUsersShared = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageUsersShared" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [SharedUser]
users_     <- Object
o Object -> Key -> Parser (Maybe [SharedUser])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"users"
        Maybe Int
button_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"button_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageUsersShared
          { users :: Maybe [SharedUser]
users     = Maybe [SharedUser]
users_
          , button_id :: Maybe Int
button_id = Maybe Int
button_id_
          }
      parseMessageChatShared :: A.Value -> AT.Parser MessageContent
      parseMessageChatShared :: Value -> Parser MessageContent
parseMessageChatShared = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageChatShared" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe SharedChat
chat_      <- Object
o Object -> Key -> Parser (Maybe SharedChat)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"chat"
        Maybe Int
button_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"button_id"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageChatShared
          { chat :: Maybe SharedChat
chat      = Maybe SharedChat
chat_
          , button_id :: Maybe Int
button_id = Maybe Int
button_id_
          }
      parseMessageBotWriteAccessAllowed :: A.Value -> AT.Parser MessageContent
      parseMessageBotWriteAccessAllowed :: Value -> Parser MessageContent
parseMessageBotWriteAccessAllowed = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageBotWriteAccessAllowed" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe BotWriteAccessAllowReason
reason_ <- Object
o Object -> Key -> Parser (Maybe BotWriteAccessAllowReason)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"reason"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageBotWriteAccessAllowed
          { reason :: Maybe BotWriteAccessAllowReason
reason = Maybe BotWriteAccessAllowReason
reason_
          }
      parseMessageWebAppDataSent :: A.Value -> AT.Parser MessageContent
      parseMessageWebAppDataSent :: Value -> Parser MessageContent
parseMessageWebAppDataSent = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageWebAppDataSent" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
button_text_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"button_text"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageWebAppDataSent
          { button_text :: Maybe Text
button_text = Maybe Text
button_text_
          }
      parseMessageWebAppDataReceived :: A.Value -> AT.Parser MessageContent
      parseMessageWebAppDataReceived :: Value -> Parser MessageContent
parseMessageWebAppDataReceived = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageWebAppDataReceived" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe Text
button_text_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"button_text"
        Maybe Text
_data_       <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"data"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageWebAppDataReceived
          { button_text :: Maybe Text
button_text = Maybe Text
button_text_
          , _data :: Maybe Text
_data       = Maybe Text
_data_
          }
      parseMessagePassportDataSent :: A.Value -> AT.Parser MessageContent
      parseMessagePassportDataSent :: Value -> Parser MessageContent
parseMessagePassportDataSent = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePassportDataSent" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [PassportElementType]
types_ <- Object
o Object -> Key -> Parser (Maybe [PassportElementType])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"types"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePassportDataSent
          { types :: Maybe [PassportElementType]
types = Maybe [PassportElementType]
types_
          }
      parseMessagePassportDataReceived :: A.Value -> AT.Parser MessageContent
      parseMessagePassportDataReceived :: Value -> Parser MessageContent
parseMessagePassportDataReceived = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessagePassportDataReceived" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe [EncryptedPassportElement]
elements_    <- Object
o Object -> Key -> Parser (Maybe [EncryptedPassportElement])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"elements"
        Maybe EncryptedCredentials
credentials_ <- Object
o Object -> Key -> Parser (Maybe EncryptedCredentials)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"credentials"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessagePassportDataReceived
          { elements :: Maybe [EncryptedPassportElement]
elements    = Maybe [EncryptedPassportElement]
elements_
          , credentials :: Maybe EncryptedCredentials
credentials = Maybe EncryptedCredentials
credentials_
          }
      parseMessageProximityAlertTriggered :: A.Value -> AT.Parser MessageContent
      parseMessageProximityAlertTriggered :: Value -> Parser MessageContent
parseMessageProximityAlertTriggered = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageProximityAlertTriggered" ((Object -> Parser MessageContent)
 -> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
        Maybe MessageSender
traveler_id_ <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"traveler_id"
        Maybe MessageSender
watcher_id_  <- Object
o Object -> Key -> Parser (Maybe MessageSender)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"watcher_id"
        Maybe Int
distance_    <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:?  Key
"distance"
        MessageContent -> Parser MessageContent
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (MessageContent -> Parser MessageContent)
-> MessageContent -> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ MessageProximityAlertTriggered
          { traveler_id :: Maybe MessageSender
traveler_id = Maybe MessageSender
traveler_id_
          , watcher_id :: Maybe MessageSender
watcher_id  = Maybe MessageSender
watcher_id_
          , distance :: Maybe Int
distance    = Maybe Int
distance_
          }
  parseJSON Value
_ = Parser MessageContent
forall a. Monoid a => a
mempty