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.UpgradedGift as UpgradedGift
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
data MessageContent
= MessageText
{ MessageContent -> Maybe FormattedText
text :: Maybe FormattedText.FormattedText
, MessageContent -> Maybe LinkPreview
link_preview :: Maybe LinkPreview.LinkPreview
, MessageContent -> Maybe LinkPreviewOptions
link_preview_options :: Maybe LinkPreviewOptions.LinkPreviewOptions
}
| MessageAnimation
{ MessageContent -> Maybe Animation
animation :: Maybe Animation.Animation
, MessageContent -> Maybe FormattedText
caption :: Maybe FormattedText.FormattedText
, MessageContent -> Maybe Bool
show_caption_above_media :: Maybe Bool
, MessageContent -> Maybe Bool
has_spoiler :: Maybe Bool
, MessageContent -> Maybe Bool
is_secret :: Maybe Bool
}
| MessageAudio
{ MessageContent -> Maybe Audio
audio :: Maybe Audio.Audio
, caption :: Maybe FormattedText.FormattedText
}
| MessageDocument
{ MessageContent -> Maybe Document
document :: Maybe Document.Document
, caption :: Maybe FormattedText.FormattedText
}
| MessagePaidMedia
{ MessageContent -> Maybe Int
star_count :: Maybe Int
, MessageContent -> Maybe [PaidMedia]
media :: Maybe [PaidMedia.PaidMedia]
, caption :: Maybe FormattedText.FormattedText
, show_caption_above_media :: Maybe Bool
}
| MessagePhoto
{ MessageContent -> Maybe Photo
photo :: Maybe Photo.Photo
, caption :: Maybe FormattedText.FormattedText
, show_caption_above_media :: Maybe Bool
, has_spoiler :: Maybe Bool
, is_secret :: Maybe Bool
}
| MessageSticker
{ MessageContent -> Maybe Sticker
sticker :: Maybe Sticker.Sticker
, MessageContent -> Maybe Bool
is_premium :: Maybe Bool
}
| MessageVideo
{ MessageContent -> Maybe Video
video :: Maybe Video.Video
, MessageContent -> Maybe [AlternativeVideo]
alternative_videos :: Maybe [AlternativeVideo.AlternativeVideo]
, caption :: Maybe FormattedText.FormattedText
, show_caption_above_media :: Maybe Bool
, has_spoiler :: Maybe Bool
, is_secret :: Maybe Bool
}
| MessageVideoNote
{ MessageContent -> Maybe VideoNote
video_note :: Maybe VideoNote.VideoNote
, MessageContent -> Maybe Bool
is_viewed :: Maybe Bool
, is_secret :: Maybe Bool
}
| MessageVoiceNote
{ MessageContent -> Maybe VoiceNote
voice_note :: Maybe VoiceNote.VoiceNote
, caption :: Maybe FormattedText.FormattedText
, MessageContent -> Maybe Bool
is_listened :: Maybe Bool
}
| MessageExpiredPhoto
| MessageExpiredVideo
| MessageExpiredVideoNote
| MessageExpiredVoiceNote
| MessageLocation
{ MessageContent -> Maybe Location
location :: Maybe Location.Location
, MessageContent -> Maybe Int
live_period :: Maybe Int
, MessageContent -> Maybe Int
expires_in :: Maybe Int
, MessageContent -> Maybe Int
heading :: Maybe Int
, MessageContent -> Maybe Int
proximity_alert_radius :: Maybe Int
}
| MessageVenue
{ MessageContent -> Maybe Venue
venue :: Maybe Venue.Venue
}
| MessageContact
{ MessageContent -> Maybe Contact
contact :: Maybe Contact.Contact
}
| MessageAnimatedEmoji
{ MessageContent -> Maybe AnimatedEmoji
animated_emoji :: Maybe AnimatedEmoji.AnimatedEmoji
, MessageContent -> Maybe Text
emoji :: Maybe T.Text
}
| MessageDice
{ MessageContent -> Maybe DiceStickers
initial_state :: Maybe DiceStickers.DiceStickers
, MessageContent -> Maybe DiceStickers
final_state :: Maybe DiceStickers.DiceStickers
, emoji :: Maybe T.Text
, MessageContent -> Maybe Int
value :: Maybe Int
, MessageContent -> Maybe Int
success_animation_frame_number :: Maybe Int
}
| MessageGame
{ MessageContent -> Maybe Game
game :: Maybe Game.Game
}
| MessagePoll
{ MessageContent -> Maybe Poll
poll :: Maybe Poll.Poll
}
| MessageStory
{ MessageContent -> Maybe Int
story_sender_chat_id :: Maybe Int
, MessageContent -> Maybe Int
story_id :: Maybe Int
, MessageContent -> Maybe Bool
via_mention :: Maybe Bool
}
| MessageInvoice
{ MessageContent -> Maybe ProductInfo
product_info :: Maybe ProductInfo.ProductInfo
, MessageContent -> Maybe Text
currency :: Maybe T.Text
, MessageContent -> Maybe Int
total_amount :: Maybe Int
, MessageContent -> Maybe Text
start_parameter :: Maybe T.Text
, MessageContent -> Maybe Bool
is_test :: Maybe Bool
, MessageContent -> Maybe Bool
need_shipping_address :: Maybe Bool
, MessageContent -> Maybe Int
receipt_message_id :: Maybe Int
, MessageContent -> Maybe PaidMedia
paid_media :: Maybe PaidMedia.PaidMedia
, MessageContent -> Maybe FormattedText
paid_media_caption :: Maybe FormattedText.FormattedText
}
| MessageCall
{ MessageContent -> Maybe Bool
is_video :: Maybe Bool
, MessageContent -> Maybe CallDiscardReason
discard_reason :: Maybe CallDiscardReason.CallDiscardReason
, MessageContent -> Maybe Int
duration :: Maybe Int
}
| MessageVideoChatScheduled
{ MessageContent -> Maybe Int
group_call_id :: Maybe Int
, MessageContent -> Maybe Int
start_date :: Maybe Int
}
| MessageVideoChatStarted
{ group_call_id :: Maybe Int
}
| MessageVideoChatEnded
{ duration :: Maybe Int
}
| MessageInviteVideoChatParticipants
{ group_call_id :: Maybe Int
, MessageContent -> Maybe [Int]
user_ids :: Maybe [Int]
}
| MessageBasicGroupChatCreate
{ MessageContent -> Maybe Text
title :: Maybe T.Text
, MessageContent -> Maybe [Int]
member_user_ids :: Maybe [Int]
}
| MessageSupergroupChatCreate
{ title :: Maybe T.Text
}
| MessageChatChangeTitle
{ title :: Maybe T.Text
}
| MessageChatChangePhoto
{ MessageContent -> Maybe ChatPhoto
_photo :: Maybe ChatPhoto.ChatPhoto
}
| MessageChatDeletePhoto
| MessageChatAddMembers
{ member_user_ids :: Maybe [Int]
}
| MessageChatJoinByLink
| MessageChatJoinByRequest
| MessageChatDeleteMember
{ MessageContent -> Maybe Int
user_id :: Maybe Int
}
| MessageChatUpgradeTo
{ MessageContent -> Maybe Int
supergroup_id :: Maybe Int
}
| MessageChatUpgradeFrom
{ title :: Maybe T.Text
, MessageContent -> Maybe Int
basic_group_id :: Maybe Int
}
| MessagePinMessage
{ MessageContent -> Maybe Int
message_id :: Maybe Int
}
| MessageScreenshotTaken
| MessageChatSetBackground
{ MessageContent -> Maybe Int
old_background_message_id :: Maybe Int
, MessageContent -> Maybe ChatBackground
background :: Maybe ChatBackground.ChatBackground
, MessageContent -> Maybe Bool
only_for_self :: Maybe Bool
}
| MessageChatSetTheme
{ MessageContent -> Maybe Text
theme_name :: Maybe T.Text
}
| MessageChatSetMessageAutoDeleteTime
{ MessageContent -> Maybe Int
message_auto_delete_time :: Maybe Int
, MessageContent -> Maybe Int
from_user_id :: Maybe Int
}
| MessageChatBoost
{ MessageContent -> Maybe Int
boost_count :: Maybe Int
}
| MessageForumTopicCreated
{ MessageContent -> Maybe Text
name :: Maybe T.Text
, MessageContent -> Maybe ForumTopicIcon
icon :: Maybe ForumTopicIcon.ForumTopicIcon
}
| MessageForumTopicEdited
{ name :: Maybe T.Text
, MessageContent -> Maybe Bool
edit_icon_custom_emoji_id :: Maybe Bool
, MessageContent -> Maybe Int
icon_custom_emoji_id :: Maybe Int
}
| MessageForumTopicIsClosedToggled
{ MessageContent -> Maybe Bool
is_closed :: Maybe Bool
}
| MessageForumTopicIsHiddenToggled
{ MessageContent -> Maybe Bool
is_hidden :: Maybe Bool
}
| MessageSuggestProfilePhoto
{ _photo :: Maybe ChatPhoto.ChatPhoto
}
| MessageCustomServiceAction
{ MessageContent -> Maybe Text
_text :: Maybe T.Text
}
| MessageGameScore
{ MessageContent -> Maybe Int
game_message_id :: Maybe Int
, MessageContent -> Maybe Int
game_id :: Maybe Int
, MessageContent -> Maybe Int
score :: Maybe Int
}
| MessagePaymentSuccessful
{ MessageContent -> Maybe Int
invoice_chat_id :: Maybe Int
, MessageContent -> Maybe Int
invoice_message_id :: Maybe Int
, currency :: Maybe T.Text
, total_amount :: Maybe Int
, MessageContent -> Maybe Int
subscription_until_date :: Maybe Int
, MessageContent -> Maybe Bool
is_recurring :: Maybe Bool
, MessageContent -> Maybe Bool
is_first_recurring :: Maybe Bool
, MessageContent -> Maybe Text
invoice_name :: Maybe T.Text
}
| MessagePaymentSuccessfulBot
{ currency :: Maybe T.Text
, total_amount :: Maybe Int
, subscription_until_date :: Maybe Int
, is_recurring :: Maybe Bool
, is_first_recurring :: Maybe Bool
, MessageContent -> Maybe ByteString
invoice_payload :: Maybe BS.ByteString
, MessageContent -> Maybe Text
shipping_option_id :: Maybe T.Text
, MessageContent -> Maybe OrderInfo
order_info :: Maybe OrderInfo.OrderInfo
, MessageContent -> Maybe Text
telegram_payment_charge_id :: Maybe T.Text
, MessageContent -> Maybe Text
provider_payment_charge_id :: Maybe T.Text
}
| MessagePaymentRefunded
{ MessageContent -> Maybe MessageSender
owner_id :: Maybe MessageSender.MessageSender
, currency :: Maybe T.Text
, total_amount :: Maybe Int
, invoice_payload :: Maybe BS.ByteString
, telegram_payment_charge_id :: Maybe T.Text
, provider_payment_charge_id :: Maybe T.Text
}
| MessageGiftedPremium
{ MessageContent -> Maybe Int
gifter_user_id :: Maybe Int
, MessageContent -> Maybe Int
receiver_user_id :: Maybe Int
, text :: Maybe FormattedText.FormattedText
, currency :: Maybe T.Text
, MessageContent -> Maybe Int
amount :: Maybe Int
, MessageContent -> Maybe Text
cryptocurrency :: Maybe T.Text
, MessageContent -> Maybe Int
cryptocurrency_amount :: Maybe Int
, MessageContent -> Maybe Int
month_count :: Maybe Int
, sticker :: Maybe Sticker.Sticker
}
| MessagePremiumGiftCode
{ MessageContent -> Maybe MessageSender
creator_id :: Maybe MessageSender.MessageSender
, text :: Maybe FormattedText.FormattedText
, MessageContent -> Maybe Bool
is_from_giveaway :: Maybe Bool
, MessageContent -> Maybe Bool
is_unclaimed :: Maybe Bool
, currency :: Maybe T.Text
, amount :: Maybe Int
, cryptocurrency :: Maybe T.Text
, cryptocurrency_amount :: Maybe Int
, month_count :: Maybe Int
, sticker :: Maybe Sticker.Sticker
, MessageContent -> Maybe Text
code :: Maybe T.Text
}
| MessageGiveawayCreated
{ star_count :: Maybe Int
}
| MessageGiveaway
{ MessageContent -> Maybe GiveawayParameters
parameters :: Maybe GiveawayParameters.GiveawayParameters
, MessageContent -> Maybe Int
winner_count :: Maybe Int
, MessageContent -> Maybe GiveawayPrize
prize :: Maybe GiveawayPrize.GiveawayPrize
, sticker :: Maybe Sticker.Sticker
}
| MessageGiveawayCompleted
{ MessageContent -> Maybe Int
giveaway_message_id :: Maybe Int
, winner_count :: Maybe Int
, MessageContent -> Maybe Bool
is_star_giveaway :: Maybe Bool
, MessageContent -> Maybe Int
unclaimed_prize_count :: Maybe Int
}
| MessageGiveawayWinners
{ MessageContent -> Maybe Int
boosted_chat_id :: Maybe Int
, giveaway_message_id :: Maybe Int
, MessageContent -> Maybe Int
additional_chat_count :: Maybe Int
, MessageContent -> Maybe Int
actual_winners_selection_date :: Maybe Int
, MessageContent -> Maybe Bool
only_new_members :: Maybe Bool
, MessageContent -> Maybe Bool
was_refunded :: Maybe Bool
, prize :: Maybe GiveawayPrize.GiveawayPrize
, MessageContent -> Maybe Text
prize_description :: Maybe T.Text
, winner_count :: Maybe Int
, MessageContent -> Maybe [Int]
winner_user_ids :: Maybe [Int]
, unclaimed_prize_count :: Maybe Int
}
| MessageGiftedStars
{ gifter_user_id :: Maybe Int
, receiver_user_id :: Maybe Int
, currency :: Maybe T.Text
, amount :: Maybe Int
, cryptocurrency :: Maybe T.Text
, cryptocurrency_amount :: Maybe Int
, star_count :: Maybe Int
, MessageContent -> Maybe Text
transaction_id :: Maybe T.Text
, sticker :: Maybe Sticker.Sticker
}
| MessageGiveawayPrizeStars
{ star_count :: Maybe Int
, transaction_id :: Maybe T.Text
, boosted_chat_id :: Maybe Int
, giveaway_message_id :: Maybe Int
, is_unclaimed :: Maybe Bool
, sticker :: Maybe Sticker.Sticker
}
| MessageGift
{ MessageContent -> Maybe Gift
gift :: Maybe Gift.Gift
, text :: Maybe FormattedText.FormattedText
, MessageContent -> Maybe Int
sell_star_count :: Maybe Int
, MessageContent -> Maybe Int
prepaid_upgrade_star_count :: Maybe Int
, MessageContent -> Maybe Bool
is_private :: Maybe Bool
, MessageContent -> Maybe Bool
is_saved :: Maybe Bool
, MessageContent -> Maybe Bool
can_be_upgraded :: Maybe Bool
, MessageContent -> Maybe Bool
was_converted :: Maybe Bool
, MessageContent -> Maybe Bool
was_upgraded :: Maybe Bool
, was_refunded :: Maybe Bool
, MessageContent -> Maybe Int
upgrade_message_id :: Maybe Int
}
| MessageUpgradedGift
{ MessageContent -> Maybe UpgradedGift
_gift :: Maybe UpgradedGift.UpgradedGift
, MessageContent -> Maybe Bool
is_upgrade :: Maybe Bool
, is_saved :: Maybe Bool
, MessageContent -> Maybe Bool
can_be_transferred :: Maybe Bool
, MessageContent -> Maybe Bool
was_transferred :: Maybe Bool
, MessageContent -> Maybe Int
transfer_star_count :: Maybe Int
, MessageContent -> Maybe Int
export_date :: Maybe Int
}
| MessageRefundedUpgradedGift
{ gift :: Maybe Gift.Gift
, is_upgrade :: Maybe Bool
}
| MessageContactRegistered
|
{ MessageContent -> Maybe [SharedUser]
users :: Maybe [SharedUser.SharedUser]
, MessageContent -> Maybe Int
button_id :: Maybe Int
}
| MessageChatShared
{ MessageContent -> Maybe SharedChat
chat :: Maybe SharedChat.SharedChat
, button_id :: Maybe Int
}
| MessageBotWriteAccessAllowed
{ MessageContent -> Maybe BotWriteAccessAllowReason
reason :: Maybe BotWriteAccessAllowReason.BotWriteAccessAllowReason
}
| MessageWebAppDataSent
{ MessageContent -> Maybe Text
button_text :: Maybe T.Text
}
| MessageWebAppDataReceived
{ button_text :: Maybe T.Text
, MessageContent -> Maybe Text
_data :: Maybe T.Text
}
| MessagePassportDataSent
{ MessageContent -> Maybe [PassportElementType]
types :: Maybe [PassportElementType.PassportElementType]
}
| MessagePassportDataReceived
{ MessageContent -> Maybe [EncryptedPassportElement]
elements :: Maybe [EncryptedPassportElement.EncryptedPassportElement]
, MessageContent -> Maybe EncryptedCredentials
credentials :: Maybe EncryptedCredentials.EncryptedCredentials
}
| MessageProximityAlertTriggered
{ MessageContent -> Maybe MessageSender
traveler_id :: Maybe MessageSender.MessageSender
, MessageContent -> Maybe MessageSender
watcher_id :: Maybe MessageSender.MessageSender
, MessageContent -> Maybe Int
distance :: Maybe Int
}
| MessageUnsupported
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_
, subscription_until_date :: MessageContent -> Maybe Int
subscription_until_date = Maybe Int
subscription_until_date_
, 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
"subscription_until_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
subscription_until_date_
, 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_
, subscription_until_date :: MessageContent -> Maybe Int
subscription_until_date = Maybe Int
subscription_until_date_
, 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
"subscription_until_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
subscription_until_date_
, 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_
, prepaid_upgrade_star_count :: MessageContent -> Maybe Int
prepaid_upgrade_star_count = Maybe Int
prepaid_upgrade_star_count_
, is_private :: MessageContent -> Maybe Bool
is_private = Maybe Bool
is_private_
, is_saved :: MessageContent -> Maybe Bool
is_saved = Maybe Bool
is_saved_
, can_be_upgraded :: MessageContent -> Maybe Bool
can_be_upgraded = Maybe Bool
can_be_upgraded_
, was_converted :: MessageContent -> Maybe Bool
was_converted = Maybe Bool
was_converted_
, was_upgraded :: MessageContent -> Maybe Bool
was_upgraded = Maybe Bool
was_upgraded_
, was_refunded :: MessageContent -> Maybe Bool
was_refunded = Maybe Bool
was_refunded_
, upgrade_message_id :: MessageContent -> Maybe Int
upgrade_message_id = Maybe Int
upgrade_message_id_
}
= 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
"prepaid_upgrade_star_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
prepaid_upgrade_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
"can_be_upgraded" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_upgraded_
, String
"was_converted" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
was_converted_
, String
"was_upgraded" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
was_upgraded_
, String
"was_refunded" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
was_refunded_
, String
"upgrade_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
upgrade_message_id_
]
shortShow MessageUpgradedGift
{ _gift :: MessageContent -> Maybe UpgradedGift
_gift = Maybe UpgradedGift
_gift_
, is_upgrade :: MessageContent -> Maybe Bool
is_upgrade = Maybe Bool
is_upgrade_
, is_saved :: MessageContent -> Maybe Bool
is_saved = Maybe Bool
is_saved_
, can_be_transferred :: MessageContent -> Maybe Bool
can_be_transferred = Maybe Bool
can_be_transferred_
, was_transferred :: MessageContent -> Maybe Bool
was_transferred = Maybe Bool
was_transferred_
, transfer_star_count :: MessageContent -> Maybe Int
transfer_star_count = Maybe Int
transfer_star_count_
, export_date :: MessageContent -> Maybe Int
export_date = Maybe Int
export_date_
}
= String
"MessageUpgradedGift"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"_gift" String -> Maybe UpgradedGift -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe UpgradedGift
_gift_
, String
"is_upgrade" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_upgrade_
, String
"is_saved" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_saved_
, String
"can_be_transferred" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
can_be_transferred_
, String
"was_transferred" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
was_transferred_
, String
"transfer_star_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
transfer_star_count_
, String
"export_date" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
export_date_
]
shortShow MessageRefundedUpgradedGift
{ gift :: MessageContent -> Maybe Gift
gift = Maybe Gift
gift_
, is_upgrade :: MessageContent -> Maybe Bool
is_upgrade = Maybe Bool
is_upgrade_
}
= String
"MessageRefundedUpgradedGift"
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
"is_upgrade" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_upgrade_
]
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
"messageUpgradedGift" -> Value -> Parser MessageContent
parseMessageUpgradedGift Value
v
String
"messageRefundedUpgradedGift" -> Value -> Parser MessageContent
parseMessageRefundedUpgradedGift 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 Int
subscription_until_date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"subscription_until_date"
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_
, subscription_until_date :: Maybe Int
subscription_until_date = Maybe Int
subscription_until_date_
, 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 Int
subscription_until_date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"subscription_until_date"
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_
, subscription_until_date :: Maybe Int
subscription_until_date = Maybe Int
subscription_until_date_
, 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 Int
prepaid_upgrade_star_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"prepaid_upgrade_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
can_be_upgraded_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_upgraded"
Maybe Bool
was_converted_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"was_converted"
Maybe Bool
was_upgraded_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"was_upgraded"
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 Int
upgrade_message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"upgrade_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
$ 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_
, prepaid_upgrade_star_count :: Maybe Int
prepaid_upgrade_star_count = Maybe Int
prepaid_upgrade_star_count_
, is_private :: Maybe Bool
is_private = Maybe Bool
is_private_
, is_saved :: Maybe Bool
is_saved = Maybe Bool
is_saved_
, can_be_upgraded :: Maybe Bool
can_be_upgraded = Maybe Bool
can_be_upgraded_
, was_converted :: Maybe Bool
was_converted = Maybe Bool
was_converted_
, was_upgraded :: Maybe Bool
was_upgraded = Maybe Bool
was_upgraded_
, was_refunded :: Maybe Bool
was_refunded = Maybe Bool
was_refunded_
, upgrade_message_id :: Maybe Int
upgrade_message_id = Maybe Int
upgrade_message_id_
}
parseMessageUpgradedGift :: A.Value -> AT.Parser MessageContent
parseMessageUpgradedGift :: Value -> Parser MessageContent
parseMessageUpgradedGift = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageUpgradedGift" ((Object -> Parser MessageContent)
-> Value -> Parser MessageContent)
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe UpgradedGift
_gift_ <- Object
o Object -> Key -> Parser (Maybe UpgradedGift)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"gift"
Maybe Bool
is_upgrade_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_upgrade"
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
can_be_transferred_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"can_be_transferred"
Maybe Bool
was_transferred_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"was_transferred"
Maybe Int
transfer_star_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"transfer_star_count"
Maybe Int
export_date_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"export_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
$ MessageUpgradedGift
{ _gift :: Maybe UpgradedGift
_gift = Maybe UpgradedGift
_gift_
, is_upgrade :: Maybe Bool
is_upgrade = Maybe Bool
is_upgrade_
, is_saved :: Maybe Bool
is_saved = Maybe Bool
is_saved_
, can_be_transferred :: Maybe Bool
can_be_transferred = Maybe Bool
can_be_transferred_
, was_transferred :: Maybe Bool
was_transferred = Maybe Bool
was_transferred_
, transfer_star_count :: Maybe Int
transfer_star_count = Maybe Int
transfer_star_count_
, export_date :: Maybe Int
export_date = Maybe Int
export_date_
}
parseMessageRefundedUpgradedGift :: A.Value -> AT.Parser MessageContent
parseMessageRefundedUpgradedGift :: Value -> Parser MessageContent
parseMessageRefundedUpgradedGift = String
-> (Object -> Parser MessageContent)
-> Value
-> Parser MessageContent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"MessageRefundedUpgradedGift" ((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 Bool
is_upgrade_ <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"is_upgrade"
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
$ MessageRefundedUpgradedGift
{ gift :: Maybe Gift
gift = Maybe Gift
gift_
, is_upgrade :: Maybe Bool
is_upgrade = Maybe Bool
is_upgrade_
}
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