toJson method
Converts a Update to a Map which can be serialized to JSON.
Implementation
Map<String, dynamic> toJson() {
return {
'update_id': updateId,
'message': message?.toJson(),
'edited_message': editedMessage?.toJson(),
'channel_post': channelPost?.toJson(),
'edited_channel_post': editedChannelPost?.toJson(),
'inline_query': inlineQuery?.toJson(),
'chosen_inline_result': chosenInlineResult?.toJson(),
'callback_query': callbackQuery?.toJson(),
'shipping_query': shippingQuery?.toJson(),
'pre_checkout_query': preCheckoutQuery?.toJson(),
'poll': poll?.toJson(),
'poll_answer': pollAnswer?.toJson(),
'my_chat_member': myChatMember?.toJson(),
'chat_member': chatMember?.toJson(),
'chat_join_request': chatJoinRequest?.toJson(),
'message_reaction': messageReaction?.toJson(),
'message_reaction_count': messageReactionCount?.toJson(),
'chat_boost': chatBoost?.toJson(),
'chat_boost_removed': removedChatBoost?.toJson(),
'business_connection': businessConnection?.toJson(),
'business_message': businessMessage?.toJson(),
'edited_business_message': editedBusinessMessage?.toJson(),
'deleted_business_messages': deletedBusinessMessages?.toJson(),
'purchased_paid_media': purchasedPaidMedia?.toJson(),
}..removeWhere(_nullFilter);
}