From 0c5ee455142e14264ca06312e3f491e7f646a5de Mon Sep 17 00:00:00 2001 From: Nikitin Aleksandr Date: Mon, 25 Dec 2023 13:30:55 +0300 Subject: [PATCH] =?UTF-8?q?=D1=81=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20CreateFr?= =?UTF-8?q?omStdTime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- calendar/calendar.go | 8 +- go.mod | 59 +- go.sum | 119 +- vendor/filippo.io/edwards25519/README.md | 2 +- vendor/filippo.io/edwards25519/doc.go | 4 +- .../filippo.io/edwards25519/edwards25519.go | 13 +- vendor/filippo.io/edwards25519/extra.go | 10 +- .../filippo.io/edwards25519/field/fe_amd64.go | 3 + .../filippo.io/edwards25519/field/fe_amd64.s | 1 + .../filippo.io/edwards25519/field/fe_arm64.s | 2 +- .../filippo.io/edwards25519/field/fe_extra.go | 2 +- .../edwards25519/field/fe_generic.go | 4 +- vendor/filippo.io/edwards25519/scalar.go | 949 +--- vendor/filippo.io/edwards25519/scalar_fiat.go | 1147 +++++ vendor/filippo.io/edwards25519/tables.go | 6 +- .../go/v8/internal/embedded/data/VERSION | 2 +- vendor/github.com/go-faster/errors/README.md | 2 +- vendor/github.com/go-faster/errors/join.go | 59 - .../github.com/go-faster/errors/join_go120.go | 14 +- .../golang-module/carbon/v2/README.cn.md | 193 +- .../golang-module/carbon/v2/README.jp.md | 188 +- .../golang-module/carbon/v2/README.md | 199 +- .../golang-module/carbon/v2/carbon.go | 84 +- .../golang-module/carbon/v2/creator.go | 75 +- .../golang-module/carbon/v2/database.go | 6 + .../golang-module/carbon/v2/deprecated.go | 30 - .../golang-module/carbon/v2/difference.go | 46 +- .../golang-module/carbon/v2/helper.go | 10 +- .../golang-module/carbon/v2/json.go | 698 +-- .../golang-module/carbon/v2/outputer.go | 131 +- .../golang-module/carbon/v2/parser.go | 4 +- .../github.com/golang-module/carbon/v2/tag.go | 74 + .../golang-module/carbon/v2/traveler.go | 6 +- vendor/github.com/google/uuid/CHANGELOG.md | 7 + vendor/github.com/google/uuid/time.go | 21 +- vendor/github.com/google/uuid/uuid.go | 53 + vendor/github.com/google/uuid/version6.go | 56 + vendor/github.com/google/uuid/version7.go | 75 + ...count_change_authorization_settings_gen.go | 9 +- .../tl_account_finish_takeout_session_gen.go | 12 +- ..._get_channel_default_emoji_statuses_gen.go | 176 + ...nnel_default_emoji_statuses_slices_gen.go} | 0 ...et_channel_restricted_status_emojis_gen.go | 176 + ...el_restricted_status_emojis_slices_gen.go} | 0 ...count_get_default_background_emojis_gen.go | 17 +- .../tl_account_get_notify_exceptions_gen.go | 4 +- .../tg/tl_account_init_takeout_session_gen.go | 12 +- ...tl_account_invalidate_sign_in_codes_gen.go | 10 +- .../gotd/td/tg/tl_account_update_color_gen.go | 120 +- .../tg/tl_account_update_emoji_status_gen.go | 4 + ...tl_account_update_password_settings_gen.go | 2 +- .../td/tg/tl_account_update_profile_gen.go | 1 - .../td/tg/tl_account_update_status_gen.go | 4 - .../td/tg/tl_app_web_view_result_url_gen.go | 4 +- .../gotd/td/tg/tl_attach_menu_bot_gen.go | 28 +- .../tg/tl_attach_menu_bot_icon_color_gen.go | 2 +- .../gotd/td/tg/tl_attach_menu_bot_icon_gen.go | 7 +- .../gotd/td/tg/tl_attach_menu_bots_bot_gen.go | 4 +- .../gotd/td/tg/tl_attach_menu_bots_gen.go | 6 +- .../td/tg/tl_auth_import_login_token_gen.go | 1 + .../gotd/td/tg/tl_auth_login_token_gen.go | 2 +- .../td/tg/tl_auth_request_firebase_sms_gen.go | 1 - .../gotd/td/tg/tl_authorization_gen.go | 5 +- .../td/tg/tl_auto_download_settings_gen.go | 7 +- vendor/github.com/gotd/td/tg/tl_boost_gen.go | 47 +- .../github.com/gotd/td/tg/tl_bot_app_gen.go | 20 +- .../gotd/td/tg/tl_bot_inline_message_gen.go | 43 +- .../td/tg/tl_bots_allow_send_message_gen.go | 8 +- .../td/tg/tl_bots_can_send_message_gen.go | 8 +- ..._bots_invoke_web_view_custom_method_gen.go | 33 +- .../tl_channel_admin_log_event_action_gen.go | 608 ++- ...annel_admin_log_event_action_slices_gen.go | 254 +- .../tl_channel_admin_log_events_filter_gen.go | 12 +- ...tl_channels_click_sponsored_message_gen.go | 10 +- .../tl_channels_convert_to_gigagroup_gen.go | 1 + .../td/tg/tl_channels_create_channel_gen.go | 13 +- .../tg/tl_channels_create_forum_topic_gen.go | 3 + .../gotd/td/tg/tl_channels_edit_banned_gen.go | 1 + .../td/tg/tl_channels_edit_forum_topic_gen.go | 6 + .../td/tg/tl_channels_edit_location_gen.go | 11 +- ...hannels_get_channel_recommendations_gen.go | 194 + ..._get_channel_recommendations_slices_gen.go | 35 + .../tl_channels_get_forum_topics_by_id_gen.go | 2 +- .../td/tg/tl_channels_get_forum_topics_gen.go | 14 +- .../tg/tl_channels_get_left_channels_gen.go | 10 +- .../td/tg/tl_channels_get_participants_gen.go | 1 + .../td/tg/tl_channels_join_channel_gen.go | 1 - .../td/tg/tl_channels_leave_channel_gen.go | 1 + ...hannels_reorder_pinned_forum_topics_gen.go | 7 +- .../gotd/td/tg/tl_channels_report_spam_gen.go | 1 + .../td/tg/tl_channels_toggle_anti_spam_gen.go | 4 + .../td/tg/tl_channels_toggle_forum_gen.go | 1 + .../tg/tl_channels_toggle_join_to_send_gen.go | 1 + ...channels_toggle_participants_hidden_gen.go | 1 + ..._channels_toggle_pre_history_hidden_gen.go | 1 + ...nnels_toggle_view_forum_as_messages_gen.go | 238 + ...oggle_view_forum_as_messages_slices_gen.go | 35 + .../td/tg/tl_channels_update_color_gen.go | 128 +- .../tg/tl_channels_update_emoji_status_gen.go | 220 + ...channels_update_emoji_status_slices_gen.go | 35 + .../gotd/td/tg/tl_chat_admin_rights_gen.go | 19 +- .../github.com/gotd/td/tg/tl_chat_full_gen.go | 244 +- vendor/github.com/gotd/td/tg/tl_chat_gen.go | 285 +- .../gotd/td/tg/tl_chat_invite_gen.go | 12 +- .../tl_chatlists_check_chatlist_invite_gen.go | 1 + .../tl_chatlists_get_chatlist_updates_gen.go | 3 +- .../tl_chatlists_join_chatlist_invite_gen.go | 2 + .../td/tg/tl_contacts_accept_contact_gen.go | 10 +- .../gotd/td/tg/tl_contacts_add_contact_gen.go | 3 +- .../tg/tl_contacts_block_from_replies_gen.go | 10 +- .../gotd/td/tg/tl_contacts_block_gen.go | 24 +- .../tg/tl_contacts_edit_close_friends_gen.go | 13 +- .../gotd/td/tg/tl_contacts_get_blocked_gen.go | 11 +- .../gotd/td/tg/tl_contacts_get_located_gen.go | 10 +- .../gotd/td/tg/tl_contacts_get_saved_gen.go | 12 +- .../gotd/td/tg/tl_contacts_set_blocked_gen.go | 26 +- .../gotd/td/tg/tl_contacts_unblock_gen.go | 23 +- vendor/github.com/gotd/td/tg/tl_dialog_gen.go | 43 + .../gotd/td/tg/tl_document_attribute_gen.go | 8 +- .../gotd/td/tg/tl_draft_message_gen.go | 8 +- vendor/github.com/gotd/td/tg/tl_errors_gen.go | 272 +- .../td/tg/tl_exported_contact_token_gen.go | 2 +- .../gotd/td/tg/tl_exported_story_link_gen.go | 9 +- .../td/tg/tl_global_privacy_settings_gen.go | 10 +- .../github.com/gotd/td/tg/tl_handlers_gen.go | 50 + .../td/tg/tl_help_get_app_changelog_gen.go | 190 - .../gotd/td/tg/tl_help_get_peer_colors_gen.go | 187 + .../tg/tl_help_get_peer_colors_slices_gen.go | 35 + .../tg/tl_help_get_peer_profile_colors_gen.go | 187 + ...help_get_peer_profile_colors_slices_gen.go | 35 + .../td/tg/tl_help_peer_color_option_gen.go | 379 ++ .../tl_help_peer_color_option_slices_gen.go | 35 + .../gotd/td/tg/tl_help_peer_color_set_gen.go | 506 ++ .../tg/tl_help_peer_color_set_slices_gen.go | 307 ++ .../gotd/td/tg/tl_help_peer_colors_gen.go | 422 ++ .../td/tg/tl_help_peer_colors_slices_gen.go | 267 + .../gotd/td/tg/tl_inline_bot_web_view_gen.go | 5 +- .../gotd/td/tg/tl_input_bot_app_gen.go | 18 +- .../td/tg/tl_input_bot_inline_message_gen.go | 39 +- .../gotd/td/tg/tl_input_file_location_gen.go | 8 +- .../gotd/td/tg/tl_input_invoice_gen.go | 23 +- .../gotd/td/tg/tl_input_media_gen.go | 26 +- .../tg/tl_input_peer_notify_settings_gen.go | 8 +- .../gotd/td/tg/tl_input_privacy_key_gen.go | 1 + .../gotd/td/tg/tl_input_privacy_rule_gen.go | 4 + .../gotd/td/tg/tl_input_reply_to_gen.go | 122 +- .../gotd/td/tg/tl_input_sticker_set_gen.go | 109 + .../tg/tl_input_store_payment_purpose_gen.go | 221 +- .../github.com/gotd/td/tg/tl_invoice_gen.go | 2 +- .../gotd/td/tg/tl_invoke_with_takeout_gen.go | 10 +- .../gotd/td/tg/tl_keyboard_button_gen.go | 59 +- .../td/tg/tl_media_area_coordinates_gen.go | 11 +- .../gotd/td/tg/tl_media_area_gen.go | 464 +- .../gotd/td/tg/tl_media_area_slices_gen.go | 190 + .../gotd/td/tg/tl_message_action_gen.go | 803 ++- .../td/tg/tl_message_action_slices_gen.go | 176 +- .../github.com/gotd/td/tg/tl_message_gen.go | 7 +- .../tg/tl_message_interaction_counters_gen.go | 216 - .../gotd/td/tg/tl_message_media_gen.go | 699 ++- .../gotd/td/tg/tl_message_media_slices_gen.go | 95 + .../gotd/td/tg/tl_message_peer_vote_gen.go | 27 +- .../gotd/td/tg/tl_message_reply_header_gen.go | 126 +- .../gotd/td/tg/tl_messages_bot_app_gen.go | 6 +- .../gotd/td/tg/tl_messages_bot_results_gen.go | 4 +- .../tg/tl_messages_check_chat_invite_gen.go | 1 - .../gotd/td/tg/tl_messages_create_chat_gen.go | 1 + .../tg/tl_messages_discard_encryption_gen.go | 1 + .../tg/tl_messages_discussion_message_gen.go | 3 +- .../td/tg/tl_messages_edit_chat_photo_gen.go | 1 + ...tl_messages_edit_inline_bot_message_gen.go | 3 +- .../td/tg/tl_messages_edit_message_gen.go | 6 +- .../tg/tl_messages_export_chat_invite_gen.go | 1 + .../td/tg/tl_messages_forum_topics_gen.go | 4 +- .../td/tg/tl_messages_forward_messages_gen.go | 5 +- .../tg/tl_messages_get_attach_menu_bot_gen.go | 4 +- .../tl_messages_get_attach_menu_bots_gen.go | 4 +- .../gotd/td/tg/tl_messages_get_bot_app_gen.go | 12 +- ...messages_get_message_reactions_list_gen.go | 2 +- .../td/tg/tl_messages_get_poll_votes_gen.go | 2 +- ...essages_hide_all_chat_join_requests_gen.go | 1 + .../tl_messages_hide_peer_settings_bar_gen.go | 18 +- .../td/tg/tl_messages_migrate_chat_gen.go | 1 + .../td/tg/tl_messages_prolong_web_view_gen.go | 7 +- .../td/tg/tl_messages_read_discussion_gen.go | 1 + .../tl_messages_request_app_web_view_gen.go | 26 +- ...tl_messages_request_simple_web_view_gen.go | 20 +- .../td/tg/tl_messages_request_web_view_gen.go | 18 +- .../gotd/td/tg/tl_messages_save_draft_gen.go | 8 +- ..._messages_search_emoji_sticker_sets_gen.go | 267 + ...es_search_emoji_sticker_sets_slices_gen.go | 35 + .../gotd/td/tg/tl_messages_search_gen.go | 11 +- ...tl_messages_send_bot_requested_peer_gen.go | 80 +- .../tg/tl_messages_send_encrypted_file_gen.go | 1 + .../td/tg/tl_messages_send_encrypted_gen.go | 2 +- .../tl_messages_send_encrypted_service_gen.go | 1 + .../tl_messages_send_inline_bot_result_gen.go | 5 +- .../gotd/td/tg/tl_messages_send_media_gen.go | 10 +- .../td/tg/tl_messages_send_message_gen.go | 10 +- .../td/tg/tl_messages_send_multi_media_gen.go | 7 +- .../td/tg/tl_messages_send_reaction_gen.go | 4 +- ...ssages_send_screenshot_notification_gen.go | 4 +- .../tg/tl_messages_send_web_view_data_gen.go | 4 +- .../tg/tl_messages_set_chat_wall_paper_gen.go | 77 + .../tl_messages_set_inline_bot_results_gen.go | 5 +- .../tg/tl_messages_toggle_no_forwards_gen.go | 1 + .../td/tg/tl_messages_transcribe_audio_gen.go | 1 + .../tg/tl_messages_transcribed_audio_gen.go | 128 +- .../tl_messages_update_dialog_filter_gen.go | 2 +- .../td/tg/tl_messages_upload_media_gen.go | 2 +- .../gotd/td/tg/tl_messages_votes_list_gen.go | 2 +- .../gotd/td/tg/tl_messages_web_page_gen.go | 7 +- .../github.com/gotd/td/tg/tl_my_boost_gen.go | 27 +- .../td/tg/tl_payments_apply_gift_code_gen.go | 14 +- .../td/tg/tl_payments_check_gift_code_gen.go | 14 +- .../tg/tl_payments_checked_gift_code_gen.go | 122 +- .../tg/tl_payments_get_giveaway_info_gen.go | 19 +- .../td/tg/tl_payments_get_payment_form_gen.go | 3 + ...ments_get_premium_gift_code_options_gen.go | 15 +- .../td/tg/tl_payments_giveaway_info_gen.go | 66 +- ...tl_payments_launch_prepaid_giveaway_gen.go | 18 +- .../gotd/td/tg/tl_peer_color_gen.go | 261 + .../gotd/td/tg/tl_peer_color_slices_gen.go | 35 + .../gotd/td/tg/tl_peer_notify_settings_gen.go | 10 +- .../gotd/td/tg/tl_peer_settings_gen.go | 6 +- .../gotd/td/tg/tl_peer_stories_gen.go | 15 +- .../gotd/td/tg/tl_phone_accept_call_gen.go | 1 + .../td/tg/tl_phone_join_group_call_gen.go | 1 + .../td/tg/tl_photos_get_user_photos_gen.go | 8 +- .../tg/tl_photos_update_profile_photo_gen.go | 1 - .../tg/tl_photos_upload_profile_photo_gen.go | 1 + .../td/tg/tl_post_interaction_counters_gen.go | 562 ++ ...tl_post_interaction_counters_slices_gen.go | 307 ++ .../gotd/td/tg/tl_premium_apply_boost_gen.go | 26 +- .../gotd/td/tg/tl_premium_boosts_list_gen.go | 23 +- .../td/tg/tl_premium_boosts_status_gen.go | 46 +- .../td/tg/tl_premium_get_boosts_list_gen.go | 30 +- .../td/tg/tl_premium_get_boosts_status_gen.go | 14 +- .../td/tg/tl_premium_get_my_boosts_gen.go | 12 + .../td/tg/tl_premium_get_user_boosts_gen.go | 219 + .../tl_premium_get_user_boosts_slices_gen.go | 35 + .../td/tg/tl_premium_gift_code_option_gen.go | 33 +- .../gotd/td/tg/tl_premium_my_boosts_gen.go | 11 +- .../gotd/td/tg/tl_prepaid_giveaway_gen.go | 18 +- .../gotd/td/tg/tl_privacy_key_gen.go | 1 + .../gotd/td/tg/tl_privacy_rule_gen.go | 4 + .../gotd/td/tg/tl_public_forward_gen.go | 439 ++ .../td/tg/tl_public_forward_slices_gen.go | 307 ++ .../gotd/td/tg/tl_reaction_count_gen.go | 4 +- .../github.com/gotd/td/tg/tl_registry_gen.go | 243 +- vendor/github.com/gotd/td/tg/tl_server_gen.go | 225 +- .../gotd/td/tg/tl_sponsored_message_gen.go | 171 +- .../gotd/td/tg/tl_sponsored_web_page_gen.go | 12 +- .../td/tg/tl_stats_broadcast_stats_gen.go | 367 +- ...l_stats_get_message_public_forwards_gen.go | 128 +- .../tl_stats_get_story_public_forwards_gen.go | 282 ++ ...ts_get_story_public_forwards_slices_gen.go | 35 + .../td/tg/tl_stats_get_story_stats_gen.go | 275 + .../tg/tl_stats_get_story_stats_slices_gen.go | 35 + .../gotd/td/tg/tl_stats_message_stats_gen.go | 52 +- .../td/tg/tl_stats_public_forwards_gen.go | 388 ++ .../tg/tl_stats_public_forwards_slices_gen.go | 35 + .../gotd/td/tg/tl_stats_story_stats_gen.go | 204 + .../td/tg/tl_stats_story_stats_slices_gen.go | 35 + .../gotd/td/tg/tl_sticker_set_gen.go | 39 +- .../tl_stories_activate_stealth_mode_gen.go | 33 +- .../gotd/td/tg/tl_stories_all_stories_gen.go | 52 +- .../td/tg/tl_stories_can_send_story_gen.go | 14 +- .../td/tg/tl_stories_delete_stories_gen.go | 16 +- .../gotd/td/tg/tl_stories_edit_story_gen.go | 45 +- .../td/tg/tl_stories_export_story_link_gen.go | 17 +- ...l_stories_get_all_read_peer_stories_gen.go | 12 + .../td/tg/tl_stories_get_all_stories_gen.go | 37 +- .../td/tg/tl_stories_get_chats_to_send_gen.go | 8 + .../td/tg/tl_stories_get_peer_max_ids_gen.go | 4 +- .../td/tg/tl_stories_get_peer_stories_gen.go | 17 +- .../tg/tl_stories_get_pinned_stories_gen.go | 25 +- .../tg/tl_stories_get_stories_archive_gen.go | 25 +- .../td/tg/tl_stories_get_stories_by_id_gen.go | 19 +- .../td/tg/tl_stories_get_stories_views_gen.go | 21 +- ...tl_stories_get_story_reactions_list_gen.go | 386 ++ ...ies_get_story_reactions_list_slices_gen.go | 35 + .../tg/tl_stories_get_story_views_list_gen.go | 82 +- .../tl_stories_increment_story_views_gen.go | 11 +- .../gotd/td/tg/tl_stories_peer_stories_gen.go | 10 +- .../gotd/td/tg/tl_stories_read_stories_gen.go | 20 +- .../gotd/td/tg/tl_stories_report_gen.go | 14 +- .../td/tg/tl_stories_send_reaction_gen.go | 24 +- .../gotd/td/tg/tl_stories_send_story_gen.go | 265 +- .../gotd/td/tg/tl_stories_stealth_mode_gen.go | 13 +- .../gotd/td/tg/tl_stories_stories_gen.go | 12 +- .../tg/tl_stories_story_reactions_list_gen.go | 377 ++ ...stories_story_reactions_list_slices_gen.go | 35 + .../gotd/td/tg/tl_stories_story_views_gen.go | 8 +- .../td/tg/tl_stories_story_views_list_gen.go | 181 +- ...l_stories_toggle_all_stories_hidden_gen.go | 6 +- ..._stories_toggle_peer_stories_hidden_gen.go | 18 +- .../td/tg/tl_stories_toggle_pinned_gen.go | 12 +- .../gotd/td/tg/tl_story_fwd_header_gen.go | 343 ++ .../td/tg/tl_story_fwd_header_slices_gen.go | 35 + .../gotd/td/tg/tl_story_item_gen.go | 218 +- .../gotd/td/tg/tl_story_reaction_gen.go | 637 +++ .../td/tg/tl_story_reaction_slices_gen.go | 416 ++ .../gotd/td/tg/tl_story_view_gen.go | 627 ++- .../gotd/td/tg/tl_story_view_slices_gen.go | 381 ++ .../gotd/td/tg/tl_story_views_gen.go | 25 +- vendor/github.com/gotd/td/tg/tl_update_gen.go | 1389 ++++- .../gotd/td/tg/tl_update_slices_gen.go | 503 ++ .../gotd/td/tg/tl_updates_classifier_gen.go | 6 + .../td/tg/tl_updates_get_difference_gen.go | 4 +- .../tg/tl_upload_get_cdn_file_hashes_gen.go | 1 + .../gotd/td/tg/tl_upload_get_file_gen.go | 3 +- .../td/tg/tl_upload_reupload_cdn_file_gen.go | 1 + .../github.com/gotd/td/tg/tl_user_full_gen.go | 55 +- vendor/github.com/gotd/td/tg/tl_user_gen.go | 189 +- .../gotd/td/tg/tl_users_get_full_user_gen.go | 1 - .../gotd/td/tg/tl_wall_paper_settings_gen.go | 78 +- .../gotd/td/tg/tl_web_page_attribute_gen.go | 19 +- .../github.com/gotd/td/tg/tl_web_page_gen.go | 16 +- .../jackc/pgservicefile/.travis.yml | 9 - .../github.com/jackc/pgservicefile/README.md | 5 +- vendor/github.com/jackc/pgx/v5/CHANGELOG.md | 9 + vendor/github.com/jackc/pgx/v5/README.md | 2 +- vendor/github.com/jackc/pgx/v5/batch.go | 2 + vendor/github.com/jackc/pgx/v5/conn.go | 30 +- vendor/github.com/jackc/pgx/v5/copy_from.go | 27 + .../jackc/pgx/v5/extended_query_builder.go | 2 +- .../pgx/v5/internal/sanitize/sanitize.go | 5 + .../github.com/jackc/pgx/v5/pgconn/pgconn.go | 49 + .../github.com/jackc/pgx/v5/pgtype/array.go | 22 +- .../jackc/pgx/v5/pgtype/builtin_wrappers.go | 4 +- vendor/github.com/jackc/pgx/v5/pgtype/date.go | 6 +- vendor/github.com/jackc/pgx/v5/pgtype/json.go | 15 +- .../jackc/pgx/v5/pgtype/multirange.go | 8 +- .../github.com/jackc/pgx/v5/pgtype/numeric.go | 20 + .../github.com/jackc/pgx/v5/pgtype/range.go | 14 +- .../jackc/pgx/v5/pgtype/range_codec.go | 16 +- vendor/github.com/jackc/pgx/v5/stdlib/sql.go | 4 +- .../github.com/klauspost/compress/README.md | 8 + .../klauspost/compress/fse/compress.go | 2 +- .../klauspost/compress/gzip/gunzip.go | 5 + .../klauspost/compress/huff0/bytereader.go | 44 - .../klauspost/compress/huff0/compress.go | 5 +- .../klauspost/compress/huff0/huff0.go | 4 +- .../klauspost/compress/zstd/README.md | 2 +- .../klauspost/compress/zstd/enc_best.go | 44 +- .../klauspost/compress/zstd/enc_better.go | 17 +- vendor/github.com/mattn/go-sqlite3/sqlite3.go | 13 +- vendor/github.com/minio/minio-go/v7/README.md | 120 +- .../minio/minio-go/v7/api-get-object.go | 13 +- .../minio/minio-go/v7/api-get-options.go | 8 +- .../minio/minio-go/v7/api-object-tagging.go | 38 +- .../minio/minio-go/v7/api-put-object.go | 5 + .../minio-go/v7/api-putobject-snowball.go | 17 + vendor/github.com/minio/minio-go/v7/api.go | 2 +- .../v7/pkg/credentials/assume_role.go | 10 +- .../minio-go/v7/pkg/credentials/iam_aws.go | 106 +- .../minio-go/v7/pkg/lifecycle/lifecycle.go | 48 +- .../v7/pkg/notification/notification.go | 9 + .../minio/minio-go/v7/s3-endpoints.go | 1 + vendor/github.com/minio/minio-go/v7/utils.go | 8 + vendor/github.com/pierrec/lz4/v4/writer.go | 4 + .../sashabaranov/go-openai/assistant.go | 6 +- .../github.com/sashabaranov/go-openai/chat.go | 91 +- .../sashabaranov/go-openai/files.go | 51 + .../sashabaranov/go-openai/messages.go | 7 +- .../github.com/sashabaranov/go-openai/run.go | 10 +- .../sashabaranov/go-openai/speech.go | 7 +- .../github.com/segmentio/kafka-go/README.md | 2 +- .../kafka-go/alterpartitionreassignments.go | 41 +- .../github.com/segmentio/kafka-go/balancer.go | 29 +- .../segmentio/kafka-go/createacls.go | 94 + .../kafka-go/listpartitionreassignments.go | 135 + .../alterpartitionreassignments.go | 2 +- .../listpartitionreassignments.go | 70 + .../segmentio/kafka-go/protocol/protocol.go | 31 + .../protocol/rawproduce/rawproduce.go | 91 + .../segmentio/kafka-go/protocol/record.go | 40 + .../segmentio/kafka-go/protocol/request.go | 6 + .../segmentio/kafka-go/protocol/response.go | 6 + .../segmentio/kafka-go/rawproduce.go | 103 + .../github.com/segmentio/kafka-go/resource.go | 86 + .../github.com/valyala/fasthttp/.golangci.yml | 70 + vendor/github.com/valyala/fasthttp/b2s_new.go | 1 - vendor/github.com/valyala/fasthttp/b2s_old.go | 1 - vendor/github.com/valyala/fasthttp/brotli.go | 12 +- .../valyala/fasthttp/bytesconv_32.go | 1 - .../valyala/fasthttp/bytesconv_64.go | 1 - vendor/github.com/valyala/fasthttp/client.go | 13 +- .../fasthttp/{coarseTime.go => coarsetime.go} | 0 .../github.com/valyala/fasthttp/compress.go | 34 +- .../valyala/fasthttp/examples/README.md | 4 + .../valyala/fasthttp/examples/client/Makefile | 6 + .../fasthttp/examples/client/README.md | 21 + .../fasthttp/examples/client/client.go | 132 + .../fasthttp/examples/fileserver/Makefile | 7 + .../fasthttp/examples/fileserver/README.md | 84 + .../examples/fileserver/fileserver.go | 120 + .../fileserver/ssl-cert-snakeoil.key} | 0 .../fileserver/ssl-cert-snakeoil.pem} | 0 .../examples/helloworldserver/Makefile | 6 + .../examples/helloworldserver/README.md | 17 + .../helloworldserver/helloworldserver.go | 55 + .../fasthttp/examples/host_client/Makefile | 6 + .../fasthttp/examples/host_client/README.md | 13 + .../examples/host_client/hostclient.go | 35 + .../examples/letsencrypt/letsencryptserver.go | 41 + .../fasthttp/examples/multidomain/Makefile | 6 + .../fasthttp/examples/multidomain/README.md | 15 + .../examples/multidomain/multidomain.go | 63 + .../fasthttputil/inmemory_listener_test.go | 273 + .../inmemory_listener_timing_test.go | 155 + .../fasthttp/fasthttputil/pipeconns_test.go | 407 ++ vendor/github.com/valyala/fasthttp/fs.go | 497 +- vendor/github.com/valyala/fasthttp/header.go | 1 + vendor/github.com/valyala/fasthttp/http.go | 7 + .../valyala/fasthttp/reuseport/reuseport.go | 1 - .../github.com/valyala/fasthttp/round2_32.go | 1 - .../github.com/valyala/fasthttp/round2_64.go | 1 - vendor/github.com/valyala/fasthttp/s2b_new.go | 1 - vendor/github.com/valyala/fasthttp/s2b_old.go | 1 - vendor/github.com/valyala/fasthttp/server.go | 4 +- .../valyala/fasthttp/stackless/writer.go | 13 +- vendor/github.com/valyala/fasthttp/tcp.go | 1 - .../valyala/fasthttp/tcp_windows.go | 3 - .../valyala/fasthttp/testdata/test.png | 1 + .../github.com/valyala/fasthttp/uri_unix.go | 1 - .../valyala/fasthttp/uri_windows.go | 3 - .../internal/v0/app/constants/constants.go | 54 - .../calc_struct_version.go | 0 .../pkg/db/constants/constants.go | 20 + .../table_connections/table_connections.go | 16 + .../entities/connections/connections.go | 18 +- .../entities/connections/connections_crud.go | 24 +- vendor/go.mau.fi/whatsmeow/appstate.go | 35 + vendor/go.mau.fi/whatsmeow/appstate/encode.go | 90 + vendor/go.mau.fi/whatsmeow/appstate/keys.go | 27 +- .../whatsmeow/binary/proto/def.pb.go | 4511 ++++++++++------- .../whatsmeow/binary/proto/def.pb.raw | Bin 86128 -> 88041 bytes .../whatsmeow/binary/proto/def.proto | 81 +- .../go.mau.fi/whatsmeow/binary/token/token.go | 12 +- vendor/go.mau.fi/whatsmeow/call.go | 18 + vendor/go.mau.fi/whatsmeow/client.go | 7 + vendor/go.mau.fi/whatsmeow/download.go | 4 +- vendor/go.mau.fi/whatsmeow/group.go | 147 +- vendor/go.mau.fi/whatsmeow/internals.go | 18 + vendor/go.mau.fi/whatsmeow/message.go | 10 +- vendor/go.mau.fi/whatsmeow/newsletter.go | 20 + vendor/go.mau.fi/whatsmeow/privacysettings.go | 84 +- vendor/go.mau.fi/whatsmeow/receipt.go | 30 +- vendor/go.mau.fi/whatsmeow/request.go | 4 +- vendor/go.mau.fi/whatsmeow/send.go | 46 +- .../whatsmeow/store/clientpayload.go | 2 +- .../whatsmeow/store/sqlstore/container.go | 8 + .../whatsmeow/store/sqlstore/upgrade.go | 19 +- .../whatsmeow/types/events/appstate.go | 30 + .../go.mau.fi/whatsmeow/types/events/call.go | 14 + .../whatsmeow/types/events/events.go | 47 +- vendor/go.mau.fi/whatsmeow/types/presence.go | 50 + vendor/go.mau.fi/whatsmeow/types/user.go | 36 +- vendor/go.mau.fi/whatsmeow/upload.go | 75 +- .../golang.org/x/crypto/argon2/blamka_amd64.s | 12 +- .../x/crypto/blake2b/blake2bAVX2_amd64.go | 2 +- .../x/crypto/blake2b/blake2bAVX2_amd64.s | 2 +- .../x/crypto/blake2b/blake2b_amd64.go | 24 - .../golang.org/x/crypto/blake2b/register.go | 2 - vendor/golang.org/x/sys/unix/fcntl.go | 2 +- vendor/golang.org/x/sys/unix/ioctl_linux.go | 5 + vendor/golang.org/x/sys/unix/mkerrors.sh | 3 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 2 +- vendor/golang.org/x/sys/unix/syscall_linux.go | 26 +- .../golang.org/x/sys/unix/syscall_openbsd.go | 14 + .../golang.org/x/sys/unix/syscall_solaris.go | 2 +- .../x/sys/unix/syscall_zos_s390x.go | 2 +- vendor/golang.org/x/sys/unix/zerrors_linux.go | 2 +- .../golang.org/x/sys/unix/zsyscall_linux.go | 15 + .../x/sys/unix/zsyscall_openbsd_386.go | 26 + .../x/sys/unix/zsyscall_openbsd_386.s | 5 + .../x/sys/unix/zsyscall_openbsd_amd64.go | 26 + .../x/sys/unix/zsyscall_openbsd_amd64.s | 5 + .../x/sys/unix/zsyscall_openbsd_arm.go | 26 + .../x/sys/unix/zsyscall_openbsd_arm.s | 5 + .../x/sys/unix/zsyscall_openbsd_arm64.go | 26 + .../x/sys/unix/zsyscall_openbsd_arm64.s | 5 + .../x/sys/unix/zsyscall_openbsd_mips64.go | 26 + .../x/sys/unix/zsyscall_openbsd_mips64.s | 5 + .../x/sys/unix/zsyscall_openbsd_ppc64.go | 26 + .../x/sys/unix/zsyscall_openbsd_ppc64.s | 6 + .../x/sys/unix/zsyscall_openbsd_riscv64.go | 26 + .../x/sys/unix/zsyscall_openbsd_riscv64.s | 5 + vendor/golang.org/x/sys/unix/ztypes_linux.go | 32 + .../x/sys/windows/syscall_windows.go | 2 + .../x/sys/windows/zsyscall_windows.go | 19 + ...r_conn_wrappers.go => balancer_wrapper.go} | 304 +- vendor/google.golang.org/grpc/clientconn.go | 500 +- vendor/google.golang.org/grpc/codes/codes.go | 8 +- .../google.golang.org/grpc/credentials/tls.go | 75 +- vendor/google.golang.org/grpc/dialoptions.go | 48 +- .../grpc/internal/buffer/unbounded.go | 41 +- .../grpc/internal/channelz/funcs.go | 7 + .../grpc/internal/envconfig/envconfig.go | 3 - .../grpc/internal/envconfig/xds.go | 39 - .../grpc/internal/experimental.go | 28 + .../internal/grpcsync/callback_serializer.go | 51 +- .../grpc/internal/idle/idle.go | 177 +- .../grpc/internal/internal.go | 9 +- .../internal/resolver/dns/dns_resolver.go | 69 +- .../resolver/dns/internal/internal.go | 70 + .../grpc/internal/tcp_keepalive_nonunix.go | 29 + .../grpc/internal/tcp_keepalive_unix.go | 54 + .../grpc/internal/transport/handler_server.go | 67 +- .../grpc/internal/transport/http2_client.go | 12 +- .../grpc/internal/transport/http2_server.go | 107 +- .../grpc/internal/transport/proxy.go | 14 +- .../grpc/internal/transport/transport.go | 22 +- .../grpc/metadata/metadata.go | 18 +- vendor/google.golang.org/grpc/peer/peer.go | 2 + .../google.golang.org/grpc/picker_wrapper.go | 21 +- vendor/google.golang.org/grpc/pickfirst.go | 14 - .../grpc/resolver/dns/dns_resolver.go | 36 + vendor/google.golang.org/grpc/resolver/map.go | 113 + .../grpc/resolver/resolver.go | 10 +- .../grpc/resolver_conn_wrapper.go | 247 - .../grpc/resolver_wrapper.go | 197 + vendor/google.golang.org/grpc/server.go | 235 +- vendor/google.golang.org/grpc/version.go | 2 +- vendor/google.golang.org/grpc/vet.sh | 166 +- .../protobuf/encoding/protojson/decode.go | 38 +- .../protobuf/encoding/protojson/doc.go | 2 +- .../protobuf/encoding/protojson/encode.go | 39 +- .../encoding/protojson/well_known_types.go | 55 +- .../protobuf/encoding/prototext/decode.go | 8 +- .../protobuf/encoding/prototext/encode.go | 4 +- .../protobuf/encoding/protowire/wire.go | 28 +- .../protobuf/internal/descfmt/stringer.go | 183 +- .../protobuf/internal/filedesc/desc.go | 47 +- .../protobuf/internal/genid/descriptor_gen.go | 212 +- .../protobuf/internal/impl/codec_gen.go | 113 +- .../protobuf/internal/impl/legacy_message.go | 19 +- .../protobuf/internal/impl/message.go | 17 +- .../protobuf/internal/impl/pointer_reflect.go | 36 + .../protobuf/internal/impl/pointer_unsafe.go | 40 + ...ings_unsafe.go => strings_unsafe_go120.go} | 4 +- .../internal/strs/strings_unsafe_go121.go | 74 + .../protobuf/internal/version/version.go | 2 +- .../protobuf/proto/decode.go | 2 +- .../google.golang.org/protobuf/proto/doc.go | 58 +- .../protobuf/proto/encode.go | 2 +- .../protobuf/proto/extension.go | 2 +- .../google.golang.org/protobuf/proto/merge.go | 2 +- .../google.golang.org/protobuf/proto/proto.go | 18 +- .../protobuf/reflect/protodesc/desc.go | 29 +- .../protobuf/reflect/protodesc/desc_init.go | 24 + .../protobuf/reflect/protodesc/editions.go | 177 + .../reflect/protodesc/editions_defaults.binpb | 4 + .../protobuf/reflect/protodesc/proto.go | 18 +- .../protobuf/reflect/protoreflect/proto.go | 83 +- .../reflect/protoreflect/source_gen.go | 62 +- .../protobuf/reflect/protoreflect/type.go | 44 +- .../protobuf/reflect/protoreflect/value.go | 24 +- .../reflect/protoreflect/value_equal.go | 8 +- .../reflect/protoreflect/value_union.go | 44 +- ...{value_unsafe.go => value_unsafe_go120.go} | 4 +- .../protoreflect/value_unsafe_go121.go | 87 + .../reflect/protoregistry/registry.go | 24 +- .../types/descriptorpb/descriptor.pb.go | 2439 ++++++--- .../protobuf/types/known/anypb/any.pb.go | 3 +- vendor/modules.txt | 77 +- 567 files changed, 33952 insertions(+), 9761 deletions(-) create mode 100644 vendor/filippo.io/edwards25519/scalar_fiat.go delete mode 100644 vendor/github.com/go-faster/errors/join.go delete mode 100644 vendor/github.com/golang-module/carbon/v2/deprecated.go create mode 100644 vendor/github.com/golang-module/carbon/v2/tag.go create mode 100644 vendor/github.com/google/uuid/version6.go create mode 100644 vendor/github.com/google/uuid/version7.go create mode 100644 vendor/github.com/gotd/td/tg/tl_account_get_channel_default_emoji_statuses_gen.go rename vendor/github.com/gotd/td/tg/{tl_help_get_app_changelog_slices_gen.go => tl_account_get_channel_default_emoji_statuses_slices_gen.go} (100%) create mode 100644 vendor/github.com/gotd/td/tg/tl_account_get_channel_restricted_status_emojis_gen.go rename vendor/github.com/gotd/td/tg/{tl_message_interaction_counters_slices_gen.go => tl_account_get_channel_restricted_status_emojis_slices_gen.go} (100%) create mode 100644 vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_slices_gen.go delete mode 100644 vendor/github.com/gotd/td/tg/tl_help_get_app_changelog_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_peer_color_option_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_peer_color_option_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_peer_color_set_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_peer_color_set_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_peer_colors_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_help_peer_colors_slices_gen.go delete mode 100644 vendor/github.com/gotd/td/tg/tl_message_interaction_counters_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_peer_color_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_peer_color_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_post_interaction_counters_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_post_interaction_counters_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_public_forward_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_public_forward_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_public_forwards_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_public_forwards_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_story_stats_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stats_story_stats_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_story_fwd_header_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_story_fwd_header_slices_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_story_reaction_gen.go create mode 100644 vendor/github.com/gotd/td/tg/tl_story_reaction_slices_gen.go delete mode 100644 vendor/github.com/jackc/pgservicefile/.travis.yml delete mode 100644 vendor/github.com/klauspost/compress/huff0/bytereader.go create mode 100644 vendor/github.com/segmentio/kafka-go/listpartitionreassignments.go create mode 100644 vendor/github.com/segmentio/kafka-go/protocol/listpartitionreassignments/listpartitionreassignments.go create mode 100644 vendor/github.com/segmentio/kafka-go/protocol/rawproduce/rawproduce.go create mode 100644 vendor/github.com/segmentio/kafka-go/rawproduce.go create mode 100644 vendor/github.com/valyala/fasthttp/.golangci.yml rename vendor/github.com/valyala/fasthttp/{coarseTime.go => coarsetime.go} (100%) create mode 100644 vendor/github.com/valyala/fasthttp/examples/README.md create mode 100644 vendor/github.com/valyala/fasthttp/examples/client/Makefile create mode 100644 vendor/github.com/valyala/fasthttp/examples/client/README.md create mode 100644 vendor/github.com/valyala/fasthttp/examples/client/client.go create mode 100644 vendor/github.com/valyala/fasthttp/examples/fileserver/Makefile create mode 100644 vendor/github.com/valyala/fasthttp/examples/fileserver/README.md create mode 100644 vendor/github.com/valyala/fasthttp/examples/fileserver/fileserver.go rename vendor/github.com/valyala/fasthttp/{fasthttputil/rsa.key => examples/fileserver/ssl-cert-snakeoil.key} (100%) rename vendor/github.com/valyala/fasthttp/{fasthttputil/rsa.pem => examples/fileserver/ssl-cert-snakeoil.pem} (100%) create mode 100644 vendor/github.com/valyala/fasthttp/examples/helloworldserver/Makefile create mode 100644 vendor/github.com/valyala/fasthttp/examples/helloworldserver/README.md create mode 100644 vendor/github.com/valyala/fasthttp/examples/helloworldserver/helloworldserver.go create mode 100644 vendor/github.com/valyala/fasthttp/examples/host_client/Makefile create mode 100644 vendor/github.com/valyala/fasthttp/examples/host_client/README.md create mode 100644 vendor/github.com/valyala/fasthttp/examples/host_client/hostclient.go create mode 100644 vendor/github.com/valyala/fasthttp/examples/letsencrypt/letsencryptserver.go create mode 100644 vendor/github.com/valyala/fasthttp/examples/multidomain/Makefile create mode 100644 vendor/github.com/valyala/fasthttp/examples/multidomain/README.md create mode 100644 vendor/github.com/valyala/fasthttp/examples/multidomain/multidomain.go create mode 100644 vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_test.go create mode 100644 vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_timing_test.go create mode 100644 vendor/github.com/valyala/fasthttp/fasthttputil/pipeconns_test.go create mode 100644 vendor/github.com/valyala/fasthttp/testdata/test.png delete mode 100644 vendor/gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres/internal/v0/app/constants/constants.go rename vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/{functions => db}/calc_struct_version/calc_struct_version.go (100%) create mode 100644 vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants/constants.go create mode 100644 vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/tables/table_connections/table_connections.go delete mode 100644 vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go rename vendor/google.golang.org/grpc/{balancer_conn_wrappers.go => balancer_wrapper.go} (57%) create mode 100644 vendor/google.golang.org/grpc/internal/experimental.go create mode 100644 vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go create mode 100644 vendor/google.golang.org/grpc/internal/tcp_keepalive_nonunix.go create mode 100644 vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go create mode 100644 vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go delete mode 100644 vendor/google.golang.org/grpc/resolver_conn_wrapper.go create mode 100644 vendor/google.golang.org/grpc/resolver_wrapper.go rename vendor/google.golang.org/protobuf/internal/strs/{strings_unsafe.go => strings_unsafe_go120.go} (96%) create mode 100644 vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go create mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/editions.go create mode 100644 vendor/google.golang.org/protobuf/reflect/protodesc/editions_defaults.binpb rename vendor/google.golang.org/protobuf/reflect/protoreflect/{value_unsafe.go => value_unsafe_go120.go} (97%) create mode 100644 vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go diff --git a/calendar/calendar.go b/calendar/calendar.go index 04069de1..5c997705 100644 --- a/calendar/calendar.go +++ b/calendar/calendar.go @@ -11,16 +11,16 @@ func FindPreviousWorkDay(DateNow time.Time) time.Time { var Otvet time.Time //DateNow := time.Now() - Otvet = carbon.Time2Carbon(DateNow).StartOfDay().Carbon2Time() + Otvet = carbon.CreateFromStdTime(DateNow).StartOfDay().ToStdTime() Weekday := int(DateNow.Weekday()) switch Weekday { case 0: //воскресенье - Otvet = carbon.Time2Carbon(Otvet).AddDays(-2).Carbon2Time() + Otvet = carbon.CreateFromStdTime(Otvet).AddDays(-2).ToStdTime() case 1: //понедельник - Otvet = carbon.Time2Carbon(Otvet).AddDays(-3).Carbon2Time() + Otvet = carbon.CreateFromStdTime(Otvet).AddDays(-3).ToStdTime() default: - Otvet = carbon.Time2Carbon(Otvet).AddDays(-1).Carbon2Time() + Otvet = carbon.CreateFromStdTime(Otvet).AddDays(-1).ToStdTime() } return Otvet diff --git a/go.mod b/go.mod index ba8413c4..f00dfefe 100644 --- a/go.mod +++ b/go.mod @@ -4,40 +4,39 @@ go 1.20 require ( github.com/ManyakRus/logrus v0.0.0-20231019115155-9e6fede0d792 - github.com/camunda/zeebe/clients/go/v8 v8.3.2 + github.com/camunda/zeebe/clients/go/v8 v8.3.4 github.com/denisenkom/go-mssqldb v0.12.3 github.com/emersion/go-imap v1.2.1 github.com/emersion/go-message v0.17.0 - github.com/go-faster/errors v0.7.0 + github.com/go-faster/errors v0.7.1 github.com/gofiber/fiber/v2 v2.51.0 - github.com/golang-module/carbon/v2 v2.2.13 + github.com/golang-module/carbon/v2 v2.3.0 github.com/gotd/contrib v0.19.0 - github.com/gotd/td v0.89.0 + github.com/gotd/td v0.92.0 github.com/jackc/pgx/v4 v4.18.1 github.com/jmoiron/sqlx v1.3.5 github.com/joho/godotenv v1.5.1 - github.com/klauspost/compress v1.17.2 + github.com/klauspost/compress v1.17.4 github.com/lib/pq v1.10.9 - github.com/mattn/go-sqlite3 v1.14.18 + github.com/mattn/go-sqlite3 v1.14.19 github.com/mdp/qrterminal/v3 v3.2.0 - github.com/minio/minio-go/v7 v7.0.63 + github.com/minio/minio-go/v7 v7.0.66 github.com/nats-io/nats.go v1.31.0 - github.com/sashabaranov/go-openai v1.17.6 - github.com/segmentio/kafka-go v0.4.44 + github.com/sashabaranov/go-openai v1.17.9 + github.com/segmentio/kafka-go v0.4.47 github.com/xhit/go-simple-mail/v2 v2.16.0 gitlab.aescorp.ru/dsp_dev/claim/common/sync_exchange v0.0.16 - gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres v1.0.15 - gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.24 - go.mau.fi/whatsmeow v0.0.0-20231112141858-68b25b3f6fe9 - golang.org/x/crypto v0.15.0 - golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa + gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.35 + go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735 + golang.org/x/crypto v0.17.0 + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 gorm.io/driver/postgres v1.5.4 gorm.io/driver/sqlserver v1.5.2 gorm.io/gorm v1.25.5 ) require ( - filippo.io/edwards25519 v1.0.0 // indirect + filippo.io/edwards25519 v1.1.0 // indirect github.com/andybalholm/brotli v1.0.6 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect @@ -54,7 +53,7 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/go-cmp v0.6.0 // indirect - github.com/google/uuid v1.4.0 // indirect + github.com/google/uuid v1.5.0 // indirect github.com/gorilla/websocket v1.5.1 // indirect github.com/gotd/ige v0.2.2 // indirect github.com/gotd/neo v0.1.5 // indirect @@ -63,9 +62,9 @@ require ( github.com/jackc/pgio v1.0.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgproto3/v2 v2.3.2 // indirect - github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 // indirect github.com/jackc/pgtype v1.14.0 // indirect - github.com/jackc/pgx/v5 v5.5.0 // indirect + github.com/jackc/pgx/v5 v5.5.1 // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.5 // indirect @@ -82,7 +81,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/nats-io/nkeys v0.4.6 // indirect github.com/nats-io/nuid v1.0.1 // indirect - github.com/pierrec/lz4/v4 v4.1.18 // indirect + github.com/pierrec/lz4/v4 v4.1.19 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.4 // indirect github.com/rs/xid v1.5.0 // indirect @@ -92,27 +91,27 @@ require ( github.com/syndtr/goleveldb v1.0.0 // indirect github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.50.0 // indirect + github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect go.mau.fi/libsignal v0.1.0 // indirect - go.mau.fi/util v0.2.0 // indirect - go.opentelemetry.io/otel v1.20.0 // indirect - go.opentelemetry.io/otel/trace v1.20.0 // indirect + go.mau.fi/util v0.2.1 // indirect + go.opentelemetry.io/otel v1.21.0 // indirect + go.opentelemetry.io/otel/trace v1.21.0 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/net v0.18.0 // indirect - golang.org/x/oauth2 v0.14.0 // indirect + golang.org/x/net v0.19.0 // indirect + golang.org/x/oauth2 v0.15.0 // indirect golang.org/x/sync v0.5.0 // indirect - golang.org/x/sys v0.14.0 // indirect - golang.org/x/term v0.14.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect - google.golang.org/grpc v1.59.0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect + google.golang.org/grpc v1.60.1 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 25ea22b9..bb67bfb6 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= -filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= +filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA= +filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.19.0/go.mod h1:h6H6c8enJmmocHUbLiiGY6sx7f9i+X3m1CHdd5c6Rdw= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= @@ -30,8 +30,8 @@ github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so= github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw= -github.com/camunda/zeebe/clients/go/v8 v8.3.2 h1:ywjMXlLIpSVnBBx0ycX+EnhLXCmX6Hpidbf7IblUPMg= -github.com/camunda/zeebe/clients/go/v8 v8.3.2/go.mod h1:IlOdQHcF9MgRWWdiuuZGQ+IB5hw54LAveMJYmrlRKSw= +github.com/camunda/zeebe/clients/go/v8 v8.3.4 h1:GXfr55VIdls7l3qANdZ9aSi1DV2PX6951zlp/x/5/9Q= +github.com/camunda/zeebe/clients/go/v8 v8.3.4/go.mod h1:IlOdQHcF9MgRWWdiuuZGQ+IB5hw54LAveMJYmrlRKSw= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I= @@ -59,8 +59,8 @@ github.com/emersion/go-sasl v0.0.0-20231106173351-e73c9f7bad43/go.mod h1:iL2twTe github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY= github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= -github.com/go-faster/errors v0.7.0 h1:UnD/xusnfUgtEYkgRZohqL2AfmPTwv13NAJwwFFaNYc= -github.com/go-faster/errors v0.7.0/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo= +github.com/go-faster/errors v0.7.1 h1:MkJTnDoEdi9pDabt1dpWf7AA8/BaSYZqibYyhZ20AYg= +github.com/go-faster/errors v0.7.1/go.mod h1:5ySTjWFiphBs07IKuiL69nxdfd5+fzh1u7FPGZP2quo= github.com/go-faster/jx v1.1.0 h1:ZsW3wD+snOdmTDy9eIVgQdjUpXRRV4rqW8NS3t+20bg= github.com/go-faster/jx v1.1.0/go.mod h1:vKDNikrKoyUmpzaJ0OkIkRQClNHFX/nF3dnTJZb3skg= github.com/go-faster/xor v0.3.0/go.mod h1:x5CaDY9UKErKzqfRfFZdfu+OSTfoZny3w5Ak7UxcipQ= @@ -83,8 +83,8 @@ github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE= github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang-module/carbon/v2 v2.2.13 h1:8BzSrasTFP4sIXA78i4I4LxxlIxetwGOUGu/+WfjdVg= -github.com/golang-module/carbon/v2 v2.2.13/go.mod h1:XDALX7KgqmHk95xyLeaqX9/LJGbfLATyruTziq68SZ8= +github.com/golang-module/carbon/v2 v2.3.0 h1:Nn2H1Hc1iR5LHP9AywC5nIE9Smb3hEaLN0wgHY947Kc= +github.com/golang-module/carbon/v2 v2.3.0/go.mod h1:XDALX7KgqmHk95xyLeaqX9/LJGbfLATyruTziq68SZ8= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 h1:au07oEsX2xN0ktxqI+Sida1w446QrXBRJ0nee3SNZlA= github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= @@ -105,8 +105,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= -github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/zI+bUmuGM= github.com/gorilla/websocket v1.5.1 h1:gmztn0JnHVt9JZquRuzLw3g4wouNVzKL15iLr/zn/QY= @@ -117,8 +117,8 @@ github.com/gotd/ige v0.2.2 h1:XQ9dJZwBfDnOGSTxKXBGP4gMud3Qku2ekScRjDWWfEk= github.com/gotd/ige v0.2.2/go.mod h1:tuCRb+Y5Y3eNTo3ypIfNpQ4MFjrnONiL2jN2AKZXmb0= github.com/gotd/neo v0.1.5 h1:oj0iQfMbGClP8xI59x7fE/uHoTJD7NZH9oV1WNuPukQ= github.com/gotd/neo v0.1.5/go.mod h1:9A2a4bn9zL6FADufBdt7tZt+WMhvZoc5gWXihOPoiBQ= -github.com/gotd/td v0.89.0 h1:qRWbTmPYk5y/u4gNAj9qIkLJlQgdMGr4HzW2ix1Q2hA= -github.com/gotd/td v0.89.0/go.mod h1:NgvwaHPW8rAHPGjaKSKzwSe+N2cUWTmfaDs8P6HPp/U= +github.com/gotd/td v0.92.0 h1:yGkIWFnIjfiPHPKEdCwFAiBCkLvjaLj+AjqamX4PEEY= +github.com/gotd/td v0.92.0/go.mod h1:NB76GPqUujl9KxjoSL8YP4bN67IIHLrNmfN6rvRKsSE= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= @@ -154,8 +154,9 @@ github.com/jackc/pgproto3/v2 v2.1.1/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwX github.com/jackc/pgproto3/v2 v2.3.2 h1:7eY55bdBeCz1F2fTzSz69QC+pG46jYq9/jtSPiJ5nn0= github.com/jackc/pgproto3/v2 v2.3.2/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b/go.mod h1:vsD4gTJCa9TptPL8sPkXrLZ+hDuNrZCnj29CQpr4X1E= -github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk= github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 h1:L0QtFUgDarD7Fpv9jeVMgy/+Ec0mtnmYuImjTz6dtDA= +github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM= github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01CGwFsrv11mJRHWJ6aifDLfdV3aVjFF0zg= github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc= github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw= @@ -168,8 +169,8 @@ github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQ github.com/jackc/pgx/v4 v4.12.1-0.20210724153913-640aa07df17c/go.mod h1:1QD0+tgSXP7iUjYm9C1NxKhny7lq6ee99u/z+IHFcgs= github.com/jackc/pgx/v4 v4.18.1 h1:YP7G1KABtKpB5IHrO9vYwSrCOhs7p3uqhvhhQBptya0= github.com/jackc/pgx/v4 v4.18.1/go.mod h1:FydWkUyadDmdNH/mHnGob881GawxeEm7TcMCzkb+qQE= -github.com/jackc/pgx/v5 v5.5.0 h1:NxstgwndsTRy7eq9/kqYc/BZh5w2hHJV86wjvO+1xPw= -github.com/jackc/pgx/v5 v5.5.0/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= +github.com/jackc/pgx/v5 v5.5.1 h1:5I9etrGkLrN+2XPCsi6XLlV5DITbSL/xBZdmAxFcXPI= +github.com/jackc/pgx/v5 v5.5.1/go.mod h1:Ig06C2Vu0t5qXC60W8sqIthScaEnFvojjj9dSljmHRA= github.com/jackc/puddle v0.0.0-20190413234325-e4ced69a3a2b/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v0.0.0-20190608224051-11cab39313c9/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= github.com/jackc/puddle v1.1.3/go.mod h1:m4B5Dj62Y0fbyuIc15OsIqK0+JU8nkqQjsgx7dvjSWk= @@ -194,8 +195,8 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.15.9/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.1/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc= github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -228,16 +229,16 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.6/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= -github.com/mattn/go-sqlite3 v1.14.18 h1:JL0eqdCOq6DJVNPSvArO/bIV9/P7fbGrV00LZHc+5aI= -github.com/mattn/go-sqlite3 v1.14.18/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= +github.com/mattn/go-sqlite3 v1.14.19 h1:fhGleo2h1p8tVChob4I9HpmVFIAkKGpiukdrgQbWfGI= +github.com/mattn/go-sqlite3 v1.14.19/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg= github.com/mdp/qrterminal/v3 v3.2.0 h1:qteQMXO3oyTK4IHwj2mWsKYYRBOp1Pj2WRYFYYNTCdk= github.com/mdp/qrterminal/v3 v3.2.0/go.mod h1:XGGuua4Lefrl7TLEsSONiD+UEjQXJZ4mPzF+gWYIJkk= github.com/microsoft/go-mssqldb v1.6.0 h1:mM3gYdVwEPFrlg/Dvr2DNVEgYFG7L42l+dGc67NNNpc= github.com/microsoft/go-mssqldb v1.6.0/go.mod h1:00mDtPbeQCRGC1HwOOR5K/gr30P1NcEG0vx6Kbv2aJU= github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34= github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM= -github.com/minio/minio-go/v7 v7.0.63 h1:GbZ2oCvaUdgT5640WJOpyDhhDxvknAJU2/T3yurwcbQ= -github.com/minio/minio-go/v7 v7.0.63/go.mod h1:Q6X7Qjb7WMhvG65qKf4gUgA5XaiSox74kR1uAEjxRS4= +github.com/minio/minio-go/v7 v7.0.66 h1:bnTOXOHjOqv/gcMuiVbN9o2ngRItvqE774dG9nq0Dzw= +github.com/minio/minio-go/v7 v7.0.66/go.mod h1:DHAgmyQEGdW3Cif0UooKOyrT3Vxs82zNdV6tkKhRtbs= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= @@ -261,8 +262,8 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/gomega v1.4.3 h1:RE1xgDvH7imwFD45h+u2SgIfERHlS2yNG4DObb5BSKU= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/pierrec/lz4/v4 v4.1.15/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= -github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ= -github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= +github.com/pierrec/lz4/v4 v4.1.19 h1:tYLzDnjDXh9qIxSTKHwXwOYmm9d887Y7Y1ZkyXYHAN4= +github.com/pierrec/lz4/v4 v4.1.19/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4= github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= @@ -274,19 +275,19 @@ github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJ github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.5.0 h1:mKX4bl4iPYJtEIxp6CYiUuLQ/8DYMoz0PUdtGgMFRVc= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU= github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc= -github.com/sashabaranov/go-openai v1.17.6 h1:hYXRPM1xO6QLOJhWEOMlSg/l3jERiKDKd1qIoK22lvs= -github.com/sashabaranov/go-openai v1.17.6/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= +github.com/sashabaranov/go-openai v1.17.9 h1:QEoBiGKWW68W79YIfXWEFZ7l5cEgZBV4/Ow3uy+5hNY= +github.com/sashabaranov/go-openai v1.17.9/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys= github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs= -github.com/segmentio/kafka-go v0.4.44 h1:Vjjksniy0WSTZ7CuVJrz1k04UoZeTc77UV6Yyk6tLY4= -github.com/segmentio/kafka-go v0.4.44/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= +github.com/segmentio/kafka-go v0.4.47 h1:IqziR4pA3vrZq7YdRxaT3w1/5fvIH5qpCwstUanQQB0= +github.com/segmentio/kafka-go v0.4.47/go.mod h1:HjF6XbOKh0Pjlkr5GVZxt6CsjjwnmhVOfURM5KMd8qg= github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4= github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= @@ -316,8 +317,8 @@ github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208 h1:PM5hJF7HVfNWmCjM github.com/toorop/go-dkim v0.0.0-20201103131630-e1cd1a0a5208/go.mod h1:BzWtXXrXzZUvMacR0oF/fbDDgUPO8L36tDMmRAf14ns= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.50.0 h1:H7fweIlBm0rXLs2q0XbalvJ6r0CUPFWK3/bB4N13e9M= -github.com/valyala/fasthttp v1.50.0/go.mod h1:k2zXd82h/7UZc3VOdJ2WaUqt1uZ/XpXAfE9i+HBC3lA= +github.com/valyala/fasthttp v1.51.0 h1:8b30A5JlZ6C7AS81RsWjYMQmrZG6feChmgAolCl1SqA= +github.com/valyala/fasthttp v1.51.0/go.mod h1:oI2XroL+lI7vdXyYoQk03bXBThfFl2cVdIA3Xl7cH8g= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= @@ -336,20 +337,18 @@ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5t github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= gitlab.aescorp.ru/dsp_dev/claim/common/sync_exchange v0.0.16 h1:H/zpsfNrgNQAo6G7Z4d4k64ovJ7S06AcglJ2GmTWMgU= gitlab.aescorp.ru/dsp_dev/claim/common/sync_exchange v0.0.16/go.mod h1:Jf0XXz40E/xniAd8nVAwSmhewULJWQ2aDKLN+tDIJkg= -gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres v1.0.15 h1:hZnJoNnFUjGhc0rC+QORLhSolmDEFBuls2RvqYnpkXY= -gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres v1.0.15/go.mod h1:IU0qXYfYHfSBNjJm6Z5QxnfLTZluLv7Q6nmKT2lWRQI= -gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.24 h1:sUIyfhb7Yq3hVeqFu0ti1zVhk5NDuGgoIbYXFecBhFU= -gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.24/go.mod h1:WDjha5KBoluGomO6iq41ZDiEaEFj1KPHtOSf9+usk/s= +gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.35 h1:/Gya1dnaXEM1CC1n8iyFEK5CyMxAYkeBtYG7b+/RX20= +gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.35/go.mod h1:tG+9dM01x6Vy/GH13JOe3T/e0fjVX/9NLqFhjb20tSU= go.mau.fi/libsignal v0.1.0 h1:vAKI/nJ5tMhdzke4cTK1fb0idJzz1JuEIpmjprueC+c= go.mau.fi/libsignal v0.1.0/go.mod h1:R8ovrTezxtUNzCQE5PH30StOQWWeBskBsWE55vMfY9I= -go.mau.fi/util v0.2.0 h1:AMGBEdg9Ya/smb/09dljo9wBwKr432EpfjDWF7aFQg0= -go.mau.fi/util v0.2.0/go.mod h1:AxuJUMCxpzgJ5eV9JbPWKRH8aAJJidxetNdUj7qcb84= -go.mau.fi/whatsmeow v0.0.0-20231112141858-68b25b3f6fe9 h1:KKiSWzaGPCaf9L0cmpuAkJB2ELccBVol2yHzSW5JE6I= -go.mau.fi/whatsmeow v0.0.0-20231112141858-68b25b3f6fe9/go.mod h1:u557d2vph8xcLrk3CKTBknUHoB6icUpqazA4w+binRU= -go.opentelemetry.io/otel v1.20.0 h1:vsb/ggIY+hUjD/zCAQHpzTmndPqv/ml2ArbsbfBYTAc= -go.opentelemetry.io/otel v1.20.0/go.mod h1:oUIGj3D77RwJdM6PPZImDpSZGDvkD9fhesHny69JFrs= -go.opentelemetry.io/otel/trace v1.20.0 h1:+yxVAPZPbQhbC3OfAkeIVTky6iTFpcr4SiY9om7mXSQ= -go.opentelemetry.io/otel/trace v1.20.0/go.mod h1:HJSK7F/hA5RlzpZ0zKDCHCDHm556LCDtKaAo6JmBFUU= +go.mau.fi/util v0.2.1 h1:eazulhFE/UmjOFtPrGg6zkF5YfAyiDzQb8ihLMbsPWw= +go.mau.fi/util v0.2.1/go.mod h1:MjlzCQEMzJ+G8RsPawHzpLB8rwTo3aPIjG5FzBvQT/c= +go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735 h1:+teJYCOK6M4Kn2TYCj29levhHVwnJTmgCtEXLtgwQtM= +go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735/go.mod h1:5xTtHNaZpGni6z6aE1iEopjW7wNgsKcolZxZrOujK9M= +go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc= +go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo= +go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= +go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ= @@ -385,10 +384,10 @@ golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ= -golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= @@ -411,10 +410,10 @@ golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg= -golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ= -golang.org/x/oauth2 v0.14.0 h1:P0Vrf/2538nmC0H+pEQ3MNFRRnVR7RlqyVw+bvm26z0= -golang.org/x/oauth2 v0.14.0/go.mod h1:lAtNWgaWfL4cm7j2OV8TxGi9Qb7ECORx8DktCY74OwM= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/oauth2 v0.15.0 h1:s8pnnxNVzjWyrvYdFUQq5llS1PX2zhPXmccZv99h7uQ= +golang.org/x/oauth2 v0.15.0/go.mod h1:q48ptWNTY5XWf+JNten23lcvHpLJ0ZSxF5ttTHKVCAM= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -447,8 +446,8 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q= -golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -457,8 +456,8 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8= -golang.org/x/term v0.14.0/go.mod h1:TySc+nGkYR6qt8km8wUhuFRTVSMIX3XPR58y2lC8vww= +golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4= +golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -492,14 +491,14 @@ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA= -google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk= -google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= +google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/vendor/filippo.io/edwards25519/README.md b/vendor/filippo.io/edwards25519/README.md index 2606f40b..24e2457d 100644 --- a/vendor/filippo.io/edwards25519/README.md +++ b/vendor/filippo.io/edwards25519/README.md @@ -9,6 +9,6 @@ Read the docs at [pkg.go.dev/filippo.io/edwards25519](https://pkg.go.dev/filippo The code is originally derived from Adam Langley's internal implementation in the Go standard library, and includes George Tankersley's [performance improvements](https://golang.org/cl/71950). It was then further developed by Henry de Valence for use in ristretto255, and was finally [merged back into the Go standard library](https://golang.org/cl/276272) as of Go 1.17. It now tracks the upstream codebase and extends it with additional functionality. -Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative. +Most users don't need this package, and should instead use `crypto/ed25519` for signatures, `golang.org/x/crypto/curve25519` for Diffie-Hellman, or `github.com/gtank/ristretto255` for prime order group logic. However, for anyone currently using a fork of `crypto/internal/edwards25519`/`crypto/ed25519/internal/edwards25519` or `github.com/agl/edwards25519`, this package should be a safer, faster, and more powerful alternative. Since this package is meant to curb proliferation of edwards25519 implementations in the Go ecosystem, it welcomes requests for new APIs or reviewable performance improvements. diff --git a/vendor/filippo.io/edwards25519/doc.go b/vendor/filippo.io/edwards25519/doc.go index d8608b06..ab6aaebc 100644 --- a/vendor/filippo.io/edwards25519/doc.go +++ b/vendor/filippo.io/edwards25519/doc.go @@ -4,7 +4,7 @@ // Package edwards25519 implements group logic for the twisted Edwards curve // -// -x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2 +// -x^2 + y^2 = 1 + -(121665/121666)*x^2*y^2 // // This is better known as the Edwards curve equivalent to Curve25519, and is // the curve used by the Ed25519 signature scheme. @@ -15,6 +15,6 @@ // // However, developers who do need to interact with low-level edwards25519 // operations can use this package, which is an extended version of -// crypto/ed25519/internal/edwards25519 from the standard library repackaged as +// crypto/internal/edwards25519 from the standard library repackaged as // an importable module. package edwards25519 diff --git a/vendor/filippo.io/edwards25519/edwards25519.go b/vendor/filippo.io/edwards25519/edwards25519.go index e22a7c2d..a744da2c 100644 --- a/vendor/filippo.io/edwards25519/edwards25519.go +++ b/vendor/filippo.io/edwards25519/edwards25519.go @@ -27,13 +27,13 @@ type projP2 struct { // // The zero value is NOT valid, and it may be used only as a receiver. type Point struct { - // The point is internally represented in extended coordinates (X, Y, Z, T) - // where x = X/Z, y = Y/Z, and xy = T/Z per https://eprint.iacr.org/2008/522. - x, y, z, t field.Element - // Make the type not comparable (i.e. used with == or as a map key), as // equivalent points can be represented by different Go values. _ incomparable + + // The point is internally represented in extended coordinates (X, Y, Z, T) + // where x = X/Z, y = Y/Z, and xy = T/Z per https://eprint.iacr.org/2008/522. + x, y, z, t field.Element } type incomparable [0]func() @@ -148,9 +148,8 @@ func (v *Point) SetBytes(x []byte) (*Point, error) { // (*field.Element).SetBytes docs) and // 2) the ones where the x-coordinate is zero and the sign bit is set. // - // This is consistent with crypto/ed25519/internal/edwards25519. Read more - // at https://hdevalence.ca/blog/2020-10-04-its-25519am, specifically the - // "Canonical A, R" section. + // Read more at https://hdevalence.ca/blog/2020-10-04-its-25519am, + // specifically the "Canonical A, R" section. y, err := new(field.Element).SetBytes(x) if err != nil { diff --git a/vendor/filippo.io/edwards25519/extra.go b/vendor/filippo.io/edwards25519/extra.go index f5e59080..d152d68f 100644 --- a/vendor/filippo.io/edwards25519/extra.go +++ b/vendor/filippo.io/edwards25519/extra.go @@ -5,7 +5,7 @@ package edwards25519 // This file contains additional functionality that is not included in the -// upstream crypto/ed25519/internal/edwards25519 package. +// upstream crypto/internal/edwards25519 package. import ( "errors" @@ -79,6 +79,12 @@ func isOnCurve(X, Y, Z, T *field.Element) bool { // Note that BytesMontgomery only encodes the u-coordinate, so v and -v encode // to the same value. If v is the identity point, BytesMontgomery returns 32 // zero bytes, analogously to the X25519 function. +// +// The lack of an inverse operation (such as SetMontgomeryBytes) is deliberate: +// while every valid edwards25519 point has a unique u-coordinate Montgomery +// encoding, X25519 accepts inputs on the quadratic twist, which don't correspond +// to any edwards25519 point, and every other X25519 input corresponds to two +// edwards25519 points. func (v *Point) BytesMontgomery() []byte { // This function is outlined to make the allocations inline in the caller // rather than happen on the heap. @@ -137,7 +143,7 @@ func (s *Scalar) Invert(t *Scalar) *Scalar { for i := 0; i < 7; i++ { table[i+1].Multiply(&table[i], &tt) } - // Now table = [t**1, t**3, t**7, t**11, t**13, t**15] + // Now table = [t**1, t**3, t**5, t**7, t**9, t**11, t**13, t**15] // so t**k = t[k/2] for odd k // To compute the sliding window digits, use the following Sage script: diff --git a/vendor/filippo.io/edwards25519/field/fe_amd64.go b/vendor/filippo.io/edwards25519/field/fe_amd64.go index 44dc8e8c..edcf163c 100644 --- a/vendor/filippo.io/edwards25519/field/fe_amd64.go +++ b/vendor/filippo.io/edwards25519/field/fe_amd64.go @@ -1,13 +1,16 @@ // Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. +//go:build amd64 && gc && !purego // +build amd64,gc,!purego package field // feMul sets out = a * b. It works like feMulGeneric. +// //go:noescape func feMul(out *Element, a *Element, b *Element) // feSquare sets out = a * a. It works like feSquareGeneric. +// //go:noescape func feSquare(out *Element, a *Element) diff --git a/vendor/filippo.io/edwards25519/field/fe_amd64.s b/vendor/filippo.io/edwards25519/field/fe_amd64.s index 0aa1e86d..293f013c 100644 --- a/vendor/filippo.io/edwards25519/field/fe_amd64.s +++ b/vendor/filippo.io/edwards25519/field/fe_amd64.s @@ -1,5 +1,6 @@ // Code generated by command: go run fe_amd64_asm.go -out ../fe_amd64.s -stubs ../fe_amd64.go -pkg field. DO NOT EDIT. +//go:build amd64 && gc && !purego // +build amd64,gc,!purego #include "textflag.h" diff --git a/vendor/filippo.io/edwards25519/field/fe_arm64.s b/vendor/filippo.io/edwards25519/field/fe_arm64.s index 751ab2ad..3126a434 100644 --- a/vendor/filippo.io/edwards25519/field/fe_arm64.s +++ b/vendor/filippo.io/edwards25519/field/fe_arm64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build arm64,gc,!purego +//go:build arm64 && gc && !purego #include "textflag.h" diff --git a/vendor/filippo.io/edwards25519/field/fe_extra.go b/vendor/filippo.io/edwards25519/field/fe_extra.go index 699238e9..1ef503b9 100644 --- a/vendor/filippo.io/edwards25519/field/fe_extra.go +++ b/vendor/filippo.io/edwards25519/field/fe_extra.go @@ -7,7 +7,7 @@ package field import "errors" // This file contains additional functionality that is not included in the -// upstream crypto/ed25519/internal/edwards25519/field package. +// upstream crypto/ed25519/edwards25519/field package. // SetWideBytes sets v to x, where x is a 64-byte little-endian encoding, which // is reduced modulo the field order. If x is not of the right length, diff --git a/vendor/filippo.io/edwards25519/field/fe_generic.go b/vendor/filippo.io/edwards25519/field/fe_generic.go index d6667b27..86f5fd95 100644 --- a/vendor/filippo.io/edwards25519/field/fe_generic.go +++ b/vendor/filippo.io/edwards25519/field/fe_generic.go @@ -156,7 +156,7 @@ func feMulGeneric(v, a, b *Element) { rr4 := r4.lo&maskLow51Bits + c3 // Now all coefficients fit into 64-bit registers but are still too large to - // be passed around as a Element. We therefore do one last carry chain, + // be passed around as an Element. We therefore do one last carry chain, // where the carries will be small enough to fit in the wiggle room above 2⁵¹. *v = Element{rr0, rr1, rr2, rr3, rr4} v.carryPropagate() @@ -245,7 +245,7 @@ func feSquareGeneric(v, a *Element) { v.carryPropagate() } -// carryPropagate brings the limbs below 52 bits by applying the reduction +// carryPropagateGeneric brings the limbs below 52 bits by applying the reduction // identity (a * 2²⁵⁵ + b = a * 19 + b) to the l4 carry. func (v *Element) carryPropagateGeneric() *Element { c0 := v.l0 >> 51 diff --git a/vendor/filippo.io/edwards25519/scalar.go b/vendor/filippo.io/edwards25519/scalar.go index 3df2fb93..3fd16538 100644 --- a/vendor/filippo.io/edwards25519/scalar.go +++ b/vendor/filippo.io/edwards25519/scalar.go @@ -5,14 +5,13 @@ package edwards25519 import ( - "crypto/subtle" "encoding/binary" "errors" ) // A Scalar is an integer modulo // -// l = 2^252 + 27742317777372353535851937790883648493 +// l = 2^252 + 27742317777372353535851937790883648493 // // which is the prime order of the edwards25519 group. // @@ -21,55 +20,77 @@ import ( // // The zero value is a valid zero element. type Scalar struct { - // s is the Scalar value in little-endian. The value is always reduced - // modulo l between operations. - s [32]byte + // s is the scalar in the Montgomery domain, in the format of the + // fiat-crypto implementation. + s fiatScalarMontgomeryDomainFieldElement } -var ( - scZero = Scalar{[32]byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} - - scOne = Scalar{[32]byte{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}} - - scMinusOne = Scalar{[32]byte{236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}} -) +// The field implementation in scalar_fiat.go is generated by the fiat-crypto +// project (https://github.com/mit-plv/fiat-crypto) at version v0.0.9 (23d2dbc) +// from a formally verified model. +// +// fiat-crypto code comes under the following license. +// +// Copyright (c) 2015-2020 The fiat-crypto Authors. All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// THIS SOFTWARE IS PROVIDED BY the fiat-crypto authors "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Berkeley Software Design, +// Inc. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// // NewScalar returns a new zero Scalar. func NewScalar() *Scalar { return &Scalar{} } -// MultiplyAdd sets s = x * y + z mod l, and returns s. +// MultiplyAdd sets s = x * y + z mod l, and returns s. It is equivalent to +// using Multiply and then Add. func (s *Scalar) MultiplyAdd(x, y, z *Scalar) *Scalar { - scMulAdd(&s.s, &x.s, &y.s, &z.s) - return s + // Make a copy of z in case it aliases s. + zCopy := new(Scalar).Set(z) + return s.Multiply(x, y).Add(s, zCopy) } // Add sets s = x + y mod l, and returns s. func (s *Scalar) Add(x, y *Scalar) *Scalar { // s = 1 * x + y mod l - scMulAdd(&s.s, &scOne.s, &x.s, &y.s) + fiatScalarAdd(&s.s, &x.s, &y.s) return s } // Subtract sets s = x - y mod l, and returns s. func (s *Scalar) Subtract(x, y *Scalar) *Scalar { // s = -1 * y + x mod l - scMulAdd(&s.s, &scMinusOne.s, &y.s, &x.s) + fiatScalarSub(&s.s, &x.s, &y.s) return s } // Negate sets s = -x mod l, and returns s. func (s *Scalar) Negate(x *Scalar) *Scalar { // s = -1 * x + 0 mod l - scMulAdd(&s.s, &scMinusOne.s, &x.s, &scZero.s) + fiatScalarOpp(&s.s, &x.s) return s } // Multiply sets s = x * y mod l, and returns s. func (s *Scalar) Multiply(x, y *Scalar) *Scalar { // s = x * y + 0 mod l - scMulAdd(&s.s, &x.s, &y.s, &scZero.s) + fiatScalarMul(&s.s, &x.s, &y.s) return s } @@ -83,18 +104,54 @@ func (s *Scalar) Set(x *Scalar) *Scalar { // If x is not of the right length, SetUniformBytes returns nil and an error, // and the receiver is unchanged. // -// SetUniformBytes can be used to set s to an uniformly distributed value given +// SetUniformBytes can be used to set s to a uniformly distributed value given // 64 uniformly distributed random bytes. func (s *Scalar) SetUniformBytes(x []byte) (*Scalar, error) { if len(x) != 64 { return nil, errors.New("edwards25519: invalid SetUniformBytes input length") } - var wideBytes [64]byte - copy(wideBytes[:], x[:]) - scReduce(&s.s, &wideBytes) + + // We have a value x of 512 bits, but our fiatScalarFromBytes function + // expects an input lower than l, which is a little over 252 bits. + // + // Instead of writing a reduction function that operates on wider inputs, we + // can interpret x as the sum of three shorter values a, b, and c. + // + // x = a + b * 2^168 + c * 2^336 mod l + // + // We then precompute 2^168 and 2^336 modulo l, and perform the reduction + // with two multiplications and two additions. + + s.setShortBytes(x[:21]) + t := new(Scalar).setShortBytes(x[21:42]) + s.Add(s, t.Multiply(t, scalarTwo168)) + t.setShortBytes(x[42:]) + s.Add(s, t.Multiply(t, scalarTwo336)) + return s, nil } +// scalarTwo168 and scalarTwo336 are 2^168 and 2^336 modulo l, encoded as a +// fiatScalarMontgomeryDomainFieldElement, which is a little-endian 4-limb value +// in the 2^256 Montgomery domain. +var scalarTwo168 = &Scalar{s: [4]uint64{0x5b8ab432eac74798, 0x38afddd6de59d5d7, + 0xa2c131b399411b7c, 0x6329a7ed9ce5a30}} +var scalarTwo336 = &Scalar{s: [4]uint64{0xbd3d108e2b35ecc5, 0x5c3a3718bdf9c90b, + 0x63aa97a331b4f2ee, 0x3d217f5be65cb5c}} + +// setShortBytes sets s = x mod l, where x is a little-endian integer shorter +// than 32 bytes. +func (s *Scalar) setShortBytes(x []byte) *Scalar { + if len(x) >= 32 { + panic("edwards25519: internal error: setShortBytes called with a long string") + } + var buf [32]byte + copy(buf[:], x) + fiatScalarFromBytes((*[4]uint64)(&s.s), &buf) + fiatScalarToMontgomery(&s.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&s.s)) + return s +} + // SetCanonicalBytes sets s = x, where x is a 32-byte little-endian encoding of // s, and returns s. If x is not a canonical encoding of s, SetCanonicalBytes // returns nil and an error, and the receiver is unchanged. @@ -102,22 +159,31 @@ func (s *Scalar) SetCanonicalBytes(x []byte) (*Scalar, error) { if len(x) != 32 { return nil, errors.New("invalid scalar length") } - ss := &Scalar{} - copy(ss.s[:], x) - if !isReduced(ss) { + if !isReduced(x) { return nil, errors.New("invalid scalar encoding") } - s.s = ss.s + + fiatScalarFromBytes((*[4]uint64)(&s.s), (*[32]byte)(x)) + fiatScalarToMontgomery(&s.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&s.s)) + return s, nil } -// isReduced returns whether the given scalar is reduced modulo l. -func isReduced(s *Scalar) bool { - for i := len(s.s) - 1; i >= 0; i-- { +// scalarMinusOneBytes is l - 1 in little endian. +var scalarMinusOneBytes = [32]byte{236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16} + +// isReduced returns whether the given scalar in 32-byte little endian encoded +// form is reduced modulo l. +func isReduced(s []byte) bool { + if len(s) != 32 { + return false + } + + for i := len(s) - 1; i >= 0; i-- { switch { - case s.s[i] > scMinusOne.s[i]: + case s[i] > scalarMinusOneBytes[i]: return false - case s.s[i] < scMinusOne.s[i]: + case s[i] < scalarMinusOneBytes[i]: return true } } @@ -143,800 +209,45 @@ func (s *Scalar) SetBytesWithClamping(x []byte) (*Scalar, error) { if len(x) != 32 { return nil, errors.New("edwards25519: invalid SetBytesWithClamping input length") } + + // We need to use the wide reduction from SetUniformBytes, since clamping + // sets the 2^254 bit, making the value higher than the order. var wideBytes [64]byte copy(wideBytes[:], x[:]) wideBytes[0] &= 248 wideBytes[31] &= 63 wideBytes[31] |= 64 - scReduce(&s.s, &wideBytes) - return s, nil + return s.SetUniformBytes(wideBytes[:]) } // Bytes returns the canonical 32-byte little-endian encoding of s. func (s *Scalar) Bytes() []byte { - buf := make([]byte, 32) - copy(buf, s.s[:]) - return buf + // This function is outlined to make the allocations inline in the caller + // rather than happen on the heap. + var encoded [32]byte + return s.bytes(&encoded) +} + +func (s *Scalar) bytes(out *[32]byte) []byte { + var ss fiatScalarNonMontgomeryDomainFieldElement + fiatScalarFromMontgomery(&ss, &s.s) + fiatScalarToBytes(out, (*[4]uint64)(&ss)) + return out[:] } // Equal returns 1 if s and t are equal, and 0 otherwise. func (s *Scalar) Equal(t *Scalar) int { - return subtle.ConstantTimeCompare(s.s[:], t.s[:]) -} - -// scMulAdd and scReduce are ported from the public domain, “ref10” -// implementation of ed25519 from SUPERCOP. - -func load3(in []byte) int64 { - r := int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - return r -} - -func load4(in []byte) int64 { - r := int64(in[0]) - r |= int64(in[1]) << 8 - r |= int64(in[2]) << 16 - r |= int64(in[3]) << 24 - return r -} - -// Input: -// a[0]+256*a[1]+...+256^31*a[31] = a -// b[0]+256*b[1]+...+256^31*b[31] = b -// c[0]+256*c[1]+...+256^31*c[31] = c -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = (ab+c) mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func scMulAdd(s, a, b, c *[32]byte) { - a0 := 2097151 & load3(a[:]) - a1 := 2097151 & (load4(a[2:]) >> 5) - a2 := 2097151 & (load3(a[5:]) >> 2) - a3 := 2097151 & (load4(a[7:]) >> 7) - a4 := 2097151 & (load4(a[10:]) >> 4) - a5 := 2097151 & (load3(a[13:]) >> 1) - a6 := 2097151 & (load4(a[15:]) >> 6) - a7 := 2097151 & (load3(a[18:]) >> 3) - a8 := 2097151 & load3(a[21:]) - a9 := 2097151 & (load4(a[23:]) >> 5) - a10 := 2097151 & (load3(a[26:]) >> 2) - a11 := (load4(a[28:]) >> 7) - b0 := 2097151 & load3(b[:]) - b1 := 2097151 & (load4(b[2:]) >> 5) - b2 := 2097151 & (load3(b[5:]) >> 2) - b3 := 2097151 & (load4(b[7:]) >> 7) - b4 := 2097151 & (load4(b[10:]) >> 4) - b5 := 2097151 & (load3(b[13:]) >> 1) - b6 := 2097151 & (load4(b[15:]) >> 6) - b7 := 2097151 & (load3(b[18:]) >> 3) - b8 := 2097151 & load3(b[21:]) - b9 := 2097151 & (load4(b[23:]) >> 5) - b10 := 2097151 & (load3(b[26:]) >> 2) - b11 := (load4(b[28:]) >> 7) - c0 := 2097151 & load3(c[:]) - c1 := 2097151 & (load4(c[2:]) >> 5) - c2 := 2097151 & (load3(c[5:]) >> 2) - c3 := 2097151 & (load4(c[7:]) >> 7) - c4 := 2097151 & (load4(c[10:]) >> 4) - c5 := 2097151 & (load3(c[13:]) >> 1) - c6 := 2097151 & (load4(c[15:]) >> 6) - c7 := 2097151 & (load3(c[18:]) >> 3) - c8 := 2097151 & load3(c[21:]) - c9 := 2097151 & (load4(c[23:]) >> 5) - c10 := 2097151 & (load3(c[26:]) >> 2) - c11 := (load4(c[28:]) >> 7) - var carry [23]int64 - - s0 := c0 + a0*b0 - s1 := c1 + a0*b1 + a1*b0 - s2 := c2 + a0*b2 + a1*b1 + a2*b0 - s3 := c3 + a0*b3 + a1*b2 + a2*b1 + a3*b0 - s4 := c4 + a0*b4 + a1*b3 + a2*b2 + a3*b1 + a4*b0 - s5 := c5 + a0*b5 + a1*b4 + a2*b3 + a3*b2 + a4*b1 + a5*b0 - s6 := c6 + a0*b6 + a1*b5 + a2*b4 + a3*b3 + a4*b2 + a5*b1 + a6*b0 - s7 := c7 + a0*b7 + a1*b6 + a2*b5 + a3*b4 + a4*b3 + a5*b2 + a6*b1 + a7*b0 - s8 := c8 + a0*b8 + a1*b7 + a2*b6 + a3*b5 + a4*b4 + a5*b3 + a6*b2 + a7*b1 + a8*b0 - s9 := c9 + a0*b9 + a1*b8 + a2*b7 + a3*b6 + a4*b5 + a5*b4 + a6*b3 + a7*b2 + a8*b1 + a9*b0 - s10 := c10 + a0*b10 + a1*b9 + a2*b8 + a3*b7 + a4*b6 + a5*b5 + a6*b4 + a7*b3 + a8*b2 + a9*b1 + a10*b0 - s11 := c11 + a0*b11 + a1*b10 + a2*b9 + a3*b8 + a4*b7 + a5*b6 + a6*b5 + a7*b4 + a8*b3 + a9*b2 + a10*b1 + a11*b0 - s12 := a1*b11 + a2*b10 + a3*b9 + a4*b8 + a5*b7 + a6*b6 + a7*b5 + a8*b4 + a9*b3 + a10*b2 + a11*b1 - s13 := a2*b11 + a3*b10 + a4*b9 + a5*b8 + a6*b7 + a7*b6 + a8*b5 + a9*b4 + a10*b3 + a11*b2 - s14 := a3*b11 + a4*b10 + a5*b9 + a6*b8 + a7*b7 + a8*b6 + a9*b5 + a10*b4 + a11*b3 - s15 := a4*b11 + a5*b10 + a6*b9 + a7*b8 + a8*b7 + a9*b6 + a10*b5 + a11*b4 - s16 := a5*b11 + a6*b10 + a7*b9 + a8*b8 + a9*b7 + a10*b6 + a11*b5 - s17 := a6*b11 + a7*b10 + a8*b9 + a9*b8 + a10*b7 + a11*b6 - s18 := a7*b11 + a8*b10 + a9*b9 + a10*b8 + a11*b7 - s19 := a8*b11 + a9*b10 + a10*b9 + a11*b8 - s20 := a9*b11 + a10*b10 + a11*b9 - s21 := a10*b11 + a11*b10 - s22 := a11 * b11 - s23 := int64(0) - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - carry[18] = (s18 + (1 << 20)) >> 21 - s19 += carry[18] - s18 -= carry[18] << 21 - carry[20] = (s20 + (1 << 20)) >> 21 - s21 += carry[20] - s20 -= carry[20] << 21 - carry[22] = (s22 + (1 << 20)) >> 21 - s23 += carry[22] - s22 -= carry[22] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - carry[17] = (s17 + (1 << 20)) >> 21 - s18 += carry[17] - s17 -= carry[17] << 21 - carry[19] = (s19 + (1 << 20)) >> 21 - s20 += carry[19] - s19 -= carry[19] << 21 - carry[21] = (s21 + (1 << 20)) >> 21 - s22 += carry[21] - s21 -= carry[21] << 21 - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - s[0] = byte(s0 >> 0) - s[1] = byte(s0 >> 8) - s[2] = byte((s0 >> 16) | (s1 << 5)) - s[3] = byte(s1 >> 3) - s[4] = byte(s1 >> 11) - s[5] = byte((s1 >> 19) | (s2 << 2)) - s[6] = byte(s2 >> 6) - s[7] = byte((s2 >> 14) | (s3 << 7)) - s[8] = byte(s3 >> 1) - s[9] = byte(s3 >> 9) - s[10] = byte((s3 >> 17) | (s4 << 4)) - s[11] = byte(s4 >> 4) - s[12] = byte(s4 >> 12) - s[13] = byte((s4 >> 20) | (s5 << 1)) - s[14] = byte(s5 >> 7) - s[15] = byte((s5 >> 15) | (s6 << 6)) - s[16] = byte(s6 >> 2) - s[17] = byte(s6 >> 10) - s[18] = byte((s6 >> 18) | (s7 << 3)) - s[19] = byte(s7 >> 5) - s[20] = byte(s7 >> 13) - s[21] = byte(s8 >> 0) - s[22] = byte(s8 >> 8) - s[23] = byte((s8 >> 16) | (s9 << 5)) - s[24] = byte(s9 >> 3) - s[25] = byte(s9 >> 11) - s[26] = byte((s9 >> 19) | (s10 << 2)) - s[27] = byte(s10 >> 6) - s[28] = byte((s10 >> 14) | (s11 << 7)) - s[29] = byte(s11 >> 1) - s[30] = byte(s11 >> 9) - s[31] = byte(s11 >> 17) -} - -// Input: -// s[0]+256*s[1]+...+256^63*s[63] = s -// -// Output: -// s[0]+256*s[1]+...+256^31*s[31] = s mod l -// where l = 2^252 + 27742317777372353535851937790883648493. -func scReduce(out *[32]byte, s *[64]byte) { - s0 := 2097151 & load3(s[:]) - s1 := 2097151 & (load4(s[2:]) >> 5) - s2 := 2097151 & (load3(s[5:]) >> 2) - s3 := 2097151 & (load4(s[7:]) >> 7) - s4 := 2097151 & (load4(s[10:]) >> 4) - s5 := 2097151 & (load3(s[13:]) >> 1) - s6 := 2097151 & (load4(s[15:]) >> 6) - s7 := 2097151 & (load3(s[18:]) >> 3) - s8 := 2097151 & load3(s[21:]) - s9 := 2097151 & (load4(s[23:]) >> 5) - s10 := 2097151 & (load3(s[26:]) >> 2) - s11 := 2097151 & (load4(s[28:]) >> 7) - s12 := 2097151 & (load4(s[31:]) >> 4) - s13 := 2097151 & (load3(s[34:]) >> 1) - s14 := 2097151 & (load4(s[36:]) >> 6) - s15 := 2097151 & (load3(s[39:]) >> 3) - s16 := 2097151 & load3(s[42:]) - s17 := 2097151 & (load4(s[44:]) >> 5) - s18 := 2097151 & (load3(s[47:]) >> 2) - s19 := 2097151 & (load4(s[49:]) >> 7) - s20 := 2097151 & (load4(s[52:]) >> 4) - s21 := 2097151 & (load3(s[55:]) >> 1) - s22 := 2097151 & (load4(s[57:]) >> 6) - s23 := (load4(s[60:]) >> 3) - - s11 += s23 * 666643 - s12 += s23 * 470296 - s13 += s23 * 654183 - s14 -= s23 * 997805 - s15 += s23 * 136657 - s16 -= s23 * 683901 - s23 = 0 - - s10 += s22 * 666643 - s11 += s22 * 470296 - s12 += s22 * 654183 - s13 -= s22 * 997805 - s14 += s22 * 136657 - s15 -= s22 * 683901 - s22 = 0 - - s9 += s21 * 666643 - s10 += s21 * 470296 - s11 += s21 * 654183 - s12 -= s21 * 997805 - s13 += s21 * 136657 - s14 -= s21 * 683901 - s21 = 0 - - s8 += s20 * 666643 - s9 += s20 * 470296 - s10 += s20 * 654183 - s11 -= s20 * 997805 - s12 += s20 * 136657 - s13 -= s20 * 683901 - s20 = 0 - - s7 += s19 * 666643 - s8 += s19 * 470296 - s9 += s19 * 654183 - s10 -= s19 * 997805 - s11 += s19 * 136657 - s12 -= s19 * 683901 - s19 = 0 - - s6 += s18 * 666643 - s7 += s18 * 470296 - s8 += s18 * 654183 - s9 -= s18 * 997805 - s10 += s18 * 136657 - s11 -= s18 * 683901 - s18 = 0 - - var carry [17]int64 - - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[12] = (s12 + (1 << 20)) >> 21 - s13 += carry[12] - s12 -= carry[12] << 21 - carry[14] = (s14 + (1 << 20)) >> 21 - s15 += carry[14] - s14 -= carry[14] << 21 - carry[16] = (s16 + (1 << 20)) >> 21 - s17 += carry[16] - s16 -= carry[16] << 21 - - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - carry[13] = (s13 + (1 << 20)) >> 21 - s14 += carry[13] - s13 -= carry[13] << 21 - carry[15] = (s15 + (1 << 20)) >> 21 - s16 += carry[15] - s15 -= carry[15] << 21 - - s5 += s17 * 666643 - s6 += s17 * 470296 - s7 += s17 * 654183 - s8 -= s17 * 997805 - s9 += s17 * 136657 - s10 -= s17 * 683901 - s17 = 0 - - s4 += s16 * 666643 - s5 += s16 * 470296 - s6 += s16 * 654183 - s7 -= s16 * 997805 - s8 += s16 * 136657 - s9 -= s16 * 683901 - s16 = 0 - - s3 += s15 * 666643 - s4 += s15 * 470296 - s5 += s15 * 654183 - s6 -= s15 * 997805 - s7 += s15 * 136657 - s8 -= s15 * 683901 - s15 = 0 - - s2 += s14 * 666643 - s3 += s14 * 470296 - s4 += s14 * 654183 - s5 -= s14 * 997805 - s6 += s14 * 136657 - s7 -= s14 * 683901 - s14 = 0 - - s1 += s13 * 666643 - s2 += s13 * 470296 - s3 += s13 * 654183 - s4 -= s13 * 997805 - s5 += s13 * 136657 - s6 -= s13 * 683901 - s13 = 0 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = (s0 + (1 << 20)) >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[2] = (s2 + (1 << 20)) >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[4] = (s4 + (1 << 20)) >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[6] = (s6 + (1 << 20)) >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[8] = (s8 + (1 << 20)) >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[10] = (s10 + (1 << 20)) >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - carry[1] = (s1 + (1 << 20)) >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[3] = (s3 + (1 << 20)) >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[5] = (s5 + (1 << 20)) >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[7] = (s7 + (1 << 20)) >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[9] = (s9 + (1 << 20)) >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[11] = (s11 + (1 << 20)) >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - carry[11] = s11 >> 21 - s12 += carry[11] - s11 -= carry[11] << 21 - - s0 += s12 * 666643 - s1 += s12 * 470296 - s2 += s12 * 654183 - s3 -= s12 * 997805 - s4 += s12 * 136657 - s5 -= s12 * 683901 - s12 = 0 - - carry[0] = s0 >> 21 - s1 += carry[0] - s0 -= carry[0] << 21 - carry[1] = s1 >> 21 - s2 += carry[1] - s1 -= carry[1] << 21 - carry[2] = s2 >> 21 - s3 += carry[2] - s2 -= carry[2] << 21 - carry[3] = s3 >> 21 - s4 += carry[3] - s3 -= carry[3] << 21 - carry[4] = s4 >> 21 - s5 += carry[4] - s4 -= carry[4] << 21 - carry[5] = s5 >> 21 - s6 += carry[5] - s5 -= carry[5] << 21 - carry[6] = s6 >> 21 - s7 += carry[6] - s6 -= carry[6] << 21 - carry[7] = s7 >> 21 - s8 += carry[7] - s7 -= carry[7] << 21 - carry[8] = s8 >> 21 - s9 += carry[8] - s8 -= carry[8] << 21 - carry[9] = s9 >> 21 - s10 += carry[9] - s9 -= carry[9] << 21 - carry[10] = s10 >> 21 - s11 += carry[10] - s10 -= carry[10] << 21 - - out[0] = byte(s0 >> 0) - out[1] = byte(s0 >> 8) - out[2] = byte((s0 >> 16) | (s1 << 5)) - out[3] = byte(s1 >> 3) - out[4] = byte(s1 >> 11) - out[5] = byte((s1 >> 19) | (s2 << 2)) - out[6] = byte(s2 >> 6) - out[7] = byte((s2 >> 14) | (s3 << 7)) - out[8] = byte(s3 >> 1) - out[9] = byte(s3 >> 9) - out[10] = byte((s3 >> 17) | (s4 << 4)) - out[11] = byte(s4 >> 4) - out[12] = byte(s4 >> 12) - out[13] = byte((s4 >> 20) | (s5 << 1)) - out[14] = byte(s5 >> 7) - out[15] = byte((s5 >> 15) | (s6 << 6)) - out[16] = byte(s6 >> 2) - out[17] = byte(s6 >> 10) - out[18] = byte((s6 >> 18) | (s7 << 3)) - out[19] = byte(s7 >> 5) - out[20] = byte(s7 >> 13) - out[21] = byte(s8 >> 0) - out[22] = byte(s8 >> 8) - out[23] = byte((s8 >> 16) | (s9 << 5)) - out[24] = byte(s9 >> 3) - out[25] = byte(s9 >> 11) - out[26] = byte((s9 >> 19) | (s10 << 2)) - out[27] = byte(s10 >> 6) - out[28] = byte((s10 >> 14) | (s11 << 7)) - out[29] = byte(s11 >> 1) - out[30] = byte(s11 >> 9) - out[31] = byte(s11 >> 17) + var diff fiatScalarMontgomeryDomainFieldElement + fiatScalarSub(&diff, &s.s, &t.s) + var nonzero uint64 + fiatScalarNonzero(&nonzero, (*[4]uint64)(&diff)) + nonzero |= nonzero >> 32 + nonzero |= nonzero >> 16 + nonzero |= nonzero >> 8 + nonzero |= nonzero >> 4 + nonzero |= nonzero >> 2 + nonzero |= nonzero >> 1 + return int(^nonzero) & 1 } // nonAdjacentForm computes a width-w non-adjacent form for this scalar. @@ -946,7 +257,8 @@ func (s *Scalar) nonAdjacentForm(w uint) [256]int8 { // This implementation is adapted from the one // in curve25519-dalek and is documented there: // https://github.com/dalek-cryptography/curve25519-dalek/blob/f630041af28e9a405255f98a8a93adca18e4315b/src/scalar.rs#L800-L871 - if s.s[31] > 127 { + b := s.Bytes() + if b[31] > 127 { panic("scalar has high bit set illegally") } if w < 2 { @@ -959,7 +271,7 @@ func (s *Scalar) nonAdjacentForm(w uint) [256]int8 { var digits [5]uint64 for i := 0; i < 4; i++ { - digits[i] = binary.LittleEndian.Uint64(s.s[i*8:]) + digits[i] = binary.LittleEndian.Uint64(b[i*8:]) } width := uint64(1 << w) @@ -1007,7 +319,8 @@ func (s *Scalar) nonAdjacentForm(w uint) [256]int8 { } func (s *Scalar) signedRadix16() [64]int8 { - if s.s[31] > 127 { + b := s.Bytes() + if b[31] > 127 { panic("scalar has high bit set illegally") } @@ -1015,8 +328,8 @@ func (s *Scalar) signedRadix16() [64]int8 { // Compute unsigned radix-16 digits: for i := 0; i < 32; i++ { - digits[2*i] = int8(s.s[i] & 15) - digits[2*i+1] = int8((s.s[i] >> 4) & 15) + digits[2*i] = int8(b[i] & 15) + digits[2*i+1] = int8((b[i] >> 4) & 15) } // Recenter coefficients: diff --git a/vendor/filippo.io/edwards25519/scalar_fiat.go b/vendor/filippo.io/edwards25519/scalar_fiat.go new file mode 100644 index 00000000..2e5782b6 --- /dev/null +++ b/vendor/filippo.io/edwards25519/scalar_fiat.go @@ -0,0 +1,1147 @@ +// Code generated by Fiat Cryptography. DO NOT EDIT. +// +// Autogenerated: word_by_word_montgomery --lang Go --cmovznz-by-mul --relax-primitive-carry-to-bitwidth 32,64 --public-function-case camelCase --public-type-case camelCase --private-function-case camelCase --private-type-case camelCase --doc-text-before-function-name '' --doc-newline-before-package-declaration --doc-prepend-header 'Code generated by Fiat Cryptography. DO NOT EDIT.' --package-name edwards25519 Scalar 64 '2^252 + 27742317777372353535851937790883648493' mul add sub opp nonzero from_montgomery to_montgomery to_bytes from_bytes +// +// curve description: Scalar +// +// machine_wordsize = 64 (from "64") +// +// requested operations: mul, add, sub, opp, nonzero, from_montgomery, to_montgomery, to_bytes, from_bytes +// +// m = 0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed (from "2^252 + 27742317777372353535851937790883648493") +// +// +// +// NOTE: In addition to the bounds specified above each function, all +// +// functions synthesized for this Montgomery arithmetic require the +// +// input to be strictly less than the prime modulus (m), and also +// +// require the input to be in the unique saturated representation. +// +// All functions also ensure that these two properties are true of +// +// return values. +// +// +// +// Computed values: +// +// eval z = z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) +// +// bytes_eval z = z[0] + (z[1] << 8) + (z[2] << 16) + (z[3] << 24) + (z[4] << 32) + (z[5] << 40) + (z[6] << 48) + (z[7] << 56) + (z[8] << 64) + (z[9] << 72) + (z[10] << 80) + (z[11] << 88) + (z[12] << 96) + (z[13] << 104) + (z[14] << 112) + (z[15] << 120) + (z[16] << 128) + (z[17] << 136) + (z[18] << 144) + (z[19] << 152) + (z[20] << 160) + (z[21] << 168) + (z[22] << 176) + (z[23] << 184) + (z[24] << 192) + (z[25] << 200) + (z[26] << 208) + (z[27] << 216) + (z[28] << 224) + (z[29] << 232) + (z[30] << 240) + (z[31] << 248) +// +// twos_complement_eval z = let x1 := z[0] + (z[1] << 64) + (z[2] << 128) + (z[3] << 192) in +// +// if x1 & (2^256-1) < 2^255 then x1 & (2^256-1) else (x1 & (2^256-1)) - 2^256 + +package edwards25519 + +import "math/bits" + +type fiatScalarUint1 uint64 // We use uint64 instead of a more narrow type for performance reasons; see https://github.com/mit-plv/fiat-crypto/pull/1006#issuecomment-892625927 +type fiatScalarInt1 int64 // We use uint64 instead of a more narrow type for performance reasons; see https://github.com/mit-plv/fiat-crypto/pull/1006#issuecomment-892625927 + +// The type fiatScalarMontgomeryDomainFieldElement is a field element in the Montgomery domain. +// +// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] +type fiatScalarMontgomeryDomainFieldElement [4]uint64 + +// The type fiatScalarNonMontgomeryDomainFieldElement is a field element NOT in the Montgomery domain. +// +// Bounds: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] +type fiatScalarNonMontgomeryDomainFieldElement [4]uint64 + +// fiatScalarCmovznzU64 is a single-word conditional move. +// +// Postconditions: +// +// out1 = (if arg1 = 0 then arg2 else arg3) +// +// Input Bounds: +// +// arg1: [0x0 ~> 0x1] +// arg2: [0x0 ~> 0xffffffffffffffff] +// arg3: [0x0 ~> 0xffffffffffffffff] +// +// Output Bounds: +// +// out1: [0x0 ~> 0xffffffffffffffff] +func fiatScalarCmovznzU64(out1 *uint64, arg1 fiatScalarUint1, arg2 uint64, arg3 uint64) { + x1 := (uint64(arg1) * 0xffffffffffffffff) + x2 := ((x1 & arg3) | ((^x1) & arg2)) + *out1 = x2 +} + +// fiatScalarMul multiplies two field elements in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// 0 ≤ eval arg2 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) * eval (from_montgomery arg2)) mod m +// 0 ≤ eval out1 < m +func fiatScalarMul(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) { + x1 := arg1[1] + x2 := arg1[2] + x3 := arg1[3] + x4 := arg1[0] + var x5 uint64 + var x6 uint64 + x6, x5 = bits.Mul64(x4, arg2[3]) + var x7 uint64 + var x8 uint64 + x8, x7 = bits.Mul64(x4, arg2[2]) + var x9 uint64 + var x10 uint64 + x10, x9 = bits.Mul64(x4, arg2[1]) + var x11 uint64 + var x12 uint64 + x12, x11 = bits.Mul64(x4, arg2[0]) + var x13 uint64 + var x14 uint64 + x13, x14 = bits.Add64(x12, x9, uint64(0x0)) + var x15 uint64 + var x16 uint64 + x15, x16 = bits.Add64(x10, x7, uint64(fiatScalarUint1(x14))) + var x17 uint64 + var x18 uint64 + x17, x18 = bits.Add64(x8, x5, uint64(fiatScalarUint1(x16))) + x19 := (uint64(fiatScalarUint1(x18)) + x6) + var x20 uint64 + _, x20 = bits.Mul64(x11, 0xd2b51da312547e1b) + var x22 uint64 + var x23 uint64 + x23, x22 = bits.Mul64(x20, 0x1000000000000000) + var x24 uint64 + var x25 uint64 + x25, x24 = bits.Mul64(x20, 0x14def9dea2f79cd6) + var x26 uint64 + var x27 uint64 + x27, x26 = bits.Mul64(x20, 0x5812631a5cf5d3ed) + var x28 uint64 + var x29 uint64 + x28, x29 = bits.Add64(x27, x24, uint64(0x0)) + x30 := (uint64(fiatScalarUint1(x29)) + x25) + var x32 uint64 + _, x32 = bits.Add64(x11, x26, uint64(0x0)) + var x33 uint64 + var x34 uint64 + x33, x34 = bits.Add64(x13, x28, uint64(fiatScalarUint1(x32))) + var x35 uint64 + var x36 uint64 + x35, x36 = bits.Add64(x15, x30, uint64(fiatScalarUint1(x34))) + var x37 uint64 + var x38 uint64 + x37, x38 = bits.Add64(x17, x22, uint64(fiatScalarUint1(x36))) + var x39 uint64 + var x40 uint64 + x39, x40 = bits.Add64(x19, x23, uint64(fiatScalarUint1(x38))) + var x41 uint64 + var x42 uint64 + x42, x41 = bits.Mul64(x1, arg2[3]) + var x43 uint64 + var x44 uint64 + x44, x43 = bits.Mul64(x1, arg2[2]) + var x45 uint64 + var x46 uint64 + x46, x45 = bits.Mul64(x1, arg2[1]) + var x47 uint64 + var x48 uint64 + x48, x47 = bits.Mul64(x1, arg2[0]) + var x49 uint64 + var x50 uint64 + x49, x50 = bits.Add64(x48, x45, uint64(0x0)) + var x51 uint64 + var x52 uint64 + x51, x52 = bits.Add64(x46, x43, uint64(fiatScalarUint1(x50))) + var x53 uint64 + var x54 uint64 + x53, x54 = bits.Add64(x44, x41, uint64(fiatScalarUint1(x52))) + x55 := (uint64(fiatScalarUint1(x54)) + x42) + var x56 uint64 + var x57 uint64 + x56, x57 = bits.Add64(x33, x47, uint64(0x0)) + var x58 uint64 + var x59 uint64 + x58, x59 = bits.Add64(x35, x49, uint64(fiatScalarUint1(x57))) + var x60 uint64 + var x61 uint64 + x60, x61 = bits.Add64(x37, x51, uint64(fiatScalarUint1(x59))) + var x62 uint64 + var x63 uint64 + x62, x63 = bits.Add64(x39, x53, uint64(fiatScalarUint1(x61))) + var x64 uint64 + var x65 uint64 + x64, x65 = bits.Add64(uint64(fiatScalarUint1(x40)), x55, uint64(fiatScalarUint1(x63))) + var x66 uint64 + _, x66 = bits.Mul64(x56, 0xd2b51da312547e1b) + var x68 uint64 + var x69 uint64 + x69, x68 = bits.Mul64(x66, 0x1000000000000000) + var x70 uint64 + var x71 uint64 + x71, x70 = bits.Mul64(x66, 0x14def9dea2f79cd6) + var x72 uint64 + var x73 uint64 + x73, x72 = bits.Mul64(x66, 0x5812631a5cf5d3ed) + var x74 uint64 + var x75 uint64 + x74, x75 = bits.Add64(x73, x70, uint64(0x0)) + x76 := (uint64(fiatScalarUint1(x75)) + x71) + var x78 uint64 + _, x78 = bits.Add64(x56, x72, uint64(0x0)) + var x79 uint64 + var x80 uint64 + x79, x80 = bits.Add64(x58, x74, uint64(fiatScalarUint1(x78))) + var x81 uint64 + var x82 uint64 + x81, x82 = bits.Add64(x60, x76, uint64(fiatScalarUint1(x80))) + var x83 uint64 + var x84 uint64 + x83, x84 = bits.Add64(x62, x68, uint64(fiatScalarUint1(x82))) + var x85 uint64 + var x86 uint64 + x85, x86 = bits.Add64(x64, x69, uint64(fiatScalarUint1(x84))) + x87 := (uint64(fiatScalarUint1(x86)) + uint64(fiatScalarUint1(x65))) + var x88 uint64 + var x89 uint64 + x89, x88 = bits.Mul64(x2, arg2[3]) + var x90 uint64 + var x91 uint64 + x91, x90 = bits.Mul64(x2, arg2[2]) + var x92 uint64 + var x93 uint64 + x93, x92 = bits.Mul64(x2, arg2[1]) + var x94 uint64 + var x95 uint64 + x95, x94 = bits.Mul64(x2, arg2[0]) + var x96 uint64 + var x97 uint64 + x96, x97 = bits.Add64(x95, x92, uint64(0x0)) + var x98 uint64 + var x99 uint64 + x98, x99 = bits.Add64(x93, x90, uint64(fiatScalarUint1(x97))) + var x100 uint64 + var x101 uint64 + x100, x101 = bits.Add64(x91, x88, uint64(fiatScalarUint1(x99))) + x102 := (uint64(fiatScalarUint1(x101)) + x89) + var x103 uint64 + var x104 uint64 + x103, x104 = bits.Add64(x79, x94, uint64(0x0)) + var x105 uint64 + var x106 uint64 + x105, x106 = bits.Add64(x81, x96, uint64(fiatScalarUint1(x104))) + var x107 uint64 + var x108 uint64 + x107, x108 = bits.Add64(x83, x98, uint64(fiatScalarUint1(x106))) + var x109 uint64 + var x110 uint64 + x109, x110 = bits.Add64(x85, x100, uint64(fiatScalarUint1(x108))) + var x111 uint64 + var x112 uint64 + x111, x112 = bits.Add64(x87, x102, uint64(fiatScalarUint1(x110))) + var x113 uint64 + _, x113 = bits.Mul64(x103, 0xd2b51da312547e1b) + var x115 uint64 + var x116 uint64 + x116, x115 = bits.Mul64(x113, 0x1000000000000000) + var x117 uint64 + var x118 uint64 + x118, x117 = bits.Mul64(x113, 0x14def9dea2f79cd6) + var x119 uint64 + var x120 uint64 + x120, x119 = bits.Mul64(x113, 0x5812631a5cf5d3ed) + var x121 uint64 + var x122 uint64 + x121, x122 = bits.Add64(x120, x117, uint64(0x0)) + x123 := (uint64(fiatScalarUint1(x122)) + x118) + var x125 uint64 + _, x125 = bits.Add64(x103, x119, uint64(0x0)) + var x126 uint64 + var x127 uint64 + x126, x127 = bits.Add64(x105, x121, uint64(fiatScalarUint1(x125))) + var x128 uint64 + var x129 uint64 + x128, x129 = bits.Add64(x107, x123, uint64(fiatScalarUint1(x127))) + var x130 uint64 + var x131 uint64 + x130, x131 = bits.Add64(x109, x115, uint64(fiatScalarUint1(x129))) + var x132 uint64 + var x133 uint64 + x132, x133 = bits.Add64(x111, x116, uint64(fiatScalarUint1(x131))) + x134 := (uint64(fiatScalarUint1(x133)) + uint64(fiatScalarUint1(x112))) + var x135 uint64 + var x136 uint64 + x136, x135 = bits.Mul64(x3, arg2[3]) + var x137 uint64 + var x138 uint64 + x138, x137 = bits.Mul64(x3, arg2[2]) + var x139 uint64 + var x140 uint64 + x140, x139 = bits.Mul64(x3, arg2[1]) + var x141 uint64 + var x142 uint64 + x142, x141 = bits.Mul64(x3, arg2[0]) + var x143 uint64 + var x144 uint64 + x143, x144 = bits.Add64(x142, x139, uint64(0x0)) + var x145 uint64 + var x146 uint64 + x145, x146 = bits.Add64(x140, x137, uint64(fiatScalarUint1(x144))) + var x147 uint64 + var x148 uint64 + x147, x148 = bits.Add64(x138, x135, uint64(fiatScalarUint1(x146))) + x149 := (uint64(fiatScalarUint1(x148)) + x136) + var x150 uint64 + var x151 uint64 + x150, x151 = bits.Add64(x126, x141, uint64(0x0)) + var x152 uint64 + var x153 uint64 + x152, x153 = bits.Add64(x128, x143, uint64(fiatScalarUint1(x151))) + var x154 uint64 + var x155 uint64 + x154, x155 = bits.Add64(x130, x145, uint64(fiatScalarUint1(x153))) + var x156 uint64 + var x157 uint64 + x156, x157 = bits.Add64(x132, x147, uint64(fiatScalarUint1(x155))) + var x158 uint64 + var x159 uint64 + x158, x159 = bits.Add64(x134, x149, uint64(fiatScalarUint1(x157))) + var x160 uint64 + _, x160 = bits.Mul64(x150, 0xd2b51da312547e1b) + var x162 uint64 + var x163 uint64 + x163, x162 = bits.Mul64(x160, 0x1000000000000000) + var x164 uint64 + var x165 uint64 + x165, x164 = bits.Mul64(x160, 0x14def9dea2f79cd6) + var x166 uint64 + var x167 uint64 + x167, x166 = bits.Mul64(x160, 0x5812631a5cf5d3ed) + var x168 uint64 + var x169 uint64 + x168, x169 = bits.Add64(x167, x164, uint64(0x0)) + x170 := (uint64(fiatScalarUint1(x169)) + x165) + var x172 uint64 + _, x172 = bits.Add64(x150, x166, uint64(0x0)) + var x173 uint64 + var x174 uint64 + x173, x174 = bits.Add64(x152, x168, uint64(fiatScalarUint1(x172))) + var x175 uint64 + var x176 uint64 + x175, x176 = bits.Add64(x154, x170, uint64(fiatScalarUint1(x174))) + var x177 uint64 + var x178 uint64 + x177, x178 = bits.Add64(x156, x162, uint64(fiatScalarUint1(x176))) + var x179 uint64 + var x180 uint64 + x179, x180 = bits.Add64(x158, x163, uint64(fiatScalarUint1(x178))) + x181 := (uint64(fiatScalarUint1(x180)) + uint64(fiatScalarUint1(x159))) + var x182 uint64 + var x183 uint64 + x182, x183 = bits.Sub64(x173, 0x5812631a5cf5d3ed, uint64(0x0)) + var x184 uint64 + var x185 uint64 + x184, x185 = bits.Sub64(x175, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x183))) + var x186 uint64 + var x187 uint64 + x186, x187 = bits.Sub64(x177, uint64(0x0), uint64(fiatScalarUint1(x185))) + var x188 uint64 + var x189 uint64 + x188, x189 = bits.Sub64(x179, 0x1000000000000000, uint64(fiatScalarUint1(x187))) + var x191 uint64 + _, x191 = bits.Sub64(x181, uint64(0x0), uint64(fiatScalarUint1(x189))) + var x192 uint64 + fiatScalarCmovznzU64(&x192, fiatScalarUint1(x191), x182, x173) + var x193 uint64 + fiatScalarCmovznzU64(&x193, fiatScalarUint1(x191), x184, x175) + var x194 uint64 + fiatScalarCmovznzU64(&x194, fiatScalarUint1(x191), x186, x177) + var x195 uint64 + fiatScalarCmovznzU64(&x195, fiatScalarUint1(x191), x188, x179) + out1[0] = x192 + out1[1] = x193 + out1[2] = x194 + out1[3] = x195 +} + +// fiatScalarAdd adds two field elements in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// 0 ≤ eval arg2 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) + eval (from_montgomery arg2)) mod m +// 0 ≤ eval out1 < m +func fiatScalarAdd(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) { + var x1 uint64 + var x2 uint64 + x1, x2 = bits.Add64(arg1[0], arg2[0], uint64(0x0)) + var x3 uint64 + var x4 uint64 + x3, x4 = bits.Add64(arg1[1], arg2[1], uint64(fiatScalarUint1(x2))) + var x5 uint64 + var x6 uint64 + x5, x6 = bits.Add64(arg1[2], arg2[2], uint64(fiatScalarUint1(x4))) + var x7 uint64 + var x8 uint64 + x7, x8 = bits.Add64(arg1[3], arg2[3], uint64(fiatScalarUint1(x6))) + var x9 uint64 + var x10 uint64 + x9, x10 = bits.Sub64(x1, 0x5812631a5cf5d3ed, uint64(0x0)) + var x11 uint64 + var x12 uint64 + x11, x12 = bits.Sub64(x3, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x10))) + var x13 uint64 + var x14 uint64 + x13, x14 = bits.Sub64(x5, uint64(0x0), uint64(fiatScalarUint1(x12))) + var x15 uint64 + var x16 uint64 + x15, x16 = bits.Sub64(x7, 0x1000000000000000, uint64(fiatScalarUint1(x14))) + var x18 uint64 + _, x18 = bits.Sub64(uint64(fiatScalarUint1(x8)), uint64(0x0), uint64(fiatScalarUint1(x16))) + var x19 uint64 + fiatScalarCmovznzU64(&x19, fiatScalarUint1(x18), x9, x1) + var x20 uint64 + fiatScalarCmovznzU64(&x20, fiatScalarUint1(x18), x11, x3) + var x21 uint64 + fiatScalarCmovznzU64(&x21, fiatScalarUint1(x18), x13, x5) + var x22 uint64 + fiatScalarCmovznzU64(&x22, fiatScalarUint1(x18), x15, x7) + out1[0] = x19 + out1[1] = x20 + out1[2] = x21 + out1[3] = x22 +} + +// fiatScalarSub subtracts two field elements in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// 0 ≤ eval arg2 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = (eval (from_montgomery arg1) - eval (from_montgomery arg2)) mod m +// 0 ≤ eval out1 < m +func fiatScalarSub(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement, arg2 *fiatScalarMontgomeryDomainFieldElement) { + var x1 uint64 + var x2 uint64 + x1, x2 = bits.Sub64(arg1[0], arg2[0], uint64(0x0)) + var x3 uint64 + var x4 uint64 + x3, x4 = bits.Sub64(arg1[1], arg2[1], uint64(fiatScalarUint1(x2))) + var x5 uint64 + var x6 uint64 + x5, x6 = bits.Sub64(arg1[2], arg2[2], uint64(fiatScalarUint1(x4))) + var x7 uint64 + var x8 uint64 + x7, x8 = bits.Sub64(arg1[3], arg2[3], uint64(fiatScalarUint1(x6))) + var x9 uint64 + fiatScalarCmovznzU64(&x9, fiatScalarUint1(x8), uint64(0x0), 0xffffffffffffffff) + var x10 uint64 + var x11 uint64 + x10, x11 = bits.Add64(x1, (x9 & 0x5812631a5cf5d3ed), uint64(0x0)) + var x12 uint64 + var x13 uint64 + x12, x13 = bits.Add64(x3, (x9 & 0x14def9dea2f79cd6), uint64(fiatScalarUint1(x11))) + var x14 uint64 + var x15 uint64 + x14, x15 = bits.Add64(x5, uint64(0x0), uint64(fiatScalarUint1(x13))) + var x16 uint64 + x16, _ = bits.Add64(x7, (x9 & 0x1000000000000000), uint64(fiatScalarUint1(x15))) + out1[0] = x10 + out1[1] = x12 + out1[2] = x14 + out1[3] = x16 +} + +// fiatScalarOpp negates a field element in the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = -eval (from_montgomery arg1) mod m +// 0 ≤ eval out1 < m +func fiatScalarOpp(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement) { + var x1 uint64 + var x2 uint64 + x1, x2 = bits.Sub64(uint64(0x0), arg1[0], uint64(0x0)) + var x3 uint64 + var x4 uint64 + x3, x4 = bits.Sub64(uint64(0x0), arg1[1], uint64(fiatScalarUint1(x2))) + var x5 uint64 + var x6 uint64 + x5, x6 = bits.Sub64(uint64(0x0), arg1[2], uint64(fiatScalarUint1(x4))) + var x7 uint64 + var x8 uint64 + x7, x8 = bits.Sub64(uint64(0x0), arg1[3], uint64(fiatScalarUint1(x6))) + var x9 uint64 + fiatScalarCmovznzU64(&x9, fiatScalarUint1(x8), uint64(0x0), 0xffffffffffffffff) + var x10 uint64 + var x11 uint64 + x10, x11 = bits.Add64(x1, (x9 & 0x5812631a5cf5d3ed), uint64(0x0)) + var x12 uint64 + var x13 uint64 + x12, x13 = bits.Add64(x3, (x9 & 0x14def9dea2f79cd6), uint64(fiatScalarUint1(x11))) + var x14 uint64 + var x15 uint64 + x14, x15 = bits.Add64(x5, uint64(0x0), uint64(fiatScalarUint1(x13))) + var x16 uint64 + x16, _ = bits.Add64(x7, (x9 & 0x1000000000000000), uint64(fiatScalarUint1(x15))) + out1[0] = x10 + out1[1] = x12 + out1[2] = x14 + out1[3] = x16 +} + +// fiatScalarNonzero outputs a single non-zero word if the input is non-zero and zero otherwise. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// out1 = 0 ↔ eval (from_montgomery arg1) mod m = 0 +// +// Input Bounds: +// +// arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff]] +// +// Output Bounds: +// +// out1: [0x0 ~> 0xffffffffffffffff] +func fiatScalarNonzero(out1 *uint64, arg1 *[4]uint64) { + x1 := (arg1[0] | (arg1[1] | (arg1[2] | arg1[3]))) + *out1 = x1 +} + +// fiatScalarFromMontgomery translates a field element out of the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// eval out1 mod m = (eval arg1 * ((2^64)⁻¹ mod m)^4) mod m +// 0 ≤ eval out1 < m +func fiatScalarFromMontgomery(out1 *fiatScalarNonMontgomeryDomainFieldElement, arg1 *fiatScalarMontgomeryDomainFieldElement) { + x1 := arg1[0] + var x2 uint64 + _, x2 = bits.Mul64(x1, 0xd2b51da312547e1b) + var x4 uint64 + var x5 uint64 + x5, x4 = bits.Mul64(x2, 0x1000000000000000) + var x6 uint64 + var x7 uint64 + x7, x6 = bits.Mul64(x2, 0x14def9dea2f79cd6) + var x8 uint64 + var x9 uint64 + x9, x8 = bits.Mul64(x2, 0x5812631a5cf5d3ed) + var x10 uint64 + var x11 uint64 + x10, x11 = bits.Add64(x9, x6, uint64(0x0)) + var x13 uint64 + _, x13 = bits.Add64(x1, x8, uint64(0x0)) + var x14 uint64 + var x15 uint64 + x14, x15 = bits.Add64(uint64(0x0), x10, uint64(fiatScalarUint1(x13))) + var x16 uint64 + var x17 uint64 + x16, x17 = bits.Add64(x14, arg1[1], uint64(0x0)) + var x18 uint64 + _, x18 = bits.Mul64(x16, 0xd2b51da312547e1b) + var x20 uint64 + var x21 uint64 + x21, x20 = bits.Mul64(x18, 0x1000000000000000) + var x22 uint64 + var x23 uint64 + x23, x22 = bits.Mul64(x18, 0x14def9dea2f79cd6) + var x24 uint64 + var x25 uint64 + x25, x24 = bits.Mul64(x18, 0x5812631a5cf5d3ed) + var x26 uint64 + var x27 uint64 + x26, x27 = bits.Add64(x25, x22, uint64(0x0)) + var x29 uint64 + _, x29 = bits.Add64(x16, x24, uint64(0x0)) + var x30 uint64 + var x31 uint64 + x30, x31 = bits.Add64((uint64(fiatScalarUint1(x17)) + (uint64(fiatScalarUint1(x15)) + (uint64(fiatScalarUint1(x11)) + x7))), x26, uint64(fiatScalarUint1(x29))) + var x32 uint64 + var x33 uint64 + x32, x33 = bits.Add64(x4, (uint64(fiatScalarUint1(x27)) + x23), uint64(fiatScalarUint1(x31))) + var x34 uint64 + var x35 uint64 + x34, x35 = bits.Add64(x5, x20, uint64(fiatScalarUint1(x33))) + var x36 uint64 + var x37 uint64 + x36, x37 = bits.Add64(x30, arg1[2], uint64(0x0)) + var x38 uint64 + var x39 uint64 + x38, x39 = bits.Add64(x32, uint64(0x0), uint64(fiatScalarUint1(x37))) + var x40 uint64 + var x41 uint64 + x40, x41 = bits.Add64(x34, uint64(0x0), uint64(fiatScalarUint1(x39))) + var x42 uint64 + _, x42 = bits.Mul64(x36, 0xd2b51da312547e1b) + var x44 uint64 + var x45 uint64 + x45, x44 = bits.Mul64(x42, 0x1000000000000000) + var x46 uint64 + var x47 uint64 + x47, x46 = bits.Mul64(x42, 0x14def9dea2f79cd6) + var x48 uint64 + var x49 uint64 + x49, x48 = bits.Mul64(x42, 0x5812631a5cf5d3ed) + var x50 uint64 + var x51 uint64 + x50, x51 = bits.Add64(x49, x46, uint64(0x0)) + var x53 uint64 + _, x53 = bits.Add64(x36, x48, uint64(0x0)) + var x54 uint64 + var x55 uint64 + x54, x55 = bits.Add64(x38, x50, uint64(fiatScalarUint1(x53))) + var x56 uint64 + var x57 uint64 + x56, x57 = bits.Add64(x40, (uint64(fiatScalarUint1(x51)) + x47), uint64(fiatScalarUint1(x55))) + var x58 uint64 + var x59 uint64 + x58, x59 = bits.Add64((uint64(fiatScalarUint1(x41)) + (uint64(fiatScalarUint1(x35)) + x21)), x44, uint64(fiatScalarUint1(x57))) + var x60 uint64 + var x61 uint64 + x60, x61 = bits.Add64(x54, arg1[3], uint64(0x0)) + var x62 uint64 + var x63 uint64 + x62, x63 = bits.Add64(x56, uint64(0x0), uint64(fiatScalarUint1(x61))) + var x64 uint64 + var x65 uint64 + x64, x65 = bits.Add64(x58, uint64(0x0), uint64(fiatScalarUint1(x63))) + var x66 uint64 + _, x66 = bits.Mul64(x60, 0xd2b51da312547e1b) + var x68 uint64 + var x69 uint64 + x69, x68 = bits.Mul64(x66, 0x1000000000000000) + var x70 uint64 + var x71 uint64 + x71, x70 = bits.Mul64(x66, 0x14def9dea2f79cd6) + var x72 uint64 + var x73 uint64 + x73, x72 = bits.Mul64(x66, 0x5812631a5cf5d3ed) + var x74 uint64 + var x75 uint64 + x74, x75 = bits.Add64(x73, x70, uint64(0x0)) + var x77 uint64 + _, x77 = bits.Add64(x60, x72, uint64(0x0)) + var x78 uint64 + var x79 uint64 + x78, x79 = bits.Add64(x62, x74, uint64(fiatScalarUint1(x77))) + var x80 uint64 + var x81 uint64 + x80, x81 = bits.Add64(x64, (uint64(fiatScalarUint1(x75)) + x71), uint64(fiatScalarUint1(x79))) + var x82 uint64 + var x83 uint64 + x82, x83 = bits.Add64((uint64(fiatScalarUint1(x65)) + (uint64(fiatScalarUint1(x59)) + x45)), x68, uint64(fiatScalarUint1(x81))) + x84 := (uint64(fiatScalarUint1(x83)) + x69) + var x85 uint64 + var x86 uint64 + x85, x86 = bits.Sub64(x78, 0x5812631a5cf5d3ed, uint64(0x0)) + var x87 uint64 + var x88 uint64 + x87, x88 = bits.Sub64(x80, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x86))) + var x89 uint64 + var x90 uint64 + x89, x90 = bits.Sub64(x82, uint64(0x0), uint64(fiatScalarUint1(x88))) + var x91 uint64 + var x92 uint64 + x91, x92 = bits.Sub64(x84, 0x1000000000000000, uint64(fiatScalarUint1(x90))) + var x94 uint64 + _, x94 = bits.Sub64(uint64(0x0), uint64(0x0), uint64(fiatScalarUint1(x92))) + var x95 uint64 + fiatScalarCmovznzU64(&x95, fiatScalarUint1(x94), x85, x78) + var x96 uint64 + fiatScalarCmovznzU64(&x96, fiatScalarUint1(x94), x87, x80) + var x97 uint64 + fiatScalarCmovznzU64(&x97, fiatScalarUint1(x94), x89, x82) + var x98 uint64 + fiatScalarCmovznzU64(&x98, fiatScalarUint1(x94), x91, x84) + out1[0] = x95 + out1[1] = x96 + out1[2] = x97 + out1[3] = x98 +} + +// fiatScalarToMontgomery translates a field element into the Montgomery domain. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// eval (from_montgomery out1) mod m = eval arg1 mod m +// 0 ≤ eval out1 < m +func fiatScalarToMontgomery(out1 *fiatScalarMontgomeryDomainFieldElement, arg1 *fiatScalarNonMontgomeryDomainFieldElement) { + x1 := arg1[1] + x2 := arg1[2] + x3 := arg1[3] + x4 := arg1[0] + var x5 uint64 + var x6 uint64 + x6, x5 = bits.Mul64(x4, 0x399411b7c309a3d) + var x7 uint64 + var x8 uint64 + x8, x7 = bits.Mul64(x4, 0xceec73d217f5be65) + var x9 uint64 + var x10 uint64 + x10, x9 = bits.Mul64(x4, 0xd00e1ba768859347) + var x11 uint64 + var x12 uint64 + x12, x11 = bits.Mul64(x4, 0xa40611e3449c0f01) + var x13 uint64 + var x14 uint64 + x13, x14 = bits.Add64(x12, x9, uint64(0x0)) + var x15 uint64 + var x16 uint64 + x15, x16 = bits.Add64(x10, x7, uint64(fiatScalarUint1(x14))) + var x17 uint64 + var x18 uint64 + x17, x18 = bits.Add64(x8, x5, uint64(fiatScalarUint1(x16))) + var x19 uint64 + _, x19 = bits.Mul64(x11, 0xd2b51da312547e1b) + var x21 uint64 + var x22 uint64 + x22, x21 = bits.Mul64(x19, 0x1000000000000000) + var x23 uint64 + var x24 uint64 + x24, x23 = bits.Mul64(x19, 0x14def9dea2f79cd6) + var x25 uint64 + var x26 uint64 + x26, x25 = bits.Mul64(x19, 0x5812631a5cf5d3ed) + var x27 uint64 + var x28 uint64 + x27, x28 = bits.Add64(x26, x23, uint64(0x0)) + var x30 uint64 + _, x30 = bits.Add64(x11, x25, uint64(0x0)) + var x31 uint64 + var x32 uint64 + x31, x32 = bits.Add64(x13, x27, uint64(fiatScalarUint1(x30))) + var x33 uint64 + var x34 uint64 + x33, x34 = bits.Add64(x15, (uint64(fiatScalarUint1(x28)) + x24), uint64(fiatScalarUint1(x32))) + var x35 uint64 + var x36 uint64 + x35, x36 = bits.Add64(x17, x21, uint64(fiatScalarUint1(x34))) + var x37 uint64 + var x38 uint64 + x38, x37 = bits.Mul64(x1, 0x399411b7c309a3d) + var x39 uint64 + var x40 uint64 + x40, x39 = bits.Mul64(x1, 0xceec73d217f5be65) + var x41 uint64 + var x42 uint64 + x42, x41 = bits.Mul64(x1, 0xd00e1ba768859347) + var x43 uint64 + var x44 uint64 + x44, x43 = bits.Mul64(x1, 0xa40611e3449c0f01) + var x45 uint64 + var x46 uint64 + x45, x46 = bits.Add64(x44, x41, uint64(0x0)) + var x47 uint64 + var x48 uint64 + x47, x48 = bits.Add64(x42, x39, uint64(fiatScalarUint1(x46))) + var x49 uint64 + var x50 uint64 + x49, x50 = bits.Add64(x40, x37, uint64(fiatScalarUint1(x48))) + var x51 uint64 + var x52 uint64 + x51, x52 = bits.Add64(x31, x43, uint64(0x0)) + var x53 uint64 + var x54 uint64 + x53, x54 = bits.Add64(x33, x45, uint64(fiatScalarUint1(x52))) + var x55 uint64 + var x56 uint64 + x55, x56 = bits.Add64(x35, x47, uint64(fiatScalarUint1(x54))) + var x57 uint64 + var x58 uint64 + x57, x58 = bits.Add64(((uint64(fiatScalarUint1(x36)) + (uint64(fiatScalarUint1(x18)) + x6)) + x22), x49, uint64(fiatScalarUint1(x56))) + var x59 uint64 + _, x59 = bits.Mul64(x51, 0xd2b51da312547e1b) + var x61 uint64 + var x62 uint64 + x62, x61 = bits.Mul64(x59, 0x1000000000000000) + var x63 uint64 + var x64 uint64 + x64, x63 = bits.Mul64(x59, 0x14def9dea2f79cd6) + var x65 uint64 + var x66 uint64 + x66, x65 = bits.Mul64(x59, 0x5812631a5cf5d3ed) + var x67 uint64 + var x68 uint64 + x67, x68 = bits.Add64(x66, x63, uint64(0x0)) + var x70 uint64 + _, x70 = bits.Add64(x51, x65, uint64(0x0)) + var x71 uint64 + var x72 uint64 + x71, x72 = bits.Add64(x53, x67, uint64(fiatScalarUint1(x70))) + var x73 uint64 + var x74 uint64 + x73, x74 = bits.Add64(x55, (uint64(fiatScalarUint1(x68)) + x64), uint64(fiatScalarUint1(x72))) + var x75 uint64 + var x76 uint64 + x75, x76 = bits.Add64(x57, x61, uint64(fiatScalarUint1(x74))) + var x77 uint64 + var x78 uint64 + x78, x77 = bits.Mul64(x2, 0x399411b7c309a3d) + var x79 uint64 + var x80 uint64 + x80, x79 = bits.Mul64(x2, 0xceec73d217f5be65) + var x81 uint64 + var x82 uint64 + x82, x81 = bits.Mul64(x2, 0xd00e1ba768859347) + var x83 uint64 + var x84 uint64 + x84, x83 = bits.Mul64(x2, 0xa40611e3449c0f01) + var x85 uint64 + var x86 uint64 + x85, x86 = bits.Add64(x84, x81, uint64(0x0)) + var x87 uint64 + var x88 uint64 + x87, x88 = bits.Add64(x82, x79, uint64(fiatScalarUint1(x86))) + var x89 uint64 + var x90 uint64 + x89, x90 = bits.Add64(x80, x77, uint64(fiatScalarUint1(x88))) + var x91 uint64 + var x92 uint64 + x91, x92 = bits.Add64(x71, x83, uint64(0x0)) + var x93 uint64 + var x94 uint64 + x93, x94 = bits.Add64(x73, x85, uint64(fiatScalarUint1(x92))) + var x95 uint64 + var x96 uint64 + x95, x96 = bits.Add64(x75, x87, uint64(fiatScalarUint1(x94))) + var x97 uint64 + var x98 uint64 + x97, x98 = bits.Add64(((uint64(fiatScalarUint1(x76)) + (uint64(fiatScalarUint1(x58)) + (uint64(fiatScalarUint1(x50)) + x38))) + x62), x89, uint64(fiatScalarUint1(x96))) + var x99 uint64 + _, x99 = bits.Mul64(x91, 0xd2b51da312547e1b) + var x101 uint64 + var x102 uint64 + x102, x101 = bits.Mul64(x99, 0x1000000000000000) + var x103 uint64 + var x104 uint64 + x104, x103 = bits.Mul64(x99, 0x14def9dea2f79cd6) + var x105 uint64 + var x106 uint64 + x106, x105 = bits.Mul64(x99, 0x5812631a5cf5d3ed) + var x107 uint64 + var x108 uint64 + x107, x108 = bits.Add64(x106, x103, uint64(0x0)) + var x110 uint64 + _, x110 = bits.Add64(x91, x105, uint64(0x0)) + var x111 uint64 + var x112 uint64 + x111, x112 = bits.Add64(x93, x107, uint64(fiatScalarUint1(x110))) + var x113 uint64 + var x114 uint64 + x113, x114 = bits.Add64(x95, (uint64(fiatScalarUint1(x108)) + x104), uint64(fiatScalarUint1(x112))) + var x115 uint64 + var x116 uint64 + x115, x116 = bits.Add64(x97, x101, uint64(fiatScalarUint1(x114))) + var x117 uint64 + var x118 uint64 + x118, x117 = bits.Mul64(x3, 0x399411b7c309a3d) + var x119 uint64 + var x120 uint64 + x120, x119 = bits.Mul64(x3, 0xceec73d217f5be65) + var x121 uint64 + var x122 uint64 + x122, x121 = bits.Mul64(x3, 0xd00e1ba768859347) + var x123 uint64 + var x124 uint64 + x124, x123 = bits.Mul64(x3, 0xa40611e3449c0f01) + var x125 uint64 + var x126 uint64 + x125, x126 = bits.Add64(x124, x121, uint64(0x0)) + var x127 uint64 + var x128 uint64 + x127, x128 = bits.Add64(x122, x119, uint64(fiatScalarUint1(x126))) + var x129 uint64 + var x130 uint64 + x129, x130 = bits.Add64(x120, x117, uint64(fiatScalarUint1(x128))) + var x131 uint64 + var x132 uint64 + x131, x132 = bits.Add64(x111, x123, uint64(0x0)) + var x133 uint64 + var x134 uint64 + x133, x134 = bits.Add64(x113, x125, uint64(fiatScalarUint1(x132))) + var x135 uint64 + var x136 uint64 + x135, x136 = bits.Add64(x115, x127, uint64(fiatScalarUint1(x134))) + var x137 uint64 + var x138 uint64 + x137, x138 = bits.Add64(((uint64(fiatScalarUint1(x116)) + (uint64(fiatScalarUint1(x98)) + (uint64(fiatScalarUint1(x90)) + x78))) + x102), x129, uint64(fiatScalarUint1(x136))) + var x139 uint64 + _, x139 = bits.Mul64(x131, 0xd2b51da312547e1b) + var x141 uint64 + var x142 uint64 + x142, x141 = bits.Mul64(x139, 0x1000000000000000) + var x143 uint64 + var x144 uint64 + x144, x143 = bits.Mul64(x139, 0x14def9dea2f79cd6) + var x145 uint64 + var x146 uint64 + x146, x145 = bits.Mul64(x139, 0x5812631a5cf5d3ed) + var x147 uint64 + var x148 uint64 + x147, x148 = bits.Add64(x146, x143, uint64(0x0)) + var x150 uint64 + _, x150 = bits.Add64(x131, x145, uint64(0x0)) + var x151 uint64 + var x152 uint64 + x151, x152 = bits.Add64(x133, x147, uint64(fiatScalarUint1(x150))) + var x153 uint64 + var x154 uint64 + x153, x154 = bits.Add64(x135, (uint64(fiatScalarUint1(x148)) + x144), uint64(fiatScalarUint1(x152))) + var x155 uint64 + var x156 uint64 + x155, x156 = bits.Add64(x137, x141, uint64(fiatScalarUint1(x154))) + x157 := ((uint64(fiatScalarUint1(x156)) + (uint64(fiatScalarUint1(x138)) + (uint64(fiatScalarUint1(x130)) + x118))) + x142) + var x158 uint64 + var x159 uint64 + x158, x159 = bits.Sub64(x151, 0x5812631a5cf5d3ed, uint64(0x0)) + var x160 uint64 + var x161 uint64 + x160, x161 = bits.Sub64(x153, 0x14def9dea2f79cd6, uint64(fiatScalarUint1(x159))) + var x162 uint64 + var x163 uint64 + x162, x163 = bits.Sub64(x155, uint64(0x0), uint64(fiatScalarUint1(x161))) + var x164 uint64 + var x165 uint64 + x164, x165 = bits.Sub64(x157, 0x1000000000000000, uint64(fiatScalarUint1(x163))) + var x167 uint64 + _, x167 = bits.Sub64(uint64(0x0), uint64(0x0), uint64(fiatScalarUint1(x165))) + var x168 uint64 + fiatScalarCmovznzU64(&x168, fiatScalarUint1(x167), x158, x151) + var x169 uint64 + fiatScalarCmovznzU64(&x169, fiatScalarUint1(x167), x160, x153) + var x170 uint64 + fiatScalarCmovznzU64(&x170, fiatScalarUint1(x167), x162, x155) + var x171 uint64 + fiatScalarCmovznzU64(&x171, fiatScalarUint1(x167), x164, x157) + out1[0] = x168 + out1[1] = x169 + out1[2] = x170 + out1[3] = x171 +} + +// fiatScalarToBytes serializes a field element NOT in the Montgomery domain to bytes in little-endian order. +// +// Preconditions: +// +// 0 ≤ eval arg1 < m +// +// Postconditions: +// +// out1 = map (λ x, ⌊((eval arg1 mod m) mod 2^(8 * (x + 1))) / 2^(8 * x)⌋) [0..31] +// +// Input Bounds: +// +// arg1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x1fffffffffffffff]] +// +// Output Bounds: +// +// out1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x1f]] +func fiatScalarToBytes(out1 *[32]uint8, arg1 *[4]uint64) { + x1 := arg1[3] + x2 := arg1[2] + x3 := arg1[1] + x4 := arg1[0] + x5 := (uint8(x4) & 0xff) + x6 := (x4 >> 8) + x7 := (uint8(x6) & 0xff) + x8 := (x6 >> 8) + x9 := (uint8(x8) & 0xff) + x10 := (x8 >> 8) + x11 := (uint8(x10) & 0xff) + x12 := (x10 >> 8) + x13 := (uint8(x12) & 0xff) + x14 := (x12 >> 8) + x15 := (uint8(x14) & 0xff) + x16 := (x14 >> 8) + x17 := (uint8(x16) & 0xff) + x18 := uint8((x16 >> 8)) + x19 := (uint8(x3) & 0xff) + x20 := (x3 >> 8) + x21 := (uint8(x20) & 0xff) + x22 := (x20 >> 8) + x23 := (uint8(x22) & 0xff) + x24 := (x22 >> 8) + x25 := (uint8(x24) & 0xff) + x26 := (x24 >> 8) + x27 := (uint8(x26) & 0xff) + x28 := (x26 >> 8) + x29 := (uint8(x28) & 0xff) + x30 := (x28 >> 8) + x31 := (uint8(x30) & 0xff) + x32 := uint8((x30 >> 8)) + x33 := (uint8(x2) & 0xff) + x34 := (x2 >> 8) + x35 := (uint8(x34) & 0xff) + x36 := (x34 >> 8) + x37 := (uint8(x36) & 0xff) + x38 := (x36 >> 8) + x39 := (uint8(x38) & 0xff) + x40 := (x38 >> 8) + x41 := (uint8(x40) & 0xff) + x42 := (x40 >> 8) + x43 := (uint8(x42) & 0xff) + x44 := (x42 >> 8) + x45 := (uint8(x44) & 0xff) + x46 := uint8((x44 >> 8)) + x47 := (uint8(x1) & 0xff) + x48 := (x1 >> 8) + x49 := (uint8(x48) & 0xff) + x50 := (x48 >> 8) + x51 := (uint8(x50) & 0xff) + x52 := (x50 >> 8) + x53 := (uint8(x52) & 0xff) + x54 := (x52 >> 8) + x55 := (uint8(x54) & 0xff) + x56 := (x54 >> 8) + x57 := (uint8(x56) & 0xff) + x58 := (x56 >> 8) + x59 := (uint8(x58) & 0xff) + x60 := uint8((x58 >> 8)) + out1[0] = x5 + out1[1] = x7 + out1[2] = x9 + out1[3] = x11 + out1[4] = x13 + out1[5] = x15 + out1[6] = x17 + out1[7] = x18 + out1[8] = x19 + out1[9] = x21 + out1[10] = x23 + out1[11] = x25 + out1[12] = x27 + out1[13] = x29 + out1[14] = x31 + out1[15] = x32 + out1[16] = x33 + out1[17] = x35 + out1[18] = x37 + out1[19] = x39 + out1[20] = x41 + out1[21] = x43 + out1[22] = x45 + out1[23] = x46 + out1[24] = x47 + out1[25] = x49 + out1[26] = x51 + out1[27] = x53 + out1[28] = x55 + out1[29] = x57 + out1[30] = x59 + out1[31] = x60 +} + +// fiatScalarFromBytes deserializes a field element NOT in the Montgomery domain from bytes in little-endian order. +// +// Preconditions: +// +// 0 ≤ bytes_eval arg1 < m +// +// Postconditions: +// +// eval out1 mod m = bytes_eval arg1 mod m +// 0 ≤ eval out1 < m +// +// Input Bounds: +// +// arg1: [[0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0xff], [0x0 ~> 0x1f]] +// +// Output Bounds: +// +// out1: [[0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0xffffffffffffffff], [0x0 ~> 0x1fffffffffffffff]] +func fiatScalarFromBytes(out1 *[4]uint64, arg1 *[32]uint8) { + x1 := (uint64(arg1[31]) << 56) + x2 := (uint64(arg1[30]) << 48) + x3 := (uint64(arg1[29]) << 40) + x4 := (uint64(arg1[28]) << 32) + x5 := (uint64(arg1[27]) << 24) + x6 := (uint64(arg1[26]) << 16) + x7 := (uint64(arg1[25]) << 8) + x8 := arg1[24] + x9 := (uint64(arg1[23]) << 56) + x10 := (uint64(arg1[22]) << 48) + x11 := (uint64(arg1[21]) << 40) + x12 := (uint64(arg1[20]) << 32) + x13 := (uint64(arg1[19]) << 24) + x14 := (uint64(arg1[18]) << 16) + x15 := (uint64(arg1[17]) << 8) + x16 := arg1[16] + x17 := (uint64(arg1[15]) << 56) + x18 := (uint64(arg1[14]) << 48) + x19 := (uint64(arg1[13]) << 40) + x20 := (uint64(arg1[12]) << 32) + x21 := (uint64(arg1[11]) << 24) + x22 := (uint64(arg1[10]) << 16) + x23 := (uint64(arg1[9]) << 8) + x24 := arg1[8] + x25 := (uint64(arg1[7]) << 56) + x26 := (uint64(arg1[6]) << 48) + x27 := (uint64(arg1[5]) << 40) + x28 := (uint64(arg1[4]) << 32) + x29 := (uint64(arg1[3]) << 24) + x30 := (uint64(arg1[2]) << 16) + x31 := (uint64(arg1[1]) << 8) + x32 := arg1[0] + x33 := (x31 + uint64(x32)) + x34 := (x30 + x33) + x35 := (x29 + x34) + x36 := (x28 + x35) + x37 := (x27 + x36) + x38 := (x26 + x37) + x39 := (x25 + x38) + x40 := (x23 + uint64(x24)) + x41 := (x22 + x40) + x42 := (x21 + x41) + x43 := (x20 + x42) + x44 := (x19 + x43) + x45 := (x18 + x44) + x46 := (x17 + x45) + x47 := (x15 + uint64(x16)) + x48 := (x14 + x47) + x49 := (x13 + x48) + x50 := (x12 + x49) + x51 := (x11 + x50) + x52 := (x10 + x51) + x53 := (x9 + x52) + x54 := (x7 + uint64(x8)) + x55 := (x6 + x54) + x56 := (x5 + x55) + x57 := (x4 + x56) + x58 := (x3 + x57) + x59 := (x2 + x58) + x60 := (x1 + x59) + out1[0] = x39 + out1[1] = x46 + out1[2] = x53 + out1[3] = x60 +} diff --git a/vendor/filippo.io/edwards25519/tables.go b/vendor/filippo.io/edwards25519/tables.go index beec956b..83234bbc 100644 --- a/vendor/filippo.io/edwards25519/tables.go +++ b/vendor/filippo.io/edwards25519/tables.go @@ -38,9 +38,9 @@ func (v *projLookupTable) FromP3(q *Point) { tmpP3 := Point{} tmpP1xP1 := projP1xP1{} for i := 0; i < 7; i++ { - // Compute (i+1)*Q as Q + i*Q and convert to a ProjCached + // Compute (i+1)*Q as Q + i*Q and convert to a projCached // This is needlessly complicated because the API has explicit - // recievers instead of creating stack objects and relying on RVO + // receivers instead of creating stack objects and relying on RVO v.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.Add(q, &v.points[i]))) } } @@ -53,7 +53,7 @@ func (v *affineLookupTable) FromP3(q *Point) { tmpP3 := Point{} tmpP1xP1 := projP1xP1{} for i := 0; i < 7; i++ { - // Compute (i+1)*Q as Q + i*Q and convert to AffineCached + // Compute (i+1)*Q as Q + i*Q and convert to affineCached v.points[i+1].FromP3(tmpP3.fromP1xP1(tmpP1xP1.AddAffine(q, &v.points[i]))) } } diff --git a/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/data/VERSION b/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/data/VERSION index 9c78b761..b105b3a9 100644 --- a/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/data/VERSION +++ b/vendor/github.com/camunda/zeebe/clients/go/v8/internal/embedded/data/VERSION @@ -1 +1 @@ -8.3.2 +8.3.4 diff --git a/vendor/github.com/go-faster/errors/README.md b/vendor/github.com/go-faster/errors/README.md index 23675ca2..9f21e134 100644 --- a/vendor/github.com/go-faster/errors/README.md +++ b/vendor/github.com/go-faster/errors/README.md @@ -16,7 +16,7 @@ errors.Wrap(err, "message") * Using `Wrap` is the most explicit way to wrap errors * Wrapping with `fmt.Errorf("foo: %w", err)` is implicit, redundant and error-prone * Parsing `"foo: %w"` is implicit, redundant and slow -* The [pkg/errors](https://github.com/pkg/errors) and [xerrrors](https://pkg.go.dev/golang.org/x/xerrors) are not maintainted +* The [pkg/errors](https://github.com/pkg/errors) and [xerrors](https://pkg.go.dev/golang.org/x/xerrors) are not maintainted * The [cockroachdb/errors](https://github.com/cockroachdb/errors) is too big * The `errors` has no caller stack trace diff --git a/vendor/github.com/go-faster/errors/join.go b/vendor/github.com/go-faster/errors/join.go deleted file mode 100644 index d1c2a532..00000000 --- a/vendor/github.com/go-faster/errors/join.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build !go1.20 -// +build !go1.20 - -package errors - -import "unsafe" - -// Join returns an error that wraps the given errors. -// Any nil error values are discarded. -// Join returns nil if every value in errs is nil. -// The error formats as the concatenation of the strings obtained -// by calling the Error method of each element of errs, with a newline -// between each string. -// -// A non-nil error returned by Join implements the Unwrap() []error method. -func Join(errs ...error) error { - n := 0 - for _, err := range errs { - if err != nil { - n++ - } - } - if n == 0 { - return nil - } - e := &joinError{ - errs: make([]error, 0, n), - } - for _, err := range errs { - if err != nil { - e.errs = append(e.errs, err) - } - } - return e -} - -type joinError struct { - errs []error -} - -func (e *joinError) Error() string { - // Since Join returns nil if every value in errs is nil, - // e.errs cannot be empty. - if len(e.errs) == 1 { - return e.errs[0].Error() - } - - b := []byte(e.errs[0].Error()) - for _, err := range e.errs[1:] { - b = append(b, '\n') - b = append(b, err.Error()...) - } - // At this point, b has at least one byte '\n'. - return unsafe.String(&b[0], len(b)) -} - -func (e *joinError) Unwrap() []error { - return e.errs -} diff --git a/vendor/github.com/go-faster/errors/join_go120.go b/vendor/github.com/go-faster/errors/join_go120.go index ecf930c3..575d6202 100644 --- a/vendor/github.com/go-faster/errors/join_go120.go +++ b/vendor/github.com/go-faster/errors/join_go120.go @@ -5,4 +5,16 @@ package errors import "errors" -var Join = errors.Join +// Join returns an error that wraps the given errors. +// Any nil error values are discarded. +// Join returns nil if every value in errs is nil. +// The error formats as the concatenation of the strings obtained +// by calling the Error method of each element of errs, with a newline +// between each string. +// +// A non-nil error returned by Join implements the Unwrap() []error method. +// +// Available only for go 1.20 or superior. +func Join(errs ...error) error { + return errors.Join(errs...) +} diff --git a/vendor/github.com/golang-module/carbon/v2/README.cn.md b/vendor/github.com/golang-module/carbon/v2/README.cn.md index c6ca938c..4c4ae945 100644 --- a/vendor/github.com/golang-module/carbon/v2/README.cn.md +++ b/vendor/github.com/golang-module/carbon/v2/README.cn.md @@ -4,8 +4,9 @@ [![Go Test](https://github.com/golang-module/carbon/actions/workflows/test.yml/badge.svg)](https://github.com/golang-module/carbon/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/golang-module/carbon/v2)](https://goreportcard.com/report/github.com/golang-module/carbon/v2) [![Go Coverage](https://codecov.io/gh/golang-module/carbon/branch/master/graph/badge.svg)](https://codecov.io/gh/golang-module/carbon) +[![Goproxy.cn](https://goproxy.cn/stats/github.com/golang-module/carbon/badges/download-count.svg)](https://goproxy.cn) [![Carbon Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/golang-module/carbon) -![License](https://img.shields.io/github/license/golang-module/carbon) +[![License](https://img.shields.io/github/license/golang-module/carbon)](https://github.com/golang-module/carbon/blob/master/LICENSE) 简体中文 | [English](README.md) | [日本語](README.jp.md) @@ -143,14 +144,14 @@ carbon.CreateFromDateTimeMicro(2020, 8, 5, 13, 14, 15, 999999).ToString() // 202 // 从年月日时分秒创建 Carbon 实例,包含纳秒 carbon.CreateFromDateTimeNano(2020, 8, 5, 13, 14, 15, 999999999).ToString() // 2020-08-05 13:14:15.999999999 +0800 CST -// 从年月日创建 Carbon 实例(时分秒默认为当前时分秒) -carbon.CreateFromDate(2020, 8, 5).ToString() // // 2020-08-05 13:14:15 +0800 CST -// 从年月日创建 Carbon 实例(时分秒默认为当前时分秒),包含毫秒 -carbon.CreateFromDateMilli(2020, 8, 5, 999).ToString() // 2020-08-05 13:14:15.999 +0800 CST -// 从年月日创建 Carbon 实例(时分秒默认为当前时分秒),包含微秒 -carbon.CreateFromDateMicro(2020, 8, 5, 999999).ToString() // 2020-08-05 13:14:15.999999 +0800 CST -// 从年月日创建 Carbon 实例(时分秒默认为当前时分秒),包含纳秒 -carbon.CreateFromDateNano(2020, 8, 5, 999999999).ToString() // 2020-08-05 13:14:15.999999999 +0800 CST +// 从年月日创建 Carbon 实例 +carbon.CreateFromDate(2020, 8, 5).ToString() // // 2020-08-05 00:00:00 +0800 CST +// 从年月日创建 Carbon 实例,包含毫秒 +carbon.CreateFromDateMilli(2020, 8, 5, 999).ToString() // 2020-08-05 00:00:00.999 +0800 CST +// 从年月日创建 Carbon 实例,包含微秒 +carbon.CreateFromDateMicro(2020, 8, 5, 999999).ToString() // 2020-08-05 00:00:00.999999 +0800 CST +// 从年月日创建 Carbon 实例,包含纳秒 +carbon.CreateFromDateNano(2020, 8, 5, 999999999).ToString() // 2020-08-05 00:00:00.999999999 +0800 CST // 从时分秒创建 Carbon 实例(年月日默认为当前年月日) carbon.CreateFromTime(13, 14, 15).ToString() // 2020-08-05 13:14:15 +0800 CST @@ -1024,8 +1025,8 @@ carbon.Parse("2020-08-05 13:14:15.999999999").ToShortTimeMicroString() // 131415 // 输出简写时间字符串,包含纳秒 carbon.Parse("2020-08-05 13:14:15.999999999").ToShortTimeNanoString() // 131415.999999999 -// 输出 ANSIC 格式字符串 -carbon.Parse("2020-08-05 13:14:15").ToANSICString() // Wed Aug 5 13:14:15 2020 +// 输出 Ansic 格式字符串 +carbon.Parse("2020-08-05 13:14:15").ToAnsicString() // Wed Aug 5 13:14:15 2020 // 输出 Atom 格式字符串 carbon.Parse("2020-08-05 13:14:15").ToAtomString() // 2020-08-05T13:14:15+08:00 // 输出 UnixDate 格式字符串 @@ -1251,7 +1252,7 @@ carbon.Parse("2020-03-21 19:00:00").Lunar().IsEleventhDoubleHour() // true carbon.Parse("2020-03-21 21:00:00").Lunar().IsTwelfthDoubleHour() // true ``` -##### JSON 支持 +##### JSON ###### 定义模型 @@ -1259,104 +1260,57 @@ carbon.Parse("2020-03-21 21:00:00").Lunar().IsTwelfthDoubleHour() // true type Person struct { Name string `json:"name"` Age int `json:"age"` - Birthday1 carbon.DateTime `json:"birthday"` - Birthday2 carbon.DateTimeMilli `json:"birthday"` - Birthday3 carbon.DateTimeMicro `json:"birthday"` - Birthday4 carbon.DateTimeNano `json:"birthday"` - GraduatedAt1 carbon.Date `json:"graduated_at"` - GraduatedAt2 carbon.DateMilli `json:"graduated_at"` - GraduatedAt3 carbon.DateMicro `json:"graduated_at"` - GraduatedAt4 carbon.DateNano `json:"graduated_at"` - OperatedAt1 carbon.Time `json:"operated_at1"` - OperatedAt2 carbon.TimeMilli `json:"operated_at2"` - OperatedAt3 carbon.TimeMicro `json:"operated_at3"` - OperatedAt4 carbon.TimeNano `json:"operated_at4"` - CreatedAt1 carbon.Timestamp `json:"created_at1"` - CreatedAt2 carbon.TimestampMilli `json:"created_at2"` - CreatedAt3 carbon.TimestampMicro `json:"created_at3"` - CreatedAt4 carbon.TimestampNano `json:"created_at4"` -} -``` - -###### 实例化模型 - -```go -person := Person { - Name: "gouguoyin", - Age: 18, - Birthday1: carbon.DateTime{carbon.Now().SubYears(18)}, - Birthday2: carbon.DateTimeMilli{carbon.Now().SubYears(18)}, - Birthday3: carbon.DateTimeMicro{carbon.Now().SubYears(18)}, - Birthday4: carbon.DateTimeNano{carbon.Now().SubYears(18)}, - GraduatedAt1: carbon.Date{carbon.Now()}, - GraduatedAt2: carbon.DateMilli{carbon.Now()}, - GraduatedAt3: carbon.DateMicro{carbon.Now()}, - GraduatedAt4: carbon.DateNano{carbon.Now()}, - OperatedAt1: carbon.Time{carbon.Now()}, - OperatedAt2: carbon.TimeMilli{carbon.Now()}, - OperatedAt3: carbon.TimeMicro{carbon.Now()}, - OperatedAt4: carbon.TimeNano{carbon.Now()}, - CreatedAt1: carbon.Timestamp{carbon.Now()}, - CreatedAt2: carbon.TimestampMilli{carbon.Now()}, - CreatedAt3: carbon.TimestampMicro{carbon.Now()}, - CreatedAt4: carbon.TimestampNano{carbon.Now()}, + Birthday carbon.Carbon `json:"birthday" carbon:"layout:2006-01-02"` + GraduatedAt carbon.Carbon `json:"graduated_at" carbon:"layout:15:04:05"` + CreatedAt carbon.Carbon `json:"created_at" carbon:"layout:2006-01-02 15:04:05"` } ``` 或 ```go +type Person struct { + Name string `json:"name"` + Age int `json:"age"` + Birthday carbon.Carbon `json:"birthday" carbon:"format:Y-m-d"` + GraduatedAt carbon.Carbon `json:"graduated_at" carbon:"format:H:i:s"` + CreatedAt carbon.Carbon `json:"created_at" carbon:"format:Y-m-d H:i:s"` +} +``` +###### 实例化模型 + +```go +now := Parse("2020-08-05 13:14:15", PRC) person := Person { Name: "gouguoyin", - Age: 18, - Birthday1: carbon.Now().SubYears(18).ToDateTimeStruct(), - Birthday2: carbon.Now().SubYears(18).ToDateTimeMilliStruct(), - Birthday3: carbon.Now().SubYears(18).ToDateTimeMicroStruct(), - Birthday4: carbon.Now().SubYears(18).ToDateTimeNanoStruct(), - GraduatedAt1: carbon.Now().ToDateStruct(), - GraduatedAt2: carbon.Now().ToDateMilliStruct(), - GraduatedAt3: carbon.Now().ToDateMicroStruct(), - GraduatedAt4: carbon.Now().ToDateNanoStruct(), - OperatedAt1: carbon.Now().ToTimeStruct(), - OperatedAt2: carbon.Now().ToTimeMilliStruct(), - OperatedAt3: carbon.Now().ToTimeMicroStruct(), - OperatedAt4: carbon.Now().ToTimeNanoStruct(), - CreatedAt1: carbon.Now().ToTimestampStruct(), - CreatedAt2: carbon.Now().ToTimestampMilliStruct(), - CreatedAt3: carbon.Now().ToTimestampMicroStruct(), - CreatedAt4: carbon.Now().ToTimestampNanoStruct(), + Age: 18, + Birthday: now, + GraduatedAt: now, + CreatedAt: now, } ``` ###### JSON 编码 ```go -data, err := json.Marshal(&person) -if err != nil { +err1 := carbon.LoadTag(&person) +if err1 != nil { // 错误处理 - log.Fatal(err) + log.Fatal(err1) +} +data, err2 := json.Marshal(person) +if err2 != nil { + // 错误处理 + log.Fatal(err2) } fmt.Printf("%s", data) // 输出 { "name": "gouguoyin", "age": 18, - "birthday1": "2003-07-16 16:22:02", - "birthday2": "2003-07-16 16:22:02.999", - "birthday3": "2003-07-16 16:22:02.999999", - "birthday4": "2003-07-16 16:22:02.999999999", - "graduated_at1": "2020-08-05", - "graduated_at2": "2020-08-05.999", - "graduated_at3": "2020-08-05.999999", - "graduated_at4": "2020-08-05.999999999", - "operated_at1": "13:14:15", - "operated_at2": "13:14:15.999", - "operated_at3": "13:14:15.999999", - "operated_at4": "13:14:15.999999999", - "created_at1": 1596604455, - "created_at2": 1596604455999, - "created_at3": 1596604455999999, - "created_at4": 1596604455999999999 + "birthday": "2020-08-05", + "graduated_at": "13:14:15", + "created_at": "2020-08-05 13:14:15" } ``` @@ -1366,57 +1320,30 @@ fmt.Printf("%s", data) str := `{ "name": "gouguoyin", "age": 18, - "birthday1": "2003-07-16 16:22:02", - "birthday2": "2003-07-16 16:22:02.999", - "birthday3": "2003-07-16 16:22:02.999999", - "birthday4": "2003-07-16 16:22:02.999999999", - "graduated_at1": "2020-08-05", - "graduated_at2": "2020-08-05.999", - "graduated_at3": "2020-08-05.999999", - "graduated_at4": "2020-08-05.999999999", - "operated_at1": "13:14:15", - "operated_at2": "13:14:15.999", - "operated_at3": "13:14:15.999999", - "operated_at4": "13:14:15.999999999", - "created_at1": 1596604455, - "created_at2": 1596604455999, - "created_at3": 1596604455999999, - "created_at4": 1596604455999999999 + "birthday": "2020-08-05", + "graduated_at": "13:14:15", + "created_at": "2020-08-05 13:14:15" }` -person := new(Person) -err := json.Unmarshal([]byte(str), &person) -if err != nil { +var person Person + +err1 := carbon.LoadTag(&person) +if err1 != nil { // 错误处理 - log.Fatal(err) + log.Fatal(err1) } -person.Birthday1.String() // 2002-08-05 13:14:15 -person.Birthday2.String() // 2002-08-05 13:14:15.999 -person.Birthday3.String() // 2002-08-05 13:14:15.999999 -person.Birthday4.String() // 2002-08-05 13:14:15.999999999 +err2 := json.Unmarshal([]byte(str), &person) +if err2 != nil { + // 错误处理 + log.Fatal(err2) +} -person.GraduatedAt1.String() // 2020-08-05 -person.GraduatedAt2.String() // 2020-08-05.999 -person.GraduatedAt3.String() // 2020-08-05.999999 -person.GraduatedAt4.String() // 2020-08-05.999999999 - -person.OperatedAt1.String() // 13:14:15 -person.OperatedAt2.String() // 13:14:15.999 -person.OperatedAt3.String() // 13:14:15.999999 -person.OperatedAt4.String() // 13:14:15.999999999 - -person.CreatedAt1.String() // "1691212455" -person.CreatedAt2.String() // "1722834855999" -person.CreatedAt3.String() // "1754370855999999" -person.CreatedAt4.String() // "1754370855999999999" - -person.CreatedAt1.Int64() // 1691212455 -person.CreatedAt2.Int64() // 1722834855999 -person.CreatedAt3.Int64() // 1754370855999999 -person.CreatedAt4.Int64() // 1754370855999999999 +fmt.Sprintf("%s", person.Birthday) // 2002-08-05 +fmt.Sprintf("%s", person.GraduatedAt) // 13:14:15 +fmt.Sprintf("%s", person.CreatedAt) // 2002-08-05 13:14:15 ``` -##### 国际化支持 +##### 国际化 目前支持的语言有 diff --git a/vendor/github.com/golang-module/carbon/v2/README.jp.md b/vendor/github.com/golang-module/carbon/v2/README.jp.md index cd2532b5..43afd6aa 100644 --- a/vendor/github.com/golang-module/carbon/v2/README.jp.md +++ b/vendor/github.com/golang-module/carbon/v2/README.jp.md @@ -4,8 +4,9 @@ [![Go Test](https://github.com/golang-module/carbon/actions/workflows/test.yml/badge.svg)](https://github.com/golang-module/carbon/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/golang-module/carbon/v2)](https://goreportcard.com/report/github.com/golang-module/carbon/v2) [![Go Coverage](https://codecov.io/gh/golang-module/carbon/branch/master/graph/badge.svg)](https://codecov.io/gh/golang-module/carbon) +[![Goproxy.cn](https://goproxy.cn/stats/github.com/golang-module/carbon/badges/download-count.svg)](https://goproxy.cn) [![Carbon Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/golang-module/carbon) -![License](https://img.shields.io/github/license/golang-module/carbon) +[![License](https://img.shields.io/github/license/golang-module/carbon)](https://github.com/golang-module/carbon/blob/master/LICENSE) 日本語 | [English](README.md) | [简体中文](README.cn.md) @@ -147,14 +148,14 @@ carbon.CreateFromDateTimeMicro(2020, 1, 1, 13, 14, 15, 999999).ToString() // 202 // 年月日から分秒で Carbon オブジェクトを作成します,ナノ秒を含む carbon.CreateFromDateTimeNano(2020, 1, 1, 13, 14, 15, 999999999).ToString() // 2020-01-01 13:14:15.999999999 +0800 CST -// 年月日から Carbon オブジェクトを作成します(時分秒はデフォルトで現在の時分秒です) -carbon.CreateFromDate(2020, 8, 5).ToString() // // 2020-08-05 13:14:15 +0800 CST -// 年月日から Carbon オブジェクトを作成します(時分秒はデフォルトで現在の時分秒です),ミリ秒を含む -carbon.CreateFromDateMilli(2020, 8, 5, 999).ToString() // 2020-08-05 13:14:15.999 +0800 CST -// 年月日から Carbon オブジェクトを作成します(時分秒はデフォルトで現在の時分秒です),マイクロ秒を含む -carbon.CreateFromDateMicro(2020, 8, 5, 999999).ToString() // 2020-08-05 13:14:15.999999 +0800 CST -// 年月日から Carbon オブジェクトを作成します(時分秒はデフォルトで現在の時分秒です),ナノ秒を含む -carbon.CreateFromDateNano(2020, 8, 5, 999999999).ToString() // 2020-08-05 13:14:15.999999999 +0800 CST +// 年月日から Carbon オブジェクトを作成します +carbon.CreateFromDate(2020, 8, 5).ToString() // // 2020-08-05 00:00:00 +0800 CST +// 年月日から Carbon オブジェクトを作成します,ミリ秒を含む +carbon.CreateFromDateMilli(2020, 8, 5, 999).ToString() // 2020-08-05 00:00:00.999 +0800 CST +// 年月日から Carbon オブジェクトを作成します,マイクロ秒を含む +carbon.CreateFromDateMicro(2020, 8, 5, 999999).ToString() // 2020-08-05 00:00:00.999999 +0800 CST +// 年月日から Carbon オブジェクトを作成します,ナノ秒を含む +carbon.CreateFromDateNano(2020, 8, 5, 999999999).ToString() // 2020-08-05 00:00:00.999999999 +0800 CST // 時分秒から Carbon オブジェクトを作成します(年月日のデフォルトは現在の年月日です) carbon.CreateFromTime(13, 14, 15).ToString() // 2020-08-05 13:14:15 +0800 CST @@ -1024,8 +1025,8 @@ carbon.Parse("2020-08-05 13:14:15.999999999").ToShortTimeMicroString() // 131415 // 略語時間文字列を出力,ナノ秒を含む carbon.Parse("2020-08-05 13:14:15.999999999").ToShortTimeNanoString() // 131415.999999999 -// ANSIC フォーマット文字列を出力 -carbon.Parse("2020-08-05 13:14:15").ToANSICString() // Wed Aug 5 13:14:15 2020 +// Ansic フォーマット文字列を出力 +carbon.Parse("2020-08-05 13:14:15").ToAnsicString() // Wed Aug 5 13:14:15 2020 // Atom フォーマット文字列を出力 carbon.Parse("2020-08-05 13:14:15").ToAtomString() // 2020-08-05T13:14:15+08:00 // UnixDate フォーマット文字列を出力 @@ -1251,7 +1252,7 @@ carbon.Parse("2020-03-21 19:00:00").Lunar().IsEleventhDoubleHour() // true carbon.Parse("2020-03-21 21:00:00").Lunar().IsTwelfthDoubleHour() // true ``` -##### JSON 処理 +##### JSON ###### 定義モデル @@ -1259,104 +1260,57 @@ carbon.Parse("2020-03-21 21:00:00").Lunar().IsTwelfthDoubleHour() // true type Person struct { Name string `json:"name"` Age int `json:"age"` - Birthday1 carbon.DateTime `json:"birthday"` - Birthday2 carbon.DateTimeMilli `json:"birthday"` - Birthday3 carbon.DateTimeMicro `json:"birthday"` - Birthday4 carbon.DateTimeNano `json:"birthday"` - GraduatedAt1 carbon.Date `json:"graduated_at"` - GraduatedAt2 carbon.DateMilli `json:"graduated_at"` - GraduatedAt3 carbon.DateMicro `json:"graduated_at"` - GraduatedAt4 carbon.DateNano `json:"graduated_at"` - OperatedAt1 carbon.Time `json:"operated_at1"` - OperatedAt2 carbon.TimeMilli `json:"operated_at2"` - OperatedAt3 carbon.TimeMicro `json:"operated_at3"` - OperatedAt4 carbon.TimeNano `json:"operated_at4"` - CreatedAt1 carbon.Timestamp `json:"created_at1"` - CreatedAt2 carbon.TimestampMilli `json:"created_at2"` - CreatedAt3 carbon.TimestampMicro `json:"created_at3"` - CreatedAt4 carbon.TimestampNano `json:"created_at4"` -} -``` - -###### 初期化モデル -```go -person := Person { - Name: "gouguoyin", - Age: 18, - Birthday1: carbon.DateTime{carbon.Now().SubYears(18)}, - Birthday2: carbon.DateTimeMilli{carbon.Now().SubYears(18)}, - Birthday3: carbon.DateTimeMicro{carbon.Now().SubYears(18)}, - Birthday4: carbon.DateTimeNano{carbon.Now().SubYears(18)}, - GraduatedAt1: carbon.Date{carbon.Now()}, - GraduatedAt2: carbon.DateMilli{carbon.Now()}, - GraduatedAt3: carbon.DateMicro{carbon.Now()}, - GraduatedAt4: carbon.DateNano{carbon.Now()}, - OperatedAt1: carbon.Time{carbon.Now()}, - OperatedAt2: carbon.TimeMilli{carbon.Now()}, - OperatedAt3: carbon.TimeMicro{carbon.Now()}, - OperatedAt4: carbon.TimeNano{carbon.Now()}, - CreatedAt1: carbon.Timestamp{carbon.Now()}, - CreatedAt2: carbon.TimestampMilli{carbon.Now()}, - CreatedAt3: carbon.TimestampMicro{carbon.Now()}, - CreatedAt4: carbon.TimestampNano{carbon.Now()}, + Birthday carbon.Carbon `json:"birthday" carbon:"layout:2006-01-02"` + GraduatedAt carbon.Carbon `json:"graduated_at" carbon:"layout:15:04:05"` + CreatedAt carbon.Carbon `json:"created_at" carbon:"layout:2006-01-02 15:04:05"` } ``` または ```go +type Person struct { + Name string `json:"name"` + Age int `json:"age"` + Birthday carbon.Carbon `json:"birthday" carbon:"format:Y-m-d"` + GraduatedAt carbon.Carbon `json:"graduated_at" carbon:"format:H:i:s"` + CreatedAt carbon.Carbon `json:"created_at" carbon:"format:Y-m-d H:i:s"` +} +``` + +###### 初期化モデル +```go +now := Parse("2020-08-05 13:14:15", PRC) person := Person { Name: "gouguoyin", - Age: 18, - Birthday1: carbon.Now().SubYears(18).ToDateTimeStruct(), - Birthday2: carbon.Now().SubYears(18).ToDateTimeMilliStruct(), - Birthday3: carbon.Now().SubYears(18).ToDateTimeMicroStruct(), - Birthday4: carbon.Now().SubYears(18).ToDateTimeNanoStruct(), - GraduatedAt1: carbon.Now().ToDateStruct(), - GraduatedAt2: carbon.Now().ToDateMilliStruct(), - GraduatedAt3: carbon.Now().ToDateMicroStruct(), - GraduatedAt4: carbon.Now().ToDateNanoStruct(), - OperatedAt1: carbon.Now().ToTimeStruct(), - OperatedAt2: carbon.Now().ToTimeMilliStruct(), - OperatedAt3: carbon.Now().ToTimeMicroStruct(), - OperatedAt4: carbon.Now().ToTimeNanoStruct(), - CreatedAt1: carbon.Now().ToTimestampStruct(), - CreatedAt2: carbon.Now().ToTimestampMilliStruct(), - CreatedAt3: carbon.Now().ToTimestampMicroStruct(), - CreatedAt4: carbon.Now().ToTimestampNanoStruct(), + Age: 18, + Birthday: now, + GraduatedAt: now, + CreatedAt: now, } - ``` ###### JSON コーディング ```go -data, err := json.Marshal(&person) -if err != nil { +err1 := carbon.LoadTag(&person) +if err1 != nil { // エラー処理... - log.Fatal(c.Error) + log.Fatal(err1) +} +data, err2 := json.Marshal(person) +if err2 != nil { + // エラー処理... + log.Fatal(err2) } fmt.Printf("%s", data) // 出力 { "name": "gouguoyin", "age": 18, - "birthday1": "2003-07-16 16:22:02", - "birthday2": "2003-07-16 16:22:02.999", - "birthday3": "2003-07-16 16:22:02.999999", - "birthday4": "2003-07-16 16:22:02.999999999", - "graduated_at1": "2020-08-05", - "graduated_at2": "2020-08-05.999", - "graduated_at3": "2020-08-05.999999", - "graduated_at4": "2020-08-05.999999999", - "operated_at1": "13:14:15", - "operated_at2": "13:14:15.999", - "operated_at3": "13:14:15.999999", - "operated_at4": "13:14:15.999999999", - "created_at1": 1596604455, - "created_at2": 1596604455999, - "created_at3": 1596604455999999, - "created_at4": 1596604455999999999 + "birthday": "2020-08-05", + "graduated_at": "13:14:15", + "created_at": "2020-08-05 13:14:15" } ``` @@ -1366,52 +1320,30 @@ fmt.Printf("%s", data) str := `{ "name": "gouguoyin", "age": 18, - "birthday1": "2003-07-16 16:22:02", - "birthday2": "2003-07-16 16:22:02.999", - "birthday3": "2003-07-16 16:22:02.999999", - "birthday4": "2003-07-16 16:22:02.999999999", - "graduated_at1": "2020-08-05", - "graduated_at2": "2020-08-05.999", - "graduated_at3": "2020-08-05.999999", - "graduated_at4": "2020-08-05.999999999", - "operated_at1": "13:14:15", - "operated_at2": "13:14:15.999", - "operated_at3": "13:14:15.999999", - "operated_at4": "13:14:15.999999999", - "created_at1": 1596604455, - "created_at2": 1596604455999, - "created_at3": 1596604455999999, - "created_at4": 1596604455999999999 + "birthday": "2020-08-05", + "graduated_at": "13:14:15", + "created_at": "2020-08-05 13:14:15" }` -person := new(Person) -err := json.Unmarshal([]byte(str), &person) -if err != nil { +var person Person + +err1 := carbon.LoadTag(&person) +if err1 != nil { // エラー処理... - log.Fatal(c.Error) + log.Fatal(err1) } -person.Birthday1.String() // 2002-08-05 13:14:15 -person.Birthday2.String() // 2002-08-05 13:14:15.999 -person.Birthday3.String() // 2002-08-05 13:14:15.999999 -person.Birthday4.String() // 2002-08-05 13:14:15.999999999 +err2 := json.Unmarshal([]byte(str), &person) +if err2 != nil { + // エラー処理... + log.Fatal(err2) +} -person.GraduatedAt1.String() // 2020-08-05 -person.GraduatedAt2.String() // 2020-08-05.999 -person.GraduatedAt3.String() // 2020-08-05.999999 -person.GraduatedAt4.String() // 2020-08-05.999999999 - -person.CreatedAt1.String() // "1691212455" -person.CreatedAt2.String() // "1722834855999" -person.CreatedAt3.String() // "1754370855999999" -person.CreatedAt4.String() // "1754370855999999999" - -person.CreatedAt1.Int64() // 1691212455 -person.CreatedAt2.Int64() // 1722834855999 -person.CreatedAt3.Int64() // 1754370855999999 -person.CreatedAt4.Int64() // 1754370855999999999 +fmt.Sprintf("%s", person.Birthday) // 2002-08-05 +fmt.Sprintf("%s", person.GraduatedAt) // 13:14:15 +fmt.Sprintf("%s", person.CreatedAt) // 2002-08-05 13:14:15 ``` -##### 国際化サポート +##### 国際化 現在サポートされている言語 diff --git a/vendor/github.com/golang-module/carbon/v2/README.md b/vendor/github.com/golang-module/carbon/v2/README.md index 2f7e5fcf..20d3f4b8 100644 --- a/vendor/github.com/golang-module/carbon/v2/README.md +++ b/vendor/github.com/golang-module/carbon/v2/README.md @@ -4,8 +4,9 @@ [![Go Test](https://github.com/golang-module/carbon/actions/workflows/test.yml/badge.svg)](https://github.com/golang-module/carbon/actions) [![Go Report Card](https://goreportcard.com/badge/github.com/golang-module/carbon/v2)](https://goreportcard.com/report/github.com/golang-module/carbon/v2) [![Go Coverage](https://codecov.io/gh/golang-module/carbon/branch/master/graph/badge.svg)](https://codecov.io/gh/golang-module/carbon) +[![Goproxy.cn](https://goproxy.cn/stats/github.com/golang-module/carbon/badges/download-count.svg)](https://goproxy.cn) [![Carbon Doc](https://img.shields.io/badge/go.dev-reference-brightgreen?logo=go&logoColor=white&style=flat)](https://pkg.go.dev/github.com/golang-module/carbon) -![License](https://img.shields.io/github/license/golang-module/carbon) +[![License](https://img.shields.io/github/license/golang-module/carbon)](https://github.com/golang-module/carbon/blob/master/LICENSE) English | [简体中文](README.cn.md) | [日本語](README.jp.md) @@ -147,13 +148,13 @@ carbon.CreateFromDateTimeMicro(2020, 8, 5, 13, 14, 15, 999999).ToString() // 202 carbon.CreateFromDateTimeNano(2020, 8, 5, 13, 14, 15, 999999999).ToString() // 2020-08-05 13:14:15.999999999 +0800 CST // Create a Carbon instance from a given year, month and day -carbon.CreateFromDate(2020, 8, 5).ToString() // // 2020-08-05 13:14:15 +0800 CST +carbon.CreateFromDate(2020, 8, 5).ToString() // // 2020-08-05 00:00:00 +0800 CST // Create a Carbon instance from a given year, month and day with millisecond -carbon.CreateFromDateMilli(2020, 8, 5, 999).ToString() // 2020-08-05 13:14:15.999 +0800 CST +carbon.CreateFromDateMilli(2020, 8, 5, 999).ToString() // 2020-08-05 00:00:00.999 +0800 CST // Create a Carbon instance from a given year, month and day with microsecond -carbon.CreateFromDateMicro(2020, 8, 5, 999999).ToString() // 2020-08-05 13:14:15.999999 +0800 CST +carbon.CreateFromDateMicro(2020, 8, 5, 999999).ToString() // 2020-08-05 00:00:00.999999 +0800 CST // Create a Carbon instance from a given year, month and day with nanosecond -carbon.CreateFromDateNano(2020, 8, 5, 999999999).ToString() // 2020-08-05 13:14:15.999999999 +0800 CST +carbon.CreateFromDateNano(2020, 8, 5, 999999999).ToString() // 2020-08-05 00:00:00.999999999 +0800 CST // Create a Carbon instance from a given hour, minute and second carbon.CreateFromTime(13, 14, 15).ToString() // 2020-08-05 13:14:15 +0800 CST @@ -1019,8 +1020,8 @@ carbon.Parse("2020-08-05 13:14:15.999999999").ToShortTimeMicroString() // 131415 // Output short time with nanosecond format string carbon.Parse("2020-08-05 13:14:15.999999999").ToShortTimeNanoString() // 131415.999999999 -// Output ANSIC format string -carbon.Parse("2020-08-05 13:14:15").ToANSICString() // Wed Aug 5 13:14:15 2020 +// Output Ansic format string +carbon.Parse("2020-08-05 13:14:15").ToAnsicString() // Wed Aug 5 13:14:15 2020 // Output Atom format string carbon.Parse("2020-08-05 13:14:15").ToAtomString() // 2020-08-05T13:14:15+08:00 // Output Unix date format string @@ -1252,106 +1253,59 @@ carbon.Parse("2020-03-21 21:00:00").Lunar().IsTwelfthDoubleHour() // true ```go type Person struct { - Name string `json:"name"` - Age int `json:"age"` - Birthday1 carbon.DateTime `json:"birthday"` - Birthday2 carbon.DateTimeMilli `json:"birthday"` - Birthday3 carbon.DateTimeMicro `json:"birthday"` - Birthday4 carbon.DateTimeNano `json:"birthday"` - GraduatedAt1 carbon.Date `json:"graduated_at"` - GraduatedAt2 carbon.DateMilli `json:"graduated_at"` - GraduatedAt3 carbon.DateMicro `json:"graduated_at"` - GraduatedAt4 carbon.DateNano `json:"graduated_at"` - OperatedAt1 carbon.Time `json:"operated_at1"` - OperatedAt2 carbon.TimeMilli `json:"operated_at2"` - OperatedAt3 carbon.TimeMicro `json:"operated_at3"` - OperatedAt4 carbon.TimeNano `json:"operated_at4"` - CreatedAt1 carbon.Timestamp `json:"created_at1"` - CreatedAt2 carbon.TimestampMilli `json:"created_at2"` - CreatedAt3 carbon.TimestampMicro `json:"created_at3"` - CreatedAt4 carbon.TimestampNano `json:"created_at4"` -} -``` - -###### Instantiate model -```go -person := Person { - Name: "gouguoyin", - Age: 18, - Birthday1: carbon.DateTime{carbon.Now().SubYears(18)}, - Birthday2: carbon.DateTimeMilli{carbon.Now().SubYears(18)}, - Birthday3: carbon.DateTimeMicro{carbon.Now().SubYears(18)}, - Birthday4: carbon.DateTimeNano{carbon.Now().SubYears(18)}, - GraduatedAt1: carbon.Date{carbon.Now()}, - GraduatedAt2: carbon.DateMilli{carbon.Now()}, - GraduatedAt3: carbon.DateMicro{carbon.Now()}, - GraduatedAt4: carbon.DateNano{carbon.Now()}, - OperatedAt1: carbon.Time{carbon.Now()}, - OperatedAt2: carbon.TimeMilli{carbon.Now()}, - OperatedAt3: carbon.TimeMicro{carbon.Now()}, - OperatedAt4: carbon.TimeNano{carbon.Now()}, - CreatedAt1: carbon.Timestamp{carbon.Now()}, - CreatedAt2: carbon.TimestampMilli{carbon.Now()}, - CreatedAt3: carbon.TimestampMicro{carbon.Now()}, - CreatedAt4: carbon.TimestampNano{carbon.Now()}, + Name string `json:"name"` + Age int `json:"age"` + Birthday carbon.Carbon `json:"birthday" carbon:"layout:2006-01-02"` + GraduatedAt carbon.Carbon `json:"graduated_at" carbon:"layout:15:04:05"` + CreatedAt carbon.Carbon `json:"created_at" carbon:"layout:2006-01-02 15:04:05"` } ``` or ```go -person := Person { - Name: "gouguoyin", - Age: 18, - Birthday1: carbon.Now().SubYears(18).ToDateTimeStruct(), - Birthday2: carbon.Now().SubYears(18).ToDateTimeMilliStruct(), - Birthday3: carbon.Now().SubYears(18).ToDateTimeMicroStruct(), - Birthday4: carbon.Now().SubYears(18).ToDateTimeNanoStruct(), - GraduatedAt1: carbon.Now().ToDateStruct(), - GraduatedAt2: carbon.Now().ToDateMilliStruct(), - GraduatedAt3: carbon.Now().ToDateMicroStruct(), - GraduatedAt4: carbon.Now().ToDateNanoStruct(), - OperatedAt1: carbon.Now().ToTimeStruct(), - OperatedAt2: carbon.Now().ToTimeMilliStruct(), - OperatedAt3: carbon.Now().ToTimeMicroStruct(), - OperatedAt4: carbon.Now().ToTimeNanoStruct(), - CreatedAt1: carbon.Now().ToTimestampStruct(), - CreatedAt2: carbon.Now().ToTimestampMilliStruct(), - CreatedAt3: carbon.Now().ToTimestampMicroStruct(), - CreatedAt4: carbon.Now().ToTimestampNanoStruct(), +type Person struct { + Name string `json:"name"` + Age int `json:"age"` + Birthday carbon.Carbon `json:"birthday" carbon:"format:Y-m-d"` + GraduatedAt carbon.Carbon `json:"graduated_at" carbon:"format:H:i:s"` + CreatedAt carbon.Carbon `json:"created_at" carbon:"format:Y-m-d H:i:s"` } +``` +###### Instantiate model +```go +now := Parse("2020-08-05 13:14:15", PRC) +person := Person { + Name: "gouguoyin", + Age: 18, + Birthday: now, + GraduatedAt: now, + CreatedAt: now, +} ``` ###### JSON encode ```go -data, err := json.Marshal(&person) -if err != nil { - // Error handle... - log.Fatal(err) +err1 := carbon.LoadTag(&person) +if err1 != nil { + // Error handle... + log.Fatal(err1) +} +data, err2 := json.Marshal(person) +if err2 != nil { + // Error handle... + log.Fatal(err2) } fmt.Printf("%s", data) // Output { - "name": "gouguoyin", - "age": 18, - "birthday1": "2003-07-16 16:22:02", - "birthday2": "2003-07-16 16:22:02.999", - "birthday3": "2003-07-16 16:22:02.999999", - "birthday4": "2003-07-16 16:22:02.999999999", - "graduated_at1": "2020-08-05", - "graduated_at2": "2020-08-05.999", - "graduated_at3": "2020-08-05.999999", - "graduated_at4": "2020-08-05.999999999", - "operated_at1": "13:14:15", - "operated_at2": "13:14:15.999", - "operated_at3": "13:14:15.999999", - "operated_at4": "13:14:15.999999999", - "created_at1": 1596604455, - "created_at2": 1596604455999, - "created_at3": 1596604455999999, - "created_at4": 1596604455999999999 + "name": "gouguoyin", + "age": 18, + "birthday": "2020-08-05", + "graduated_at": "13:14:15", + "created_at": "2020-08-05 13:14:15" } ``` @@ -1359,56 +1313,29 @@ fmt.Printf("%s", data) ```go str := `{ - "name": "gouguoyin", - "age": 18, - "birthday1": "2003-07-16 16:22:02", - "birthday2": "2003-07-16 16:22:02.999", - "birthday3": "2003-07-16 16:22:02.999999", - "birthday4": "2003-07-16 16:22:02.999999999", - "graduated_at1": "2020-08-05", - "graduated_at2": "2020-08-05.999", - "graduated_at3": "2020-08-05.999999", - "graduated_at4": "2020-08-05.999999999", - "operated_at1": "13:14:15", - "operated_at2": "13:14:15.999", - "operated_at3": "13:14:15.999999", - "operated_at4": "13:14:15.999999999", - "created_at1": 1596604455, - "created_at2": 1596604455999, - "created_at3": 1596604455999999, - "created_at4": 1596604455999999999 + "name": "gouguoyin", + "age": 18, + "birthday": "2020-08-05", + "graduated_at": "13:14:15", + "created_at": "2020-08-05 13:14:15" }` -person := new(Person) -err := json.Unmarshal([]byte(str), &person) -if err != nil { - // Error handle... - log.Fatal(err) +var person Person + +err1 := carbon.LoadTag(&person) +if err1 != nil { + // Error handle... + log.Fatal(err1) } -person.Birthday1.String() // 2002-08-05 13:14:15 -person.Birthday2.String() // 2002-08-05 13:14:15.999 -person.Birthday3.String() // 2002-08-05 13:14:15.999999 -person.Birthday4.String() // 2002-08-05 13:14:15.999999999 +err2 := json.Unmarshal([]byte(str), &person) +if err2 != nil { + // Error handle... + log.Fatal(err2) +} -person.GraduatedAt1.String() // 2020-08-05 -person.GraduatedAt2.String() // 2020-08-05.999 -person.GraduatedAt3.String() // 2020-08-05.999999 -person.GraduatedAt4.String() // 2020-08-05.999999999 - -person.OperatedAt1.String() // 13:14:15 -person.OperatedAt2.String() // 13:14:15.999 -person.OperatedAt3.String() // 13:14:15.999999 -person.OperatedAt4.String() // 13:14:15.999999999 - -person.CreatedAt1.String() // "1691212455" -person.CreatedAt2.String() // "1722834855999" -person.CreatedAt3.String() // "1754370855999999" -person.CreatedAt4.String() // "1754370855999999999" - -person.CreatedAt1.Int64() // 1691212455 -person.CreatedAt2.Int64() // 1722834855999 -person.CreatedAt3.Int64() // 1754370855999999 -person.CreatedAt4.Int64() // 1754370855999999999 +fmt.Sprintf("%s", person.Birthday) // 2002-08-05 +fmt.Sprintf("%s", person.GraduatedAt) // 13:14:15 +fmt.Sprintf("%s", person.CreatedAt) // 2002-08-05 13:14:15 ``` ##### I18n diff --git a/vendor/github.com/golang-module/carbon/v2/carbon.go b/vendor/github.com/golang-module/carbon/v2/carbon.go index 318dd62b..0ae90b0a 100644 --- a/vendor/github.com/golang-module/carbon/v2/carbon.go +++ b/vendor/github.com/golang-module/carbon/v2/carbon.go @@ -14,7 +14,7 @@ import ( // Version current version // 当前版本号 -const Version = "2.2.13" +const Version = "2.3.0" // timezone constants // 时区常量 @@ -127,28 +127,31 @@ const ( // layout constants // 布局模板常量 const ( - ANSICLayout = time.ANSIC - UnixDateLayout = time.UnixDate - RubyDateLayout = time.RubyDate - RFC822Layout = time.RFC822 - RFC822ZLayout = time.RFC822Z - RFC850Layout = time.RFC850 - RFC1123Layout = time.RFC1123 - RFC1123ZLayout = time.RFC1123Z - RssLayout = time.RFC1123Z - KitchenLayout = time.Kitchen - RFC2822Layout = time.RFC1123Z - CookieLayout = "Monday, 02-Jan-2006 15:04:05 MST" - RFC3339Layout = "2006-01-02T15:04:05Z07:00" - RFC3339MilliLayout = "2006-01-02T15:04:05.999Z07:00" - RFC3339MicroLayout = "2006-01-02T15:04:05.999999Z07:00" - RFC3339NanoLayout = "2006-01-02T15:04:05.999999999Z07:00" - ISO8601Layout = "2006-01-02T15:04:05-07:00" - ISO8601MilliLayout = "2006-01-02T15:04:05.999-07:00" - ISO8601MicroLayout = "2006-01-02T15:04:05.999999-07:00" - ISO8601NanoLayout = "2006-01-02T15:04:05.999999999-07:00" - RFC1036Layout = "Mon, 02 Jan 06 15:04:05 -0700" - RFC7231Layout = "Mon, 02 Jan 2006 15:04:05 MST" + ANSICLayout = time.ANSIC + CookieLayout = "Monday, 02-Jan-2006 15:04:05 MST" + KitchenLayout = time.Kitchen + RssLayout = time.RFC1123Z + RubyDateLayout = time.RubyDate + UnixDateLayout = time.UnixDate + + RFC1036Layout = "Mon, 02 Jan 06 15:04:05 -0700" + RFC1123Layout = time.RFC1123 + RFC1123ZLayout = time.RFC1123Z + RFC2822Layout = time.RFC1123Z + RFC3339Layout = "2006-01-02T15:04:05Z07:00" + RFC3339MilliLayout = "2006-01-02T15:04:05.999Z07:00" + RFC3339MicroLayout = "2006-01-02T15:04:05.999999Z07:00" + RFC3339NanoLayout = "2006-01-02T15:04:05.999999999Z07:00" + RFC7231Layout = "Mon, 02 Jan 2006 15:04:05 MST" + RFC822Layout = time.RFC822 + RFC822ZLayout = time.RFC822Z + RFC850Layout = time.RFC850 + + ISO8601Layout = "2006-01-02T15:04:05-07:00" + ISO8601MilliLayout = "2006-01-02T15:04:05.999-07:00" + ISO8601MicroLayout = "2006-01-02T15:04:05.999999-07:00" + ISO8601NanoLayout = "2006-01-02T15:04:05.999999999-07:00" + DayDateTimeLayout = "Mon, Jan 2, 2006 3:04 PM" DateTimeLayout = "2006-01-02 15:04:05" DateTimeMilliLayout = "2006-01-02 15:04:05.999" @@ -158,22 +161,24 @@ const ( ShortDateTimeMilliLayout = "20060102150405.999" ShortDateTimeMicroLayout = "20060102150405.999999" ShortDateTimeNanoLayout = "20060102150405.999999999" - DateLayout = "2006-01-02" - DateMilliLayout = "2006-01-02.999" - DateMicroLayout = "2006-01-02.999999" - DateNanoLayout = "2006-01-02.999999999" - ShortDateLayout = "20060102" - ShortDateMilliLayout = "20060102.999" - ShortDateMicroLayout = "20060102.999999" - ShortDateNanoLayout = "20060102.999999999" - TimeLayout = "15:04:05" - TimeMilliLayout = "15:04:05.999" - TimeMicroLayout = "15:04:05.999999" - TimeNanoLayout = "15:04:05.999999999" - ShortTimeLayout = "150405" - ShortTimeMilliLayout = "150405.999" - ShortTimeMicroLayout = "150405.999999" - ShortTimeNanoLayout = "150405.999999999" + + DateLayout = "2006-01-02" + DateMilliLayout = "2006-01-02.999" + DateMicroLayout = "2006-01-02.999999" + DateNanoLayout = "2006-01-02.999999999" + ShortDateLayout = "20060102" + ShortDateMilliLayout = "20060102.999" + ShortDateMicroLayout = "20060102.999999" + ShortDateNanoLayout = "20060102.999999999" + + TimeLayout = "15:04:05" + TimeMilliLayout = "15:04:05.999" + TimeMicroLayout = "15:04:05.999999" + TimeNanoLayout = "15:04:05.999999999" + ShortTimeLayout = "150405" + ShortTimeMilliLayout = "150405.999" + ShortTimeMicroLayout = "150405.999999" + ShortTimeNanoLayout = "150405.999999999" ) // Carbon defines a Carbon struct. @@ -181,6 +186,7 @@ const ( type Carbon struct { time time.Time testNow int64 // timestamp with nanosecond of test now time + tag string weekStartsAt time.Weekday loc *time.Location lang *Language diff --git a/vendor/github.com/golang-module/carbon/v2/creator.go b/vendor/github.com/golang-module/carbon/v2/creator.go index b492d5be..27eab7f4 100644 --- a/vendor/github.com/golang-module/carbon/v2/creator.go +++ b/vendor/github.com/golang-module/carbon/v2/creator.go @@ -17,7 +17,7 @@ func CreateFromStdTime(tt time.Time) Carbon { // 从给定的秒级时间戳创建 Carbon 实例 func (c Carbon) CreateFromTimestamp(timestamp int64, timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c @@ -36,7 +36,7 @@ func CreateFromTimestamp(timestamp int64, timezone ...string) Carbon { // 从给定的毫秒级时间戳创建 Carbon 实例 func (c Carbon) CreateFromTimestampMilli(timestamp int64, timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c @@ -55,7 +55,7 @@ func CreateFromTimestampMilli(timestamp int64, timezone ...string) Carbon { // 从给定的微秒级时间戳创建 Carbon 实例 func (c Carbon) CreateFromTimestampMicro(timestamp int64, timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c @@ -74,7 +74,7 @@ func CreateFromTimestampMicro(timestamp int64, timezone ...string) Carbon { // 从给定的纳秒级时间戳创建 Carbon 实例 func (c Carbon) CreateFromTimestampNano(timestamp int64, timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c @@ -92,8 +92,7 @@ func CreateFromTimestampNano(timestamp int64, timezone ...string) Carbon { // CreateFromDateTime creates a Carbon instance from a given date and time. // 从给定的年、月、日、时、分、秒创建 Carbon 实例 func (c Carbon) CreateFromDateTime(year, month, day, hour, minute, second int, timezone ...string) Carbon { - now := c.Now(timezone...) - return c.create(year, month, day, hour, minute, second, now.Nanosecond(), timezone...) + return c.create(year, month, day, hour, minute, second, 0, timezone...) } // CreateFromDateTime creates a Carbon instance from a given date and time. @@ -141,9 +140,7 @@ func CreateFromDateTimeNano(year, month, day, hour, minute, second, nanosecond i // CreateFromDate creates a Carbon instance from a given date. // 从给定的年、月、日创建 Carbon 实例 func (c Carbon) CreateFromDate(year, month, day int, timezone ...string) Carbon { - now := c.Now(timezone...) - hour, minute, second := now.Time() - return c.create(year, month, day, hour, minute, second, now.Nanosecond(), timezone...) + return c.create(year, month, day, 0, 0, 0, 0, timezone...) } // CreateFromDate creates a Carbon instance from a given date. @@ -155,9 +152,7 @@ func CreateFromDate(year, month, day int, timezone ...string) Carbon { // CreateFromDateMilli creates a Carbon instance from a given date and millisecond. // 从给定的年、月、日、毫秒创建 Carbon 实例 func (c Carbon) CreateFromDateMilli(year, month, day, millisecond int, timezone ...string) Carbon { - now := c.Now(timezone...) - hour, minute, second := now.Time() - return c.create(year, month, day, hour, minute, second, millisecond*1e6, timezone...) + return c.create(year, month, day, 0, 0, 0, millisecond*1e6, timezone...) } // CreateFromDateMilli creates a Carbon instance from a given date and millisecond. @@ -169,9 +164,7 @@ func CreateFromDateMilli(year, month, day, millisecond int, timezone ...string) // CreateFromDateMicro creates a Carbon instance from a given date and microsecond. // 从给定的年、月、日、微秒创建 Carbon 实例 func (c Carbon) CreateFromDateMicro(year, month, day, microsecond int, timezone ...string) Carbon { - now := c.Now(timezone...) - hour, minute, second := now.Time() - return c.create(year, month, day, hour, minute, second, microsecond*1e3, timezone...) + return c.create(year, month, day, 0, 0, 0, microsecond*1e3, timezone...) } // CreateFromDateMicro creates a Carbon instance from a given date and microsecond. @@ -183,9 +176,7 @@ func CreateFromDateMicro(year, month, day, microsecond int, timezone ...string) // CreateFromDateNano creates a Carbon instance from a given date and nanosecond. // 从给定的年、月、日、纳秒创建 Carbon 实例 func (c Carbon) CreateFromDateNano(year, month, day, nanosecond int, timezone ...string) Carbon { - now := c.Now(timezone...) - hour, minute, second := now.Time() - return c.create(year, month, day, hour, minute, second, nanosecond, timezone...) + return c.create(year, month, day, 0, 0, 0, nanosecond, timezone...) } // CreateFromDateNano creates a Carbon instance from a given date and nanosecond. @@ -194,58 +185,54 @@ func CreateFromDateNano(year, month, day, nanosecond int, timezone ...string) Ca return NewCarbon().CreateFromDateNano(year, month, day, nanosecond, timezone...) } -// CreateFromTime creates a Carbon instance from a given time. -// 从给定的时、分、秒创建 Carbon 实例 +// CreateFromTime creates a Carbon instance from a given time(year, month and day are taken from the current time). +// 从给定的时、分、秒创建 Carbon 实例(年、月、日取自当前时间) func (c Carbon) CreateFromTime(hour, minute, second int, timezone ...string) Carbon { - now := c.Now(timezone...) - year, month, day := now.Date() - return c.create(year, month, day, hour, minute, second, now.Nanosecond(), timezone...) + year, month, day := c.Now(timezone...).Date() + return c.create(year, month, day, hour, minute, second, 0, timezone...) } -// CreateFromTime creates a Carbon instance from a given time. -// 从给定的时、分、秒创建 Carbon 实例 +// CreateFromTime creates a Carbon instance from a given time(year, month and day are taken from the current time). +// 从给定的时、分、秒创建 Carbon 实例(年、月、日取自当前时间) func CreateFromTime(hour, minute, second int, timezone ...string) Carbon { return NewCarbon().CreateFromTime(hour, minute, second, timezone...) } -// CreateFromTimeMilli creates a Carbon instance from a given time and millisecond. -// 从给定的时、分、秒、毫秒创建 Carbon 实例 +// CreateFromTimeMilli creates a Carbon instance from a given time and millisecond(year, month and day are taken from the current time). +// 从给定的时、分、秒、毫秒创建 Carbon 实例(年、月、日取自当前时间) func (c Carbon) CreateFromTimeMilli(hour, minute, second, millisecond int, timezone ...string) Carbon { - now := c.Now(timezone...) - year, month, day := now.Date() + year, month, day := c.Now(timezone...).Date() return c.create(year, month, day, hour, minute, second, millisecond*1e6, timezone...) } -// CreateFromTimeMilli creates a Carbon instance from a given time and millisecond. -// 从给定的时、分、秒、毫秒创建 Carbon 实例 +// CreateFromTimeMilli creates a Carbon instance from a given time and millisecond(year, month and day are taken from the current time). +// 从给定的时、分、秒、毫秒创建 Carbon 实例(年、月、日取自当前时间) func CreateFromTimeMilli(hour, minute, second, millisecond int, timezone ...string) Carbon { return NewCarbon().CreateFromTimeMilli(hour, minute, second, millisecond, timezone...) } -// CreateFromTimeMicro creates a Carbon instance from a given time and microsecond. -// 从给定的时、分、秒、微秒创建 Carbon 实例 +// CreateFromTimeMicro creates a Carbon instance from a given time and microsecond(year, month and day are taken from the current time). +// 从给定的时、分、秒、微秒创建 Carbon 实例(年、月、日取自当前时间) func (c Carbon) CreateFromTimeMicro(hour, minute, second, microsecond int, timezone ...string) Carbon { - now := c.Now(timezone...) - year, month, day := now.Date() + year, month, day := c.Now(timezone...).Date() return c.create(year, month, day, hour, minute, second, microsecond*1e3, timezone...) } -// CreateFromTimeMicro creates a Carbon instance from a given time and microsecond. -// 从给定的时、分、秒、微秒创建 Carbon 实例 +// CreateFromTimeMicro creates a Carbon instance from a given time and microsecond(year, month and day are taken from the current time). +// 从给定的时、分、秒、微秒创建 Carbon 实例(年、月、日取自当前时间) func CreateFromTimeMicro(hour, minute, second, microsecond int, timezone ...string) Carbon { return NewCarbon().CreateFromTimeMicro(hour, minute, second, microsecond, timezone...) } -// CreateFromTimeNano creates a Carbon instance from a given time and nanosecond. -// 从给定的时、分、秒、纳秒创建 Carbon 实例 +// CreateFromTimeNano creates a Carbon instance from a given time and nanosecond(year, month and day are taken from the current time). +// 从给定的时、分、秒、纳秒创建 Carbon 实例(年、月、日取自当前时间) func (c Carbon) CreateFromTimeNano(hour, minute, second, nanosecond int, timezone ...string) Carbon { - now := c.Now(timezone...) - year, month, day := now.Date() + year, month, day := c.Now(timezone...).Date() return c.create(year, month, day, hour, minute, second, nanosecond, timezone...) } -// CreateFromTimeNano creates a Carbon instance from a given time and nanosecond. -// 从给定的时、分、秒、纳秒创建 Carbon 实例 +// CreateFromTimeNano creates a Carbon instance from a given time and nanosecond(year, month and day are taken from the current time). +// 从给定的时、分、秒、纳秒创建 Carbon 实例(年、月、日取自当前时间) func CreateFromTimeNano(hour, minute, second, nanosecond int, timezone ...string) Carbon { return NewCarbon().CreateFromTimeNano(hour, minute, second, nanosecond, timezone...) } @@ -254,7 +241,7 @@ func CreateFromTimeNano(hour, minute, second, nanosecond int, timezone ...string // 从给定的年、月、日、时、分、秒、纳秒创建 Carbon 实例 func (c Carbon) create(year, month, day, hour, minute, second, nanosecond int, timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c diff --git a/vendor/github.com/golang-module/carbon/v2/database.go b/vendor/github.com/golang-module/carbon/v2/database.go index 41419a0e..08562982 100644 --- a/vendor/github.com/golang-module/carbon/v2/database.go +++ b/vendor/github.com/golang-module/carbon/v2/database.go @@ -23,3 +23,9 @@ func (c Carbon) Value() (driver.Value, error) { } return c.ToStdTime(), nil } + +// GormDataType implements the interface GormDataTypeInterface for Carbon struct. +// 实现 GormDataTypeInterface 接口 +func (c Carbon) GormDataType() string { + return "time" +} diff --git a/vendor/github.com/golang-module/carbon/v2/deprecated.go b/vendor/github.com/golang-module/carbon/v2/deprecated.go deleted file mode 100644 index c9cd6f4b..00000000 --- a/vendor/github.com/golang-module/carbon/v2/deprecated.go +++ /dev/null @@ -1,30 +0,0 @@ -// The functions and methods in this file will be removed in the future -// 该文件中的函数和方法将来会被移除 - -package carbon - -import "time" - -// Deprecated: It will be removed in the future, use CreateFromStdTime instead. -// -// FromStdTime converts standard time.Time to Carbon. -// 将标准 time.Time 转换成 Carbon,未来将移除,请使用 CreateFromStdTime 替代 -func FromStdTime(tt time.Time) Carbon { - return CreateFromStdTime(tt) -} - -// Deprecated: It will be removed in the future, use CreateFromStdTime instead. -// -// Time2Carbon converts standard time.Time to Carbon. -// 将标准 time.Time 转换成 Carbon,未来将移除,请使用 CreateFromStdTime 替代 -func Time2Carbon(tt time.Time) Carbon { - return CreateFromStdTime(tt) -} - -// Deprecated: It will be removed in the future, use ToStdTime instead. -// -// Carbon2Time converts Carbon to standard time.Time. -// 将 Carbon 转换成标准 time.Time,未来将移除,请使用 ToStdTime 替代 -func (c Carbon) Carbon2Time() time.Time { - return c.ToStdTime() -} diff --git a/vendor/github.com/golang-module/carbon/v2/difference.go b/vendor/github.com/golang-module/carbon/v2/difference.go index c5e5e9a4..3a5c679e 100644 --- a/vendor/github.com/golang-module/carbon/v2/difference.go +++ b/vendor/github.com/golang-module/carbon/v2/difference.go @@ -13,7 +13,7 @@ func (c Carbon) DiffInYears(carbon ...Carbon) int64 { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } dy, dm, dd := end.Year()-start.Year(), end.Month()-start.Month(), end.Day()-start.Day() @@ -40,24 +40,15 @@ func (c Carbon) DiffInMonths(carbon ...Carbon) int64 { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } - startYear, startMonth, startDay := c.Date() - endYear, endMonth, endDay := end.Date() + if c.DiffAbsInDays(end) < 28 { + return 0 + } + startYear, startMonth, _ := c.Date() + endYear, endMonth, _ := end.Date() - diffYear, diffMonth, diffDay := endYear-startYear, endMonth-startMonth, endDay-startDay - if diffDay < 0 { - diffMonth = diffMonth - 1 - } - if diffYear == 0 && diffMonth == 0 { - return int64(0) - } - if diffYear == 0 && diffMonth != 0 && diffDay != 0 { - if int(end.DiffAbsInHours(c)) < c.DaysInMonth()*HoursPerDay { - return int64(0) - } - return int64(diffMonth) - } + diffYear, diffMonth := endYear-startYear, endMonth-startMonth return int64(diffYear*MonthsPerYear + diffMonth) } @@ -75,7 +66,7 @@ func (c Carbon) DiffInWeeks(carbon ...Carbon) int64 { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } return int64(math.Floor(float64((end.Timestamp() - start.Timestamp()) / (7 * 24 * 3600)))) } @@ -94,7 +85,7 @@ func (c Carbon) DiffInDays(carbon ...Carbon) int64 { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } return int64(math.Floor(float64((end.Timestamp() - start.Timestamp()) / (24 * 3600)))) } @@ -113,7 +104,7 @@ func (c Carbon) DiffInHours(carbon ...Carbon) int64 { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } return c.DiffInSeconds(end) / SecondsPerHour } @@ -132,7 +123,7 @@ func (c Carbon) DiffInMinutes(carbon ...Carbon) int64 { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } return c.DiffInSeconds(end) / SecondsPerMinute } @@ -151,7 +142,7 @@ func (c Carbon) DiffInSeconds(carbon ...Carbon) int64 { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } return end.Timestamp() - c.Timestamp() } @@ -170,7 +161,7 @@ func (c Carbon) DiffInString(carbon ...Carbon) string { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } if c.Error != nil || end.Error != nil { return "" @@ -187,7 +178,7 @@ func (c Carbon) DiffAbsInString(carbon ...Carbon) string { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } if c.Error != nil || end.Error != nil { return "" @@ -204,7 +195,7 @@ func (c Carbon) DiffForHumans(carbon ...Carbon) string { end = CreateFromTimestampNano(c.testNow, c.Location()) } if len(carbon) > 0 { - end = carbon[len(carbon)-1] + end = carbon[0] } if c.Error != nil || end.Error != nil { return "" @@ -233,23 +224,18 @@ func (c Carbon) diff(end Carbon) (unit string, value int64) { case c.DiffAbsInYears(end) > 0: unit = "year" value = c.DiffInYears(end) - break case c.DiffAbsInMonths(end) > 0: unit = "month" value = c.DiffInMonths(end) - break case c.DiffAbsInWeeks(end) > 0: unit = "week" value = c.DiffInWeeks(end) - break case c.DiffAbsInDays(end) > 0: unit = "day" value = c.DiffInDays(end) - break case c.DiffAbsInHours(end) > 0: unit = "hour" value = c.DiffInHours(end) - break case c.DiffAbsInMinutes(end) > 0: unit = "minute" value = c.DiffInMinutes(end) diff --git a/vendor/github.com/golang-module/carbon/v2/helper.go b/vendor/github.com/golang-module/carbon/v2/helper.go index 59c84164..adb91ee0 100644 --- a/vendor/github.com/golang-module/carbon/v2/helper.go +++ b/vendor/github.com/golang-module/carbon/v2/helper.go @@ -52,10 +52,12 @@ var layouts = []string{ "2006-01-02 15:04:05PM MST", "2006-01-02 15:04:05.999999999PM MST", "2006-1-2 15:4:5PM MST", "2006-1-2 15:4:5.999999999PM MST", "2006-01-02 15:04:05 PM MST", "2006-01-02 15:04:05.999999999 PM MST", "2006-1-2 15:4:5 PM MST", "2006-1-2 15:4:5.999999999 PM MST", "1/2/2006", "1/2/2006 15", "1/2/2006 15:4", "1/2/2006 15:4:5", "1/2/2006 15:4:5.999999999", - "2006-1-2 15:4:5 -0700 MST", "2006-1-2 15:4:5.999999999 -0700 MST", - "2006-1-2T15:4:5Z07", "2006-1-2T15:4:5.999999999Z07", - "2006-1-2T15:4:5Z07:00", "2006-1-2T15:4:5.999999999Z07:00", - "2006-1-2T15:4:5-07:00", "2006-1-2T15:4:5.999999999-07:00", + "2006-1-2 15:4:5 -0700 MST", "2006-1-2 15:4:5.999999999 -0700 MST", "2006-1-2 15:04:05 -0700 MST", "2006-1-2 15:04:05.999999999 -0700 MST", + "2006-01-02T15:04:05", "2006-01-02T15:04:05.999999999", "2006-1-2T3:4:5", "2006-1-2T3:4:5.999999999", + "2006-01-02T15:04:05Z07", "2006-01-02T15:04:05.999999999Z07", "2006-1-2T15:4:5Z07", "2006-1-2T15:4:5.999999999Z07", + "2006-01-02T15:04:05Z07:00", "2006-01-02T15:04:05.999999999Z07:00", "2006-1-2T15:4:5Z07:00", "2006-1-2T15:4:5.999999999Z07:00", + "2006-01-02T15:04:05-07:00", "2006-01-02T15:04:05.999999999-07:00", "2006-1-2T15:4:5-07:00", "2006-1-2T15:4:5.999999999-07:00", + "2006-01-02T15:04:05-0700", "2006-01-02T15:04:05.999999999-0700", "2006-1-2T3:4:5-0700", "2006-1-2T3:4:5.999999999-0700", "20060102150405-07:00", "20060102150405.999999999-07:00", "20060102150405Z07", "20060102150405.999999999Z07", "20060102150405Z07:00", "20060102150405.999999999Z07:00", diff --git a/vendor/github.com/golang-module/carbon/v2/json.go b/vendor/github.com/golang-module/carbon/v2/json.go index 86f373a4..1a201013 100644 --- a/vendor/github.com/golang-module/carbon/v2/json.go +++ b/vendor/github.com/golang-module/carbon/v2/json.go @@ -3,673 +3,41 @@ package carbon import ( "bytes" "fmt" - "strconv" ) -// DateTime defines a DateTime struct. -// 定义 DateTime 结构体 -type DateTime struct { - Carbon -} - -// DateTimeMilli defines a DateTimeMilli struct. -// 定义 DateTimeMilli 结构体 -type DateTimeMilli struct { - Carbon -} - -// DateTimeMicro defines a DateTimeMicro struct. -// 定义 DateTimeMicro 结构体 -type DateTimeMicro struct { - Carbon -} - -// DateTimeNano defines a DateTimeNano struct. -// 定义 DateTimeNano 结构体 -type DateTimeNano struct { - Carbon -} - -// Date defines a Date struct. -// 定义 Date 结构体 -type Date struct { - Carbon -} - -// DateMilli defines a DateMilli struct. -// 定义 DateMilli 结构体 -type DateMilli struct { - Carbon -} - -// DateMicro defines a DateMicro struct. -// 定义 DateMicro 结构体 -type DateMicro struct { - Carbon -} - -// DateNano defines a DateNano struct. -// 定义 DateNano 结构体 -type DateNano struct { - Carbon -} - -// Time defines a Time struct. -// 定义 Time 结构体 -type Time struct { - Carbon -} - -// TimeMilli defines a TimeMilli struct. -// 定义 TimeMilli 结构体 -type TimeMilli struct { - Carbon -} - -// TimeMicro defines a TimeMicro struct. -// 定义 TimeMicro 结构体 -type TimeMicro struct { - Carbon -} - -// TimeNano defines a TimeNano struct. -// 定义 TimeNano 结构体 -type TimeNano struct { - Carbon -} - -// Timestamp defines a Timestamp struct. -// 定义 Timestamp 结构体 -type Timestamp struct { - Carbon -} - -// TimestampMilli defines a TimestampMilli struct. -// 定义 TimestampMilli 结构体 -type TimestampMilli struct { - Carbon -} - -// TimestampMicro defines a TimestampMicro struct. -// 定义 TimestampMicro 结构体 -type TimestampMicro struct { - Carbon -} - -// TimestampNano defines a TimestampNano struct. -// 定义 TimestampNano 结构体 -type TimestampNano struct { - Carbon -} - -// MarshalJSON implements the interface json.Marshal for DateTime struct. -// 实现 MarshalJSON 接口 -func (t DateTime) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateTimeString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for DateTime struct. -// 实现 UnmarshalJSON 接口 -func (t *DateTime) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateTimeLayout, t.Location()) - if c.Error == nil { - *t = DateTime{Carbon: c} +// MarshalJSON implements the interface Marshaler for Carbon struct. +// 实现 Marshaler 接口 +func (c Carbon) MarshalJSON() ([]byte, error) { + if c.Error != nil { + return nil, c.Error } + key, value := c.parseTag() + if key == "layout" { + return []byte(fmt.Sprintf(`"%s"`, c.Layout(value))), nil + } + if key == "format" { + return []byte(fmt.Sprintf(`"%s"`, c.Format(value))), nil + } + return []byte(fmt.Sprintf(`"%s"`, c.ToDateTimeString())), nil +} + +// UnmarshalJSON implements the interface Unmarshaler for Carbon struct. +// 实现 Unmarshaler 接口 +func (c *Carbon) UnmarshalJSON(b []byte) error { + if c.Error != nil { + return c.Error + } + key, value := c.parseTag() + if key == "layout" { + *c = ParseByLayout(string(bytes.Trim(b, `"`)), value, c.Location()) + c.tag = "layout:" + value + return c.Error + } + if key == "format" { + *c = ParseByFormat(string(bytes.Trim(b, `"`)), value, c.Location()) + c.tag = "format:" + value + return c.Error + } + *c = Parse(string(bytes.Trim(b, `"`)), c.Location()) return c.Error } - -// MarshalJSON implements the interface json.Marshal for DateTimeMilli struct. -// 实现 MarshalJSON 接口 -func (t DateTimeMilli) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateTimeMilliString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for DateTimeMilli struct. -// 实现 UnmarshalJSON 接口 -func (t *DateTimeMilli) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateTimeMilliLayout, t.Location()) - if c.Error == nil { - *t = DateTimeMilli{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for DateTimeMicro struct. -// 实现 MarshalJSON 接口 -func (t DateTimeMicro) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateTimeMicroString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for DateTimeMicro struct. -// 实现 UnmarshalJSON 接口 -func (t *DateTimeMicro) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateTimeMicroLayout, t.Location()) - if c.Error == nil { - *t = DateTimeMicro{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for DateTimeNano struct. -// 实现 MarshalJSON 接口 -func (t DateTimeNano) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateTimeNanoString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for DateTimeNano struct. -// 实现 UnmarshalJSON 接口 -func (t *DateTimeNano) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateTimeNanoLayout, t.Location()) - if c.Error == nil { - *t = DateTimeNano{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for Date struct. -// 实现 MarshalJSON 接口 -func (t Date) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for Date struct. -// 实现 UnmarshalJSON 接口 -func (t *Date) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateLayout, t.Location()) - if c.Error == nil { - *t = Date{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for DateMilli struct. -// 实现 MarshalJSON 接口 -func (t DateMilli) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateMilliString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for DateMilli struct. -// 实现 UnmarshalJSON 接口 -func (t *DateMilli) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateMilliLayout, t.Location()) - if c.Error == nil { - *t = DateMilli{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for DateMicro struct. -// 实现 MarshalJSON 接口 -func (t DateMicro) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateMicroString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for DateMicro struct. -// 实现 UnmarshalJSON 接口 -func (t *DateMicro) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateMicroLayout, t.Location()) - if c.Error == nil { - *t = DateMicro{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for DateNano struct. -// 实现 MarshalJSON 接口 -func (t DateNano) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToDateNanoString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for DateNano struct. -// 实现 UnmarshalJSON 接口 -func (t *DateNano) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), DateNanoLayout, t.Location()) - if c.Error == nil { - *t = DateNano{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for Time struct. -// 实现 MarshalJSON 接口 -func (t Time) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToTimeString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for Time struct. -// 实现 UnmarshalJSON 接口 -func (t *Time) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), TimeLayout, t.Location()) - if c.Error == nil { - *t = Time{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for TimeMilli struct. -// 实现 MarshalJSON 接口 -func (t TimeMilli) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToTimeMilliString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for TimeMilli struct. -// 实现 UnmarshalJSON 接口 -func (t *TimeMilli) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), TimeMilliLayout, t.Location()) - if c.Error == nil { - *t = TimeMilli{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for TimeMicro struct. -// 实现 MarshalJSON 接口 -func (t TimeMicro) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToTimeMicroString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for TimeMicro struct. -// 实现 UnmarshalJSON 接口 -func (t *TimeMicro) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), TimeMicroLayout, t.Location()) - if c.Error == nil { - *t = TimeMicro{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for TimeNano struct. -// 实现 MarshalJSON 接口 -func (t TimeNano) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`"%s"`, t.ToTimeNanoString())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for TimeNano struct. -// 实现 UnmarshalJSON 接口 -func (t *TimeNano) UnmarshalJSON(b []byte) error { - c := ParseByLayout(string(bytes.Trim(b, `"`)), TimeNanoLayout, t.Location()) - if c.Error == nil { - *t = TimeNano{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for Timestamp struct. -// 实现 MarshalJSON 接口 -func (t Timestamp) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`%d`, t.Timestamp())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for Timestamp struct. -// 实现 UnmarshalJSON 接口 -func (t *Timestamp) UnmarshalJSON(b []byte) error { - ts, _ := strconv.ParseInt(string(b), 10, 64) - c := CreateFromTimestamp(ts) - if c.Error == nil { - *t = Timestamp{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for TimestampMilli struct. -// 实现 MarshalJSON 接口 -func (t TimestampMilli) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`%d`, t.TimestampMilli())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for TimestampMilli struct. -// 实现 UnmarshalJSON 接口 -func (t *TimestampMilli) UnmarshalJSON(b []byte) error { - ts, _ := strconv.ParseInt(string(b), 10, 64) - c := CreateFromTimestampMilli(ts) - if c.Error == nil { - *t = TimestampMilli{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface MarshalJSON for TimestampMicro struct. -// 实现 MarshalJSON 接口 -func (t TimestampMicro) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`%d`, t.TimestampMicro())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for TimestampMicro struct. -// 实现 UnmarshalJSON 接口 -func (t *TimestampMicro) UnmarshalJSON(b []byte) error { - ts, _ := strconv.ParseInt(string(b), 10, 64) - c := CreateFromTimestampMicro(ts) - if c.Error == nil { - *t = TimestampMicro{Carbon: c} - } - return c.Error -} - -// MarshalJSON implements the interface json.Marshal for TimestampNano struct. -// 实现 MarshalJSON 接口 -func (t TimestampNano) MarshalJSON() ([]byte, error) { - return []byte(fmt.Sprintf(`%d`, t.TimestampNano())), nil -} - -// UnmarshalJSON implements the interface json.Unmarshal for TimestampNano struct. -// 实现 UnmarshalJSON 接口 -func (t *TimestampNano) UnmarshalJSON(b []byte) error { - ts, _ := strconv.ParseInt(string(b), 10, 64) - c := CreateFromTimestampNano(ts) - if c.Error == nil { - *t = TimestampNano{Carbon: c} - } - return c.Error -} - -// ToDateTimeStruct converts Carbon to DateTime. -// 将 Carbon 结构体转换成 DateTime 结构体 -func (c Carbon) ToDateTimeStruct() DateTime { - return DateTime{Carbon: c} -} - -// ToDateTimeMilliStruct converts Carbon to DateTimeMilli. -// 将 Carbon 结构体转换成 DateTimeMilli 结构体 -func (c Carbon) ToDateTimeMilliStruct() DateTimeMilli { - return DateTimeMilli{Carbon: c} -} - -// ToDateTimeMicroStruct converts Carbon to DateTimeMicro. -// 将 Carbon 结构体转换成 DateTimeMicro 结构体 -func (c Carbon) ToDateTimeMicroStruct() DateTimeMicro { - return DateTimeMicro{Carbon: c} -} - -// ToDateTimeNanoStruct converts Carbon to DateTimeNano. -// 将 Carbon 结构体转换成 DateTimeNano 结构体 -func (c Carbon) ToDateTimeNanoStruct() DateTimeNano { - return DateTimeNano{Carbon: c} -} - -// ToDateStruct converts Carbon to Date. -// 将 Carbon 结构体转换成 Date 结构体 -func (c Carbon) ToDateStruct() Date { - return Date{Carbon: c} -} - -// ToDateMilliStruct converts Carbon to DateMilli. -// 将 Carbon 结构体转换成 DateMilli 结构体 -func (c Carbon) ToDateMilliStruct() DateMilli { - return DateMilli{Carbon: c} -} - -// ToDateMicroStruct converts Carbon to DateMicro. -// 将 Carbon 结构体转换成 DateMicro 结构体 -func (c Carbon) ToDateMicroStruct() DateMicro { - return DateMicro{Carbon: c} -} - -// ToDateNanoStruct converts Carbon to DateNano. -// 将 Carbon 结构体转换成 DateNano 结构体 -func (c Carbon) ToDateNanoStruct() DateNano { - return DateNano{Carbon: c} -} - -// ToTimeStruct converts Carbon to Time. -// 将 Carbon 结构体转换成 Time 结构体 -func (c Carbon) ToTimeStruct() Time { - return Time{Carbon: c} -} - -// ToTimeMilliStruct converts Carbon to TimeMilli. -// 将 Carbon 结构体转换成 TimeMilli 结构体 -func (c Carbon) ToTimeMilliStruct() TimeMilli { - return TimeMilli{Carbon: c} -} - -// ToTimeMicroStruct converts Carbon to TimeMicro. -// 将 Carbon 结构体转换成 TimeMicro 结构体 -func (c Carbon) ToTimeMicroStruct() TimeMicro { - return TimeMicro{Carbon: c} -} - -// ToTimeNanoStruct converts Carbon to TimeNano. -// 将 Carbon 结构体转换成 TimeNano 结构体 -func (c Carbon) ToTimeNanoStruct() TimeNano { - return TimeNano{Carbon: c} -} - -// ToTimestampStruct converts Carbon to Timestamp. -// 将 Carbon 结构体转换成 Timestamp 结构体 -func (c Carbon) ToTimestampStruct() Timestamp { - return Timestamp{Carbon: c} -} - -// ToTimestampMilliStruct converts Carbon to TimestampMilli. -// 将 Carbon 结构体转换成 TimestampMilli 结构体 -func (c Carbon) ToTimestampMilliStruct() TimestampMilli { - return TimestampMilli{Carbon: c} -} - -// ToTimestampMicroStruct converts Carbon to TimestampMicro. -// 将 Carbon 结构体转换成 TimestampMicro 结构体 -func (c Carbon) ToTimestampMicroStruct() TimestampMicro { - return TimestampMicro{Carbon: c} -} - -// ToTimestampNanoStruct converts Carbon to TimestampNano. -// 将 Carbon 结构体转换成 TimestampNano 结构体 -func (c Carbon) ToTimestampNanoStruct() TimestampNano { - return TimestampNano{Carbon: c} -} - -// Int64 outputs timestamp with second. -// 输出秒级时间戳 -func (t Timestamp) Int64() int64 { - return t.Timestamp() -} - -// Int64 outputs timestamp with millisecond. -// 输出豪秒级时间戳 -func (t TimestampMilli) Int64() int64 { - return t.TimestampMilli() -} - -// Int64 outputs timestamp with microsecond. -// 输出微秒级时间戳 -func (t TimestampMicro) Int64() int64 { - return t.TimestampMicro() -} - -// Int64 outputs timestamp with nanosecond. -// 输出纳秒级时间戳 -func (t TimestampNano) Int64() int64 { - return t.TimestampNano() -} - -// String implements the interface Stringer for DateTime struct. -// 实现 Stringer 接口 -func (t DateTime) String() string { - return t.ToDateTimeString() -} - -// String implements the interface Stringer for DateTimeMilli struct. -// 实现 Stringer 接口 -func (t DateTimeMilli) String() string { - return t.ToDateTimeMilliString() -} - -// String implements the interface Stringer for DateTimeMicro struct. -// 实现 Stringer 接口 -func (t DateTimeMicro) String() string { - return t.ToDateTimeMicroString() -} - -// String implements the interface Stringer for DateTimeNano struct. -// 实现 Stringer 接口 -func (t DateTimeNano) String() string { - return t.ToDateTimeNanoString() -} - -// String implements the interface Stringer for Date struct. -// 实现 Stringer 接口 -func (t Date) String() string { - return t.ToDateString() -} - -// String implements the interface Stringer for DateMilli struct. -// 实现 Stringer 接口 -func (t DateMilli) String() string { - return t.ToDateMilliString() -} - -// String implements the interface Stringer for DateMicro struct. -// 实现 Stringer 接口 -func (t DateMicro) String() string { - return t.ToDateMicroString() -} - -// String implements the interface Stringer for DateNano struct. -// 实现 Stringer 接口 -func (t DateNano) String() string { - return t.ToDateNanoString() -} - -// String implements the interface Stringer for Time struct. -// 实现 Stringer 接口 -func (t Time) String() string { - return t.ToTimeString() -} - -// String implements the interface Stringer for TimeMilli struct. -// 实现 Stringer 接口 -func (t TimeMilli) String() string { - return t.ToTimeMilliString() -} - -// String implements the interface Stringer for TimeMicro struct. -// 实现 Stringer 接口 -func (t TimeMicro) String() string { - return t.ToTimeMicroString() -} - -// String implements the interface Stringer for TimeNano struct. -// 实现 Stringer 接口 -func (t TimeNano) String() string { - return t.ToTimeNanoString() -} - -// String implements the interface Stringer for Timestamp struct. -// 实现 Stringer 接口 -func (t Timestamp) String() string { - return strconv.FormatInt(t.Timestamp(), 10) -} - -// String implements the interface Stringer for TimestampMilli struct. -// 实现 Stringer 接口 -func (t TimestampMilli) String() string { - return strconv.FormatInt(t.TimestampMilli(), 10) -} - -// String implements the interface Stringer for TimestampMicro struct. -// 实现 Stringer 接口 -func (t TimestampMicro) String() string { - return strconv.FormatInt(t.TimestampMicro(), 10) -} - -// String implements the interface Stringer for TimestampNano struct. -// 实现 Stringer 接口 -func (t TimestampNano) String() string { - return strconv.FormatInt(t.TimestampNano(), 10) -} - -// GormDataType implements the interface GormDataTypeInterface for DateTime struct. -// 实现 GormDataTypeInterface 接口 -func (t DateTime) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for DateTimeMilli struct. -// 实现 GormDataTypeInterface 接口 -func (t DateTimeMilli) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for DateTimeMicro struct. -// 实现 GormDataTypeInterface 接口 -func (t DateTimeMicro) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for DateTimeNano struct. -// 实现 GormDataTypeInterface 接口 -func (t DateTimeNano) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for Date struct. -// 实现 GormDataTypeInterface 接口 -func (t Date) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for DateMilli struct. -// 实现 GormDataTypeInterface 接口 -func (t DateMilli) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for DateMicro struct. -// 实现 GormDataTypeInterface 接口 -func (t DateMicro) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for DateNano struct. -// 实现 GormDataTypeInterface 接口 -func (t DateNano) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for Time struct. -// 实现 GormDataTypeInterface 接口 -func (t Time) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for TimeMilli struct. -// 实现 GormDataTypeInterface 接口 -func (t TimeMilli) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for TimeMicro struct. -// 实现 GormDataTypeInterface 接口 -func (t TimeMicro) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for TimeNano struct. -// 实现 GormDataTypeInterface 接口 -func (t TimeNano) GormDataType() string { - return "time" -} - -// GormDataType implements the interface GormDataTypeInterface for Timestamp struct. -// 实现 GormDataTypeInterface 接口 -func (t Timestamp) GormDataType() string { - return "int" -} - -// GormDataType implements the interface GormDataTypeInterface for TimestampMilli struct. -// 实现 GormDataTypeInterface 接口 -func (t TimestampMilli) GormDataType() string { - return "int" -} - -// GormDataType implements the interface GormDataTypeInterface for TimestampMicro struct. -// 实现 GormDataTypeInterface 接口 -func (t TimestampMicro) GormDataType() string { - return "int" -} - -// GormDataType implements the interface GormDataTypeInterface for TimestampNano struct. -// 实现 GormDataTypeInterface 接口 -func (t TimestampNano) GormDataType() string { - return "int" -} diff --git a/vendor/github.com/golang-module/carbon/v2/outputer.go b/vendor/github.com/golang-module/carbon/v2/outputer.go index 74b121ee..b18f809b 100644 --- a/vendor/github.com/golang-module/carbon/v2/outputer.go +++ b/vendor/github.com/golang-module/carbon/v2/outputer.go @@ -11,6 +11,13 @@ import ( // String implements the interface Stringer for Carbon struct. // 实现 Stringer 接口 func (c Carbon) String() string { + key, value := c.parseTag() + if key == "layout" { + return c.Layout(value) + } + if key == "format" { + return c.Format(value) + } return c.ToDateTimeString() } @@ -18,7 +25,7 @@ func (c Carbon) String() string { // 输出 "2006-01-02 15:04:05.999999999 -0700 MST" 格式字符串 func (c Carbon) ToString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -30,7 +37,7 @@ func (c Carbon) ToString(timezone ...string) string { // 输出完整月份字符串,支持i18n func (c Carbon) ToMonthString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -40,7 +47,7 @@ func (c Carbon) ToMonthString(timezone ...string) string { } if months, ok := c.lang.resources["months"]; ok { slice := strings.Split(months, "|") - if len(slice) == 12 { + if len(slice) == MonthsPerYear { return slice[c.Month()-1] } } @@ -51,7 +58,7 @@ func (c Carbon) ToMonthString(timezone ...string) string { // 输出缩写月份字符串,支持i18n func (c Carbon) ToShortMonthString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -61,7 +68,7 @@ func (c Carbon) ToShortMonthString(timezone ...string) string { } if months, ok := c.lang.resources["short_months"]; ok { slice := strings.Split(months, "|") - if len(slice) == 12 { + if len(slice) == MonthsPerYear { return slice[c.Month()-1] } } @@ -72,7 +79,7 @@ func (c Carbon) ToShortMonthString(timezone ...string) string { // 输出完整星期字符串,支持i18n func (c Carbon) ToWeekString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -82,8 +89,8 @@ func (c Carbon) ToWeekString(timezone ...string) string { } if months, ok := c.lang.resources["weeks"]; ok { slice := strings.Split(months, "|") - if len(slice) == 7 { - return slice[c.Week()] + if len(slice) == DaysPerWeek { + return slice[c.DayOfWeek()%DaysPerWeek] } } return "" @@ -93,7 +100,7 @@ func (c Carbon) ToWeekString(timezone ...string) string { // 输出缩写星期字符串,支持i18n func (c Carbon) ToShortWeekString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -103,8 +110,8 @@ func (c Carbon) ToShortWeekString(timezone ...string) string { } if months, ok := c.lang.resources["short_weeks"]; ok { slice := strings.Split(months, "|") - if len(slice) == 7 { - return slice[c.Week()] + if len(slice) == DaysPerWeek { + return slice[c.DayOfWeek()%DaysPerWeek] } } return "" @@ -114,7 +121,7 @@ func (c Carbon) ToShortWeekString(timezone ...string) string { // 输出 "Mon, Jan 2, 2006 3:04 PM" 格式字符串 func (c Carbon) ToDayDateTimeString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -126,7 +133,7 @@ func (c Carbon) ToDayDateTimeString(timezone ...string) string { // 输出 "2006-01-02 15:04:05" 格式字符串 func (c Carbon) ToDateTimeString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -138,7 +145,7 @@ func (c Carbon) ToDateTimeString(timezone ...string) string { // 输出 "2006-01-02 15:04:05.999" 格式字符串 func (c Carbon) ToDateTimeMilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -150,7 +157,7 @@ func (c Carbon) ToDateTimeMilliString(timezone ...string) string { // 输出 "2006-01-02 15:04:05.999999" 格式字符串 func (c Carbon) ToDateTimeMicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -162,7 +169,7 @@ func (c Carbon) ToDateTimeMicroString(timezone ...string) string { // 输出 "2006-01-02 15:04:05.999999999" 格式字符串 func (c Carbon) ToDateTimeNanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -174,7 +181,7 @@ func (c Carbon) ToDateTimeNanoString(timezone ...string) string { // 输出 "20060102150405" 格式字符串 func (c Carbon) ToShortDateTimeString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -186,7 +193,7 @@ func (c Carbon) ToShortDateTimeString(timezone ...string) string { // 输出 "20060102150405.999" 格式字符串 func (c Carbon) ToShortDateTimeMilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -198,7 +205,7 @@ func (c Carbon) ToShortDateTimeMilliString(timezone ...string) string { // 输出 "20060102150405.999999" 格式字符串 func (c Carbon) ToShortDateTimeMicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -210,7 +217,7 @@ func (c Carbon) ToShortDateTimeMicroString(timezone ...string) string { // 输出 "20060102150405.999999999" 格式字符串 func (c Carbon) ToShortDateTimeNanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -222,7 +229,7 @@ func (c Carbon) ToShortDateTimeNanoString(timezone ...string) string { // 输出 "2006-01-02" 格式字符串 func (c Carbon) ToDateString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -234,7 +241,7 @@ func (c Carbon) ToDateString(timezone ...string) string { // 输出 "2006-01-02.999" 格式字符串 func (c Carbon) ToDateMilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -246,7 +253,7 @@ func (c Carbon) ToDateMilliString(timezone ...string) string { // 输出 "2006-01-02.999999" 格式字符串 func (c Carbon) ToDateMicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -258,7 +265,7 @@ func (c Carbon) ToDateMicroString(timezone ...string) string { // 输出 "2006-01-02.999999999" 格式字符串 func (c Carbon) ToDateNanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -270,7 +277,7 @@ func (c Carbon) ToDateNanoString(timezone ...string) string { // 输出 "20060102" 格式字符串 func (c Carbon) ToShortDateString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -282,7 +289,7 @@ func (c Carbon) ToShortDateString(timezone ...string) string { // 输出 "20060102.999" 格式字符串 func (c Carbon) ToShortDateMilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -294,7 +301,7 @@ func (c Carbon) ToShortDateMilliString(timezone ...string) string { // 输出 "20060102.999999" 格式字符串 func (c Carbon) ToShortDateMicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -306,7 +313,7 @@ func (c Carbon) ToShortDateMicroString(timezone ...string) string { // 输出 "20060102.999999999" 格式字符串 func (c Carbon) ToShortDateNanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -318,7 +325,7 @@ func (c Carbon) ToShortDateNanoString(timezone ...string) string { // 输出 "15:04:05" 格式字符串 func (c Carbon) ToTimeString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -330,7 +337,7 @@ func (c Carbon) ToTimeString(timezone ...string) string { // 输出 "15:04:05.999" 格式字符串 func (c Carbon) ToTimeMilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -342,7 +349,7 @@ func (c Carbon) ToTimeMilliString(timezone ...string) string { // 输出 "15:04:05.999999" 格式字符串 func (c Carbon) ToTimeMicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -354,7 +361,7 @@ func (c Carbon) ToTimeMicroString(timezone ...string) string { // 输出 "15:04:05.999999999" 格式字符串 func (c Carbon) ToTimeNanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -366,7 +373,7 @@ func (c Carbon) ToTimeNanoString(timezone ...string) string { // 输出 "150405" 格式字符串 func (c Carbon) ToShortTimeString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -378,7 +385,7 @@ func (c Carbon) ToShortTimeString(timezone ...string) string { // 输出 "150405.999" 格式字符串 func (c Carbon) ToShortTimeMilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -390,7 +397,7 @@ func (c Carbon) ToShortTimeMilliString(timezone ...string) string { // 输出 "150405.999999" 格式字符串 func (c Carbon) ToShortTimeMicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -402,7 +409,7 @@ func (c Carbon) ToShortTimeMicroString(timezone ...string) string { // 输出 "150405.999999999" 格式字符串 func (c Carbon) ToShortTimeNanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -416,11 +423,11 @@ func (c Carbon) ToAtomString(timezone ...string) string { return c.ToRfc3339String(timezone...) } -// ToANSICString outputs a string in "Mon Jan _2 15:04:05 2006" layout. +// ToAnsicString outputs a string in "Mon Jan _2 15:04:05 2006" layout. // 输出 "Mon Jan _2 15:04:05 2006" 格式字符串 -func (c Carbon) ToANSICString(timezone ...string) string { +func (c Carbon) ToAnsicString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -432,7 +439,7 @@ func (c Carbon) ToANSICString(timezone ...string) string { // 输出 "Monday, 02-Jan-2006 15:04:05 MST" 格式字符串 func (c Carbon) ToCookieString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -444,7 +451,7 @@ func (c Carbon) ToCookieString(timezone ...string) string { // 输出 "Mon, 02 Jan 2006 15:04:05 -0700" 格式字符串 func (c Carbon) ToRssString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -462,7 +469,7 @@ func (c Carbon) ToW3cString(timezone ...string) string { // 输出 "Mon Jan _2 15:04:05 MST 2006" 格式字符串 func (c Carbon) ToUnixDateString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -474,7 +481,7 @@ func (c Carbon) ToUnixDateString(timezone ...string) string { // 输出 "Mon Jan 02 15:04:05 -0700 2006" 格式字符串 func (c Carbon) ToRubyDateString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -486,7 +493,7 @@ func (c Carbon) ToRubyDateString(timezone ...string) string { // 输出 "3:04PM" 格式字符串 func (c Carbon) ToKitchenString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -498,7 +505,7 @@ func (c Carbon) ToKitchenString(timezone ...string) string { // 输出 "2006-01-02T15:04:05-07:00" 格式字符串 func (c Carbon) ToIso8601String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -510,7 +517,7 @@ func (c Carbon) ToIso8601String(timezone ...string) string { // 输出 "2006-01-02T15:04:05.999-07:00" 格式字符串 func (c Carbon) ToIso8601MilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -522,7 +529,7 @@ func (c Carbon) ToIso8601MilliString(timezone ...string) string { // 输出 "2006-01-02T15:04:05.999999-07:00" 格式字符串 func (c Carbon) ToIso8601MicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -534,7 +541,7 @@ func (c Carbon) ToIso8601MicroString(timezone ...string) string { // 输出 "2006-01-02T15:04:05.999999999-07:00" 格式字符串 func (c Carbon) ToIso8601NanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -546,7 +553,7 @@ func (c Carbon) ToIso8601NanoString(timezone ...string) string { // 输出 "02 Jan 06 15:04 MST" 格式字符串 func (c Carbon) ToRfc822String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -558,7 +565,7 @@ func (c Carbon) ToRfc822String(timezone ...string) string { // 输出 "02 Jan 06 15:04 -0700" 格式字符串 func (c Carbon) ToRfc822zString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -570,7 +577,7 @@ func (c Carbon) ToRfc822zString(timezone ...string) string { // 输出 "Monday, 02-Jan-06 15:04:05 MST" 格式字符串 func (c Carbon) ToRfc850String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -582,7 +589,7 @@ func (c Carbon) ToRfc850String(timezone ...string) string { // 输出 "Mon, 02 Jan 06 15:04:05 -0700" 格式字符串 func (c Carbon) ToRfc1036String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -594,7 +601,7 @@ func (c Carbon) ToRfc1036String(timezone ...string) string { // 输出 "Mon, 02 Jan 2006 15:04:05 MST" 格式字符串 func (c Carbon) ToRfc1123String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -606,7 +613,7 @@ func (c Carbon) ToRfc1123String(timezone ...string) string { // 输出 "Mon, 02 Jan 2006 15:04:05 -0700" 格式字符串 func (c Carbon) ToRfc1123zString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -618,7 +625,7 @@ func (c Carbon) ToRfc1123zString(timezone ...string) string { // 输出 "Mon, 02 Jan 2006 15:04:05 -0700" 格式字符串 func (c Carbon) ToRfc2822String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -630,7 +637,7 @@ func (c Carbon) ToRfc2822String(timezone ...string) string { // 输出 "2006-01-02T15:04:05Z07:00" 格式字符串 func (c Carbon) ToRfc3339String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -642,7 +649,7 @@ func (c Carbon) ToRfc3339String(timezone ...string) string { // 输出 "2006-01-02T15:04:05.999Z07:00" 格式字符串 func (c Carbon) ToRfc3339MilliString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -654,7 +661,7 @@ func (c Carbon) ToRfc3339MilliString(timezone ...string) string { // 输出 "2006-01-02T15:04:05.999999Z07:00" 格式字符串 func (c Carbon) ToRfc3339MicroString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -666,7 +673,7 @@ func (c Carbon) ToRfc3339MicroString(timezone ...string) string { // 输出 "2006-01-02T15:04:05.999999999Z07:00" 格式字符串 func (c Carbon) ToRfc3339NanoString(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -678,7 +685,7 @@ func (c Carbon) ToRfc3339NanoString(timezone ...string) string { // 输出 "Mon, 02 Jan 2006 15:04:05 GMT" 格式字符串 func (c Carbon) ToRfc7231String(timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -690,7 +697,7 @@ func (c Carbon) ToRfc7231String(timezone ...string) string { // 输出指定布局模板的时间字符串 func (c Carbon) ToLayoutString(layout string, timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" @@ -708,7 +715,7 @@ func (c Carbon) Layout(layout string, timezone ...string) string { // 输出指定格式模板的时间字符串 func (c Carbon) ToFormatString(format string, timezone ...string) string { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.IsInvalid() { return "" diff --git a/vendor/github.com/golang-module/carbon/v2/parser.go b/vendor/github.com/golang-module/carbon/v2/parser.go index d6715f08..25d98259 100644 --- a/vendor/github.com/golang-module/carbon/v2/parser.go +++ b/vendor/github.com/golang-module/carbon/v2/parser.go @@ -11,7 +11,7 @@ func (c Carbon) Parse(value string, timezone ...string) Carbon { return c } if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } switch value { case "now": @@ -58,7 +58,7 @@ func ParseByFormat(value, format string, timezone ...string) Carbon { // 通过布局模板将时间字符串解析成 Carbon 实例 func (c Carbon) ParseByLayout(value, layout string, timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c diff --git a/vendor/github.com/golang-module/carbon/v2/tag.go b/vendor/github.com/golang-module/carbon/v2/tag.go new file mode 100644 index 00000000..5276ca19 --- /dev/null +++ b/vendor/github.com/golang-module/carbon/v2/tag.go @@ -0,0 +1,74 @@ +package carbon + +import ( + "fmt" + "reflect" + "strings" +) + +var ( + // invalid pointer error + // 无效的指针错误 + invalidPtrError = func() error { + return fmt.Errorf("invalid pointer, please make sure the pointer is valid") + } + + // invalid tag error + // 无效的标签错误 + invalidTagError = func() error { + return fmt.Errorf("invalid tag, please make sure the tag is valid") + } +) + +// Tag gets tag. +// 获取标签 +func (c Carbon) Tag() string { + return c.tag +} + +// SetTag sets tag. +// 设置标签 +func (c Carbon) SetTag(tag string) Carbon { + if c.Error != nil { + return c + } + c.tag = tag + return c +} + +// parseTag parses tag. +// 解析标签 +func (c Carbon) parseTag() (key, value string) { + if c.tag == "" || len(c.tag) <= 7 { + return "", "" + } + return strings.TrimSpace(c.tag[:6]), strings.TrimSpace(c.tag[7:]) +} + +// LoadTag loads tag. +// 加载标签 +func LoadTag(v interface{}) error { + typ := reflect.TypeOf(v) + val := reflect.ValueOf(v) + if typ.Kind() != reflect.Ptr { + return invalidPtrError() + } + params := make([]reflect.Value, 1) + for i := 0; i < val.Elem().NumField(); i++ { + field := typ.Elem().Field(i) + value := val.Elem().Field(i) + if reflect.TypeOf(Carbon{}) != value.Type() { + continue + } + tag := field.Tag.Get("carbon") + if tag == "" { + tag = "layout:" + DateTimeLayout + } + if !strings.Contains(tag, "layout:") && !strings.Contains(tag, "format:") { + return invalidTagError() + } + params[0] = reflect.ValueOf(tag) + value.Set(value.MethodByName("SetTag").Call(params)[0]) + } + return nil +} diff --git a/vendor/github.com/golang-module/carbon/v2/traveler.go b/vendor/github.com/golang-module/carbon/v2/traveler.go index e03627db..58e50911 100644 --- a/vendor/github.com/golang-module/carbon/v2/traveler.go +++ b/vendor/github.com/golang-module/carbon/v2/traveler.go @@ -8,7 +8,7 @@ import ( // 当前 func (c Carbon) Now(timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c @@ -30,7 +30,7 @@ func Now(timezone ...string) Carbon { // 明天 func (c Carbon) Tomorrow(timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c @@ -54,7 +54,7 @@ func Tomorrow(timezone ...string) Carbon { // 昨天 func (c Carbon) Yesterday(timezone ...string) Carbon { if len(timezone) > 0 { - c.loc, c.Error = getLocationByTimezone(timezone[len(timezone)-1]) + c.loc, c.Error = getLocationByTimezone(timezone[0]) } if c.Error != nil { return c diff --git a/vendor/github.com/google/uuid/CHANGELOG.md b/vendor/github.com/google/uuid/CHANGELOG.md index 7ed347d3..c9fb829d 100644 --- a/vendor/github.com/google/uuid/CHANGELOG.md +++ b/vendor/github.com/google/uuid/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.5.0](https://github.com/google/uuid/compare/v1.4.0...v1.5.0) (2023-12-12) + + +### Features + +* Validate UUID without creating new UUID ([#141](https://github.com/google/uuid/issues/141)) ([9ee7366](https://github.com/google/uuid/commit/9ee7366e66c9ad96bab89139418a713dc584ae29)) + ## [1.4.0](https://github.com/google/uuid/compare/v1.3.1...v1.4.0) (2023-10-26) diff --git a/vendor/github.com/google/uuid/time.go b/vendor/github.com/google/uuid/time.go index e6ef06cd..c3511292 100644 --- a/vendor/github.com/google/uuid/time.go +++ b/vendor/github.com/google/uuid/time.go @@ -108,12 +108,23 @@ func setClockSequence(seq int) { } // Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in -// uuid. The time is only defined for version 1 and 2 UUIDs. +// uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs. func (uuid UUID) Time() Time { - time := int64(binary.BigEndian.Uint32(uuid[0:4])) - time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32 - time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48 - return Time(time) + var t Time + switch uuid.Version() { + case 6: + time := binary.BigEndian.Uint64(uuid[:8]) // Ignore uuid[6] version b0110 + t = Time(time) + case 7: + time := binary.BigEndian.Uint64(uuid[:8]) + t = Time((time>>16)*10000 + g1582ns100) + default: // forward compatible + time := int64(binary.BigEndian.Uint32(uuid[0:4])) + time |= int64(binary.BigEndian.Uint16(uuid[4:6])) << 32 + time |= int64(binary.BigEndian.Uint16(uuid[6:8])&0xfff) << 48 + t = Time(time) + } + return t } // ClockSequence returns the clock sequence encoded in uuid. diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index dc75f7d9..5232b486 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -186,6 +186,59 @@ func Must(uuid UUID, err error) UUID { return uuid } +// Validate returns an error if s is not a properly formatted UUID in one of the following formats: +// xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +// urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +// xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx +// {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} +// It returns an error if the format is invalid, otherwise nil. +func Validate(s string) error { + switch len(s) { + // Standard UUID format + case 36: + + // UUID with "urn:uuid:" prefix + case 36 + 9: + if !strings.EqualFold(s[:9], "urn:uuid:") { + return fmt.Errorf("invalid urn prefix: %q", s[:9]) + } + s = s[9:] + + // UUID enclosed in braces + case 36 + 2: + if s[0] != '{' || s[len(s)-1] != '}' { + return fmt.Errorf("invalid bracketed UUID format") + } + s = s[1 : len(s)-1] + + // UUID without hyphens + case 32: + for i := 0; i < len(s); i += 2 { + _, ok := xtob(s[i], s[i+1]) + if !ok { + return errors.New("invalid UUID format") + } + } + + default: + return invalidLengthError{len(s)} + } + + // Check for standard UUID format + if len(s) == 36 { + if s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-' { + return errors.New("invalid UUID format") + } + for _, x := range []int{0, 2, 4, 6, 9, 11, 14, 16, 19, 21, 24, 26, 28, 30, 32, 34} { + if _, ok := xtob(s[x], s[x+1]); !ok { + return errors.New("invalid UUID format") + } + } + } + + return nil +} + // String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx // , or "" if uuid is invalid. func (uuid UUID) String() string { diff --git a/vendor/github.com/google/uuid/version6.go b/vendor/github.com/google/uuid/version6.go new file mode 100644 index 00000000..339a959a --- /dev/null +++ b/vendor/github.com/google/uuid/version6.go @@ -0,0 +1,56 @@ +// Copyright 2023 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package uuid + +import "encoding/binary" + +// UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality. +// It is expected that UUIDv6 will primarily be used in contexts where there are existing v1 UUIDs. +// Systems that do not involve legacy UUIDv1 SHOULD consider using UUIDv7 instead. +// +// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#uuidv6 +// +// NewV6 returns a Version 6 UUID based on the current NodeID and clock +// sequence, and the current time. If the NodeID has not been set by SetNodeID +// or SetNodeInterface then it will be set automatically. If the NodeID cannot +// be set NewV6 set NodeID is random bits automatically . If clock sequence has not been set by +// SetClockSequence then it will be set automatically. If GetTime fails to +// return the current NewV6 returns Nil and an error. +func NewV6() (UUID, error) { + var uuid UUID + now, seq, err := GetTime() + if err != nil { + return uuid, err + } + + /* + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | time_high | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | time_mid | time_low_and_version | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |clk_seq_hi_res | clk_seq_low | node (0-1) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | node (2-5) | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ + + binary.BigEndian.PutUint64(uuid[0:], uint64(now)) + binary.BigEndian.PutUint16(uuid[8:], seq) + + uuid[6] = 0x60 | (uuid[6] & 0x0F) + uuid[8] = 0x80 | (uuid[8] & 0x3F) + + nodeMu.Lock() + if nodeID == zeroID { + setNodeInterface("") + } + copy(uuid[10:], nodeID[:]) + nodeMu.Unlock() + + return uuid, nil +} diff --git a/vendor/github.com/google/uuid/version7.go b/vendor/github.com/google/uuid/version7.go new file mode 100644 index 00000000..ba9dd5eb --- /dev/null +++ b/vendor/github.com/google/uuid/version7.go @@ -0,0 +1,75 @@ +// Copyright 2023 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package uuid + +import ( + "io" +) + +// UUID version 7 features a time-ordered value field derived from the widely +// implemented and well known Unix Epoch timestamp source, +// the number of milliseconds seconds since midnight 1 Jan 1970 UTC, leap seconds excluded. +// As well as improved entropy characteristics over versions 1 or 6. +// +// see https://datatracker.ietf.org/doc/html/draft-peabody-dispatch-new-uuid-format-03#name-uuid-version-7 +// +// Implementations SHOULD utilize UUID version 7 over UUID version 1 and 6 if possible. +// +// NewV7 returns a Version 7 UUID based on the current time(Unix Epoch). +// Uses the randomness pool if it was enabled with EnableRandPool. +// On error, NewV7 returns Nil and an error +func NewV7() (UUID, error) { + uuid, err := NewRandom() + if err != nil { + return uuid, err + } + makeV7(uuid[:]) + return uuid, nil +} + +// NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch). +// it use NewRandomFromReader fill random bits. +// On error, NewV7FromReader returns Nil and an error. +func NewV7FromReader(r io.Reader) (UUID, error) { + uuid, err := NewRandomFromReader(r) + if err != nil { + return uuid, err + } + + makeV7(uuid[:]) + return uuid, nil +} + +// makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6]) +// uuid[8] already has the right version number (Variant is 10) +// see function NewV7 and NewV7FromReader +func makeV7(uuid []byte) { + /* + 0 1 2 3 + 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | unix_ts_ms | ver | rand_a | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + |var| rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + | rand_b | + +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ + */ + _ = uuid[15] // bounds check + + t := timeNow().UnixMilli() + + uuid[0] = byte(t >> 40) + uuid[1] = byte(t >> 32) + uuid[2] = byte(t >> 24) + uuid[3] = byte(t >> 16) + uuid[4] = byte(t >> 8) + uuid[5] = byte(t) + + uuid[6] = 0x70 | (uuid[6] & 0x0F) + // uuid[8] has already has right version +} diff --git a/vendor/github.com/gotd/td/tg/tl_account_change_authorization_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_account_change_authorization_settings_gen.go index d975dfbb..d77b9117 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_change_authorization_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_change_authorization_settings_gen.go @@ -32,7 +32,7 @@ var ( ) // AccountChangeAuthorizationSettingsRequest represents TL type `account.changeAuthorizationSettings#40f48462`. -// Change authorization settings +// Change settings related to a session. // // See https://core.telegram.org/method/account.changeAuthorizationSettings for reference. type AccountChangeAuthorizationSettingsRequest struct { @@ -41,7 +41,10 @@ type AccountChangeAuthorizationSettingsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Confirmed field of AccountChangeAuthorizationSettingsRequest. + // If set, confirms a newly logged in session »¹. + // + // Links: + // 1) https://core.telegram.org/api/auth#confirming-login Confirmed bool // Session ID from the authorization¹ constructor, fetchable using account // getAuthorizations² @@ -321,7 +324,7 @@ func (c *AccountChangeAuthorizationSettingsRequest) GetCallRequestsDisabled() (v } // AccountChangeAuthorizationSettings invokes method account.changeAuthorizationSettings#40f48462 returning error if any. -// Change authorization settings +// Change settings related to a session. // // Possible errors: // diff --git a/vendor/github.com/gotd/td/tg/tl_account_finish_takeout_session_gen.go b/vendor/github.com/gotd/td/tg/tl_account_finish_takeout_session_gen.go index 52546f90..0a28e7ce 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_finish_takeout_session_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_finish_takeout_session_gen.go @@ -32,7 +32,10 @@ var ( ) // AccountFinishTakeoutSessionRequest represents TL type `account.finishTakeoutSession#1d2652ee`. -// Finish account takeout session +// Terminate a takeout session, see here » for more info¹. +// +// Links: +// 1. https://core.telegram.org/api/takeout // // See https://core.telegram.org/method/account.finishTakeoutSession for reference. type AccountFinishTakeoutSessionRequest struct { @@ -191,11 +194,14 @@ func (f *AccountFinishTakeoutSessionRequest) GetSuccess() (value bool) { } // AccountFinishTakeoutSession invokes method account.finishTakeoutSession#1d2652ee returning error if any. -// Finish account takeout session +// Terminate a takeout session, see here » for more info¹. +// +// Links: +// 1. https://core.telegram.org/api/takeout // // Possible errors: // -// 403 TAKEOUT_REQUIRED: A takeout session has to be initialized, first. +// 403 TAKEOUT_REQUIRED: A takeout session needs to be initialized first, see here » for more info. // // See https://core.telegram.org/method/account.finishTakeoutSession for reference. func (c *Client) AccountFinishTakeoutSession(ctx context.Context, request *AccountFinishTakeoutSessionRequest) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_account_get_channel_default_emoji_statuses_gen.go b/vendor/github.com/gotd/td/tg/tl_account_get_channel_default_emoji_statuses_gen.go new file mode 100644 index 00000000..544468d1 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_account_get_channel_default_emoji_statuses_gen.go @@ -0,0 +1,176 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// AccountGetChannelDefaultEmojiStatusesRequest represents TL type `account.getChannelDefaultEmojiStatuses#7727a7d5`. +// +// See https://core.telegram.org/method/account.getChannelDefaultEmojiStatuses for reference. +type AccountGetChannelDefaultEmojiStatusesRequest struct { + // Hash field of AccountGetChannelDefaultEmojiStatusesRequest. + Hash int64 +} + +// AccountGetChannelDefaultEmojiStatusesRequestTypeID is TL type id of AccountGetChannelDefaultEmojiStatusesRequest. +const AccountGetChannelDefaultEmojiStatusesRequestTypeID = 0x7727a7d5 + +// Ensuring interfaces in compile-time for AccountGetChannelDefaultEmojiStatusesRequest. +var ( + _ bin.Encoder = &AccountGetChannelDefaultEmojiStatusesRequest{} + _ bin.Decoder = &AccountGetChannelDefaultEmojiStatusesRequest{} + _ bin.BareEncoder = &AccountGetChannelDefaultEmojiStatusesRequest{} + _ bin.BareDecoder = &AccountGetChannelDefaultEmojiStatusesRequest{} +) + +func (g *AccountGetChannelDefaultEmojiStatusesRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Hash == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) String() string { + if g == nil { + return "AccountGetChannelDefaultEmojiStatusesRequest(nil)" + } + type Alias AccountGetChannelDefaultEmojiStatusesRequest + return fmt.Sprintf("AccountGetChannelDefaultEmojiStatusesRequest%+v", Alias(*g)) +} + +// FillFrom fills AccountGetChannelDefaultEmojiStatusesRequest from given interface. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) FillFrom(from interface { + GetHash() (value int64) +}) { + g.Hash = from.GetHash() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*AccountGetChannelDefaultEmojiStatusesRequest) TypeID() uint32 { + return AccountGetChannelDefaultEmojiStatusesRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*AccountGetChannelDefaultEmojiStatusesRequest) TypeName() string { + return "account.getChannelDefaultEmojiStatuses" +} + +// TypeInfo returns info about TL type. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "account.getChannelDefaultEmojiStatuses", + ID: AccountGetChannelDefaultEmojiStatusesRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Hash", + SchemaName: "hash", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode account.getChannelDefaultEmojiStatuses#7727a7d5 as nil") + } + b.PutID(AccountGetChannelDefaultEmojiStatusesRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode account.getChannelDefaultEmojiStatuses#7727a7d5 as nil") + } + b.PutLong(g.Hash) + return nil +} + +// Decode implements bin.Decoder. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode account.getChannelDefaultEmojiStatuses#7727a7d5 to nil") + } + if err := b.ConsumeID(AccountGetChannelDefaultEmojiStatusesRequestTypeID); err != nil { + return fmt.Errorf("unable to decode account.getChannelDefaultEmojiStatuses#7727a7d5: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode account.getChannelDefaultEmojiStatuses#7727a7d5 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode account.getChannelDefaultEmojiStatuses#7727a7d5: field hash: %w", err) + } + g.Hash = value + } + return nil +} + +// GetHash returns value of Hash field. +func (g *AccountGetChannelDefaultEmojiStatusesRequest) GetHash() (value int64) { + if g == nil { + return + } + return g.Hash +} + +// AccountGetChannelDefaultEmojiStatuses invokes method account.getChannelDefaultEmojiStatuses#7727a7d5 returning error if any. +// +// See https://core.telegram.org/method/account.getChannelDefaultEmojiStatuses for reference. +func (c *Client) AccountGetChannelDefaultEmojiStatuses(ctx context.Context, hash int64) (AccountEmojiStatusesClass, error) { + var result AccountEmojiStatusesBox + + request := &AccountGetChannelDefaultEmojiStatusesRequest{ + Hash: hash, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.EmojiStatuses, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_get_app_changelog_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_account_get_channel_default_emoji_statuses_slices_gen.go similarity index 100% rename from vendor/github.com/gotd/td/tg/tl_help_get_app_changelog_slices_gen.go rename to vendor/github.com/gotd/td/tg/tl_account_get_channel_default_emoji_statuses_slices_gen.go diff --git a/vendor/github.com/gotd/td/tg/tl_account_get_channel_restricted_status_emojis_gen.go b/vendor/github.com/gotd/td/tg/tl_account_get_channel_restricted_status_emojis_gen.go new file mode 100644 index 00000000..a806efc3 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_account_get_channel_restricted_status_emojis_gen.go @@ -0,0 +1,176 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// AccountGetChannelRestrictedStatusEmojisRequest represents TL type `account.getChannelRestrictedStatusEmojis#35a9e0d5`. +// +// See https://core.telegram.org/method/account.getChannelRestrictedStatusEmojis for reference. +type AccountGetChannelRestrictedStatusEmojisRequest struct { + // Hash field of AccountGetChannelRestrictedStatusEmojisRequest. + Hash int64 +} + +// AccountGetChannelRestrictedStatusEmojisRequestTypeID is TL type id of AccountGetChannelRestrictedStatusEmojisRequest. +const AccountGetChannelRestrictedStatusEmojisRequestTypeID = 0x35a9e0d5 + +// Ensuring interfaces in compile-time for AccountGetChannelRestrictedStatusEmojisRequest. +var ( + _ bin.Encoder = &AccountGetChannelRestrictedStatusEmojisRequest{} + _ bin.Decoder = &AccountGetChannelRestrictedStatusEmojisRequest{} + _ bin.BareEncoder = &AccountGetChannelRestrictedStatusEmojisRequest{} + _ bin.BareDecoder = &AccountGetChannelRestrictedStatusEmojisRequest{} +) + +func (g *AccountGetChannelRestrictedStatusEmojisRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Hash == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) String() string { + if g == nil { + return "AccountGetChannelRestrictedStatusEmojisRequest(nil)" + } + type Alias AccountGetChannelRestrictedStatusEmojisRequest + return fmt.Sprintf("AccountGetChannelRestrictedStatusEmojisRequest%+v", Alias(*g)) +} + +// FillFrom fills AccountGetChannelRestrictedStatusEmojisRequest from given interface. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) FillFrom(from interface { + GetHash() (value int64) +}) { + g.Hash = from.GetHash() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*AccountGetChannelRestrictedStatusEmojisRequest) TypeID() uint32 { + return AccountGetChannelRestrictedStatusEmojisRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*AccountGetChannelRestrictedStatusEmojisRequest) TypeName() string { + return "account.getChannelRestrictedStatusEmojis" +} + +// TypeInfo returns info about TL type. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "account.getChannelRestrictedStatusEmojis", + ID: AccountGetChannelRestrictedStatusEmojisRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Hash", + SchemaName: "hash", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode account.getChannelRestrictedStatusEmojis#35a9e0d5 as nil") + } + b.PutID(AccountGetChannelRestrictedStatusEmojisRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode account.getChannelRestrictedStatusEmojis#35a9e0d5 as nil") + } + b.PutLong(g.Hash) + return nil +} + +// Decode implements bin.Decoder. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode account.getChannelRestrictedStatusEmojis#35a9e0d5 to nil") + } + if err := b.ConsumeID(AccountGetChannelRestrictedStatusEmojisRequestTypeID); err != nil { + return fmt.Errorf("unable to decode account.getChannelRestrictedStatusEmojis#35a9e0d5: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode account.getChannelRestrictedStatusEmojis#35a9e0d5 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode account.getChannelRestrictedStatusEmojis#35a9e0d5: field hash: %w", err) + } + g.Hash = value + } + return nil +} + +// GetHash returns value of Hash field. +func (g *AccountGetChannelRestrictedStatusEmojisRequest) GetHash() (value int64) { + if g == nil { + return + } + return g.Hash +} + +// AccountGetChannelRestrictedStatusEmojis invokes method account.getChannelRestrictedStatusEmojis#35a9e0d5 returning error if any. +// +// See https://core.telegram.org/method/account.getChannelRestrictedStatusEmojis for reference. +func (c *Client) AccountGetChannelRestrictedStatusEmojis(ctx context.Context, hash int64) (EmojiListClass, error) { + var result EmojiListBox + + request := &AccountGetChannelRestrictedStatusEmojisRequest{ + Hash: hash, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.EmojiList, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_message_interaction_counters_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_account_get_channel_restricted_status_emojis_slices_gen.go similarity index 100% rename from vendor/github.com/gotd/td/tg/tl_message_interaction_counters_slices_gen.go rename to vendor/github.com/gotd/td/tg/tl_account_get_channel_restricted_status_emojis_slices_gen.go diff --git a/vendor/github.com/gotd/td/tg/tl_account_get_default_background_emojis_gen.go b/vendor/github.com/gotd/td/tg/tl_account_get_default_background_emojis_gen.go index f2870079..67547c2e 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_get_default_background_emojis_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_get_default_background_emojis_gen.go @@ -32,10 +32,19 @@ var ( ) // AccountGetDefaultBackgroundEmojisRequest represents TL type `account.getDefaultBackgroundEmojis#a60ab9ce`. +// Get a set of suggested custom emoji stickers¹ that can be used in an accent color +// pattern². +// +// Links: +// 1. https://core.telegram.org/api/custom-emoji +// 2. https://core.telegram.org/api/colors // // See https://core.telegram.org/method/account.getDefaultBackgroundEmojis for reference. type AccountGetDefaultBackgroundEmojisRequest struct { - // Hash field of AccountGetDefaultBackgroundEmojisRequest. + // Hash for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 } @@ -161,6 +170,12 @@ func (g *AccountGetDefaultBackgroundEmojisRequest) GetHash() (value int64) { } // AccountGetDefaultBackgroundEmojis invokes method account.getDefaultBackgroundEmojis#a60ab9ce returning error if any. +// Get a set of suggested custom emoji stickers¹ that can be used in an accent color +// pattern². +// +// Links: +// 1. https://core.telegram.org/api/custom-emoji +// 2. https://core.telegram.org/api/colors // // See https://core.telegram.org/method/account.getDefaultBackgroundEmojis for reference. func (c *Client) AccountGetDefaultBackgroundEmojis(ctx context.Context, hash int64) (EmojiListClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_account_get_notify_exceptions_gen.go b/vendor/github.com/gotd/td/tg/tl_account_get_notify_exceptions_gen.go index 8f608d64..8fab5840 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_get_notify_exceptions_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_get_notify_exceptions_gen.go @@ -41,9 +41,9 @@ type AccountGetNotifyExceptionsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // If true, chats with non-default sound will also be returned + // If set, chats with non-default sound will be returned CompareSound bool - // CompareStories field of AccountGetNotifyExceptionsRequest. + // If set, chats with non-default notification settings for stories will be returned CompareStories bool // If specified, only chats of the specified category will be returned // diff --git a/vendor/github.com/gotd/td/tg/tl_account_init_takeout_session_gen.go b/vendor/github.com/gotd/td/tg/tl_account_init_takeout_session_gen.go index da34bf4c..7e19f0f4 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_init_takeout_session_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_init_takeout_session_gen.go @@ -32,7 +32,10 @@ var ( ) // AccountInitTakeoutSessionRequest represents TL type `account.initTakeoutSession#8ef3eab0`. -// Initialize account takeout session +// Initialize a takeout session, see here » for more info¹. +// +// Links: +// 1. https://core.telegram.org/api/takeout // // See https://core.telegram.org/method/account.initTakeoutSession for reference. type AccountInitTakeoutSessionRequest struct { @@ -423,11 +426,14 @@ func (i *AccountInitTakeoutSessionRequest) GetFileMaxSize() (value int64, ok boo } // AccountInitTakeoutSession invokes method account.initTakeoutSession#8ef3eab0 returning error if any. -// Initialize account takeout session +// Initialize a takeout session, see here » for more info¹. +// +// Links: +// 1. https://core.telegram.org/api/takeout // // Possible errors: // -// 420 TAKEOUT_INIT_DELAY_%d: Wait %d seconds before initializing takeout. +// 420 TAKEOUT_INIT_DELAY_%d: Sorry, for security reasons, you will be able to begin downloading your data in %d seconds. We have notified all your devices about the export request to make sure it's authorized and to give you time to react if it's not. // // See https://core.telegram.org/method/account.initTakeoutSession for reference. func (c *Client) AccountInitTakeoutSession(ctx context.Context, request *AccountInitTakeoutSessionRequest) (*AccountTakeout, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_account_invalidate_sign_in_codes_gen.go b/vendor/github.com/gotd/td/tg/tl_account_invalidate_sign_in_codes_gen.go index 258b4cad..a066b9d0 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_invalidate_sign_in_codes_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_invalidate_sign_in_codes_gen.go @@ -32,10 +32,14 @@ var ( ) // AccountInvalidateSignInCodesRequest represents TL type `account.invalidateSignInCodes#ca8ae8ba`. +// Invalidate the specified login codes, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/auth#invalidating-login-codes // // See https://core.telegram.org/method/account.invalidateSignInCodes for reference. type AccountInvalidateSignInCodesRequest struct { - // Codes field of AccountInvalidateSignInCodesRequest. + // The login codes to invalidate. Codes []string } @@ -174,6 +178,10 @@ func (i *AccountInvalidateSignInCodesRequest) GetCodes() (value []string) { } // AccountInvalidateSignInCodes invokes method account.invalidateSignInCodes#ca8ae8ba returning error if any. +// Invalidate the specified login codes, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/auth#invalidating-login-codes // // See https://core.telegram.org/method/account.invalidateSignInCodes for reference. func (c *Client) AccountInvalidateSignInCodes(ctx context.Context, codes []string) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_account_update_color_gen.go b/vendor/github.com/gotd/td/tg/tl_account_update_color_gen.go index bda15cf0..80e6679e 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_update_color_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_update_color_gen.go @@ -31,22 +31,38 @@ var ( _ = tdjson.Encoder{} ) -// AccountUpdateColorRequest represents TL type `account.updateColor#a001cc43`. +// AccountUpdateColorRequest represents TL type `account.updateColor#7cefa15d`. +// Update the accent color and background custom emoji »¹ of the current account. +// +// Links: +// 1. https://core.telegram.org/api/colors // // See https://core.telegram.org/method/account.updateColor for reference. type AccountUpdateColorRequest struct { - // Flags field of AccountUpdateColorRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Color field of AccountUpdateColorRequest. + // Whether to change the accent color emoji pattern of the profile page; otherwise, the + // accent color and emoji pattern of messages will be changed. + ForProfile bool + // ID of the accent color palette »¹ to use (not RGB24, see here »² for more info). + // + // Links: + // 1) https://core.telegram.org/api/colors + // 2) https://core.telegram.org/api/colors + // + // Use SetColor and GetColor helpers. Color int - // BackgroundEmojiID field of AccountUpdateColorRequest. + // Custom emoji ID used in the accent color pattern. // // Use SetBackgroundEmojiID and GetBackgroundEmojiID helpers. BackgroundEmojiID int64 } // AccountUpdateColorRequestTypeID is TL type id of AccountUpdateColorRequest. -const AccountUpdateColorRequestTypeID = 0xa001cc43 +const AccountUpdateColorRequestTypeID = 0x7cefa15d // Ensuring interfaces in compile-time for AccountUpdateColorRequest. var ( @@ -63,6 +79,9 @@ func (u *AccountUpdateColorRequest) Zero() bool { if !(u.Flags.Zero()) { return false } + if !(u.ForProfile == false) { + return false + } if !(u.Color == 0) { return false } @@ -84,10 +103,15 @@ func (u *AccountUpdateColorRequest) String() string { // FillFrom fills AccountUpdateColorRequest from given interface. func (u *AccountUpdateColorRequest) FillFrom(from interface { - GetColor() (value int) + GetForProfile() (value bool) + GetColor() (value int, ok bool) GetBackgroundEmojiID() (value int64, ok bool) }) { - u.Color = from.GetColor() + u.ForProfile = from.GetForProfile() + if val, ok := from.GetColor(); ok { + u.Color = val + } + if val, ok := from.GetBackgroundEmojiID(); ok { u.BackgroundEmojiID = val } @@ -117,9 +141,15 @@ func (u *AccountUpdateColorRequest) TypeInfo() tdp.Type { return typ } typ.Fields = []tdp.Field{ + { + Name: "ForProfile", + SchemaName: "for_profile", + Null: !u.Flags.Has(1), + }, { Name: "Color", SchemaName: "color", + Null: !u.Flags.Has(2), }, { Name: "BackgroundEmojiID", @@ -132,6 +162,12 @@ func (u *AccountUpdateColorRequest) TypeInfo() tdp.Type { // SetFlags sets flags for non-zero fields. func (u *AccountUpdateColorRequest) SetFlags() { + if !(u.ForProfile == false) { + u.Flags.Set(1) + } + if !(u.Color == 0) { + u.Flags.Set(2) + } if !(u.BackgroundEmojiID == 0) { u.Flags.Set(0) } @@ -140,7 +176,7 @@ func (u *AccountUpdateColorRequest) SetFlags() { // Encode implements bin.Encoder. func (u *AccountUpdateColorRequest) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode account.updateColor#a001cc43 as nil") + return fmt.Errorf("can't encode account.updateColor#7cefa15d as nil") } b.PutID(AccountUpdateColorRequestTypeID) return u.EncodeBare(b) @@ -149,13 +185,15 @@ func (u *AccountUpdateColorRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *AccountUpdateColorRequest) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode account.updateColor#a001cc43 as nil") + return fmt.Errorf("can't encode account.updateColor#7cefa15d as nil") } u.SetFlags() if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode account.updateColor#a001cc43: field flags: %w", err) + return fmt.Errorf("unable to encode account.updateColor#7cefa15d: field flags: %w", err) + } + if u.Flags.Has(2) { + b.PutInt(u.Color) } - b.PutInt(u.Color) if u.Flags.Has(0) { b.PutLong(u.BackgroundEmojiID) } @@ -165,10 +203,10 @@ func (u *AccountUpdateColorRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *AccountUpdateColorRequest) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode account.updateColor#a001cc43 to nil") + return fmt.Errorf("can't decode account.updateColor#7cefa15d to nil") } if err := b.ConsumeID(AccountUpdateColorRequestTypeID); err != nil { - return fmt.Errorf("unable to decode account.updateColor#a001cc43: %w", err) + return fmt.Errorf("unable to decode account.updateColor#7cefa15d: %w", err) } return u.DecodeBare(b) } @@ -176,36 +214,66 @@ func (u *AccountUpdateColorRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *AccountUpdateColorRequest) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode account.updateColor#a001cc43 to nil") + return fmt.Errorf("can't decode account.updateColor#7cefa15d to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode account.updateColor#a001cc43: field flags: %w", err) + return fmt.Errorf("unable to decode account.updateColor#7cefa15d: field flags: %w", err) } } - { + u.ForProfile = u.Flags.Has(1) + if u.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode account.updateColor#a001cc43: field color: %w", err) + return fmt.Errorf("unable to decode account.updateColor#7cefa15d: field color: %w", err) } u.Color = value } if u.Flags.Has(0) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode account.updateColor#a001cc43: field background_emoji_id: %w", err) + return fmt.Errorf("unable to decode account.updateColor#7cefa15d: field background_emoji_id: %w", err) } u.BackgroundEmojiID = value } return nil } -// GetColor returns value of Color field. -func (u *AccountUpdateColorRequest) GetColor() (value int) { +// SetForProfile sets value of ForProfile conditional field. +func (u *AccountUpdateColorRequest) SetForProfile(value bool) { + if value { + u.Flags.Set(1) + u.ForProfile = true + } else { + u.Flags.Unset(1) + u.ForProfile = false + } +} + +// GetForProfile returns value of ForProfile conditional field. +func (u *AccountUpdateColorRequest) GetForProfile() (value bool) { if u == nil { return } - return u.Color + return u.Flags.Has(1) +} + +// SetColor sets value of Color conditional field. +func (u *AccountUpdateColorRequest) SetColor(value int) { + u.Flags.Set(2) + u.Color = value +} + +// GetColor returns value of Color conditional field and +// boolean which is true if field was set. +func (u *AccountUpdateColorRequest) GetColor() (value int, ok bool) { + if u == nil { + return + } + if !u.Flags.Has(2) { + return value, false + } + return u.Color, true } // SetBackgroundEmojiID sets value of BackgroundEmojiID conditional field. @@ -226,7 +294,15 @@ func (u *AccountUpdateColorRequest) GetBackgroundEmojiID() (value int64, ok bool return u.BackgroundEmojiID, true } -// AccountUpdateColor invokes method account.updateColor#a001cc43 returning error if any. +// AccountUpdateColor invokes method account.updateColor#7cefa15d returning error if any. +// Update the accent color and background custom emoji »¹ of the current account. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// Possible errors: +// +// 400 COLOR_INVALID: The specified color palette ID was invalid. // // See https://core.telegram.org/method/account.updateColor for reference. func (c *Client) AccountUpdateColor(ctx context.Context, request *AccountUpdateColorRequest) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_account_update_emoji_status_gen.go b/vendor/github.com/gotd/td/tg/tl_account_update_emoji_status_gen.go index 7820f4a2..425b106b 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_update_emoji_status_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_update_emoji_status_gen.go @@ -183,6 +183,10 @@ func (u *AccountUpdateEmojiStatusRequest) GetEmojiStatusAsNotEmpty() (NotEmptyEm // Links: // 1. https://core.telegram.org/api/emoji-status // +// Possible errors: +// +// 400 DOCUMENT_INVALID: The specified document is invalid. +// // See https://core.telegram.org/method/account.updateEmojiStatus for reference. func (c *Client) AccountUpdateEmojiStatus(ctx context.Context, emojistatus EmojiStatusClass) (bool, error) { var result BoolBox diff --git a/vendor/github.com/gotd/td/tg/tl_account_update_password_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_account_update_password_settings_gen.go index ecfcbdcb..68dd9600 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_update_password_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_update_password_settings_gen.go @@ -209,9 +209,9 @@ func (u *AccountUpdatePasswordSettingsRequest) GetPasswordAsNotEmpty() (*InputCh // // Possible errors: // -// 400 EMAIL_UNCONFIRMED_%d: The provided email isn't confirmed, %d is the length of the verification code that was just sent to the email: use account.verifyEmail to enter the received verification code and enable the recovery email. // 400 EMAIL_INVALID: The specified email is invalid. // 400 EMAIL_UNCONFIRMED: Email unconfirmed. +// 400 EMAIL_UNCONFIRMED_%d: The provided email isn't confirmed, %d is the length of the verification code that was just sent to the email: use account.verifyEmail to enter the received verification code and enable the recovery email. // 400 NEW_SALT_INVALID: The new salt is invalid. // 400 NEW_SETTINGS_EMPTY: No password is set on the current account, and no new password was specified in new_settings. // 400 NEW_SETTINGS_INVALID: The new password settings are invalid. diff --git a/vendor/github.com/gotd/td/tg/tl_account_update_profile_gen.go b/vendor/github.com/gotd/td/tg/tl_account_update_profile_gen.go index c0efea6c..bc7968e1 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_update_profile_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_update_profile_gen.go @@ -305,7 +305,6 @@ func (u *AccountUpdateProfileRequest) GetAbout() (value string, ok bool) { // Possible errors: // // 400 ABOUT_TOO_LONG: About string too long. -// 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 FIRSTNAME_INVALID: The first name is invalid. // // See https://core.telegram.org/method/account.updateProfile for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_account_update_status_gen.go b/vendor/github.com/gotd/td/tg/tl_account_update_status_gen.go index edcfb1be..26bb8ee8 100644 --- a/vendor/github.com/gotd/td/tg/tl_account_update_status_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_account_update_status_gen.go @@ -168,10 +168,6 @@ func (u *AccountUpdateStatusRequest) GetOffline() (value bool) { // AccountUpdateStatus invokes method account.updateStatus#6628562c returning error if any. // Updates online user status. // -// Possible errors: -// -// 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. -// // See https://core.telegram.org/method/account.updateStatus for reference. func (c *Client) AccountUpdateStatus(ctx context.Context, offline bool) (bool, error) { var result BoolBox diff --git a/vendor/github.com/gotd/td/tg/tl_app_web_view_result_url_gen.go b/vendor/github.com/gotd/td/tg/tl_app_web_view_result_url_gen.go index 2852c72f..f9d8ef64 100644 --- a/vendor/github.com/gotd/td/tg/tl_app_web_view_result_url_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_app_web_view_result_url_gen.go @@ -32,10 +32,10 @@ var ( ) // AppWebViewResultURL represents TL type `appWebViewResultUrl#3c1b4f0d`. -// Contains the link that must be used to open a named bot web app¹. +// Contains the link that must be used to open a named Mini App¹. // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-bot-web-apps +// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps // // See https://core.telegram.org/constructor/appWebViewResultUrl for reference. type AppWebViewResultURL struct { diff --git a/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_gen.go b/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_gen.go index a837eab4..a61290bf 100644 --- a/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_gen.go @@ -32,7 +32,9 @@ var ( ) // AttachMenuBot represents TL type `attachMenuBot#d90d8dfe`. -// Represents a bot web app that can be launched from the attachment menu »¹ +// Represents a bot mini app that can be launched from the attachment/side menu »¹ +// At least one of the show_in_attach_menu or the show_in_side_menu flags will always be +// set. // // Links: // 1. https://core.telegram.org/api/bots/attach @@ -44,24 +46,30 @@ type AttachMenuBot struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Whether this bot attachment menu entry should be shown in the attachment menu (toggle - // using messages.toggleBotInAttachMenu¹) + // If set, before launching the mini app the client should ask the user to add the mini + // app to the attachment/side menu, and only if the user accepts, after invoking messages + // toggleBotInAttachMenu¹ the app should be opened. // // Links: // 1) https://core.telegram.org/method/messages.toggleBotInAttachMenu Inactive bool - // True, if the bot supports the "settings_button_pressed" event »¹ - // - // Links: - // 1) https://core.telegram.org/api/bots/webapps#settings-button-pressed + // Deprecated flag, can be ignored. HasSettings bool // Whether the bot would like to send messages to the user. RequestWriteAccess bool - // ShowInAttachMenu field of AttachMenuBot. + // Whether, when installed, an attachment menu entry should be shown for the Mini App. ShowInAttachMenu bool - // ShowInSideMenu field of AttachMenuBot. + // Whether, when installed, an entry in the main view side menu should be shown for the + // Mini App. ShowInSideMenu bool - // SideMenuDisclaimerNeeded field of AttachMenuBot. + // If inactive if set and the user hasn't previously accepted the third-party mini apps + // Terms of Service¹ for this bot, when showing the mini app installation prompt, an + // additional mandatory checkbox to accept the mini apps TOS² and a disclaimer + // indicating that this Mini App is not affiliated to Telegram should be shown. + // + // Links: + // 1) https://telegram.org/tos/mini-apps + // 2) https://telegram.org/tos/mini-apps SideMenuDisclaimerNeeded bool // Bot ID BotID int64 diff --git a/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_color_gen.go b/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_color_gen.go index 664dc5b9..6f4dab8a 100644 --- a/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_color_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_color_gen.go @@ -32,7 +32,7 @@ var ( ) // AttachMenuBotIconColor represents TL type `attachMenuBotIconColor#4576f3f0`. -// Represents an attachment menu icon color for bot web apps »¹ +// Represents an attachment menu icon color for bot mini apps »¹ // // Links: // 1. https://core.telegram.org/api/bots/attach diff --git a/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_gen.go b/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_gen.go index 7f22d240..46f0b6f4 100644 --- a/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_attach_menu_bot_icon_gen.go @@ -32,7 +32,7 @@ var ( ) // AttachMenuBotIcon represents TL type `attachMenuBotIcon#b2a7386b`. -// Represents an attachment menu icon for bot web apps »¹ +// Represents an attachment menu icon for bot mini apps »¹ // // Links: // 1. https://core.telegram.org/api/bots/attach @@ -45,12 +45,15 @@ type AttachMenuBotIcon struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // One of the following values: note that animated icons must be played when the user - // clicks on the button, activating the bot web app. default_static - Default attachment + // clicks on the button, activating the bot mini app. default_static - Default attachment // menu icon in SVG format placeholder_static - Default placeholder for opened Web Apps // in SVG format ios_static - Attachment menu icon in SVG format for the official iOS app // ios_animated - Animated attachment menu icon in TGS format for the official iOS app // android_animated - Animated attachment menu icon in TGS format for the official // Android app macos_animated - Animated attachment menu icon in TGS format for the + // official native Mac OS app ios_side_menu_static - Side menu icon in PNG format for the + // official iOS app android_side_menu_static - Side menu icon in SVG format for the + // official android app macos_side_menu_static - Side menu icon in PNG format for the // official native Mac OS app Name string // The actual icon file. diff --git a/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_bot_gen.go b/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_bot_gen.go index 5b0c48f7..82784332 100644 --- a/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_bot_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_bot_gen.go @@ -32,14 +32,14 @@ var ( ) // AttachMenuBotsBot represents TL type `attachMenuBotsBot#93bf667f`. -// Represents a bot web app that can be launched from the attachment menu »¹ +// Represents a bot mini app that can be launched from the attachment menu »¹ // // Links: // 1. https://core.telegram.org/api/bots/attach // // See https://core.telegram.org/constructor/attachMenuBotsBot for reference. type AttachMenuBotsBot struct { - // Represents a bot web app that can be launched from the attachment menu »¹ + // Represents a bot mini app that can be launched from the attachment menu »¹ // // Links: // 1) https://core.telegram.org/api/bots/attach diff --git a/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_gen.go b/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_gen.go index df192ec1..033e2521 100644 --- a/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_attach_menu_bots_gen.go @@ -32,7 +32,7 @@ var ( ) // AttachMenuBotsNotModified represents TL type `attachMenuBotsNotModified#f1d88a5c`. -// The list of bot web apps hasn't changed +// The list of bot mini apps hasn't changed // // See https://core.telegram.org/constructor/attachMenuBotsNotModified for reference. type AttachMenuBotsNotModified struct { @@ -134,7 +134,7 @@ func (a *AttachMenuBotsNotModified) DecodeBare(b *bin.Buffer) error { } // AttachMenuBots represents TL type `attachMenuBots#3c4301c0`. -// Represents a list of bot web apps that can be launched from the attachment menu »¹ +// Represents a list of bot mini apps that can be launched from the attachment menu »¹ // // Links: // 1. https://core.telegram.org/api/bots/attach @@ -146,7 +146,7 @@ type AttachMenuBots struct { // Links: // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 - // List of bot web apps that can be launched from the attachment menu »¹ + // List of bot mini apps that can be launched from the attachment menu »¹ // // Links: // 1) https://core.telegram.org/api/bots/attach diff --git a/vendor/github.com/gotd/td/tg/tl_auth_import_login_token_gen.go b/vendor/github.com/gotd/td/tg/tl_auth_import_login_token_gen.go index ca286e64..951d010a 100644 --- a/vendor/github.com/gotd/td/tg/tl_auth_import_login_token_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_auth_import_login_token_gen.go @@ -182,6 +182,7 @@ func (i *AuthImportLoginTokenRequest) GetToken() (value []byte) { // 400 AUTH_TOKEN_EXPIRED: The authorization token has expired. // 400 AUTH_TOKEN_INVALID: The specified auth token is invalid. // 400 AUTH_TOKEN_INVALIDX: The specified auth token is invalid. +// 500 MEMBER_NOT_FOUND: // // See https://core.telegram.org/method/auth.importLoginToken for reference. func (c *Client) AuthImportLoginToken(ctx context.Context, token []byte) (AuthLoginTokenClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_auth_login_token_gen.go b/vendor/github.com/gotd/td/tg/tl_auth_login_token_gen.go index 458fd9ef..1d971ea8 100644 --- a/vendor/github.com/gotd/td/tg/tl_auth_login_token_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_auth_login_token_gen.go @@ -39,7 +39,7 @@ var ( // // See https://core.telegram.org/constructor/auth.loginToken for reference. type AuthLoginToken struct { - // Expiry date of QR code + // Expiration date of QR code Expires int // Token to render in QR code Token []byte diff --git a/vendor/github.com/gotd/td/tg/tl_auth_request_firebase_sms_gen.go b/vendor/github.com/gotd/td/tg/tl_auth_request_firebase_sms_gen.go index 9f031d23..5fd97d0c 100644 --- a/vendor/github.com/gotd/td/tg/tl_auth_request_firebase_sms_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_auth_request_firebase_sms_gen.go @@ -319,7 +319,6 @@ func (r *AuthRequestFirebaseSMSRequest) GetIosPushSecret() (value string, ok boo // 400 PHONE_NUMBER_INVALID: The phone number is invalid. // // See https://core.telegram.org/method/auth.requestFirebaseSms for reference. -// Can be used by bots. func (c *Client) AuthRequestFirebaseSMS(ctx context.Context, request *AuthRequestFirebaseSMSRequest) (bool, error) { var result BoolBox diff --git a/vendor/github.com/gotd/td/tg/tl_authorization_gen.go b/vendor/github.com/gotd/td/tg/tl_authorization_gen.go index 9c017e96..e365533d 100644 --- a/vendor/github.com/gotd/td/tg/tl_authorization_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_authorization_gen.go @@ -51,7 +51,10 @@ type Authorization struct { EncryptedRequestsDisabled bool // Whether this session will accept phone calls CallRequestsDisabled bool - // Unconfirmed field of Authorization. + // Whether the session is unconfirmed, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/auth#confirming-login Unconfirmed bool // Identifier Hash int64 diff --git a/vendor/github.com/gotd/td/tg/tl_auto_download_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_auto_download_settings_gen.go index 4f991b83..ad9b3d23 100644 --- a/vendor/github.com/gotd/td/tg/tl_auto_download_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_auto_download_settings_gen.go @@ -49,7 +49,12 @@ type AutoDownloadSettings struct { AudioPreloadNext bool // Whether to enable data saving mode in phone calls PhonecallsLessData bool - // StoriesPreload field of AutoDownloadSettings. + // Whether to preload stories¹; in particular, the first documentAttributeVideo² + // preload_prefix_size bytes of story videos should be preloaded. + // + // Links: + // 1) https://core.telegram.org/api/stories + // 2) https://core.telegram.org/constructor/documentAttributeVideo StoriesPreload bool // Maximum size of photos to preload PhotoSizeMax int diff --git a/vendor/github.com/gotd/td/tg/tl_boost_gen.go b/vendor/github.com/gotd/td/tg/tl_boost_gen.go index 37f42681..d7d873a1 100644 --- a/vendor/github.com/gotd/td/tg/tl_boost_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_boost_gen.go @@ -32,36 +32,61 @@ var ( ) // Boost represents TL type `boost#2a1c8c71`. +// Info about one or more boosts¹ applied by a specific user. +// +// Links: +// 1. https://core.telegram.org/api/boost // // See https://core.telegram.org/constructor/boost for reference. type Boost struct { - // Flags field of Boost. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Gift field of Boost. + // Whether this boost was applied because the channel directly gifted a subscription to + // the user¹. + // + // Links: + // 1) https://core.telegram.org/api/giveaways Gift bool - // Giveaway field of Boost. + // Whether this boost was applied because the user was chosen in a giveaway started by + // the channel¹. + // + // Links: + // 1) https://core.telegram.org/api/giveaways Giveaway bool - // Unclaimed field of Boost. + // If set, the user hasn't yet invoked payments.applyGiftCode¹ to claim a subscription + // gifted directly or in a giveaway by the channel². + // + // Links: + // 1) https://core.telegram.org/method/payments.applyGiftCode + // 2) https://core.telegram.org/api/giveaways Unclaimed bool - // ID field of Boost. + // Unique ID for this set of boosts. ID string - // UserID field of Boost. + // ID of the user that applied the boost. // // Use SetUserID and GetUserID helpers. UserID int64 - // GiveawayMsgID field of Boost. + // The message ID of the giveaway¹ + // + // Links: + // 1) https://core.telegram.org/api/giveaways // // Use SetGiveawayMsgID and GetGiveawayMsgID helpers. GiveawayMsgID int - // Date field of Boost. + // When was the boost applied Date int - // Expires field of Boost. + // When does the boost expire Expires int - // UsedGiftSlug field of Boost. + // The created Telegram Premium gift code, only set if either gift or giveaway are set + // AND it is either a gift code for the currently logged in user or if it was already + // claimed. // // Use SetUsedGiftSlug and GetUsedGiftSlug helpers. UsedGiftSlug string - // Multiplier field of Boost. + // If set, this boost counts as multiplier boosts, otherwise it counts as a single boost. // // Use SetMultiplier and GetMultiplier helpers. Multiplier int diff --git a/vendor/github.com/gotd/td/tg/tl_bot_app_gen.go b/vendor/github.com/gotd/td/tg/tl_bot_app_gen.go index 1116724f..2d52c385 100644 --- a/vendor/github.com/gotd/td/tg/tl_bot_app_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_bot_app_gen.go @@ -134,10 +134,10 @@ func (b *BotAppNotModified) DecodeBare(buf *bin.Buffer) error { } // BotApp represents TL type `botApp#95fcd1d6`. -// Contains information about a named bot web app¹. +// Contains information about a named Mini App¹. // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-bot-web-apps +// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps // // See https://core.telegram.org/constructor/botApp for reference. type BotApp struct { @@ -146,22 +146,22 @@ type BotApp struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Bot web app ID + // bot mini app ID ID int64 - // Bot web app access hash + // bot mini app access hash AccessHash int64 - // Bot web app short name, used to generate named bot web app deep links¹. + // bot mini app short name, used to generate named Mini App deep links¹. // // Links: - // 1) https://core.telegram.org/api/links#named-bot-web-app-links + // 1) https://core.telegram.org/api/links#named-mini-app-links ShortName string - // Bot web app title. + // bot mini app title. Title string - // Bot web app description. + // bot mini app description. Description string - // Bot web app photo. + // bot mini app photo. Photo PhotoClass - // Bot web app animation. + // bot mini app animation. // // Use SetDocument and GetDocument helpers. Document DocumentClass diff --git a/vendor/github.com/gotd/td/tg/tl_bot_inline_message_gen.go b/vendor/github.com/gotd/td/tg/tl_bot_inline_message_gen.go index 7ed88a36..b781852e 100644 --- a/vendor/github.com/gotd/td/tg/tl_bot_inline_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_bot_inline_message_gen.go @@ -44,7 +44,8 @@ type BotInlineMessageMediaAuto struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // InvertMedia field of BotInlineMessageMediaAuto. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // Caption Message string @@ -367,7 +368,8 @@ type BotInlineMessageText struct { Flags bin.Fields // Disable webpage preview NoWebpage bool - // InvertMedia field of BotInlineMessageText. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // The message Message string @@ -1092,7 +1094,8 @@ type BotInlineMessageMediaVenue struct { Title string // Address Address string - // Venue provider: currently only "foursquare" needs to be supported + // Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be + // supported Provider string // Venue ID in the provider's database VenueID string @@ -2138,30 +2141,44 @@ func (b *BotInlineMessageMediaInvoice) GetReplyMarkup() (value ReplyMarkupClass, } // BotInlineMessageMediaWebPage represents TL type `botInlineMessageMediaWebPage#809ad9a6`. +// Specifies options that must be used to generate the link preview for the message, or +// even a standalone link preview without an attached message. // // See https://core.telegram.org/constructor/botInlineMessageMediaWebPage for reference. type BotInlineMessageMediaWebPage struct { - // Flags field of BotInlineMessageMediaWebPage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // InvertMedia field of BotInlineMessageMediaWebPage. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool - // ForceLargeMedia field of BotInlineMessageMediaWebPage. + // If set, specifies that a large media preview should be used. ForceLargeMedia bool - // ForceSmallMedia field of BotInlineMessageMediaWebPage. + // If set, specifies that a small media preview should be used. ForceSmallMedia bool - // Manual field of BotInlineMessageMediaWebPage. + // If set, indicates that the URL used for the webpage preview was specified manually + // using inputMediaWebPage¹, and may not be related to any of the URLs specified in the + // message. + // + // Links: + // 1) https://core.telegram.org/constructor/inputMediaWebPage Manual bool - // Safe field of BotInlineMessageMediaWebPage. + // If set, the link can be opened directly without user confirmation. Safe bool - // Message field of BotInlineMessageMediaWebPage. + // The message, can be empty. Message string - // Entities field of BotInlineMessageMediaWebPage. + // Message entities for styled text¹ + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // URL field of BotInlineMessageMediaWebPage. + // The URL to use for the link preview. URL string - // ReplyMarkup field of BotInlineMessageMediaWebPage. + // Reply markup for sending bot buttons // // Use SetReplyMarkup and GetReplyMarkup helpers. ReplyMarkup ReplyMarkupClass diff --git a/vendor/github.com/gotd/td/tg/tl_bots_allow_send_message_gen.go b/vendor/github.com/gotd/td/tg/tl_bots_allow_send_message_gen.go index db30247f..087663b3 100644 --- a/vendor/github.com/gotd/td/tg/tl_bots_allow_send_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_bots_allow_send_message_gen.go @@ -32,10 +32,11 @@ var ( ) // BotsAllowSendMessageRequest represents TL type `bots.allowSendMessage#f132e3ef`. +// Allow the specified bot to send us messages // // See https://core.telegram.org/method/bots.allowSendMessage for reference. type BotsAllowSendMessageRequest struct { - // Bot field of BotsAllowSendMessageRequest. + // The bot Bot InputUserClass } @@ -166,6 +167,11 @@ func (a *BotsAllowSendMessageRequest) GetBot() (value InputUserClass) { } // BotsAllowSendMessage invokes method bots.allowSendMessage#f132e3ef returning error if any. +// Allow the specified bot to send us messages +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.allowSendMessage for reference. func (c *Client) BotsAllowSendMessage(ctx context.Context, bot InputUserClass) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_bots_can_send_message_gen.go b/vendor/github.com/gotd/td/tg/tl_bots_can_send_message_gen.go index 930f0db4..62f49c94 100644 --- a/vendor/github.com/gotd/td/tg/tl_bots_can_send_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_bots_can_send_message_gen.go @@ -32,10 +32,11 @@ var ( ) // BotsCanSendMessageRequest represents TL type `bots.canSendMessage#1359f4e6`. +// Check whether the specified bot can send us messages // // See https://core.telegram.org/method/bots.canSendMessage for reference. type BotsCanSendMessageRequest struct { - // Bot field of BotsCanSendMessageRequest. + // The bot Bot InputUserClass } @@ -166,6 +167,11 @@ func (c *BotsCanSendMessageRequest) GetBot() (value InputUserClass) { } // BotsCanSendMessage invokes method bots.canSendMessage#1359f4e6 returning error if any. +// Check whether the specified bot can send us messages +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.canSendMessage for reference. func (c *Client) BotsCanSendMessage(ctx context.Context, bot InputUserClass) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_bots_invoke_web_view_custom_method_gen.go b/vendor/github.com/gotd/td/tg/tl_bots_invoke_web_view_custom_method_gen.go index b128b7b7..a542b5d5 100644 --- a/vendor/github.com/gotd/td/tg/tl_bots_invoke_web_view_custom_method_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_bots_invoke_web_view_custom_method_gen.go @@ -32,14 +32,27 @@ var ( ) // BotsInvokeWebViewCustomMethodRequest represents TL type `bots.invokeWebViewCustomMethod#87fc5e7`. +// Send a custom request from a mini bot app¹, triggered by a +// web_app_invoke_custom_method event »². +// The response should be sent using a custom_method_invoked¹ event, see here »² for +// more info on the flow. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps +// 2. https://core.telegram.org/api/web-events#web-app-invoke-custom-method +// 3. https://core.telegram.org/api/bots/webapps#custom-method-invoked +// 4. https://core.telegram.org/api/web-events#web-app-invoke-custom-method // // See https://core.telegram.org/method/bots.invokeWebViewCustomMethod for reference. type BotsInvokeWebViewCustomMethodRequest struct { - // Bot field of BotsInvokeWebViewCustomMethodRequest. + // Identifier of the bot associated to the mini bot app¹ + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps Bot InputUserClass - // CustomMethod field of BotsInvokeWebViewCustomMethodRequest. + // Identifier of the custom method to invoke CustomMethod string - // Params field of BotsInvokeWebViewCustomMethodRequest. + // Method parameters Params DataJSON } @@ -220,6 +233,20 @@ func (i *BotsInvokeWebViewCustomMethodRequest) GetParams() (value DataJSON) { } // BotsInvokeWebViewCustomMethod invokes method bots.invokeWebViewCustomMethod#87fc5e7 returning error if any. +// Send a custom request from a mini bot app¹, triggered by a +// web_app_invoke_custom_method event »². +// The response should be sent using a custom_method_invoked¹ event, see here »² for +// more info on the flow. +// +// Links: +// 1. https://core.telegram.org/api/bots/webapps +// 2. https://core.telegram.org/api/web-events#web-app-invoke-custom-method +// 3. https://core.telegram.org/api/bots/webapps#custom-method-invoked +// 4. https://core.telegram.org/api/web-events#web-app-invoke-custom-method +// +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. // // See https://core.telegram.org/method/bots.invokeWebViewCustomMethod for reference. func (c *Client) BotsInvokeWebViewCustomMethod(ctx context.Context, request *BotsInvokeWebViewCustomMethodRequest) (*DataJSON, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_gen.go b/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_gen.go index b80a19d4..282428b8 100644 --- a/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_gen.go @@ -6707,40 +6707,42 @@ func (c *ChannelAdminLogEventActionToggleAntiSpam) GetNewValue() (value bool) { return c.NewValue } -// ChannelAdminLogEventActionChangeColor represents TL type `channelAdminLogEventActionChangeColor#3c2b247b`. +// ChannelAdminLogEventActionChangePeerColor represents TL type `channelAdminLogEventActionChangePeerColor#5796e780`. // -// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeColor for reference. -type ChannelAdminLogEventActionChangeColor struct { - // PrevValue field of ChannelAdminLogEventActionChangeColor. - PrevValue int - // NewValue field of ChannelAdminLogEventActionChangeColor. - NewValue int +// See https://core.telegram.org/constructor/channelAdminLogEventActionChangePeerColor for reference. +type ChannelAdminLogEventActionChangePeerColor struct { + // PrevValue field of ChannelAdminLogEventActionChangePeerColor. + PrevValue PeerColor + // NewValue field of ChannelAdminLogEventActionChangePeerColor. + NewValue PeerColor } -// ChannelAdminLogEventActionChangeColorTypeID is TL type id of ChannelAdminLogEventActionChangeColor. -const ChannelAdminLogEventActionChangeColorTypeID = 0x3c2b247b +// ChannelAdminLogEventActionChangePeerColorTypeID is TL type id of ChannelAdminLogEventActionChangePeerColor. +const ChannelAdminLogEventActionChangePeerColorTypeID = 0x5796e780 // construct implements constructor of ChannelAdminLogEventActionClass. -func (c ChannelAdminLogEventActionChangeColor) construct() ChannelAdminLogEventActionClass { return &c } +func (c ChannelAdminLogEventActionChangePeerColor) construct() ChannelAdminLogEventActionClass { + return &c +} -// Ensuring interfaces in compile-time for ChannelAdminLogEventActionChangeColor. +// Ensuring interfaces in compile-time for ChannelAdminLogEventActionChangePeerColor. var ( - _ bin.Encoder = &ChannelAdminLogEventActionChangeColor{} - _ bin.Decoder = &ChannelAdminLogEventActionChangeColor{} - _ bin.BareEncoder = &ChannelAdminLogEventActionChangeColor{} - _ bin.BareDecoder = &ChannelAdminLogEventActionChangeColor{} + _ bin.Encoder = &ChannelAdminLogEventActionChangePeerColor{} + _ bin.Decoder = &ChannelAdminLogEventActionChangePeerColor{} + _ bin.BareEncoder = &ChannelAdminLogEventActionChangePeerColor{} + _ bin.BareDecoder = &ChannelAdminLogEventActionChangePeerColor{} - _ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeColor{} + _ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangePeerColor{} ) -func (c *ChannelAdminLogEventActionChangeColor) Zero() bool { +func (c *ChannelAdminLogEventActionChangePeerColor) Zero() bool { if c == nil { return true } - if !(c.PrevValue == 0) { + if !(c.PrevValue.Zero()) { return false } - if !(c.NewValue == 0) { + if !(c.NewValue.Zero()) { return false } @@ -6748,18 +6750,18 @@ func (c *ChannelAdminLogEventActionChangeColor) Zero() bool { } // String implements fmt.Stringer. -func (c *ChannelAdminLogEventActionChangeColor) String() string { +func (c *ChannelAdminLogEventActionChangePeerColor) String() string { if c == nil { - return "ChannelAdminLogEventActionChangeColor(nil)" + return "ChannelAdminLogEventActionChangePeerColor(nil)" } - type Alias ChannelAdminLogEventActionChangeColor - return fmt.Sprintf("ChannelAdminLogEventActionChangeColor%+v", Alias(*c)) + type Alias ChannelAdminLogEventActionChangePeerColor + return fmt.Sprintf("ChannelAdminLogEventActionChangePeerColor%+v", Alias(*c)) } -// FillFrom fills ChannelAdminLogEventActionChangeColor from given interface. -func (c *ChannelAdminLogEventActionChangeColor) FillFrom(from interface { - GetPrevValue() (value int) - GetNewValue() (value int) +// FillFrom fills ChannelAdminLogEventActionChangePeerColor from given interface. +func (c *ChannelAdminLogEventActionChangePeerColor) FillFrom(from interface { + GetPrevValue() (value PeerColor) + GetNewValue() (value PeerColor) }) { c.PrevValue = from.GetPrevValue() c.NewValue = from.GetNewValue() @@ -6768,20 +6770,20 @@ func (c *ChannelAdminLogEventActionChangeColor) FillFrom(from interface { // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ChannelAdminLogEventActionChangeColor) TypeID() uint32 { - return ChannelAdminLogEventActionChangeColorTypeID +func (*ChannelAdminLogEventActionChangePeerColor) TypeID() uint32 { + return ChannelAdminLogEventActionChangePeerColorTypeID } // TypeName returns name of type in TL schema. -func (*ChannelAdminLogEventActionChangeColor) TypeName() string { - return "channelAdminLogEventActionChangeColor" +func (*ChannelAdminLogEventActionChangePeerColor) TypeName() string { + return "channelAdminLogEventActionChangePeerColor" } // TypeInfo returns info about TL type. -func (c *ChannelAdminLogEventActionChangeColor) TypeInfo() tdp.Type { +func (c *ChannelAdminLogEventActionChangePeerColor) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "channelAdminLogEventActionChangeColor", - ID: ChannelAdminLogEventActionChangeColorTypeID, + Name: "channelAdminLogEventActionChangePeerColor", + ID: ChannelAdminLogEventActionChangePeerColorTypeID, } if c == nil { typ.Null = true @@ -6801,59 +6803,59 @@ func (c *ChannelAdminLogEventActionChangeColor) TypeInfo() tdp.Type { } // Encode implements bin.Encoder. -func (c *ChannelAdminLogEventActionChangeColor) Encode(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangePeerColor) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeColor#3c2b247b as nil") + return fmt.Errorf("can't encode channelAdminLogEventActionChangePeerColor#5796e780 as nil") } - b.PutID(ChannelAdminLogEventActionChangeColorTypeID) + b.PutID(ChannelAdminLogEventActionChangePeerColorTypeID) return c.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (c *ChannelAdminLogEventActionChangeColor) EncodeBare(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangePeerColor) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeColor#3c2b247b as nil") + return fmt.Errorf("can't encode channelAdminLogEventActionChangePeerColor#5796e780 as nil") + } + if err := c.PrevValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangePeerColor#5796e780: field prev_value: %w", err) + } + if err := c.NewValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangePeerColor#5796e780: field new_value: %w", err) } - b.PutInt(c.PrevValue) - b.PutInt(c.NewValue) return nil } // Decode implements bin.Decoder. -func (c *ChannelAdminLogEventActionChangeColor) Decode(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangePeerColor) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeColor#3c2b247b to nil") + return fmt.Errorf("can't decode channelAdminLogEventActionChangePeerColor#5796e780 to nil") } - if err := b.ConsumeID(ChannelAdminLogEventActionChangeColorTypeID); err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeColor#3c2b247b: %w", err) + if err := b.ConsumeID(ChannelAdminLogEventActionChangePeerColorTypeID); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangePeerColor#5796e780: %w", err) } return c.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (c *ChannelAdminLogEventActionChangeColor) DecodeBare(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangePeerColor) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeColor#3c2b247b to nil") + return fmt.Errorf("can't decode channelAdminLogEventActionChangePeerColor#5796e780 to nil") } { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeColor#3c2b247b: field prev_value: %w", err) + if err := c.PrevValue.Decode(b); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangePeerColor#5796e780: field prev_value: %w", err) } - c.PrevValue = value } { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeColor#3c2b247b: field new_value: %w", err) + if err := c.NewValue.Decode(b); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangePeerColor#5796e780: field new_value: %w", err) } - c.NewValue = value } return nil } // GetPrevValue returns value of PrevValue field. -func (c *ChannelAdminLogEventActionChangeColor) GetPrevValue() (value int) { +func (c *ChannelAdminLogEventActionChangePeerColor) GetPrevValue() (value PeerColor) { if c == nil { return } @@ -6861,49 +6863,49 @@ func (c *ChannelAdminLogEventActionChangeColor) GetPrevValue() (value int) { } // GetNewValue returns value of NewValue field. -func (c *ChannelAdminLogEventActionChangeColor) GetNewValue() (value int) { +func (c *ChannelAdminLogEventActionChangePeerColor) GetNewValue() (value PeerColor) { if c == nil { return } return c.NewValue } -// ChannelAdminLogEventActionChangeBackgroundEmoji represents TL type `channelAdminLogEventActionChangeBackgroundEmoji#445fc434`. +// ChannelAdminLogEventActionChangeProfilePeerColor represents TL type `channelAdminLogEventActionChangeProfilePeerColor#5e477b25`. // -// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeBackgroundEmoji for reference. -type ChannelAdminLogEventActionChangeBackgroundEmoji struct { - // PrevValue field of ChannelAdminLogEventActionChangeBackgroundEmoji. - PrevValue int64 - // NewValue field of ChannelAdminLogEventActionChangeBackgroundEmoji. - NewValue int64 +// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeProfilePeerColor for reference. +type ChannelAdminLogEventActionChangeProfilePeerColor struct { + // PrevValue field of ChannelAdminLogEventActionChangeProfilePeerColor. + PrevValue PeerColor + // NewValue field of ChannelAdminLogEventActionChangeProfilePeerColor. + NewValue PeerColor } -// ChannelAdminLogEventActionChangeBackgroundEmojiTypeID is TL type id of ChannelAdminLogEventActionChangeBackgroundEmoji. -const ChannelAdminLogEventActionChangeBackgroundEmojiTypeID = 0x445fc434 +// ChannelAdminLogEventActionChangeProfilePeerColorTypeID is TL type id of ChannelAdminLogEventActionChangeProfilePeerColor. +const ChannelAdminLogEventActionChangeProfilePeerColorTypeID = 0x5e477b25 // construct implements constructor of ChannelAdminLogEventActionClass. -func (c ChannelAdminLogEventActionChangeBackgroundEmoji) construct() ChannelAdminLogEventActionClass { +func (c ChannelAdminLogEventActionChangeProfilePeerColor) construct() ChannelAdminLogEventActionClass { return &c } -// Ensuring interfaces in compile-time for ChannelAdminLogEventActionChangeBackgroundEmoji. +// Ensuring interfaces in compile-time for ChannelAdminLogEventActionChangeProfilePeerColor. var ( - _ bin.Encoder = &ChannelAdminLogEventActionChangeBackgroundEmoji{} - _ bin.Decoder = &ChannelAdminLogEventActionChangeBackgroundEmoji{} - _ bin.BareEncoder = &ChannelAdminLogEventActionChangeBackgroundEmoji{} - _ bin.BareDecoder = &ChannelAdminLogEventActionChangeBackgroundEmoji{} + _ bin.Encoder = &ChannelAdminLogEventActionChangeProfilePeerColor{} + _ bin.Decoder = &ChannelAdminLogEventActionChangeProfilePeerColor{} + _ bin.BareEncoder = &ChannelAdminLogEventActionChangeProfilePeerColor{} + _ bin.BareDecoder = &ChannelAdminLogEventActionChangeProfilePeerColor{} - _ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeBackgroundEmoji{} + _ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeProfilePeerColor{} ) -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) Zero() bool { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) Zero() bool { if c == nil { return true } - if !(c.PrevValue == 0) { + if !(c.PrevValue.Zero()) { return false } - if !(c.NewValue == 0) { + if !(c.NewValue.Zero()) { return false } @@ -6911,18 +6913,18 @@ func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) Zero() bool { } // String implements fmt.Stringer. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) String() string { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) String() string { if c == nil { - return "ChannelAdminLogEventActionChangeBackgroundEmoji(nil)" + return "ChannelAdminLogEventActionChangeProfilePeerColor(nil)" } - type Alias ChannelAdminLogEventActionChangeBackgroundEmoji - return fmt.Sprintf("ChannelAdminLogEventActionChangeBackgroundEmoji%+v", Alias(*c)) + type Alias ChannelAdminLogEventActionChangeProfilePeerColor + return fmt.Sprintf("ChannelAdminLogEventActionChangeProfilePeerColor%+v", Alias(*c)) } -// FillFrom fills ChannelAdminLogEventActionChangeBackgroundEmoji from given interface. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) FillFrom(from interface { - GetPrevValue() (value int64) - GetNewValue() (value int64) +// FillFrom fills ChannelAdminLogEventActionChangeProfilePeerColor from given interface. +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) FillFrom(from interface { + GetPrevValue() (value PeerColor) + GetNewValue() (value PeerColor) }) { c.PrevValue = from.GetPrevValue() c.NewValue = from.GetNewValue() @@ -6931,20 +6933,20 @@ func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) FillFrom(from interfac // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ChannelAdminLogEventActionChangeBackgroundEmoji) TypeID() uint32 { - return ChannelAdminLogEventActionChangeBackgroundEmojiTypeID +func (*ChannelAdminLogEventActionChangeProfilePeerColor) TypeID() uint32 { + return ChannelAdminLogEventActionChangeProfilePeerColorTypeID } // TypeName returns name of type in TL schema. -func (*ChannelAdminLogEventActionChangeBackgroundEmoji) TypeName() string { - return "channelAdminLogEventActionChangeBackgroundEmoji" +func (*ChannelAdminLogEventActionChangeProfilePeerColor) TypeName() string { + return "channelAdminLogEventActionChangeProfilePeerColor" } // TypeInfo returns info about TL type. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) TypeInfo() tdp.Type { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "channelAdminLogEventActionChangeBackgroundEmoji", - ID: ChannelAdminLogEventActionChangeBackgroundEmojiTypeID, + Name: "channelAdminLogEventActionChangeProfilePeerColor", + ID: ChannelAdminLogEventActionChangeProfilePeerColorTypeID, } if c == nil { typ.Null = true @@ -6964,59 +6966,59 @@ func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) TypeInfo() tdp.Type { } // Encode implements bin.Encoder. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) Encode(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeBackgroundEmoji#445fc434 as nil") + return fmt.Errorf("can't encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 as nil") } - b.PutID(ChannelAdminLogEventActionChangeBackgroundEmojiTypeID) + b.PutID(ChannelAdminLogEventActionChangeProfilePeerColorTypeID) return c.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) EncodeBare(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelAdminLogEventActionChangeBackgroundEmoji#445fc434 as nil") + return fmt.Errorf("can't encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 as nil") + } + if err := c.PrevValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field prev_value: %w", err) + } + if err := c.NewValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field new_value: %w", err) } - b.PutLong(c.PrevValue) - b.PutLong(c.NewValue) return nil } // Decode implements bin.Decoder. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) Decode(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeBackgroundEmoji#445fc434 to nil") + return fmt.Errorf("can't decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 to nil") } - if err := b.ConsumeID(ChannelAdminLogEventActionChangeBackgroundEmojiTypeID); err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeBackgroundEmoji#445fc434: %w", err) + if err := b.ConsumeID(ChannelAdminLogEventActionChangeProfilePeerColorTypeID); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: %w", err) } return c.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) DecodeBare(b *bin.Buffer) error { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelAdminLogEventActionChangeBackgroundEmoji#445fc434 to nil") + return fmt.Errorf("can't decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25 to nil") } { - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeBackgroundEmoji#445fc434: field prev_value: %w", err) + if err := c.PrevValue.Decode(b); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field prev_value: %w", err) } - c.PrevValue = value } { - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode channelAdminLogEventActionChangeBackgroundEmoji#445fc434: field new_value: %w", err) + if err := c.NewValue.Decode(b); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeProfilePeerColor#5e477b25: field new_value: %w", err) } - c.NewValue = value } return nil } // GetPrevValue returns value of PrevValue field. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) GetPrevValue() (value int64) { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) GetPrevValue() (value PeerColor) { if c == nil { return } @@ -7024,7 +7026,353 @@ func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) GetPrevValue() (value } // GetNewValue returns value of NewValue field. -func (c *ChannelAdminLogEventActionChangeBackgroundEmoji) GetNewValue() (value int64) { +func (c *ChannelAdminLogEventActionChangeProfilePeerColor) GetNewValue() (value PeerColor) { + if c == nil { + return + } + return c.NewValue +} + +// ChannelAdminLogEventActionChangeWallpaper represents TL type `channelAdminLogEventActionChangeWallpaper#31bb5d52`. +// +// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeWallpaper for reference. +type ChannelAdminLogEventActionChangeWallpaper struct { + // PrevValue field of ChannelAdminLogEventActionChangeWallpaper. + PrevValue WallPaperClass + // NewValue field of ChannelAdminLogEventActionChangeWallpaper. + NewValue WallPaperClass +} + +// ChannelAdminLogEventActionChangeWallpaperTypeID is TL type id of ChannelAdminLogEventActionChangeWallpaper. +const ChannelAdminLogEventActionChangeWallpaperTypeID = 0x31bb5d52 + +// construct implements constructor of ChannelAdminLogEventActionClass. +func (c ChannelAdminLogEventActionChangeWallpaper) construct() ChannelAdminLogEventActionClass { + return &c +} + +// Ensuring interfaces in compile-time for ChannelAdminLogEventActionChangeWallpaper. +var ( + _ bin.Encoder = &ChannelAdminLogEventActionChangeWallpaper{} + _ bin.Decoder = &ChannelAdminLogEventActionChangeWallpaper{} + _ bin.BareEncoder = &ChannelAdminLogEventActionChangeWallpaper{} + _ bin.BareDecoder = &ChannelAdminLogEventActionChangeWallpaper{} + + _ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeWallpaper{} +) + +func (c *ChannelAdminLogEventActionChangeWallpaper) Zero() bool { + if c == nil { + return true + } + if !(c.PrevValue == nil) { + return false + } + if !(c.NewValue == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChannelAdminLogEventActionChangeWallpaper) String() string { + if c == nil { + return "ChannelAdminLogEventActionChangeWallpaper(nil)" + } + type Alias ChannelAdminLogEventActionChangeWallpaper + return fmt.Sprintf("ChannelAdminLogEventActionChangeWallpaper%+v", Alias(*c)) +} + +// FillFrom fills ChannelAdminLogEventActionChangeWallpaper from given interface. +func (c *ChannelAdminLogEventActionChangeWallpaper) FillFrom(from interface { + GetPrevValue() (value WallPaperClass) + GetNewValue() (value WallPaperClass) +}) { + c.PrevValue = from.GetPrevValue() + c.NewValue = from.GetNewValue() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChannelAdminLogEventActionChangeWallpaper) TypeID() uint32 { + return ChannelAdminLogEventActionChangeWallpaperTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChannelAdminLogEventActionChangeWallpaper) TypeName() string { + return "channelAdminLogEventActionChangeWallpaper" +} + +// TypeInfo returns info about TL type. +func (c *ChannelAdminLogEventActionChangeWallpaper) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "channelAdminLogEventActionChangeWallpaper", + ID: ChannelAdminLogEventActionChangeWallpaperTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "PrevValue", + SchemaName: "prev_value", + }, + { + Name: "NewValue", + SchemaName: "new_value", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChannelAdminLogEventActionChangeWallpaper) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode channelAdminLogEventActionChangeWallpaper#31bb5d52 as nil") + } + b.PutID(ChannelAdminLogEventActionChangeWallpaperTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChannelAdminLogEventActionChangeWallpaper) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode channelAdminLogEventActionChangeWallpaper#31bb5d52 as nil") + } + if c.PrevValue == nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field prev_value is nil") + } + if err := c.PrevValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field prev_value: %w", err) + } + if c.NewValue == nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field new_value is nil") + } + if err := c.NewValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeWallpaper#31bb5d52: field new_value: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (c *ChannelAdminLogEventActionChangeWallpaper) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode channelAdminLogEventActionChangeWallpaper#31bb5d52 to nil") + } + if err := b.ConsumeID(ChannelAdminLogEventActionChangeWallpaperTypeID); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeWallpaper#31bb5d52: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChannelAdminLogEventActionChangeWallpaper) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode channelAdminLogEventActionChangeWallpaper#31bb5d52 to nil") + } + { + value, err := DecodeWallPaper(b) + if err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeWallpaper#31bb5d52: field prev_value: %w", err) + } + c.PrevValue = value + } + { + value, err := DecodeWallPaper(b) + if err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeWallpaper#31bb5d52: field new_value: %w", err) + } + c.NewValue = value + } + return nil +} + +// GetPrevValue returns value of PrevValue field. +func (c *ChannelAdminLogEventActionChangeWallpaper) GetPrevValue() (value WallPaperClass) { + if c == nil { + return + } + return c.PrevValue +} + +// GetNewValue returns value of NewValue field. +func (c *ChannelAdminLogEventActionChangeWallpaper) GetNewValue() (value WallPaperClass) { + if c == nil { + return + } + return c.NewValue +} + +// ChannelAdminLogEventActionChangeEmojiStatus represents TL type `channelAdminLogEventActionChangeEmojiStatus#3ea9feb1`. +// +// See https://core.telegram.org/constructor/channelAdminLogEventActionChangeEmojiStatus for reference. +type ChannelAdminLogEventActionChangeEmojiStatus struct { + // PrevValue field of ChannelAdminLogEventActionChangeEmojiStatus. + PrevValue EmojiStatusClass + // NewValue field of ChannelAdminLogEventActionChangeEmojiStatus. + NewValue EmojiStatusClass +} + +// ChannelAdminLogEventActionChangeEmojiStatusTypeID is TL type id of ChannelAdminLogEventActionChangeEmojiStatus. +const ChannelAdminLogEventActionChangeEmojiStatusTypeID = 0x3ea9feb1 + +// construct implements constructor of ChannelAdminLogEventActionClass. +func (c ChannelAdminLogEventActionChangeEmojiStatus) construct() ChannelAdminLogEventActionClass { + return &c +} + +// Ensuring interfaces in compile-time for ChannelAdminLogEventActionChangeEmojiStatus. +var ( + _ bin.Encoder = &ChannelAdminLogEventActionChangeEmojiStatus{} + _ bin.Decoder = &ChannelAdminLogEventActionChangeEmojiStatus{} + _ bin.BareEncoder = &ChannelAdminLogEventActionChangeEmojiStatus{} + _ bin.BareDecoder = &ChannelAdminLogEventActionChangeEmojiStatus{} + + _ ChannelAdminLogEventActionClass = &ChannelAdminLogEventActionChangeEmojiStatus{} +) + +func (c *ChannelAdminLogEventActionChangeEmojiStatus) Zero() bool { + if c == nil { + return true + } + if !(c.PrevValue == nil) { + return false + } + if !(c.NewValue == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) String() string { + if c == nil { + return "ChannelAdminLogEventActionChangeEmojiStatus(nil)" + } + type Alias ChannelAdminLogEventActionChangeEmojiStatus + return fmt.Sprintf("ChannelAdminLogEventActionChangeEmojiStatus%+v", Alias(*c)) +} + +// FillFrom fills ChannelAdminLogEventActionChangeEmojiStatus from given interface. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) FillFrom(from interface { + GetPrevValue() (value EmojiStatusClass) + GetNewValue() (value EmojiStatusClass) +}) { + c.PrevValue = from.GetPrevValue() + c.NewValue = from.GetNewValue() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChannelAdminLogEventActionChangeEmojiStatus) TypeID() uint32 { + return ChannelAdminLogEventActionChangeEmojiStatusTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChannelAdminLogEventActionChangeEmojiStatus) TypeName() string { + return "channelAdminLogEventActionChangeEmojiStatus" +} + +// TypeInfo returns info about TL type. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "channelAdminLogEventActionChangeEmojiStatus", + ID: ChannelAdminLogEventActionChangeEmojiStatusTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "PrevValue", + SchemaName: "prev_value", + }, + { + Name: "NewValue", + SchemaName: "new_value", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 as nil") + } + b.PutID(ChannelAdminLogEventActionChangeEmojiStatusTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 as nil") + } + if c.PrevValue == nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field prev_value is nil") + } + if err := c.PrevValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field prev_value: %w", err) + } + if c.NewValue == nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field new_value is nil") + } + if err := c.NewValue.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field new_value: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 to nil") + } + if err := b.ConsumeID(ChannelAdminLogEventActionChangeEmojiStatusTypeID); err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 to nil") + } + { + value, err := DecodeEmojiStatus(b) + if err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field prev_value: %w", err) + } + c.PrevValue = value + } + { + value, err := DecodeEmojiStatus(b) + if err != nil { + return fmt.Errorf("unable to decode channelAdminLogEventActionChangeEmojiStatus#3ea9feb1: field new_value: %w", err) + } + c.NewValue = value + } + return nil +} + +// GetPrevValue returns value of PrevValue field. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) GetPrevValue() (value EmojiStatusClass) { + if c == nil { + return + } + return c.PrevValue +} + +// GetNewValue returns value of NewValue field. +func (c *ChannelAdminLogEventActionChangeEmojiStatus) GetNewValue() (value EmojiStatusClass) { if c == nil { return } @@ -7088,8 +7436,10 @@ const ChannelAdminLogEventActionClassName = "ChannelAdminLogEventAction" // case *tg.ChannelAdminLogEventActionDeleteTopic: // channelAdminLogEventActionDeleteTopic#ae168909 // case *tg.ChannelAdminLogEventActionPinTopic: // channelAdminLogEventActionPinTopic#5d8d353b // case *tg.ChannelAdminLogEventActionToggleAntiSpam: // channelAdminLogEventActionToggleAntiSpam#64f36dfc -// case *tg.ChannelAdminLogEventActionChangeColor: // channelAdminLogEventActionChangeColor#3c2b247b -// case *tg.ChannelAdminLogEventActionChangeBackgroundEmoji: // channelAdminLogEventActionChangeBackgroundEmoji#445fc434 +// case *tg.ChannelAdminLogEventActionChangePeerColor: // channelAdminLogEventActionChangePeerColor#5796e780 +// case *tg.ChannelAdminLogEventActionChangeProfilePeerColor: // channelAdminLogEventActionChangeProfilePeerColor#5e477b25 +// case *tg.ChannelAdminLogEventActionChangeWallpaper: // channelAdminLogEventActionChangeWallpaper#31bb5d52 +// case *tg.ChannelAdminLogEventActionChangeEmojiStatus: // channelAdminLogEventActionChangeEmojiStatus#3ea9feb1 // default: panic(v) // } type ChannelAdminLogEventActionClass interface { @@ -7419,16 +7769,30 @@ func DecodeChannelAdminLogEventAction(buf *bin.Buffer) (ChannelAdminLogEventActi return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) } return &v, nil - case ChannelAdminLogEventActionChangeColorTypeID: - // Decoding channelAdminLogEventActionChangeColor#3c2b247b. - v := ChannelAdminLogEventActionChangeColor{} + case ChannelAdminLogEventActionChangePeerColorTypeID: + // Decoding channelAdminLogEventActionChangePeerColor#5796e780. + v := ChannelAdminLogEventActionChangePeerColor{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) } return &v, nil - case ChannelAdminLogEventActionChangeBackgroundEmojiTypeID: - // Decoding channelAdminLogEventActionChangeBackgroundEmoji#445fc434. - v := ChannelAdminLogEventActionChangeBackgroundEmoji{} + case ChannelAdminLogEventActionChangeProfilePeerColorTypeID: + // Decoding channelAdminLogEventActionChangeProfilePeerColor#5e477b25. + v := ChannelAdminLogEventActionChangeProfilePeerColor{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) + } + return &v, nil + case ChannelAdminLogEventActionChangeWallpaperTypeID: + // Decoding channelAdminLogEventActionChangeWallpaper#31bb5d52. + v := ChannelAdminLogEventActionChangeWallpaper{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) + } + return &v, nil + case ChannelAdminLogEventActionChangeEmojiStatusTypeID: + // Decoding channelAdminLogEventActionChangeEmojiStatus#3ea9feb1. + v := ChannelAdminLogEventActionChangeEmojiStatus{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChannelAdminLogEventActionClass: %w", err) } diff --git a/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_slices_gen.go index 1d8cffa7..8322d148 100644 --- a/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_slices_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channel_admin_log_event_action_slices_gen.go @@ -649,10 +649,10 @@ func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionToggle return to } -// AsChannelAdminLogEventActionChangeColor returns copy with only ChannelAdminLogEventActionChangeColor constructors. -func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeColor() (to ChannelAdminLogEventActionChangeColorArray) { +// AsChannelAdminLogEventActionChangePeerColor returns copy with only ChannelAdminLogEventActionChangePeerColor constructors. +func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangePeerColor() (to ChannelAdminLogEventActionChangePeerColorArray) { for _, elem := range s { - value, ok := elem.(*ChannelAdminLogEventActionChangeColor) + value, ok := elem.(*ChannelAdminLogEventActionChangePeerColor) if !ok { continue } @@ -662,10 +662,36 @@ func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChange return to } -// AsChannelAdminLogEventActionChangeBackgroundEmoji returns copy with only ChannelAdminLogEventActionChangeBackgroundEmoji constructors. -func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeBackgroundEmoji() (to ChannelAdminLogEventActionChangeBackgroundEmojiArray) { +// AsChannelAdminLogEventActionChangeProfilePeerColor returns copy with only ChannelAdminLogEventActionChangeProfilePeerColor constructors. +func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeProfilePeerColor() (to ChannelAdminLogEventActionChangeProfilePeerColorArray) { for _, elem := range s { - value, ok := elem.(*ChannelAdminLogEventActionChangeBackgroundEmoji) + value, ok := elem.(*ChannelAdminLogEventActionChangeProfilePeerColor) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsChannelAdminLogEventActionChangeWallpaper returns copy with only ChannelAdminLogEventActionChangeWallpaper constructors. +func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeWallpaper() (to ChannelAdminLogEventActionChangeWallpaperArray) { + for _, elem := range s { + value, ok := elem.(*ChannelAdminLogEventActionChangeWallpaper) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsChannelAdminLogEventActionChangeEmojiStatus returns copy with only ChannelAdminLogEventActionChangeEmojiStatus constructors. +func (s ChannelAdminLogEventActionClassArray) AsChannelAdminLogEventActionChangeEmojiStatus() (to ChannelAdminLogEventActionChangeEmojiStatusArray) { + for _, elem := range s { + value, ok := elem.(*ChannelAdminLogEventActionChangeEmojiStatus) if !ok { continue } @@ -4037,27 +4063,27 @@ func (s *ChannelAdminLogEventActionToggleAntiSpamArray) Pop() (v ChannelAdminLog return v, true } -// ChannelAdminLogEventActionChangeColorArray is adapter for slice of ChannelAdminLogEventActionChangeColor. -type ChannelAdminLogEventActionChangeColorArray []ChannelAdminLogEventActionChangeColor +// ChannelAdminLogEventActionChangePeerColorArray is adapter for slice of ChannelAdminLogEventActionChangePeerColor. +type ChannelAdminLogEventActionChangePeerColorArray []ChannelAdminLogEventActionChangePeerColor -// Sort sorts slice of ChannelAdminLogEventActionChangeColor. -func (s ChannelAdminLogEventActionChangeColorArray) Sort(less func(a, b ChannelAdminLogEventActionChangeColor) bool) ChannelAdminLogEventActionChangeColorArray { +// Sort sorts slice of ChannelAdminLogEventActionChangePeerColor. +func (s ChannelAdminLogEventActionChangePeerColorArray) Sort(less func(a, b ChannelAdminLogEventActionChangePeerColor) bool) ChannelAdminLogEventActionChangePeerColorArray { sort.Slice(s, func(i, j int) bool { return less(s[i], s[j]) }) return s } -// SortStable sorts slice of ChannelAdminLogEventActionChangeColor. -func (s ChannelAdminLogEventActionChangeColorArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeColor) bool) ChannelAdminLogEventActionChangeColorArray { +// SortStable sorts slice of ChannelAdminLogEventActionChangePeerColor. +func (s ChannelAdminLogEventActionChangePeerColorArray) SortStable(less func(a, b ChannelAdminLogEventActionChangePeerColor) bool) ChannelAdminLogEventActionChangePeerColorArray { sort.SliceStable(s, func(i, j int) bool { return less(s[i], s[j]) }) return s } -// Retain filters in-place slice of ChannelAdminLogEventActionChangeColor. -func (s ChannelAdminLogEventActionChangeColorArray) Retain(keep func(x ChannelAdminLogEventActionChangeColor) bool) ChannelAdminLogEventActionChangeColorArray { +// Retain filters in-place slice of ChannelAdminLogEventActionChangePeerColor. +func (s ChannelAdminLogEventActionChangePeerColorArray) Retain(keep func(x ChannelAdminLogEventActionChangePeerColor) bool) ChannelAdminLogEventActionChangePeerColorArray { n := 0 for _, x := range s { if keep(x) { @@ -4071,7 +4097,7 @@ func (s ChannelAdminLogEventActionChangeColorArray) Retain(keep func(x ChannelAd } // First returns first element of slice (if exists). -func (s ChannelAdminLogEventActionChangeColorArray) First() (v ChannelAdminLogEventActionChangeColor, ok bool) { +func (s ChannelAdminLogEventActionChangePeerColorArray) First() (v ChannelAdminLogEventActionChangePeerColor, ok bool) { if len(s) < 1 { return } @@ -4079,7 +4105,7 @@ func (s ChannelAdminLogEventActionChangeColorArray) First() (v ChannelAdminLogEv } // Last returns last element of slice (if exists). -func (s ChannelAdminLogEventActionChangeColorArray) Last() (v ChannelAdminLogEventActionChangeColor, ok bool) { +func (s ChannelAdminLogEventActionChangePeerColorArray) Last() (v ChannelAdminLogEventActionChangePeerColor, ok bool) { if len(s) < 1 { return } @@ -4087,7 +4113,7 @@ func (s ChannelAdminLogEventActionChangeColorArray) Last() (v ChannelAdminLogEve } // PopFirst returns first element of slice (if exists) and deletes it. -func (s *ChannelAdminLogEventActionChangeColorArray) PopFirst() (v ChannelAdminLogEventActionChangeColor, ok bool) { +func (s *ChannelAdminLogEventActionChangePeerColorArray) PopFirst() (v ChannelAdminLogEventActionChangePeerColor, ok bool) { if s == nil || len(*s) < 1 { return } @@ -4097,7 +4123,7 @@ func (s *ChannelAdminLogEventActionChangeColorArray) PopFirst() (v ChannelAdminL // Delete by index from SliceTricks. copy(a[0:], a[1:]) - var zero ChannelAdminLogEventActionChangeColor + var zero ChannelAdminLogEventActionChangePeerColor a[len(a)-1] = zero a = a[:len(a)-1] *s = a @@ -4106,7 +4132,7 @@ func (s *ChannelAdminLogEventActionChangeColorArray) PopFirst() (v ChannelAdminL } // Pop returns last element of slice (if exists) and deletes it. -func (s *ChannelAdminLogEventActionChangeColorArray) Pop() (v ChannelAdminLogEventActionChangeColor, ok bool) { +func (s *ChannelAdminLogEventActionChangePeerColorArray) Pop() (v ChannelAdminLogEventActionChangePeerColor, ok bool) { if s == nil || len(*s) < 1 { return } @@ -4119,27 +4145,27 @@ func (s *ChannelAdminLogEventActionChangeColorArray) Pop() (v ChannelAdminLogEve return v, true } -// ChannelAdminLogEventActionChangeBackgroundEmojiArray is adapter for slice of ChannelAdminLogEventActionChangeBackgroundEmoji. -type ChannelAdminLogEventActionChangeBackgroundEmojiArray []ChannelAdminLogEventActionChangeBackgroundEmoji +// ChannelAdminLogEventActionChangeProfilePeerColorArray is adapter for slice of ChannelAdminLogEventActionChangeProfilePeerColor. +type ChannelAdminLogEventActionChangeProfilePeerColorArray []ChannelAdminLogEventActionChangeProfilePeerColor -// Sort sorts slice of ChannelAdminLogEventActionChangeBackgroundEmoji. -func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) Sort(less func(a, b ChannelAdminLogEventActionChangeBackgroundEmoji) bool) ChannelAdminLogEventActionChangeBackgroundEmojiArray { +// Sort sorts slice of ChannelAdminLogEventActionChangeProfilePeerColor. +func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) Sort(less func(a, b ChannelAdminLogEventActionChangeProfilePeerColor) bool) ChannelAdminLogEventActionChangeProfilePeerColorArray { sort.Slice(s, func(i, j int) bool { return less(s[i], s[j]) }) return s } -// SortStable sorts slice of ChannelAdminLogEventActionChangeBackgroundEmoji. -func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeBackgroundEmoji) bool) ChannelAdminLogEventActionChangeBackgroundEmojiArray { +// SortStable sorts slice of ChannelAdminLogEventActionChangeProfilePeerColor. +func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeProfilePeerColor) bool) ChannelAdminLogEventActionChangeProfilePeerColorArray { sort.SliceStable(s, func(i, j int) bool { return less(s[i], s[j]) }) return s } -// Retain filters in-place slice of ChannelAdminLogEventActionChangeBackgroundEmoji. -func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) Retain(keep func(x ChannelAdminLogEventActionChangeBackgroundEmoji) bool) ChannelAdminLogEventActionChangeBackgroundEmojiArray { +// Retain filters in-place slice of ChannelAdminLogEventActionChangeProfilePeerColor. +func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) Retain(keep func(x ChannelAdminLogEventActionChangeProfilePeerColor) bool) ChannelAdminLogEventActionChangeProfilePeerColorArray { n := 0 for _, x := range s { if keep(x) { @@ -4153,7 +4179,7 @@ func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) Retain(keep func(x } // First returns first element of slice (if exists). -func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) First() (v ChannelAdminLogEventActionChangeBackgroundEmoji, ok bool) { +func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) First() (v ChannelAdminLogEventActionChangeProfilePeerColor, ok bool) { if len(s) < 1 { return } @@ -4161,7 +4187,7 @@ func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) First() (v Channel } // Last returns last element of slice (if exists). -func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) Last() (v ChannelAdminLogEventActionChangeBackgroundEmoji, ok bool) { +func (s ChannelAdminLogEventActionChangeProfilePeerColorArray) Last() (v ChannelAdminLogEventActionChangeProfilePeerColor, ok bool) { if len(s) < 1 { return } @@ -4169,7 +4195,7 @@ func (s ChannelAdminLogEventActionChangeBackgroundEmojiArray) Last() (v ChannelA } // PopFirst returns first element of slice (if exists) and deletes it. -func (s *ChannelAdminLogEventActionChangeBackgroundEmojiArray) PopFirst() (v ChannelAdminLogEventActionChangeBackgroundEmoji, ok bool) { +func (s *ChannelAdminLogEventActionChangeProfilePeerColorArray) PopFirst() (v ChannelAdminLogEventActionChangeProfilePeerColor, ok bool) { if s == nil || len(*s) < 1 { return } @@ -4179,7 +4205,7 @@ func (s *ChannelAdminLogEventActionChangeBackgroundEmojiArray) PopFirst() (v Cha // Delete by index from SliceTricks. copy(a[0:], a[1:]) - var zero ChannelAdminLogEventActionChangeBackgroundEmoji + var zero ChannelAdminLogEventActionChangeProfilePeerColor a[len(a)-1] = zero a = a[:len(a)-1] *s = a @@ -4188,7 +4214,171 @@ func (s *ChannelAdminLogEventActionChangeBackgroundEmojiArray) PopFirst() (v Cha } // Pop returns last element of slice (if exists) and deletes it. -func (s *ChannelAdminLogEventActionChangeBackgroundEmojiArray) Pop() (v ChannelAdminLogEventActionChangeBackgroundEmoji, ok bool) { +func (s *ChannelAdminLogEventActionChangeProfilePeerColorArray) Pop() (v ChannelAdminLogEventActionChangeProfilePeerColor, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// ChannelAdminLogEventActionChangeWallpaperArray is adapter for slice of ChannelAdminLogEventActionChangeWallpaper. +type ChannelAdminLogEventActionChangeWallpaperArray []ChannelAdminLogEventActionChangeWallpaper + +// Sort sorts slice of ChannelAdminLogEventActionChangeWallpaper. +func (s ChannelAdminLogEventActionChangeWallpaperArray) Sort(less func(a, b ChannelAdminLogEventActionChangeWallpaper) bool) ChannelAdminLogEventActionChangeWallpaperArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of ChannelAdminLogEventActionChangeWallpaper. +func (s ChannelAdminLogEventActionChangeWallpaperArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeWallpaper) bool) ChannelAdminLogEventActionChangeWallpaperArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of ChannelAdminLogEventActionChangeWallpaper. +func (s ChannelAdminLogEventActionChangeWallpaperArray) Retain(keep func(x ChannelAdminLogEventActionChangeWallpaper) bool) ChannelAdminLogEventActionChangeWallpaperArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s ChannelAdminLogEventActionChangeWallpaperArray) First() (v ChannelAdminLogEventActionChangeWallpaper, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s ChannelAdminLogEventActionChangeWallpaperArray) Last() (v ChannelAdminLogEventActionChangeWallpaper, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *ChannelAdminLogEventActionChangeWallpaperArray) PopFirst() (v ChannelAdminLogEventActionChangeWallpaper, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero ChannelAdminLogEventActionChangeWallpaper + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *ChannelAdminLogEventActionChangeWallpaperArray) Pop() (v ChannelAdminLogEventActionChangeWallpaper, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// ChannelAdminLogEventActionChangeEmojiStatusArray is adapter for slice of ChannelAdminLogEventActionChangeEmojiStatus. +type ChannelAdminLogEventActionChangeEmojiStatusArray []ChannelAdminLogEventActionChangeEmojiStatus + +// Sort sorts slice of ChannelAdminLogEventActionChangeEmojiStatus. +func (s ChannelAdminLogEventActionChangeEmojiStatusArray) Sort(less func(a, b ChannelAdminLogEventActionChangeEmojiStatus) bool) ChannelAdminLogEventActionChangeEmojiStatusArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of ChannelAdminLogEventActionChangeEmojiStatus. +func (s ChannelAdminLogEventActionChangeEmojiStatusArray) SortStable(less func(a, b ChannelAdminLogEventActionChangeEmojiStatus) bool) ChannelAdminLogEventActionChangeEmojiStatusArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of ChannelAdminLogEventActionChangeEmojiStatus. +func (s ChannelAdminLogEventActionChangeEmojiStatusArray) Retain(keep func(x ChannelAdminLogEventActionChangeEmojiStatus) bool) ChannelAdminLogEventActionChangeEmojiStatusArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s ChannelAdminLogEventActionChangeEmojiStatusArray) First() (v ChannelAdminLogEventActionChangeEmojiStatus, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s ChannelAdminLogEventActionChangeEmojiStatusArray) Last() (v ChannelAdminLogEventActionChangeEmojiStatus, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *ChannelAdminLogEventActionChangeEmojiStatusArray) PopFirst() (v ChannelAdminLogEventActionChangeEmojiStatus, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero ChannelAdminLogEventActionChangeEmojiStatus + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *ChannelAdminLogEventActionChangeEmojiStatusArray) Pop() (v ChannelAdminLogEventActionChangeEmojiStatus, ok bool) { if s == nil || len(*s) < 1 { return } diff --git a/vendor/github.com/gotd/td/tg/tl_channel_admin_log_events_filter_gen.go b/vendor/github.com/gotd/td/tg/tl_channel_admin_log_events_filter_gen.go index 708773d4..ef53ad64 100644 --- a/vendor/github.com/gotd/td/tg/tl_channel_admin_log_events_filter_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channel_admin_log_events_filter_gen.go @@ -41,10 +41,12 @@ type ChannelAdminLogEventsFilter struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Join events¹ + // Join events¹, including joins using invite links² and join requests³. // // Links: // 1) https://core.telegram.org/constructor/channelAdminLogEventActionParticipantJoin + // 2) https://core.telegram.org/constructor/channelAdminLogEventActionParticipantJoinByInvite + // 3) https://core.telegram.org/constructor/channelAdminLogEventActionParticipantJoinByRequest Join bool // Leave events¹ // @@ -87,7 +89,8 @@ type ChannelAdminLogEventsFilter struct { // 1) https://core.telegram.org/constructor/channelAdminLogEventActionParticipantToggleAdmin Demote bool // Info change events (when about¹, linked chat², location³, photo⁴, stickerset⁵, - // title⁶ or username⁷ data of a channel gets modified) + // title⁶ or username⁷, slowmode⁸, history TTL⁹ settings of a channel gets + // modified) // // Links: // 1) https://core.telegram.org/constructor/channelAdminLogEventActionChangeAbout @@ -97,15 +100,18 @@ type ChannelAdminLogEventsFilter struct { // 5) https://core.telegram.org/constructor/channelAdminLogEventActionChangeStickerSet // 6) https://core.telegram.org/constructor/channelAdminLogEventActionChangeTitle // 7) https://core.telegram.org/constructor/channelAdminLogEventActionChangeUsername + // 8) https://core.telegram.org/constructor/channelAdminLogEventActionToggleSlowMode + // 9) https://core.telegram.org/constructor/channelAdminLogEventActionChangeHistoryTTL Info bool // Settings change events (invites¹, hidden prehistory², signatures³, default banned - // rights⁴) + // rights⁴, forum toggle events⁵) // // Links: // 1) https://core.telegram.org/constructor/channelAdminLogEventActionToggleInvites // 2) https://core.telegram.org/constructor/channelAdminLogEventActionTogglePreHistoryHidden // 3) https://core.telegram.org/constructor/channelAdminLogEventActionToggleSignatures // 4) https://core.telegram.org/constructor/channelAdminLogEventActionDefaultBannedRights + // 5) https://core.telegram.org/constructor/channelAdminLogEventActionToggleForum Settings bool // Message pin events¹ // diff --git a/vendor/github.com/gotd/td/tg/tl_channels_click_sponsored_message_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_click_sponsored_message_gen.go index e814d2bb..09919658 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_click_sponsored_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_click_sponsored_message_gen.go @@ -32,12 +32,13 @@ var ( ) // ChannelsClickSponsoredMessageRequest represents TL type `channels.clickSponsoredMessage#18afbc93`. +// Informs the server that the user has either: // // See https://core.telegram.org/method/channels.clickSponsoredMessage for reference. type ChannelsClickSponsoredMessageRequest struct { - // Channel field of ChannelsClickSponsoredMessageRequest. + // Channel where the sponsored message was posted Channel InputChannelClass - // RandomID field of ChannelsClickSponsoredMessageRequest. + // Message ID RandomID []byte } @@ -198,6 +199,11 @@ func (c *ChannelsClickSponsoredMessageRequest) GetChannelAsNotEmpty() (NotEmptyI } // ChannelsClickSponsoredMessage invokes method channels.clickSponsoredMessage#18afbc93 returning error if any. +// Informs the server that the user has either: +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.clickSponsoredMessage for reference. func (c *Client) ChannelsClickSponsoredMessage(ctx context.Context, request *ChannelsClickSponsoredMessageRequest) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channels_convert_to_gigagroup_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_convert_to_gigagroup_gen.go index e7376720..c6afc518 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_convert_to_gigagroup_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_convert_to_gigagroup_gen.go @@ -193,6 +193,7 @@ func (c *ChannelsConvertToGigagroupRequest) GetChannelAsNotEmpty() (NotEmptyInpu // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. +// 400 FORUM_ENABLED: You can't execute the specified action because the group is a forum, disable forum functionality to continue. // 400 PARTICIPANTS_TOO_FEW: Not enough participants. // // See https://core.telegram.org/method/channels.convertToGigagroup for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_create_channel_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_create_channel_gen.go index c395d264..55a8246b 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_create_channel_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_create_channel_gen.go @@ -69,11 +69,17 @@ type ChannelsCreateChannelRequest struct { Title string // Channel description About string - // Geogroup location + // Geogroup location, see here »¹ for more info on geogroups. + // + // Links: + // 1) https://core.telegram.org/api/nearby // // Use SetGeoPoint and GetGeoPoint helpers. GeoPoint InputGeoPointClass - // Geogroup address + // Geogroup address, see here »¹ for more info on geogroups. + // + // Links: + // 1) https://core.telegram.org/api/nearby // // Use SetAddress and GetAddress helpers. Address string @@ -537,10 +543,11 @@ func (c *ChannelsCreateChannelRequest) GetGeoPointAsNotEmpty() (*InputGeoPoint, // // Possible errors: // +// 400 ADDRESS_INVALID: The specified geopoint address is invalid. // 400 CHANNELS_ADMIN_LOCATED_TOO_MUCH: The user has reached the limit of public geogroups. // 400 CHANNELS_TOO_MUCH: You have joined too many channels/supergroups. -// 500 CHANNEL_ID_GENERATE_FAILED: // 400 CHAT_ABOUT_TOO_LONG: Chat about too long. +// 500 CHAT_INVALID: Invalid chat. // 400 CHAT_TITLE_EMPTY: No chat title provided. // 400 TTL_PERIOD_INVALID: The specified TTL period is invalid. // 406 USER_RESTRICTED: You're spamreported, you can't create channels or chats. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_create_forum_topic_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_create_forum_topic_gen.go index bb5673e6..1ee92621 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_create_forum_topic_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_create_forum_topic_gen.go @@ -419,8 +419,11 @@ func (c *ChannelsCreateForumTopicRequest) GetChannelAsNotEmpty() (NotEmptyInputC // // Possible errors: // +// 400 CHANNEL_FORUM_MISSING: This supergroup is not a forum. // 400 CHANNEL_INVALID: The provided channel is invalid. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. +// 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// 400 TOPIC_TITLE_EMPTY: The specified topic title is empty. // // See https://core.telegram.org/method/channels.createForumTopic for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_edit_banned_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_edit_banned_gen.go index f0776834..d03d4422 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_edit_banned_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_edit_banned_gen.go @@ -244,6 +244,7 @@ func (e *ChannelsEditBannedRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel // // Possible errors: // +// 406 BANNED_RIGHTS_INVALID: You provided some invalid flags in the banned rights. // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_edit_forum_topic_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_edit_forum_topic_gen.go index 6e68cd81..1d10e72b 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_edit_forum_topic_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_edit_forum_topic_gen.go @@ -432,6 +432,12 @@ func (e *ChannelsEditForumTopicRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // // Possible errors: // +// 400 CHANNEL_FORUM_MISSING: This supergroup is not a forum. +// 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 DOCUMENT_INVALID: The specified document is invalid. +// 400 GENERAL_MODIFY_ICON_FORBIDDEN: You can't modify the icon of the "General" topic. +// 400 TOPIC_CLOSE_SEPARATELY: The close flag cannot be provided together with any of the other flags. +// 400 TOPIC_HIDE_SEPARATELY: The hide flag cannot be provided together with any of the other flags. // 400 TOPIC_ID_INVALID: The specified topic ID is invalid. // 400 TOPIC_NOT_MODIFIED: The updated topic info is equal to the current topic info, nothing was changed. // diff --git a/vendor/github.com/gotd/td/tg/tl_channels_edit_location_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_edit_location_gen.go index fe79dc73..cff623ba 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_edit_location_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_edit_location_gen.go @@ -32,7 +32,10 @@ var ( ) // ChannelsEditLocationRequest represents TL type `channels.editLocation#58e63f6d`. -// Edit location of geogroup +// Edit location of geogroup, see here »¹ for more info on geogroups. +// +// Links: +// 1. https://core.telegram.org/api/nearby // // See https://core.telegram.org/method/channels.editLocation for reference. type ChannelsEditLocationRequest struct { @@ -239,12 +242,16 @@ func (e *ChannelsEditLocationRequest) GetGeoPointAsNotEmpty() (*InputGeoPoint, b } // ChannelsEditLocation invokes method channels.editLocation#58e63f6d returning error if any. -// Edit location of geogroup +// Edit location of geogroup, see here »¹ for more info on geogroups. +// +// Links: +// 1. https://core.telegram.org/api/nearby // // Possible errors: // // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 MEGAGROUP_GEO_REQUIRED: This method can only be invoked on a geogroup. // 400 MEGAGROUP_REQUIRED: You can only use this method on a supergroup. // // See https://core.telegram.org/method/channels.editLocation for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_gen.go new file mode 100644 index 00000000..a011abf5 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_gen.go @@ -0,0 +1,194 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ChannelsGetChannelRecommendationsRequest represents TL type `channels.getChannelRecommendations#83b70d97`. +// Obtain a list of similarly themed public channels, selected based on similarities in +// their subscriber bases. +// +// See https://core.telegram.org/method/channels.getChannelRecommendations for reference. +type ChannelsGetChannelRecommendationsRequest struct { + // The method will return channels related to the passed channel. + Channel InputChannelClass +} + +// ChannelsGetChannelRecommendationsRequestTypeID is TL type id of ChannelsGetChannelRecommendationsRequest. +const ChannelsGetChannelRecommendationsRequestTypeID = 0x83b70d97 + +// Ensuring interfaces in compile-time for ChannelsGetChannelRecommendationsRequest. +var ( + _ bin.Encoder = &ChannelsGetChannelRecommendationsRequest{} + _ bin.Decoder = &ChannelsGetChannelRecommendationsRequest{} + _ bin.BareEncoder = &ChannelsGetChannelRecommendationsRequest{} + _ bin.BareDecoder = &ChannelsGetChannelRecommendationsRequest{} +) + +func (g *ChannelsGetChannelRecommendationsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Channel == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *ChannelsGetChannelRecommendationsRequest) String() string { + if g == nil { + return "ChannelsGetChannelRecommendationsRequest(nil)" + } + type Alias ChannelsGetChannelRecommendationsRequest + return fmt.Sprintf("ChannelsGetChannelRecommendationsRequest%+v", Alias(*g)) +} + +// FillFrom fills ChannelsGetChannelRecommendationsRequest from given interface. +func (g *ChannelsGetChannelRecommendationsRequest) FillFrom(from interface { + GetChannel() (value InputChannelClass) +}) { + g.Channel = from.GetChannel() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChannelsGetChannelRecommendationsRequest) TypeID() uint32 { + return ChannelsGetChannelRecommendationsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChannelsGetChannelRecommendationsRequest) TypeName() string { + return "channels.getChannelRecommendations" +} + +// TypeInfo returns info about TL type. +func (g *ChannelsGetChannelRecommendationsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "channels.getChannelRecommendations", + ID: ChannelsGetChannelRecommendationsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Channel", + SchemaName: "channel", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *ChannelsGetChannelRecommendationsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode channels.getChannelRecommendations#83b70d97 as nil") + } + b.PutID(ChannelsGetChannelRecommendationsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *ChannelsGetChannelRecommendationsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode channels.getChannelRecommendations#83b70d97 as nil") + } + if g.Channel == nil { + return fmt.Errorf("unable to encode channels.getChannelRecommendations#83b70d97: field channel is nil") + } + if err := g.Channel.Encode(b); err != nil { + return fmt.Errorf("unable to encode channels.getChannelRecommendations#83b70d97: field channel: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (g *ChannelsGetChannelRecommendationsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode channels.getChannelRecommendations#83b70d97 to nil") + } + if err := b.ConsumeID(ChannelsGetChannelRecommendationsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode channels.getChannelRecommendations#83b70d97: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *ChannelsGetChannelRecommendationsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode channels.getChannelRecommendations#83b70d97 to nil") + } + { + value, err := DecodeInputChannel(b) + if err != nil { + return fmt.Errorf("unable to decode channels.getChannelRecommendations#83b70d97: field channel: %w", err) + } + g.Channel = value + } + return nil +} + +// GetChannel returns value of Channel field. +func (g *ChannelsGetChannelRecommendationsRequest) GetChannel() (value InputChannelClass) { + if g == nil { + return + } + return g.Channel +} + +// GetChannelAsNotEmpty returns mapped value of Channel field. +func (g *ChannelsGetChannelRecommendationsRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, bool) { + return g.Channel.AsNotEmpty() +} + +// ChannelsGetChannelRecommendations invokes method channels.getChannelRecommendations#83b70d97 returning error if any. +// Obtain a list of similarly themed public channels, selected based on similarities in +// their subscriber bases. +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// +// See https://core.telegram.org/method/channels.getChannelRecommendations for reference. +func (c *Client) ChannelsGetChannelRecommendations(ctx context.Context, channel InputChannelClass) (MessagesChatsClass, error) { + var result MessagesChatsBox + + request := &ChannelsGetChannelRecommendationsRequest{ + Channel: channel, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.Chats, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_channels_get_channel_recommendations_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_by_id_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_by_id_gen.go index e08e9d98..f2cafad0 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_by_id_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_by_id_gen.go @@ -218,7 +218,7 @@ func (g *ChannelsGetForumTopicsByIDRequest) GetChannelAsNotEmpty() (NotEmptyInpu // // 400 CHANNEL_FORUM_MISSING: This supergroup is not a forum. // 400 CHANNEL_INVALID: The provided channel is invalid. -// 400 TOPICS_EMPTY: +// 400 TOPICS_EMPTY: You specified no topic IDs. // // See https://core.telegram.org/method/channels.getForumTopicsByID for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_gen.go index 352f2fbb..47c5de56 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_get_forum_topics_gen.go @@ -50,22 +50,27 @@ type ChannelsGetForumTopicsRequest struct { // // Use SetQ and GetQ helpers. Q string - // Offsets for pagination, for more info click here¹ + // Offsets for pagination, for more info click here¹, date of the last message of the + // last found topic. Use 0 or any date in the future to get results from the last topic. // // Links: // 1) https://core.telegram.org/api/offsets OffsetDate int - // Offsets for pagination, for more info click here¹ + // Offsets for pagination, for more info click here¹, ID of the last message of the last + // found topic (or initially 0). // // Links: // 1) https://core.telegram.org/api/offsets OffsetID int - // Offsets for pagination, for more info click here¹ + // Offsets for pagination, for more info click here¹, ID of the last found topic (or + // initially 0). // // Links: // 1) https://core.telegram.org/api/offsets OffsetTopic int - // Maximum number of results to return, see pagination¹ + // Maximum number of results to return, see pagination¹. For optimal performance, the + // number of returned topics is chosen by the server and can be smaller than the + // specified limit. // // Links: // 1) https://core.telegram.org/api/offsets @@ -373,6 +378,7 @@ func (g *ChannelsGetForumTopicsRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // // 400 CHANNEL_FORUM_MISSING: This supergroup is not a forum. // 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // // See https://core.telegram.org/method/channels.getForumTopics for reference. func (c *Client) ChannelsGetForumTopics(ctx context.Context, request *ChannelsGetForumTopicsRequest) (*MessagesForumTopics, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channels_get_left_channels_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_get_left_channels_gen.go index b363b3c1..5cdc1359 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_get_left_channels_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_get_left_channels_gen.go @@ -32,10 +32,12 @@ var ( ) // ChannelsGetLeftChannelsRequest represents TL type `channels.getLeftChannels#8341ecc0`. -// Get a list of channels/supergroups¹ we left +// Get a list of channels/supergroups¹ we left, requires a takeout session, see here » +// for more info². // // Links: // 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/api/takeout // // See https://core.telegram.org/method/channels.getLeftChannels for reference. type ChannelsGetLeftChannelsRequest struct { @@ -168,14 +170,16 @@ func (g *ChannelsGetLeftChannelsRequest) GetOffset() (value int) { } // ChannelsGetLeftChannels invokes method channels.getLeftChannels#8341ecc0 returning error if any. -// Get a list of channels/supergroups¹ we left +// Get a list of channels/supergroups¹ we left, requires a takeout session, see here » +// for more info². // // Links: // 1. https://core.telegram.org/api/channel +// 2. https://core.telegram.org/api/takeout // // Possible errors: // -// 403 TAKEOUT_REQUIRED: A takeout session has to be initialized, first. +// 403 TAKEOUT_REQUIRED: A takeout session needs to be initialized first, see here » for more info. // // See https://core.telegram.org/method/channels.getLeftChannels for reference. func (c *Client) ChannelsGetLeftChannels(ctx context.Context, offset int) (MessagesChatsClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channels_get_participants_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_get_participants_gen.go index ad9403c5..249bb726 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_get_participants_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_get_participants_gen.go @@ -307,6 +307,7 @@ func (g *ChannelsGetParticipantsRequest) GetChannelAsNotEmpty() (NotEmptyInputCh // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 MSG_ID_INVALID: Invalid message ID provided. // // See https://core.telegram.org/method/channels.getParticipants for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_join_channel_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_join_channel_gen.go index c1432659..e0f08bc0 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_join_channel_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_join_channel_gen.go @@ -184,7 +184,6 @@ func (j *ChannelsJoinChannelRequest) GetChannelAsNotEmpty() (NotEmptyInputChanne // 406 INVITE_HASH_EXPIRED: The invite link has expired. // 400 INVITE_HASH_INVALID: The invite hash is invalid. // 400 INVITE_REQUEST_SENT: You have successfully requested to join this chat or channel. -// 500 MEMBER_CHAT_ADD_FAILED: // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 USERS_TOO_MUCH: The maximum number of users has been exceeded (to create a chat, for example). diff --git a/vendor/github.com/gotd/td/tg/tl_channels_leave_channel_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_leave_channel_gen.go index e52ad640..84097cc8 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_leave_channel_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_leave_channel_gen.go @@ -188,6 +188,7 @@ func (l *ChannelsLeaveChannelRequest) GetChannelAsNotEmpty() (NotEmptyInputChann // 400 CHANNEL_INVALID: The provided channel is invalid. // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHANNEL_PUBLIC_GROUP_NA: channel/supergroup not available. +// 400 CHAT_INVALID: Invalid chat. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // 400 USER_CREATOR: You can't leave this channel, because you're its creator. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_reorder_pinned_forum_topics_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_reorder_pinned_forum_topics_gen.go index 36e36338..211cb5da 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_reorder_pinned_forum_topics_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_reorder_pinned_forum_topics_gen.go @@ -41,7 +41,12 @@ type ChannelsReorderPinnedForumTopicsRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // If set, topics pinned server-side but not present in the order field will be unpinned. + // If not set, the order of only the topics present both server-side and in order will be + // changed (i.e. mentioning topics not pinned server-side in order will not pin them, and + // not mentioning topics pinned server-side will not unpin them). If set, the entire + // server-side pinned topic list will be replaced with order (i.e. mentioning topics not + // pinned server-side in order will pin them, and not mentioning topics pinned + // server-side will unpin them) Force bool // Supergroup ID Channel InputChannelClass diff --git a/vendor/github.com/gotd/td/tg/tl_channels_report_spam_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_report_spam_gen.go index 17e4f4e4..d2883f65 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_report_spam_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_report_spam_gen.go @@ -253,6 +253,7 @@ func (r *ChannelsReportSpamRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. +// 400 MSG_ID_INVALID: Invalid message ID provided. // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/channels.reportSpam for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_toggle_anti_spam_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_toggle_anti_spam_gen.go index 86c33b39..e7cadde8 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_toggle_anti_spam_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_toggle_anti_spam_gen.go @@ -212,6 +212,10 @@ func (t *ChannelsToggleAntiSpamRequest) GetChannelAsNotEmpty() (NotEmptyInputCha // Links: // 1. https://core.telegram.org/api/antispam // +// Possible errors: +// +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// // See https://core.telegram.org/method/channels.toggleAntiSpam for reference. // Can be used by bots. func (c *Client) ChannelsToggleAntiSpam(ctx context.Context, request *ChannelsToggleAntiSpamRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channels_toggle_forum_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_toggle_forum_gen.go index 63723df3..496319a5 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_toggle_forum_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_toggle_forum_gen.go @@ -210,6 +210,7 @@ func (t *ChannelsToggleForumRequest) GetChannelAsNotEmpty() (NotEmptyInputChanne // Possible errors: // // 400 CHAT_DISCUSSION_UNALLOWED: You can't enable forum topics in a discussion group linked to a channel. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // // See https://core.telegram.org/method/channels.toggleForum for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_toggle_join_to_send_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_toggle_join_to_send_gen.go index 566b8077..faf9335a 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_toggle_join_to_send_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_toggle_join_to_send_gen.go @@ -214,6 +214,7 @@ func (t *ChannelsToggleJoinToSendRequest) GetChannelAsNotEmpty() (NotEmptyInputC // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_ID_INVALID: The provided chat id is invalid. +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // // See https://core.telegram.org/method/channels.toggleJoinToSend for reference. func (c *Client) ChannelsToggleJoinToSend(ctx context.Context, request *ChannelsToggleJoinToSendRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channels_toggle_participants_hidden_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_toggle_participants_hidden_gen.go index ff8d9a6d..c9bc0f33 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_toggle_participants_hidden_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_toggle_participants_hidden_gen.go @@ -215,6 +215,7 @@ func (t *ChannelsToggleParticipantsHiddenRequest) GetChannelAsNotEmpty() (NotEmp // // Possible errors: // +// 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 PARTICIPANTS_TOO_FEW: Not enough participants. // // See https://core.telegram.org/method/channels.toggleParticipantsHidden for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_channels_toggle_pre_history_hidden_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_toggle_pre_history_hidden_gen.go index abbd209c..d7bdfa4f 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_toggle_pre_history_hidden_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_toggle_pre_history_hidden_gen.go @@ -209,6 +209,7 @@ func (t *ChannelsTogglePreHistoryHiddenRequest) GetChannelAsNotEmpty() (NotEmpty // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_LINK_EXISTS: The chat is public, you can't hide the history to new users. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 FORUM_ENABLED: You can't execute the specified action because the group is a forum, disable forum functionality to continue. // // See https://core.telegram.org/method/channels.togglePreHistoryHidden for reference. func (c *Client) ChannelsTogglePreHistoryHidden(ctx context.Context, request *ChannelsTogglePreHistoryHiddenRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_gen.go new file mode 100644 index 00000000..432ed8a0 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_gen.go @@ -0,0 +1,238 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ChannelsToggleViewForumAsMessagesRequest represents TL type `channels.toggleViewForumAsMessages#9738bb15`. +// Users may also choose to display messages from all topics of a forum¹ as if they were +// sent to a normal group, using a "View as messages" setting in the local client: this +// setting only affects the current account, and is synced to other logged in sessions +// using this method. +// Invoking this method will update the value of the view_forum_as_messages flag of +// channelFull¹ or dialog² and emit an updateChannelViewForumAsMessages³. +// +// Links: +// 1. https://core.telegram.org/api/forum +// 2. https://core.telegram.org/constructor/channelFull +// 3. https://core.telegram.org/constructor/dialog +// 4. https://core.telegram.org/constructor/updateChannelViewForumAsMessages +// +// See https://core.telegram.org/method/channels.toggleViewForumAsMessages for reference. +type ChannelsToggleViewForumAsMessagesRequest struct { + // The forum + Channel InputChannelClass + // The new value of the view_forum_as_messages flag. + Enabled bool +} + +// ChannelsToggleViewForumAsMessagesRequestTypeID is TL type id of ChannelsToggleViewForumAsMessagesRequest. +const ChannelsToggleViewForumAsMessagesRequestTypeID = 0x9738bb15 + +// Ensuring interfaces in compile-time for ChannelsToggleViewForumAsMessagesRequest. +var ( + _ bin.Encoder = &ChannelsToggleViewForumAsMessagesRequest{} + _ bin.Decoder = &ChannelsToggleViewForumAsMessagesRequest{} + _ bin.BareEncoder = &ChannelsToggleViewForumAsMessagesRequest{} + _ bin.BareDecoder = &ChannelsToggleViewForumAsMessagesRequest{} +) + +func (t *ChannelsToggleViewForumAsMessagesRequest) Zero() bool { + if t == nil { + return true + } + if !(t.Channel == nil) { + return false + } + if !(t.Enabled == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (t *ChannelsToggleViewForumAsMessagesRequest) String() string { + if t == nil { + return "ChannelsToggleViewForumAsMessagesRequest(nil)" + } + type Alias ChannelsToggleViewForumAsMessagesRequest + return fmt.Sprintf("ChannelsToggleViewForumAsMessagesRequest%+v", Alias(*t)) +} + +// FillFrom fills ChannelsToggleViewForumAsMessagesRequest from given interface. +func (t *ChannelsToggleViewForumAsMessagesRequest) FillFrom(from interface { + GetChannel() (value InputChannelClass) + GetEnabled() (value bool) +}) { + t.Channel = from.GetChannel() + t.Enabled = from.GetEnabled() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChannelsToggleViewForumAsMessagesRequest) TypeID() uint32 { + return ChannelsToggleViewForumAsMessagesRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChannelsToggleViewForumAsMessagesRequest) TypeName() string { + return "channels.toggleViewForumAsMessages" +} + +// TypeInfo returns info about TL type. +func (t *ChannelsToggleViewForumAsMessagesRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "channels.toggleViewForumAsMessages", + ID: ChannelsToggleViewForumAsMessagesRequestTypeID, + } + if t == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Channel", + SchemaName: "channel", + }, + { + Name: "Enabled", + SchemaName: "enabled", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (t *ChannelsToggleViewForumAsMessagesRequest) Encode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode channels.toggleViewForumAsMessages#9738bb15 as nil") + } + b.PutID(ChannelsToggleViewForumAsMessagesRequestTypeID) + return t.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (t *ChannelsToggleViewForumAsMessagesRequest) EncodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode channels.toggleViewForumAsMessages#9738bb15 as nil") + } + if t.Channel == nil { + return fmt.Errorf("unable to encode channels.toggleViewForumAsMessages#9738bb15: field channel is nil") + } + if err := t.Channel.Encode(b); err != nil { + return fmt.Errorf("unable to encode channels.toggleViewForumAsMessages#9738bb15: field channel: %w", err) + } + b.PutBool(t.Enabled) + return nil +} + +// Decode implements bin.Decoder. +func (t *ChannelsToggleViewForumAsMessagesRequest) Decode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode channels.toggleViewForumAsMessages#9738bb15 to nil") + } + if err := b.ConsumeID(ChannelsToggleViewForumAsMessagesRequestTypeID); err != nil { + return fmt.Errorf("unable to decode channels.toggleViewForumAsMessages#9738bb15: %w", err) + } + return t.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (t *ChannelsToggleViewForumAsMessagesRequest) DecodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode channels.toggleViewForumAsMessages#9738bb15 to nil") + } + { + value, err := DecodeInputChannel(b) + if err != nil { + return fmt.Errorf("unable to decode channels.toggleViewForumAsMessages#9738bb15: field channel: %w", err) + } + t.Channel = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode channels.toggleViewForumAsMessages#9738bb15: field enabled: %w", err) + } + t.Enabled = value + } + return nil +} + +// GetChannel returns value of Channel field. +func (t *ChannelsToggleViewForumAsMessagesRequest) GetChannel() (value InputChannelClass) { + if t == nil { + return + } + return t.Channel +} + +// GetEnabled returns value of Enabled field. +func (t *ChannelsToggleViewForumAsMessagesRequest) GetEnabled() (value bool) { + if t == nil { + return + } + return t.Enabled +} + +// GetChannelAsNotEmpty returns mapped value of Channel field. +func (t *ChannelsToggleViewForumAsMessagesRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, bool) { + return t.Channel.AsNotEmpty() +} + +// ChannelsToggleViewForumAsMessages invokes method channels.toggleViewForumAsMessages#9738bb15 returning error if any. +// Users may also choose to display messages from all topics of a forum¹ as if they were +// sent to a normal group, using a "View as messages" setting in the local client: this +// setting only affects the current account, and is synced to other logged in sessions +// using this method. +// Invoking this method will update the value of the view_forum_as_messages flag of +// channelFull¹ or dialog² and emit an updateChannelViewForumAsMessages³. +// +// Links: +// 1. https://core.telegram.org/api/forum +// 2. https://core.telegram.org/constructor/channelFull +// 3. https://core.telegram.org/constructor/dialog +// 4. https://core.telegram.org/constructor/updateChannelViewForumAsMessages +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// +// See https://core.telegram.org/method/channels.toggleViewForumAsMessages for reference. +func (c *Client) ChannelsToggleViewForumAsMessages(ctx context.Context, request *ChannelsToggleViewForumAsMessagesRequest) (UpdatesClass, error) { + var result UpdatesBox + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.Updates, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_channels_toggle_view_forum_as_messages_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_channels_update_color_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_update_color_gen.go index 21e1c670..2fbdc8ac 100644 --- a/vendor/github.com/gotd/td/tg/tl_channels_update_color_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_channels_update_color_gen.go @@ -31,24 +31,39 @@ var ( _ = tdjson.Encoder{} ) -// ChannelsUpdateColorRequest represents TL type `channels.updateColor#621a201f`. +// ChannelsUpdateColorRequest represents TL type `channels.updateColor#d8aa3671`. +// Update the accent color and background custom emoji »¹ of a channel. +// +// Links: +// 1. https://core.telegram.org/api/colors // // See https://core.telegram.org/method/channels.updateColor for reference. type ChannelsUpdateColorRequest struct { - // Flags field of ChannelsUpdateColorRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Channel field of ChannelsUpdateColorRequest. + // ForProfile field of ChannelsUpdateColorRequest. + ForProfile bool + // Channel whose accent color should be changed. Channel InputChannelClass - // Color field of ChannelsUpdateColorRequest. + // ID of the accent color palette »¹ to use (not RGB24, see here »² for more info). + // + // Links: + // 1) https://core.telegram.org/api/colors + // 2) https://core.telegram.org/api/colors + // + // Use SetColor and GetColor helpers. Color int - // BackgroundEmojiID field of ChannelsUpdateColorRequest. + // Custom emoji ID used in the accent color pattern. // // Use SetBackgroundEmojiID and GetBackgroundEmojiID helpers. BackgroundEmojiID int64 } // ChannelsUpdateColorRequestTypeID is TL type id of ChannelsUpdateColorRequest. -const ChannelsUpdateColorRequestTypeID = 0x621a201f +const ChannelsUpdateColorRequestTypeID = 0xd8aa3671 // Ensuring interfaces in compile-time for ChannelsUpdateColorRequest. var ( @@ -65,6 +80,9 @@ func (u *ChannelsUpdateColorRequest) Zero() bool { if !(u.Flags.Zero()) { return false } + if !(u.ForProfile == false) { + return false + } if !(u.Channel == nil) { return false } @@ -89,12 +107,17 @@ func (u *ChannelsUpdateColorRequest) String() string { // FillFrom fills ChannelsUpdateColorRequest from given interface. func (u *ChannelsUpdateColorRequest) FillFrom(from interface { + GetForProfile() (value bool) GetChannel() (value InputChannelClass) - GetColor() (value int) + GetColor() (value int, ok bool) GetBackgroundEmojiID() (value int64, ok bool) }) { + u.ForProfile = from.GetForProfile() u.Channel = from.GetChannel() - u.Color = from.GetColor() + if val, ok := from.GetColor(); ok { + u.Color = val + } + if val, ok := from.GetBackgroundEmojiID(); ok { u.BackgroundEmojiID = val } @@ -124,6 +147,11 @@ func (u *ChannelsUpdateColorRequest) TypeInfo() tdp.Type { return typ } typ.Fields = []tdp.Field{ + { + Name: "ForProfile", + SchemaName: "for_profile", + Null: !u.Flags.Has(1), + }, { Name: "Channel", SchemaName: "channel", @@ -131,6 +159,7 @@ func (u *ChannelsUpdateColorRequest) TypeInfo() tdp.Type { { Name: "Color", SchemaName: "color", + Null: !u.Flags.Has(2), }, { Name: "BackgroundEmojiID", @@ -143,6 +172,12 @@ func (u *ChannelsUpdateColorRequest) TypeInfo() tdp.Type { // SetFlags sets flags for non-zero fields. func (u *ChannelsUpdateColorRequest) SetFlags() { + if !(u.ForProfile == false) { + u.Flags.Set(1) + } + if !(u.Color == 0) { + u.Flags.Set(2) + } if !(u.BackgroundEmojiID == 0) { u.Flags.Set(0) } @@ -151,7 +186,7 @@ func (u *ChannelsUpdateColorRequest) SetFlags() { // Encode implements bin.Encoder. func (u *ChannelsUpdateColorRequest) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode channels.updateColor#621a201f as nil") + return fmt.Errorf("can't encode channels.updateColor#d8aa3671 as nil") } b.PutID(ChannelsUpdateColorRequestTypeID) return u.EncodeBare(b) @@ -160,19 +195,21 @@ func (u *ChannelsUpdateColorRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *ChannelsUpdateColorRequest) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode channels.updateColor#621a201f as nil") + return fmt.Errorf("can't encode channels.updateColor#d8aa3671 as nil") } u.SetFlags() if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channels.updateColor#621a201f: field flags: %w", err) + return fmt.Errorf("unable to encode channels.updateColor#d8aa3671: field flags: %w", err) } if u.Channel == nil { - return fmt.Errorf("unable to encode channels.updateColor#621a201f: field channel is nil") + return fmt.Errorf("unable to encode channels.updateColor#d8aa3671: field channel is nil") } if err := u.Channel.Encode(b); err != nil { - return fmt.Errorf("unable to encode channels.updateColor#621a201f: field channel: %w", err) + return fmt.Errorf("unable to encode channels.updateColor#d8aa3671: field channel: %w", err) + } + if u.Flags.Has(2) { + b.PutInt(u.Color) } - b.PutInt(u.Color) if u.Flags.Has(0) { b.PutLong(u.BackgroundEmojiID) } @@ -182,10 +219,10 @@ func (u *ChannelsUpdateColorRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *ChannelsUpdateColorRequest) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode channels.updateColor#621a201f to nil") + return fmt.Errorf("can't decode channels.updateColor#d8aa3671 to nil") } if err := b.ConsumeID(ChannelsUpdateColorRequestTypeID); err != nil { - return fmt.Errorf("unable to decode channels.updateColor#621a201f: %w", err) + return fmt.Errorf("unable to decode channels.updateColor#d8aa3671: %w", err) } return u.DecodeBare(b) } @@ -193,37 +230,57 @@ func (u *ChannelsUpdateColorRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *ChannelsUpdateColorRequest) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode channels.updateColor#621a201f to nil") + return fmt.Errorf("can't decode channels.updateColor#d8aa3671 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channels.updateColor#621a201f: field flags: %w", err) + return fmt.Errorf("unable to decode channels.updateColor#d8aa3671: field flags: %w", err) } } + u.ForProfile = u.Flags.Has(1) { value, err := DecodeInputChannel(b) if err != nil { - return fmt.Errorf("unable to decode channels.updateColor#621a201f: field channel: %w", err) + return fmt.Errorf("unable to decode channels.updateColor#d8aa3671: field channel: %w", err) } u.Channel = value } - { + if u.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channels.updateColor#621a201f: field color: %w", err) + return fmt.Errorf("unable to decode channels.updateColor#d8aa3671: field color: %w", err) } u.Color = value } if u.Flags.Has(0) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channels.updateColor#621a201f: field background_emoji_id: %w", err) + return fmt.Errorf("unable to decode channels.updateColor#d8aa3671: field background_emoji_id: %w", err) } u.BackgroundEmojiID = value } return nil } +// SetForProfile sets value of ForProfile conditional field. +func (u *ChannelsUpdateColorRequest) SetForProfile(value bool) { + if value { + u.Flags.Set(1) + u.ForProfile = true + } else { + u.Flags.Unset(1) + u.ForProfile = false + } +} + +// GetForProfile returns value of ForProfile conditional field. +func (u *ChannelsUpdateColorRequest) GetForProfile() (value bool) { + if u == nil { + return + } + return u.Flags.Has(1) +} + // GetChannel returns value of Channel field. func (u *ChannelsUpdateColorRequest) GetChannel() (value InputChannelClass) { if u == nil { @@ -232,12 +289,22 @@ func (u *ChannelsUpdateColorRequest) GetChannel() (value InputChannelClass) { return u.Channel } -// GetColor returns value of Color field. -func (u *ChannelsUpdateColorRequest) GetColor() (value int) { +// SetColor sets value of Color conditional field. +func (u *ChannelsUpdateColorRequest) SetColor(value int) { + u.Flags.Set(2) + u.Color = value +} + +// GetColor returns value of Color conditional field and +// boolean which is true if field was set. +func (u *ChannelsUpdateColorRequest) GetColor() (value int, ok bool) { if u == nil { return } - return u.Color + if !u.Flags.Has(2) { + return value, false + } + return u.Color, true } // SetBackgroundEmojiID sets value of BackgroundEmojiID conditional field. @@ -263,7 +330,16 @@ func (u *ChannelsUpdateColorRequest) GetChannelAsNotEmpty() (NotEmptyInputChanne return u.Channel.AsNotEmpty() } -// ChannelsUpdateColor invokes method channels.updateColor#621a201f returning error if any. +// ChannelsUpdateColor invokes method channels.updateColor#d8aa3671 returning error if any. +// Update the accent color and background custom emoji »¹ of a channel. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// Possible errors: +// +// 400 BOOSTS_REQUIRED: The specified channel must first be boosted by its users in order to perform this action. +// 400 CHANNEL_INVALID: The provided channel is invalid. // // See https://core.telegram.org/method/channels.updateColor for reference. func (c *Client) ChannelsUpdateColor(ctx context.Context, request *ChannelsUpdateColorRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_gen.go new file mode 100644 index 00000000..b6583048 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_gen.go @@ -0,0 +1,220 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ChannelsUpdateEmojiStatusRequest represents TL type `channels.updateEmojiStatus#f0d3e6a8`. +// +// See https://core.telegram.org/method/channels.updateEmojiStatus for reference. +type ChannelsUpdateEmojiStatusRequest struct { + // Channel field of ChannelsUpdateEmojiStatusRequest. + Channel InputChannelClass + // EmojiStatus field of ChannelsUpdateEmojiStatusRequest. + EmojiStatus EmojiStatusClass +} + +// ChannelsUpdateEmojiStatusRequestTypeID is TL type id of ChannelsUpdateEmojiStatusRequest. +const ChannelsUpdateEmojiStatusRequestTypeID = 0xf0d3e6a8 + +// Ensuring interfaces in compile-time for ChannelsUpdateEmojiStatusRequest. +var ( + _ bin.Encoder = &ChannelsUpdateEmojiStatusRequest{} + _ bin.Decoder = &ChannelsUpdateEmojiStatusRequest{} + _ bin.BareEncoder = &ChannelsUpdateEmojiStatusRequest{} + _ bin.BareDecoder = &ChannelsUpdateEmojiStatusRequest{} +) + +func (u *ChannelsUpdateEmojiStatusRequest) Zero() bool { + if u == nil { + return true + } + if !(u.Channel == nil) { + return false + } + if !(u.EmojiStatus == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *ChannelsUpdateEmojiStatusRequest) String() string { + if u == nil { + return "ChannelsUpdateEmojiStatusRequest(nil)" + } + type Alias ChannelsUpdateEmojiStatusRequest + return fmt.Sprintf("ChannelsUpdateEmojiStatusRequest%+v", Alias(*u)) +} + +// FillFrom fills ChannelsUpdateEmojiStatusRequest from given interface. +func (u *ChannelsUpdateEmojiStatusRequest) FillFrom(from interface { + GetChannel() (value InputChannelClass) + GetEmojiStatus() (value EmojiStatusClass) +}) { + u.Channel = from.GetChannel() + u.EmojiStatus = from.GetEmojiStatus() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ChannelsUpdateEmojiStatusRequest) TypeID() uint32 { + return ChannelsUpdateEmojiStatusRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ChannelsUpdateEmojiStatusRequest) TypeName() string { + return "channels.updateEmojiStatus" +} + +// TypeInfo returns info about TL type. +func (u *ChannelsUpdateEmojiStatusRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "channels.updateEmojiStatus", + ID: ChannelsUpdateEmojiStatusRequestTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Channel", + SchemaName: "channel", + }, + { + Name: "EmojiStatus", + SchemaName: "emoji_status", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *ChannelsUpdateEmojiStatusRequest) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode channels.updateEmojiStatus#f0d3e6a8 as nil") + } + b.PutID(ChannelsUpdateEmojiStatusRequestTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *ChannelsUpdateEmojiStatusRequest) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode channels.updateEmojiStatus#f0d3e6a8 as nil") + } + if u.Channel == nil { + return fmt.Errorf("unable to encode channels.updateEmojiStatus#f0d3e6a8: field channel is nil") + } + if err := u.Channel.Encode(b); err != nil { + return fmt.Errorf("unable to encode channels.updateEmojiStatus#f0d3e6a8: field channel: %w", err) + } + if u.EmojiStatus == nil { + return fmt.Errorf("unable to encode channels.updateEmojiStatus#f0d3e6a8: field emoji_status is nil") + } + if err := u.EmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode channels.updateEmojiStatus#f0d3e6a8: field emoji_status: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (u *ChannelsUpdateEmojiStatusRequest) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode channels.updateEmojiStatus#f0d3e6a8 to nil") + } + if err := b.ConsumeID(ChannelsUpdateEmojiStatusRequestTypeID); err != nil { + return fmt.Errorf("unable to decode channels.updateEmojiStatus#f0d3e6a8: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *ChannelsUpdateEmojiStatusRequest) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode channels.updateEmojiStatus#f0d3e6a8 to nil") + } + { + value, err := DecodeInputChannel(b) + if err != nil { + return fmt.Errorf("unable to decode channels.updateEmojiStatus#f0d3e6a8: field channel: %w", err) + } + u.Channel = value + } + { + value, err := DecodeEmojiStatus(b) + if err != nil { + return fmt.Errorf("unable to decode channels.updateEmojiStatus#f0d3e6a8: field emoji_status: %w", err) + } + u.EmojiStatus = value + } + return nil +} + +// GetChannel returns value of Channel field. +func (u *ChannelsUpdateEmojiStatusRequest) GetChannel() (value InputChannelClass) { + if u == nil { + return + } + return u.Channel +} + +// GetEmojiStatus returns value of EmojiStatus field. +func (u *ChannelsUpdateEmojiStatusRequest) GetEmojiStatus() (value EmojiStatusClass) { + if u == nil { + return + } + return u.EmojiStatus +} + +// GetChannelAsNotEmpty returns mapped value of Channel field. +func (u *ChannelsUpdateEmojiStatusRequest) GetChannelAsNotEmpty() (NotEmptyInputChannel, bool) { + return u.Channel.AsNotEmpty() +} + +// GetEmojiStatusAsNotEmpty returns mapped value of EmojiStatus field. +func (u *ChannelsUpdateEmojiStatusRequest) GetEmojiStatusAsNotEmpty() (NotEmptyEmojiStatus, bool) { + return u.EmojiStatus.AsNotEmpty() +} + +// ChannelsUpdateEmojiStatus invokes method channels.updateEmojiStatus#f0d3e6a8 returning error if any. +// +// See https://core.telegram.org/method/channels.updateEmojiStatus for reference. +func (c *Client) ChannelsUpdateEmojiStatus(ctx context.Context, request *ChannelsUpdateEmojiStatusRequest) (UpdatesClass, error) { + var result UpdatesBox + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.Updates, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_channels_update_emoji_status_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_chat_admin_rights_gen.go b/vendor/github.com/gotd/td/tg/tl_chat_admin_rights_gen.go index 96157a01..b5cc3982 100644 --- a/vendor/github.com/gotd/td/tg/tl_chat_admin_rights_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_chat_admin_rights_gen.go @@ -104,11 +104,24 @@ type ChatAdminRights struct { // Links: // 1) https://core.telegram.org/api/forum#forum-topics ManageTopics bool - // PostStories field of ChatAdminRights. + // If set, allows the admin to post stories¹ as the channel². + // + // Links: + // 1) https://core.telegram.org/api/stories + // 2) https://core.telegram.org/api/channel PostStories bool - // EditStories field of ChatAdminRights. + // If set, allows the admin to edit stories¹ posted by the other admins of the channel². + // + // Links: + // 1) https://core.telegram.org/api/stories + // 2) https://core.telegram.org/api/channel EditStories bool - // DeleteStories field of ChatAdminRights. + // If set, allows the admin to delete stories¹ posted by the other admins of the + // channel². + // + // Links: + // 1) https://core.telegram.org/api/stories + // 2) https://core.telegram.org/api/channel DeleteStories bool } diff --git a/vendor/github.com/gotd/td/tg/tl_chat_full_gen.go b/vendor/github.com/gotd/td/tg/tl_chat_full_gen.go index dc2710d5..9c7604a7 100644 --- a/vendor/github.com/gotd/td/tg/tl_chat_full_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_chat_full_gen.go @@ -1027,7 +1027,7 @@ func (c *ChatFull) GetAvailableReactions() (value ChatReactionsClass, ok bool) { return c.AvailableReactions, true } -// ChannelFull represents TL type `channelFull#723027bd`. +// ChannelFull represents TL type `channelFull#f2bcb6f`. // Full info about a channel¹, supergroup² or gigagroup³. // // Links: @@ -1087,8 +1087,21 @@ type ChannelFull struct { // Links: // 1) https://core.telegram.org/api/translation TranslationsDisabled bool - // StoriesPinnedAvailable field of ChannelFull. + // Whether this user has some pinned stories¹. + // + // Links: + // 1) https://core.telegram.org/api/stories#pinned-or-archived-stories StoriesPinnedAvailable bool + // Users may also choose to display messages from all topics of a forum¹ as if they were + // sent to a normal group, using a "View as messages" setting in the local client. This + // setting only affects the current account, and is synced to other logged in sessions + // using the channels.toggleViewForumAsMessages² method; invoking this method will + // update the value of this flag. + // + // Links: + // 1) https://core.telegram.org/api/forum + // 2) https://core.telegram.org/method/channels.toggleViewForumAsMessages + ViewForumAsMessages bool // ID of the channel ID int64 // Info about the channel @@ -1251,14 +1264,21 @@ type ChannelFull struct { // // Use SetAvailableReactions and GetAvailableReactions helpers. AvailableReactions ChatReactionsClass - // Stories field of ChannelFull. + // Channel stories¹ + // + // Links: + // 1) https://core.telegram.org/api/stories // // Use SetStories and GetStories helpers. Stories PeerStories + // Wallpaper field of ChannelFull. + // + // Use SetWallpaper and GetWallpaper helpers. + Wallpaper WallPaperClass } // ChannelFullTypeID is TL type id of ChannelFull. -const ChannelFullTypeID = 0x723027bd +const ChannelFullTypeID = 0xf2bcb6f // construct implements constructor of ChatFullClass. func (c ChannelFull) construct() ChatFullClass { return &c } @@ -1322,6 +1342,9 @@ func (c *ChannelFull) Zero() bool { if !(c.StoriesPinnedAvailable == false) { return false } + if !(c.ViewForumAsMessages == false) { + return false + } if !(c.ID == 0) { return false } @@ -1430,6 +1453,9 @@ func (c *ChannelFull) Zero() bool { if !(c.Stories.Zero()) { return false } + if !(c.Wallpaper == nil) { + return false + } return true } @@ -1458,6 +1484,7 @@ func (c *ChannelFull) FillFrom(from interface { GetParticipantsHidden() (value bool) GetTranslationsDisabled() (value bool) GetStoriesPinnedAvailable() (value bool) + GetViewForumAsMessages() (value bool) GetID() (value int64) GetAbout() (value string) GetParticipantsCount() (value int, ok bool) @@ -1494,6 +1521,7 @@ func (c *ChannelFull) FillFrom(from interface { GetDefaultSendAs() (value PeerClass, ok bool) GetAvailableReactions() (value ChatReactionsClass, ok bool) GetStories() (value PeerStories, ok bool) + GetWallpaper() (value WallPaperClass, ok bool) }) { c.CanViewParticipants = from.GetCanViewParticipants() c.CanSetUsername = from.GetCanSetUsername() @@ -1508,6 +1536,7 @@ func (c *ChannelFull) FillFrom(from interface { c.ParticipantsHidden = from.GetParticipantsHidden() c.TranslationsDisabled = from.GetTranslationsDisabled() c.StoriesPinnedAvailable = from.GetStoriesPinnedAvailable() + c.ViewForumAsMessages = from.GetViewForumAsMessages() c.ID = from.GetID() c.About = from.GetAbout() if val, ok := from.GetParticipantsCount(); ok { @@ -1625,6 +1654,10 @@ func (c *ChannelFull) FillFrom(from interface { c.Stories = val } + if val, ok := from.GetWallpaper(); ok { + c.Wallpaper = val + } + } // TypeID returns type id in TL schema. @@ -1715,6 +1748,11 @@ func (c *ChannelFull) TypeInfo() tdp.Type { SchemaName: "stories_pinned_available", Null: !c.Flags2.Has(5), }, + { + Name: "ViewForumAsMessages", + SchemaName: "view_forum_as_messages", + Null: !c.Flags2.Has(6), + }, { Name: "ID", SchemaName: "id", @@ -1886,6 +1924,11 @@ func (c *ChannelFull) TypeInfo() tdp.Type { SchemaName: "stories", Null: !c.Flags2.Has(4), }, + { + Name: "Wallpaper", + SchemaName: "wallpaper", + Null: !c.Flags2.Has(7), + }, } return typ } @@ -1931,6 +1974,9 @@ func (c *ChannelFull) SetFlags() { if !(c.StoriesPinnedAvailable == false) { c.Flags2.Set(5) } + if !(c.ViewForumAsMessages == false) { + c.Flags2.Set(6) + } if !(c.ParticipantsCount == 0) { c.Flags.Set(0) } @@ -2012,12 +2058,15 @@ func (c *ChannelFull) SetFlags() { if !(c.Stories.Zero()) { c.Flags2.Set(4) } + if !(c.Wallpaper == nil) { + c.Flags2.Set(7) + } } // Encode implements bin.Encoder. func (c *ChannelFull) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelFull#723027bd as nil") + return fmt.Errorf("can't encode channelFull#f2bcb6f as nil") } b.PutID(ChannelFullTypeID) return c.EncodeBare(b) @@ -2026,14 +2075,14 @@ func (c *ChannelFull) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channelFull#723027bd as nil") + return fmt.Errorf("can't encode channelFull#f2bcb6f as nil") } c.SetFlags() if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field flags: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field flags: %w", err) } if err := c.Flags2.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field flags2: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field flags2: %w", err) } b.PutLong(c.ID) b.PutString(c.About) @@ -2056,26 +2105,26 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { b.PutInt(c.ReadOutboxMaxID) b.PutInt(c.UnreadCount) if c.ChatPhoto == nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field chat_photo is nil") + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field chat_photo is nil") } if err := c.ChatPhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field chat_photo: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field chat_photo: %w", err) } if err := c.NotifySettings.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field notify_settings: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field notify_settings: %w", err) } if c.Flags.Has(23) { if c.ExportedInvite == nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field exported_invite is nil") + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field exported_invite is nil") } if err := c.ExportedInvite.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field exported_invite: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field exported_invite: %w", err) } } b.PutVectorHeader(len(c.BotInfo)) for idx, v := range c.BotInfo { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field bot_info element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field bot_info element with index %d: %w", idx, err) } } if c.Flags.Has(4) { @@ -2089,7 +2138,7 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(8) { if err := c.Stickerset.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field stickerset: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field stickerset: %w", err) } } if c.Flags.Has(9) { @@ -2103,10 +2152,10 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(15) { if c.Location == nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field location is nil") + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field location is nil") } if err := c.Location.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field location: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field location: %w", err) } } if c.Flags.Has(17) { @@ -2121,7 +2170,7 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { b.PutInt(c.Pts) if c.Flags.Has(21) { if err := c.Call.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field call: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field call: %w", err) } } if c.Flags.Has(24) { @@ -2135,10 +2184,10 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(26) { if c.GroupcallDefaultJoinAs == nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field groupcall_default_join_as is nil") + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field groupcall_default_join_as is nil") } if err := c.GroupcallDefaultJoinAs.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field groupcall_default_join_as: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field groupcall_default_join_as: %w", err) } } if c.Flags.Has(27) { @@ -2155,23 +2204,31 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { } if c.Flags.Has(29) { if c.DefaultSendAs == nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field default_send_as is nil") + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field default_send_as is nil") } if err := c.DefaultSendAs.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field default_send_as: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field default_send_as: %w", err) } } if c.Flags.Has(30) { if c.AvailableReactions == nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field available_reactions is nil") + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field available_reactions is nil") } if err := c.AvailableReactions.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field available_reactions: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field available_reactions: %w", err) } } if c.Flags2.Has(4) { if err := c.Stories.Encode(b); err != nil { - return fmt.Errorf("unable to encode channelFull#723027bd: field stories: %w", err) + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field stories: %w", err) + } + } + if c.Flags2.Has(7) { + if c.Wallpaper == nil { + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field wallpaper is nil") + } + if err := c.Wallpaper.Encode(b); err != nil { + return fmt.Errorf("unable to encode channelFull#f2bcb6f: field wallpaper: %w", err) } } return nil @@ -2180,10 +2237,10 @@ func (c *ChannelFull) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *ChannelFull) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelFull#723027bd to nil") + return fmt.Errorf("can't decode channelFull#f2bcb6f to nil") } if err := b.ConsumeID(ChannelFullTypeID); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: %w", err) } return c.DecodeBare(b) } @@ -2191,11 +2248,11 @@ func (c *ChannelFull) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channelFull#723027bd to nil") + return fmt.Errorf("can't decode channelFull#f2bcb6f to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field flags: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field flags: %w", err) } } c.CanViewParticipants = c.Flags.Has(3) @@ -2208,7 +2265,7 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { c.Blocked = c.Flags.Has(22) { if err := c.Flags2.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field flags2: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field flags2: %w", err) } } c.CanDeleteChannel = c.Flags2.Has(0) @@ -2216,99 +2273,100 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { c.ParticipantsHidden = c.Flags2.Has(2) c.TranslationsDisabled = c.Flags2.Has(3) c.StoriesPinnedAvailable = c.Flags2.Has(5) + c.ViewForumAsMessages = c.Flags2.Has(6) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field id: %w", err) } c.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field about: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field about: %w", err) } c.About = value } if c.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field participants_count: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field participants_count: %w", err) } c.ParticipantsCount = value } if c.Flags.Has(1) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field admins_count: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field admins_count: %w", err) } c.AdminsCount = value } if c.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field kicked_count: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field kicked_count: %w", err) } c.KickedCount = value } if c.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field banned_count: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field banned_count: %w", err) } c.BannedCount = value } if c.Flags.Has(13) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field online_count: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field online_count: %w", err) } c.OnlineCount = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field read_inbox_max_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field read_inbox_max_id: %w", err) } c.ReadInboxMaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field read_outbox_max_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field read_outbox_max_id: %w", err) } c.ReadOutboxMaxID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field unread_count: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field unread_count: %w", err) } c.UnreadCount = value } { value, err := DecodePhoto(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field chat_photo: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field chat_photo: %w", err) } c.ChatPhoto = value } { if err := c.NotifySettings.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field notify_settings: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field notify_settings: %w", err) } } if c.Flags.Has(23) { value, err := DecodeExportedChatInvite(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field exported_invite: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field exported_invite: %w", err) } c.ExportedInvite = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field bot_info: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field bot_info: %w", err) } if headerLen > 0 { @@ -2317,7 +2375,7 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value BotInfo if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field bot_info: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field bot_info: %w", err) } c.BotInfo = append(c.BotInfo, value) } @@ -2325,101 +2383,101 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { if c.Flags.Has(4) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field migrated_from_chat_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field migrated_from_chat_id: %w", err) } c.MigratedFromChatID = value } if c.Flags.Has(4) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field migrated_from_max_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field migrated_from_max_id: %w", err) } c.MigratedFromMaxID = value } if c.Flags.Has(5) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field pinned_msg_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field pinned_msg_id: %w", err) } c.PinnedMsgID = value } if c.Flags.Has(8) { if err := c.Stickerset.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field stickerset: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field stickerset: %w", err) } } if c.Flags.Has(9) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field available_min_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field available_min_id: %w", err) } c.AvailableMinID = value } if c.Flags.Has(11) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field folder_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field folder_id: %w", err) } c.FolderID = value } if c.Flags.Has(14) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field linked_chat_id: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field linked_chat_id: %w", err) } c.LinkedChatID = value } if c.Flags.Has(15) { value, err := DecodeChannelLocation(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field location: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field location: %w", err) } c.Location = value } if c.Flags.Has(17) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field slowmode_seconds: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field slowmode_seconds: %w", err) } c.SlowmodeSeconds = value } if c.Flags.Has(18) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field slowmode_next_send_date: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field slowmode_next_send_date: %w", err) } c.SlowmodeNextSendDate = value } if c.Flags.Has(12) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field stats_dc: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field stats_dc: %w", err) } c.StatsDC = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field pts: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field pts: %w", err) } c.Pts = value } if c.Flags.Has(21) { if err := c.Call.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field call: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field call: %w", err) } } if c.Flags.Has(24) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field ttl_period: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field ttl_period: %w", err) } c.TTLPeriod = value } if c.Flags.Has(25) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field pending_suggestions: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field pending_suggestions: %w", err) } if headerLen > 0 { @@ -2428,7 +2486,7 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field pending_suggestions: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field pending_suggestions: %w", err) } c.PendingSuggestions = append(c.PendingSuggestions, value) } @@ -2436,28 +2494,28 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { if c.Flags.Has(26) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field groupcall_default_join_as: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field groupcall_default_join_as: %w", err) } c.GroupcallDefaultJoinAs = value } if c.Flags.Has(27) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field theme_emoticon: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field theme_emoticon: %w", err) } c.ThemeEmoticon = value } if c.Flags.Has(28) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field requests_pending: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field requests_pending: %w", err) } c.RequestsPending = value } if c.Flags.Has(28) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field recent_requesters: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field recent_requesters: %w", err) } if headerLen > 0 { @@ -2466,7 +2524,7 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field recent_requesters: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field recent_requesters: %w", err) } c.RecentRequesters = append(c.RecentRequesters, value) } @@ -2474,22 +2532,29 @@ func (c *ChannelFull) DecodeBare(b *bin.Buffer) error { if c.Flags.Has(29) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field default_send_as: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field default_send_as: %w", err) } c.DefaultSendAs = value } if c.Flags.Has(30) { value, err := DecodeChatReactions(b) if err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field available_reactions: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field available_reactions: %w", err) } c.AvailableReactions = value } if c.Flags2.Has(4) { if err := c.Stories.Decode(b); err != nil { - return fmt.Errorf("unable to decode channelFull#723027bd: field stories: %w", err) + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field stories: %w", err) } } + if c.Flags2.Has(7) { + value, err := DecodeWallPaper(b) + if err != nil { + return fmt.Errorf("unable to decode channelFull#f2bcb6f: field wallpaper: %w", err) + } + c.Wallpaper = value + } return nil } @@ -2740,6 +2805,25 @@ func (c *ChannelFull) GetStoriesPinnedAvailable() (value bool) { return c.Flags2.Has(5) } +// SetViewForumAsMessages sets value of ViewForumAsMessages conditional field. +func (c *ChannelFull) SetViewForumAsMessages(value bool) { + if value { + c.Flags2.Set(6) + c.ViewForumAsMessages = true + } else { + c.Flags2.Unset(6) + c.ViewForumAsMessages = false + } +} + +// GetViewForumAsMessages returns value of ViewForumAsMessages conditional field. +func (c *ChannelFull) GetViewForumAsMessages() (value bool) { + if c == nil { + return + } + return c.Flags2.Has(6) +} + // GetID returns value of ID field. func (c *ChannelFull) GetID() (value int64) { if c == nil { @@ -3298,6 +3382,24 @@ func (c *ChannelFull) GetStories() (value PeerStories, ok bool) { return c.Stories, true } +// SetWallpaper sets value of Wallpaper conditional field. +func (c *ChannelFull) SetWallpaper(value WallPaperClass) { + c.Flags2.Set(7) + c.Wallpaper = value +} + +// GetWallpaper returns value of Wallpaper conditional field and +// boolean which is true if field was set. +func (c *ChannelFull) GetWallpaper() (value WallPaperClass, ok bool) { + if c == nil { + return + } + if !c.Flags2.Has(7) { + return value, false + } + return c.Wallpaper, true +} + // ChatFullClassName is schema name of ChatFullClass. const ChatFullClassName = "ChatFull" @@ -3313,7 +3415,7 @@ const ChatFullClassName = "ChatFull" // } // switch v := g.(type) { // case *tg.ChatFull: // chatFull#c9d31138 -// case *tg.ChannelFull: // channelFull#723027bd +// case *tg.ChannelFull: // channelFull#f2bcb6f // default: panic(v) // } type ChatFullClass interface { @@ -3419,7 +3521,7 @@ func DecodeChatFull(buf *bin.Buffer) (ChatFullClass, error) { } return &v, nil case ChannelFullTypeID: - // Decoding channelFull#723027bd. + // Decoding channelFull#f2bcb6f. v := ChannelFull{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatFullClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_chat_gen.go b/vendor/github.com/gotd/td/tg/tl_chat_gen.go index e79c74a8..2a2671f2 100644 --- a/vendor/github.com/gotd/td/tg/tl_chat_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_chat_gen.go @@ -999,7 +999,7 @@ func (c *ChatForbidden) GetTitle() (value string) { return c.Title } -// Channel represents TL type `channel#1981ea7e`. +// Channel represents TL type `channel#aadfc8f`. // Channel/supergroup info // // See https://core.telegram.org/constructor/channel for reference. @@ -1011,7 +1011,7 @@ type Channel struct { Flags bin.Fields // Whether the current user is the creator of this channel Creator bool - // Whether the current user has left this channel + // Whether the current user has left or is not a member of this channel Left bool // Is this a channel? Broadcast bool @@ -1081,11 +1081,19 @@ type Channel struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags2 bin.Fields - // StoriesHidden field of Channel. + // Whether we have hidden all stories posted by this channel »¹. + // + // Links: + // 1) https://core.telegram.org/api/stories#hiding-stories-of-other-users StoriesHidden bool - // StoriesHiddenMin field of Channel. + // If set, indicates that the stories_hidden flag was not populated, and its value must + // cannot be relied on; use the previously cached value, or re-fetch the constructor + // using channels.getChannels¹ to obtain the latest value of the stories_hidden flag. + // + // Links: + // 1) https://core.telegram.org/method/channels.getChannels StoriesHiddenMin bool - // StoriesUnavailable field of Channel. + // No stories from the channel are visible. StoriesUnavailable bool // ID of the channel ID int64 @@ -1137,22 +1145,36 @@ type Channel struct { // // Use SetUsernames and GetUsernames helpers. Usernames []Username - // StoriesMaxID field of Channel. + // ID of the maximum read story¹. + // + // Links: + // 1) https://core.telegram.org/api/stories // // Use SetStoriesMaxID and GetStoriesMaxID helpers. StoriesMaxID int - // Color field of Channel. + // The channel's accent color¹. + // + // Links: + // 1) https://core.telegram.org/api/colors // // Use SetColor and GetColor helpers. - Color int - // BackgroundEmojiID field of Channel. + Color PeerColor + // ProfileColor field of Channel. // - // Use SetBackgroundEmojiID and GetBackgroundEmojiID helpers. - BackgroundEmojiID int64 + // Use SetProfileColor and GetProfileColor helpers. + ProfileColor PeerColor + // EmojiStatus field of Channel. + // + // Use SetEmojiStatus and GetEmojiStatus helpers. + EmojiStatus EmojiStatusClass + // Level field of Channel. + // + // Use SetLevel and GetLevel helpers. + Level int } // ChannelTypeID is TL type id of Channel. -const ChannelTypeID = 0x1981ea7e +const ChannelTypeID = 0xaadfc8f // construct implements constructor of ChatClass. func (c Channel) construct() ChatClass { return &c } @@ -1285,10 +1307,16 @@ func (c *Channel) Zero() bool { if !(c.StoriesMaxID == 0) { return false } - if !(c.Color == 0) { + if !(c.Color.Zero()) { return false } - if !(c.BackgroundEmojiID == 0) { + if !(c.ProfileColor.Zero()) { + return false + } + if !(c.EmojiStatus == nil) { + return false + } + if !(c.Level == 0) { return false } @@ -1342,8 +1370,10 @@ func (c *Channel) FillFrom(from interface { GetParticipantsCount() (value int, ok bool) GetUsernames() (value []Username, ok bool) GetStoriesMaxID() (value int, ok bool) - GetColor() (value int, ok bool) - GetBackgroundEmojiID() (value int64, ok bool) + GetColor() (value PeerColor, ok bool) + GetProfileColor() (value PeerColor, ok bool) + GetEmojiStatus() (value EmojiStatusClass, ok bool) + GetLevel() (value int, ok bool) }) { c.Creator = from.GetCreator() c.Left = from.GetLeft() @@ -1412,8 +1442,16 @@ func (c *Channel) FillFrom(from interface { c.Color = val } - if val, ok := from.GetBackgroundEmojiID(); ok { - c.BackgroundEmojiID = val + if val, ok := from.GetProfileColor(); ok { + c.ProfileColor = val + } + + if val, ok := from.GetEmojiStatus(); ok { + c.EmojiStatus = val + } + + if val, ok := from.GetLevel(); ok { + c.Level = val } } @@ -1620,12 +1658,22 @@ func (c *Channel) TypeInfo() tdp.Type { { Name: "Color", SchemaName: "color", - Null: !c.Flags2.Has(6), + Null: !c.Flags2.Has(7), }, { - Name: "BackgroundEmojiID", - SchemaName: "background_emoji_id", - Null: !c.Flags2.Has(5), + Name: "ProfileColor", + SchemaName: "profile_color", + Null: !c.Flags2.Has(8), + }, + { + Name: "EmojiStatus", + SchemaName: "emoji_status", + Null: !c.Flags2.Has(9), + }, + { + Name: "Level", + SchemaName: "level", + Null: !c.Flags2.Has(10), }, } return typ @@ -1729,18 +1777,24 @@ func (c *Channel) SetFlags() { if !(c.StoriesMaxID == 0) { c.Flags2.Set(4) } - if !(c.Color == 0) { - c.Flags2.Set(6) + if !(c.Color.Zero()) { + c.Flags2.Set(7) } - if !(c.BackgroundEmojiID == 0) { - c.Flags2.Set(5) + if !(c.ProfileColor.Zero()) { + c.Flags2.Set(8) + } + if !(c.EmojiStatus == nil) { + c.Flags2.Set(9) + } + if !(c.Level == 0) { + c.Flags2.Set(10) } } // Encode implements bin.Encoder. func (c *Channel) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channel#1981ea7e as nil") + return fmt.Errorf("can't encode channel#aadfc8f as nil") } b.PutID(ChannelTypeID) return c.EncodeBare(b) @@ -1749,14 +1803,14 @@ func (c *Channel) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *Channel) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode channel#1981ea7e as nil") + return fmt.Errorf("can't encode channel#aadfc8f as nil") } c.SetFlags() if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field flags: %w", err) + return fmt.Errorf("unable to encode channel#aadfc8f: field flags: %w", err) } if err := c.Flags2.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field flags2: %w", err) + return fmt.Errorf("unable to encode channel#aadfc8f: field flags2: %w", err) } b.PutLong(c.ID) if c.Flags.Has(13) { @@ -1767,33 +1821,33 @@ func (c *Channel) EncodeBare(b *bin.Buffer) error { b.PutString(c.Username) } if c.Photo == nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field photo is nil") + return fmt.Errorf("unable to encode channel#aadfc8f: field photo is nil") } if err := c.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field photo: %w", err) + return fmt.Errorf("unable to encode channel#aadfc8f: field photo: %w", err) } b.PutInt(c.Date) if c.Flags.Has(9) { b.PutVectorHeader(len(c.RestrictionReason)) for idx, v := range c.RestrictionReason { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field restriction_reason element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode channel#aadfc8f: field restriction_reason element with index %d: %w", idx, err) } } } if c.Flags.Has(14) { if err := c.AdminRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field admin_rights: %w", err) + return fmt.Errorf("unable to encode channel#aadfc8f: field admin_rights: %w", err) } } if c.Flags.Has(15) { if err := c.BannedRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field banned_rights: %w", err) + return fmt.Errorf("unable to encode channel#aadfc8f: field banned_rights: %w", err) } } if c.Flags.Has(18) { if err := c.DefaultBannedRights.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field default_banned_rights: %w", err) + return fmt.Errorf("unable to encode channel#aadfc8f: field default_banned_rights: %w", err) } } if c.Flags.Has(17) { @@ -1803,18 +1857,33 @@ func (c *Channel) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(c.Usernames)) for idx, v := range c.Usernames { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode channel#1981ea7e: field usernames element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode channel#aadfc8f: field usernames element with index %d: %w", idx, err) } } } if c.Flags2.Has(4) { b.PutInt(c.StoriesMaxID) } - if c.Flags2.Has(6) { - b.PutInt(c.Color) + if c.Flags2.Has(7) { + if err := c.Color.Encode(b); err != nil { + return fmt.Errorf("unable to encode channel#aadfc8f: field color: %w", err) + } } - if c.Flags2.Has(5) { - b.PutLong(c.BackgroundEmojiID) + if c.Flags2.Has(8) { + if err := c.ProfileColor.Encode(b); err != nil { + return fmt.Errorf("unable to encode channel#aadfc8f: field profile_color: %w", err) + } + } + if c.Flags2.Has(9) { + if c.EmojiStatus == nil { + return fmt.Errorf("unable to encode channel#aadfc8f: field emoji_status is nil") + } + if err := c.EmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode channel#aadfc8f: field emoji_status: %w", err) + } + } + if c.Flags2.Has(10) { + b.PutInt(c.Level) } return nil } @@ -1822,10 +1891,10 @@ func (c *Channel) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *Channel) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channel#1981ea7e to nil") + return fmt.Errorf("can't decode channel#aadfc8f to nil") } if err := b.ConsumeID(ChannelTypeID); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: %w", err) } return c.DecodeBare(b) } @@ -1833,11 +1902,11 @@ func (c *Channel) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *Channel) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode channel#1981ea7e to nil") + return fmt.Errorf("can't decode channel#aadfc8f to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field flags: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field flags: %w", err) } } c.Creator = c.Flags.Has(0) @@ -1862,7 +1931,7 @@ func (c *Channel) DecodeBare(b *bin.Buffer) error { c.Forum = c.Flags.Has(30) { if err := c.Flags2.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field flags2: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field flags2: %w", err) } } c.StoriesHidden = c.Flags2.Has(1) @@ -1871,49 +1940,49 @@ func (c *Channel) DecodeBare(b *bin.Buffer) error { { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field id: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field id: %w", err) } c.ID = value } if c.Flags.Has(13) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field access_hash: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field access_hash: %w", err) } c.AccessHash = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field title: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field title: %w", err) } c.Title = value } if c.Flags.Has(6) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field username: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field username: %w", err) } c.Username = value } { value, err := DecodeChatPhoto(b) if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field photo: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field photo: %w", err) } c.Photo = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field date: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field date: %w", err) } c.Date = value } if c.Flags.Has(9) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field restriction_reason: %w", err) } if headerLen > 0 { @@ -1922,37 +1991,37 @@ func (c *Channel) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value RestrictionReason if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field restriction_reason: %w", err) } c.RestrictionReason = append(c.RestrictionReason, value) } } if c.Flags.Has(14) { if err := c.AdminRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field admin_rights: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field admin_rights: %w", err) } } if c.Flags.Has(15) { if err := c.BannedRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field banned_rights: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field banned_rights: %w", err) } } if c.Flags.Has(18) { if err := c.DefaultBannedRights.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field default_banned_rights: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field default_banned_rights: %w", err) } } if c.Flags.Has(17) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field participants_count: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field participants_count: %w", err) } c.ParticipantsCount = value } if c.Flags2.Has(0) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field usernames: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field usernames: %w", err) } if headerLen > 0 { @@ -1961,7 +2030,7 @@ func (c *Channel) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value Username if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field usernames: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field usernames: %w", err) } c.Usernames = append(c.Usernames, value) } @@ -1969,23 +2038,33 @@ func (c *Channel) DecodeBare(b *bin.Buffer) error { if c.Flags2.Has(4) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field stories_max_id: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field stories_max_id: %w", err) } c.StoriesMaxID = value } - if c.Flags2.Has(6) { + if c.Flags2.Has(7) { + if err := c.Color.Decode(b); err != nil { + return fmt.Errorf("unable to decode channel#aadfc8f: field color: %w", err) + } + } + if c.Flags2.Has(8) { + if err := c.ProfileColor.Decode(b); err != nil { + return fmt.Errorf("unable to decode channel#aadfc8f: field profile_color: %w", err) + } + } + if c.Flags2.Has(9) { + value, err := DecodeEmojiStatus(b) + if err != nil { + return fmt.Errorf("unable to decode channel#aadfc8f: field emoji_status: %w", err) + } + c.EmojiStatus = value + } + if c.Flags2.Has(10) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field color: %w", err) + return fmt.Errorf("unable to decode channel#aadfc8f: field level: %w", err) } - c.Color = value - } - if c.Flags2.Has(5) { - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode channel#1981ea7e: field background_emoji_id: %w", err) - } - c.BackgroundEmojiID = value + c.Level = value } return nil } @@ -2622,39 +2701,75 @@ func (c *Channel) GetStoriesMaxID() (value int, ok bool) { } // SetColor sets value of Color conditional field. -func (c *Channel) SetColor(value int) { - c.Flags2.Set(6) +func (c *Channel) SetColor(value PeerColor) { + c.Flags2.Set(7) c.Color = value } // GetColor returns value of Color conditional field and // boolean which is true if field was set. -func (c *Channel) GetColor() (value int, ok bool) { +func (c *Channel) GetColor() (value PeerColor, ok bool) { if c == nil { return } - if !c.Flags2.Has(6) { + if !c.Flags2.Has(7) { return value, false } return c.Color, true } -// SetBackgroundEmojiID sets value of BackgroundEmojiID conditional field. -func (c *Channel) SetBackgroundEmojiID(value int64) { - c.Flags2.Set(5) - c.BackgroundEmojiID = value +// SetProfileColor sets value of ProfileColor conditional field. +func (c *Channel) SetProfileColor(value PeerColor) { + c.Flags2.Set(8) + c.ProfileColor = value } -// GetBackgroundEmojiID returns value of BackgroundEmojiID conditional field and +// GetProfileColor returns value of ProfileColor conditional field and // boolean which is true if field was set. -func (c *Channel) GetBackgroundEmojiID() (value int64, ok bool) { +func (c *Channel) GetProfileColor() (value PeerColor, ok bool) { if c == nil { return } - if !c.Flags2.Has(5) { + if !c.Flags2.Has(8) { return value, false } - return c.BackgroundEmojiID, true + return c.ProfileColor, true +} + +// SetEmojiStatus sets value of EmojiStatus conditional field. +func (c *Channel) SetEmojiStatus(value EmojiStatusClass) { + c.Flags2.Set(9) + c.EmojiStatus = value +} + +// GetEmojiStatus returns value of EmojiStatus conditional field and +// boolean which is true if field was set. +func (c *Channel) GetEmojiStatus() (value EmojiStatusClass, ok bool) { + if c == nil { + return + } + if !c.Flags2.Has(9) { + return value, false + } + return c.EmojiStatus, true +} + +// SetLevel sets value of Level conditional field. +func (c *Channel) SetLevel(value int) { + c.Flags2.Set(10) + c.Level = value +} + +// GetLevel returns value of Level conditional field and +// boolean which is true if field was set. +func (c *Channel) GetLevel() (value int, ok bool) { + if c == nil { + return + } + if !c.Flags2.Has(10) { + return value, false + } + return c.Level, true } // ChannelForbidden represents TL type `channelForbidden#17d493d5`. @@ -3003,7 +3118,7 @@ const ChatClassName = "Chat" // case *tg.ChatEmpty: // chatEmpty#29562865 // case *tg.Chat: // chat#41cbf256 // case *tg.ChatForbidden: // chatForbidden#6592a1a7 -// case *tg.Channel: // channel#1981ea7e +// case *tg.Channel: // channel#aadfc8f // case *tg.ChannelForbidden: // channelForbidden#17d493d5 // default: panic(v) // } @@ -3296,7 +3411,7 @@ func DecodeChat(buf *bin.Buffer) (ChatClass, error) { } return &v, nil case ChannelTypeID: - // Decoding channel#1981ea7e. + // Decoding channel#aadfc8f. v := Channel{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ChatClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_chat_invite_gen.go b/vendor/github.com/gotd/td/tg/tl_chat_invite_gen.go index a7ea1c20..d0b4082e 100644 --- a/vendor/github.com/gotd/td/tg/tl_chat_invite_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_chat_invite_gen.go @@ -207,11 +207,12 @@ type ChatInvite struct { // Links: // 1) https://core.telegram.org/api/invites#join-requests RequestNeeded bool - // Verified field of ChatInvite. + // Is this chat or channel verified by Telegram? Verified bool - // Scam field of ChatInvite. + // This chat is probably a scam Scam bool - // Fake field of ChatInvite. + // If set, this chat was reported by many users as a fake or scam: be careful when + // interacting with it. Fake bool // Chat/supergroup/channel title Title string @@ -227,7 +228,10 @@ type ChatInvite struct { // // Use SetParticipants and GetParticipants helpers. Participants []UserClass - // Color field of ChatInvite. + // Profile color palette ID¹ + // + // Links: + // 1) https://core.telegram.org/api/colors Color int } diff --git a/vendor/github.com/gotd/td/tg/tl_chatlists_check_chatlist_invite_gen.go b/vendor/github.com/gotd/td/tg/tl_chatlists_check_chatlist_invite_gen.go index b8f11ea6..c614784f 100644 --- a/vendor/github.com/gotd/td/tg/tl_chatlists_check_chatlist_invite_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_chatlists_check_chatlist_invite_gen.go @@ -176,6 +176,7 @@ func (c *ChatlistsCheckChatlistInviteRequest) GetSlug() (value string) { // Possible errors: // // 400 INVITE_SLUG_EMPTY: The specified invite slug is empty. +// 400 INVITE_SLUG_EXPIRED: The specified chat folder link has expired. // // See https://core.telegram.org/method/chatlists.checkChatlistInvite for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_chatlists_get_chatlist_updates_gen.go b/vendor/github.com/gotd/td/tg/tl_chatlists_get_chatlist_updates_gen.go index 17e71ada..79074ba6 100644 --- a/vendor/github.com/gotd/td/tg/tl_chatlists_get_chatlist_updates_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_chatlists_get_chatlist_updates_gen.go @@ -178,7 +178,8 @@ func (g *ChatlistsGetChatlistUpdatesRequest) GetChatlist() (value InputChatlistD // // Possible errors: // -// 400 INPUT_CHATLIST_INVALID: +// 400 FILTER_ID_INVALID: The specified filter ID is invalid. +// 400 INPUT_CHATLIST_INVALID: The specified folder is invalid. // // See https://core.telegram.org/method/chatlists.getChatlistUpdates for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_chatlists_join_chatlist_invite_gen.go b/vendor/github.com/gotd/td/tg/tl_chatlists_join_chatlist_invite_gen.go index b9afdfe3..2e44aa2d 100644 --- a/vendor/github.com/gotd/td/tg/tl_chatlists_join_chatlist_invite_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_chatlists_join_chatlist_invite_gen.go @@ -230,7 +230,9 @@ func (j *ChatlistsJoinChatlistInviteRequest) MapPeers() (value InputPeerClassArr // // Possible errors: // +// 400 FILTER_INCLUDE_EMPTY: The include_peers vector of the filter is empty. // 400 INVITE_SLUG_EMPTY: The specified invite slug is empty. +// 400 INVITE_SLUG_EXPIRED: The specified chat folder link has expired. // // See https://core.telegram.org/method/chatlists.joinChatlistInvite for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_accept_contact_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_accept_contact_gen.go index 463acccf..48fa2cfd 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_accept_contact_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_accept_contact_gen.go @@ -32,11 +32,10 @@ var ( ) // ContactsAcceptContactRequest represents TL type `contacts.acceptContact#f831a20f`. -// If the peer settings¹ of a new user allow us to add them as contact, add that user as -// contact +// If the add contact action bar is active¹, add that user as contact // // Links: -// 1. https://core.telegram.org/constructor/peerSettings +// 1. https://core.telegram.org/api/action-bar#add-contact // // See https://core.telegram.org/method/contacts.acceptContact for reference. type ContactsAcceptContactRequest struct { @@ -171,11 +170,10 @@ func (a *ContactsAcceptContactRequest) GetID() (value InputUserClass) { } // ContactsAcceptContact invokes method contacts.acceptContact#f831a20f returning error if any. -// If the peer settings¹ of a new user allow us to add them as contact, add that user as -// contact +// If the add contact action bar is active¹, add that user as contact // // Links: -// 1. https://core.telegram.org/constructor/peerSettings +// 1. https://core.telegram.org/api/action-bar#add-contact // // Possible errors: // diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_add_contact_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_add_contact_gen.go index 456e03d4..79bfd148 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_add_contact_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_add_contact_gen.go @@ -54,7 +54,8 @@ type ContactsAddContactRequest struct { FirstName string // Last name LastName string - // User's phone number + // User's phone number, may be omitted to simply add the user to the contact list, + // without a phone number. Phone string } diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_block_from_replies_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_block_from_replies_gen.go index e0bb0848..22e4f031 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_block_from_replies_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_block_from_replies_gen.go @@ -32,10 +32,10 @@ var ( ) // ContactsBlockFromRepliesRequest represents TL type `contacts.blockFromReplies#29a8962c`. -// Stop getting notifications about thread replies¹ of a certain user in @replies +// Stop getting notifications about discussion replies¹ of a certain user in @replies // // Links: -// 1. https://core.telegram.org/api/threads +// 1. https://core.telegram.org/api/discussion // // See https://core.telegram.org/method/contacts.blockFromReplies for reference. type ContactsBlockFromRepliesRequest struct { @@ -53,7 +53,7 @@ type ContactsBlockFromRepliesRequest struct { // ID of the message in the @replies¹ chat // // Links: - // 1) https://core.telegram.org/api/threads#replies + // 1) https://core.telegram.org/api/discussion#replies MsgID int } @@ -294,10 +294,10 @@ func (b *ContactsBlockFromRepliesRequest) GetMsgID() (value int) { } // ContactsBlockFromReplies invokes method contacts.blockFromReplies#29a8962c returning error if any. -// Stop getting notifications about thread replies¹ of a certain user in @replies +// Stop getting notifications about discussion replies¹ of a certain user in @replies // // Links: -// 1. https://core.telegram.org/api/threads +// 1. https://core.telegram.org/api/discussion // // See https://core.telegram.org/method/contacts.blockFromReplies for reference. func (c *Client) ContactsBlockFromReplies(ctx context.Context, request *ContactsBlockFromRepliesRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_block_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_block_gen.go index 01c06c2b..6c0a0734 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_block_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_block_gen.go @@ -32,15 +32,25 @@ var ( ) // ContactsBlockRequest represents TL type `contacts.block#2e2e8734`. -// Adds the user to the blacklist. +// Adds a peer to a blocklist, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/block // // See https://core.telegram.org/method/contacts.block for reference. type ContactsBlockRequest struct { - // Flags field of ContactsBlockRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MyStoriesFrom field of ContactsBlockRequest. + // Whether the peer should be added to the story blocklist; if not set, the peer will be + // added to the main blocklist, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/block MyStoriesFrom bool - // User ID + // Peer ID InputPeerClass } @@ -220,10 +230,14 @@ func (b *ContactsBlockRequest) GetID() (value InputPeerClass) { } // ContactsBlock invokes method contacts.block#2e2e8734 returning error if any. -// Adds the user to the blacklist. +// Adds a peer to a blocklist, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/block // // Possible errors: // +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CONTACT_ID_INVALID: The provided contact ID is invalid. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MSG_ID_INVALID: Invalid message ID provided. diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_edit_close_friends_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_edit_close_friends_gen.go index 1c6c64b1..2b262279 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_edit_close_friends_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_edit_close_friends_gen.go @@ -32,10 +32,17 @@ var ( ) // ContactsEditCloseFriendsRequest represents TL type `contacts.editCloseFriends#ba6705f0`. +// Edit the close friends list, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/privacy // // See https://core.telegram.org/method/contacts.editCloseFriends for reference. type ContactsEditCloseFriendsRequest struct { - // ID field of ContactsEditCloseFriendsRequest. + // Full list of user IDs of close friends, see here¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/privacy ID []int64 } @@ -174,6 +181,10 @@ func (e *ContactsEditCloseFriendsRequest) GetID() (value []int64) { } // ContactsEditCloseFriends invokes method contacts.editCloseFriends#ba6705f0 returning error if any. +// Edit the close friends list, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/privacy // // See https://core.telegram.org/method/contacts.editCloseFriends for reference. func (c *Client) ContactsEditCloseFriends(ctx context.Context, id []int64) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_get_blocked_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_get_blocked_gen.go index 8ed9c96d..dd9901d0 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_get_blocked_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_get_blocked_gen.go @@ -36,9 +36,16 @@ var ( // // See https://core.telegram.org/method/contacts.getBlocked for reference. type ContactsGetBlockedRequest struct { - // Flags field of ContactsGetBlockedRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MyStoriesFrom field of ContactsGetBlockedRequest. + // Whether to fetch the story blocklist; if not set, will fetch the main blocklist. See + // here »¹ for differences between the two. + // + // Links: + // 1) https://core.telegram.org/api/block MyStoriesFrom bool // The number of list elements to be skipped Offset int diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_get_located_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_get_located_gen.go index 2887c323..a0ae3014 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_get_located_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_get_located_gen.go @@ -32,7 +32,10 @@ var ( ) // ContactsGetLocatedRequest represents TL type `contacts.getLocated#d348bc44`. -// Get contacts near you +// Get users and geochats near you, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/nearby // // See https://core.telegram.org/method/contacts.getLocated for reference. type ContactsGetLocatedRequest struct { @@ -281,7 +284,10 @@ func (g *ContactsGetLocatedRequest) GetGeoPointAsNotEmpty() (*InputGeoPoint, boo } // ContactsGetLocated invokes method contacts.getLocated#d348bc44 returning error if any. -// Get contacts near you +// Get users and geochats near you, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/nearby // // Possible errors: // diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_get_saved_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_get_saved_gen.go index 32f50153..a419a516 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_get_saved_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_get_saved_gen.go @@ -32,7 +32,10 @@ var ( ) // ContactsGetSavedRequest represents TL type `contacts.getSaved#82f1e39f`. -// Get all contacts +// Get all contacts, requires a takeout session, see here » for more info¹. +// +// Links: +// 1. https://core.telegram.org/api/takeout // // See https://core.telegram.org/method/contacts.getSaved for reference. type ContactsGetSavedRequest struct { @@ -129,11 +132,14 @@ func (g *ContactsGetSavedRequest) DecodeBare(b *bin.Buffer) error { } // ContactsGetSaved invokes method contacts.getSaved#82f1e39f returning error if any. -// Get all contacts +// Get all contacts, requires a takeout session, see here » for more info¹. +// +// Links: +// 1. https://core.telegram.org/api/takeout // // Possible errors: // -// 403 TAKEOUT_REQUIRED: A takeout session has to be initialized, first. +// 403 TAKEOUT_REQUIRED: A takeout¹ session needs to be initialized first, see here » for more info². // // See https://core.telegram.org/method/contacts.getSaved for reference. func (c *Client) ContactsGetSaved(ctx context.Context) ([]SavedPhoneContact, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_set_blocked_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_set_blocked_gen.go index 3af2b9aa..09b11558 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_set_blocked_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_set_blocked_gen.go @@ -32,16 +32,30 @@ var ( ) // ContactsSetBlockedRequest represents TL type `contacts.setBlocked#94c65c76`. +// Replace the contents of an entire blocklist, see here for more info »¹. +// +// Links: +// 1. https://core.telegram.org/api/block // // See https://core.telegram.org/method/contacts.setBlocked for reference. type ContactsSetBlockedRequest struct { - // Flags field of ContactsSetBlockedRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MyStoriesFrom field of ContactsSetBlockedRequest. + // Whether to edit the story blocklist; if not set, will edit the main blocklist. See + // here »¹ for differences between the two. + // + // Links: + // 1) https://core.telegram.org/api/block MyStoriesFrom bool - // ID field of ContactsSetBlockedRequest. + // Full content of the blocklist. ID []InputPeerClass - // Limit field of ContactsSetBlockedRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -264,6 +278,10 @@ func (s *ContactsSetBlockedRequest) MapID() (value InputPeerClassArray) { } // ContactsSetBlocked invokes method contacts.setBlocked#94c65c76 returning error if any. +// Replace the contents of an entire blocklist, see here for more info »¹. +// +// Links: +// 1. https://core.telegram.org/api/block // // See https://core.telegram.org/method/contacts.setBlocked for reference. func (c *Client) ContactsSetBlocked(ctx context.Context, request *ContactsSetBlockedRequest) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_contacts_unblock_gen.go b/vendor/github.com/gotd/td/tg/tl_contacts_unblock_gen.go index cf3b8d53..88459c92 100644 --- a/vendor/github.com/gotd/td/tg/tl_contacts_unblock_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_contacts_unblock_gen.go @@ -32,15 +32,25 @@ var ( ) // ContactsUnblockRequest represents TL type `contacts.unblock#b550d328`. -// Deletes the user from the blacklist. +// Deletes a peer from a blocklist, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/block // // See https://core.telegram.org/method/contacts.unblock for reference. type ContactsUnblockRequest struct { - // Flags field of ContactsUnblockRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MyStoriesFrom field of ContactsUnblockRequest. + // Whether the peer should be removed from the story blocklist; if not set, the peer will + // be removed from the main blocklist, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/block MyStoriesFrom bool - // User ID + // Peer ID InputPeerClass } @@ -220,7 +230,10 @@ func (u *ContactsUnblockRequest) GetID() (value InputPeerClass) { } // ContactsUnblock invokes method contacts.unblock#b550d328 returning error if any. -// Deletes the user from the blacklist. +// Deletes a peer from a blocklist, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/block // // Possible errors: // diff --git a/vendor/github.com/gotd/td/tg/tl_dialog_gen.go b/vendor/github.com/gotd/td/tg/tl_dialog_gen.go index f5401b55..c1a038e5 100644 --- a/vendor/github.com/gotd/td/tg/tl_dialog_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_dialog_gen.go @@ -45,6 +45,16 @@ type Dialog struct { Pinned bool // Whether the chat was manually marked as unread UnreadMark bool + // Users may also choose to display messages from all topics of a forum¹ as if they were + // sent to a normal group, using a "View as messages" setting in the local client. This + // setting only affects the current account, and is synced to other logged in sessions + // using the channels.toggleViewForumAsMessages² method; invoking this method will + // update the value of this flag. + // + // Links: + // 1) https://core.telegram.org/api/forum + // 2) https://core.telegram.org/method/channels.toggleViewForumAsMessages + ViewForumAsMessages bool // The chat Peer PeerClass // The latest message ID @@ -120,6 +130,9 @@ func (d *Dialog) Zero() bool { if !(d.UnreadMark == false) { return false } + if !(d.ViewForumAsMessages == false) { + return false + } if !(d.Peer == nil) { return false } @@ -173,6 +186,7 @@ func (d *Dialog) String() string { func (d *Dialog) FillFrom(from interface { GetPinned() (value bool) GetUnreadMark() (value bool) + GetViewForumAsMessages() (value bool) GetPeer() (value PeerClass) GetTopMessage() (value int) GetReadInboxMaxID() (value int) @@ -188,6 +202,7 @@ func (d *Dialog) FillFrom(from interface { }) { d.Pinned = from.GetPinned() d.UnreadMark = from.GetUnreadMark() + d.ViewForumAsMessages = from.GetViewForumAsMessages() d.Peer = from.GetPeer() d.TopMessage = from.GetTopMessage() d.ReadInboxMaxID = from.GetReadInboxMaxID() @@ -247,6 +262,11 @@ func (d *Dialog) TypeInfo() tdp.Type { SchemaName: "unread_mark", Null: !d.Flags.Has(3), }, + { + Name: "ViewForumAsMessages", + SchemaName: "view_forum_as_messages", + Null: !d.Flags.Has(6), + }, { Name: "Peer", SchemaName: "peer", @@ -311,6 +331,9 @@ func (d *Dialog) SetFlags() { if !(d.UnreadMark == false) { d.Flags.Set(3) } + if !(d.ViewForumAsMessages == false) { + d.Flags.Set(6) + } if !(d.Pts == 0) { d.Flags.Set(0) } @@ -401,6 +424,7 @@ func (d *Dialog) DecodeBare(b *bin.Buffer) error { } d.Pinned = d.Flags.Has(2) d.UnreadMark = d.Flags.Has(3) + d.ViewForumAsMessages = d.Flags.Has(6) { value, err := DecodePeer(b) if err != nil { @@ -524,6 +548,25 @@ func (d *Dialog) GetUnreadMark() (value bool) { return d.Flags.Has(3) } +// SetViewForumAsMessages sets value of ViewForumAsMessages conditional field. +func (d *Dialog) SetViewForumAsMessages(value bool) { + if value { + d.Flags.Set(6) + d.ViewForumAsMessages = true + } else { + d.Flags.Unset(6) + d.ViewForumAsMessages = false + } +} + +// GetViewForumAsMessages returns value of ViewForumAsMessages conditional field. +func (d *Dialog) GetViewForumAsMessages() (value bool) { + if d == nil { + return + } + return d.Flags.Has(6) +} + // GetPeer returns value of Peer field. func (d *Dialog) GetPeer() (value PeerClass) { if d == nil { diff --git a/vendor/github.com/gotd/td/tg/tl_document_attribute_gen.go b/vendor/github.com/gotd/td/tg/tl_document_attribute_gen.go index 9a06e883..7b213cad 100644 --- a/vendor/github.com/gotd/td/tg/tl_document_attribute_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_document_attribute_gen.go @@ -580,7 +580,8 @@ type DocumentAttributeVideo struct { RoundMessage bool // Whether the video supports streaming SupportsStreaming bool - // Nosound field of DocumentAttributeVideo. + // Whether the specified document is a video file with no audio tracks (a GIF animation + // (even as MPEG4), for example) Nosound bool // Duration in seconds Duration float64 @@ -588,7 +589,10 @@ type DocumentAttributeVideo struct { W int // Video height H int - // PreloadPrefixSize field of DocumentAttributeVideo. + // Number of bytes to preload when preloading videos (particularly video stories¹). + // + // Links: + // 1) https://core.telegram.org/api/stories // // Use SetPreloadPrefixSize and GetPreloadPrefixSize helpers. PreloadPrefixSize int diff --git a/vendor/github.com/gotd/td/tg/tl_draft_message_gen.go b/vendor/github.com/gotd/td/tg/tl_draft_message_gen.go index 6cedd85e..471f5440 100644 --- a/vendor/github.com/gotd/td/tg/tl_draft_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_draft_message_gen.go @@ -223,9 +223,11 @@ type DraftMessage struct { Flags bin.Fields // Whether no webpage preview will be generated NoWebpage bool - // InvertMedia field of DraftMessage. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool - // ReplyTo field of DraftMessage. + // If set, indicates that the message should be sent in reply to the specified message or + // story. // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -238,7 +240,7 @@ type DraftMessage struct { // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // Media field of DraftMessage. + // Media. // // Use SetMedia and GetMedia helpers. Media InputMediaClass diff --git a/vendor/github.com/gotd/td/tg/tl_errors_gen.go b/vendor/github.com/gotd/td/tg/tl_errors_gen.go index 15d1ce71..2357773f 100644 --- a/vendor/github.com/gotd/td/tg/tl_errors_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_errors_gen.go @@ -37,11 +37,14 @@ const ( ErrAboutTooLong = "ABOUT_TOO_LONG" ErrAccessTokenExpired = "ACCESS_TOKEN_EXPIRED" ErrAccessTokenInvalid = "ACCESS_TOKEN_INVALID" + ErrAddressInvalid = "ADDRESS_INVALID" ErrAdminsTooMuch = "ADMINS_TOO_MUCH" ErrAdminIDInvalid = "ADMIN_ID_INVALID" ErrAdminRankEmojiNotAllowed = "ADMIN_RANK_EMOJI_NOT_ALLOWED" ErrAdminRankInvalid = "ADMIN_RANK_INVALID" + ErrAdminRightsEmpty = "ADMIN_RIGHTS_EMPTY" ErrAlbumPhotosTooMany = "ALBUM_PHOTOS_TOO_MANY" + ErrAnonymousReactionsDisabled = "ANONYMOUS_REACTIONS_DISABLED" ErrAPIIDInvalid = "API_ID_INVALID" ErrAPIIDPublishedFlood = "API_ID_PUBLISHED_FLOOD" ErrArticleTitleEmpty = "ARTICLE_TITLE_EMPTY" @@ -57,6 +60,9 @@ const ( ErrAutoarchiveNotAvailable = "AUTOARCHIVE_NOT_AVAILABLE" ErrBankCardNumberInvalid = "BANK_CARD_NUMBER_INVALID" ErrBannedRightsInvalid = "BANNED_RIGHTS_INVALID" + ErrBoostsEmpty = "BOOSTS_EMPTY" + ErrBoostsRequired = "BOOSTS_REQUIRED" + ErrBoostPeerInvalid = "BOOST_PEER_INVALID" ErrBotsTooMuch = "BOTS_TOO_MUCH" ErrBotAppInvalid = "BOT_APP_INVALID" ErrBotChannelsNa = "BOT_CHANNELS_NA" @@ -84,6 +90,7 @@ const ( ErrCallAlreadyDeclined = "CALL_ALREADY_DECLINED" ErrCallOccupyFailed = "CALL_OCCUPY_FAILED" ErrCallPeerInvalid = "CALL_PEER_INVALID" + ErrCallProtocolCompatLayerInvalid = "CALL_PROTOCOL_COMPAT_LAYER_INVALID" ErrCallProtocolFlagsInvalid = "CALL_PROTOCOL_FLAGS_INVALID" ErrCDNMethodInvalid = "CDN_METHOD_INVALID" ErrCDNUploadTimeout = "CDN_UPLOAD_TIMEOUT" @@ -91,7 +98,6 @@ const ( ErrChannelsAdminPublicTooMuch = "CHANNELS_ADMIN_PUBLIC_TOO_MUCH" ErrChannelsTooMuch = "CHANNELS_TOO_MUCH" ErrChannelForumMissing = "CHANNEL_FORUM_MISSING" - ErrChannelIDGenerateFailed = "CHANNEL_ID_GENERATE_FAILED" ErrChannelIDInvalid = "CHANNEL_ID_INVALID" ErrChannelInvalid = "CHANNEL_INVALID" ErrChannelParicipantMissing = "CHANNEL_PARICIPANT_MISSING" @@ -113,7 +119,6 @@ const ( ErrChatInvalid = "CHAT_INVALID" ErrChatInvitePermanent = "CHAT_INVITE_PERMANENT" ErrChatLinkExists = "CHAT_LINK_EXISTS" - ErrChatMembersChannel = "CHAT_MEMBERS_CHANNEL" ErrChatNotModified = "CHAT_NOT_MODIFIED" ErrChatPublicRequired = "CHAT_PUBLIC_REQUIRED" ErrChatRestricted = "CHAT_RESTRICTED" @@ -136,6 +141,7 @@ const ( ErrCodeEmpty = "CODE_EMPTY" ErrCodeHashInvalid = "CODE_HASH_INVALID" ErrCodeInvalid = "CODE_INVALID" + ErrColorInvalid = "COLOR_INVALID" ErrConnectionAPIIDInvalid = "CONNECTION_API_ID_INVALID" ErrConnectionAppVersionEmpty = "CONNECTION_APP_VERSION_EMPTY" ErrConnectionLayerInvalid = "CONNECTION_LAYER_INVALID" @@ -145,6 +151,7 @@ const ( ErrContactReqMissing = "CONTACT_REQ_MISSING" ErrCreateCallFailed = "CREATE_CALL_FAILED" ErrCurrencyTotalAmountInvalid = "CURRENCY_TOTAL_AMOUNT_INVALID" + ErrCustomReactionsTooMany = "CUSTOM_REACTIONS_TOO_MANY" ErrDataInvalid = "DATA_INVALID" ErrDataJSONInvalid = "DATA_JSON_INVALID" ErrDataTooLong = "DATA_TOO_LONG" @@ -192,25 +199,29 @@ const ( ErrFileReferenceInvalid = "FILE_REFERENCE_INVALID" ErrFileTitleEmpty = "FILE_TITLE_EMPTY" ErrFileTokenInvalid = "FILE_TOKEN_INVALID" - ErrFileWriteEmpty = "FILE_WRITE_EMPTY" ErrFilterIDInvalid = "FILTER_ID_INVALID" ErrFilterIncludeEmpty = "FILTER_INCLUDE_EMPTY" ErrFilterNotSupported = "FILTER_NOT_SUPPORTED" ErrFilterTitleEmpty = "FILTER_TITLE_EMPTY" ErrFirstnameInvalid = "FIRSTNAME_INVALID" ErrFolderIDInvalid = "FOLDER_ID_INVALID" + ErrForumEnabled = "FORUM_ENABLED" ErrFreshChangeAdminsForbidden = "FRESH_CHANGE_ADMINS_FORBIDDEN" ErrFreshChangePhoneForbidden = "FRESH_CHANGE_PHONE_FORBIDDEN" ErrFreshResetAuthorisationForbidden = "FRESH_RESET_AUTHORISATION_FORBIDDEN" ErrFromMessageBotDisabled = "FROM_MESSAGE_BOT_DISABLED" ErrFromPeerInvalid = "FROM_PEER_INVALID" ErrGameBotInvalid = "GAME_BOT_INVALID" + ErrGeneralModifyIconForbidden = "GENERAL_MODIFY_ICON_FORBIDDEN" ErrGeoPointInvalid = "GEO_POINT_INVALID" + ErrGiftcodeNotAllowed = "GIFTCODE_NOT_ALLOWED" + ErrGiftSlugInvalid = "GIFT_SLUG_INVALID" ErrGifContentTypeInvalid = "GIF_CONTENT_TYPE_INVALID" ErrGifIDInvalid = "GIF_ID_INVALID" ErrGraphExpiredReload = "GRAPH_EXPIRED_RELOAD" ErrGraphInvalidReload = "GRAPH_INVALID_RELOAD" ErrGraphOutdatedReload = "GRAPH_OUTDATED_RELOAD" + ErrGroupcallAddParticipantsFailed = "GROUPCALL_ADD_PARTICIPANTS_FAILED" ErrGroupcallAlreadyDiscarded = "GROUPCALL_ALREADY_DISCARDED" ErrGroupcallAlreadyStarted = "GROUPCALL_ALREADY_STARTED" ErrGroupcallForbidden = "GROUPCALL_FORBIDDEN" @@ -240,6 +251,7 @@ const ( ErrInviteRequestSent = "INVITE_REQUEST_SENT" ErrInviteRevokedMissing = "INVITE_REVOKED_MISSING" ErrInviteSlugEmpty = "INVITE_SLUG_EMPTY" + ErrInviteSlugExpired = "INVITE_SLUG_EXPIRED" ErrInvoicePayloadInvalid = "INVOICE_PAYLOAD_INVALID" ErrJoinAsPeerInvalid = "JOIN_AS_PEER_INVALID" ErrLangCodeInvalid = "LANG_CODE_INVALID" @@ -255,15 +267,19 @@ const ( ErrMD5ChecksumInvalid = "MD5_CHECKSUM_INVALID" ErrMediaCaptionTooLong = "MEDIA_CAPTION_TOO_LONG" ErrMediaEmpty = "MEDIA_EMPTY" + ErrMediaFileInvalid = "MEDIA_FILE_INVALID" ErrMediaGroupedInvalid = "MEDIA_GROUPED_INVALID" ErrMediaInvalid = "MEDIA_INVALID" ErrMediaNewInvalid = "MEDIA_NEW_INVALID" ErrMediaPrevInvalid = "MEDIA_PREV_INVALID" ErrMediaTTLInvalid = "MEDIA_TTL_INVALID" + ErrMediaTypeInvalid = "MEDIA_TYPE_INVALID" + ErrMediaVideoStoryMissing = "MEDIA_VIDEO_STORY_MISSING" + ErrMegagroupGeoRequired = "MEGAGROUP_GEO_REQUIRED" ErrMegagroupIDInvalid = "MEGAGROUP_ID_INVALID" ErrMegagroupPrehistoryHidden = "MEGAGROUP_PREHISTORY_HIDDEN" ErrMegagroupRequired = "MEGAGROUP_REQUIRED" - ErrMemberChatAddFailed = "MEMBER_CHAT_ADD_FAILED" + ErrMemberNotFound = "MEMBER_NOT_FOUND" ErrMessageAuthorRequired = "MESSAGE_AUTHOR_REQUIRED" ErrMessageDeleteForbidden = "MESSAGE_DELETE_FORBIDDEN" ErrMessageEditTimeExpired = "MESSAGE_EDIT_TIME_EXPIRED" @@ -370,6 +386,8 @@ const ( ErrReplyMarkupBuyEmpty = "REPLY_MARKUP_BUY_EMPTY" ErrReplyMarkupInvalid = "REPLY_MARKUP_INVALID" ErrReplyMarkupTooLong = "REPLY_MARKUP_TOO_LONG" + ErrReplyToInvalid = "REPLY_TO_INVALID" + ErrReplyToUserInvalid = "REPLY_TO_USER_INVALID" ErrResetRequestMissing = "RESET_REQUEST_MISSING" ErrResultsTooMuch = "RESULTS_TOO_MUCH" ErrResultIDDuplicate = "RESULT_ID_DUPLICATE" @@ -391,6 +409,7 @@ const ( ErrSecondsInvalid = "SECONDS_INVALID" ErrSendAsPeerInvalid = "SEND_AS_PEER_INVALID" ErrSendCodeUnavailable = "SEND_CODE_UNAVAILABLE" + ErrSendMediaInvalid = "SEND_MEDIA_INVALID" ErrSendMessageMediaInvalid = "SEND_MESSAGE_MEDIA_INVALID" ErrSendMessageTypeInvalid = "SEND_MESSAGE_TYPE_INVALID" ErrSensitiveChangeForbidden = "SENSITIVE_CHANGE_FORBIDDEN" @@ -400,8 +419,10 @@ const ( ErrShortNameInvalid = "SHORT_NAME_INVALID" ErrShortNameOccupied = "SHORT_NAME_OCCUPIED" ErrSignInFailed = "SIGN_IN_FAILED" + ErrSlotsEmpty = "SLOTS_EMPTY" ErrSlowmodeMultiMsgsDisabled = "SLOWMODE_MULTI_MSGS_DISABLED" ErrSlowmodeWait = "SLOWMODE_WAIT" + ErrSlugInvalid = "SLUG_INVALID" ErrSMSCodeCreateFailed = "SMS_CODE_CREATE_FAILED" ErrSRPIDInvalid = "SRP_ID_INVALID" ErrSRPPasswordChanged = "SRP_PASSWORD_CHANGED" @@ -429,6 +450,14 @@ const ( ErrStickerVideoBig = "STICKER_VIDEO_BIG" ErrStickerVideoNodoc = "STICKER_VIDEO_NODOC" ErrStickerVideoNowebm = "STICKER_VIDEO_NOWEBM" + ErrStoriesNeverCreated = "STORIES_NEVER_CREATED" + ErrStoriesTooMuch = "STORIES_TOO_MUCH" + ErrStoryIDEmpty = "STORY_ID_EMPTY" + ErrStoryIDInvalid = "STORY_ID_INVALID" + ErrStoryNotModified = "STORY_NOT_MODIFIED" + ErrStoryPeriodInvalid = "STORY_PERIOD_INVALID" + ErrStorySendFloodMonthly = "STORY_SEND_FLOOD_MONTHLY" + ErrStorySendFloodWeekly = "STORY_SEND_FLOOD_WEEKLY" ErrSwitchPmTextEmpty = "SWITCH_PM_TEXT_EMPTY" ErrTakeoutInitDelay = "TAKEOUT_INIT_DELAY" ErrTakeoutRequired = "TAKEOUT_REQUIRED" @@ -447,9 +476,12 @@ const ( ErrTokenTypeInvalid = "TOKEN_TYPE_INVALID" ErrTopicsEmpty = "TOPICS_EMPTY" ErrTopicClosed = "TOPIC_CLOSED" + ErrTopicCloseSeparately = "TOPIC_CLOSE_SEPARATELY" ErrTopicDeleted = "TOPIC_DELETED" + ErrTopicHideSeparately = "TOPIC_HIDE_SEPARATELY" ErrTopicIDInvalid = "TOPIC_ID_INVALID" ErrTopicNotModified = "TOPIC_NOT_MODIFIED" + ErrTopicTitleEmpty = "TOPIC_TITLE_EMPTY" ErrToLangInvalid = "TO_LANG_INVALID" ErrTranscriptionFailed = "TRANSCRIPTION_FAILED" ErrTTLDaysInvalid = "TTL_DAYS_INVALID" @@ -466,7 +498,6 @@ const ( ErrUsernameNotOccupied = "USERNAME_NOT_OCCUPIED" ErrUsernameOccupied = "USERNAME_OCCUPIED" ErrUsernamePurchaseAvailable = "USERNAME_PURCHASE_AVAILABLE" - ErrUsernameUnsynchronized = "USERNAME_UNSYNCHRONIZED" ErrUserpicPrivacyRequired = "USERPIC_PRIVACY_REQUIRED" ErrUserpicUploadRequired = "USERPIC_UPLOAD_REQUIRED" ErrUsersTooFew = "USERS_TOO_FEW" @@ -490,8 +521,10 @@ const ( ErrUserNotMutualContact = "USER_NOT_MUTUAL_CONTACT" ErrUserNotParticipant = "USER_NOT_PARTICIPANT" ErrUserPrivacyRestricted = "USER_PRIVACY_RESTRICTED" + ErrUserPublicMissing = "USER_PUBLIC_MISSING" ErrUserRestricted = "USER_RESTRICTED" ErrUserVolumeInvalid = "USER_VOLUME_INVALID" + ErrVenueIDInvalid = "VENUE_ID_INVALID" ErrVideoContentTypeInvalid = "VIDEO_CONTENT_TYPE_INVALID" ErrVideoFileInvalid = "VIDEO_FILE_INVALID" ErrVideoTitleEmpty = "VIDEO_TITLE_EMPTY" @@ -499,6 +532,7 @@ const ( ErrWallpaperFileInvalid = "WALLPAPER_FILE_INVALID" ErrWallpaperInvalid = "WALLPAPER_INVALID" ErrWallpaperMimeInvalid = "WALLPAPER_MIME_INVALID" + ErrWallpaperNotFound = "WALLPAPER_NOT_FOUND" ErrWcConvertURLInvalid = "WC_CONVERT_URL_INVALID" ErrWebdocumentInvalid = "WEBDOCUMENT_INVALID" ErrWebdocumentMimeInvalid = "WEBDOCUMENT_MIME_INVALID" @@ -506,6 +540,8 @@ const ( ErrWebdocumentURLInvalid = "WEBDOCUMENT_URL_INVALID" ErrWebpageCurlFailed = "WEBPAGE_CURL_FAILED" ErrWebpageMediaEmpty = "WEBPAGE_MEDIA_EMPTY" + ErrWebpageNotFound = "WEBPAGE_NOT_FOUND" + ErrWebpageURLInvalid = "WEBPAGE_URL_INVALID" ErrWebpushAuthInvalid = "WEBPUSH_AUTH_INVALID" ErrWebpushKeyInvalid = "WEBPUSH_KEY_INVALID" ErrWebpushTokenInvalid = "WEBPUSH_TOKEN_INVALID" @@ -532,6 +568,11 @@ func IsAccessTokenInvalid(err error) bool { return tgerr.Is(err, ErrAccessTokenInvalid) } +// IsAddressInvalid reports whether err is ADDRESS_INVALID. +func IsAddressInvalid(err error) bool { + return tgerr.Is(err, ErrAddressInvalid) +} + // IsAdminsTooMuch reports whether err is ADMINS_TOO_MUCH. func IsAdminsTooMuch(err error) bool { return tgerr.Is(err, ErrAdminsTooMuch) @@ -552,11 +593,21 @@ func IsAdminRankInvalid(err error) bool { return tgerr.Is(err, ErrAdminRankInvalid) } +// IsAdminRightsEmpty reports whether err is ADMIN_RIGHTS_EMPTY. +func IsAdminRightsEmpty(err error) bool { + return tgerr.Is(err, ErrAdminRightsEmpty) +} + // IsAlbumPhotosTooMany reports whether err is ALBUM_PHOTOS_TOO_MANY. func IsAlbumPhotosTooMany(err error) bool { return tgerr.Is(err, ErrAlbumPhotosTooMany) } +// IsAnonymousReactionsDisabled reports whether err is ANONYMOUS_REACTIONS_DISABLED. +func IsAnonymousReactionsDisabled(err error) bool { + return tgerr.Is(err, ErrAnonymousReactionsDisabled) +} + // IsAPIIDInvalid reports whether err is API_ID_INVALID. func IsAPIIDInvalid(err error) bool { return tgerr.Is(err, ErrAPIIDInvalid) @@ -632,6 +683,21 @@ func IsBannedRightsInvalid(err error) bool { return tgerr.Is(err, ErrBannedRightsInvalid) } +// IsBoostsEmpty reports whether err is BOOSTS_EMPTY. +func IsBoostsEmpty(err error) bool { + return tgerr.Is(err, ErrBoostsEmpty) +} + +// IsBoostsRequired reports whether err is BOOSTS_REQUIRED. +func IsBoostsRequired(err error) bool { + return tgerr.Is(err, ErrBoostsRequired) +} + +// IsBoostPeerInvalid reports whether err is BOOST_PEER_INVALID. +func IsBoostPeerInvalid(err error) bool { + return tgerr.Is(err, ErrBoostPeerInvalid) +} + // IsBotsTooMuch reports whether err is BOTS_TOO_MUCH. func IsBotsTooMuch(err error) bool { return tgerr.Is(err, ErrBotsTooMuch) @@ -767,6 +833,11 @@ func IsCallPeerInvalid(err error) bool { return tgerr.Is(err, ErrCallPeerInvalid) } +// IsCallProtocolCompatLayerInvalid reports whether err is CALL_PROTOCOL_COMPAT_LAYER_INVALID. +func IsCallProtocolCompatLayerInvalid(err error) bool { + return tgerr.Is(err, ErrCallProtocolCompatLayerInvalid) +} + // IsCallProtocolFlagsInvalid reports whether err is CALL_PROTOCOL_FLAGS_INVALID. func IsCallProtocolFlagsInvalid(err error) bool { return tgerr.Is(err, ErrCallProtocolFlagsInvalid) @@ -802,11 +873,6 @@ func IsChannelForumMissing(err error) bool { return tgerr.Is(err, ErrChannelForumMissing) } -// IsChannelIDGenerateFailed reports whether err is CHANNEL_ID_GENERATE_FAILED. -func IsChannelIDGenerateFailed(err error) bool { - return tgerr.Is(err, ErrChannelIDGenerateFailed) -} - // IsChannelIDInvalid reports whether err is CHANNEL_ID_INVALID. func IsChannelIDInvalid(err error) bool { return tgerr.Is(err, ErrChannelIDInvalid) @@ -912,11 +978,6 @@ func IsChatLinkExists(err error) bool { return tgerr.Is(err, ErrChatLinkExists) } -// IsChatMembersChannel reports whether err is CHAT_MEMBERS_CHANNEL. -func IsChatMembersChannel(err error) bool { - return tgerr.Is(err, ErrChatMembersChannel) -} - // IsChatNotModified reports whether err is CHAT_NOT_MODIFIED. func IsChatNotModified(err error) bool { return tgerr.Is(err, ErrChatNotModified) @@ -1027,6 +1088,11 @@ func IsCodeInvalid(err error) bool { return tgerr.Is(err, ErrCodeInvalid) } +// IsColorInvalid reports whether err is COLOR_INVALID. +func IsColorInvalid(err error) bool { + return tgerr.Is(err, ErrColorInvalid) +} + // IsConnectionAPIIDInvalid reports whether err is CONNECTION_API_ID_INVALID. func IsConnectionAPIIDInvalid(err error) bool { return tgerr.Is(err, ErrConnectionAPIIDInvalid) @@ -1072,6 +1138,11 @@ func IsCurrencyTotalAmountInvalid(err error) bool { return tgerr.Is(err, ErrCurrencyTotalAmountInvalid) } +// IsCustomReactionsTooMany reports whether err is CUSTOM_REACTIONS_TOO_MANY. +func IsCustomReactionsTooMany(err error) bool { + return tgerr.Is(err, ErrCustomReactionsTooMany) +} + // IsDataInvalid reports whether err is DATA_INVALID. func IsDataInvalid(err error) bool { return tgerr.Is(err, ErrDataInvalid) @@ -1307,11 +1378,6 @@ func IsFileTokenInvalid(err error) bool { return tgerr.Is(err, ErrFileTokenInvalid) } -// IsFileWriteEmpty reports whether err is FILE_WRITE_EMPTY. -func IsFileWriteEmpty(err error) bool { - return tgerr.Is(err, ErrFileWriteEmpty) -} - // IsFilterIDInvalid reports whether err is FILTER_ID_INVALID. func IsFilterIDInvalid(err error) bool { return tgerr.Is(err, ErrFilterIDInvalid) @@ -1342,6 +1408,11 @@ func IsFolderIDInvalid(err error) bool { return tgerr.Is(err, ErrFolderIDInvalid) } +// IsForumEnabled reports whether err is FORUM_ENABLED. +func IsForumEnabled(err error) bool { + return tgerr.Is(err, ErrForumEnabled) +} + // IsFreshChangeAdminsForbidden reports whether err is FRESH_CHANGE_ADMINS_FORBIDDEN. func IsFreshChangeAdminsForbidden(err error) bool { return tgerr.Is(err, ErrFreshChangeAdminsForbidden) @@ -1372,11 +1443,26 @@ func IsGameBotInvalid(err error) bool { return tgerr.Is(err, ErrGameBotInvalid) } +// IsGeneralModifyIconForbidden reports whether err is GENERAL_MODIFY_ICON_FORBIDDEN. +func IsGeneralModifyIconForbidden(err error) bool { + return tgerr.Is(err, ErrGeneralModifyIconForbidden) +} + // IsGeoPointInvalid reports whether err is GEO_POINT_INVALID. func IsGeoPointInvalid(err error) bool { return tgerr.Is(err, ErrGeoPointInvalid) } +// IsGiftcodeNotAllowed reports whether err is GIFTCODE_NOT_ALLOWED. +func IsGiftcodeNotAllowed(err error) bool { + return tgerr.Is(err, ErrGiftcodeNotAllowed) +} + +// IsGiftSlugInvalid reports whether err is GIFT_SLUG_INVALID. +func IsGiftSlugInvalid(err error) bool { + return tgerr.Is(err, ErrGiftSlugInvalid) +} + // IsGifContentTypeInvalid reports whether err is GIF_CONTENT_TYPE_INVALID. func IsGifContentTypeInvalid(err error) bool { return tgerr.Is(err, ErrGifContentTypeInvalid) @@ -1402,6 +1488,11 @@ func IsGraphOutdatedReload(err error) bool { return tgerr.Is(err, ErrGraphOutdatedReload) } +// IsGroupcallAddParticipantsFailed reports whether err is GROUPCALL_ADD_PARTICIPANTS_FAILED. +func IsGroupcallAddParticipantsFailed(err error) bool { + return tgerr.Is(err, ErrGroupcallAddParticipantsFailed) +} + // IsGroupcallAlreadyDiscarded reports whether err is GROUPCALL_ALREADY_DISCARDED. func IsGroupcallAlreadyDiscarded(err error) bool { return tgerr.Is(err, ErrGroupcallAlreadyDiscarded) @@ -1547,6 +1638,11 @@ func IsInviteSlugEmpty(err error) bool { return tgerr.Is(err, ErrInviteSlugEmpty) } +// IsInviteSlugExpired reports whether err is INVITE_SLUG_EXPIRED. +func IsInviteSlugExpired(err error) bool { + return tgerr.Is(err, ErrInviteSlugExpired) +} + // IsInvoicePayloadInvalid reports whether err is INVOICE_PAYLOAD_INVALID. func IsInvoicePayloadInvalid(err error) bool { return tgerr.Is(err, ErrInvoicePayloadInvalid) @@ -1622,6 +1718,11 @@ func IsMediaEmpty(err error) bool { return tgerr.Is(err, ErrMediaEmpty) } +// IsMediaFileInvalid reports whether err is MEDIA_FILE_INVALID. +func IsMediaFileInvalid(err error) bool { + return tgerr.Is(err, ErrMediaFileInvalid) +} + // IsMediaGroupedInvalid reports whether err is MEDIA_GROUPED_INVALID. func IsMediaGroupedInvalid(err error) bool { return tgerr.Is(err, ErrMediaGroupedInvalid) @@ -1647,6 +1748,21 @@ func IsMediaTTLInvalid(err error) bool { return tgerr.Is(err, ErrMediaTTLInvalid) } +// IsMediaTypeInvalid reports whether err is MEDIA_TYPE_INVALID. +func IsMediaTypeInvalid(err error) bool { + return tgerr.Is(err, ErrMediaTypeInvalid) +} + +// IsMediaVideoStoryMissing reports whether err is MEDIA_VIDEO_STORY_MISSING. +func IsMediaVideoStoryMissing(err error) bool { + return tgerr.Is(err, ErrMediaVideoStoryMissing) +} + +// IsMegagroupGeoRequired reports whether err is MEGAGROUP_GEO_REQUIRED. +func IsMegagroupGeoRequired(err error) bool { + return tgerr.Is(err, ErrMegagroupGeoRequired) +} + // IsMegagroupIDInvalid reports whether err is MEGAGROUP_ID_INVALID. func IsMegagroupIDInvalid(err error) bool { return tgerr.Is(err, ErrMegagroupIDInvalid) @@ -1662,9 +1778,9 @@ func IsMegagroupRequired(err error) bool { return tgerr.Is(err, ErrMegagroupRequired) } -// IsMemberChatAddFailed reports whether err is MEMBER_CHAT_ADD_FAILED. -func IsMemberChatAddFailed(err error) bool { - return tgerr.Is(err, ErrMemberChatAddFailed) +// IsMemberNotFound reports whether err is MEMBER_NOT_FOUND. +func IsMemberNotFound(err error) bool { + return tgerr.Is(err, ErrMemberNotFound) } // IsMessageAuthorRequired reports whether err is MESSAGE_AUTHOR_REQUIRED. @@ -2197,6 +2313,16 @@ func IsReplyMarkupTooLong(err error) bool { return tgerr.Is(err, ErrReplyMarkupTooLong) } +// IsReplyToInvalid reports whether err is REPLY_TO_INVALID. +func IsReplyToInvalid(err error) bool { + return tgerr.Is(err, ErrReplyToInvalid) +} + +// IsReplyToUserInvalid reports whether err is REPLY_TO_USER_INVALID. +func IsReplyToUserInvalid(err error) bool { + return tgerr.Is(err, ErrReplyToUserInvalid) +} + // IsResetRequestMissing reports whether err is RESET_REQUEST_MISSING. func IsResetRequestMissing(err error) bool { return tgerr.Is(err, ErrResetRequestMissing) @@ -2302,6 +2428,11 @@ func IsSendCodeUnavailable(err error) bool { return tgerr.Is(err, ErrSendCodeUnavailable) } +// IsSendMediaInvalid reports whether err is SEND_MEDIA_INVALID. +func IsSendMediaInvalid(err error) bool { + return tgerr.Is(err, ErrSendMediaInvalid) +} + // IsSendMessageMediaInvalid reports whether err is SEND_MESSAGE_MEDIA_INVALID. func IsSendMessageMediaInvalid(err error) bool { return tgerr.Is(err, ErrSendMessageMediaInvalid) @@ -2347,6 +2478,11 @@ func IsSignInFailed(err error) bool { return tgerr.Is(err, ErrSignInFailed) } +// IsSlotsEmpty reports whether err is SLOTS_EMPTY. +func IsSlotsEmpty(err error) bool { + return tgerr.Is(err, ErrSlotsEmpty) +} + // IsSlowmodeMultiMsgsDisabled reports whether err is SLOWMODE_MULTI_MSGS_DISABLED. func IsSlowmodeMultiMsgsDisabled(err error) bool { return tgerr.Is(err, ErrSlowmodeMultiMsgsDisabled) @@ -2357,6 +2493,11 @@ func IsSlowmodeWait(err error) bool { return tgerr.Is(err, ErrSlowmodeWait) } +// IsSlugInvalid reports whether err is SLUG_INVALID. +func IsSlugInvalid(err error) bool { + return tgerr.Is(err, ErrSlugInvalid) +} + // IsSMSCodeCreateFailed reports whether err is SMS_CODE_CREATE_FAILED. func IsSMSCodeCreateFailed(err error) bool { return tgerr.Is(err, ErrSMSCodeCreateFailed) @@ -2492,6 +2633,46 @@ func IsStickerVideoNowebm(err error) bool { return tgerr.Is(err, ErrStickerVideoNowebm) } +// IsStoriesNeverCreated reports whether err is STORIES_NEVER_CREATED. +func IsStoriesNeverCreated(err error) bool { + return tgerr.Is(err, ErrStoriesNeverCreated) +} + +// IsStoriesTooMuch reports whether err is STORIES_TOO_MUCH. +func IsStoriesTooMuch(err error) bool { + return tgerr.Is(err, ErrStoriesTooMuch) +} + +// IsStoryIDEmpty reports whether err is STORY_ID_EMPTY. +func IsStoryIDEmpty(err error) bool { + return tgerr.Is(err, ErrStoryIDEmpty) +} + +// IsStoryIDInvalid reports whether err is STORY_ID_INVALID. +func IsStoryIDInvalid(err error) bool { + return tgerr.Is(err, ErrStoryIDInvalid) +} + +// IsStoryNotModified reports whether err is STORY_NOT_MODIFIED. +func IsStoryNotModified(err error) bool { + return tgerr.Is(err, ErrStoryNotModified) +} + +// IsStoryPeriodInvalid reports whether err is STORY_PERIOD_INVALID. +func IsStoryPeriodInvalid(err error) bool { + return tgerr.Is(err, ErrStoryPeriodInvalid) +} + +// IsStorySendFloodMonthly reports whether err is STORY_SEND_FLOOD_MONTHLY. +func IsStorySendFloodMonthly(err error) bool { + return tgerr.Is(err, ErrStorySendFloodMonthly) +} + +// IsStorySendFloodWeekly reports whether err is STORY_SEND_FLOOD_WEEKLY. +func IsStorySendFloodWeekly(err error) bool { + return tgerr.Is(err, ErrStorySendFloodWeekly) +} + // IsSwitchPmTextEmpty reports whether err is SWITCH_PM_TEXT_EMPTY. func IsSwitchPmTextEmpty(err error) bool { return tgerr.Is(err, ErrSwitchPmTextEmpty) @@ -2582,11 +2763,21 @@ func IsTopicClosed(err error) bool { return tgerr.Is(err, ErrTopicClosed) } +// IsTopicCloseSeparately reports whether err is TOPIC_CLOSE_SEPARATELY. +func IsTopicCloseSeparately(err error) bool { + return tgerr.Is(err, ErrTopicCloseSeparately) +} + // IsTopicDeleted reports whether err is TOPIC_DELETED. func IsTopicDeleted(err error) bool { return tgerr.Is(err, ErrTopicDeleted) } +// IsTopicHideSeparately reports whether err is TOPIC_HIDE_SEPARATELY. +func IsTopicHideSeparately(err error) bool { + return tgerr.Is(err, ErrTopicHideSeparately) +} + // IsTopicIDInvalid reports whether err is TOPIC_ID_INVALID. func IsTopicIDInvalid(err error) bool { return tgerr.Is(err, ErrTopicIDInvalid) @@ -2597,6 +2788,11 @@ func IsTopicNotModified(err error) bool { return tgerr.Is(err, ErrTopicNotModified) } +// IsTopicTitleEmpty reports whether err is TOPIC_TITLE_EMPTY. +func IsTopicTitleEmpty(err error) bool { + return tgerr.Is(err, ErrTopicTitleEmpty) +} + // IsToLangInvalid reports whether err is TO_LANG_INVALID. func IsToLangInvalid(err error) bool { return tgerr.Is(err, ErrToLangInvalid) @@ -2677,11 +2873,6 @@ func IsUsernamePurchaseAvailable(err error) bool { return tgerr.Is(err, ErrUsernamePurchaseAvailable) } -// IsUsernameUnsynchronized reports whether err is USERNAME_UNSYNCHRONIZED. -func IsUsernameUnsynchronized(err error) bool { - return tgerr.Is(err, ErrUsernameUnsynchronized) -} - // IsUserpicPrivacyRequired reports whether err is USERPIC_PRIVACY_REQUIRED. func IsUserpicPrivacyRequired(err error) bool { return tgerr.Is(err, ErrUserpicPrivacyRequired) @@ -2797,6 +2988,11 @@ func IsUserPrivacyRestricted(err error) bool { return tgerr.Is(err, ErrUserPrivacyRestricted) } +// IsUserPublicMissing reports whether err is USER_PUBLIC_MISSING. +func IsUserPublicMissing(err error) bool { + return tgerr.Is(err, ErrUserPublicMissing) +} + // IsUserRestricted reports whether err is USER_RESTRICTED. func IsUserRestricted(err error) bool { return tgerr.Is(err, ErrUserRestricted) @@ -2807,6 +3003,11 @@ func IsUserVolumeInvalid(err error) bool { return tgerr.Is(err, ErrUserVolumeInvalid) } +// IsVenueIDInvalid reports whether err is VENUE_ID_INVALID. +func IsVenueIDInvalid(err error) bool { + return tgerr.Is(err, ErrVenueIDInvalid) +} + // IsVideoContentTypeInvalid reports whether err is VIDEO_CONTENT_TYPE_INVALID. func IsVideoContentTypeInvalid(err error) bool { return tgerr.Is(err, ErrVideoContentTypeInvalid) @@ -2842,6 +3043,11 @@ func IsWallpaperMimeInvalid(err error) bool { return tgerr.Is(err, ErrWallpaperMimeInvalid) } +// IsWallpaperNotFound reports whether err is WALLPAPER_NOT_FOUND. +func IsWallpaperNotFound(err error) bool { + return tgerr.Is(err, ErrWallpaperNotFound) +} + // IsWcConvertURLInvalid reports whether err is WC_CONVERT_URL_INVALID. func IsWcConvertURLInvalid(err error) bool { return tgerr.Is(err, ErrWcConvertURLInvalid) @@ -2877,6 +3083,16 @@ func IsWebpageMediaEmpty(err error) bool { return tgerr.Is(err, ErrWebpageMediaEmpty) } +// IsWebpageNotFound reports whether err is WEBPAGE_NOT_FOUND. +func IsWebpageNotFound(err error) bool { + return tgerr.Is(err, ErrWebpageNotFound) +} + +// IsWebpageURLInvalid reports whether err is WEBPAGE_URL_INVALID. +func IsWebpageURLInvalid(err error) bool { + return tgerr.Is(err, ErrWebpageURLInvalid) +} + // IsWebpushAuthInvalid reports whether err is WEBPUSH_AUTH_INVALID. func IsWebpushAuthInvalid(err error) bool { return tgerr.Is(err, ErrWebpushAuthInvalid) diff --git a/vendor/github.com/gotd/td/tg/tl_exported_contact_token_gen.go b/vendor/github.com/gotd/td/tg/tl_exported_contact_token_gen.go index 17907326..0730eaaf 100644 --- a/vendor/github.com/gotd/td/tg/tl_exported_contact_token_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_exported_contact_token_gen.go @@ -44,7 +44,7 @@ type ExportedContactToken struct { // Links: // 1) https://core.telegram.org/api/links#temporary-profile-links URL string - // Its expiry date + // Its expiration date Expires int } diff --git a/vendor/github.com/gotd/td/tg/tl_exported_story_link_gen.go b/vendor/github.com/gotd/td/tg/tl_exported_story_link_gen.go index 670f573a..8f6fa975 100644 --- a/vendor/github.com/gotd/td/tg/tl_exported_story_link_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_exported_story_link_gen.go @@ -32,10 +32,17 @@ var ( ) // ExportedStoryLink represents TL type `exportedStoryLink#3fc9053b`. +// Represents a story deep link¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#story-links // // See https://core.telegram.org/constructor/exportedStoryLink for reference. type ExportedStoryLink struct { - // Link field of ExportedStoryLink. + // The story deep link¹. + // + // Links: + // 1) https://core.telegram.org/api/stories#story-links Link string } diff --git a/vendor/github.com/gotd/td/tg/tl_global_privacy_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_global_privacy_settings_gen.go index 55872c8a..9ee7d716 100644 --- a/vendor/github.com/gotd/td/tg/tl_global_privacy_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_global_privacy_settings_gen.go @@ -43,9 +43,15 @@ type GlobalPrivacySettings struct { Flags bin.Fields // Whether to archive and mute new chats from non-contacts ArchiveAndMuteNewNoncontactPeers bool - // KeepArchivedUnmuted field of GlobalPrivacySettings. + // Whether unmuted chats will be kept in the Archive chat list when they get a new + // message. KeepArchivedUnmuted bool - // KeepArchivedFolders field of GlobalPrivacySettings. + // Whether unmuted chats that are always included or pinned in a folder¹, will be kept + // in the Archive chat list when they get a new message. Ignored if keep_archived_unmuted + // is set. + // + // Links: + // 1) https://core.telegram.org/api/folders KeepArchivedFolders bool } diff --git a/vendor/github.com/gotd/td/tg/tl_handlers_gen.go b/vendor/github.com/gotd/td/tg/tl_handlers_gen.go index 20f2f80d..fd1d08ed 100644 --- a/vendor/github.com/gotd/td/tg/tl_handlers_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_handlers_gen.go @@ -1275,3 +1275,53 @@ func (u UpdateDispatcher) OnSentStoryReaction(handler SentStoryReactionHandler) return handler(ctx, e, update.(*UpdateSentStoryReaction)) } } + +// BotChatBoostHandler is a BotChatBoost event handler. +type BotChatBoostHandler func(ctx context.Context, e Entities, update *UpdateBotChatBoost) error + +// OnBotChatBoost sets BotChatBoost handler. +func (u UpdateDispatcher) OnBotChatBoost(handler BotChatBoostHandler) { + u.handlers[UpdateBotChatBoostTypeID] = func(ctx context.Context, e Entities, update UpdateClass) error { + return handler(ctx, e, update.(*UpdateBotChatBoost)) + } +} + +// ChannelViewForumAsMessagesHandler is a ChannelViewForumAsMessages event handler. +type ChannelViewForumAsMessagesHandler func(ctx context.Context, e Entities, update *UpdateChannelViewForumAsMessages) error + +// OnChannelViewForumAsMessages sets ChannelViewForumAsMessages handler. +func (u UpdateDispatcher) OnChannelViewForumAsMessages(handler ChannelViewForumAsMessagesHandler) { + u.handlers[UpdateChannelViewForumAsMessagesTypeID] = func(ctx context.Context, e Entities, update UpdateClass) error { + return handler(ctx, e, update.(*UpdateChannelViewForumAsMessages)) + } +} + +// PeerWallpaperHandler is a PeerWallpaper event handler. +type PeerWallpaperHandler func(ctx context.Context, e Entities, update *UpdatePeerWallpaper) error + +// OnPeerWallpaper sets PeerWallpaper handler. +func (u UpdateDispatcher) OnPeerWallpaper(handler PeerWallpaperHandler) { + u.handlers[UpdatePeerWallpaperTypeID] = func(ctx context.Context, e Entities, update UpdateClass) error { + return handler(ctx, e, update.(*UpdatePeerWallpaper)) + } +} + +// BotMessageReactionHandler is a BotMessageReaction event handler. +type BotMessageReactionHandler func(ctx context.Context, e Entities, update *UpdateBotMessageReaction) error + +// OnBotMessageReaction sets BotMessageReaction handler. +func (u UpdateDispatcher) OnBotMessageReaction(handler BotMessageReactionHandler) { + u.handlers[UpdateBotMessageReactionTypeID] = func(ctx context.Context, e Entities, update UpdateClass) error { + return handler(ctx, e, update.(*UpdateBotMessageReaction)) + } +} + +// BotMessageReactionsHandler is a BotMessageReactions event handler. +type BotMessageReactionsHandler func(ctx context.Context, e Entities, update *UpdateBotMessageReactions) error + +// OnBotMessageReactions sets BotMessageReactions handler. +func (u UpdateDispatcher) OnBotMessageReactions(handler BotMessageReactionsHandler) { + u.handlers[UpdateBotMessageReactionsTypeID] = func(ctx context.Context, e Entities, update UpdateClass) error { + return handler(ctx, e, update.(*UpdateBotMessageReactions)) + } +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_get_app_changelog_gen.go b/vendor/github.com/gotd/td/tg/tl_help_get_app_changelog_gen.go deleted file mode 100644 index 859b5d66..00000000 --- a/vendor/github.com/gotd/td/tg/tl_help_get_app_changelog_gen.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tg - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// HelpGetAppChangelogRequest represents TL type `help.getAppChangelog#9010ef6f`. -// Get changelog of current app. -// Typically, an updates¹ constructor will be returned, containing one or more -// updateServiceNotification² updates with app-specific changelogs. -// -// Links: -// 1. https://core.telegram.org/constructor/updates -// 2. https://core.telegram.org/constructor/updateServiceNotification -// -// See https://core.telegram.org/method/help.getAppChangelog for reference. -type HelpGetAppChangelogRequest struct { - // Previous app version - PrevAppVersion string -} - -// HelpGetAppChangelogRequestTypeID is TL type id of HelpGetAppChangelogRequest. -const HelpGetAppChangelogRequestTypeID = 0x9010ef6f - -// Ensuring interfaces in compile-time for HelpGetAppChangelogRequest. -var ( - _ bin.Encoder = &HelpGetAppChangelogRequest{} - _ bin.Decoder = &HelpGetAppChangelogRequest{} - _ bin.BareEncoder = &HelpGetAppChangelogRequest{} - _ bin.BareDecoder = &HelpGetAppChangelogRequest{} -) - -func (g *HelpGetAppChangelogRequest) Zero() bool { - if g == nil { - return true - } - if !(g.PrevAppVersion == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (g *HelpGetAppChangelogRequest) String() string { - if g == nil { - return "HelpGetAppChangelogRequest(nil)" - } - type Alias HelpGetAppChangelogRequest - return fmt.Sprintf("HelpGetAppChangelogRequest%+v", Alias(*g)) -} - -// FillFrom fills HelpGetAppChangelogRequest from given interface. -func (g *HelpGetAppChangelogRequest) FillFrom(from interface { - GetPrevAppVersion() (value string) -}) { - g.PrevAppVersion = from.GetPrevAppVersion() -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*HelpGetAppChangelogRequest) TypeID() uint32 { - return HelpGetAppChangelogRequestTypeID -} - -// TypeName returns name of type in TL schema. -func (*HelpGetAppChangelogRequest) TypeName() string { - return "help.getAppChangelog" -} - -// TypeInfo returns info about TL type. -func (g *HelpGetAppChangelogRequest) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "help.getAppChangelog", - ID: HelpGetAppChangelogRequestTypeID, - } - if g == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "PrevAppVersion", - SchemaName: "prev_app_version", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (g *HelpGetAppChangelogRequest) Encode(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't encode help.getAppChangelog#9010ef6f as nil") - } - b.PutID(HelpGetAppChangelogRequestTypeID) - return g.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (g *HelpGetAppChangelogRequest) EncodeBare(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't encode help.getAppChangelog#9010ef6f as nil") - } - b.PutString(g.PrevAppVersion) - return nil -} - -// Decode implements bin.Decoder. -func (g *HelpGetAppChangelogRequest) Decode(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't decode help.getAppChangelog#9010ef6f to nil") - } - if err := b.ConsumeID(HelpGetAppChangelogRequestTypeID); err != nil { - return fmt.Errorf("unable to decode help.getAppChangelog#9010ef6f: %w", err) - } - return g.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (g *HelpGetAppChangelogRequest) DecodeBare(b *bin.Buffer) error { - if g == nil { - return fmt.Errorf("can't decode help.getAppChangelog#9010ef6f to nil") - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode help.getAppChangelog#9010ef6f: field prev_app_version: %w", err) - } - g.PrevAppVersion = value - } - return nil -} - -// GetPrevAppVersion returns value of PrevAppVersion field. -func (g *HelpGetAppChangelogRequest) GetPrevAppVersion() (value string) { - if g == nil { - return - } - return g.PrevAppVersion -} - -// HelpGetAppChangelog invokes method help.getAppChangelog#9010ef6f returning error if any. -// Get changelog of current app. -// Typically, an updates¹ constructor will be returned, containing one or more -// updateServiceNotification² updates with app-specific changelogs. -// -// Links: -// 1. https://core.telegram.org/constructor/updates -// 2. https://core.telegram.org/constructor/updateServiceNotification -// -// See https://core.telegram.org/method/help.getAppChangelog for reference. -func (c *Client) HelpGetAppChangelog(ctx context.Context, prevappversion string) (UpdatesClass, error) { - var result UpdatesBox - - request := &HelpGetAppChangelogRequest{ - PrevAppVersion: prevappversion, - } - if err := c.rpc.Invoke(ctx, request, &result); err != nil { - return nil, err - } - return result.Updates, nil -} diff --git a/vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_gen.go b/vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_gen.go new file mode 100644 index 00000000..d7138309 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_gen.go @@ -0,0 +1,187 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// HelpGetPeerColorsRequest represents TL type `help.getPeerColors#da80f42f`. +// Get the set of accent color palettes »¹ that can be used for message accents. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/method/help.getPeerColors for reference. +type HelpGetPeerColorsRequest struct { + // Hash for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation + Hash int +} + +// HelpGetPeerColorsRequestTypeID is TL type id of HelpGetPeerColorsRequest. +const HelpGetPeerColorsRequestTypeID = 0xda80f42f + +// Ensuring interfaces in compile-time for HelpGetPeerColorsRequest. +var ( + _ bin.Encoder = &HelpGetPeerColorsRequest{} + _ bin.Decoder = &HelpGetPeerColorsRequest{} + _ bin.BareEncoder = &HelpGetPeerColorsRequest{} + _ bin.BareDecoder = &HelpGetPeerColorsRequest{} +) + +func (g *HelpGetPeerColorsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Hash == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *HelpGetPeerColorsRequest) String() string { + if g == nil { + return "HelpGetPeerColorsRequest(nil)" + } + type Alias HelpGetPeerColorsRequest + return fmt.Sprintf("HelpGetPeerColorsRequest%+v", Alias(*g)) +} + +// FillFrom fills HelpGetPeerColorsRequest from given interface. +func (g *HelpGetPeerColorsRequest) FillFrom(from interface { + GetHash() (value int) +}) { + g.Hash = from.GetHash() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*HelpGetPeerColorsRequest) TypeID() uint32 { + return HelpGetPeerColorsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*HelpGetPeerColorsRequest) TypeName() string { + return "help.getPeerColors" +} + +// TypeInfo returns info about TL type. +func (g *HelpGetPeerColorsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "help.getPeerColors", + ID: HelpGetPeerColorsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Hash", + SchemaName: "hash", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *HelpGetPeerColorsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode help.getPeerColors#da80f42f as nil") + } + b.PutID(HelpGetPeerColorsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *HelpGetPeerColorsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode help.getPeerColors#da80f42f as nil") + } + b.PutInt(g.Hash) + return nil +} + +// Decode implements bin.Decoder. +func (g *HelpGetPeerColorsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode help.getPeerColors#da80f42f to nil") + } + if err := b.ConsumeID(HelpGetPeerColorsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode help.getPeerColors#da80f42f: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *HelpGetPeerColorsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode help.getPeerColors#da80f42f to nil") + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.getPeerColors#da80f42f: field hash: %w", err) + } + g.Hash = value + } + return nil +} + +// GetHash returns value of Hash field. +func (g *HelpGetPeerColorsRequest) GetHash() (value int) { + if g == nil { + return + } + return g.Hash +} + +// HelpGetPeerColors invokes method help.getPeerColors#da80f42f returning error if any. +// Get the set of accent color palettes »¹ that can be used for message accents. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/method/help.getPeerColors for reference. +func (c *Client) HelpGetPeerColors(ctx context.Context, hash int) (HelpPeerColorsClass, error) { + var result HelpPeerColorsBox + + request := &HelpGetPeerColorsRequest{ + Hash: hash, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.PeerColors, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_get_peer_colors_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_gen.go b/vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_gen.go new file mode 100644 index 00000000..13ea44dc --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_gen.go @@ -0,0 +1,187 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// HelpGetPeerProfileColorsRequest represents TL type `help.getPeerProfileColors#abcfa9fd`. +// Get the set of accent color palettes »¹ that can be used in profile page backgrounds. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/method/help.getPeerProfileColors for reference. +type HelpGetPeerProfileColorsRequest struct { + // Hash for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation + Hash int +} + +// HelpGetPeerProfileColorsRequestTypeID is TL type id of HelpGetPeerProfileColorsRequest. +const HelpGetPeerProfileColorsRequestTypeID = 0xabcfa9fd + +// Ensuring interfaces in compile-time for HelpGetPeerProfileColorsRequest. +var ( + _ bin.Encoder = &HelpGetPeerProfileColorsRequest{} + _ bin.Decoder = &HelpGetPeerProfileColorsRequest{} + _ bin.BareEncoder = &HelpGetPeerProfileColorsRequest{} + _ bin.BareDecoder = &HelpGetPeerProfileColorsRequest{} +) + +func (g *HelpGetPeerProfileColorsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Hash == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *HelpGetPeerProfileColorsRequest) String() string { + if g == nil { + return "HelpGetPeerProfileColorsRequest(nil)" + } + type Alias HelpGetPeerProfileColorsRequest + return fmt.Sprintf("HelpGetPeerProfileColorsRequest%+v", Alias(*g)) +} + +// FillFrom fills HelpGetPeerProfileColorsRequest from given interface. +func (g *HelpGetPeerProfileColorsRequest) FillFrom(from interface { + GetHash() (value int) +}) { + g.Hash = from.GetHash() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*HelpGetPeerProfileColorsRequest) TypeID() uint32 { + return HelpGetPeerProfileColorsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*HelpGetPeerProfileColorsRequest) TypeName() string { + return "help.getPeerProfileColors" +} + +// TypeInfo returns info about TL type. +func (g *HelpGetPeerProfileColorsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "help.getPeerProfileColors", + ID: HelpGetPeerProfileColorsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Hash", + SchemaName: "hash", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *HelpGetPeerProfileColorsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode help.getPeerProfileColors#abcfa9fd as nil") + } + b.PutID(HelpGetPeerProfileColorsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *HelpGetPeerProfileColorsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode help.getPeerProfileColors#abcfa9fd as nil") + } + b.PutInt(g.Hash) + return nil +} + +// Decode implements bin.Decoder. +func (g *HelpGetPeerProfileColorsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode help.getPeerProfileColors#abcfa9fd to nil") + } + if err := b.ConsumeID(HelpGetPeerProfileColorsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode help.getPeerProfileColors#abcfa9fd: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *HelpGetPeerProfileColorsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode help.getPeerProfileColors#abcfa9fd to nil") + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.getPeerProfileColors#abcfa9fd: field hash: %w", err) + } + g.Hash = value + } + return nil +} + +// GetHash returns value of Hash field. +func (g *HelpGetPeerProfileColorsRequest) GetHash() (value int) { + if g == nil { + return + } + return g.Hash +} + +// HelpGetPeerProfileColors invokes method help.getPeerProfileColors#abcfa9fd returning error if any. +// Get the set of accent color palettes »¹ that can be used in profile page backgrounds. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/method/help.getPeerProfileColors for reference. +func (c *Client) HelpGetPeerProfileColors(ctx context.Context, hash int) (HelpPeerColorsClass, error) { + var result HelpPeerColorsBox + + request := &HelpGetPeerProfileColorsRequest{ + Hash: hash, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.PeerColors, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_get_peer_profile_colors_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_help_peer_color_option_gen.go b/vendor/github.com/gotd/td/tg/tl_help_peer_color_option_gen.go new file mode 100644 index 00000000..df1e72cc --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_peer_color_option_gen.go @@ -0,0 +1,379 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// HelpPeerColorOption represents TL type `help.peerColorOption#ef8430ab`. +// Contains info about a color palette »¹. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/constructor/help.peerColorOption for reference. +type HelpPeerColorOption struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // Whether this palette should not be displayed as an option to the user when choosing a + // palette to apply to profile pages or message accents. + Hidden bool + // Palette ID. + ColorID int + // Light mode palette. Will be empty for IDs 0 to 6 inclusive, in which case a palette + // containing a single color from the following colors should be used: red, orange, + // violet, green, cyan, blue, pink for indexes 0 to 6. + // + // Use SetColors and GetColors helpers. + Colors HelpPeerColorSetClass + // Dark mode palette. Optional, defaults to the palette in colors (or the autogenerated + // palette for IDs 0 to 6) if absent. + // + // Use SetDarkColors and GetDarkColors helpers. + DarkColors HelpPeerColorSetClass + // ChannelMinLevel field of HelpPeerColorOption. + // + // Use SetChannelMinLevel and GetChannelMinLevel helpers. + ChannelMinLevel int +} + +// HelpPeerColorOptionTypeID is TL type id of HelpPeerColorOption. +const HelpPeerColorOptionTypeID = 0xef8430ab + +// Ensuring interfaces in compile-time for HelpPeerColorOption. +var ( + _ bin.Encoder = &HelpPeerColorOption{} + _ bin.Decoder = &HelpPeerColorOption{} + _ bin.BareEncoder = &HelpPeerColorOption{} + _ bin.BareDecoder = &HelpPeerColorOption{} +) + +func (p *HelpPeerColorOption) Zero() bool { + if p == nil { + return true + } + if !(p.Flags.Zero()) { + return false + } + if !(p.Hidden == false) { + return false + } + if !(p.ColorID == 0) { + return false + } + if !(p.Colors == nil) { + return false + } + if !(p.DarkColors == nil) { + return false + } + if !(p.ChannelMinLevel == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *HelpPeerColorOption) String() string { + if p == nil { + return "HelpPeerColorOption(nil)" + } + type Alias HelpPeerColorOption + return fmt.Sprintf("HelpPeerColorOption%+v", Alias(*p)) +} + +// FillFrom fills HelpPeerColorOption from given interface. +func (p *HelpPeerColorOption) FillFrom(from interface { + GetHidden() (value bool) + GetColorID() (value int) + GetColors() (value HelpPeerColorSetClass, ok bool) + GetDarkColors() (value HelpPeerColorSetClass, ok bool) + GetChannelMinLevel() (value int, ok bool) +}) { + p.Hidden = from.GetHidden() + p.ColorID = from.GetColorID() + if val, ok := from.GetColors(); ok { + p.Colors = val + } + + if val, ok := from.GetDarkColors(); ok { + p.DarkColors = val + } + + if val, ok := from.GetChannelMinLevel(); ok { + p.ChannelMinLevel = val + } + +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*HelpPeerColorOption) TypeID() uint32 { + return HelpPeerColorOptionTypeID +} + +// TypeName returns name of type in TL schema. +func (*HelpPeerColorOption) TypeName() string { + return "help.peerColorOption" +} + +// TypeInfo returns info about TL type. +func (p *HelpPeerColorOption) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "help.peerColorOption", + ID: HelpPeerColorOptionTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Hidden", + SchemaName: "hidden", + Null: !p.Flags.Has(0), + }, + { + Name: "ColorID", + SchemaName: "color_id", + }, + { + Name: "Colors", + SchemaName: "colors", + Null: !p.Flags.Has(1), + }, + { + Name: "DarkColors", + SchemaName: "dark_colors", + Null: !p.Flags.Has(2), + }, + { + Name: "ChannelMinLevel", + SchemaName: "channel_min_level", + Null: !p.Flags.Has(3), + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (p *HelpPeerColorOption) SetFlags() { + if !(p.Hidden == false) { + p.Flags.Set(0) + } + if !(p.Colors == nil) { + p.Flags.Set(1) + } + if !(p.DarkColors == nil) { + p.Flags.Set(2) + } + if !(p.ChannelMinLevel == 0) { + p.Flags.Set(3) + } +} + +// Encode implements bin.Encoder. +func (p *HelpPeerColorOption) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorOption#ef8430ab as nil") + } + b.PutID(HelpPeerColorOptionTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *HelpPeerColorOption) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorOption#ef8430ab as nil") + } + p.SetFlags() + if err := p.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode help.peerColorOption#ef8430ab: field flags: %w", err) + } + b.PutInt(p.ColorID) + if p.Flags.Has(1) { + if p.Colors == nil { + return fmt.Errorf("unable to encode help.peerColorOption#ef8430ab: field colors is nil") + } + if err := p.Colors.Encode(b); err != nil { + return fmt.Errorf("unable to encode help.peerColorOption#ef8430ab: field colors: %w", err) + } + } + if p.Flags.Has(2) { + if p.DarkColors == nil { + return fmt.Errorf("unable to encode help.peerColorOption#ef8430ab: field dark_colors is nil") + } + if err := p.DarkColors.Encode(b); err != nil { + return fmt.Errorf("unable to encode help.peerColorOption#ef8430ab: field dark_colors: %w", err) + } + } + if p.Flags.Has(3) { + b.PutInt(p.ChannelMinLevel) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *HelpPeerColorOption) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorOption#ef8430ab to nil") + } + if err := b.ConsumeID(HelpPeerColorOptionTypeID); err != nil { + return fmt.Errorf("unable to decode help.peerColorOption#ef8430ab: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *HelpPeerColorOption) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorOption#ef8430ab to nil") + } + { + if err := p.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode help.peerColorOption#ef8430ab: field flags: %w", err) + } + } + p.Hidden = p.Flags.Has(0) + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorOption#ef8430ab: field color_id: %w", err) + } + p.ColorID = value + } + if p.Flags.Has(1) { + value, err := DecodeHelpPeerColorSet(b) + if err != nil { + return fmt.Errorf("unable to decode help.peerColorOption#ef8430ab: field colors: %w", err) + } + p.Colors = value + } + if p.Flags.Has(2) { + value, err := DecodeHelpPeerColorSet(b) + if err != nil { + return fmt.Errorf("unable to decode help.peerColorOption#ef8430ab: field dark_colors: %w", err) + } + p.DarkColors = value + } + if p.Flags.Has(3) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorOption#ef8430ab: field channel_min_level: %w", err) + } + p.ChannelMinLevel = value + } + return nil +} + +// SetHidden sets value of Hidden conditional field. +func (p *HelpPeerColorOption) SetHidden(value bool) { + if value { + p.Flags.Set(0) + p.Hidden = true + } else { + p.Flags.Unset(0) + p.Hidden = false + } +} + +// GetHidden returns value of Hidden conditional field. +func (p *HelpPeerColorOption) GetHidden() (value bool) { + if p == nil { + return + } + return p.Flags.Has(0) +} + +// GetColorID returns value of ColorID field. +func (p *HelpPeerColorOption) GetColorID() (value int) { + if p == nil { + return + } + return p.ColorID +} + +// SetColors sets value of Colors conditional field. +func (p *HelpPeerColorOption) SetColors(value HelpPeerColorSetClass) { + p.Flags.Set(1) + p.Colors = value +} + +// GetColors returns value of Colors conditional field and +// boolean which is true if field was set. +func (p *HelpPeerColorOption) GetColors() (value HelpPeerColorSetClass, ok bool) { + if p == nil { + return + } + if !p.Flags.Has(1) { + return value, false + } + return p.Colors, true +} + +// SetDarkColors sets value of DarkColors conditional field. +func (p *HelpPeerColorOption) SetDarkColors(value HelpPeerColorSetClass) { + p.Flags.Set(2) + p.DarkColors = value +} + +// GetDarkColors returns value of DarkColors conditional field and +// boolean which is true if field was set. +func (p *HelpPeerColorOption) GetDarkColors() (value HelpPeerColorSetClass, ok bool) { + if p == nil { + return + } + if !p.Flags.Has(2) { + return value, false + } + return p.DarkColors, true +} + +// SetChannelMinLevel sets value of ChannelMinLevel conditional field. +func (p *HelpPeerColorOption) SetChannelMinLevel(value int) { + p.Flags.Set(3) + p.ChannelMinLevel = value +} + +// GetChannelMinLevel returns value of ChannelMinLevel conditional field and +// boolean which is true if field was set. +func (p *HelpPeerColorOption) GetChannelMinLevel() (value int, ok bool) { + if p == nil { + return + } + if !p.Flags.Has(3) { + return value, false + } + return p.ChannelMinLevel, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_peer_color_option_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_help_peer_color_option_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_peer_color_option_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_help_peer_color_set_gen.go b/vendor/github.com/gotd/td/tg/tl_help_peer_color_set_gen.go new file mode 100644 index 00000000..86f2a1d3 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_peer_color_set_gen.go @@ -0,0 +1,506 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// HelpPeerColorSet represents TL type `help.peerColorSet#26219a58`. +// Represents a color palette that can be used in message accents »¹. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/constructor/help.peerColorSet for reference. +type HelpPeerColorSet struct { + // A list of 1-3 colors in RGB format, describing the accent color. + Colors []int +} + +// HelpPeerColorSetTypeID is TL type id of HelpPeerColorSet. +const HelpPeerColorSetTypeID = 0x26219a58 + +// construct implements constructor of HelpPeerColorSetClass. +func (p HelpPeerColorSet) construct() HelpPeerColorSetClass { return &p } + +// Ensuring interfaces in compile-time for HelpPeerColorSet. +var ( + _ bin.Encoder = &HelpPeerColorSet{} + _ bin.Decoder = &HelpPeerColorSet{} + _ bin.BareEncoder = &HelpPeerColorSet{} + _ bin.BareDecoder = &HelpPeerColorSet{} + + _ HelpPeerColorSetClass = &HelpPeerColorSet{} +) + +func (p *HelpPeerColorSet) Zero() bool { + if p == nil { + return true + } + if !(p.Colors == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *HelpPeerColorSet) String() string { + if p == nil { + return "HelpPeerColorSet(nil)" + } + type Alias HelpPeerColorSet + return fmt.Sprintf("HelpPeerColorSet%+v", Alias(*p)) +} + +// FillFrom fills HelpPeerColorSet from given interface. +func (p *HelpPeerColorSet) FillFrom(from interface { + GetColors() (value []int) +}) { + p.Colors = from.GetColors() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*HelpPeerColorSet) TypeID() uint32 { + return HelpPeerColorSetTypeID +} + +// TypeName returns name of type in TL schema. +func (*HelpPeerColorSet) TypeName() string { + return "help.peerColorSet" +} + +// TypeInfo returns info about TL type. +func (p *HelpPeerColorSet) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "help.peerColorSet", + ID: HelpPeerColorSetTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Colors", + SchemaName: "colors", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *HelpPeerColorSet) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorSet#26219a58 as nil") + } + b.PutID(HelpPeerColorSetTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *HelpPeerColorSet) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorSet#26219a58 as nil") + } + b.PutVectorHeader(len(p.Colors)) + for _, v := range p.Colors { + b.PutInt(v) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *HelpPeerColorSet) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorSet#26219a58 to nil") + } + if err := b.ConsumeID(HelpPeerColorSetTypeID); err != nil { + return fmt.Errorf("unable to decode help.peerColorSet#26219a58: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *HelpPeerColorSet) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorSet#26219a58 to nil") + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorSet#26219a58: field colors: %w", err) + } + + if headerLen > 0 { + p.Colors = make([]int, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorSet#26219a58: field colors: %w", err) + } + p.Colors = append(p.Colors, value) + } + } + return nil +} + +// GetColors returns value of Colors field. +func (p *HelpPeerColorSet) GetColors() (value []int) { + if p == nil { + return + } + return p.Colors +} + +// HelpPeerColorProfileSet represents TL type `help.peerColorProfileSet#767d61eb`. +// Represents a color palette that can be used in profile pages »¹. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/constructor/help.peerColorProfileSet for reference. +type HelpPeerColorProfileSet struct { + // A list of 1-2 colors in RGB format, shown in the color palette settings to describe + // the current palette. + PaletteColors []int + // A list of 1-2 colors in RGB format describing the colors used to generate the actual + // background used in the profile page. + BgColors []int + // A list of 2 colors in RGB format describing the colors of the gradient used for the + // unread active story indicator around the profile photo. + StoryColors []int +} + +// HelpPeerColorProfileSetTypeID is TL type id of HelpPeerColorProfileSet. +const HelpPeerColorProfileSetTypeID = 0x767d61eb + +// construct implements constructor of HelpPeerColorSetClass. +func (p HelpPeerColorProfileSet) construct() HelpPeerColorSetClass { return &p } + +// Ensuring interfaces in compile-time for HelpPeerColorProfileSet. +var ( + _ bin.Encoder = &HelpPeerColorProfileSet{} + _ bin.Decoder = &HelpPeerColorProfileSet{} + _ bin.BareEncoder = &HelpPeerColorProfileSet{} + _ bin.BareDecoder = &HelpPeerColorProfileSet{} + + _ HelpPeerColorSetClass = &HelpPeerColorProfileSet{} +) + +func (p *HelpPeerColorProfileSet) Zero() bool { + if p == nil { + return true + } + if !(p.PaletteColors == nil) { + return false + } + if !(p.BgColors == nil) { + return false + } + if !(p.StoryColors == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *HelpPeerColorProfileSet) String() string { + if p == nil { + return "HelpPeerColorProfileSet(nil)" + } + type Alias HelpPeerColorProfileSet + return fmt.Sprintf("HelpPeerColorProfileSet%+v", Alias(*p)) +} + +// FillFrom fills HelpPeerColorProfileSet from given interface. +func (p *HelpPeerColorProfileSet) FillFrom(from interface { + GetPaletteColors() (value []int) + GetBgColors() (value []int) + GetStoryColors() (value []int) +}) { + p.PaletteColors = from.GetPaletteColors() + p.BgColors = from.GetBgColors() + p.StoryColors = from.GetStoryColors() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*HelpPeerColorProfileSet) TypeID() uint32 { + return HelpPeerColorProfileSetTypeID +} + +// TypeName returns name of type in TL schema. +func (*HelpPeerColorProfileSet) TypeName() string { + return "help.peerColorProfileSet" +} + +// TypeInfo returns info about TL type. +func (p *HelpPeerColorProfileSet) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "help.peerColorProfileSet", + ID: HelpPeerColorProfileSetTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "PaletteColors", + SchemaName: "palette_colors", + }, + { + Name: "BgColors", + SchemaName: "bg_colors", + }, + { + Name: "StoryColors", + SchemaName: "story_colors", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *HelpPeerColorProfileSet) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorProfileSet#767d61eb as nil") + } + b.PutID(HelpPeerColorProfileSetTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *HelpPeerColorProfileSet) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorProfileSet#767d61eb as nil") + } + b.PutVectorHeader(len(p.PaletteColors)) + for _, v := range p.PaletteColors { + b.PutInt(v) + } + b.PutVectorHeader(len(p.BgColors)) + for _, v := range p.BgColors { + b.PutInt(v) + } + b.PutVectorHeader(len(p.StoryColors)) + for _, v := range p.StoryColors { + b.PutInt(v) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *HelpPeerColorProfileSet) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorProfileSet#767d61eb to nil") + } + if err := b.ConsumeID(HelpPeerColorProfileSetTypeID); err != nil { + return fmt.Errorf("unable to decode help.peerColorProfileSet#767d61eb: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *HelpPeerColorProfileSet) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorProfileSet#767d61eb to nil") + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorProfileSet#767d61eb: field palette_colors: %w", err) + } + + if headerLen > 0 { + p.PaletteColors = make([]int, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorProfileSet#767d61eb: field palette_colors: %w", err) + } + p.PaletteColors = append(p.PaletteColors, value) + } + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorProfileSet#767d61eb: field bg_colors: %w", err) + } + + if headerLen > 0 { + p.BgColors = make([]int, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorProfileSet#767d61eb: field bg_colors: %w", err) + } + p.BgColors = append(p.BgColors, value) + } + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorProfileSet#767d61eb: field story_colors: %w", err) + } + + if headerLen > 0 { + p.StoryColors = make([]int, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.peerColorProfileSet#767d61eb: field story_colors: %w", err) + } + p.StoryColors = append(p.StoryColors, value) + } + } + return nil +} + +// GetPaletteColors returns value of PaletteColors field. +func (p *HelpPeerColorProfileSet) GetPaletteColors() (value []int) { + if p == nil { + return + } + return p.PaletteColors +} + +// GetBgColors returns value of BgColors field. +func (p *HelpPeerColorProfileSet) GetBgColors() (value []int) { + if p == nil { + return + } + return p.BgColors +} + +// GetStoryColors returns value of StoryColors field. +func (p *HelpPeerColorProfileSet) GetStoryColors() (value []int) { + if p == nil { + return + } + return p.StoryColors +} + +// HelpPeerColorSetClassName is schema name of HelpPeerColorSetClass. +const HelpPeerColorSetClassName = "help.PeerColorSet" + +// HelpPeerColorSetClass represents help.PeerColorSet generic type. +// +// See https://core.telegram.org/type/help.PeerColorSet for reference. +// +// Example: +// +// g, err := tg.DecodeHelpPeerColorSet(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tg.HelpPeerColorSet: // help.peerColorSet#26219a58 +// case *tg.HelpPeerColorProfileSet: // help.peerColorProfileSet#767d61eb +// default: panic(v) +// } +type HelpPeerColorSetClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() HelpPeerColorSetClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool +} + +// DecodeHelpPeerColorSet implements binary de-serialization for HelpPeerColorSetClass. +func DecodeHelpPeerColorSet(buf *bin.Buffer) (HelpPeerColorSetClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case HelpPeerColorSetTypeID: + // Decoding help.peerColorSet#26219a58. + v := HelpPeerColorSet{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode HelpPeerColorSetClass: %w", err) + } + return &v, nil + case HelpPeerColorProfileSetTypeID: + // Decoding help.peerColorProfileSet#767d61eb. + v := HelpPeerColorProfileSet{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode HelpPeerColorSetClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode HelpPeerColorSetClass: %w", bin.NewUnexpectedID(id)) + } +} + +// HelpPeerColorSet boxes the HelpPeerColorSetClass providing a helper. +type HelpPeerColorSetBox struct { + PeerColorSet HelpPeerColorSetClass +} + +// Decode implements bin.Decoder for HelpPeerColorSetBox. +func (b *HelpPeerColorSetBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode HelpPeerColorSetBox to nil") + } + v, err := DecodeHelpPeerColorSet(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PeerColorSet = v + return nil +} + +// Encode implements bin.Encode for HelpPeerColorSetBox. +func (b *HelpPeerColorSetBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PeerColorSet == nil { + return fmt.Errorf("unable to encode HelpPeerColorSetClass as nil") + } + return b.PeerColorSet.Encode(buf) +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_peer_color_set_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_help_peer_color_set_slices_gen.go new file mode 100644 index 00000000..88947738 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_peer_color_set_slices_gen.go @@ -0,0 +1,307 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// HelpPeerColorSetClassArray is adapter for slice of HelpPeerColorSetClass. +type HelpPeerColorSetClassArray []HelpPeerColorSetClass + +// Sort sorts slice of HelpPeerColorSetClass. +func (s HelpPeerColorSetClassArray) Sort(less func(a, b HelpPeerColorSetClass) bool) HelpPeerColorSetClassArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of HelpPeerColorSetClass. +func (s HelpPeerColorSetClassArray) SortStable(less func(a, b HelpPeerColorSetClass) bool) HelpPeerColorSetClassArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of HelpPeerColorSetClass. +func (s HelpPeerColorSetClassArray) Retain(keep func(x HelpPeerColorSetClass) bool) HelpPeerColorSetClassArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s HelpPeerColorSetClassArray) First() (v HelpPeerColorSetClass, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s HelpPeerColorSetClassArray) Last() (v HelpPeerColorSetClass, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *HelpPeerColorSetClassArray) PopFirst() (v HelpPeerColorSetClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero HelpPeerColorSetClass + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *HelpPeerColorSetClassArray) Pop() (v HelpPeerColorSetClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// AsHelpPeerColorSet returns copy with only HelpPeerColorSet constructors. +func (s HelpPeerColorSetClassArray) AsHelpPeerColorSet() (to HelpPeerColorSetArray) { + for _, elem := range s { + value, ok := elem.(*HelpPeerColorSet) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsHelpPeerColorProfileSet returns copy with only HelpPeerColorProfileSet constructors. +func (s HelpPeerColorSetClassArray) AsHelpPeerColorProfileSet() (to HelpPeerColorProfileSetArray) { + for _, elem := range s { + value, ok := elem.(*HelpPeerColorProfileSet) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// HelpPeerColorSetArray is adapter for slice of HelpPeerColorSet. +type HelpPeerColorSetArray []HelpPeerColorSet + +// Sort sorts slice of HelpPeerColorSet. +func (s HelpPeerColorSetArray) Sort(less func(a, b HelpPeerColorSet) bool) HelpPeerColorSetArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of HelpPeerColorSet. +func (s HelpPeerColorSetArray) SortStable(less func(a, b HelpPeerColorSet) bool) HelpPeerColorSetArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of HelpPeerColorSet. +func (s HelpPeerColorSetArray) Retain(keep func(x HelpPeerColorSet) bool) HelpPeerColorSetArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s HelpPeerColorSetArray) First() (v HelpPeerColorSet, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s HelpPeerColorSetArray) Last() (v HelpPeerColorSet, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *HelpPeerColorSetArray) PopFirst() (v HelpPeerColorSet, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero HelpPeerColorSet + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *HelpPeerColorSetArray) Pop() (v HelpPeerColorSet, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// HelpPeerColorProfileSetArray is adapter for slice of HelpPeerColorProfileSet. +type HelpPeerColorProfileSetArray []HelpPeerColorProfileSet + +// Sort sorts slice of HelpPeerColorProfileSet. +func (s HelpPeerColorProfileSetArray) Sort(less func(a, b HelpPeerColorProfileSet) bool) HelpPeerColorProfileSetArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of HelpPeerColorProfileSet. +func (s HelpPeerColorProfileSetArray) SortStable(less func(a, b HelpPeerColorProfileSet) bool) HelpPeerColorProfileSetArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of HelpPeerColorProfileSet. +func (s HelpPeerColorProfileSetArray) Retain(keep func(x HelpPeerColorProfileSet) bool) HelpPeerColorProfileSetArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s HelpPeerColorProfileSetArray) First() (v HelpPeerColorProfileSet, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s HelpPeerColorProfileSetArray) Last() (v HelpPeerColorProfileSet, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *HelpPeerColorProfileSetArray) PopFirst() (v HelpPeerColorProfileSet, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero HelpPeerColorProfileSet + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *HelpPeerColorProfileSetArray) Pop() (v HelpPeerColorProfileSet, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_peer_colors_gen.go b/vendor/github.com/gotd/td/tg/tl_help_peer_colors_gen.go new file mode 100644 index 00000000..9946c7a1 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_peer_colors_gen.go @@ -0,0 +1,422 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// HelpPeerColorsNotModified represents TL type `help.peerColorsNotModified#2ba1f5ce`. +// The list of color palettes has not changed. +// +// See https://core.telegram.org/constructor/help.peerColorsNotModified for reference. +type HelpPeerColorsNotModified struct { +} + +// HelpPeerColorsNotModifiedTypeID is TL type id of HelpPeerColorsNotModified. +const HelpPeerColorsNotModifiedTypeID = 0x2ba1f5ce + +// construct implements constructor of HelpPeerColorsClass. +func (p HelpPeerColorsNotModified) construct() HelpPeerColorsClass { return &p } + +// Ensuring interfaces in compile-time for HelpPeerColorsNotModified. +var ( + _ bin.Encoder = &HelpPeerColorsNotModified{} + _ bin.Decoder = &HelpPeerColorsNotModified{} + _ bin.BareEncoder = &HelpPeerColorsNotModified{} + _ bin.BareDecoder = &HelpPeerColorsNotModified{} + + _ HelpPeerColorsClass = &HelpPeerColorsNotModified{} +) + +func (p *HelpPeerColorsNotModified) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *HelpPeerColorsNotModified) String() string { + if p == nil { + return "HelpPeerColorsNotModified(nil)" + } + type Alias HelpPeerColorsNotModified + return fmt.Sprintf("HelpPeerColorsNotModified%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*HelpPeerColorsNotModified) TypeID() uint32 { + return HelpPeerColorsNotModifiedTypeID +} + +// TypeName returns name of type in TL schema. +func (*HelpPeerColorsNotModified) TypeName() string { + return "help.peerColorsNotModified" +} + +// TypeInfo returns info about TL type. +func (p *HelpPeerColorsNotModified) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "help.peerColorsNotModified", + ID: HelpPeerColorsNotModifiedTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *HelpPeerColorsNotModified) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorsNotModified#2ba1f5ce as nil") + } + b.PutID(HelpPeerColorsNotModifiedTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *HelpPeerColorsNotModified) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColorsNotModified#2ba1f5ce as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *HelpPeerColorsNotModified) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorsNotModified#2ba1f5ce to nil") + } + if err := b.ConsumeID(HelpPeerColorsNotModifiedTypeID); err != nil { + return fmt.Errorf("unable to decode help.peerColorsNotModified#2ba1f5ce: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *HelpPeerColorsNotModified) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColorsNotModified#2ba1f5ce to nil") + } + return nil +} + +// HelpPeerColors represents TL type `help.peerColors#f8ed08`. +// Contains info about multiple color palettes »¹. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/constructor/help.peerColors for reference. +type HelpPeerColors struct { + // Hash for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation + Hash int + // Usable color palettes¹. + // + // Links: + // 1) https://core.telegram.org/api/colors + Colors []HelpPeerColorOption +} + +// HelpPeerColorsTypeID is TL type id of HelpPeerColors. +const HelpPeerColorsTypeID = 0xf8ed08 + +// construct implements constructor of HelpPeerColorsClass. +func (p HelpPeerColors) construct() HelpPeerColorsClass { return &p } + +// Ensuring interfaces in compile-time for HelpPeerColors. +var ( + _ bin.Encoder = &HelpPeerColors{} + _ bin.Decoder = &HelpPeerColors{} + _ bin.BareEncoder = &HelpPeerColors{} + _ bin.BareDecoder = &HelpPeerColors{} + + _ HelpPeerColorsClass = &HelpPeerColors{} +) + +func (p *HelpPeerColors) Zero() bool { + if p == nil { + return true + } + if !(p.Hash == 0) { + return false + } + if !(p.Colors == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *HelpPeerColors) String() string { + if p == nil { + return "HelpPeerColors(nil)" + } + type Alias HelpPeerColors + return fmt.Sprintf("HelpPeerColors%+v", Alias(*p)) +} + +// FillFrom fills HelpPeerColors from given interface. +func (p *HelpPeerColors) FillFrom(from interface { + GetHash() (value int) + GetColors() (value []HelpPeerColorOption) +}) { + p.Hash = from.GetHash() + p.Colors = from.GetColors() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*HelpPeerColors) TypeID() uint32 { + return HelpPeerColorsTypeID +} + +// TypeName returns name of type in TL schema. +func (*HelpPeerColors) TypeName() string { + return "help.peerColors" +} + +// TypeInfo returns info about TL type. +func (p *HelpPeerColors) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "help.peerColors", + ID: HelpPeerColorsTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Hash", + SchemaName: "hash", + }, + { + Name: "Colors", + SchemaName: "colors", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *HelpPeerColors) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColors#f8ed08 as nil") + } + b.PutID(HelpPeerColorsTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *HelpPeerColors) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode help.peerColors#f8ed08 as nil") + } + b.PutInt(p.Hash) + b.PutVectorHeader(len(p.Colors)) + for idx, v := range p.Colors { + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode help.peerColors#f8ed08: field colors element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (p *HelpPeerColors) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColors#f8ed08 to nil") + } + if err := b.ConsumeID(HelpPeerColorsTypeID); err != nil { + return fmt.Errorf("unable to decode help.peerColors#f8ed08: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *HelpPeerColors) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode help.peerColors#f8ed08 to nil") + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode help.peerColors#f8ed08: field hash: %w", err) + } + p.Hash = value + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode help.peerColors#f8ed08: field colors: %w", err) + } + + if headerLen > 0 { + p.Colors = make([]HelpPeerColorOption, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value HelpPeerColorOption + if err := value.Decode(b); err != nil { + return fmt.Errorf("unable to decode help.peerColors#f8ed08: field colors: %w", err) + } + p.Colors = append(p.Colors, value) + } + } + return nil +} + +// GetHash returns value of Hash field. +func (p *HelpPeerColors) GetHash() (value int) { + if p == nil { + return + } + return p.Hash +} + +// GetColors returns value of Colors field. +func (p *HelpPeerColors) GetColors() (value []HelpPeerColorOption) { + if p == nil { + return + } + return p.Colors +} + +// HelpPeerColorsClassName is schema name of HelpPeerColorsClass. +const HelpPeerColorsClassName = "help.PeerColors" + +// HelpPeerColorsClass represents help.PeerColors generic type. +// +// See https://core.telegram.org/type/help.PeerColors for reference. +// +// Example: +// +// g, err := tg.DecodeHelpPeerColors(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tg.HelpPeerColorsNotModified: // help.peerColorsNotModified#2ba1f5ce +// case *tg.HelpPeerColors: // help.peerColors#f8ed08 +// default: panic(v) +// } +type HelpPeerColorsClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() HelpPeerColorsClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool + + // AsModified tries to map HelpPeerColorsClass to HelpPeerColors. + AsModified() (*HelpPeerColors, bool) +} + +// AsModified tries to map HelpPeerColorsNotModified to HelpPeerColors. +func (p *HelpPeerColorsNotModified) AsModified() (*HelpPeerColors, bool) { + return nil, false +} + +// AsModified tries to map HelpPeerColors to HelpPeerColors. +func (p *HelpPeerColors) AsModified() (*HelpPeerColors, bool) { + return p, true +} + +// DecodeHelpPeerColors implements binary de-serialization for HelpPeerColorsClass. +func DecodeHelpPeerColors(buf *bin.Buffer) (HelpPeerColorsClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case HelpPeerColorsNotModifiedTypeID: + // Decoding help.peerColorsNotModified#2ba1f5ce. + v := HelpPeerColorsNotModified{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode HelpPeerColorsClass: %w", err) + } + return &v, nil + case HelpPeerColorsTypeID: + // Decoding help.peerColors#f8ed08. + v := HelpPeerColors{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode HelpPeerColorsClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode HelpPeerColorsClass: %w", bin.NewUnexpectedID(id)) + } +} + +// HelpPeerColors boxes the HelpPeerColorsClass providing a helper. +type HelpPeerColorsBox struct { + PeerColors HelpPeerColorsClass +} + +// Decode implements bin.Decoder for HelpPeerColorsBox. +func (b *HelpPeerColorsBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode HelpPeerColorsBox to nil") + } + v, err := DecodeHelpPeerColors(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PeerColors = v + return nil +} + +// Encode implements bin.Encode for HelpPeerColorsBox. +func (b *HelpPeerColorsBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PeerColors == nil { + return fmt.Errorf("unable to encode HelpPeerColorsClass as nil") + } + return b.PeerColors.Encode(buf) +} diff --git a/vendor/github.com/gotd/td/tg/tl_help_peer_colors_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_help_peer_colors_slices_gen.go new file mode 100644 index 00000000..a7d6c41e --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_help_peer_colors_slices_gen.go @@ -0,0 +1,267 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// HelpPeerColorsClassArray is adapter for slice of HelpPeerColorsClass. +type HelpPeerColorsClassArray []HelpPeerColorsClass + +// Sort sorts slice of HelpPeerColorsClass. +func (s HelpPeerColorsClassArray) Sort(less func(a, b HelpPeerColorsClass) bool) HelpPeerColorsClassArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of HelpPeerColorsClass. +func (s HelpPeerColorsClassArray) SortStable(less func(a, b HelpPeerColorsClass) bool) HelpPeerColorsClassArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of HelpPeerColorsClass. +func (s HelpPeerColorsClassArray) Retain(keep func(x HelpPeerColorsClass) bool) HelpPeerColorsClassArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s HelpPeerColorsClassArray) First() (v HelpPeerColorsClass, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s HelpPeerColorsClassArray) Last() (v HelpPeerColorsClass, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *HelpPeerColorsClassArray) PopFirst() (v HelpPeerColorsClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero HelpPeerColorsClass + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *HelpPeerColorsClassArray) Pop() (v HelpPeerColorsClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// AsHelpPeerColors returns copy with only HelpPeerColors constructors. +func (s HelpPeerColorsClassArray) AsHelpPeerColors() (to HelpPeerColorsArray) { + for _, elem := range s { + value, ok := elem.(*HelpPeerColors) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AppendOnlyModified appends only Modified constructors to +// given slice. +func (s HelpPeerColorsClassArray) AppendOnlyModified(to []*HelpPeerColors) []*HelpPeerColors { + for _, elem := range s { + value, ok := elem.AsModified() + if !ok { + continue + } + to = append(to, value) + } + + return to +} + +// AsModified returns copy with only Modified constructors. +func (s HelpPeerColorsClassArray) AsModified() (to []*HelpPeerColors) { + return s.AppendOnlyModified(to) +} + +// FirstAsModified returns first element of slice (if exists). +func (s HelpPeerColorsClassArray) FirstAsModified() (v *HelpPeerColors, ok bool) { + value, ok := s.First() + if !ok { + return + } + return value.AsModified() +} + +// LastAsModified returns last element of slice (if exists). +func (s HelpPeerColorsClassArray) LastAsModified() (v *HelpPeerColors, ok bool) { + value, ok := s.Last() + if !ok { + return + } + return value.AsModified() +} + +// PopFirstAsModified returns element of slice (if exists). +func (s *HelpPeerColorsClassArray) PopFirstAsModified() (v *HelpPeerColors, ok bool) { + value, ok := s.PopFirst() + if !ok { + return + } + return value.AsModified() +} + +// PopAsModified returns element of slice (if exists). +func (s *HelpPeerColorsClassArray) PopAsModified() (v *HelpPeerColors, ok bool) { + value, ok := s.Pop() + if !ok { + return + } + return value.AsModified() +} + +// HelpPeerColorsArray is adapter for slice of HelpPeerColors. +type HelpPeerColorsArray []HelpPeerColors + +// Sort sorts slice of HelpPeerColors. +func (s HelpPeerColorsArray) Sort(less func(a, b HelpPeerColors) bool) HelpPeerColorsArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of HelpPeerColors. +func (s HelpPeerColorsArray) SortStable(less func(a, b HelpPeerColors) bool) HelpPeerColorsArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of HelpPeerColors. +func (s HelpPeerColorsArray) Retain(keep func(x HelpPeerColors) bool) HelpPeerColorsArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s HelpPeerColorsArray) First() (v HelpPeerColors, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s HelpPeerColorsArray) Last() (v HelpPeerColors, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *HelpPeerColorsArray) PopFirst() (v HelpPeerColors, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero HelpPeerColors + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *HelpPeerColorsArray) Pop() (v HelpPeerColors, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_inline_bot_web_view_gen.go b/vendor/github.com/gotd/td/tg/tl_inline_bot_web_view_gen.go index 6b3dddd6..4d313db6 100644 --- a/vendor/github.com/gotd/td/tg/tl_inline_bot_web_view_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_inline_bot_web_view_gen.go @@ -32,10 +32,11 @@ var ( ) // InlineBotWebView represents TL type `inlineBotWebView#b57295d5`. -// Specifies a bot web app¹ button, shown on top of the inline query results list. +// Specifies an inline mode mini app¹ button, shown on top of the inline query results +// list. // // Links: -// 1. https://core.telegram.org/api/bots/webapps#simple-web-apps +// 1. https://core.telegram.org/api/bots/webapps#inline-mode-mini-apps // // See https://core.telegram.org/constructor/inlineBotWebView for reference. type InlineBotWebView struct { diff --git a/vendor/github.com/gotd/td/tg/tl_input_bot_app_gen.go b/vendor/github.com/gotd/td/tg/tl_input_bot_app_gen.go index 9c22a626..f684455f 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_bot_app_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_bot_app_gen.go @@ -32,17 +32,17 @@ var ( ) // InputBotAppID represents TL type `inputBotAppID#a920bd7a`. -// Used to fetch information about a named bot web app¹ by its ID +// Used to fetch information about a named Mini App¹ by its ID // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-bot-web-apps +// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps // // See https://core.telegram.org/constructor/inputBotAppID for reference. type InputBotAppID struct { - // named bot web app¹ ID. + // named Mini App¹ ID. // // Links: - // 1) https://core.telegram.org/api/bots/webapps#named-bot-web-apps + // 1) https://core.telegram.org/api/bots/webapps#named-mini-apps ID int64 // Access hash, obtained from the botApp¹ constructor. // @@ -203,19 +203,19 @@ func (i *InputBotAppID) GetAccessHash() (value int64) { } // InputBotAppShortName represents TL type `inputBotAppShortName#908c0407`. -// Used to fetch information about a named bot web app¹ by its short name +// Used to fetch information about a named Mini App¹ by its short name // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-bot-web-apps +// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps // // See https://core.telegram.org/constructor/inputBotAppShortName for reference. type InputBotAppShortName struct { - // ID of the bot that owns the bot web app + // ID of the bot that owns the bot mini app BotID InputUserClass - // Short name, obtained from a named bot web app deep link¹ + // Short name, obtained from a named Mini App deep link¹ // // Links: - // 1) https://core.telegram.org/api/links#named-bot-web-app-links + // 1) https://core.telegram.org/api/links#named-mini-app-links ShortName string } diff --git a/vendor/github.com/gotd/td/tg/tl_input_bot_inline_message_gen.go b/vendor/github.com/gotd/td/tg/tl_input_bot_inline_message_gen.go index 06153a61..f121ac24 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_bot_inline_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_bot_inline_message_gen.go @@ -41,7 +41,8 @@ type InputBotInlineMessageMediaAuto struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // InvertMedia field of InputBotInlineMessageMediaAuto. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // Caption Message string @@ -364,7 +365,8 @@ type InputBotInlineMessageText struct { Flags bin.Fields // Disable webpage preview NoWebpage bool - // InvertMedia field of InputBotInlineMessageText. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // Message Message string @@ -1089,7 +1091,8 @@ type InputBotInlineMessageMediaVenue struct { Title string // Address Address string - // Venue provider: currently only "foursquare" needs to be supported + // Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be + // supported Provider string // Venue ID in the provider's database VenueID string @@ -2293,28 +2296,40 @@ func (i *InputBotInlineMessageMediaInvoice) GetReplyMarkup() (value ReplyMarkupC } // InputBotInlineMessageMediaWebPage represents TL type `inputBotInlineMessageMediaWebPage#bddcc510`. +// Specifies options that will be used to generate the link preview for the message, or +// even a standalone link preview without an attached message. // // See https://core.telegram.org/constructor/inputBotInlineMessageMediaWebPage for reference. type InputBotInlineMessageMediaWebPage struct { - // Flags field of InputBotInlineMessageMediaWebPage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // InvertMedia field of InputBotInlineMessageMediaWebPage. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool - // ForceLargeMedia field of InputBotInlineMessageMediaWebPage. + // If set, specifies that a large media preview should be used. ForceLargeMedia bool - // ForceSmallMedia field of InputBotInlineMessageMediaWebPage. + // If set, specifies that a small media preview should be used. ForceSmallMedia bool - // Optional field of InputBotInlineMessageMediaWebPage. + // If not set, a WEBPAGE_NOT_FOUND RPC error will be emitted if a webpage preview cannot + // be generated for the specified url; otherwise, no error will be emitted (unless the + // provided message is also empty, in which case a MESSAGE_EMPTY will be emitted, + // instead). Optional bool - // Message field of InputBotInlineMessageMediaWebPage. + // The message, can be empty. Message string - // Entities field of InputBotInlineMessageMediaWebPage. + // Message entities for styled text¹ + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // URL field of InputBotInlineMessageMediaWebPage. + // The URL to use for the link preview. URL string - // ReplyMarkup field of InputBotInlineMessageMediaWebPage. + // Inline keyboard // // Use SetReplyMarkup and GetReplyMarkup helpers. ReplyMarkup ReplyMarkupClass diff --git a/vendor/github.com/gotd/td/tg/tl_input_file_location_gen.go b/vendor/github.com/gotd/td/tg/tl_input_file_location_gen.go index c58df5ea..7a48b85e 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_file_location_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_file_location_gen.go @@ -812,7 +812,13 @@ func (i *InputSecureFileLocation) GetAccessHash() (value int64) { } // InputTakeoutFileLocation represents TL type `inputTakeoutFileLocation#29be5899`. -// Empty constructor for takeout +// Used to download a JSON file that will contain all personal data related to features +// that do not have a specialized takeout method¹ yet, see here »² for more info on +// the takeout API. +// +// Links: +// 1. https://core.telegram.org/api/takeout +// 2. https://core.telegram.org/api/takeout // // See https://core.telegram.org/constructor/inputTakeoutFileLocation for reference. type InputTakeoutFileLocation struct { diff --git a/vendor/github.com/gotd/td/tg/tl_input_invoice_gen.go b/vendor/github.com/gotd/td/tg/tl_input_invoice_gen.go index a1b47fd8..7f580506 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_invoice_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_invoice_gen.go @@ -342,12 +342,31 @@ func (i *InputInvoiceSlug) GetSlug() (value string) { } // InputInvoicePremiumGiftCode represents TL type `inputInvoicePremiumGiftCode#98986c0d`. +// Used if the user wishes to start a channel giveaway¹ or send some giftcodes² to +// members of a channel, in exchange for boosts³. +// +// Links: +// 1. https://core.telegram.org/api/giveaways +// 2. https://core.telegram.org/api/giveaways +// 3. https://core.telegram.org/api/boost // // See https://core.telegram.org/constructor/inputInvoicePremiumGiftCode for reference. type InputInvoicePremiumGiftCode struct { - // Purpose field of InputInvoicePremiumGiftCode. + // Should be populated with inputStorePaymentPremiumGiveaway¹ for giveaways² and + // inputStorePaymentPremiumGiftCode³ for gifts⁴. + // + // Links: + // 1) https://core.telegram.org/constructor/inputStorePaymentPremiumGiveaway + // 2) https://core.telegram.org/api/giveaways + // 3) https://core.telegram.org/constructor/inputStorePaymentPremiumGiftCode + // 4) https://core.telegram.org/api/giveaways Purpose InputStorePaymentPurposeClass - // Option field of InputInvoicePremiumGiftCode. + // Should be populated with one of the giveaway options returned by payments + // getPremiumGiftCodeOptions¹, see the giveaways »² documentation for more info. + // + // Links: + // 1) https://core.telegram.org/method/payments.getPremiumGiftCodeOptions + // 2) https://core.telegram.org/api/giveaways Option PremiumGiftCodeOption } diff --git a/vendor/github.com/gotd/td/tg/tl_input_media_gen.go b/vendor/github.com/gotd/td/tg/tl_input_media_gen.go index 6ad374aa..928f4b5f 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_media_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_media_gen.go @@ -1880,7 +1880,8 @@ type InputMediaVenue struct { Title string // Physical address of the venue Address string - // Venue provider: currently only "foursquare" needs to be supported + // Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be + // supported Provider string // Venue ID in the provider's database VenueID string @@ -4050,12 +4051,13 @@ func (i *InputMediaDice) GetEmoticon() (value string) { } // InputMediaStory represents TL type `inputMediaStory#89fdd778`. +// Forwarded story // // See https://core.telegram.org/constructor/inputMediaStory for reference. type InputMediaStory struct { - // Peer field of InputMediaStory. + // Peer where the story was posted Peer InputPeerClass - // ID field of InputMediaStory. + // Story ID ID int } @@ -4216,18 +4218,26 @@ func (i *InputMediaStory) GetID() (value int) { } // InputMediaWebPage represents TL type `inputMediaWebPage#c21b8849`. +// Specifies options that will be used to generate the link preview for the caption, or +// even a standalone link preview without an attached message. // // See https://core.telegram.org/constructor/inputMediaWebPage for reference. type InputMediaWebPage struct { - // Flags field of InputMediaWebPage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ForceLargeMedia field of InputMediaWebPage. + // If set, specifies that a large media preview should be used. ForceLargeMedia bool - // ForceSmallMedia field of InputMediaWebPage. + // If set, specifies that a small media preview should be used. ForceSmallMedia bool - // Optional field of InputMediaWebPage. + // If not set, a WEBPAGE_NOT_FOUND RPC error will be emitted if a webpage preview cannot + // be generated for the specified url; otherwise, no error will be emitted (unless the + // provided message is also empty, in which case a MESSAGE_EMPTY will be emitted, + // instead). Optional bool - // URL field of InputMediaWebPage. + // The URL to use for the link preview. URL string } diff --git a/vendor/github.com/gotd/td/tg/tl_input_peer_notify_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_input_peer_notify_settings_gen.go index ab573191..f62a61e5 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_peer_notify_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_peer_notify_settings_gen.go @@ -53,19 +53,19 @@ type InputPeerNotifySettings struct { // // Use SetMuteUntil and GetMuteUntil helpers. MuteUntil int - // Name of an audio file for notification + // Identifier of an audio file to play for notifications. // // Use SetSound and GetSound helpers. Sound NotificationSoundClass - // StoriesMuted field of InputPeerNotifySettings. + // Whether story notifications should be disabled. // // Use SetStoriesMuted and GetStoriesMuted helpers. StoriesMuted bool - // StoriesHideSender field of InputPeerNotifySettings. + // Whether the sender name should be displayed in story notifications. // // Use SetStoriesHideSender and GetStoriesHideSender helpers. StoriesHideSender bool - // StoriesSound field of InputPeerNotifySettings. + // Identifier of an audio file to play for story notifications. // // Use SetStoriesSound and GetStoriesSound helpers. StoriesSound NotificationSoundClass diff --git a/vendor/github.com/gotd/td/tg/tl_input_privacy_key_gen.go b/vendor/github.com/gotd/td/tg/tl_input_privacy_key_gen.go index b37c4cc9..1d059959 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_privacy_key_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_privacy_key_gen.go @@ -953,6 +953,7 @@ func (i *InputPrivacyKeyVoiceMessages) DecodeBare(b *bin.Buffer) error { } // InputPrivacyKeyAbout represents TL type `inputPrivacyKeyAbout#3823cc40`. +// Whether people can see your bio // // See https://core.telegram.org/constructor/inputPrivacyKeyAbout for reference. type InputPrivacyKeyAbout struct { diff --git a/vendor/github.com/gotd/td/tg/tl_input_privacy_rule_gen.go b/vendor/github.com/gotd/td/tg/tl_input_privacy_rule_gen.go index 54f426a7..5e3fcfa8 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_privacy_rule_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_privacy_rule_gen.go @@ -1052,6 +1052,10 @@ func (i *InputPrivacyValueDisallowChatParticipants) GetChats() (value []int64) { } // InputPrivacyValueAllowCloseFriends represents TL type `inputPrivacyValueAllowCloseFriends#2f453e49`. +// Allow only close friends »¹ +// +// Links: +// 1. https://core.telegram.org/api/privacy // // See https://core.telegram.org/constructor/inputPrivacyValueAllowCloseFriends for reference. type InputPrivacyValueAllowCloseFriends struct { diff --git a/vendor/github.com/gotd/td/tg/tl_input_reply_to_gen.go b/vendor/github.com/gotd/td/tg/tl_input_reply_to_gen.go index 8d688b21..e5efa9b1 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_reply_to_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_reply_to_gen.go @@ -31,34 +31,53 @@ var ( _ = tdjson.Encoder{} ) -// InputReplyToMessage represents TL type `inputReplyToMessage#73ec805`. +// InputReplyToMessage represents TL type `inputReplyToMessage#22c0f6d5`. +// Reply to a message. // // See https://core.telegram.org/constructor/inputReplyToMessage for reference. type InputReplyToMessage struct { - // Flags field of InputReplyToMessage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ReplyToMsgID field of InputReplyToMessage. + // The message ID to reply to. ReplyToMsgID int - // TopMsgID field of InputReplyToMessage. + // This field must contain the topic ID only when replying to messages in forum topics + // different from the "General" topic (i.e. reply_to_msg_id is set and reply_to_msg_id != + // topicID and topicID != 1). If the replied-to message is deleted before the method + // finishes execution, the value in this field will be used to send the message to the + // correct topic, instead of the "General" topic. // // Use SetTopMsgID and GetTopMsgID helpers. TopMsgID int - // ReplyToPeerID field of InputReplyToMessage. + // Used to reply to messages sent to another chat (specified here), can only be used for + // non-protected chats and messages. // // Use SetReplyToPeerID and GetReplyToPeerID helpers. ReplyToPeerID InputPeerClass - // QuoteText field of InputReplyToMessage. + // Used to quote-reply to only a certain section (specified here) of the original message. // // Use SetQuoteText and GetQuoteText helpers. QuoteText string - // QuoteEntities field of InputReplyToMessage. + // Message entities for styled text¹ from the quote_text field. + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetQuoteEntities and GetQuoteEntities helpers. QuoteEntities []MessageEntityClass + // Offset of the message quote_text within the original message (in UTF-16 code units¹). + // + // Links: + // 1) https://core.telegram.org/api/entities#entity-length + // + // Use SetQuoteOffset and GetQuoteOffset helpers. + QuoteOffset int } // InputReplyToMessageTypeID is TL type id of InputReplyToMessage. -const InputReplyToMessageTypeID = 0x73ec805 +const InputReplyToMessageTypeID = 0x22c0f6d5 // construct implements constructor of InputReplyToClass. func (i InputReplyToMessage) construct() InputReplyToClass { return &i } @@ -95,6 +114,9 @@ func (i *InputReplyToMessage) Zero() bool { if !(i.QuoteEntities == nil) { return false } + if !(i.QuoteOffset == 0) { + return false + } return true } @@ -115,6 +137,7 @@ func (i *InputReplyToMessage) FillFrom(from interface { GetReplyToPeerID() (value InputPeerClass, ok bool) GetQuoteText() (value string, ok bool) GetQuoteEntities() (value []MessageEntityClass, ok bool) + GetQuoteOffset() (value int, ok bool) }) { i.ReplyToMsgID = from.GetReplyToMsgID() if val, ok := from.GetTopMsgID(); ok { @@ -133,6 +156,10 @@ func (i *InputReplyToMessage) FillFrom(from interface { i.QuoteEntities = val } + if val, ok := from.GetQuoteOffset(); ok { + i.QuoteOffset = val + } + } // TypeID returns type id in TL schema. @@ -182,6 +209,11 @@ func (i *InputReplyToMessage) TypeInfo() tdp.Type { SchemaName: "quote_entities", Null: !i.Flags.Has(3), }, + { + Name: "QuoteOffset", + SchemaName: "quote_offset", + Null: !i.Flags.Has(4), + }, } return typ } @@ -200,12 +232,15 @@ func (i *InputReplyToMessage) SetFlags() { if !(i.QuoteEntities == nil) { i.Flags.Set(3) } + if !(i.QuoteOffset == 0) { + i.Flags.Set(4) + } } // Encode implements bin.Encoder. func (i *InputReplyToMessage) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputReplyToMessage#73ec805 as nil") + return fmt.Errorf("can't encode inputReplyToMessage#22c0f6d5 as nil") } b.PutID(InputReplyToMessageTypeID) return i.EncodeBare(b) @@ -214,11 +249,11 @@ func (i *InputReplyToMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputReplyToMessage) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputReplyToMessage#73ec805 as nil") + return fmt.Errorf("can't encode inputReplyToMessage#22c0f6d5 as nil") } i.SetFlags() if err := i.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputReplyToMessage#73ec805: field flags: %w", err) + return fmt.Errorf("unable to encode inputReplyToMessage#22c0f6d5: field flags: %w", err) } b.PutInt(i.ReplyToMsgID) if i.Flags.Has(0) { @@ -226,10 +261,10 @@ func (i *InputReplyToMessage) EncodeBare(b *bin.Buffer) error { } if i.Flags.Has(1) { if i.ReplyToPeerID == nil { - return fmt.Errorf("unable to encode inputReplyToMessage#73ec805: field reply_to_peer_id is nil") + return fmt.Errorf("unable to encode inputReplyToMessage#22c0f6d5: field reply_to_peer_id is nil") } if err := i.ReplyToPeerID.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputReplyToMessage#73ec805: field reply_to_peer_id: %w", err) + return fmt.Errorf("unable to encode inputReplyToMessage#22c0f6d5: field reply_to_peer_id: %w", err) } } if i.Flags.Has(2) { @@ -239,23 +274,26 @@ func (i *InputReplyToMessage) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(i.QuoteEntities)) for idx, v := range i.QuoteEntities { if v == nil { - return fmt.Errorf("unable to encode inputReplyToMessage#73ec805: field quote_entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode inputReplyToMessage#22c0f6d5: field quote_entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputReplyToMessage#73ec805: field quote_entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode inputReplyToMessage#22c0f6d5: field quote_entities element with index %d: %w", idx, err) } } } + if i.Flags.Has(4) { + b.PutInt(i.QuoteOffset) + } return nil } // Decode implements bin.Decoder. func (i *InputReplyToMessage) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputReplyToMessage#73ec805 to nil") + return fmt.Errorf("can't decode inputReplyToMessage#22c0f6d5 to nil") } if err := b.ConsumeID(InputReplyToMessageTypeID); err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: %w", err) } return i.DecodeBare(b) } @@ -263,45 +301,45 @@ func (i *InputReplyToMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputReplyToMessage) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputReplyToMessage#73ec805 to nil") + return fmt.Errorf("can't decode inputReplyToMessage#22c0f6d5 to nil") } { if err := i.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: field flags: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field flags: %w", err) } } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: field reply_to_msg_id: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field reply_to_msg_id: %w", err) } i.ReplyToMsgID = value } if i.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: field top_msg_id: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field top_msg_id: %w", err) } i.TopMsgID = value } if i.Flags.Has(1) { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: field reply_to_peer_id: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field reply_to_peer_id: %w", err) } i.ReplyToPeerID = value } if i.Flags.Has(2) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: field quote_text: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field quote_text: %w", err) } i.QuoteText = value } if i.Flags.Has(3) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: field quote_entities: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field quote_entities: %w", err) } if headerLen > 0 { @@ -310,11 +348,18 @@ func (i *InputReplyToMessage) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode inputReplyToMessage#73ec805: field quote_entities: %w", err) + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field quote_entities: %w", err) } i.QuoteEntities = append(i.QuoteEntities, value) } } + if i.Flags.Has(4) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputReplyToMessage#22c0f6d5: field quote_offset: %w", err) + } + i.QuoteOffset = value + } return nil } @@ -398,6 +443,24 @@ func (i *InputReplyToMessage) GetQuoteEntities() (value []MessageEntityClass, ok return i.QuoteEntities, true } +// SetQuoteOffset sets value of QuoteOffset conditional field. +func (i *InputReplyToMessage) SetQuoteOffset(value int) { + i.Flags.Set(4) + i.QuoteOffset = value +} + +// GetQuoteOffset returns value of QuoteOffset conditional field and +// boolean which is true if field was set. +func (i *InputReplyToMessage) GetQuoteOffset() (value int, ok bool) { + if i == nil { + return + } + if !i.Flags.Has(4) { + return value, false + } + return i.QuoteOffset, true +} + // MapQuoteEntities returns field QuoteEntities wrapped in MessageEntityClassArray helper. func (i *InputReplyToMessage) MapQuoteEntities() (value MessageEntityClassArray, ok bool) { if !i.Flags.Has(3) { @@ -407,12 +470,13 @@ func (i *InputReplyToMessage) MapQuoteEntities() (value MessageEntityClassArray, } // InputReplyToStory represents TL type `inputReplyToStory#15b0f283`. +// Reply to a story. // // See https://core.telegram.org/constructor/inputReplyToStory for reference. type InputReplyToStory struct { - // UserID field of InputReplyToStory. + // ID of the user that posted the story. UserID InputUserClass - // StoryID field of InputReplyToStory. + // ID of the story to reply to. StoryID int } @@ -586,7 +650,7 @@ const InputReplyToClassName = "InputReplyTo" // panic(err) // } // switch v := g.(type) { -// case *tg.InputReplyToMessage: // inputReplyToMessage#73ec805 +// case *tg.InputReplyToMessage: // inputReplyToMessage#22c0f6d5 // case *tg.InputReplyToStory: // inputReplyToStory#15b0f283 // default: panic(v) // } @@ -617,7 +681,7 @@ func DecodeInputReplyTo(buf *bin.Buffer) (InputReplyToClass, error) { } switch id { case InputReplyToMessageTypeID: - // Decoding inputReplyToMessage#73ec805. + // Decoding inputReplyToMessage#22c0f6d5. v := InputReplyToMessage{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputReplyToClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_input_sticker_set_gen.go b/vendor/github.com/gotd/td/tg/tl_input_sticker_set_gen.go index 032f36f7..f844560b 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_sticker_set_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_sticker_set_gen.go @@ -1198,6 +1198,107 @@ func (i *InputStickerSetEmojiDefaultTopicIcons) DecodeBare(b *bin.Buffer) error return nil } +// InputStickerSetEmojiChannelDefaultStatuses represents TL type `inputStickerSetEmojiChannelDefaultStatuses#49748553`. +// +// See https://core.telegram.org/constructor/inputStickerSetEmojiChannelDefaultStatuses for reference. +type InputStickerSetEmojiChannelDefaultStatuses struct { +} + +// InputStickerSetEmojiChannelDefaultStatusesTypeID is TL type id of InputStickerSetEmojiChannelDefaultStatuses. +const InputStickerSetEmojiChannelDefaultStatusesTypeID = 0x49748553 + +// construct implements constructor of InputStickerSetClass. +func (i InputStickerSetEmojiChannelDefaultStatuses) construct() InputStickerSetClass { return &i } + +// Ensuring interfaces in compile-time for InputStickerSetEmojiChannelDefaultStatuses. +var ( + _ bin.Encoder = &InputStickerSetEmojiChannelDefaultStatuses{} + _ bin.Decoder = &InputStickerSetEmojiChannelDefaultStatuses{} + _ bin.BareEncoder = &InputStickerSetEmojiChannelDefaultStatuses{} + _ bin.BareDecoder = &InputStickerSetEmojiChannelDefaultStatuses{} + + _ InputStickerSetClass = &InputStickerSetEmojiChannelDefaultStatuses{} +) + +func (i *InputStickerSetEmojiChannelDefaultStatuses) Zero() bool { + if i == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputStickerSetEmojiChannelDefaultStatuses) String() string { + if i == nil { + return "InputStickerSetEmojiChannelDefaultStatuses(nil)" + } + type Alias InputStickerSetEmojiChannelDefaultStatuses + return fmt.Sprintf("InputStickerSetEmojiChannelDefaultStatuses%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputStickerSetEmojiChannelDefaultStatuses) TypeID() uint32 { + return InputStickerSetEmojiChannelDefaultStatusesTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputStickerSetEmojiChannelDefaultStatuses) TypeName() string { + return "inputStickerSetEmojiChannelDefaultStatuses" +} + +// TypeInfo returns info about TL type. +func (i *InputStickerSetEmojiChannelDefaultStatuses) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputStickerSetEmojiChannelDefaultStatuses", + ID: InputStickerSetEmojiChannelDefaultStatusesTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (i *InputStickerSetEmojiChannelDefaultStatuses) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStickerSetEmojiChannelDefaultStatuses#49748553 as nil") + } + b.PutID(InputStickerSetEmojiChannelDefaultStatusesTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputStickerSetEmojiChannelDefaultStatuses) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputStickerSetEmojiChannelDefaultStatuses#49748553 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputStickerSetEmojiChannelDefaultStatuses) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStickerSetEmojiChannelDefaultStatuses#49748553 to nil") + } + if err := b.ConsumeID(InputStickerSetEmojiChannelDefaultStatusesTypeID); err != nil { + return fmt.Errorf("unable to decode inputStickerSetEmojiChannelDefaultStatuses#49748553: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputStickerSetEmojiChannelDefaultStatuses) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputStickerSetEmojiChannelDefaultStatuses#49748553 to nil") + } + return nil +} + // InputStickerSetClassName is schema name of InputStickerSetClass. const InputStickerSetClassName = "InputStickerSet" @@ -1222,6 +1323,7 @@ const InputStickerSetClassName = "InputStickerSet" // case *tg.InputStickerSetEmojiGenericAnimations: // inputStickerSetEmojiGenericAnimations#4c4d4ce // case *tg.InputStickerSetEmojiDefaultStatuses: // inputStickerSetEmojiDefaultStatuses#29d0f5ee // case *tg.InputStickerSetEmojiDefaultTopicIcons: // inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 +// case *tg.InputStickerSetEmojiChannelDefaultStatuses: // inputStickerSetEmojiChannelDefaultStatuses#49748553 // default: panic(v) // } type InputStickerSetClass interface { @@ -1320,6 +1422,13 @@ func DecodeInputStickerSet(buf *bin.Buffer) (InputStickerSetClass, error) { return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err) } return &v, nil + case InputStickerSetEmojiChannelDefaultStatusesTypeID: + // Decoding inputStickerSetEmojiChannelDefaultStatuses#49748553. + v := InputStickerSetEmojiChannelDefaultStatuses{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InputStickerSetClass: %w", bin.NewUnexpectedID(id)) } diff --git a/vendor/github.com/gotd/td/tg/tl_input_store_payment_purpose_gen.go b/vendor/github.com/gotd/td/tg/tl_input_store_payment_purpose_gen.go index 0397733e..31b8cfdc 100644 --- a/vendor/github.com/gotd/td/tg/tl_input_store_payment_purpose_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_input_store_payment_purpose_gen.go @@ -435,20 +435,49 @@ func (i *InputStorePaymentGiftPremium) GetAmount() (value int64) { } // InputStorePaymentPremiumGiftCode represents TL type `inputStorePaymentPremiumGiftCode#a3805f3f`. +// Used to gift Telegram Premium¹ subscriptions only to some specific subscribers of a +// channel or to some of our contacts, see here »² for more info on giveaways and gifts. +// +// Links: +// 1. https://core.telegram.org/api/premium +// 2. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/constructor/inputStorePaymentPremiumGiftCode for reference. type InputStorePaymentPremiumGiftCode struct { - // Flags field of InputStorePaymentPremiumGiftCode. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Users field of InputStorePaymentPremiumGiftCode. + // The users that will receive the Telegram Premium¹ subscriptions. + // + // Links: + // 1) https://core.telegram.org/api/premium Users []InputUserClass - // BoostPeer field of InputStorePaymentPremiumGiftCode. + // If set, the gifts will be sent on behalf of a channel we are an admin of, which will + // also assign some boosts¹ to it. Otherwise, the gift will be sent directly from the + // currently logged in users, and we will gain some extra boost slots². See here »³ + // for more info on giveaways and gifts. + // + // Links: + // 1) https://core.telegram.org/api/boost + // 2) https://core.telegram.org/api/boost + // 3) https://core.telegram.org/api/giveaways // // Use SetBoostPeer and GetBoostPeer helpers. BoostPeer InputPeerClass - // Currency field of InputStorePaymentPremiumGiftCode. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of InputStorePaymentPremiumGiftCode. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } @@ -716,36 +745,75 @@ func (i *InputStorePaymentPremiumGiftCode) MapUsers() (value InputUserClassArray return InputUserClassArray(i.Users) } -// InputStorePaymentPremiumGiveaway represents TL type `inputStorePaymentPremiumGiveaway#7c9375e6`. +// InputStorePaymentPremiumGiveaway represents TL type `inputStorePaymentPremiumGiveaway#160544ca`. +// Used to pay for a giveaway, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/constructor/inputStorePaymentPremiumGiveaway for reference. type InputStorePaymentPremiumGiveaway struct { - // Flags field of InputStorePaymentPremiumGiveaway. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OnlyNewSubscribers field of InputStorePaymentPremiumGiveaway. + // If set, only new subscribers starting from the giveaway creation date will be able to + // participate to the giveaway. OnlyNewSubscribers bool - // BoostPeer field of InputStorePaymentPremiumGiveaway. + // WinnersAreVisible field of InputStorePaymentPremiumGiveaway. + WinnersAreVisible bool + // The channel starting the giveaway, that the user must join to participate, that will + // receive the giveaway boosts¹; see here »² for more info on giveaways. + // + // Links: + // 1) https://core.telegram.org/api/boost + // 2) https://core.telegram.org/api/giveaways BoostPeer InputPeerClass - // AdditionalPeers field of InputStorePaymentPremiumGiveaway. + // Additional channels that the user must join to participate to the giveaway can be + // specified here. // // Use SetAdditionalPeers and GetAdditionalPeers helpers. AdditionalPeers []InputPeerClass - // CountriesISO2 field of InputStorePaymentPremiumGiveaway. + // The set of users that can participate to the giveaway can be restricted by passing + // here an explicit whitelist of up to giveaway_countries_max¹ countries, specified as + // two-letter ISO 3166-1 alpha-2 country codes. + // + // Links: + // 1) https://core.telegram.org/api/config#giveaway-countries-max // // Use SetCountriesISO2 and GetCountriesISO2 helpers. CountriesISO2 []string - // RandomID field of InputStorePaymentPremiumGiveaway. + // PrizeDescription field of InputStorePaymentPremiumGiveaway. + // + // Use SetPrizeDescription and GetPrizeDescription helpers. + PrizeDescription string + // Random ID to avoid resending the giveaway RandomID int64 - // UntilDate field of InputStorePaymentPremiumGiveaway. + // The end date of the giveaway, must be at most giveaway_period_max¹ seconds in the + // future; see here »² for more info on giveaways. + // + // Links: + // 1) https://core.telegram.org/api/config#giveaway-period-max + // 2) https://core.telegram.org/api/giveaways UntilDate int - // Currency field of InputStorePaymentPremiumGiveaway. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of InputStorePaymentPremiumGiveaway. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } // InputStorePaymentPremiumGiveawayTypeID is TL type id of InputStorePaymentPremiumGiveaway. -const InputStorePaymentPremiumGiveawayTypeID = 0x7c9375e6 +const InputStorePaymentPremiumGiveawayTypeID = 0x160544ca // construct implements constructor of InputStorePaymentPurposeClass. func (i InputStorePaymentPremiumGiveaway) construct() InputStorePaymentPurposeClass { return &i } @@ -770,6 +838,9 @@ func (i *InputStorePaymentPremiumGiveaway) Zero() bool { if !(i.OnlyNewSubscribers == false) { return false } + if !(i.WinnersAreVisible == false) { + return false + } if !(i.BoostPeer == nil) { return false } @@ -779,6 +850,9 @@ func (i *InputStorePaymentPremiumGiveaway) Zero() bool { if !(i.CountriesISO2 == nil) { return false } + if !(i.PrizeDescription == "") { + return false + } if !(i.RandomID == 0) { return false } @@ -807,15 +881,18 @@ func (i *InputStorePaymentPremiumGiveaway) String() string { // FillFrom fills InputStorePaymentPremiumGiveaway from given interface. func (i *InputStorePaymentPremiumGiveaway) FillFrom(from interface { GetOnlyNewSubscribers() (value bool) + GetWinnersAreVisible() (value bool) GetBoostPeer() (value InputPeerClass) GetAdditionalPeers() (value []InputPeerClass, ok bool) GetCountriesISO2() (value []string, ok bool) + GetPrizeDescription() (value string, ok bool) GetRandomID() (value int64) GetUntilDate() (value int) GetCurrency() (value string) GetAmount() (value int64) }) { i.OnlyNewSubscribers = from.GetOnlyNewSubscribers() + i.WinnersAreVisible = from.GetWinnersAreVisible() i.BoostPeer = from.GetBoostPeer() if val, ok := from.GetAdditionalPeers(); ok { i.AdditionalPeers = val @@ -825,6 +902,10 @@ func (i *InputStorePaymentPremiumGiveaway) FillFrom(from interface { i.CountriesISO2 = val } + if val, ok := from.GetPrizeDescription(); ok { + i.PrizeDescription = val + } + i.RandomID = from.GetRandomID() i.UntilDate = from.GetUntilDate() i.Currency = from.GetCurrency() @@ -859,6 +940,11 @@ func (i *InputStorePaymentPremiumGiveaway) TypeInfo() tdp.Type { SchemaName: "only_new_subscribers", Null: !i.Flags.Has(0), }, + { + Name: "WinnersAreVisible", + SchemaName: "winners_are_visible", + Null: !i.Flags.Has(3), + }, { Name: "BoostPeer", SchemaName: "boost_peer", @@ -873,6 +959,11 @@ func (i *InputStorePaymentPremiumGiveaway) TypeInfo() tdp.Type { SchemaName: "countries_iso2", Null: !i.Flags.Has(2), }, + { + Name: "PrizeDescription", + SchemaName: "prize_description", + Null: !i.Flags.Has(4), + }, { Name: "RandomID", SchemaName: "random_id", @@ -898,18 +989,24 @@ func (i *InputStorePaymentPremiumGiveaway) SetFlags() { if !(i.OnlyNewSubscribers == false) { i.Flags.Set(0) } + if !(i.WinnersAreVisible == false) { + i.Flags.Set(3) + } if !(i.AdditionalPeers == nil) { i.Flags.Set(1) } if !(i.CountriesISO2 == nil) { i.Flags.Set(2) } + if !(i.PrizeDescription == "") { + i.Flags.Set(4) + } } // Encode implements bin.Encoder. func (i *InputStorePaymentPremiumGiveaway) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputStorePaymentPremiumGiveaway#7c9375e6 as nil") + return fmt.Errorf("can't encode inputStorePaymentPremiumGiveaway#160544ca as nil") } b.PutID(InputStorePaymentPremiumGiveawayTypeID) return i.EncodeBare(b) @@ -918,26 +1015,26 @@ func (i *InputStorePaymentPremiumGiveaway) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputStorePaymentPremiumGiveaway) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputStorePaymentPremiumGiveaway#7c9375e6 as nil") + return fmt.Errorf("can't encode inputStorePaymentPremiumGiveaway#160544ca as nil") } i.SetFlags() if err := i.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#7c9375e6: field flags: %w", err) + return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#160544ca: field flags: %w", err) } if i.BoostPeer == nil { - return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#7c9375e6: field boost_peer is nil") + return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#160544ca: field boost_peer is nil") } if err := i.BoostPeer.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#7c9375e6: field boost_peer: %w", err) + return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#160544ca: field boost_peer: %w", err) } if i.Flags.Has(1) { b.PutVectorHeader(len(i.AdditionalPeers)) for idx, v := range i.AdditionalPeers { if v == nil { - return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#7c9375e6: field additional_peers element with index %d is nil", idx) + return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#160544ca: field additional_peers element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#7c9375e6: field additional_peers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode inputStorePaymentPremiumGiveaway#160544ca: field additional_peers element with index %d: %w", idx, err) } } } @@ -947,6 +1044,9 @@ func (i *InputStorePaymentPremiumGiveaway) EncodeBare(b *bin.Buffer) error { b.PutString(v) } } + if i.Flags.Has(4) { + b.PutString(i.PrizeDescription) + } b.PutLong(i.RandomID) b.PutInt(i.UntilDate) b.PutString(i.Currency) @@ -957,10 +1057,10 @@ func (i *InputStorePaymentPremiumGiveaway) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputStorePaymentPremiumGiveaway) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputStorePaymentPremiumGiveaway#7c9375e6 to nil") + return fmt.Errorf("can't decode inputStorePaymentPremiumGiveaway#160544ca to nil") } if err := b.ConsumeID(InputStorePaymentPremiumGiveawayTypeID); err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: %w", err) } return i.DecodeBare(b) } @@ -968,25 +1068,26 @@ func (i *InputStorePaymentPremiumGiveaway) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputStorePaymentPremiumGiveaway) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputStorePaymentPremiumGiveaway#7c9375e6 to nil") + return fmt.Errorf("can't decode inputStorePaymentPremiumGiveaway#160544ca to nil") } { if err := i.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field flags: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field flags: %w", err) } } i.OnlyNewSubscribers = i.Flags.Has(0) + i.WinnersAreVisible = i.Flags.Has(3) { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field boost_peer: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field boost_peer: %w", err) } i.BoostPeer = value } if i.Flags.Has(1) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field additional_peers: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field additional_peers: %w", err) } if headerLen > 0 { @@ -995,7 +1096,7 @@ func (i *InputStorePaymentPremiumGiveaway) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field additional_peers: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field additional_peers: %w", err) } i.AdditionalPeers = append(i.AdditionalPeers, value) } @@ -1003,7 +1104,7 @@ func (i *InputStorePaymentPremiumGiveaway) DecodeBare(b *bin.Buffer) error { if i.Flags.Has(2) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field countries_iso2: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field countries_iso2: %w", err) } if headerLen > 0 { @@ -1012,36 +1113,43 @@ func (i *InputStorePaymentPremiumGiveaway) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field countries_iso2: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field countries_iso2: %w", err) } i.CountriesISO2 = append(i.CountriesISO2, value) } } + if i.Flags.Has(4) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field prize_description: %w", err) + } + i.PrizeDescription = value + } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field random_id: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field random_id: %w", err) } i.RandomID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field until_date: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field until_date: %w", err) } i.UntilDate = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field currency: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field currency: %w", err) } i.Currency = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#7c9375e6: field amount: %w", err) + return fmt.Errorf("unable to decode inputStorePaymentPremiumGiveaway#160544ca: field amount: %w", err) } i.Amount = value } @@ -1067,6 +1175,25 @@ func (i *InputStorePaymentPremiumGiveaway) GetOnlyNewSubscribers() (value bool) return i.Flags.Has(0) } +// SetWinnersAreVisible sets value of WinnersAreVisible conditional field. +func (i *InputStorePaymentPremiumGiveaway) SetWinnersAreVisible(value bool) { + if value { + i.Flags.Set(3) + i.WinnersAreVisible = true + } else { + i.Flags.Unset(3) + i.WinnersAreVisible = false + } +} + +// GetWinnersAreVisible returns value of WinnersAreVisible conditional field. +func (i *InputStorePaymentPremiumGiveaway) GetWinnersAreVisible() (value bool) { + if i == nil { + return + } + return i.Flags.Has(3) +} + // GetBoostPeer returns value of BoostPeer field. func (i *InputStorePaymentPremiumGiveaway) GetBoostPeer() (value InputPeerClass) { if i == nil { @@ -1111,6 +1238,24 @@ func (i *InputStorePaymentPremiumGiveaway) GetCountriesISO2() (value []string, o return i.CountriesISO2, true } +// SetPrizeDescription sets value of PrizeDescription conditional field. +func (i *InputStorePaymentPremiumGiveaway) SetPrizeDescription(value string) { + i.Flags.Set(4) + i.PrizeDescription = value +} + +// GetPrizeDescription returns value of PrizeDescription conditional field and +// boolean which is true if field was set. +func (i *InputStorePaymentPremiumGiveaway) GetPrizeDescription() (value string, ok bool) { + if i == nil { + return + } + if !i.Flags.Has(4) { + return value, false + } + return i.PrizeDescription, true +} + // GetRandomID returns value of RandomID field. func (i *InputStorePaymentPremiumGiveaway) GetRandomID() (value int64) { if i == nil { @@ -1168,7 +1313,7 @@ const InputStorePaymentPurposeClassName = "InputStorePaymentPurpose" // case *tg.InputStorePaymentPremiumSubscription: // inputStorePaymentPremiumSubscription#a6751e66 // case *tg.InputStorePaymentGiftPremium: // inputStorePaymentGiftPremium#616f7fe8 // case *tg.InputStorePaymentPremiumGiftCode: // inputStorePaymentPremiumGiftCode#a3805f3f -// case *tg.InputStorePaymentPremiumGiveaway: // inputStorePaymentPremiumGiveaway#7c9375e6 +// case *tg.InputStorePaymentPremiumGiveaway: // inputStorePaymentPremiumGiveaway#160544ca // default: panic(v) // } type InputStorePaymentPurposeClass interface { @@ -1219,7 +1364,7 @@ func DecodeInputStorePaymentPurpose(buf *bin.Buffer) (InputStorePaymentPurposeCl } return &v, nil case InputStorePaymentPremiumGiveawayTypeID: - // Decoding inputStorePaymentPremiumGiveaway#7c9375e6. + // Decoding inputStorePaymentPremiumGiveaway#160544ca. v := InputStorePaymentPremiumGiveaway{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputStorePaymentPurposeClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_invoice_gen.go b/vendor/github.com/gotd/td/tg/tl_invoice_gen.go index 2741c2e0..dde26487 100644 --- a/vendor/github.com/gotd/td/tg/tl_invoice_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_invoice_gen.go @@ -84,7 +84,7 @@ type Invoice struct { // // Use SetSuggestedTipAmounts and GetSuggestedTipAmounts helpers. SuggestedTipAmounts []int64 - // TermsURL field of Invoice. + // Terms of service URL // // Use SetTermsURL and GetTermsURL helpers. TermsURL string diff --git a/vendor/github.com/gotd/td/tg/tl_invoke_with_takeout_gen.go b/vendor/github.com/gotd/td/tg/tl_invoke_with_takeout_gen.go index 87e56e58..cac5ed37 100644 --- a/vendor/github.com/gotd/td/tg/tl_invoke_with_takeout_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_invoke_with_takeout_gen.go @@ -32,11 +32,17 @@ var ( ) // InvokeWithTakeoutRequest represents TL type `invokeWithTakeout#aca9fd2e`. -// Invoke a method within a takeout session +// Invoke a method within a takeout session, see here » for more info¹. +// +// Links: +// 1. https://core.telegram.org/api/takeout // // See https://core.telegram.org/constructor/invokeWithTakeout for reference. type InvokeWithTakeoutRequest struct { - // Takeout session ID + // Takeout session ID »¹ + // + // Links: + // 1) https://core.telegram.org/api/takeout TakeoutID int64 // Query Query bin.Object diff --git a/vendor/github.com/gotd/td/tg/tl_keyboard_button_gen.go b/vendor/github.com/gotd/td/tg/tl_keyboard_button_gen.go index 00262442..d606e431 100644 --- a/vendor/github.com/gotd/td/tg/tl_keyboard_button_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_keyboard_button_gen.go @@ -2532,7 +2532,7 @@ func (k *KeyboardButtonUserProfile) GetUserID() (value int64) { } // KeyboardButtonWebView represents TL type `keyboardButtonWebView#13767230`. -// Button to open a bot web app¹ using messages.requestWebView², sending over user +// Button to open a bot mini app¹ using messages.requestWebView², sending over user // information after user confirmation. // Can only be sent or received as part of an inline keyboard, use // keyboardButtonSimpleWebView¹ for reply keyboards. @@ -2705,7 +2705,7 @@ func (k *KeyboardButtonWebView) GetURL() (value string) { } // KeyboardButtonSimpleWebView represents TL type `keyboardButtonSimpleWebView#a0c0505c`. -// Button to open a bot web app¹ using messages.requestSimpleWebView², without sending +// Button to open a bot mini app¹ using messages.requestSimpleWebView², without sending // user information to the web app. // Can only be sent or received as part of a reply keyboard, use keyboardButtonWebView¹ // for inline keyboards. @@ -2877,7 +2877,7 @@ func (k *KeyboardButtonSimpleWebView) GetURL() (value string) { return k.URL } -// KeyboardButtonRequestPeer represents TL type `keyboardButtonRequestPeer#d0b468c`. +// KeyboardButtonRequestPeer represents TL type `keyboardButtonRequestPeer#53d7bfd8`. // Prompts the user to select and share a peer with the bot using messages // sendBotRequestedPeer¹ // @@ -2898,10 +2898,12 @@ type KeyboardButtonRequestPeer struct { // option for the user to create and immediately use a peer of the specified type, if // needed. PeerType RequestPeerTypeClass + // MaxQuantity field of KeyboardButtonRequestPeer. + MaxQuantity int } // KeyboardButtonRequestPeerTypeID is TL type id of KeyboardButtonRequestPeer. -const KeyboardButtonRequestPeerTypeID = 0xd0b468c +const KeyboardButtonRequestPeerTypeID = 0x53d7bfd8 // construct implements constructor of KeyboardButtonClass. func (k KeyboardButtonRequestPeer) construct() KeyboardButtonClass { return &k } @@ -2929,6 +2931,9 @@ func (k *KeyboardButtonRequestPeer) Zero() bool { if !(k.PeerType == nil) { return false } + if !(k.MaxQuantity == 0) { + return false + } return true } @@ -2947,10 +2952,12 @@ func (k *KeyboardButtonRequestPeer) FillFrom(from interface { GetText() (value string) GetButtonID() (value int) GetPeerType() (value RequestPeerTypeClass) + GetMaxQuantity() (value int) }) { k.Text = from.GetText() k.ButtonID = from.GetButtonID() k.PeerType = from.GetPeerType() + k.MaxQuantity = from.GetMaxQuantity() } // TypeID returns type id in TL schema. @@ -2988,6 +2995,10 @@ func (k *KeyboardButtonRequestPeer) TypeInfo() tdp.Type { Name: "PeerType", SchemaName: "peer_type", }, + { + Name: "MaxQuantity", + SchemaName: "max_quantity", + }, } return typ } @@ -2995,7 +3006,7 @@ func (k *KeyboardButtonRequestPeer) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (k *KeyboardButtonRequestPeer) Encode(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't encode keyboardButtonRequestPeer#d0b468c as nil") + return fmt.Errorf("can't encode keyboardButtonRequestPeer#53d7bfd8 as nil") } b.PutID(KeyboardButtonRequestPeerTypeID) return k.EncodeBare(b) @@ -3004,26 +3015,27 @@ func (k *KeyboardButtonRequestPeer) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (k *KeyboardButtonRequestPeer) EncodeBare(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't encode keyboardButtonRequestPeer#d0b468c as nil") + return fmt.Errorf("can't encode keyboardButtonRequestPeer#53d7bfd8 as nil") } b.PutString(k.Text) b.PutInt(k.ButtonID) if k.PeerType == nil { - return fmt.Errorf("unable to encode keyboardButtonRequestPeer#d0b468c: field peer_type is nil") + return fmt.Errorf("unable to encode keyboardButtonRequestPeer#53d7bfd8: field peer_type is nil") } if err := k.PeerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode keyboardButtonRequestPeer#d0b468c: field peer_type: %w", err) + return fmt.Errorf("unable to encode keyboardButtonRequestPeer#53d7bfd8: field peer_type: %w", err) } + b.PutInt(k.MaxQuantity) return nil } // Decode implements bin.Decoder. func (k *KeyboardButtonRequestPeer) Decode(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't decode keyboardButtonRequestPeer#d0b468c to nil") + return fmt.Errorf("can't decode keyboardButtonRequestPeer#53d7bfd8 to nil") } if err := b.ConsumeID(KeyboardButtonRequestPeerTypeID); err != nil { - return fmt.Errorf("unable to decode keyboardButtonRequestPeer#d0b468c: %w", err) + return fmt.Errorf("unable to decode keyboardButtonRequestPeer#53d7bfd8: %w", err) } return k.DecodeBare(b) } @@ -3031,29 +3043,36 @@ func (k *KeyboardButtonRequestPeer) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (k *KeyboardButtonRequestPeer) DecodeBare(b *bin.Buffer) error { if k == nil { - return fmt.Errorf("can't decode keyboardButtonRequestPeer#d0b468c to nil") + return fmt.Errorf("can't decode keyboardButtonRequestPeer#53d7bfd8 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonRequestPeer#d0b468c: field text: %w", err) + return fmt.Errorf("unable to decode keyboardButtonRequestPeer#53d7bfd8: field text: %w", err) } k.Text = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode keyboardButtonRequestPeer#d0b468c: field button_id: %w", err) + return fmt.Errorf("unable to decode keyboardButtonRequestPeer#53d7bfd8: field button_id: %w", err) } k.ButtonID = value } { value, err := DecodeRequestPeerType(b) if err != nil { - return fmt.Errorf("unable to decode keyboardButtonRequestPeer#d0b468c: field peer_type: %w", err) + return fmt.Errorf("unable to decode keyboardButtonRequestPeer#53d7bfd8: field peer_type: %w", err) } k.PeerType = value } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode keyboardButtonRequestPeer#53d7bfd8: field max_quantity: %w", err) + } + k.MaxQuantity = value + } return nil } @@ -3081,6 +3100,14 @@ func (k *KeyboardButtonRequestPeer) GetPeerType() (value RequestPeerTypeClass) { return k.PeerType } +// GetMaxQuantity returns value of MaxQuantity field. +func (k *KeyboardButtonRequestPeer) GetMaxQuantity() (value int) { + if k == nil { + return + } + return k.MaxQuantity +} + // KeyboardButtonClassName is schema name of KeyboardButtonClass. const KeyboardButtonClassName = "KeyboardButton" @@ -3110,7 +3137,7 @@ const KeyboardButtonClassName = "KeyboardButton" // case *tg.KeyboardButtonUserProfile: // keyboardButtonUserProfile#308660c1 // case *tg.KeyboardButtonWebView: // keyboardButtonWebView#13767230 // case *tg.KeyboardButtonSimpleWebView: // keyboardButtonSimpleWebView#a0c0505c -// case *tg.KeyboardButtonRequestPeer: // keyboardButtonRequestPeer#d0b468c +// case *tg.KeyboardButtonRequestPeer: // keyboardButtonRequestPeer#53d7bfd8 // default: panic(v) // } type KeyboardButtonClass interface { @@ -3248,7 +3275,7 @@ func DecodeKeyboardButton(buf *bin.Buffer) (KeyboardButtonClass, error) { } return &v, nil case KeyboardButtonRequestPeerTypeID: - // Decoding keyboardButtonRequestPeer#d0b468c. + // Decoding keyboardButtonRequestPeer#53d7bfd8. v := KeyboardButtonRequestPeer{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode KeyboardButtonClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_media_area_coordinates_gen.go b/vendor/github.com/gotd/td/tg/tl_media_area_coordinates_gen.go index 49338a43..91269e1f 100644 --- a/vendor/github.com/gotd/td/tg/tl_media_area_coordinates_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_media_area_coordinates_gen.go @@ -32,18 +32,19 @@ var ( ) // MediaAreaCoordinates represents TL type `mediaAreaCoordinates#3d1ea4e`. +// Coordinates and size of a clicable rectangular area on top of a story. // // See https://core.telegram.org/constructor/mediaAreaCoordinates for reference. type MediaAreaCoordinates struct { - // X field of MediaAreaCoordinates. + // The abscissa of the rectangle's center, as a percentage of the media width (0-100). X float64 - // Y field of MediaAreaCoordinates. + // The ordinate of the rectangle's center, as a percentage of the media height (0-100). Y float64 - // W field of MediaAreaCoordinates. + // The width of the rectangle, as a percentage of the media width (0-100). W float64 - // H field of MediaAreaCoordinates. + // The height of the rectangle, as a percentage of the media height (0-100). H float64 - // Rotation field of MediaAreaCoordinates. + // Clockwise rotation angle of the rectangle, in degrees (0-360). Rotation float64 } diff --git a/vendor/github.com/gotd/td/tg/tl_media_area_gen.go b/vendor/github.com/gotd/td/tg/tl_media_area_gen.go index 44161396..a5d25f37 100644 --- a/vendor/github.com/gotd/td/tg/tl_media_area_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_media_area_gen.go @@ -32,22 +32,27 @@ var ( ) // MediaAreaVenue represents TL type `mediaAreaVenue#be82db9c`. +// Represents a location tag attached to a story¹, with additional venue information. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/mediaAreaVenue for reference. type MediaAreaVenue struct { - // Coordinates field of MediaAreaVenue. + // The size and location of the media area corresponding to the location sticker on top + // of the story media. Coordinates MediaAreaCoordinates - // Geo field of MediaAreaVenue. + // Coordinates of the venue Geo GeoPointClass - // Title field of MediaAreaVenue. + // Venue name Title string - // Address field of MediaAreaVenue. + // Address Address string - // Provider field of MediaAreaVenue. + // Venue provider: currently only "foursquare" needs to be supported. Provider string - // VenueID field of MediaAreaVenue. + // Venue ID in the provider's database VenueID string - // VenueType field of MediaAreaVenue. + // Venue type in the provider's database VenueType string } @@ -333,14 +338,27 @@ func (m *MediaAreaVenue) GetVenueType() (value string) { } // InputMediaAreaVenue represents TL type `inputMediaAreaVenue#b282217f`. +// Represents a location tag¹ attached to a story², with additional venue information. +// +// Links: +// 1. https://core.telegram.org/api/stories#media-areas +// 2. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/inputMediaAreaVenue for reference. type InputMediaAreaVenue struct { - // Coordinates field of InputMediaAreaVenue. + // The size and location of the media area corresponding to the location sticker on top + // of the story media. Coordinates MediaAreaCoordinates - // QueryID field of InputMediaAreaVenue. + // The query_id from messages.botResults¹, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/constructor/messages.botResults + // 2) https://core.telegram.org/api/stories#media-areas QueryID int64 - // ResultID field of InputMediaAreaVenue. + // The id of the chosen result, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/stories#media-areas ResultID string } @@ -521,12 +539,17 @@ func (i *InputMediaAreaVenue) GetResultID() (value string) { } // MediaAreaGeoPoint represents TL type `mediaAreaGeoPoint#df8b3b22`. +// Represents a geolocation tag attached to a story¹. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/mediaAreaGeoPoint for reference. type MediaAreaGeoPoint struct { - // Coordinates field of MediaAreaGeoPoint. + // The size and position of the media area corresponding to the location sticker on top + // of the story media. Coordinates MediaAreaCoordinates - // Geo field of MediaAreaGeoPoint. + // Coordinates of the geolocation tag. Geo GeoPointClass } @@ -687,18 +710,25 @@ func (m *MediaAreaGeoPoint) GetGeo() (value GeoPointClass) { } // MediaAreaSuggestedReaction represents TL type `mediaAreaSuggestedReaction#14455871`. +// Represents a reaction bubble. // // See https://core.telegram.org/constructor/mediaAreaSuggestedReaction for reference. type MediaAreaSuggestedReaction struct { - // Flags field of MediaAreaSuggestedReaction. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Dark field of MediaAreaSuggestedReaction. + // Whether the reaction bubble has a dark background. Dark bool - // Flipped field of MediaAreaSuggestedReaction. + // Whether the reaction bubble is mirrored (see here »¹ for more info). + // + // Links: + // 1) https://core.telegram.org/api/stories#reactions Flipped bool - // Coordinates field of MediaAreaSuggestedReaction. + // The coordinates of the media area corresponding to the reaction button. Coordinates MediaAreaCoordinates - // Reaction field of MediaAreaSuggestedReaction. + // The reaction that should be sent when this area is clicked. Reaction ReactionClass } @@ -940,6 +970,387 @@ func (m *MediaAreaSuggestedReaction) GetReaction() (value ReactionClass) { return m.Reaction } +// MediaAreaChannelPost represents TL type `mediaAreaChannelPost#770416af`. +// +// See https://core.telegram.org/constructor/mediaAreaChannelPost for reference. +type MediaAreaChannelPost struct { + // Coordinates field of MediaAreaChannelPost. + Coordinates MediaAreaCoordinates + // ChannelID field of MediaAreaChannelPost. + ChannelID int64 + // MsgID field of MediaAreaChannelPost. + MsgID int +} + +// MediaAreaChannelPostTypeID is TL type id of MediaAreaChannelPost. +const MediaAreaChannelPostTypeID = 0x770416af + +// construct implements constructor of MediaAreaClass. +func (m MediaAreaChannelPost) construct() MediaAreaClass { return &m } + +// Ensuring interfaces in compile-time for MediaAreaChannelPost. +var ( + _ bin.Encoder = &MediaAreaChannelPost{} + _ bin.Decoder = &MediaAreaChannelPost{} + _ bin.BareEncoder = &MediaAreaChannelPost{} + _ bin.BareDecoder = &MediaAreaChannelPost{} + + _ MediaAreaClass = &MediaAreaChannelPost{} +) + +func (m *MediaAreaChannelPost) Zero() bool { + if m == nil { + return true + } + if !(m.Coordinates.Zero()) { + return false + } + if !(m.ChannelID == 0) { + return false + } + if !(m.MsgID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MediaAreaChannelPost) String() string { + if m == nil { + return "MediaAreaChannelPost(nil)" + } + type Alias MediaAreaChannelPost + return fmt.Sprintf("MediaAreaChannelPost%+v", Alias(*m)) +} + +// FillFrom fills MediaAreaChannelPost from given interface. +func (m *MediaAreaChannelPost) FillFrom(from interface { + GetCoordinates() (value MediaAreaCoordinates) + GetChannelID() (value int64) + GetMsgID() (value int) +}) { + m.Coordinates = from.GetCoordinates() + m.ChannelID = from.GetChannelID() + m.MsgID = from.GetMsgID() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MediaAreaChannelPost) TypeID() uint32 { + return MediaAreaChannelPostTypeID +} + +// TypeName returns name of type in TL schema. +func (*MediaAreaChannelPost) TypeName() string { + return "mediaAreaChannelPost" +} + +// TypeInfo returns info about TL type. +func (m *MediaAreaChannelPost) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "mediaAreaChannelPost", + ID: MediaAreaChannelPostTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Coordinates", + SchemaName: "coordinates", + }, + { + Name: "ChannelID", + SchemaName: "channel_id", + }, + { + Name: "MsgID", + SchemaName: "msg_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MediaAreaChannelPost) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode mediaAreaChannelPost#770416af as nil") + } + b.PutID(MediaAreaChannelPostTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MediaAreaChannelPost) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode mediaAreaChannelPost#770416af as nil") + } + if err := m.Coordinates.Encode(b); err != nil { + return fmt.Errorf("unable to encode mediaAreaChannelPost#770416af: field coordinates: %w", err) + } + b.PutLong(m.ChannelID) + b.PutInt(m.MsgID) + return nil +} + +// Decode implements bin.Decoder. +func (m *MediaAreaChannelPost) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode mediaAreaChannelPost#770416af to nil") + } + if err := b.ConsumeID(MediaAreaChannelPostTypeID); err != nil { + return fmt.Errorf("unable to decode mediaAreaChannelPost#770416af: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MediaAreaChannelPost) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode mediaAreaChannelPost#770416af to nil") + } + { + if err := m.Coordinates.Decode(b); err != nil { + return fmt.Errorf("unable to decode mediaAreaChannelPost#770416af: field coordinates: %w", err) + } + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode mediaAreaChannelPost#770416af: field channel_id: %w", err) + } + m.ChannelID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode mediaAreaChannelPost#770416af: field msg_id: %w", err) + } + m.MsgID = value + } + return nil +} + +// GetCoordinates returns value of Coordinates field. +func (m *MediaAreaChannelPost) GetCoordinates() (value MediaAreaCoordinates) { + if m == nil { + return + } + return m.Coordinates +} + +// GetChannelID returns value of ChannelID field. +func (m *MediaAreaChannelPost) GetChannelID() (value int64) { + if m == nil { + return + } + return m.ChannelID +} + +// GetMsgID returns value of MsgID field. +func (m *MediaAreaChannelPost) GetMsgID() (value int) { + if m == nil { + return + } + return m.MsgID +} + +// InputMediaAreaChannelPost represents TL type `inputMediaAreaChannelPost#2271f2bf`. +// +// See https://core.telegram.org/constructor/inputMediaAreaChannelPost for reference. +type InputMediaAreaChannelPost struct { + // Coordinates field of InputMediaAreaChannelPost. + Coordinates MediaAreaCoordinates + // Channel field of InputMediaAreaChannelPost. + Channel InputChannelClass + // MsgID field of InputMediaAreaChannelPost. + MsgID int +} + +// InputMediaAreaChannelPostTypeID is TL type id of InputMediaAreaChannelPost. +const InputMediaAreaChannelPostTypeID = 0x2271f2bf + +// construct implements constructor of MediaAreaClass. +func (i InputMediaAreaChannelPost) construct() MediaAreaClass { return &i } + +// Ensuring interfaces in compile-time for InputMediaAreaChannelPost. +var ( + _ bin.Encoder = &InputMediaAreaChannelPost{} + _ bin.Decoder = &InputMediaAreaChannelPost{} + _ bin.BareEncoder = &InputMediaAreaChannelPost{} + _ bin.BareDecoder = &InputMediaAreaChannelPost{} + + _ MediaAreaClass = &InputMediaAreaChannelPost{} +) + +func (i *InputMediaAreaChannelPost) Zero() bool { + if i == nil { + return true + } + if !(i.Coordinates.Zero()) { + return false + } + if !(i.Channel == nil) { + return false + } + if !(i.MsgID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputMediaAreaChannelPost) String() string { + if i == nil { + return "InputMediaAreaChannelPost(nil)" + } + type Alias InputMediaAreaChannelPost + return fmt.Sprintf("InputMediaAreaChannelPost%+v", Alias(*i)) +} + +// FillFrom fills InputMediaAreaChannelPost from given interface. +func (i *InputMediaAreaChannelPost) FillFrom(from interface { + GetCoordinates() (value MediaAreaCoordinates) + GetChannel() (value InputChannelClass) + GetMsgID() (value int) +}) { + i.Coordinates = from.GetCoordinates() + i.Channel = from.GetChannel() + i.MsgID = from.GetMsgID() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputMediaAreaChannelPost) TypeID() uint32 { + return InputMediaAreaChannelPostTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputMediaAreaChannelPost) TypeName() string { + return "inputMediaAreaChannelPost" +} + +// TypeInfo returns info about TL type. +func (i *InputMediaAreaChannelPost) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputMediaAreaChannelPost", + ID: InputMediaAreaChannelPostTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Coordinates", + SchemaName: "coordinates", + }, + { + Name: "Channel", + SchemaName: "channel", + }, + { + Name: "MsgID", + SchemaName: "msg_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputMediaAreaChannelPost) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMediaAreaChannelPost#2271f2bf as nil") + } + b.PutID(InputMediaAreaChannelPostTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputMediaAreaChannelPost) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMediaAreaChannelPost#2271f2bf as nil") + } + if err := i.Coordinates.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputMediaAreaChannelPost#2271f2bf: field coordinates: %w", err) + } + if i.Channel == nil { + return fmt.Errorf("unable to encode inputMediaAreaChannelPost#2271f2bf: field channel is nil") + } + if err := i.Channel.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputMediaAreaChannelPost#2271f2bf: field channel: %w", err) + } + b.PutInt(i.MsgID) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputMediaAreaChannelPost) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMediaAreaChannelPost#2271f2bf to nil") + } + if err := b.ConsumeID(InputMediaAreaChannelPostTypeID); err != nil { + return fmt.Errorf("unable to decode inputMediaAreaChannelPost#2271f2bf: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputMediaAreaChannelPost) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMediaAreaChannelPost#2271f2bf to nil") + } + { + if err := i.Coordinates.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputMediaAreaChannelPost#2271f2bf: field coordinates: %w", err) + } + } + { + value, err := DecodeInputChannel(b) + if err != nil { + return fmt.Errorf("unable to decode inputMediaAreaChannelPost#2271f2bf: field channel: %w", err) + } + i.Channel = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputMediaAreaChannelPost#2271f2bf: field msg_id: %w", err) + } + i.MsgID = value + } + return nil +} + +// GetCoordinates returns value of Coordinates field. +func (i *InputMediaAreaChannelPost) GetCoordinates() (value MediaAreaCoordinates) { + if i == nil { + return + } + return i.Coordinates +} + +// GetChannel returns value of Channel field. +func (i *InputMediaAreaChannelPost) GetChannel() (value InputChannelClass) { + if i == nil { + return + } + return i.Channel +} + +// GetMsgID returns value of MsgID field. +func (i *InputMediaAreaChannelPost) GetMsgID() (value int) { + if i == nil { + return + } + return i.MsgID +} + // MediaAreaClassName is schema name of MediaAreaClass. const MediaAreaClassName = "MediaArea" @@ -958,6 +1369,8 @@ const MediaAreaClassName = "MediaArea" // case *tg.InputMediaAreaVenue: // inputMediaAreaVenue#b282217f // case *tg.MediaAreaGeoPoint: // mediaAreaGeoPoint#df8b3b22 // case *tg.MediaAreaSuggestedReaction: // mediaAreaSuggestedReaction#14455871 +// case *tg.MediaAreaChannelPost: // mediaAreaChannelPost#770416af +// case *tg.InputMediaAreaChannelPost: // inputMediaAreaChannelPost#2271f2bf // default: panic(v) // } type MediaAreaClass interface { @@ -978,7 +1391,8 @@ type MediaAreaClass interface { // Zero returns true if current object has a zero value. Zero() bool - // Coordinates field of MediaAreaVenue. + // The size and location of the media area corresponding to the location sticker on top + // of the story media. GetCoordinates() (value MediaAreaCoordinates) } @@ -1017,6 +1431,20 @@ func DecodeMediaArea(buf *bin.Buffer) (MediaAreaClass, error) { return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", err) } return &v, nil + case MediaAreaChannelPostTypeID: + // Decoding mediaAreaChannelPost#770416af. + v := MediaAreaChannelPost{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", err) + } + return &v, nil + case InputMediaAreaChannelPostTypeID: + // Decoding inputMediaAreaChannelPost#2271f2bf. + v := InputMediaAreaChannelPost{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode MediaAreaClass: %w", bin.NewUnexpectedID(id)) } diff --git a/vendor/github.com/gotd/td/tg/tl_media_area_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_media_area_slices_gen.go index 0a293e77..082b0cbe 100644 --- a/vendor/github.com/gotd/td/tg/tl_media_area_slices_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_media_area_slices_gen.go @@ -168,6 +168,32 @@ func (s MediaAreaClassArray) AsMediaAreaSuggestedReaction() (to MediaAreaSuggest return to } +// AsMediaAreaChannelPost returns copy with only MediaAreaChannelPost constructors. +func (s MediaAreaClassArray) AsMediaAreaChannelPost() (to MediaAreaChannelPostArray) { + for _, elem := range s { + value, ok := elem.(*MediaAreaChannelPost) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsInputMediaAreaChannelPost returns copy with only InputMediaAreaChannelPost constructors. +func (s MediaAreaClassArray) AsInputMediaAreaChannelPost() (to InputMediaAreaChannelPostArray) { + for _, elem := range s { + value, ok := elem.(*InputMediaAreaChannelPost) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + // MediaAreaVenueArray is adapter for slice of MediaAreaVenue. type MediaAreaVenueArray []MediaAreaVenue @@ -495,3 +521,167 @@ func (s *MediaAreaSuggestedReactionArray) Pop() (v MediaAreaSuggestedReaction, o return v, true } + +// MediaAreaChannelPostArray is adapter for slice of MediaAreaChannelPost. +type MediaAreaChannelPostArray []MediaAreaChannelPost + +// Sort sorts slice of MediaAreaChannelPost. +func (s MediaAreaChannelPostArray) Sort(less func(a, b MediaAreaChannelPost) bool) MediaAreaChannelPostArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of MediaAreaChannelPost. +func (s MediaAreaChannelPostArray) SortStable(less func(a, b MediaAreaChannelPost) bool) MediaAreaChannelPostArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of MediaAreaChannelPost. +func (s MediaAreaChannelPostArray) Retain(keep func(x MediaAreaChannelPost) bool) MediaAreaChannelPostArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s MediaAreaChannelPostArray) First() (v MediaAreaChannelPost, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s MediaAreaChannelPostArray) Last() (v MediaAreaChannelPost, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *MediaAreaChannelPostArray) PopFirst() (v MediaAreaChannelPost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero MediaAreaChannelPost + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *MediaAreaChannelPostArray) Pop() (v MediaAreaChannelPost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// InputMediaAreaChannelPostArray is adapter for slice of InputMediaAreaChannelPost. +type InputMediaAreaChannelPostArray []InputMediaAreaChannelPost + +// Sort sorts slice of InputMediaAreaChannelPost. +func (s InputMediaAreaChannelPostArray) Sort(less func(a, b InputMediaAreaChannelPost) bool) InputMediaAreaChannelPostArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of InputMediaAreaChannelPost. +func (s InputMediaAreaChannelPostArray) SortStable(less func(a, b InputMediaAreaChannelPost) bool) InputMediaAreaChannelPostArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of InputMediaAreaChannelPost. +func (s InputMediaAreaChannelPostArray) Retain(keep func(x InputMediaAreaChannelPost) bool) InputMediaAreaChannelPostArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s InputMediaAreaChannelPostArray) First() (v InputMediaAreaChannelPost, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s InputMediaAreaChannelPostArray) Last() (v InputMediaAreaChannelPost, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *InputMediaAreaChannelPostArray) PopFirst() (v InputMediaAreaChannelPost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero InputMediaAreaChannelPost + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *InputMediaAreaChannelPostArray) Pop() (v InputMediaAreaChannelPost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_message_action_gen.go b/vendor/github.com/gotd/td/tg/tl_message_action_gen.go index b05b6e39..020c1bb9 100644 --- a/vendor/github.com/gotd/td/tg/tl_message_action_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_message_action_gen.go @@ -3181,7 +3181,10 @@ type MessageActionBotAllowed struct { // Links: // 1) https://core.telegram.org/api/bots/attach AttachMenu bool - // FromRequest field of MessageActionBotAllowed. + // We have allowed the bot to send us messages using bots.allowSendMessage »¹. + // + // Links: + // 1) https://core.telegram.org/method/bots.allowSendMessage FromRequest bool // We have authorized the bot to send us messages by logging into a website via Telegram // Login »¹; this field contains the domain name of the website on which the user has @@ -3192,7 +3195,7 @@ type MessageActionBotAllowed struct { // // Use SetDomain and GetDomain helpers. Domain string - // We have authorized the bot to send us messages by opening the specified bot web app¹. + // We have authorized the bot to send us messages by opening the specified bot mini app¹. // // Links: // 1) https://core.telegram.org/api/bots/webapps @@ -5113,7 +5116,7 @@ func (m *MessageActionChatJoinedByRequest) DecodeBare(b *bin.Buffer) error { } // MessageActionWebViewDataSentMe represents TL type `messageActionWebViewDataSentMe#47dd8079`. -// Data from an opened reply keyboard bot web app¹ was relayed to the bot that owns it +// Data from an opened reply keyboard bot mini app¹ was relayed to the bot that owns it // (bot side service message). // // Links: @@ -5282,7 +5285,7 @@ func (m *MessageActionWebViewDataSentMe) GetData() (value string) { } // MessageActionWebViewDataSent represents TL type `messageActionWebViewDataSent#b4c38cb5`. -// Data from an opened reply keyboard bot web app¹ was relayed to the bot that owns it +// Data from an opened reply keyboard bot mini app¹ was relayed to the bot that owns it // (user side service message). // Clients should display a service message with the text Data from the «$text» button // was transferred to the bot. @@ -6449,7 +6452,7 @@ func (m *MessageActionSuggestProfilePhoto) GetPhoto() (value PhotoClass) { return m.Photo } -// MessageActionRequestedPeer represents TL type `messageActionRequestedPeer#fe77345d`. +// MessageActionRequestedPeer represents TL type `messageActionRequestedPeer#31518e9b`. // Contains info about a peer that the user shared with the bot after clicking on a // keyboardButtonRequestPeer¹ button. // @@ -6463,12 +6466,12 @@ type MessageActionRequestedPeer struct { // Links: // 1) https://core.telegram.org/constructor/keyboardButtonRequestPeer ButtonID int - // The shared peer - Peer PeerClass + // Peers field of MessageActionRequestedPeer. + Peers []PeerClass } // MessageActionRequestedPeerTypeID is TL type id of MessageActionRequestedPeer. -const MessageActionRequestedPeerTypeID = 0xfe77345d +const MessageActionRequestedPeerTypeID = 0x31518e9b // construct implements constructor of MessageActionClass. func (m MessageActionRequestedPeer) construct() MessageActionClass { return &m } @@ -6490,7 +6493,7 @@ func (m *MessageActionRequestedPeer) Zero() bool { if !(m.ButtonID == 0) { return false } - if !(m.Peer == nil) { + if !(m.Peers == nil) { return false } @@ -6509,10 +6512,10 @@ func (m *MessageActionRequestedPeer) String() string { // FillFrom fills MessageActionRequestedPeer from given interface. func (m *MessageActionRequestedPeer) FillFrom(from interface { GetButtonID() (value int) - GetPeer() (value PeerClass) + GetPeers() (value []PeerClass) }) { m.ButtonID = from.GetButtonID() - m.Peer = from.GetPeer() + m.Peers = from.GetPeers() } // TypeID returns type id in TL schema. @@ -6543,8 +6546,8 @@ func (m *MessageActionRequestedPeer) TypeInfo() tdp.Type { SchemaName: "button_id", }, { - Name: "Peer", - SchemaName: "peer", + Name: "Peers", + SchemaName: "peers", }, } return typ @@ -6553,7 +6556,7 @@ func (m *MessageActionRequestedPeer) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageActionRequestedPeer) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionRequestedPeer#fe77345d as nil") + return fmt.Errorf("can't encode messageActionRequestedPeer#31518e9b as nil") } b.PutID(MessageActionRequestedPeerTypeID) return m.EncodeBare(b) @@ -6562,14 +6565,17 @@ func (m *MessageActionRequestedPeer) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionRequestedPeer) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionRequestedPeer#fe77345d as nil") + return fmt.Errorf("can't encode messageActionRequestedPeer#31518e9b as nil") } b.PutInt(m.ButtonID) - if m.Peer == nil { - return fmt.Errorf("unable to encode messageActionRequestedPeer#fe77345d: field peer is nil") - } - if err := m.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageActionRequestedPeer#fe77345d: field peer: %w", err) + b.PutVectorHeader(len(m.Peers)) + for idx, v := range m.Peers { + if v == nil { + return fmt.Errorf("unable to encode messageActionRequestedPeer#31518e9b: field peers element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageActionRequestedPeer#31518e9b: field peers element with index %d: %w", idx, err) + } } return nil } @@ -6577,10 +6583,10 @@ func (m *MessageActionRequestedPeer) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageActionRequestedPeer) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionRequestedPeer#fe77345d to nil") + return fmt.Errorf("can't decode messageActionRequestedPeer#31518e9b to nil") } if err := b.ConsumeID(MessageActionRequestedPeerTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionRequestedPeer#fe77345d: %w", err) + return fmt.Errorf("unable to decode messageActionRequestedPeer#31518e9b: %w", err) } return m.DecodeBare(b) } @@ -6588,21 +6594,31 @@ func (m *MessageActionRequestedPeer) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionRequestedPeer) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionRequestedPeer#fe77345d to nil") + return fmt.Errorf("can't decode messageActionRequestedPeer#31518e9b to nil") } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageActionRequestedPeer#fe77345d: field button_id: %w", err) + return fmt.Errorf("unable to decode messageActionRequestedPeer#31518e9b: field button_id: %w", err) } m.ButtonID = value } { - value, err := DecodePeer(b) + headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageActionRequestedPeer#fe77345d: field peer: %w", err) + return fmt.Errorf("unable to decode messageActionRequestedPeer#31518e9b: field peers: %w", err) + } + + if headerLen > 0 { + m.Peers = make([]PeerClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode messageActionRequestedPeer#31518e9b: field peers: %w", err) + } + m.Peers = append(m.Peers, value) } - m.Peer = value } return nil } @@ -6615,15 +6631,20 @@ func (m *MessageActionRequestedPeer) GetButtonID() (value int) { return m.ButtonID } -// GetPeer returns value of Peer field. -func (m *MessageActionRequestedPeer) GetPeer() (value PeerClass) { +// GetPeers returns value of Peers field. +func (m *MessageActionRequestedPeer) GetPeers() (value []PeerClass) { if m == nil { return } - return m.Peer + return m.Peers } -// MessageActionSetChatWallPaper represents TL type `messageActionSetChatWallPaper#bc44a927`. +// MapPeers returns field Peers wrapped in PeerClassArray helper. +func (m *MessageActionRequestedPeer) MapPeers() (value PeerClassArray) { + return PeerClassArray(m.Peers) +} + +// MessageActionSetChatWallPaper represents TL type `messageActionSetChatWallPaper#5060a3f4`. // The wallpaper »¹ of the current chat was changed. // // Links: @@ -6631,6 +6652,27 @@ func (m *MessageActionRequestedPeer) GetPeer() (value PeerClass) { // // See https://core.telegram.org/constructor/messageActionSetChatWallPaper for reference. type MessageActionSetChatWallPaper struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // If set, indicates the user applied a wallpaper »¹ previously sent by the other user + // in a messageActionSetChatWallPaper² message. + // + // Links: + // 1) https://core.telegram.org/api/wallpapers + // 2) https://core.telegram.org/constructor/messageActionSetChatWallPaper + Same bool + // If set, indicates the wallpaper was forcefully applied for both sides, without + // explicit confirmation from the other side. If the message is incoming, and we did not + // like the new wallpaper the other user has chosen for us, we can re-set our previous + // wallpaper just on our side, by invoking messages.setChatWallPaper¹, providing only + // the revert flag (and obviously the peer parameter). + // + // Links: + // 1) https://core.telegram.org/method/messages.setChatWallPaper + ForBoth bool // New wallpaper¹ // // Links: @@ -6639,7 +6681,7 @@ type MessageActionSetChatWallPaper struct { } // MessageActionSetChatWallPaperTypeID is TL type id of MessageActionSetChatWallPaper. -const MessageActionSetChatWallPaperTypeID = 0xbc44a927 +const MessageActionSetChatWallPaperTypeID = 0x5060a3f4 // construct implements constructor of MessageActionClass. func (m MessageActionSetChatWallPaper) construct() MessageActionClass { return &m } @@ -6658,6 +6700,15 @@ func (m *MessageActionSetChatWallPaper) Zero() bool { if m == nil { return true } + if !(m.Flags.Zero()) { + return false + } + if !(m.Same == false) { + return false + } + if !(m.ForBoth == false) { + return false + } if !(m.Wallpaper == nil) { return false } @@ -6676,8 +6727,12 @@ func (m *MessageActionSetChatWallPaper) String() string { // FillFrom fills MessageActionSetChatWallPaper from given interface. func (m *MessageActionSetChatWallPaper) FillFrom(from interface { + GetSame() (value bool) + GetForBoth() (value bool) GetWallpaper() (value WallPaperClass) }) { + m.Same = from.GetSame() + m.ForBoth = from.GetForBoth() m.Wallpaper = from.GetWallpaper() } @@ -6704,6 +6759,16 @@ func (m *MessageActionSetChatWallPaper) TypeInfo() tdp.Type { return typ } typ.Fields = []tdp.Field{ + { + Name: "Same", + SchemaName: "same", + Null: !m.Flags.Has(0), + }, + { + Name: "ForBoth", + SchemaName: "for_both", + Null: !m.Flags.Has(1), + }, { Name: "Wallpaper", SchemaName: "wallpaper", @@ -6712,10 +6777,20 @@ func (m *MessageActionSetChatWallPaper) TypeInfo() tdp.Type { return typ } +// SetFlags sets flags for non-zero fields. +func (m *MessageActionSetChatWallPaper) SetFlags() { + if !(m.Same == false) { + m.Flags.Set(0) + } + if !(m.ForBoth == false) { + m.Flags.Set(1) + } +} + // Encode implements bin.Encoder. func (m *MessageActionSetChatWallPaper) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionSetChatWallPaper#bc44a927 as nil") + return fmt.Errorf("can't encode messageActionSetChatWallPaper#5060a3f4 as nil") } b.PutID(MessageActionSetChatWallPaperTypeID) return m.EncodeBare(b) @@ -6724,13 +6799,17 @@ func (m *MessageActionSetChatWallPaper) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionSetChatWallPaper) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionSetChatWallPaper#bc44a927 as nil") + return fmt.Errorf("can't encode messageActionSetChatWallPaper#5060a3f4 as nil") + } + m.SetFlags() + if err := m.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageActionSetChatWallPaper#5060a3f4: field flags: %w", err) } if m.Wallpaper == nil { - return fmt.Errorf("unable to encode messageActionSetChatWallPaper#bc44a927: field wallpaper is nil") + return fmt.Errorf("unable to encode messageActionSetChatWallPaper#5060a3f4: field wallpaper is nil") } if err := m.Wallpaper.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageActionSetChatWallPaper#bc44a927: field wallpaper: %w", err) + return fmt.Errorf("unable to encode messageActionSetChatWallPaper#5060a3f4: field wallpaper: %w", err) } return nil } @@ -6738,10 +6817,10 @@ func (m *MessageActionSetChatWallPaper) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageActionSetChatWallPaper) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionSetChatWallPaper#bc44a927 to nil") + return fmt.Errorf("can't decode messageActionSetChatWallPaper#5060a3f4 to nil") } if err := b.ConsumeID(MessageActionSetChatWallPaperTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionSetChatWallPaper#bc44a927: %w", err) + return fmt.Errorf("unable to decode messageActionSetChatWallPaper#5060a3f4: %w", err) } return m.DecodeBare(b) } @@ -6749,18 +6828,63 @@ func (m *MessageActionSetChatWallPaper) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionSetChatWallPaper) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionSetChatWallPaper#bc44a927 to nil") + return fmt.Errorf("can't decode messageActionSetChatWallPaper#5060a3f4 to nil") } + { + if err := m.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode messageActionSetChatWallPaper#5060a3f4: field flags: %w", err) + } + } + m.Same = m.Flags.Has(0) + m.ForBoth = m.Flags.Has(1) { value, err := DecodeWallPaper(b) if err != nil { - return fmt.Errorf("unable to decode messageActionSetChatWallPaper#bc44a927: field wallpaper: %w", err) + return fmt.Errorf("unable to decode messageActionSetChatWallPaper#5060a3f4: field wallpaper: %w", err) } m.Wallpaper = value } return nil } +// SetSame sets value of Same conditional field. +func (m *MessageActionSetChatWallPaper) SetSame(value bool) { + if value { + m.Flags.Set(0) + m.Same = true + } else { + m.Flags.Unset(0) + m.Same = false + } +} + +// GetSame returns value of Same conditional field. +func (m *MessageActionSetChatWallPaper) GetSame() (value bool) { + if m == nil { + return + } + return m.Flags.Has(0) +} + +// SetForBoth sets value of ForBoth conditional field. +func (m *MessageActionSetChatWallPaper) SetForBoth(value bool) { + if value { + m.Flags.Set(1) + m.ForBoth = true + } else { + m.Flags.Unset(1) + m.ForBoth = false + } +} + +// GetForBoth returns value of ForBoth conditional field. +func (m *MessageActionSetChatWallPaper) GetForBoth() (value bool) { + if m == nil { + return + } + return m.Flags.Has(1) +} + // GetWallpaper returns value of Wallpaper field. func (m *MessageActionSetChatWallPaper) GetWallpaper() (value WallPaperClass) { if m == nil { @@ -6769,176 +6893,70 @@ func (m *MessageActionSetChatWallPaper) GetWallpaper() (value WallPaperClass) { return m.Wallpaper } -// MessageActionSetSameChatWallPaper represents TL type `messageActionSetSameChatWallPaper#c0787d6d`. -// The user applied a wallpaper »¹ previously sent by the other user in a -// messageActionSetChatWallPaper² message. +// MessageActionGiftCode represents TL type `messageActionGiftCode#678c2e09`. +// Contains a Telegram Premium giftcode link¹. // // Links: -// 1. https://core.telegram.org/api/wallpapers -// 2. https://core.telegram.org/constructor/messageActionSetChatWallPaper -// -// See https://core.telegram.org/constructor/messageActionSetSameChatWallPaper for reference. -type MessageActionSetSameChatWallPaper struct { - // The wallpaper¹ - // - // Links: - // 1) https://core.telegram.org/api/wallpapers - Wallpaper WallPaperClass -} - -// MessageActionSetSameChatWallPaperTypeID is TL type id of MessageActionSetSameChatWallPaper. -const MessageActionSetSameChatWallPaperTypeID = 0xc0787d6d - -// construct implements constructor of MessageActionClass. -func (m MessageActionSetSameChatWallPaper) construct() MessageActionClass { return &m } - -// Ensuring interfaces in compile-time for MessageActionSetSameChatWallPaper. -var ( - _ bin.Encoder = &MessageActionSetSameChatWallPaper{} - _ bin.Decoder = &MessageActionSetSameChatWallPaper{} - _ bin.BareEncoder = &MessageActionSetSameChatWallPaper{} - _ bin.BareDecoder = &MessageActionSetSameChatWallPaper{} - - _ MessageActionClass = &MessageActionSetSameChatWallPaper{} -) - -func (m *MessageActionSetSameChatWallPaper) Zero() bool { - if m == nil { - return true - } - if !(m.Wallpaper == nil) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageActionSetSameChatWallPaper) String() string { - if m == nil { - return "MessageActionSetSameChatWallPaper(nil)" - } - type Alias MessageActionSetSameChatWallPaper - return fmt.Sprintf("MessageActionSetSameChatWallPaper%+v", Alias(*m)) -} - -// FillFrom fills MessageActionSetSameChatWallPaper from given interface. -func (m *MessageActionSetSameChatWallPaper) FillFrom(from interface { - GetWallpaper() (value WallPaperClass) -}) { - m.Wallpaper = from.GetWallpaper() -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageActionSetSameChatWallPaper) TypeID() uint32 { - return MessageActionSetSameChatWallPaperTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageActionSetSameChatWallPaper) TypeName() string { - return "messageActionSetSameChatWallPaper" -} - -// TypeInfo returns info about TL type. -func (m *MessageActionSetSameChatWallPaper) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageActionSetSameChatWallPaper", - ID: MessageActionSetSameChatWallPaperTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Wallpaper", - SchemaName: "wallpaper", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageActionSetSameChatWallPaper) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageActionSetSameChatWallPaper#c0787d6d as nil") - } - b.PutID(MessageActionSetSameChatWallPaperTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageActionSetSameChatWallPaper) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageActionSetSameChatWallPaper#c0787d6d as nil") - } - if m.Wallpaper == nil { - return fmt.Errorf("unable to encode messageActionSetSameChatWallPaper#c0787d6d: field wallpaper is nil") - } - if err := m.Wallpaper.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageActionSetSameChatWallPaper#c0787d6d: field wallpaper: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageActionSetSameChatWallPaper) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageActionSetSameChatWallPaper#c0787d6d to nil") - } - if err := b.ConsumeID(MessageActionSetSameChatWallPaperTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionSetSameChatWallPaper#c0787d6d: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageActionSetSameChatWallPaper) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageActionSetSameChatWallPaper#c0787d6d to nil") - } - { - value, err := DecodeWallPaper(b) - if err != nil { - return fmt.Errorf("unable to decode messageActionSetSameChatWallPaper#c0787d6d: field wallpaper: %w", err) - } - m.Wallpaper = value - } - return nil -} - -// GetWallpaper returns value of Wallpaper field. -func (m *MessageActionSetSameChatWallPaper) GetWallpaper() (value WallPaperClass) { - if m == nil { - return - } - return m.Wallpaper -} - -// MessageActionGiftCode represents TL type `messageActionGiftCode#d2cfdb0e`. +// 1. https://core.telegram.org/api/links#premium-giftcode-links // // See https://core.telegram.org/constructor/messageActionGiftCode for reference. type MessageActionGiftCode struct { - // Flags field of MessageActionGiftCode. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ViaGiveaway field of MessageActionGiftCode. + // If set, this gift code was received from a giveaway »¹ started by a channel we're + // subscribed to. + // + // Links: + // 1) https://core.telegram.org/api/giveaways ViaGiveaway bool - // Unclaimed field of MessageActionGiftCode. + // If set, the link was not redeemed¹ yet. + // + // Links: + // 1) https://core.telegram.org/api/links#premium-giftcode-links Unclaimed bool - // BoostPeer field of MessageActionGiftCode. + // Identifier of the channel that created the gift code either directly or through a + // giveaway¹: if we import this giftcode link, we will also automatically boost² this + // channel. + // + // Links: + // 1) https://core.telegram.org/api/giveaways + // 2) https://core.telegram.org/api/boost // // Use SetBoostPeer and GetBoostPeer helpers. BoostPeer PeerClass - // Months field of MessageActionGiftCode. + // Duration in months of the gifted Telegram Premium subscription¹. + // + // Links: + // 1) https://core.telegram.org/api/premium Months int - // Slug field of MessageActionGiftCode. + // Slug of the Telegram Premium giftcode link¹ + // + // Links: + // 1) https://core.telegram.org/api/links#premium-giftcode-links Slug string + // Currency field of MessageActionGiftCode. + // + // Use SetCurrency and GetCurrency helpers. + Currency string + // Amount field of MessageActionGiftCode. + // + // Use SetAmount and GetAmount helpers. + Amount int64 + // CryptoCurrency field of MessageActionGiftCode. + // + // Use SetCryptoCurrency and GetCryptoCurrency helpers. + CryptoCurrency string + // CryptoAmount field of MessageActionGiftCode. + // + // Use SetCryptoAmount and GetCryptoAmount helpers. + CryptoAmount int64 } // MessageActionGiftCodeTypeID is TL type id of MessageActionGiftCode. -const MessageActionGiftCodeTypeID = 0xd2cfdb0e +const MessageActionGiftCodeTypeID = 0x678c2e09 // construct implements constructor of MessageActionClass. func (m MessageActionGiftCode) construct() MessageActionClass { return &m } @@ -6975,6 +6993,18 @@ func (m *MessageActionGiftCode) Zero() bool { if !(m.Slug == "") { return false } + if !(m.Currency == "") { + return false + } + if !(m.Amount == 0) { + return false + } + if !(m.CryptoCurrency == "") { + return false + } + if !(m.CryptoAmount == 0) { + return false + } return true } @@ -6995,6 +7025,10 @@ func (m *MessageActionGiftCode) FillFrom(from interface { GetBoostPeer() (value PeerClass, ok bool) GetMonths() (value int) GetSlug() (value string) + GetCurrency() (value string, ok bool) + GetAmount() (value int64, ok bool) + GetCryptoCurrency() (value string, ok bool) + GetCryptoAmount() (value int64, ok bool) }) { m.ViaGiveaway = from.GetViaGiveaway() m.Unclaimed = from.GetUnclaimed() @@ -7004,6 +7038,22 @@ func (m *MessageActionGiftCode) FillFrom(from interface { m.Months = from.GetMonths() m.Slug = from.GetSlug() + if val, ok := from.GetCurrency(); ok { + m.Currency = val + } + + if val, ok := from.GetAmount(); ok { + m.Amount = val + } + + if val, ok := from.GetCryptoCurrency(); ok { + m.CryptoCurrency = val + } + + if val, ok := from.GetCryptoAmount(); ok { + m.CryptoAmount = val + } + } // TypeID returns type id in TL schema. @@ -7052,6 +7102,26 @@ func (m *MessageActionGiftCode) TypeInfo() tdp.Type { Name: "Slug", SchemaName: "slug", }, + { + Name: "Currency", + SchemaName: "currency", + Null: !m.Flags.Has(2), + }, + { + Name: "Amount", + SchemaName: "amount", + Null: !m.Flags.Has(2), + }, + { + Name: "CryptoCurrency", + SchemaName: "crypto_currency", + Null: !m.Flags.Has(3), + }, + { + Name: "CryptoAmount", + SchemaName: "crypto_amount", + Null: !m.Flags.Has(3), + }, } return typ } @@ -7067,12 +7137,24 @@ func (m *MessageActionGiftCode) SetFlags() { if !(m.BoostPeer == nil) { m.Flags.Set(1) } + if !(m.Currency == "") { + m.Flags.Set(2) + } + if !(m.Amount == 0) { + m.Flags.Set(2) + } + if !(m.CryptoCurrency == "") { + m.Flags.Set(3) + } + if !(m.CryptoAmount == 0) { + m.Flags.Set(3) + } } // Encode implements bin.Encoder. func (m *MessageActionGiftCode) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionGiftCode#d2cfdb0e as nil") + return fmt.Errorf("can't encode messageActionGiftCode#678c2e09 as nil") } b.PutID(MessageActionGiftCodeTypeID) return m.EncodeBare(b) @@ -7081,32 +7163,44 @@ func (m *MessageActionGiftCode) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageActionGiftCode) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageActionGiftCode#d2cfdb0e as nil") + return fmt.Errorf("can't encode messageActionGiftCode#678c2e09 as nil") } m.SetFlags() if err := m.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageActionGiftCode#d2cfdb0e: field flags: %w", err) + return fmt.Errorf("unable to encode messageActionGiftCode#678c2e09: field flags: %w", err) } if m.Flags.Has(1) { if m.BoostPeer == nil { - return fmt.Errorf("unable to encode messageActionGiftCode#d2cfdb0e: field boost_peer is nil") + return fmt.Errorf("unable to encode messageActionGiftCode#678c2e09: field boost_peer is nil") } if err := m.BoostPeer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageActionGiftCode#d2cfdb0e: field boost_peer: %w", err) + return fmt.Errorf("unable to encode messageActionGiftCode#678c2e09: field boost_peer: %w", err) } } b.PutInt(m.Months) b.PutString(m.Slug) + if m.Flags.Has(2) { + b.PutString(m.Currency) + } + if m.Flags.Has(2) { + b.PutLong(m.Amount) + } + if m.Flags.Has(3) { + b.PutString(m.CryptoCurrency) + } + if m.Flags.Has(3) { + b.PutLong(m.CryptoAmount) + } return nil } // Decode implements bin.Decoder. func (m *MessageActionGiftCode) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionGiftCode#d2cfdb0e to nil") + return fmt.Errorf("can't decode messageActionGiftCode#678c2e09 to nil") } if err := b.ConsumeID(MessageActionGiftCodeTypeID); err != nil { - return fmt.Errorf("unable to decode messageActionGiftCode#d2cfdb0e: %w", err) + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: %w", err) } return m.DecodeBare(b) } @@ -7114,11 +7208,11 @@ func (m *MessageActionGiftCode) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageActionGiftCode) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageActionGiftCode#d2cfdb0e to nil") + return fmt.Errorf("can't decode messageActionGiftCode#678c2e09 to nil") } { if err := m.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageActionGiftCode#d2cfdb0e: field flags: %w", err) + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field flags: %w", err) } } m.ViaGiveaway = m.Flags.Has(0) @@ -7126,24 +7220,52 @@ func (m *MessageActionGiftCode) DecodeBare(b *bin.Buffer) error { if m.Flags.Has(1) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode messageActionGiftCode#d2cfdb0e: field boost_peer: %w", err) + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field boost_peer: %w", err) } m.BoostPeer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageActionGiftCode#d2cfdb0e: field months: %w", err) + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field months: %w", err) } m.Months = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageActionGiftCode#d2cfdb0e: field slug: %w", err) + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field slug: %w", err) } m.Slug = value } + if m.Flags.Has(2) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field currency: %w", err) + } + m.Currency = value + } + if m.Flags.Has(2) { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field amount: %w", err) + } + m.Amount = value + } + if m.Flags.Has(3) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field crypto_currency: %w", err) + } + m.CryptoCurrency = value + } + if m.Flags.Has(3) { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode messageActionGiftCode#678c2e09: field crypto_amount: %w", err) + } + m.CryptoAmount = value + } return nil } @@ -7219,7 +7341,83 @@ func (m *MessageActionGiftCode) GetSlug() (value string) { return m.Slug } +// SetCurrency sets value of Currency conditional field. +func (m *MessageActionGiftCode) SetCurrency(value string) { + m.Flags.Set(2) + m.Currency = value +} + +// GetCurrency returns value of Currency conditional field and +// boolean which is true if field was set. +func (m *MessageActionGiftCode) GetCurrency() (value string, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(2) { + return value, false + } + return m.Currency, true +} + +// SetAmount sets value of Amount conditional field. +func (m *MessageActionGiftCode) SetAmount(value int64) { + m.Flags.Set(2) + m.Amount = value +} + +// GetAmount returns value of Amount conditional field and +// boolean which is true if field was set. +func (m *MessageActionGiftCode) GetAmount() (value int64, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(2) { + return value, false + } + return m.Amount, true +} + +// SetCryptoCurrency sets value of CryptoCurrency conditional field. +func (m *MessageActionGiftCode) SetCryptoCurrency(value string) { + m.Flags.Set(3) + m.CryptoCurrency = value +} + +// GetCryptoCurrency returns value of CryptoCurrency conditional field and +// boolean which is true if field was set. +func (m *MessageActionGiftCode) GetCryptoCurrency() (value string, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(3) { + return value, false + } + return m.CryptoCurrency, true +} + +// SetCryptoAmount sets value of CryptoAmount conditional field. +func (m *MessageActionGiftCode) SetCryptoAmount(value int64) { + m.Flags.Set(3) + m.CryptoAmount = value +} + +// GetCryptoAmount returns value of CryptoAmount conditional field and +// boolean which is true if field was set. +func (m *MessageActionGiftCode) GetCryptoAmount() (value int64, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(3) { + return value, false + } + return m.CryptoAmount, true +} + // MessageActionGiveawayLaunch represents TL type `messageActionGiveawayLaunch#332ba9ed`. +// A giveaway¹ was started. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/constructor/messageActionGiveawayLaunch for reference. type MessageActionGiveawayLaunch struct { @@ -7320,6 +7518,171 @@ func (m *MessageActionGiveawayLaunch) DecodeBare(b *bin.Buffer) error { return nil } +// MessageActionGiveawayResults represents TL type `messageActionGiveawayResults#2a9fadc5`. +// A giveaway¹ has ended. +// +// Links: +// 1. https://core.telegram.org/api/giveaways +// +// See https://core.telegram.org/constructor/messageActionGiveawayResults for reference. +type MessageActionGiveawayResults struct { + // Number of winners in the giveaway + WinnersCount int + // Number of undistributed prizes + UnclaimedCount int +} + +// MessageActionGiveawayResultsTypeID is TL type id of MessageActionGiveawayResults. +const MessageActionGiveawayResultsTypeID = 0x2a9fadc5 + +// construct implements constructor of MessageActionClass. +func (m MessageActionGiveawayResults) construct() MessageActionClass { return &m } + +// Ensuring interfaces in compile-time for MessageActionGiveawayResults. +var ( + _ bin.Encoder = &MessageActionGiveawayResults{} + _ bin.Decoder = &MessageActionGiveawayResults{} + _ bin.BareEncoder = &MessageActionGiveawayResults{} + _ bin.BareDecoder = &MessageActionGiveawayResults{} + + _ MessageActionClass = &MessageActionGiveawayResults{} +) + +func (m *MessageActionGiveawayResults) Zero() bool { + if m == nil { + return true + } + if !(m.WinnersCount == 0) { + return false + } + if !(m.UnclaimedCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageActionGiveawayResults) String() string { + if m == nil { + return "MessageActionGiveawayResults(nil)" + } + type Alias MessageActionGiveawayResults + return fmt.Sprintf("MessageActionGiveawayResults%+v", Alias(*m)) +} + +// FillFrom fills MessageActionGiveawayResults from given interface. +func (m *MessageActionGiveawayResults) FillFrom(from interface { + GetWinnersCount() (value int) + GetUnclaimedCount() (value int) +}) { + m.WinnersCount = from.GetWinnersCount() + m.UnclaimedCount = from.GetUnclaimedCount() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageActionGiveawayResults) TypeID() uint32 { + return MessageActionGiveawayResultsTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageActionGiveawayResults) TypeName() string { + return "messageActionGiveawayResults" +} + +// TypeInfo returns info about TL type. +func (m *MessageActionGiveawayResults) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageActionGiveawayResults", + ID: MessageActionGiveawayResultsTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "WinnersCount", + SchemaName: "winners_count", + }, + { + Name: "UnclaimedCount", + SchemaName: "unclaimed_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageActionGiveawayResults) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageActionGiveawayResults#2a9fadc5 as nil") + } + b.PutID(MessageActionGiveawayResultsTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageActionGiveawayResults) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageActionGiveawayResults#2a9fadc5 as nil") + } + b.PutInt(m.WinnersCount) + b.PutInt(m.UnclaimedCount) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageActionGiveawayResults) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageActionGiveawayResults#2a9fadc5 to nil") + } + if err := b.ConsumeID(MessageActionGiveawayResultsTypeID); err != nil { + return fmt.Errorf("unable to decode messageActionGiveawayResults#2a9fadc5: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageActionGiveawayResults) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageActionGiveawayResults#2a9fadc5 to nil") + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageActionGiveawayResults#2a9fadc5: field winners_count: %w", err) + } + m.WinnersCount = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageActionGiveawayResults#2a9fadc5: field unclaimed_count: %w", err) + } + m.UnclaimedCount = value + } + return nil +} + +// GetWinnersCount returns value of WinnersCount field. +func (m *MessageActionGiveawayResults) GetWinnersCount() (value int) { + if m == nil { + return + } + return m.WinnersCount +} + +// GetUnclaimedCount returns value of UnclaimedCount field. +func (m *MessageActionGiveawayResults) GetUnclaimedCount() (value int) { + if m == nil { + return + } + return m.UnclaimedCount +} + // MessageActionClassName is schema name of MessageActionClass. const MessageActionClassName = "MessageAction" @@ -7370,11 +7733,11 @@ const MessageActionClassName = "MessageAction" // case *tg.MessageActionTopicCreate: // messageActionTopicCreate#d999256 // case *tg.MessageActionTopicEdit: // messageActionTopicEdit#c0944820 // case *tg.MessageActionSuggestProfilePhoto: // messageActionSuggestProfilePhoto#57de635e -// case *tg.MessageActionRequestedPeer: // messageActionRequestedPeer#fe77345d -// case *tg.MessageActionSetChatWallPaper: // messageActionSetChatWallPaper#bc44a927 -// case *tg.MessageActionSetSameChatWallPaper: // messageActionSetSameChatWallPaper#c0787d6d -// case *tg.MessageActionGiftCode: // messageActionGiftCode#d2cfdb0e +// case *tg.MessageActionRequestedPeer: // messageActionRequestedPeer#31518e9b +// case *tg.MessageActionSetChatWallPaper: // messageActionSetChatWallPaper#5060a3f4 +// case *tg.MessageActionGiftCode: // messageActionGiftCode#678c2e09 // case *tg.MessageActionGiveawayLaunch: // messageActionGiveawayLaunch#332ba9ed +// case *tg.MessageActionGiveawayResults: // messageActionGiveawayResults#2a9fadc5 // default: panic(v) // } type MessageActionClass interface { @@ -7656,28 +8019,21 @@ func DecodeMessageAction(buf *bin.Buffer) (MessageActionClass, error) { } return &v, nil case MessageActionRequestedPeerTypeID: - // Decoding messageActionRequestedPeer#fe77345d. + // Decoding messageActionRequestedPeer#31518e9b. v := MessageActionRequestedPeer{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) } return &v, nil case MessageActionSetChatWallPaperTypeID: - // Decoding messageActionSetChatWallPaper#bc44a927. + // Decoding messageActionSetChatWallPaper#5060a3f4. v := MessageActionSetChatWallPaper{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) } return &v, nil - case MessageActionSetSameChatWallPaperTypeID: - // Decoding messageActionSetSameChatWallPaper#c0787d6d. - v := MessageActionSetSameChatWallPaper{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) - } - return &v, nil case MessageActionGiftCodeTypeID: - // Decoding messageActionGiftCode#d2cfdb0e. + // Decoding messageActionGiftCode#678c2e09. v := MessageActionGiftCode{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) @@ -7690,6 +8046,13 @@ func DecodeMessageAction(buf *bin.Buffer) (MessageActionClass, error) { return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) } return &v, nil + case MessageActionGiveawayResultsTypeID: + // Decoding messageActionGiveawayResults#2a9fadc5. + v := MessageActionGiveawayResults{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageActionClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode MessageActionClass: %w", bin.NewUnexpectedID(id)) } diff --git a/vendor/github.com/gotd/td/tg/tl_message_action_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_message_action_slices_gen.go index 06119895..b1d178f8 100644 --- a/vendor/github.com/gotd/td/tg/tl_message_action_slices_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_message_action_slices_gen.go @@ -519,10 +519,10 @@ func (s MessageActionClassArray) AsMessageActionSetChatWallPaper() (to MessageAc return to } -// AsMessageActionSetSameChatWallPaper returns copy with only MessageActionSetSameChatWallPaper constructors. -func (s MessageActionClassArray) AsMessageActionSetSameChatWallPaper() (to MessageActionSetSameChatWallPaperArray) { +// AsMessageActionGiftCode returns copy with only MessageActionGiftCode constructors. +func (s MessageActionClassArray) AsMessageActionGiftCode() (to MessageActionGiftCodeArray) { for _, elem := range s { - value, ok := elem.(*MessageActionSetSameChatWallPaper) + value, ok := elem.(*MessageActionGiftCode) if !ok { continue } @@ -532,10 +532,10 @@ func (s MessageActionClassArray) AsMessageActionSetSameChatWallPaper() (to Messa return to } -// AsMessageActionGiftCode returns copy with only MessageActionGiftCode constructors. -func (s MessageActionClassArray) AsMessageActionGiftCode() (to MessageActionGiftCodeArray) { +// AsMessageActionGiveawayResults returns copy with only MessageActionGiveawayResults constructors. +func (s MessageActionClassArray) AsMessageActionGiveawayResults() (to MessageActionGiveawayResultsArray) { for _, elem := range s { - value, ok := elem.(*MessageActionGiftCode) + value, ok := elem.(*MessageActionGiveawayResults) if !ok { continue } @@ -3087,88 +3087,6 @@ func (s *MessageActionSetChatWallPaperArray) Pop() (v MessageActionSetChatWallPa return v, true } -// MessageActionSetSameChatWallPaperArray is adapter for slice of MessageActionSetSameChatWallPaper. -type MessageActionSetSameChatWallPaperArray []MessageActionSetSameChatWallPaper - -// Sort sorts slice of MessageActionSetSameChatWallPaper. -func (s MessageActionSetSameChatWallPaperArray) Sort(less func(a, b MessageActionSetSameChatWallPaper) bool) MessageActionSetSameChatWallPaperArray { - sort.Slice(s, func(i, j int) bool { - return less(s[i], s[j]) - }) - return s -} - -// SortStable sorts slice of MessageActionSetSameChatWallPaper. -func (s MessageActionSetSameChatWallPaperArray) SortStable(less func(a, b MessageActionSetSameChatWallPaper) bool) MessageActionSetSameChatWallPaperArray { - sort.SliceStable(s, func(i, j int) bool { - return less(s[i], s[j]) - }) - return s -} - -// Retain filters in-place slice of MessageActionSetSameChatWallPaper. -func (s MessageActionSetSameChatWallPaperArray) Retain(keep func(x MessageActionSetSameChatWallPaper) bool) MessageActionSetSameChatWallPaperArray { - n := 0 - for _, x := range s { - if keep(x) { - s[n] = x - n++ - } - } - s = s[:n] - - return s -} - -// First returns first element of slice (if exists). -func (s MessageActionSetSameChatWallPaperArray) First() (v MessageActionSetSameChatWallPaper, ok bool) { - if len(s) < 1 { - return - } - return s[0], true -} - -// Last returns last element of slice (if exists). -func (s MessageActionSetSameChatWallPaperArray) Last() (v MessageActionSetSameChatWallPaper, ok bool) { - if len(s) < 1 { - return - } - return s[len(s)-1], true -} - -// PopFirst returns first element of slice (if exists) and deletes it. -func (s *MessageActionSetSameChatWallPaperArray) PopFirst() (v MessageActionSetSameChatWallPaper, ok bool) { - if s == nil || len(*s) < 1 { - return - } - - a := *s - v = a[0] - - // Delete by index from SliceTricks. - copy(a[0:], a[1:]) - var zero MessageActionSetSameChatWallPaper - a[len(a)-1] = zero - a = a[:len(a)-1] - *s = a - - return v, true -} - -// Pop returns last element of slice (if exists) and deletes it. -func (s *MessageActionSetSameChatWallPaperArray) Pop() (v MessageActionSetSameChatWallPaper, ok bool) { - if s == nil || len(*s) < 1 { - return - } - - a := *s - v = a[len(a)-1] - a = a[:len(a)-1] - *s = a - - return v, true -} - // MessageActionGiftCodeArray is adapter for slice of MessageActionGiftCode. type MessageActionGiftCodeArray []MessageActionGiftCode @@ -3250,3 +3168,85 @@ func (s *MessageActionGiftCodeArray) Pop() (v MessageActionGiftCode, ok bool) { return v, true } + +// MessageActionGiveawayResultsArray is adapter for slice of MessageActionGiveawayResults. +type MessageActionGiveawayResultsArray []MessageActionGiveawayResults + +// Sort sorts slice of MessageActionGiveawayResults. +func (s MessageActionGiveawayResultsArray) Sort(less func(a, b MessageActionGiveawayResults) bool) MessageActionGiveawayResultsArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of MessageActionGiveawayResults. +func (s MessageActionGiveawayResultsArray) SortStable(less func(a, b MessageActionGiveawayResults) bool) MessageActionGiveawayResultsArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of MessageActionGiveawayResults. +func (s MessageActionGiveawayResultsArray) Retain(keep func(x MessageActionGiveawayResults) bool) MessageActionGiveawayResultsArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s MessageActionGiveawayResultsArray) First() (v MessageActionGiveawayResults, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s MessageActionGiveawayResultsArray) Last() (v MessageActionGiveawayResults, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *MessageActionGiveawayResultsArray) PopFirst() (v MessageActionGiveawayResults, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero MessageActionGiveawayResults + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *MessageActionGiveawayResultsArray) Pop() (v MessageActionGiveawayResults, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_message_gen.go b/vendor/github.com/gotd/td/tg/tl_message_gen.go index b990ec66..eb30914c 100644 --- a/vendor/github.com/gotd/td/tg/tl_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_message_gen.go @@ -278,12 +278,15 @@ type Message struct { // Links: // 1) https://core.telegram.org/api/pin Pinned bool - // Whether this message is protected¹ and thus cannot be forwarded + // Whether this message is protected¹ and thus cannot be forwarded; clients should also + // prevent users from saving attached media (i.e. videos should only be streamed, photos + // should be kept in RAM, et cetera). // // Links: // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more Noforwards bool - // InvertMedia field of Message. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // ID of the message ID int diff --git a/vendor/github.com/gotd/td/tg/tl_message_interaction_counters_gen.go b/vendor/github.com/gotd/td/tg/tl_message_interaction_counters_gen.go deleted file mode 100644 index 5a8d2853..00000000 --- a/vendor/github.com/gotd/td/tg/tl_message_interaction_counters_gen.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tg - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// MessageInteractionCounters represents TL type `messageInteractionCounters#ad4fc9bd`. -// Message interaction counters -// -// See https://core.telegram.org/constructor/messageInteractionCounters for reference. -type MessageInteractionCounters struct { - // Message ID - MsgID int - // Views - Views int - // Number of times this message was forwarded - Forwards int -} - -// MessageInteractionCountersTypeID is TL type id of MessageInteractionCounters. -const MessageInteractionCountersTypeID = 0xad4fc9bd - -// Ensuring interfaces in compile-time for MessageInteractionCounters. -var ( - _ bin.Encoder = &MessageInteractionCounters{} - _ bin.Decoder = &MessageInteractionCounters{} - _ bin.BareEncoder = &MessageInteractionCounters{} - _ bin.BareDecoder = &MessageInteractionCounters{} -) - -func (m *MessageInteractionCounters) Zero() bool { - if m == nil { - return true - } - if !(m.MsgID == 0) { - return false - } - if !(m.Views == 0) { - return false - } - if !(m.Forwards == 0) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageInteractionCounters) String() string { - if m == nil { - return "MessageInteractionCounters(nil)" - } - type Alias MessageInteractionCounters - return fmt.Sprintf("MessageInteractionCounters%+v", Alias(*m)) -} - -// FillFrom fills MessageInteractionCounters from given interface. -func (m *MessageInteractionCounters) FillFrom(from interface { - GetMsgID() (value int) - GetViews() (value int) - GetForwards() (value int) -}) { - m.MsgID = from.GetMsgID() - m.Views = from.GetViews() - m.Forwards = from.GetForwards() -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageInteractionCounters) TypeID() uint32 { - return MessageInteractionCountersTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageInteractionCounters) TypeName() string { - return "messageInteractionCounters" -} - -// TypeInfo returns info about TL type. -func (m *MessageInteractionCounters) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageInteractionCounters", - ID: MessageInteractionCountersTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "MsgID", - SchemaName: "msg_id", - }, - { - Name: "Views", - SchemaName: "views", - }, - { - Name: "Forwards", - SchemaName: "forwards", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageInteractionCounters) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageInteractionCounters#ad4fc9bd as nil") - } - b.PutID(MessageInteractionCountersTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageInteractionCounters) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageInteractionCounters#ad4fc9bd as nil") - } - b.PutInt(m.MsgID) - b.PutInt(m.Views) - b.PutInt(m.Forwards) - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageInteractionCounters) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageInteractionCounters#ad4fc9bd to nil") - } - if err := b.ConsumeID(MessageInteractionCountersTypeID); err != nil { - return fmt.Errorf("unable to decode messageInteractionCounters#ad4fc9bd: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageInteractionCounters) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageInteractionCounters#ad4fc9bd to nil") - } - { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode messageInteractionCounters#ad4fc9bd: field msg_id: %w", err) - } - m.MsgID = value - } - { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode messageInteractionCounters#ad4fc9bd: field views: %w", err) - } - m.Views = value - } - { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode messageInteractionCounters#ad4fc9bd: field forwards: %w", err) - } - m.Forwards = value - } - return nil -} - -// GetMsgID returns value of MsgID field. -func (m *MessageInteractionCounters) GetMsgID() (value int) { - if m == nil { - return - } - return m.MsgID -} - -// GetViews returns value of Views field. -func (m *MessageInteractionCounters) GetViews() (value int) { - if m == nil { - return - } - return m.Views -} - -// GetForwards returns value of Forwards field. -func (m *MessageInteractionCounters) GetForwards() (value int) { - if m == nil { - return - } - return m.Forwards -} diff --git a/vendor/github.com/gotd/td/tg/tl_message_media_gen.go b/vendor/github.com/gotd/td/tg/tl_message_media_gen.go index 32baab8e..dc104e0f 100644 --- a/vendor/github.com/gotd/td/tg/tl_message_media_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_message_media_gen.go @@ -902,7 +902,9 @@ type MessageMediaDocument struct { // // Use SetDocument and GetDocument helpers. Document DocumentClass - // AltDocument field of MessageMediaDocument. + // Currently only used for story videos, may contain an alternative version of the story + // video, explicitly encoded using H.264 (in MPEG4 transport) at a lower resolution than + // document. // // Use SetAltDocument and GetAltDocument helpers. AltDocument DocumentClass @@ -1242,15 +1244,24 @@ func (m *MessageMediaDocument) GetTTLSeconds() (value int, ok bool) { // // See https://core.telegram.org/constructor/messageMediaWebPage for reference. type MessageMediaWebPage struct { - // Flags field of MessageMediaWebPage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ForceLargeMedia field of MessageMediaWebPage. + // If set, specifies that a large media preview should be used. ForceLargeMedia bool - // ForceSmallMedia field of MessageMediaWebPage. + // If set, specifies that a small media preview should be used. ForceSmallMedia bool - // Manual field of MessageMediaWebPage. + // If set, indicates that the URL used for the webpage preview was specified manually + // using inputMediaWebPage¹, and may not be related to any of the URLs specified in the + // message. + // + // Links: + // 1) https://core.telegram.org/constructor/inputMediaWebPage Manual bool - // Safe field of MessageMediaWebPage. + // If set, the webpage can be opened directly without user confirmation; otherwise, user + // confirmation is required, showing the exact URL that will be opened. Safe bool // Webpage preview Webpage WebPageClass @@ -1546,7 +1557,8 @@ type MessageMediaVenue struct { Title string // Address Address string - // Venue provider: currently only "foursquare" needs to be supported + // Venue provider: currently only "foursquare" and "gplaces" (Google Places) need to be + // supported Provider string // Venue ID in the provider's database VenueID string @@ -3074,18 +3086,31 @@ func (m *MessageMediaDice) GetEmoticon() (value string) { } // MessageMediaStory represents TL type `messageMediaStory#68cb6283`. +// Represents a forwarded story¹ or a story mention. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/messageMediaStory for reference. type MessageMediaStory struct { - // Flags field of MessageMediaStory. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ViaMention field of MessageMediaStory. + // If set, indicates that this someone has mentioned us in this story (i.e. by tagging us + // in the description) or vice versa, we have mentioned the other peer (if the message is + // outgoing). ViaMention bool - // Peer field of MessageMediaStory. + // Peer that posted the story. Peer PeerClass - // ID field of MessageMediaStory. + // Story ID ID int - // Story field of MessageMediaStory. + // The story itself, if absent fetch it using stories.getStoriesByID¹ and the peer/id + // parameters specified above. + // + // Links: + // 1) https://core.telegram.org/method/stories.getStoriesByID // // Use SetStory and GetStory helpers. Story StoryItemClass @@ -3345,30 +3370,52 @@ func (m *MessageMediaStory) GetStory() (value StoryItemClass, ok bool) { return m.Story, true } -// MessageMediaGiveaway represents TL type `messageMediaGiveaway#58260664`. +// MessageMediaGiveaway represents TL type `messageMediaGiveaway#daad85b0`. +// Contains info about a giveaway, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/constructor/messageMediaGiveaway for reference. type MessageMediaGiveaway struct { - // Flags field of MessageMediaGiveaway. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // OnlyNewSubscribers field of MessageMediaGiveaway. + // If set, only new subscribers starting from the giveaway creation date will be able to + // participate to the giveaway. OnlyNewSubscribers bool - // Channels field of MessageMediaGiveaway. + // WinnersAreVisible field of MessageMediaGiveaway. + WinnersAreVisible bool + // The channels that the user must join to participate in the giveaway. Channels []int64 - // CountriesISO2 field of MessageMediaGiveaway. + // If set, only users residing in these countries can participate in the giveaway, + // (specified as a list of two-letter ISO 3166-1 alpha-2 country codes); otherwise there + // are no country-based limitations. // // Use SetCountriesISO2 and GetCountriesISO2 helpers. CountriesISO2 []string - // Quantity field of MessageMediaGiveaway. + // PrizeDescription field of MessageMediaGiveaway. + // + // Use SetPrizeDescription and GetPrizeDescription helpers. + PrizeDescription string + // Number of Telegram Premium¹ subscriptions given away. + // + // Links: + // 1) https://core.telegram.org/api/premium Quantity int - // Months field of MessageMediaGiveaway. + // Duration in months of each Telegram Premium¹ subscription in the giveaway. + // + // Links: + // 1) https://core.telegram.org/api/premium Months int - // UntilDate field of MessageMediaGiveaway. + // The end date of the giveaway. UntilDate int } // MessageMediaGiveawayTypeID is TL type id of MessageMediaGiveaway. -const MessageMediaGiveawayTypeID = 0x58260664 +const MessageMediaGiveawayTypeID = 0xdaad85b0 // construct implements constructor of MessageMediaClass. func (m MessageMediaGiveaway) construct() MessageMediaClass { return &m } @@ -3393,12 +3440,18 @@ func (m *MessageMediaGiveaway) Zero() bool { if !(m.OnlyNewSubscribers == false) { return false } + if !(m.WinnersAreVisible == false) { + return false + } if !(m.Channels == nil) { return false } if !(m.CountriesISO2 == nil) { return false } + if !(m.PrizeDescription == "") { + return false + } if !(m.Quantity == 0) { return false } @@ -3424,18 +3477,25 @@ func (m *MessageMediaGiveaway) String() string { // FillFrom fills MessageMediaGiveaway from given interface. func (m *MessageMediaGiveaway) FillFrom(from interface { GetOnlyNewSubscribers() (value bool) + GetWinnersAreVisible() (value bool) GetChannels() (value []int64) GetCountriesISO2() (value []string, ok bool) + GetPrizeDescription() (value string, ok bool) GetQuantity() (value int) GetMonths() (value int) GetUntilDate() (value int) }) { m.OnlyNewSubscribers = from.GetOnlyNewSubscribers() + m.WinnersAreVisible = from.GetWinnersAreVisible() m.Channels = from.GetChannels() if val, ok := from.GetCountriesISO2(); ok { m.CountriesISO2 = val } + if val, ok := from.GetPrizeDescription(); ok { + m.PrizeDescription = val + } + m.Quantity = from.GetQuantity() m.Months = from.GetMonths() m.UntilDate = from.GetUntilDate() @@ -3469,6 +3529,11 @@ func (m *MessageMediaGiveaway) TypeInfo() tdp.Type { SchemaName: "only_new_subscribers", Null: !m.Flags.Has(0), }, + { + Name: "WinnersAreVisible", + SchemaName: "winners_are_visible", + Null: !m.Flags.Has(2), + }, { Name: "Channels", SchemaName: "channels", @@ -3478,6 +3543,11 @@ func (m *MessageMediaGiveaway) TypeInfo() tdp.Type { SchemaName: "countries_iso2", Null: !m.Flags.Has(1), }, + { + Name: "PrizeDescription", + SchemaName: "prize_description", + Null: !m.Flags.Has(3), + }, { Name: "Quantity", SchemaName: "quantity", @@ -3499,15 +3569,21 @@ func (m *MessageMediaGiveaway) SetFlags() { if !(m.OnlyNewSubscribers == false) { m.Flags.Set(0) } + if !(m.WinnersAreVisible == false) { + m.Flags.Set(2) + } if !(m.CountriesISO2 == nil) { m.Flags.Set(1) } + if !(m.PrizeDescription == "") { + m.Flags.Set(3) + } } // Encode implements bin.Encoder. func (m *MessageMediaGiveaway) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageMediaGiveaway#58260664 as nil") + return fmt.Errorf("can't encode messageMediaGiveaway#daad85b0 as nil") } b.PutID(MessageMediaGiveawayTypeID) return m.EncodeBare(b) @@ -3516,11 +3592,11 @@ func (m *MessageMediaGiveaway) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageMediaGiveaway) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageMediaGiveaway#58260664 as nil") + return fmt.Errorf("can't encode messageMediaGiveaway#daad85b0 as nil") } m.SetFlags() if err := m.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageMediaGiveaway#58260664: field flags: %w", err) + return fmt.Errorf("unable to encode messageMediaGiveaway#daad85b0: field flags: %w", err) } b.PutVectorHeader(len(m.Channels)) for _, v := range m.Channels { @@ -3532,6 +3608,9 @@ func (m *MessageMediaGiveaway) EncodeBare(b *bin.Buffer) error { b.PutString(v) } } + if m.Flags.Has(3) { + b.PutString(m.PrizeDescription) + } b.PutInt(m.Quantity) b.PutInt(m.Months) b.PutInt(m.UntilDate) @@ -3541,10 +3620,10 @@ func (m *MessageMediaGiveaway) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageMediaGiveaway) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageMediaGiveaway#58260664 to nil") + return fmt.Errorf("can't decode messageMediaGiveaway#daad85b0 to nil") } if err := b.ConsumeID(MessageMediaGiveawayTypeID); err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: %w", err) } return m.DecodeBare(b) } @@ -3552,18 +3631,19 @@ func (m *MessageMediaGiveaway) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageMediaGiveaway) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageMediaGiveaway#58260664 to nil") + return fmt.Errorf("can't decode messageMediaGiveaway#daad85b0 to nil") } { if err := m.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field flags: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field flags: %w", err) } } m.OnlyNewSubscribers = m.Flags.Has(0) + m.WinnersAreVisible = m.Flags.Has(2) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field channels: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field channels: %w", err) } if headerLen > 0 { @@ -3572,7 +3652,7 @@ func (m *MessageMediaGiveaway) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field channels: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field channels: %w", err) } m.Channels = append(m.Channels, value) } @@ -3580,7 +3660,7 @@ func (m *MessageMediaGiveaway) DecodeBare(b *bin.Buffer) error { if m.Flags.Has(1) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field countries_iso2: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field countries_iso2: %w", err) } if headerLen > 0 { @@ -3589,29 +3669,36 @@ func (m *MessageMediaGiveaway) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field countries_iso2: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field countries_iso2: %w", err) } m.CountriesISO2 = append(m.CountriesISO2, value) } } + if m.Flags.Has(3) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field prize_description: %w", err) + } + m.PrizeDescription = value + } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field quantity: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field quantity: %w", err) } m.Quantity = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field months: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field months: %w", err) } m.Months = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageMediaGiveaway#58260664: field until_date: %w", err) + return fmt.Errorf("unable to decode messageMediaGiveaway#daad85b0: field until_date: %w", err) } m.UntilDate = value } @@ -3637,6 +3724,25 @@ func (m *MessageMediaGiveaway) GetOnlyNewSubscribers() (value bool) { return m.Flags.Has(0) } +// SetWinnersAreVisible sets value of WinnersAreVisible conditional field. +func (m *MessageMediaGiveaway) SetWinnersAreVisible(value bool) { + if value { + m.Flags.Set(2) + m.WinnersAreVisible = true + } else { + m.Flags.Unset(2) + m.WinnersAreVisible = false + } +} + +// GetWinnersAreVisible returns value of WinnersAreVisible conditional field. +func (m *MessageMediaGiveaway) GetWinnersAreVisible() (value bool) { + if m == nil { + return + } + return m.Flags.Has(2) +} + // GetChannels returns value of Channels field. func (m *MessageMediaGiveaway) GetChannels() (value []int64) { if m == nil { @@ -3663,6 +3769,24 @@ func (m *MessageMediaGiveaway) GetCountriesISO2() (value []string, ok bool) { return m.CountriesISO2, true } +// SetPrizeDescription sets value of PrizeDescription conditional field. +func (m *MessageMediaGiveaway) SetPrizeDescription(value string) { + m.Flags.Set(3) + m.PrizeDescription = value +} + +// GetPrizeDescription returns value of PrizeDescription conditional field and +// boolean which is true if field was set. +func (m *MessageMediaGiveaway) GetPrizeDescription() (value string, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(3) { + return value, false + } + return m.PrizeDescription, true +} + // GetQuantity returns value of Quantity field. func (m *MessageMediaGiveaway) GetQuantity() (value int) { if m == nil { @@ -3687,6 +3811,499 @@ func (m *MessageMediaGiveaway) GetUntilDate() (value int) { return m.UntilDate } +// MessageMediaGiveawayResults represents TL type `messageMediaGiveawayResults#c6991068`. +// +// See https://core.telegram.org/constructor/messageMediaGiveawayResults for reference. +type MessageMediaGiveawayResults struct { + // Flags field of MessageMediaGiveawayResults. + Flags bin.Fields + // OnlyNewSubscribers field of MessageMediaGiveawayResults. + OnlyNewSubscribers bool + // Refunded field of MessageMediaGiveawayResults. + Refunded bool + // ChannelID field of MessageMediaGiveawayResults. + ChannelID int64 + // AdditionalPeersCount field of MessageMediaGiveawayResults. + // + // Use SetAdditionalPeersCount and GetAdditionalPeersCount helpers. + AdditionalPeersCount int + // LaunchMsgID field of MessageMediaGiveawayResults. + LaunchMsgID int + // WinnersCount field of MessageMediaGiveawayResults. + WinnersCount int + // UnclaimedCount field of MessageMediaGiveawayResults. + UnclaimedCount int + // Winners field of MessageMediaGiveawayResults. + Winners []int64 + // Months field of MessageMediaGiveawayResults. + Months int + // PrizeDescription field of MessageMediaGiveawayResults. + // + // Use SetPrizeDescription and GetPrizeDescription helpers. + PrizeDescription string + // UntilDate field of MessageMediaGiveawayResults. + UntilDate int +} + +// MessageMediaGiveawayResultsTypeID is TL type id of MessageMediaGiveawayResults. +const MessageMediaGiveawayResultsTypeID = 0xc6991068 + +// construct implements constructor of MessageMediaClass. +func (m MessageMediaGiveawayResults) construct() MessageMediaClass { return &m } + +// Ensuring interfaces in compile-time for MessageMediaGiveawayResults. +var ( + _ bin.Encoder = &MessageMediaGiveawayResults{} + _ bin.Decoder = &MessageMediaGiveawayResults{} + _ bin.BareEncoder = &MessageMediaGiveawayResults{} + _ bin.BareDecoder = &MessageMediaGiveawayResults{} + + _ MessageMediaClass = &MessageMediaGiveawayResults{} +) + +func (m *MessageMediaGiveawayResults) Zero() bool { + if m == nil { + return true + } + if !(m.Flags.Zero()) { + return false + } + if !(m.OnlyNewSubscribers == false) { + return false + } + if !(m.Refunded == false) { + return false + } + if !(m.ChannelID == 0) { + return false + } + if !(m.AdditionalPeersCount == 0) { + return false + } + if !(m.LaunchMsgID == 0) { + return false + } + if !(m.WinnersCount == 0) { + return false + } + if !(m.UnclaimedCount == 0) { + return false + } + if !(m.Winners == nil) { + return false + } + if !(m.Months == 0) { + return false + } + if !(m.PrizeDescription == "") { + return false + } + if !(m.UntilDate == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageMediaGiveawayResults) String() string { + if m == nil { + return "MessageMediaGiveawayResults(nil)" + } + type Alias MessageMediaGiveawayResults + return fmt.Sprintf("MessageMediaGiveawayResults%+v", Alias(*m)) +} + +// FillFrom fills MessageMediaGiveawayResults from given interface. +func (m *MessageMediaGiveawayResults) FillFrom(from interface { + GetOnlyNewSubscribers() (value bool) + GetRefunded() (value bool) + GetChannelID() (value int64) + GetAdditionalPeersCount() (value int, ok bool) + GetLaunchMsgID() (value int) + GetWinnersCount() (value int) + GetUnclaimedCount() (value int) + GetWinners() (value []int64) + GetMonths() (value int) + GetPrizeDescription() (value string, ok bool) + GetUntilDate() (value int) +}) { + m.OnlyNewSubscribers = from.GetOnlyNewSubscribers() + m.Refunded = from.GetRefunded() + m.ChannelID = from.GetChannelID() + if val, ok := from.GetAdditionalPeersCount(); ok { + m.AdditionalPeersCount = val + } + + m.LaunchMsgID = from.GetLaunchMsgID() + m.WinnersCount = from.GetWinnersCount() + m.UnclaimedCount = from.GetUnclaimedCount() + m.Winners = from.GetWinners() + m.Months = from.GetMonths() + if val, ok := from.GetPrizeDescription(); ok { + m.PrizeDescription = val + } + + m.UntilDate = from.GetUntilDate() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageMediaGiveawayResults) TypeID() uint32 { + return MessageMediaGiveawayResultsTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageMediaGiveawayResults) TypeName() string { + return "messageMediaGiveawayResults" +} + +// TypeInfo returns info about TL type. +func (m *MessageMediaGiveawayResults) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageMediaGiveawayResults", + ID: MessageMediaGiveawayResultsTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OnlyNewSubscribers", + SchemaName: "only_new_subscribers", + Null: !m.Flags.Has(0), + }, + { + Name: "Refunded", + SchemaName: "refunded", + Null: !m.Flags.Has(2), + }, + { + Name: "ChannelID", + SchemaName: "channel_id", + }, + { + Name: "AdditionalPeersCount", + SchemaName: "additional_peers_count", + Null: !m.Flags.Has(3), + }, + { + Name: "LaunchMsgID", + SchemaName: "launch_msg_id", + }, + { + Name: "WinnersCount", + SchemaName: "winners_count", + }, + { + Name: "UnclaimedCount", + SchemaName: "unclaimed_count", + }, + { + Name: "Winners", + SchemaName: "winners", + }, + { + Name: "Months", + SchemaName: "months", + }, + { + Name: "PrizeDescription", + SchemaName: "prize_description", + Null: !m.Flags.Has(1), + }, + { + Name: "UntilDate", + SchemaName: "until_date", + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (m *MessageMediaGiveawayResults) SetFlags() { + if !(m.OnlyNewSubscribers == false) { + m.Flags.Set(0) + } + if !(m.Refunded == false) { + m.Flags.Set(2) + } + if !(m.AdditionalPeersCount == 0) { + m.Flags.Set(3) + } + if !(m.PrizeDescription == "") { + m.Flags.Set(1) + } +} + +// Encode implements bin.Encoder. +func (m *MessageMediaGiveawayResults) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageMediaGiveawayResults#c6991068 as nil") + } + b.PutID(MessageMediaGiveawayResultsTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageMediaGiveawayResults) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageMediaGiveawayResults#c6991068 as nil") + } + m.SetFlags() + if err := m.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageMediaGiveawayResults#c6991068: field flags: %w", err) + } + b.PutLong(m.ChannelID) + if m.Flags.Has(3) { + b.PutInt(m.AdditionalPeersCount) + } + b.PutInt(m.LaunchMsgID) + b.PutInt(m.WinnersCount) + b.PutInt(m.UnclaimedCount) + b.PutVectorHeader(len(m.Winners)) + for _, v := range m.Winners { + b.PutLong(v) + } + b.PutInt(m.Months) + if m.Flags.Has(1) { + b.PutString(m.PrizeDescription) + } + b.PutInt(m.UntilDate) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageMediaGiveawayResults) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageMediaGiveawayResults#c6991068 to nil") + } + if err := b.ConsumeID(MessageMediaGiveawayResultsTypeID); err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageMediaGiveawayResults) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageMediaGiveawayResults#c6991068 to nil") + } + { + if err := m.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field flags: %w", err) + } + } + m.OnlyNewSubscribers = m.Flags.Has(0) + m.Refunded = m.Flags.Has(2) + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field channel_id: %w", err) + } + m.ChannelID = value + } + if m.Flags.Has(3) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field additional_peers_count: %w", err) + } + m.AdditionalPeersCount = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field launch_msg_id: %w", err) + } + m.LaunchMsgID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field winners_count: %w", err) + } + m.WinnersCount = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field unclaimed_count: %w", err) + } + m.UnclaimedCount = value + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field winners: %w", err) + } + + if headerLen > 0 { + m.Winners = make([]int64, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field winners: %w", err) + } + m.Winners = append(m.Winners, value) + } + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field months: %w", err) + } + m.Months = value + } + if m.Flags.Has(1) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field prize_description: %w", err) + } + m.PrizeDescription = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageMediaGiveawayResults#c6991068: field until_date: %w", err) + } + m.UntilDate = value + } + return nil +} + +// SetOnlyNewSubscribers sets value of OnlyNewSubscribers conditional field. +func (m *MessageMediaGiveawayResults) SetOnlyNewSubscribers(value bool) { + if value { + m.Flags.Set(0) + m.OnlyNewSubscribers = true + } else { + m.Flags.Unset(0) + m.OnlyNewSubscribers = false + } +} + +// GetOnlyNewSubscribers returns value of OnlyNewSubscribers conditional field. +func (m *MessageMediaGiveawayResults) GetOnlyNewSubscribers() (value bool) { + if m == nil { + return + } + return m.Flags.Has(0) +} + +// SetRefunded sets value of Refunded conditional field. +func (m *MessageMediaGiveawayResults) SetRefunded(value bool) { + if value { + m.Flags.Set(2) + m.Refunded = true + } else { + m.Flags.Unset(2) + m.Refunded = false + } +} + +// GetRefunded returns value of Refunded conditional field. +func (m *MessageMediaGiveawayResults) GetRefunded() (value bool) { + if m == nil { + return + } + return m.Flags.Has(2) +} + +// GetChannelID returns value of ChannelID field. +func (m *MessageMediaGiveawayResults) GetChannelID() (value int64) { + if m == nil { + return + } + return m.ChannelID +} + +// SetAdditionalPeersCount sets value of AdditionalPeersCount conditional field. +func (m *MessageMediaGiveawayResults) SetAdditionalPeersCount(value int) { + m.Flags.Set(3) + m.AdditionalPeersCount = value +} + +// GetAdditionalPeersCount returns value of AdditionalPeersCount conditional field and +// boolean which is true if field was set. +func (m *MessageMediaGiveawayResults) GetAdditionalPeersCount() (value int, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(3) { + return value, false + } + return m.AdditionalPeersCount, true +} + +// GetLaunchMsgID returns value of LaunchMsgID field. +func (m *MessageMediaGiveawayResults) GetLaunchMsgID() (value int) { + if m == nil { + return + } + return m.LaunchMsgID +} + +// GetWinnersCount returns value of WinnersCount field. +func (m *MessageMediaGiveawayResults) GetWinnersCount() (value int) { + if m == nil { + return + } + return m.WinnersCount +} + +// GetUnclaimedCount returns value of UnclaimedCount field. +func (m *MessageMediaGiveawayResults) GetUnclaimedCount() (value int) { + if m == nil { + return + } + return m.UnclaimedCount +} + +// GetWinners returns value of Winners field. +func (m *MessageMediaGiveawayResults) GetWinners() (value []int64) { + if m == nil { + return + } + return m.Winners +} + +// GetMonths returns value of Months field. +func (m *MessageMediaGiveawayResults) GetMonths() (value int) { + if m == nil { + return + } + return m.Months +} + +// SetPrizeDescription sets value of PrizeDescription conditional field. +func (m *MessageMediaGiveawayResults) SetPrizeDescription(value string) { + m.Flags.Set(1) + m.PrizeDescription = value +} + +// GetPrizeDescription returns value of PrizeDescription conditional field and +// boolean which is true if field was set. +func (m *MessageMediaGiveawayResults) GetPrizeDescription() (value string, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(1) { + return value, false + } + return m.PrizeDescription, true +} + +// GetUntilDate returns value of UntilDate field. +func (m *MessageMediaGiveawayResults) GetUntilDate() (value int) { + if m == nil { + return + } + return m.UntilDate +} + // MessageMediaClassName is schema name of MessageMediaClass. const MessageMediaClassName = "MessageMedia" @@ -3715,7 +4332,8 @@ const MessageMediaClassName = "MessageMedia" // case *tg.MessageMediaPoll: // messageMediaPoll#4bd6e798 // case *tg.MessageMediaDice: // messageMediaDice#3f7ee58b // case *tg.MessageMediaStory: // messageMediaStory#68cb6283 -// case *tg.MessageMediaGiveaway: // messageMediaGiveaway#58260664 +// case *tg.MessageMediaGiveaway: // messageMediaGiveaway#daad85b0 +// case *tg.MessageMediaGiveawayResults: // messageMediaGiveawayResults#c6991068 // default: panic(v) // } type MessageMediaClass interface { @@ -3843,12 +4461,19 @@ func DecodeMessageMedia(buf *bin.Buffer) (MessageMediaClass, error) { } return &v, nil case MessageMediaGiveawayTypeID: - // Decoding messageMediaGiveaway#58260664. + // Decoding messageMediaGiveaway#daad85b0. v := MessageMediaGiveaway{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageMediaClass: %w", err) } return &v, nil + case MessageMediaGiveawayResultsTypeID: + // Decoding messageMediaGiveawayResults#c6991068. + v := MessageMediaGiveawayResults{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageMediaClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode MessageMediaClass: %w", bin.NewUnexpectedID(id)) } diff --git a/vendor/github.com/gotd/td/tg/tl_message_media_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_message_media_slices_gen.go index 6f03b5f0..04f8ec7f 100644 --- a/vendor/github.com/gotd/td/tg/tl_message_media_slices_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_message_media_slices_gen.go @@ -285,6 +285,19 @@ func (s MessageMediaClassArray) AsMessageMediaGiveaway() (to MessageMediaGiveawa return to } +// AsMessageMediaGiveawayResults returns copy with only MessageMediaGiveawayResults constructors. +func (s MessageMediaClassArray) AsMessageMediaGiveawayResults() (to MessageMediaGiveawayResultsArray) { + for _, elem := range s { + value, ok := elem.(*MessageMediaGiveawayResults) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + // MessageMediaPhotoArray is adapter for slice of MessageMediaPhoto. type MessageMediaPhotoArray []MessageMediaPhoto @@ -1378,3 +1391,85 @@ func (s *MessageMediaGiveawayArray) Pop() (v MessageMediaGiveaway, ok bool) { return v, true } + +// MessageMediaGiveawayResultsArray is adapter for slice of MessageMediaGiveawayResults. +type MessageMediaGiveawayResultsArray []MessageMediaGiveawayResults + +// Sort sorts slice of MessageMediaGiveawayResults. +func (s MessageMediaGiveawayResultsArray) Sort(less func(a, b MessageMediaGiveawayResults) bool) MessageMediaGiveawayResultsArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of MessageMediaGiveawayResults. +func (s MessageMediaGiveawayResultsArray) SortStable(less func(a, b MessageMediaGiveawayResults) bool) MessageMediaGiveawayResultsArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of MessageMediaGiveawayResults. +func (s MessageMediaGiveawayResultsArray) Retain(keep func(x MessageMediaGiveawayResults) bool) MessageMediaGiveawayResultsArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s MessageMediaGiveawayResultsArray) First() (v MessageMediaGiveawayResults, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s MessageMediaGiveawayResultsArray) Last() (v MessageMediaGiveawayResults, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *MessageMediaGiveawayResultsArray) PopFirst() (v MessageMediaGiveawayResults, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero MessageMediaGiveawayResults + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *MessageMediaGiveawayResultsArray) Pop() (v MessageMediaGiveawayResults, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_message_peer_vote_gen.go b/vendor/github.com/gotd/td/tg/tl_message_peer_vote_gen.go index 49fc0f28..9e2b85ee 100644 --- a/vendor/github.com/gotd/td/tg/tl_message_peer_vote_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_message_peer_vote_gen.go @@ -32,14 +32,15 @@ var ( ) // MessagePeerVote represents TL type `messagePeerVote#b6cc2d5c`. +// How a peer voted in a poll // // See https://core.telegram.org/constructor/messagePeerVote for reference. type MessagePeerVote struct { - // Peer field of MessagePeerVote. + // Peer ID Peer PeerClass - // Option field of MessagePeerVote. + // The option chosen by the peer Option []byte - // Date field of MessagePeerVote. + // When did the peer cast the vote Date int } @@ -225,12 +226,17 @@ func (m *MessagePeerVote) GetDate() (value int) { } // MessagePeerVoteInputOption represents TL type `messagePeerVoteInputOption#74cda504`. +// How a peer voted in a poll (reduced constructor, returned if an option was provided to +// messages.getPollVotes¹) +// +// Links: +// 1. https://core.telegram.org/method/messages.getPollVotes // // See https://core.telegram.org/constructor/messagePeerVoteInputOption for reference. type MessagePeerVoteInputOption struct { - // Peer field of MessagePeerVoteInputOption. + // The peer that voted for the queried option Peer PeerClass - // Date field of MessagePeerVoteInputOption. + // When did the peer cast the vote Date int } @@ -391,14 +397,15 @@ func (m *MessagePeerVoteInputOption) GetDate() (value int) { } // MessagePeerVoteMultiple represents TL type `messagePeerVoteMultiple#4628f6e6`. +// How a peer voted in a multiple-choice poll // // See https://core.telegram.org/constructor/messagePeerVoteMultiple for reference. type MessagePeerVoteMultiple struct { - // Peer field of MessagePeerVoteMultiple. + // Peer ID Peer PeerClass - // Options field of MessagePeerVoteMultiple. + // Options chosen by the peer Options [][]byte - // Date field of MessagePeerVoteMultiple. + // When did the peer cast their votes Date int } @@ -633,10 +640,10 @@ type MessagePeerVoteClass interface { // Zero returns true if current object has a zero value. Zero() bool - // Peer field of MessagePeerVote. + // Peer ID GetPeer() (value PeerClass) - // Date field of MessagePeerVote. + // When did the peer cast the vote GetDate() (value int) } diff --git a/vendor/github.com/gotd/td/tg/tl_message_reply_header_gen.go b/vendor/github.com/gotd/td/tg/tl_message_reply_header_gen.go index 3d8cd447..8d3de3ba 100644 --- a/vendor/github.com/gotd/td/tg/tl_message_reply_header_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_message_reply_header_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// MessageReplyHeader represents TL type `messageReplyHeader#6eebcabd`. +// MessageReplyHeader represents TL type `messageReplyHeader#afbc09db`. // Message replies and thread¹ information // // Links: @@ -51,7 +51,7 @@ type MessageReplyHeader struct { // Links: // 1) https://core.telegram.org/api/forum#forum-topics ForumTopic bool - // Quote field of MessageReplyHeader. + // Whether this message is quoting a part of another message. Quote bool // ID of message to which this message is replying // @@ -65,11 +65,13 @@ type MessageReplyHeader struct { // // Use SetReplyToPeerID and GetReplyToPeerID helpers. ReplyToPeerID PeerClass - // ReplyFrom field of MessageReplyHeader. + // When replying to a message sent by a certain peer to another chat, contains info about + // the peer that originally sent the message to that other chat. // // Use SetReplyFrom and GetReplyFrom helpers. ReplyFrom MessageFwdHeader - // ReplyMedia field of MessageReplyHeader. + // When replying to a media sent by a certain peer to another chat, contains the media of + // the replied-to message. // // Use SetReplyMedia and GetReplyMedia helpers. ReplyMedia MessageMediaClass @@ -80,18 +82,28 @@ type MessageReplyHeader struct { // // Use SetReplyToTopID and GetReplyToTopID helpers. ReplyToTopID int - // QuoteText field of MessageReplyHeader. + // Used to quote-reply to only a certain section (specified here) of the original message. // // Use SetQuoteText and GetQuoteText helpers. QuoteText string - // QuoteEntities field of MessageReplyHeader. + // Message entities for styled text¹ from the quote_text field. + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetQuoteEntities and GetQuoteEntities helpers. QuoteEntities []MessageEntityClass + // Offset of the message quote_text within the original message (in UTF-16 code units¹). + // + // Links: + // 1) https://core.telegram.org/api/entities#entity-length + // + // Use SetQuoteOffset and GetQuoteOffset helpers. + QuoteOffset int } // MessageReplyHeaderTypeID is TL type id of MessageReplyHeader. -const MessageReplyHeaderTypeID = 0x6eebcabd +const MessageReplyHeaderTypeID = 0xafbc09db // construct implements constructor of MessageReplyHeaderClass. func (m MessageReplyHeader) construct() MessageReplyHeaderClass { return &m } @@ -143,6 +155,9 @@ func (m *MessageReplyHeader) Zero() bool { if !(m.QuoteEntities == nil) { return false } + if !(m.QuoteOffset == 0) { + return false + } return true } @@ -168,6 +183,7 @@ func (m *MessageReplyHeader) FillFrom(from interface { GetReplyToTopID() (value int, ok bool) GetQuoteText() (value string, ok bool) GetQuoteEntities() (value []MessageEntityClass, ok bool) + GetQuoteOffset() (value int, ok bool) }) { m.ReplyToScheduled = from.GetReplyToScheduled() m.ForumTopic = from.GetForumTopic() @@ -200,6 +216,10 @@ func (m *MessageReplyHeader) FillFrom(from interface { m.QuoteEntities = val } + if val, ok := from.GetQuoteOffset(); ok { + m.QuoteOffset = val + } + } // TypeID returns type id in TL schema. @@ -275,6 +295,11 @@ func (m *MessageReplyHeader) TypeInfo() tdp.Type { SchemaName: "quote_entities", Null: !m.Flags.Has(7), }, + { + Name: "QuoteOffset", + SchemaName: "quote_offset", + Null: !m.Flags.Has(10), + }, } return typ } @@ -311,12 +336,15 @@ func (m *MessageReplyHeader) SetFlags() { if !(m.QuoteEntities == nil) { m.Flags.Set(7) } + if !(m.QuoteOffset == 0) { + m.Flags.Set(10) + } } // Encode implements bin.Encoder. func (m *MessageReplyHeader) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageReplyHeader#6eebcabd as nil") + return fmt.Errorf("can't encode messageReplyHeader#afbc09db as nil") } b.PutID(MessageReplyHeaderTypeID) return m.EncodeBare(b) @@ -325,34 +353,34 @@ func (m *MessageReplyHeader) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageReplyHeader) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageReplyHeader#6eebcabd as nil") + return fmt.Errorf("can't encode messageReplyHeader#afbc09db as nil") } m.SetFlags() if err := m.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field flags: %w", err) + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field flags: %w", err) } if m.Flags.Has(4) { b.PutInt(m.ReplyToMsgID) } if m.Flags.Has(0) { if m.ReplyToPeerID == nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field reply_to_peer_id is nil") + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field reply_to_peer_id is nil") } if err := m.ReplyToPeerID.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field reply_to_peer_id: %w", err) + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field reply_to_peer_id: %w", err) } } if m.Flags.Has(5) { if err := m.ReplyFrom.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field reply_from: %w", err) + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field reply_from: %w", err) } } if m.Flags.Has(8) { if m.ReplyMedia == nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field reply_media is nil") + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field reply_media is nil") } if err := m.ReplyMedia.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field reply_media: %w", err) + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field reply_media: %w", err) } } if m.Flags.Has(1) { @@ -365,23 +393,26 @@ func (m *MessageReplyHeader) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(m.QuoteEntities)) for idx, v := range m.QuoteEntities { if v == nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field quote_entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field quote_entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageReplyHeader#6eebcabd: field quote_entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode messageReplyHeader#afbc09db: field quote_entities element with index %d: %w", idx, err) } } } + if m.Flags.Has(10) { + b.PutInt(m.QuoteOffset) + } return nil } // Decode implements bin.Decoder. func (m *MessageReplyHeader) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageReplyHeader#6eebcabd to nil") + return fmt.Errorf("can't decode messageReplyHeader#afbc09db to nil") } if err := b.ConsumeID(MessageReplyHeaderTypeID); err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: %w", err) } return m.DecodeBare(b) } @@ -389,11 +420,11 @@ func (m *MessageReplyHeader) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageReplyHeader) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageReplyHeader#6eebcabd to nil") + return fmt.Errorf("can't decode messageReplyHeader#afbc09db to nil") } { if err := m.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field flags: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field flags: %w", err) } } m.ReplyToScheduled = m.Flags.Has(2) @@ -402,47 +433,47 @@ func (m *MessageReplyHeader) DecodeBare(b *bin.Buffer) error { if m.Flags.Has(4) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field reply_to_msg_id: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field reply_to_msg_id: %w", err) } m.ReplyToMsgID = value } if m.Flags.Has(0) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field reply_to_peer_id: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field reply_to_peer_id: %w", err) } m.ReplyToPeerID = value } if m.Flags.Has(5) { if err := m.ReplyFrom.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field reply_from: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field reply_from: %w", err) } } if m.Flags.Has(8) { value, err := DecodeMessageMedia(b) if err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field reply_media: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field reply_media: %w", err) } m.ReplyMedia = value } if m.Flags.Has(1) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field reply_to_top_id: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field reply_to_top_id: %w", err) } m.ReplyToTopID = value } if m.Flags.Has(6) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field quote_text: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field quote_text: %w", err) } m.QuoteText = value } if m.Flags.Has(7) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field quote_entities: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field quote_entities: %w", err) } if headerLen > 0 { @@ -451,11 +482,18 @@ func (m *MessageReplyHeader) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode messageReplyHeader#6eebcabd: field quote_entities: %w", err) + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field quote_entities: %w", err) } m.QuoteEntities = append(m.QuoteEntities, value) } } + if m.Flags.Has(10) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageReplyHeader#afbc09db: field quote_offset: %w", err) + } + m.QuoteOffset = value + } return nil } @@ -642,6 +680,24 @@ func (m *MessageReplyHeader) GetQuoteEntities() (value []MessageEntityClass, ok return m.QuoteEntities, true } +// SetQuoteOffset sets value of QuoteOffset conditional field. +func (m *MessageReplyHeader) SetQuoteOffset(value int) { + m.Flags.Set(10) + m.QuoteOffset = value +} + +// GetQuoteOffset returns value of QuoteOffset conditional field and +// boolean which is true if field was set. +func (m *MessageReplyHeader) GetQuoteOffset() (value int, ok bool) { + if m == nil { + return + } + if !m.Flags.Has(10) { + return value, false + } + return m.QuoteOffset, true +} + // MapQuoteEntities returns field QuoteEntities wrapped in MessageEntityClassArray helper. func (m *MessageReplyHeader) MapQuoteEntities() (value MessageEntityClassArray, ok bool) { if !m.Flags.Has(7) { @@ -651,12 +707,16 @@ func (m *MessageReplyHeader) MapQuoteEntities() (value MessageEntityClassArray, } // MessageReplyStoryHeader represents TL type `messageReplyStoryHeader#9c98bfc1`. +// Represents a reply to a story¹ +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/messageReplyStoryHeader for reference. type MessageReplyStoryHeader struct { - // UserID field of MessageReplyStoryHeader. + // ID of the user that posted a story UserID int64 - // StoryID field of MessageReplyStoryHeader. + // Story ID StoryID int } @@ -825,7 +885,7 @@ const MessageReplyHeaderClassName = "MessageReplyHeader" // panic(err) // } // switch v := g.(type) { -// case *tg.MessageReplyHeader: // messageReplyHeader#6eebcabd +// case *tg.MessageReplyHeader: // messageReplyHeader#afbc09db // case *tg.MessageReplyStoryHeader: // messageReplyStoryHeader#9c98bfc1 // default: panic(v) // } @@ -856,7 +916,7 @@ func DecodeMessageReplyHeader(buf *bin.Buffer) (MessageReplyHeaderClass, error) } switch id { case MessageReplyHeaderTypeID: - // Decoding messageReplyHeader#6eebcabd. + // Decoding messageReplyHeader#afbc09db. v := MessageReplyHeader{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageReplyHeaderClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_messages_bot_app_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_bot_app_gen.go index 036bf4f1..5990a12f 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_bot_app_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_bot_app_gen.go @@ -32,10 +32,10 @@ var ( ) // MessagesBotApp represents TL type `messages.botApp#eb50adf5`. -// Contains information about a named bot web app¹ +// Contains information about a named Mini App¹ // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-bot-web-apps +// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps // // See https://core.telegram.org/constructor/messages.botApp for reference. type MessagesBotApp struct { @@ -53,7 +53,7 @@ type MessagesBotApp struct { // Links: // 1) https://core.telegram.org/method/messages.requestAppWebView RequestWriteAccess bool - // HasSettings field of MessagesBotApp. + // Deprecated flag, can be ignored. HasSettings bool // Bot app information App BotAppClass diff --git a/vendor/github.com/gotd/td/tg/tl_messages_bot_results_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_bot_results_gen.go index 2bb15d1f..8faa3516 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_bot_results_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_bot_results_gen.go @@ -55,10 +55,10 @@ type MessagesBotResults struct { // Use SetSwitchPm and GetSwitchPm helpers. SwitchPm InlineBotSwitchPM // Shown as a button on top of the remaining inline result list; if clicked, opens the - // specified bot web app¹. + // specified inline mode mini app¹. // // Links: - // 1) https://core.telegram.org/api/bots/webapps#simple-web-apps + // 1) https://core.telegram.org/api/bots/webapps#inline-mode-mini-apps // // Use SetSwitchWebview and GetSwitchWebview helpers. SwitchWebview InlineBotWebView diff --git a/vendor/github.com/gotd/td/tg/tl_messages_check_chat_invite_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_check_chat_invite_gen.go index 4269b30f..ea9b5066 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_check_chat_invite_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_check_chat_invite_gen.go @@ -170,7 +170,6 @@ func (c *MessagesCheckChatInviteRequest) GetHash() (value string) { // Possible errors: // // 406 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. -// 500 CHAT_MEMBERS_CHANNEL: // 400 INVITE_HASH_EMPTY: The invite hash is empty. // 406 INVITE_HASH_EXPIRED: The invite link has expired. // 400 INVITE_HASH_INVALID: The invite hash is invalid. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_create_chat_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_create_chat_gen.go index c7d0df89..57888018 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_create_chat_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_create_chat_gen.go @@ -308,6 +308,7 @@ func (c *MessagesCreateChatRequest) MapUsers() (value InputUserClassArray) { // 400 CHAT_INVALID: Invalid chat. // 400 CHAT_TITLE_EMPTY: No chat title provided. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. +// 400 TTL_PERIOD_INVALID: The specified TTL period is invalid. // 400 USERS_TOO_FEW: Not enough users (to create a chat, for example). // 406 USER_RESTRICTED: You're spamreported, you can't create channels or chats. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_discard_encryption_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_discard_encryption_gen.go index 5eb95022..6b79742b 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_discard_encryption_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_discard_encryption_gen.go @@ -223,6 +223,7 @@ func (d *MessagesDiscardEncryptionRequest) GetChatID() (value int) { // Possible errors: // // 400 CHAT_ID_EMPTY: The provided chat ID is empty. +// 400 ENCRYPTION_ALREADY_ACCEPTED: Secret chat already accepted. // 400 ENCRYPTION_ALREADY_DECLINED: The secret chat was already declined. // 400 ENCRYPTION_ID_INVALID: The provided secret chat ID is invalid. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_discussion_message_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_discussion_message_gen.go index 374e1e4a..0368c31f 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_discussion_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_discussion_message_gen.go @@ -44,7 +44,8 @@ type MessagesDiscussionMessage struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Discussion messages + // The messages from which the thread starts. The messages are returned in reverse + // chronological order (i.e., in order of decreasing message ID). Messages []MessageClass // Message ID of latest reply in this thread¹ // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_edit_chat_photo_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_edit_chat_photo_gen.go index b88b9e6c..55d3ba95 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_edit_chat_photo_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_edit_chat_photo_gen.go @@ -200,6 +200,7 @@ func (e *MessagesEditChatPhotoRequest) GetPhoto() (value InputChatPhotoClass) { // // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. +// 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 PHOTO_CROP_SIZE_SMALL: Photo is too small. // 400 PHOTO_EXT_INVALID: The extension of the photo is invalid. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_edit_inline_bot_message_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_edit_inline_bot_message_gen.go index f5f6f623..56023411 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_edit_inline_bot_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_edit_inline_bot_message_gen.go @@ -43,7 +43,8 @@ type MessagesEditInlineBotMessageRequest struct { Flags bin.Fields // Disable webpage preview NoWebpage bool - // InvertMedia field of MessagesEditInlineBotMessageRequest. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // Sent inline message ID ID InputBotInlineMessageIDClass diff --git a/vendor/github.com/gotd/td/tg/tl_messages_edit_message_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_edit_message_gen.go index 16509864..f6682d03 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_edit_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_edit_message_gen.go @@ -43,7 +43,8 @@ type MessagesEditMessageRequest struct { Flags bin.Fields // Disable webpage preview NoWebpage bool - // InvertMedia field of MessagesEditMessageRequest. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // Where was the message sent Peer InputPeerClass @@ -585,12 +586,14 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // 400 DOCUMENT_INVALID: The specified document is invalid. // 400 ENTITIES_TOO_LONG: You provided too many styled message entities. // 400 ENTITY_BOUNDS_INVALID: A specified entity offset or length is invalid, see here » for info on how to properly compute the entity offset/length. +// 400 FILE_PARTS_INVALID: The number of file parts is invalid. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 403 INLINE_BOT_REQUIRED: Only the inline bot can edit message. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MEDIA_CAPTION_TOO_LONG: The caption is too long. // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MEDIA_GROUPED_INVALID: You tried to send media of different types in an album. +// 400 MEDIA_INVALID: Media invalid. // 400 MEDIA_NEW_INVALID: The new media is invalid. // 400 MEDIA_PREV_INVALID: Previous media invalid. // 400 MEDIA_TTL_INVALID: The specified media TTL is invalid. @@ -601,6 +604,7 @@ func (e *MessagesEditMessageRequest) MapEntities() (value MessageEntityClassArra // 400 MESSAGE_NOT_MODIFIED: The provided message data is identical to the previous message data, the message wasn't modified. // 400 MESSAGE_TOO_LONG: The provided message is too long. // 400 MSG_ID_INVALID: Invalid message ID provided. +// 500 MSG_WAIT_FAILED: A waiting call returned an error. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 SCHEDULE_DATE_INVALID: Invalid schedule date provided. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_export_chat_invite_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_export_chat_invite_gen.go index 7047f822..1aa0dd0d 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_export_chat_invite_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_export_chat_invite_gen.go @@ -415,6 +415,7 @@ func (e *MessagesExportChatInviteRequest) GetTitle() (value string, ok bool) { // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 EXPIRE_DATE_INVALID: The specified expiration date is invalid. +// 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 USAGE_LIMIT_INVALID: The specified usage limit is invalid. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_forum_topics_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_forum_topics_gen.go index 56d806ed..0c2965d2 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_forum_topics_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_forum_topics_gen.go @@ -45,7 +45,7 @@ type MessagesForumTopics struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Whether the returned topics are ordered by creation date; if set, pagination by - // next_offset should use forumTopic¹.date; otherwise topics are ordered by the last + // offset_date should use forumTopic¹.date; otherwise topics are ordered by the last // message date, so paginate by the date of the message² referenced by forumTopic³ // top_message. // @@ -54,7 +54,7 @@ type MessagesForumTopics struct { // 2) https://core.telegram.org/type/Message // 3) https://core.telegram.org/constructor/forumTopic OrderByCreateDate bool - // Total number of topics matching query; may be less than the topics contained in topics + // Total number of topics matching query; may be more than the topics contained in topics // in which case pagination¹ is required. // // Links: diff --git a/vendor/github.com/gotd/td/tg/tl_messages_forward_messages_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_forward_messages_gen.go index c50398c6..f39c13e9 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_forward_messages_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_forward_messages_gen.go @@ -680,6 +680,7 @@ func (f *MessagesForwardMessagesRequest) GetSendAs() (value InputPeerClass, ok b // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted. // 403 CHAT_SEND_AUDIOS_FORBIDDEN: You can't send audio messages in this chat. +// 403 CHAT_SEND_DOCS_FORBIDDEN: You can't send documents in this chat. // 403 CHAT_SEND_GAME_FORBIDDEN: You can't send a game to this chat. // 403 CHAT_SEND_GIFS_FORBIDDEN: You can't send gifs in this chat. // 403 CHAT_SEND_MEDIA_FORBIDDEN: You can't send media in this chat. @@ -696,6 +697,7 @@ func (f *MessagesForwardMessagesRequest) GetSendAs() (value InputPeerClass, ok b // 400 MESSAGE_IDS_EMPTY: No message ids were provided. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. +// 406 PAYMENT_UNSUPPORTED: A detailed description of the error will be received separately as described here ». // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 QUIZ_ANSWER_MISSING: You can forward a quiz while hiding the original author only after choosing an option in the quiz. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. @@ -703,13 +705,14 @@ func (f *MessagesForwardMessagesRequest) GetSendAs() (value InputPeerClass, ok b // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. -// 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. // 400 SLOWMODE_MULTI_MSGS_DISABLED: Slowmode is enabled, you cannot forward multiple messages to this group. +// 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. // 406 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore. // 406 TOPIC_DELETED: The specified topic was deleted. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // 403 USER_IS_BLOCKED: You were blocked by this user. // 400 USER_IS_BOT: Bots can't send messages to other bots. +// 403 VOICE_MESSAGES_FORBIDDEN: This user's privacy settings forbid you from sending voice messages. // 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.forwardMessages for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bot_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bot_gen.go index d21107b7..d6938261 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bot_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bot_gen.go @@ -32,7 +32,7 @@ var ( ) // MessagesGetAttachMenuBotRequest represents TL type `messages.getAttachMenuBot#77216192`. -// Returns attachment menu entry for a bot web app that can be launched from the +// Returns attachment menu entry for a bot mini app that can be launched from the // attachment menu »¹ // // Links: @@ -171,7 +171,7 @@ func (g *MessagesGetAttachMenuBotRequest) GetBot() (value InputUserClass) { } // MessagesGetAttachMenuBot invokes method messages.getAttachMenuBot#77216192 returning error if any. -// Returns attachment menu entry for a bot web app that can be launched from the +// Returns attachment menu entry for a bot mini app that can be launched from the // attachment menu »¹ // // Links: diff --git a/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bots_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bots_gen.go index ef523dd6..ca2b3616 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bots_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_get_attach_menu_bots_gen.go @@ -32,7 +32,7 @@ var ( ) // MessagesGetAttachMenuBotsRequest represents TL type `messages.getAttachMenuBots#16fcc2cb`. -// Returns installed attachment menu bot web apps »¹ +// Returns installed attachment menu bot mini apps »¹ // // Links: // 1. https://core.telegram.org/api/bots/attach @@ -168,7 +168,7 @@ func (g *MessagesGetAttachMenuBotsRequest) GetHash() (value int64) { } // MessagesGetAttachMenuBots invokes method messages.getAttachMenuBots#16fcc2cb returning error if any. -// Returns installed attachment menu bot web apps »¹ +// Returns installed attachment menu bot mini apps »¹ // // Links: // 1. https://core.telegram.org/api/bots/attach diff --git a/vendor/github.com/gotd/td/tg/tl_messages_get_bot_app_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_get_bot_app_gen.go index 97d4db9e..a77d4c0d 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_get_bot_app_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_get_bot_app_gen.go @@ -32,17 +32,17 @@ var ( ) // MessagesGetBotAppRequest represents TL type `messages.getBotApp#34fdc5c3`. -// Obtain information about a named bot web app¹ +// Obtain information about a named Mini App¹ // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-bot-web-apps +// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps // // See https://core.telegram.org/method/messages.getBotApp for reference. type MessagesGetBotAppRequest struct { - // Bot app information obtained from a named bot web app deep link »¹. + // Bot app information obtained from a named Mini App deep link »¹. // // Links: - // 1) https://core.telegram.org/api/links#named-bot-web-app-links + // 1) https://core.telegram.org/api/links#named-mini-app-links App InputBotAppClass // Hash for pagination, for more info click here¹ // @@ -203,10 +203,10 @@ func (g *MessagesGetBotAppRequest) GetHash() (value int64) { } // MessagesGetBotApp invokes method messages.getBotApp#34fdc5c3 returning error if any. -// Obtain information about a named bot web app¹ +// Obtain information about a named Mini App¹ // // Links: -// 1. https://core.telegram.org/api/bots/webapps#named-bot-web-apps +// 1. https://core.telegram.org/api/bots/webapps#named-mini-apps // // Possible errors: // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_get_message_reactions_list_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_get_message_reactions_list_gen.go index c38073fb..7b7ad00d 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_get_message_reactions_list_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_get_message_reactions_list_gen.go @@ -360,7 +360,7 @@ func (g *MessagesGetMessageReactionsListRequest) GetLimit() (value int) { // // Possible errors: // -// 403 BROADCAST_FORBIDDEN: Participants of polls in channels should stay anonymous. +// 403 BROADCAST_FORBIDDEN: Channel poll voters and reactions cannot be fetched to prevent deanonymization. // 400 MSG_ID_INVALID: Invalid message ID provided. // // See https://core.telegram.org/method/messages.getMessageReactionsList for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_get_poll_votes_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_get_poll_votes_gen.go index edc33408..ba3e1900 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_get_poll_votes_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_get_poll_votes_gen.go @@ -349,7 +349,7 @@ func (g *MessagesGetPollVotesRequest) GetLimit() (value int) { // // Possible errors: // -// 403 BROADCAST_FORBIDDEN: Participants of polls in channels should stay anonymous. +// 403 BROADCAST_FORBIDDEN: Channel poll voters and reactions cannot be fetched to prevent deanonymization. // 400 MSG_ID_INVALID: Invalid message ID provided. // 403 POLL_VOTE_REQUIRED: Cast a vote in the poll before calling this method. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_hide_all_chat_join_requests_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_hide_all_chat_join_requests_gen.go index bc980083..3daaee0b 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_hide_all_chat_join_requests_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_hide_all_chat_join_requests_gen.go @@ -288,6 +288,7 @@ func (h *MessagesHideAllChatJoinRequestsRequest) GetLink() (value string, ok boo // Possible errors: // // 400 CHANNELS_TOO_MUCH: You have joined too many channels/supergroups. +// 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_hide_peer_settings_bar_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_hide_peer_settings_bar_gen.go index 0c5a3b3a..3ee9f73d 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_hide_peer_settings_bar_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_hide_peer_settings_bar_gen.go @@ -32,12 +32,13 @@ var ( ) // MessagesHidePeerSettingsBarRequest represents TL type `messages.hidePeerSettingsBar#4facb138`. -// Should be called after the user hides the report spam/add as contact bar of a new chat -// effectively prevents the user from executing the actions specified in the peer's -// settings¹. +// Should be called after the user hides the report spam/add as contact bar¹ of a new +// chat, effectively prevents the user from executing the actions specified in the action +// bar »². // // Links: -// 1. https://core.telegram.org/constructor/peerSettings +// 1. https://core.telegram.org/api/action-bar +// 2. https://core.telegram.org/api/action-bar // // See https://core.telegram.org/method/messages.hidePeerSettingsBar for reference. type MessagesHidePeerSettingsBarRequest struct { @@ -172,12 +173,13 @@ func (h *MessagesHidePeerSettingsBarRequest) GetPeer() (value InputPeerClass) { } // MessagesHidePeerSettingsBar invokes method messages.hidePeerSettingsBar#4facb138 returning error if any. -// Should be called after the user hides the report spam/add as contact bar of a new chat -// effectively prevents the user from executing the actions specified in the peer's -// settings¹. +// Should be called after the user hides the report spam/add as contact bar¹ of a new +// chat, effectively prevents the user from executing the actions specified in the action +// bar »². // // Links: -// 1. https://core.telegram.org/constructor/peerSettings +// 1. https://core.telegram.org/api/action-bar +// 2. https://core.telegram.org/api/action-bar // // See https://core.telegram.org/method/messages.hidePeerSettingsBar for reference. func (c *Client) MessagesHidePeerSettingsBar(ctx context.Context, peer InputPeerClass) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_messages_migrate_chat_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_migrate_chat_gen.go index ee689513..41a92d9c 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_migrate_chat_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_migrate_chat_gen.go @@ -178,6 +178,7 @@ func (m *MessagesMigrateChatRequest) GetChatID() (value int64) { // 400 CHANNELS_TOO_MUCH: You have joined too many channels/supergroups. // 403 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_ID_INVALID: The provided chat id is invalid. +// 500 CHAT_INVALID: Invalid chat. // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/messages.migrateChat for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_prolong_web_view_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_prolong_web_view_gen.go index 95db4337..5a9ee792 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_prolong_web_view_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_prolong_web_view_gen.go @@ -61,7 +61,12 @@ type MessagesProlongWebViewRequest struct { // Links: // 1) https://core.telegram.org/method/messages.requestWebView QueryID int64 - // ReplyTo field of MessagesProlongWebViewRequest. + // If set, indicates that the inline message that will be sent by the bot on behalf of + // the user once the web app interaction is terminated¹ should be sent in reply to the + // specified message or story. + // + // Links: + // 1) https://core.telegram.org/method/messages.sendWebViewResultMessage // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass diff --git a/vendor/github.com/gotd/td/tg/tl_messages_read_discussion_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_read_discussion_gen.go index c8ae6a58..c01faf5d 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_read_discussion_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_read_discussion_gen.go @@ -231,6 +231,7 @@ func (r *MessagesReadDiscussionRequest) GetReadMaxID() (value int) { // // Possible errors: // +// 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_request_app_web_view_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_request_app_web_view_gen.go index 2287d5d5..1246020e 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_request_app_web_view_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_request_app_web_view_gen.go @@ -32,14 +32,14 @@ var ( ) // MessagesRequestAppWebViewRequest represents TL type `messages.requestAppWebView#8c5a3b3c`. -// Open a bot web app¹ from a named bot web app deep link², sending over user -// information after user confirmation. +// Open a bot mini app¹ from a named Mini App deep link², sending over user information +// after user confirmation. // After calling this method, until the user closes the webview, messages // prolongWebView¹ must be called every 60 seconds. // // Links: // 1. https://core.telegram.org/bots/webapps -// 2. https://core.telegram.org/api/links#named-bot-web-app-links +// 2. https://core.telegram.org/api/links#named-mini-app-links // 3. https://core.telegram.org/method/messages.prolongWebView // // See https://core.telegram.org/method/messages.requestAppWebView for reference. @@ -50,26 +50,26 @@ type MessagesRequestAppWebViewRequest struct { // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Set this flag if the bot is asking permission to send messages to the user as - // specified in the named bot web app deep link¹ docs, and the user agreed. + // specified in the named Mini App deep link¹ docs, and the user agreed. // // Links: - // 1) https://core.telegram.org/api/links#named-bot-web-app-links + // 1) https://core.telegram.org/api/links#named-mini-app-links WriteAllowed bool // If the client has clicked on the link in a Telegram chat, pass the chat's peer // information; otherwise pass the bot's peer information, instead. Peer InputPeerClass - // The app obtained by invoking messages.getBotApp¹ as specified in the named bot web - // app deep link² docs. + // The app obtained by invoking messages.getBotApp¹ as specified in the named Mini App + // deep link² docs. // // Links: // 1) https://core.telegram.org/method/messages.getBotApp - // 2) https://core.telegram.org/api/links#named-bot-web-app-links + // 2) https://core.telegram.org/api/links#named-mini-app-links App InputBotAppClass - // If the startapp query string parameter is present in the named bot web app deep link¹ + // If the startapp query string parameter is present in the named Mini App deep link¹, // pass it to start_param. // // Links: - // 1) https://core.telegram.org/api/links#named-bot-web-app-links + // 1) https://core.telegram.org/api/links#named-mini-app-links // // Use SetStartParam and GetStartParam helpers. StartParam string @@ -403,14 +403,14 @@ func (r *MessagesRequestAppWebViewRequest) GetPlatform() (value string) { } // MessagesRequestAppWebView invokes method messages.requestAppWebView#8c5a3b3c returning error if any. -// Open a bot web app¹ from a named bot web app deep link², sending over user -// information after user confirmation. +// Open a bot mini app¹ from a named Mini App deep link², sending over user information +// after user confirmation. // After calling this method, until the user closes the webview, messages // prolongWebView¹ must be called every 60 seconds. // // Links: // 1. https://core.telegram.org/bots/webapps -// 2. https://core.telegram.org/api/links#named-bot-web-app-links +// 2. https://core.telegram.org/api/links#named-mini-app-links // 3. https://core.telegram.org/method/messages.prolongWebView // // See https://core.telegram.org/method/messages.requestAppWebView for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_request_simple_web_view_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_request_simple_web_view_gen.go index 9835e12a..49c6aeb7 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_request_simple_web_view_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_request_simple_web_view_gen.go @@ -32,7 +32,7 @@ var ( ) // MessagesRequestSimpleWebViewRequest represents TL type `messages.requestSimpleWebView#1a46500a`. -// Open a bot web app¹. +// Open a bot mini app¹. // // Links: // 1. https://core.telegram.org/api/bots/webapps @@ -50,15 +50,23 @@ type MessagesRequestSimpleWebViewRequest struct { // Links: // 1) https://core.telegram.org/method/messages.getInlineBotResults FromSwitchWebview bool - // FromSideMenu field of MessagesRequestSimpleWebViewRequest. + // Set this flag if opening the Mini App from the installed side menu entry »¹ or from + // a Mini App link »². + // + // Links: + // 1) https://core.telegram.org/api/bots/attach + // 2) https://core.telegram.org/api/links#mini-app-links FromSideMenu bool - // Bot that owns the webapp + // Bot that owns the mini app Bot InputUserClass - // Web app URL + // Web app URL, if opening from a keyboard button or inline result // // Use SetURL and GetURL helpers. URL string - // StartParam field of MessagesRequestSimpleWebViewRequest. + // Start parameter, if opening from a Mini App link »¹. + // + // Links: + // 1) https://core.telegram.org/api/links#mini-app-links // // Use SetStartParam and GetStartParam helpers. StartParam string @@ -439,7 +447,7 @@ func (r *MessagesRequestSimpleWebViewRequest) GetPlatform() (value string) { } // MessagesRequestSimpleWebView invokes method messages.requestSimpleWebView#1a46500a returning error if any. -// Open a bot web app¹. +// Open a bot mini app¹. // // Links: // 1. https://core.telegram.org/api/bots/webapps diff --git a/vendor/github.com/gotd/td/tg/tl_messages_request_web_view_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_request_web_view_gen.go index e9dadf8d..45e7ed4e 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_request_web_view_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_request_web_view_gen.go @@ -32,7 +32,7 @@ var ( ) // MessagesRequestWebViewRequest represents TL type `messages.requestWebView#269dc2c1`. -// Open a bot web app¹, sending over user information after user confirmation. +// Open a bot mini app¹, sending over user information after user confirmation. // After calling this method, until the user closes the webview, messages // prolongWebView¹ must be called every 60 seconds. // @@ -81,7 +81,7 @@ type MessagesRequestWebViewRequest struct { // start_param should contain the data from the startattach parameter. // // Links: - // 1) https://core.telegram.org/api/links#bot-attachment-menu-links + // 1) https://core.telegram.org/api/links#bot-attachment-or-side-menu-links // // Use SetStartParam and GetStartParam helpers. StartParam string @@ -94,7 +94,12 @@ type MessagesRequestWebViewRequest struct { ThemeParams DataJSON // Short name of the application; 0-64 English letters, digits, and underscores Platform string - // ReplyTo field of MessagesRequestWebViewRequest. + // If set, indicates that the inline message that will be sent by the bot on behalf of + // the user once the web app interaction is terminated¹ should be sent in reply to the + // specified message or story. + // + // Links: + // 1) https://core.telegram.org/method/messages.sendWebViewResultMessage // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -599,7 +604,7 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo } // MessagesRequestWebView invokes method messages.requestWebView#269dc2c1 returning error if any. -// Open a bot web app¹, sending over user information after user confirmation. +// Open a bot mini app¹, sending over user information after user confirmation. // After calling this method, until the user closes the webview, messages // prolongWebView¹ must be called every 60 seconds. // @@ -607,6 +612,11 @@ func (r *MessagesRequestWebViewRequest) GetSendAs() (value InputPeerClass, ok bo // 1. https://core.telegram.org/bots/webapps // 2. https://core.telegram.org/method/messages.prolongWebView // +// Possible errors: +// +// 400 BOT_INVALID: This is not a valid bot. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// // See https://core.telegram.org/method/messages.requestWebView for reference. func (c *Client) MessagesRequestWebView(ctx context.Context, request *MessagesRequestWebViewRequest) (*WebViewResultURL, error) { var result WebViewResultURL diff --git a/vendor/github.com/gotd/td/tg/tl_messages_save_draft_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_save_draft_gen.go index 86f965cf..8301f491 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_save_draft_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_save_draft_gen.go @@ -46,9 +46,11 @@ type MessagesSaveDraftRequest struct { Flags bin.Fields // Disable generation of the webpage preview NoWebpage bool - // InvertMedia field of MessagesSaveDraftRequest. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool - // ReplyTo field of MessagesSaveDraftRequest. + // If set, indicates that the message should be sent in reply to the specified message or + // story. // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -63,7 +65,7 @@ type MessagesSaveDraftRequest struct { // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // Media field of MessagesSaveDraftRequest. + // Attached media // // Use SetMedia and GetMedia helpers. Media InputMediaClass diff --git a/vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_gen.go new file mode 100644 index 00000000..6c1e7d99 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_gen.go @@ -0,0 +1,267 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// MessagesSearchEmojiStickerSetsRequest represents TL type `messages.searchEmojiStickerSets#92b4494c`. +// Search for custom emoji stickersets »¹ +// +// Links: +// 1. https://core.telegram.org/api/custom-emoji +// +// See https://core.telegram.org/method/messages.searchEmojiStickerSets for reference. +type MessagesSearchEmojiStickerSetsRequest struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // Exclude featured stickersets from results + ExcludeFeatured bool + // Query string + Q string + // Hash for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation + Hash int64 +} + +// MessagesSearchEmojiStickerSetsRequestTypeID is TL type id of MessagesSearchEmojiStickerSetsRequest. +const MessagesSearchEmojiStickerSetsRequestTypeID = 0x92b4494c + +// Ensuring interfaces in compile-time for MessagesSearchEmojiStickerSetsRequest. +var ( + _ bin.Encoder = &MessagesSearchEmojiStickerSetsRequest{} + _ bin.Decoder = &MessagesSearchEmojiStickerSetsRequest{} + _ bin.BareEncoder = &MessagesSearchEmojiStickerSetsRequest{} + _ bin.BareDecoder = &MessagesSearchEmojiStickerSetsRequest{} +) + +func (s *MessagesSearchEmojiStickerSetsRequest) Zero() bool { + if s == nil { + return true + } + if !(s.Flags.Zero()) { + return false + } + if !(s.ExcludeFeatured == false) { + return false + } + if !(s.Q == "") { + return false + } + if !(s.Hash == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *MessagesSearchEmojiStickerSetsRequest) String() string { + if s == nil { + return "MessagesSearchEmojiStickerSetsRequest(nil)" + } + type Alias MessagesSearchEmojiStickerSetsRequest + return fmt.Sprintf("MessagesSearchEmojiStickerSetsRequest%+v", Alias(*s)) +} + +// FillFrom fills MessagesSearchEmojiStickerSetsRequest from given interface. +func (s *MessagesSearchEmojiStickerSetsRequest) FillFrom(from interface { + GetExcludeFeatured() (value bool) + GetQ() (value string) + GetHash() (value int64) +}) { + s.ExcludeFeatured = from.GetExcludeFeatured() + s.Q = from.GetQ() + s.Hash = from.GetHash() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessagesSearchEmojiStickerSetsRequest) TypeID() uint32 { + return MessagesSearchEmojiStickerSetsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessagesSearchEmojiStickerSetsRequest) TypeName() string { + return "messages.searchEmojiStickerSets" +} + +// TypeInfo returns info about TL type. +func (s *MessagesSearchEmojiStickerSetsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messages.searchEmojiStickerSets", + ID: MessagesSearchEmojiStickerSetsRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ExcludeFeatured", + SchemaName: "exclude_featured", + Null: !s.Flags.Has(0), + }, + { + Name: "Q", + SchemaName: "q", + }, + { + Name: "Hash", + SchemaName: "hash", + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (s *MessagesSearchEmojiStickerSetsRequest) SetFlags() { + if !(s.ExcludeFeatured == false) { + s.Flags.Set(0) + } +} + +// Encode implements bin.Encoder. +func (s *MessagesSearchEmojiStickerSetsRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode messages.searchEmojiStickerSets#92b4494c as nil") + } + b.PutID(MessagesSearchEmojiStickerSetsRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *MessagesSearchEmojiStickerSetsRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode messages.searchEmojiStickerSets#92b4494c as nil") + } + s.SetFlags() + if err := s.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode messages.searchEmojiStickerSets#92b4494c: field flags: %w", err) + } + b.PutString(s.Q) + b.PutLong(s.Hash) + return nil +} + +// Decode implements bin.Decoder. +func (s *MessagesSearchEmojiStickerSetsRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode messages.searchEmojiStickerSets#92b4494c to nil") + } + if err := b.ConsumeID(MessagesSearchEmojiStickerSetsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode messages.searchEmojiStickerSets#92b4494c: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *MessagesSearchEmojiStickerSetsRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode messages.searchEmojiStickerSets#92b4494c to nil") + } + { + if err := s.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode messages.searchEmojiStickerSets#92b4494c: field flags: %w", err) + } + } + s.ExcludeFeatured = s.Flags.Has(0) + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode messages.searchEmojiStickerSets#92b4494c: field q: %w", err) + } + s.Q = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode messages.searchEmojiStickerSets#92b4494c: field hash: %w", err) + } + s.Hash = value + } + return nil +} + +// SetExcludeFeatured sets value of ExcludeFeatured conditional field. +func (s *MessagesSearchEmojiStickerSetsRequest) SetExcludeFeatured(value bool) { + if value { + s.Flags.Set(0) + s.ExcludeFeatured = true + } else { + s.Flags.Unset(0) + s.ExcludeFeatured = false + } +} + +// GetExcludeFeatured returns value of ExcludeFeatured conditional field. +func (s *MessagesSearchEmojiStickerSetsRequest) GetExcludeFeatured() (value bool) { + if s == nil { + return + } + return s.Flags.Has(0) +} + +// GetQ returns value of Q field. +func (s *MessagesSearchEmojiStickerSetsRequest) GetQ() (value string) { + if s == nil { + return + } + return s.Q +} + +// GetHash returns value of Hash field. +func (s *MessagesSearchEmojiStickerSetsRequest) GetHash() (value int64) { + if s == nil { + return + } + return s.Hash +} + +// MessagesSearchEmojiStickerSets invokes method messages.searchEmojiStickerSets#92b4494c returning error if any. +// Search for custom emoji stickersets »¹ +// +// Links: +// 1. https://core.telegram.org/api/custom-emoji +// +// See https://core.telegram.org/method/messages.searchEmojiStickerSets for reference. +func (c *Client) MessagesSearchEmojiStickerSets(ctx context.Context, request *MessagesSearchEmojiStickerSetsRequest) (MessagesFoundStickerSetsClass, error) { + var result MessagesFoundStickerSetsBox + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return result.FoundStickerSets, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_messages_search_emoji_sticker_sets_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_messages_search_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_search_gen.go index 0bfbb0b3..d8fb9b0c 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_search_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_search_gen.go @@ -32,7 +32,7 @@ var ( ) // MessagesSearchRequest represents TL type `messages.search#a0fda762`. -// Returns found messages +// Search for messages. // // See https://core.telegram.org/method/messages.search for reference. type MessagesSearchRequest struct { @@ -41,11 +41,14 @@ type MessagesSearchRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // User or chat, histories with which are searched, or (inputPeerEmpty)¹ constructor for - // global search + // User or chat, histories with which are searched, or (inputPeerEmpty)¹ constructor to + // search in all private chats and normal groups (not channels) »². Use messages + // searchGlobal³ to search globally in all chats, groups, supergroups and channels. // // Links: // 1) https://core.telegram.org/constructor/inputPeerEmpty + // 2) https://core.telegram.org/api/channel + // 3) https://core.telegram.org/method/messages.searchGlobal Peer InputPeerClass // Text search request Q string @@ -588,7 +591,7 @@ func (s *MessagesSearchRequest) GetHash() (value int64) { } // MessagesSearch invokes method messages.search#a0fda762 returning error if any. -// Returns found messages +// Search for messages. // // Possible errors: // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_bot_requested_peer_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_bot_requested_peer_gen.go index cb2d07d0..ca43a475 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_bot_requested_peer_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_bot_requested_peer_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// MessagesSendBotRequestedPeerRequest represents TL type `messages.sendBotRequestedPeer#fe38d01b`. +// MessagesSendBotRequestedPeerRequest represents TL type `messages.sendBotRequestedPeer#91b2d060`. // Send a chosen peer, as requested by a keyboardButtonRequestPeer¹ button. // // Links: @@ -55,12 +55,12 @@ type MessagesSendBotRequestedPeerRequest struct { // Links: // 1) https://core.telegram.org/constructor/keyboardButtonRequestPeer ButtonID int - // The chosen peer. - RequestedPeer InputPeerClass + // RequestedPeers field of MessagesSendBotRequestedPeerRequest. + RequestedPeers []InputPeerClass } // MessagesSendBotRequestedPeerRequestTypeID is TL type id of MessagesSendBotRequestedPeerRequest. -const MessagesSendBotRequestedPeerRequestTypeID = 0xfe38d01b +const MessagesSendBotRequestedPeerRequestTypeID = 0x91b2d060 // Ensuring interfaces in compile-time for MessagesSendBotRequestedPeerRequest. var ( @@ -83,7 +83,7 @@ func (s *MessagesSendBotRequestedPeerRequest) Zero() bool { if !(s.ButtonID == 0) { return false } - if !(s.RequestedPeer == nil) { + if !(s.RequestedPeers == nil) { return false } @@ -104,12 +104,12 @@ func (s *MessagesSendBotRequestedPeerRequest) FillFrom(from interface { GetPeer() (value InputPeerClass) GetMsgID() (value int) GetButtonID() (value int) - GetRequestedPeer() (value InputPeerClass) + GetRequestedPeers() (value []InputPeerClass) }) { s.Peer = from.GetPeer() s.MsgID = from.GetMsgID() s.ButtonID = from.GetButtonID() - s.RequestedPeer = from.GetRequestedPeer() + s.RequestedPeers = from.GetRequestedPeers() } // TypeID returns type id in TL schema. @@ -148,8 +148,8 @@ func (s *MessagesSendBotRequestedPeerRequest) TypeInfo() tdp.Type { SchemaName: "button_id", }, { - Name: "RequestedPeer", - SchemaName: "requested_peer", + Name: "RequestedPeers", + SchemaName: "requested_peers", }, } return typ @@ -158,7 +158,7 @@ func (s *MessagesSendBotRequestedPeerRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *MessagesSendBotRequestedPeerRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.sendBotRequestedPeer#fe38d01b as nil") + return fmt.Errorf("can't encode messages.sendBotRequestedPeer#91b2d060 as nil") } b.PutID(MessagesSendBotRequestedPeerRequestTypeID) return s.EncodeBare(b) @@ -167,21 +167,24 @@ func (s *MessagesSendBotRequestedPeerRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *MessagesSendBotRequestedPeerRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode messages.sendBotRequestedPeer#fe38d01b as nil") + return fmt.Errorf("can't encode messages.sendBotRequestedPeer#91b2d060 as nil") } if s.Peer == nil { - return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#fe38d01b: field peer is nil") + return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#91b2d060: field peer is nil") } if err := s.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#fe38d01b: field peer: %w", err) + return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#91b2d060: field peer: %w", err) } b.PutInt(s.MsgID) b.PutInt(s.ButtonID) - if s.RequestedPeer == nil { - return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#fe38d01b: field requested_peer is nil") - } - if err := s.RequestedPeer.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#fe38d01b: field requested_peer: %w", err) + b.PutVectorHeader(len(s.RequestedPeers)) + for idx, v := range s.RequestedPeers { + if v == nil { + return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#91b2d060: field requested_peers element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode messages.sendBotRequestedPeer#91b2d060: field requested_peers element with index %d: %w", idx, err) + } } return nil } @@ -189,10 +192,10 @@ func (s *MessagesSendBotRequestedPeerRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *MessagesSendBotRequestedPeerRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.sendBotRequestedPeer#fe38d01b to nil") + return fmt.Errorf("can't decode messages.sendBotRequestedPeer#91b2d060 to nil") } if err := b.ConsumeID(MessagesSendBotRequestedPeerRequestTypeID); err != nil { - return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#fe38d01b: %w", err) + return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#91b2d060: %w", err) } return s.DecodeBare(b) } @@ -200,35 +203,45 @@ func (s *MessagesSendBotRequestedPeerRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *MessagesSendBotRequestedPeerRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode messages.sendBotRequestedPeer#fe38d01b to nil") + return fmt.Errorf("can't decode messages.sendBotRequestedPeer#91b2d060 to nil") } { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#fe38d01b: field peer: %w", err) + return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#91b2d060: field peer: %w", err) } s.Peer = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#fe38d01b: field msg_id: %w", err) + return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#91b2d060: field msg_id: %w", err) } s.MsgID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#fe38d01b: field button_id: %w", err) + return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#91b2d060: field button_id: %w", err) } s.ButtonID = value } { - value, err := DecodeInputPeer(b) + headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#fe38d01b: field requested_peer: %w", err) + return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#91b2d060: field requested_peers: %w", err) + } + + if headerLen > 0 { + s.RequestedPeers = make([]InputPeerClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeInputPeer(b) + if err != nil { + return fmt.Errorf("unable to decode messages.sendBotRequestedPeer#91b2d060: field requested_peers: %w", err) + } + s.RequestedPeers = append(s.RequestedPeers, value) } - s.RequestedPeer = value } return nil } @@ -257,15 +270,20 @@ func (s *MessagesSendBotRequestedPeerRequest) GetButtonID() (value int) { return s.ButtonID } -// GetRequestedPeer returns value of RequestedPeer field. -func (s *MessagesSendBotRequestedPeerRequest) GetRequestedPeer() (value InputPeerClass) { +// GetRequestedPeers returns value of RequestedPeers field. +func (s *MessagesSendBotRequestedPeerRequest) GetRequestedPeers() (value []InputPeerClass) { if s == nil { return } - return s.RequestedPeer + return s.RequestedPeers } -// MessagesSendBotRequestedPeer invokes method messages.sendBotRequestedPeer#fe38d01b returning error if any. +// MapRequestedPeers returns field RequestedPeers wrapped in InputPeerClassArray helper. +func (s *MessagesSendBotRequestedPeerRequest) MapRequestedPeers() (value InputPeerClassArray) { + return InputPeerClassArray(s.RequestedPeers) +} + +// MessagesSendBotRequestedPeer invokes method messages.sendBotRequestedPeer#91b2d060 returning error if any. // Send a chosen peer, as requested by a keyboardButtonRequestPeer¹ button. // // Links: diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_file_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_file_gen.go index 075605de..acb51068 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_file_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_file_gen.go @@ -317,6 +317,7 @@ func (s *MessagesSendEncryptedFileRequest) GetFileAsNotEmpty() (NotEmptyInputEnc // // Possible errors: // +// 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 DATA_TOO_LONG: Data too long. // 400 ENCRYPTION_DECLINED: The secret chat was declined. // 400 FILE_EMTPY: An empty file was provided. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_gen.go index 2ce8c628..ae715091 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_gen.go @@ -284,7 +284,7 @@ func (s *MessagesSendEncryptedRequest) GetData() (value []byte) { // 400 DATA_INVALID: Encrypted data invalid. // 400 DATA_TOO_LONG: Data too long. // 400 ENCRYPTION_DECLINED: The secret chat was declined. -// 400 MSG_WAIT_FAILED: A waiting call returned an error. +// 500 MSG_WAIT_FAILED: A waiting call returned an error. // 403 USER_IS_BLOCKED: You were blocked by this user. // // See https://core.telegram.org/method/messages.sendEncrypted for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_service_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_service_gen.go index a48271f5..9fc6cc90 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_service_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_encrypted_service_gen.go @@ -224,6 +224,7 @@ func (s *MessagesSendEncryptedServiceRequest) GetData() (value []byte) { // // Possible errors: // +// 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 DATA_INVALID: Encrypted data invalid. // 400 ENCRYPTION_DECLINED: The secret chat was declined. // 400 ENCRYPTION_ID_INVALID: The provided secret chat ID is invalid. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_inline_bot_result_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_inline_bot_result_gen.go index 18770fa6..74f8322f 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_inline_bot_result_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_inline_bot_result_gen.go @@ -62,7 +62,8 @@ type MessagesSendInlineBotResultRequest struct { HideVia bool // Destination Peer InputPeerClass - // ReplyTo field of MessagesSendInlineBotResultRequest. + // If set, indicates that the message should be sent in reply to the specified message or + // story. // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -610,8 +611,10 @@ func (s *MessagesSendInlineBotResultRequest) GetSendAs() (value InputPeerClass, // 400 QUERY_ID_EMPTY: The query ID is empty. // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 RESULT_ID_EMPTY: Result ID empty. +// 400 RESULT_ID_INVALID: One of the specified result IDs is invalid. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. +// 500 SEND_MEDIA_INVALID: // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. // 400 TOPIC_DELETED: The specified topic was deleted. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_media_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_media_gen.go index ecf6a319..13abe083 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_media_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_media_gen.go @@ -58,11 +58,13 @@ type MessagesSendMediaRequest struct { // Links: // 1) https://core.telegram.org/api/stickers#recent-stickersets UpdateStickersetsOrder bool - // InvertMedia field of MessagesSendMediaRequest. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // Destination Peer InputPeerClass - // ReplyTo field of MessagesSendMediaRequest. + // If set, indicates that the message should be sent in reply to the specified message or + // story. // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -798,6 +800,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 403 CHAT_SEND_GIFS_FORBIDDEN: You can't send gifs in this chat. // 403 CHAT_SEND_MEDIA_FORBIDDEN: You can't send media in this chat. // 403 CHAT_SEND_PHOTOS_FORBIDDEN: You can't send photos in this chat. +// 403 CHAT_SEND_PLAIN_FORBIDDEN: You can't send non-media (text) messages in this chat. // 403 CHAT_SEND_POLL_FORBIDDEN: You can't send polls in this chat. // 403 CHAT_SEND_STICKERS_FORBIDDEN: You can't send stickers in this chat. // 403 CHAT_SEND_VIDEOS_FORBIDDEN: You can't send videos in this chat. @@ -819,6 +822,7 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 MEDIA_CAPTION_TOO_LONG: The caption is too long. // 400 MEDIA_EMPTY: The provided media object is invalid. // 400 MEDIA_INVALID: Media invalid. +// 400 MESSAGE_EMPTY: The provided message is empty. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 PAYMENT_PROVIDER_INVALID: The specified payment provider is invalid. // 400 PEER_ID_INVALID: The provided peer id is invalid. @@ -855,6 +859,8 @@ func (s *MessagesSendMediaRequest) MapEntities() (value MessageEntityClassArray, // 400 WEBDOCUMENT_MIME_INVALID: Invalid webdocument mime type provided. // 400 WEBPAGE_CURL_FAILED: Failure while fetching the webpage with cURL. // 400 WEBPAGE_MEDIA_EMPTY: Webpage media empty. +// 400 WEBPAGE_NOT_FOUND: A preview for the specified webpage url could not be generated. +// 400 WEBPAGE_URL_INVALID: The specified webpage url is invalid. // 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.sendMedia for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_message_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_message_gen.go index 64e4283f..940b30d9 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_message_gen.go @@ -60,11 +60,13 @@ type MessagesSendMessageRequest struct { // Links: // 1) https://core.telegram.org/api/stickers#recent-stickersets UpdateStickersetsOrder bool - // InvertMedia field of MessagesSendMessageRequest. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // The destination where the message will be sent Peer InputPeerClass - // ReplyTo field of MessagesSendMessageRequest. + // If set, indicates that the message should be sent in reply to the specified message or + // story. // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -785,6 +787,7 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // // Possible errors: // +// 400 ADMIN_RIGHTS_EMPTY: // 400 BOT_DOMAIN_INVALID: Bot domain invalid. // 400 BOT_INVALID: This is not a valid bot. // 400 BUTTON_DATA_INVALID: The data of one or more of the buttons you provided is invalid. @@ -817,12 +820,15 @@ func (s *MessagesSendMessageRequest) MapEntities() (value MessageEntityClassArra // 500 RANDOM_ID_DUPLICATE: You provided a random ID that was already used. // 400 REPLY_MARKUP_INVALID: The provided reply markup is invalid. // 400 REPLY_MARKUP_TOO_LONG: The specified reply_markup is too long. +// 400 REPLY_TO_INVALID: The specified reply_to field is invalid. +// 400 REPLY_TO_USER_INVALID: The replied-to user is invalid. // 400 SCHEDULE_BOT_NOT_ALLOWED: Bots cannot schedule messages. // 400 SCHEDULE_DATE_TOO_LATE: You can't schedule a message this far in the future. // 400 SCHEDULE_STATUS_PRIVATE: Can't schedule until user is online, if the user's last seen timestamp is hidden by their privacy settings. // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. +// 400 STORY_ID_INVALID: The specified story ID is invalid. // 406 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore. // 406 TOPIC_DELETED: The specified topic was deleted. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_multi_media_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_multi_media_gen.go index f041ec59..84154be5 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_multi_media_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_multi_media_gen.go @@ -64,11 +64,13 @@ type MessagesSendMultiMediaRequest struct { // Links: // 1) https://core.telegram.org/api/stickers#recent-stickersets UpdateStickersetsOrder bool - // InvertMedia field of MessagesSendMultiMediaRequest. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // The destination chat Peer InputPeerClass - // ReplyTo field of MessagesSendMultiMediaRequest. + // If set, indicates that the message should be sent in reply to the specified message or + // story. // // Use SetReplyTo and GetReplyTo helpers. ReplyTo InputReplyToClass @@ -637,6 +639,7 @@ func (s *MessagesSendMultiMediaRequest) GetSendAs() (value InputPeerClass, ok bo // 400 SCHEDULE_TOO_MUCH: There are too many scheduled messages. // 400 SEND_AS_PEER_INVALID: You can't send messages as the specified peer. // 420 SLOWMODE_WAIT_%d: Slowmode is enabled in this chat: wait %d seconds before sending another message to this chat. +// 400 TOPIC_CLOSED: This topic was closed, you can't send messages to it anymore. // 400 TOPIC_DELETED: The specified topic was deleted. // 400 USER_BANNED_IN_CHANNEL: You're banned from sending messages in supergroups/channels. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_reaction_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_reaction_gen.go index 68df1c86..a3cacad8 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_reaction_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_reaction_gen.go @@ -48,7 +48,7 @@ type MessagesSendReactionRequest struct { Flags bin.Fields // Whether a bigger and longer reaction should be shown Big bool - // Add this reaction to the recent reactions list »¹. + // Whether to add this reaction to the recent reactions list »¹. // // Links: // 1) https://core.telegram.org/api/reactions#recent-reactions @@ -376,9 +376,11 @@ func (s *MessagesSendReactionRequest) MapReaction() (value ReactionClassArray, o // // Possible errors: // +// 403 ANONYMOUS_REACTIONS_DISABLED: // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. +// 400 CUSTOM_REACTIONS_TOO_MANY: Too many custom reactions were specified. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. // 400 MESSAGE_NOT_MODIFIED: The provided message data is identical to the previous message data, the message wasn't modified. // 400 MSG_ID_INVALID: Invalid message ID provided. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_screenshot_notification_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_screenshot_notification_gen.go index 21d9f267..7596eabf 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_screenshot_notification_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_screenshot_notification_gen.go @@ -38,7 +38,8 @@ var ( type MessagesSendScreenshotNotificationRequest struct { // Other user Peer InputPeerClass - // ReplyTo field of MessagesSendScreenshotNotificationRequest. + // Indicates the message that was screenshotted (the specified message ID can also be 0 + // to avoid indicating any specific message). ReplyTo InputReplyToClass // Random ID to avoid message resending RandomID int64 @@ -232,6 +233,7 @@ func (s *MessagesSendScreenshotNotificationRequest) GetRandomID() (value int64) // // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_ID_INVALID: The specified story ID is invalid. // 400 YOU_BLOCKED_USER: You blocked this user. // // See https://core.telegram.org/method/messages.sendScreenshotNotification for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_send_web_view_data_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_send_web_view_data_gen.go index d34011f1..e3886f72 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_send_web_view_data_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_send_web_view_data_gen.go @@ -32,7 +32,7 @@ var ( ) // MessagesSendWebViewDataRequest represents TL type `messages.sendWebViewData#dc0242c8`. -// Used by the user to relay data from an opened reply keyboard bot web app¹ to the bot +// Used by the user to relay data from an opened reply keyboard bot mini app¹ to the bot // that owns it. // // Links: @@ -258,7 +258,7 @@ func (s *MessagesSendWebViewDataRequest) GetData() (value string) { } // MessagesSendWebViewData invokes method messages.sendWebViewData#dc0242c8 returning error if any. -// Used by the user to relay data from an opened reply keyboard bot web app¹ to the bot +// Used by the user to relay data from an opened reply keyboard bot mini app¹ to the bot // that owns it. // // Links: diff --git a/vendor/github.com/gotd/td/tg/tl_messages_set_chat_wall_paper_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_set_chat_wall_paper_gen.go index 16ee031b..613f8eb2 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_set_chat_wall_paper_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_set_chat_wall_paper_gen.go @@ -44,6 +44,16 @@ type MessagesSetChatWallPaperRequest struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields + // Only for Premium¹ users, sets the specified wallpaper for both users of the chat, + // without requiring confirmation from the other user. + // + // Links: + // 1) https://core.telegram.org/api/premium + ForBoth bool + // If we don't like the new wallpaper the other user of the chat has chosen for us using + // the for_both flag, we can re-set our previous wallpaper just on our side using this + // flag. + Revert bool // The private chat where the wallpaper will be set Peer InputPeerClass // The wallpaper »¹, obtained as described in the wallpaper documentation »²; must @@ -94,6 +104,12 @@ func (s *MessagesSetChatWallPaperRequest) Zero() bool { if !(s.Flags.Zero()) { return false } + if !(s.ForBoth == false) { + return false + } + if !(s.Revert == false) { + return false + } if !(s.Peer == nil) { return false } @@ -121,11 +137,15 @@ func (s *MessagesSetChatWallPaperRequest) String() string { // FillFrom fills MessagesSetChatWallPaperRequest from given interface. func (s *MessagesSetChatWallPaperRequest) FillFrom(from interface { + GetForBoth() (value bool) + GetRevert() (value bool) GetPeer() (value InputPeerClass) GetWallpaper() (value InputWallPaperClass, ok bool) GetSettings() (value WallPaperSettings, ok bool) GetID() (value int, ok bool) }) { + s.ForBoth = from.GetForBoth() + s.Revert = from.GetRevert() s.Peer = from.GetPeer() if val, ok := from.GetWallpaper(); ok { s.Wallpaper = val @@ -164,6 +184,16 @@ func (s *MessagesSetChatWallPaperRequest) TypeInfo() tdp.Type { return typ } typ.Fields = []tdp.Field{ + { + Name: "ForBoth", + SchemaName: "for_both", + Null: !s.Flags.Has(3), + }, + { + Name: "Revert", + SchemaName: "revert", + Null: !s.Flags.Has(4), + }, { Name: "Peer", SchemaName: "peer", @@ -189,6 +219,12 @@ func (s *MessagesSetChatWallPaperRequest) TypeInfo() tdp.Type { // SetFlags sets flags for non-zero fields. func (s *MessagesSetChatWallPaperRequest) SetFlags() { + if !(s.ForBoth == false) { + s.Flags.Set(3) + } + if !(s.Revert == false) { + s.Flags.Set(4) + } if !(s.Wallpaper == nil) { s.Flags.Set(0) } @@ -264,6 +300,8 @@ func (s *MessagesSetChatWallPaperRequest) DecodeBare(b *bin.Buffer) error { return fmt.Errorf("unable to decode messages.setChatWallPaper#8ffacae1: field flags: %w", err) } } + s.ForBoth = s.Flags.Has(3) + s.Revert = s.Flags.Has(4) { value, err := DecodeInputPeer(b) if err != nil { @@ -293,6 +331,44 @@ func (s *MessagesSetChatWallPaperRequest) DecodeBare(b *bin.Buffer) error { return nil } +// SetForBoth sets value of ForBoth conditional field. +func (s *MessagesSetChatWallPaperRequest) SetForBoth(value bool) { + if value { + s.Flags.Set(3) + s.ForBoth = true + } else { + s.Flags.Unset(3) + s.ForBoth = false + } +} + +// GetForBoth returns value of ForBoth conditional field. +func (s *MessagesSetChatWallPaperRequest) GetForBoth() (value bool) { + if s == nil { + return + } + return s.Flags.Has(3) +} + +// SetRevert sets value of Revert conditional field. +func (s *MessagesSetChatWallPaperRequest) SetRevert(value bool) { + if value { + s.Flags.Set(4) + s.Revert = true + } else { + s.Flags.Unset(4) + s.Revert = false + } +} + +// GetRevert returns value of Revert conditional field. +func (s *MessagesSetChatWallPaperRequest) GetRevert() (value bool) { + if s == nil { + return + } + return s.Flags.Has(4) +} + // GetPeer returns value of Peer field. func (s *MessagesSetChatWallPaperRequest) GetPeer() (value InputPeerClass) { if s == nil { @@ -365,6 +441,7 @@ func (s *MessagesSetChatWallPaperRequest) GetID() (value int, ok bool) { // // 400 PEER_ID_INVALID: The provided peer id is invalid. // 400 WALLPAPER_INVALID: The specified wallpaper is invalid. +// 400 WALLPAPER_NOT_FOUND: The specified wallpaper could not be found. // // See https://core.telegram.org/method/messages.setChatWallPaper for reference. // Can be used by bots. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_set_inline_bot_results_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_set_inline_bot_results_gen.go index 0e44ff0c..ff925dea 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_set_inline_bot_results_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_set_inline_bot_results_gen.go @@ -66,10 +66,11 @@ type MessagesSetInlineBotResultsRequest struct { // Use SetSwitchPm and GetSwitchPm helpers. SwitchPm InlineBotSwitchPM // If passed, clients will display a button on top of the remaining inline result list - // with the specified text, that switches the user to the specified bot web app¹. + // with the specified text, that switches the user to the specified inline mode mini + // app¹. // // Links: - // 1) https://core.telegram.org/api/bots/webapps#simple-web-apps + // 1) https://core.telegram.org/api/bots/webapps#inline-mode-mini-apps // // Use SetSwitchWebview and GetSwitchWebview helpers. SwitchWebview InlineBotWebView diff --git a/vendor/github.com/gotd/td/tg/tl_messages_toggle_no_forwards_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_toggle_no_forwards_gen.go index 8c41b0f9..66b63f44 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_toggle_no_forwards_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_toggle_no_forwards_gen.go @@ -204,6 +204,7 @@ func (t *MessagesToggleNoForwardsRequest) GetEnabled() (value bool) { // // Possible errors: // +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. // 400 CHAT_NOT_MODIFIED: No changes were made to chat information because the new information you passed is identical to the current information. // 400 PEER_ID_INVALID: The provided peer id is invalid. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_transcribe_audio_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_transcribe_audio_gen.go index bf2cd47b..fe6f65d0 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_transcribe_audio_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_transcribe_audio_gen.go @@ -204,6 +204,7 @@ func (t *MessagesTranscribeAudioRequest) GetMsgID() (value int) { // // Possible errors: // +// 400 PEER_ID_INVALID: The provided peer id is invalid. // 403 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. // 400 TRANSCRIPTION_FAILED: Audio transcription failed. // diff --git a/vendor/github.com/gotd/td/tg/tl_messages_transcribed_audio_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_transcribed_audio_gen.go index e819fe24..ac2e083e 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_transcribed_audio_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_transcribed_audio_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// MessagesTranscribedAudio represents TL type `messages.transcribedAudio#93752c52`. +// MessagesTranscribedAudio represents TL type `messages.transcribedAudio#cfb9d957`. // Transcribed text from a voice message »¹ // // Links: @@ -55,10 +55,28 @@ type MessagesTranscribedAudio struct { TranscriptionID int64 // Transcripted text Text string + // For non-Premium¹ users, this flag will be set, indicating the remaining + // transcriptions in the free trial period. + // + // Links: + // 1) https://core.telegram.org/api/premium + // + // Use SetTrialRemainsNum and GetTrialRemainsNum helpers. + TrialRemainsNum int + // For non-Premium¹ users, this flag will be set, indicating the date when the + // trial_remains_num counter will be reset to the maximum value of + // transcribe_audio_trial_weekly_number². + // + // Links: + // 1) https://core.telegram.org/api/premium + // 2) https://core.telegram.org/api/config#transcribe-audio-trial-weekly-number + // + // Use SetTrialRemainsUntilDate and GetTrialRemainsUntilDate helpers. + TrialRemainsUntilDate int } // MessagesTranscribedAudioTypeID is TL type id of MessagesTranscribedAudio. -const MessagesTranscribedAudioTypeID = 0x93752c52 +const MessagesTranscribedAudioTypeID = 0xcfb9d957 // Ensuring interfaces in compile-time for MessagesTranscribedAudio. var ( @@ -84,6 +102,12 @@ func (t *MessagesTranscribedAudio) Zero() bool { if !(t.Text == "") { return false } + if !(t.TrialRemainsNum == 0) { + return false + } + if !(t.TrialRemainsUntilDate == 0) { + return false + } return true } @@ -102,10 +126,20 @@ func (t *MessagesTranscribedAudio) FillFrom(from interface { GetPending() (value bool) GetTranscriptionID() (value int64) GetText() (value string) + GetTrialRemainsNum() (value int, ok bool) + GetTrialRemainsUntilDate() (value int, ok bool) }) { t.Pending = from.GetPending() t.TranscriptionID = from.GetTranscriptionID() t.Text = from.GetText() + if val, ok := from.GetTrialRemainsNum(); ok { + t.TrialRemainsNum = val + } + + if val, ok := from.GetTrialRemainsUntilDate(); ok { + t.TrialRemainsUntilDate = val + } + } // TypeID returns type id in TL schema. @@ -144,6 +178,16 @@ func (t *MessagesTranscribedAudio) TypeInfo() tdp.Type { Name: "Text", SchemaName: "text", }, + { + Name: "TrialRemainsNum", + SchemaName: "trial_remains_num", + Null: !t.Flags.Has(1), + }, + { + Name: "TrialRemainsUntilDate", + SchemaName: "trial_remains_until_date", + Null: !t.Flags.Has(1), + }, } return typ } @@ -153,12 +197,18 @@ func (t *MessagesTranscribedAudio) SetFlags() { if !(t.Pending == false) { t.Flags.Set(0) } + if !(t.TrialRemainsNum == 0) { + t.Flags.Set(1) + } + if !(t.TrialRemainsUntilDate == 0) { + t.Flags.Set(1) + } } // Encode implements bin.Encoder. func (t *MessagesTranscribedAudio) Encode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode messages.transcribedAudio#93752c52 as nil") + return fmt.Errorf("can't encode messages.transcribedAudio#cfb9d957 as nil") } b.PutID(MessagesTranscribedAudioTypeID) return t.EncodeBare(b) @@ -167,24 +217,30 @@ func (t *MessagesTranscribedAudio) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (t *MessagesTranscribedAudio) EncodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode messages.transcribedAudio#93752c52 as nil") + return fmt.Errorf("can't encode messages.transcribedAudio#cfb9d957 as nil") } t.SetFlags() if err := t.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode messages.transcribedAudio#93752c52: field flags: %w", err) + return fmt.Errorf("unable to encode messages.transcribedAudio#cfb9d957: field flags: %w", err) } b.PutLong(t.TranscriptionID) b.PutString(t.Text) + if t.Flags.Has(1) { + b.PutInt(t.TrialRemainsNum) + } + if t.Flags.Has(1) { + b.PutInt(t.TrialRemainsUntilDate) + } return nil } // Decode implements bin.Decoder. func (t *MessagesTranscribedAudio) Decode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode messages.transcribedAudio#93752c52 to nil") + return fmt.Errorf("can't decode messages.transcribedAudio#cfb9d957 to nil") } if err := b.ConsumeID(MessagesTranscribedAudioTypeID); err != nil { - return fmt.Errorf("unable to decode messages.transcribedAudio#93752c52: %w", err) + return fmt.Errorf("unable to decode messages.transcribedAudio#cfb9d957: %w", err) } return t.DecodeBare(b) } @@ -192,28 +248,42 @@ func (t *MessagesTranscribedAudio) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (t *MessagesTranscribedAudio) DecodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode messages.transcribedAudio#93752c52 to nil") + return fmt.Errorf("can't decode messages.transcribedAudio#cfb9d957 to nil") } { if err := t.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode messages.transcribedAudio#93752c52: field flags: %w", err) + return fmt.Errorf("unable to decode messages.transcribedAudio#cfb9d957: field flags: %w", err) } } t.Pending = t.Flags.Has(0) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode messages.transcribedAudio#93752c52: field transcription_id: %w", err) + return fmt.Errorf("unable to decode messages.transcribedAudio#cfb9d957: field transcription_id: %w", err) } t.TranscriptionID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messages.transcribedAudio#93752c52: field text: %w", err) + return fmt.Errorf("unable to decode messages.transcribedAudio#cfb9d957: field text: %w", err) } t.Text = value } + if t.Flags.Has(1) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messages.transcribedAudio#cfb9d957: field trial_remains_num: %w", err) + } + t.TrialRemainsNum = value + } + if t.Flags.Has(1) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messages.transcribedAudio#cfb9d957: field trial_remains_until_date: %w", err) + } + t.TrialRemainsUntilDate = value + } return nil } @@ -251,3 +321,39 @@ func (t *MessagesTranscribedAudio) GetText() (value string) { } return t.Text } + +// SetTrialRemainsNum sets value of TrialRemainsNum conditional field. +func (t *MessagesTranscribedAudio) SetTrialRemainsNum(value int) { + t.Flags.Set(1) + t.TrialRemainsNum = value +} + +// GetTrialRemainsNum returns value of TrialRemainsNum conditional field and +// boolean which is true if field was set. +func (t *MessagesTranscribedAudio) GetTrialRemainsNum() (value int, ok bool) { + if t == nil { + return + } + if !t.Flags.Has(1) { + return value, false + } + return t.TrialRemainsNum, true +} + +// SetTrialRemainsUntilDate sets value of TrialRemainsUntilDate conditional field. +func (t *MessagesTranscribedAudio) SetTrialRemainsUntilDate(value int) { + t.Flags.Set(1) + t.TrialRemainsUntilDate = value +} + +// GetTrialRemainsUntilDate returns value of TrialRemainsUntilDate conditional field and +// boolean which is true if field was set. +func (t *MessagesTranscribedAudio) GetTrialRemainsUntilDate() (value int, ok bool) { + if t == nil { + return + } + if !t.Flags.Has(1) { + return value, false + } + return t.TrialRemainsUntilDate, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_messages_update_dialog_filter_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_update_dialog_filter_gen.go index 8d37704c..92120c93 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_update_dialog_filter_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_update_dialog_filter_gen.go @@ -252,7 +252,7 @@ func (u *MessagesUpdateDialogFilterRequest) GetFilter() (value DialogFilterClass // // Possible errors: // -// 400 CHATLIST_EXCLUDE_INVALID: +// 400 CHATLIST_EXCLUDE_INVALID: The specified exclude_peers are invalid. // 400 CHAT_ID_INVALID: The provided chat id is invalid. // 400 FILTER_ID_INVALID: The specified filter ID is invalid. // 400 FILTER_INCLUDE_EMPTY: The include_peers vector of the filter is empty. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_upload_media_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_upload_media_gen.go index 99c1eb49..8c5be588 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_upload_media_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_upload_media_gen.go @@ -217,7 +217,7 @@ func (u *MessagesUploadMediaRequest) GetMedia() (value InputMediaClass) { // 400 CHAT_RESTRICTED: You can't send messages in this chat, you were restricted. // 403 CHAT_WRITE_FORBIDDEN: You can't write in this chat. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. -// 500 FILE_WRITE_EMPTY: +// 400 FILE_PART_LENGTH_INVALID: The length of a file part is invalid. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 400 INPUT_USER_DEACTIVATED: The specified user was deleted. // 400 MEDIA_INVALID: Media invalid. diff --git a/vendor/github.com/gotd/td/tg/tl_messages_votes_list_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_votes_list_gen.go index 858acd6b..788d5e86 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_votes_list_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_votes_list_gen.go @@ -49,7 +49,7 @@ type MessagesVotesList struct { Count int // Vote info for each user Votes []MessagePeerVoteClass - // Chats field of MessagesVotesList. + // Mentioned chats Chats []ChatClass // Info about users that voted in the poll Users []UserClass diff --git a/vendor/github.com/gotd/td/tg/tl_messages_web_page_gen.go b/vendor/github.com/gotd/td/tg/tl_messages_web_page_gen.go index 2849bc7b..12c41738 100644 --- a/vendor/github.com/gotd/td/tg/tl_messages_web_page_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_messages_web_page_gen.go @@ -32,14 +32,15 @@ var ( ) // MessagesWebPage represents TL type `messages.webPage#fd5e12bd`. +// Represents an Instant View webpage. // // See https://core.telegram.org/constructor/messages.webPage for reference. type MessagesWebPage struct { - // Webpage field of MessagesWebPage. + // The instant view webpage. Webpage WebPageClass - // Chats field of MessagesWebPage. + // Chats mentioned in the webpage. Chats []ChatClass - // Users field of MessagesWebPage. + // Users mentioned in the webpage. Users []UserClass } diff --git a/vendor/github.com/gotd/td/tg/tl_my_boost_gen.go b/vendor/github.com/gotd/td/tg/tl_my_boost_gen.go index 623e3973..94d0fdb2 100644 --- a/vendor/github.com/gotd/td/tg/tl_my_boost_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_my_boost_gen.go @@ -32,22 +32,37 @@ var ( ) // MyBoost represents TL type `myBoost#c448415c`. +// Contains information about a single boost slot »¹. +// +// Links: +// 1. https://core.telegram.org/api/boost // // See https://core.telegram.org/constructor/myBoost for reference. type MyBoost struct { - // Flags field of MyBoost. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Slot field of MyBoost. + // Boost slot ID »¹ + // + // Links: + // 1) https://core.telegram.org/api/boost Slot int - // Peer field of MyBoost. + // If set, indicates this slot is currently occupied, i.e. we are boosting¹ this peer. + // Note that we can assign multiple boost slots to the same peer. + // + // Links: + // 1) https://core.telegram.org/api/boost // // Use SetPeer and GetPeer helpers. Peer PeerClass - // Date field of MyBoost. + // When (unixtime) we started boosting the peer, 0 otherwise. Date int - // Expires field of MyBoost. + // Indicates the (unixtime) expiration date of the boost in peer (0 if peer is not set). Expires int - // CooldownUntilDate field of MyBoost. + // If peer is set, indicates the (unixtime) date after which this boost can be reassigned + // to another channel. // // Use SetCooldownUntilDate and GetCooldownUntilDate helpers. CooldownUntilDate int diff --git a/vendor/github.com/gotd/td/tg/tl_payments_apply_gift_code_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_apply_gift_code_gen.go index 1b35a1ce..69bf582b 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_apply_gift_code_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_apply_gift_code_gen.go @@ -32,10 +32,14 @@ var ( ) // PaymentsApplyGiftCodeRequest represents TL type `payments.applyGiftCode#f6e26854`. +// Apply a Telegram Premium giftcode »¹ +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/method/payments.applyGiftCode for reference. type PaymentsApplyGiftCodeRequest struct { - // Slug field of PaymentsApplyGiftCodeRequest. + // The code to apply Slug string } @@ -161,6 +165,14 @@ func (a *PaymentsApplyGiftCodeRequest) GetSlug() (value string) { } // PaymentsApplyGiftCode invokes method payments.applyGiftCode#f6e26854 returning error if any. +// Apply a Telegram Premium giftcode »¹ +// +// Links: +// 1. https://core.telegram.org/api/giveaways +// +// Possible errors: +// +// 406 GIFTCODE_NOT_ALLOWED: // // See https://core.telegram.org/method/payments.applyGiftCode for reference. func (c *Client) PaymentsApplyGiftCode(ctx context.Context, slug string) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_payments_check_gift_code_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_check_gift_code_gen.go index a35f02d0..e60e57b0 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_check_gift_code_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_check_gift_code_gen.go @@ -32,10 +32,14 @@ var ( ) // PaymentsCheckGiftCodeRequest represents TL type `payments.checkGiftCode#8e51b4c1`. +// Obtain information about a Telegram Premium giftcode »¹ +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/method/payments.checkGiftCode for reference. type PaymentsCheckGiftCodeRequest struct { - // Slug field of PaymentsCheckGiftCodeRequest. + // The giftcode to check Slug string } @@ -161,6 +165,14 @@ func (c *PaymentsCheckGiftCodeRequest) GetSlug() (value string) { } // PaymentsCheckGiftCode invokes method payments.checkGiftCode#8e51b4c1 returning error if any. +// Obtain information about a Telegram Premium giftcode »¹ +// +// Links: +// 1. https://core.telegram.org/api/giveaways +// +// Possible errors: +// +// 400 GIFT_SLUG_INVALID: The specified slug is invalid. // // See https://core.telegram.org/method/payments.checkGiftCode for reference. func (c *Client) PaymentsCheckGiftCode(ctx context.Context, slug string) (*PaymentsCheckedGiftCode, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_payments_checked_gift_code_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_checked_gift_code_gen.go index a75c3d56..04dae931 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_checked_gift_code_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_checked_gift_code_gen.go @@ -31,40 +31,55 @@ var ( _ = tdjson.Encoder{} ) -// PaymentsCheckedGiftCode represents TL type `payments.checkedGiftCode#b722f158`. +// PaymentsCheckedGiftCode represents TL type `payments.checkedGiftCode#284a1096`. +// Contains info about a Telegram Premium giftcode link¹. +// +// Links: +// 1. https://core.telegram.org/api/links#premium-giftcode-links // // See https://core.telegram.org/constructor/payments.checkedGiftCode for reference. type PaymentsCheckedGiftCode struct { - // Flags field of PaymentsCheckedGiftCode. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ViaGiveaway field of PaymentsCheckedGiftCode. + // Whether this giftcode was created by a giveaway¹. + // + // Links: + // 1) https://core.telegram.org/api/giveaways ViaGiveaway bool - // FromID field of PaymentsCheckedGiftCode. + // The peer that created the gift code. + // + // Use SetFromID and GetFromID helpers. FromID PeerClass - // GiveawayMsgID field of PaymentsCheckedGiftCode. + // Message ID of the giveaway in the channel specified in from_id. // // Use SetGiveawayMsgID and GetGiveawayMsgID helpers. GiveawayMsgID int - // ToID field of PaymentsCheckedGiftCode. + // The destination user of the gift. // // Use SetToID and GetToID helpers. ToID int64 - // Date field of PaymentsCheckedGiftCode. + // Creation date of the gift code. Date int - // Months field of PaymentsCheckedGiftCode. + // Duration in months of the gifted Telegram Premium¹ subscription. + // + // Links: + // 1) https://core.telegram.org/api/premium Months int - // UsedDate field of PaymentsCheckedGiftCode. + // When was the giftcode imported, if it was imported. // // Use SetUsedDate and GetUsedDate helpers. UsedDate int - // Chats field of PaymentsCheckedGiftCode. + // Mentioned chats Chats []ChatClass - // Users field of PaymentsCheckedGiftCode. + // Mentioned users Users []UserClass } // PaymentsCheckedGiftCodeTypeID is TL type id of PaymentsCheckedGiftCode. -const PaymentsCheckedGiftCodeTypeID = 0xb722f158 +const PaymentsCheckedGiftCodeTypeID = 0x284a1096 // Ensuring interfaces in compile-time for PaymentsCheckedGiftCode. var ( @@ -124,7 +139,7 @@ func (c *PaymentsCheckedGiftCode) String() string { // FillFrom fills PaymentsCheckedGiftCode from given interface. func (c *PaymentsCheckedGiftCode) FillFrom(from interface { GetViaGiveaway() (value bool) - GetFromID() (value PeerClass) + GetFromID() (value PeerClass, ok bool) GetGiveawayMsgID() (value int, ok bool) GetToID() (value int64, ok bool) GetDate() (value int) @@ -134,7 +149,10 @@ func (c *PaymentsCheckedGiftCode) FillFrom(from interface { GetUsers() (value []UserClass) }) { c.ViaGiveaway = from.GetViaGiveaway() - c.FromID = from.GetFromID() + if val, ok := from.GetFromID(); ok { + c.FromID = val + } + if val, ok := from.GetGiveawayMsgID(); ok { c.GiveawayMsgID = val } @@ -184,6 +202,7 @@ func (c *PaymentsCheckedGiftCode) TypeInfo() tdp.Type { { Name: "FromID", SchemaName: "from_id", + Null: !c.Flags.Has(4), }, { Name: "GiveawayMsgID", @@ -225,6 +244,9 @@ func (c *PaymentsCheckedGiftCode) SetFlags() { if !(c.ViaGiveaway == false) { c.Flags.Set(2) } + if !(c.FromID == nil) { + c.Flags.Set(4) + } if !(c.GiveawayMsgID == 0) { c.Flags.Set(3) } @@ -239,7 +261,7 @@ func (c *PaymentsCheckedGiftCode) SetFlags() { // Encode implements bin.Encoder. func (c *PaymentsCheckedGiftCode) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode payments.checkedGiftCode#b722f158 as nil") + return fmt.Errorf("can't encode payments.checkedGiftCode#284a1096 as nil") } b.PutID(PaymentsCheckedGiftCodeTypeID) return c.EncodeBare(b) @@ -248,17 +270,19 @@ func (c *PaymentsCheckedGiftCode) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *PaymentsCheckedGiftCode) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode payments.checkedGiftCode#b722f158 as nil") + return fmt.Errorf("can't encode payments.checkedGiftCode#284a1096 as nil") } c.SetFlags() if err := c.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.checkedGiftCode#b722f158: field flags: %w", err) + return fmt.Errorf("unable to encode payments.checkedGiftCode#284a1096: field flags: %w", err) } - if c.FromID == nil { - return fmt.Errorf("unable to encode payments.checkedGiftCode#b722f158: field from_id is nil") - } - if err := c.FromID.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.checkedGiftCode#b722f158: field from_id: %w", err) + if c.Flags.Has(4) { + if c.FromID == nil { + return fmt.Errorf("unable to encode payments.checkedGiftCode#284a1096: field from_id is nil") + } + if err := c.FromID.Encode(b); err != nil { + return fmt.Errorf("unable to encode payments.checkedGiftCode#284a1096: field from_id: %w", err) + } } if c.Flags.Has(3) { b.PutInt(c.GiveawayMsgID) @@ -274,19 +298,19 @@ func (c *PaymentsCheckedGiftCode) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(c.Chats)) for idx, v := range c.Chats { if v == nil { - return fmt.Errorf("unable to encode payments.checkedGiftCode#b722f158: field chats element with index %d is nil", idx) + return fmt.Errorf("unable to encode payments.checkedGiftCode#284a1096: field chats element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.checkedGiftCode#b722f158: field chats element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode payments.checkedGiftCode#284a1096: field chats element with index %d: %w", idx, err) } } b.PutVectorHeader(len(c.Users)) for idx, v := range c.Users { if v == nil { - return fmt.Errorf("unable to encode payments.checkedGiftCode#b722f158: field users element with index %d is nil", idx) + return fmt.Errorf("unable to encode payments.checkedGiftCode#284a1096: field users element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode payments.checkedGiftCode#b722f158: field users element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode payments.checkedGiftCode#284a1096: field users element with index %d: %w", idx, err) } } return nil @@ -295,10 +319,10 @@ func (c *PaymentsCheckedGiftCode) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *PaymentsCheckedGiftCode) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode payments.checkedGiftCode#b722f158 to nil") + return fmt.Errorf("can't decode payments.checkedGiftCode#284a1096 to nil") } if err := b.ConsumeID(PaymentsCheckedGiftCodeTypeID); err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: %w", err) } return c.DecodeBare(b) } @@ -306,60 +330,60 @@ func (c *PaymentsCheckedGiftCode) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *PaymentsCheckedGiftCode) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode payments.checkedGiftCode#b722f158 to nil") + return fmt.Errorf("can't decode payments.checkedGiftCode#284a1096 to nil") } { if err := c.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field flags: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field flags: %w", err) } } c.ViaGiveaway = c.Flags.Has(2) - { + if c.Flags.Has(4) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field from_id: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field from_id: %w", err) } c.FromID = value } if c.Flags.Has(3) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field giveaway_msg_id: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field giveaway_msg_id: %w", err) } c.GiveawayMsgID = value } if c.Flags.Has(0) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field to_id: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field to_id: %w", err) } c.ToID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field date: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field date: %w", err) } c.Date = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field months: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field months: %w", err) } c.Months = value } if c.Flags.Has(1) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field used_date: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field used_date: %w", err) } c.UsedDate = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field chats: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field chats: %w", err) } if headerLen > 0 { @@ -368,7 +392,7 @@ func (c *PaymentsCheckedGiftCode) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeChat(b) if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field chats: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field chats: %w", err) } c.Chats = append(c.Chats, value) } @@ -376,7 +400,7 @@ func (c *PaymentsCheckedGiftCode) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field users: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field users: %w", err) } if headerLen > 0 { @@ -385,7 +409,7 @@ func (c *PaymentsCheckedGiftCode) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeUser(b) if err != nil { - return fmt.Errorf("unable to decode payments.checkedGiftCode#b722f158: field users: %w", err) + return fmt.Errorf("unable to decode payments.checkedGiftCode#284a1096: field users: %w", err) } c.Users = append(c.Users, value) } @@ -412,12 +436,22 @@ func (c *PaymentsCheckedGiftCode) GetViaGiveaway() (value bool) { return c.Flags.Has(2) } -// GetFromID returns value of FromID field. -func (c *PaymentsCheckedGiftCode) GetFromID() (value PeerClass) { +// SetFromID sets value of FromID conditional field. +func (c *PaymentsCheckedGiftCode) SetFromID(value PeerClass) { + c.Flags.Set(4) + c.FromID = value +} + +// GetFromID returns value of FromID conditional field and +// boolean which is true if field was set. +func (c *PaymentsCheckedGiftCode) GetFromID() (value PeerClass, ok bool) { if c == nil { return } - return c.FromID + if !c.Flags.Has(4) { + return value, false + } + return c.FromID, true } // SetGiveawayMsgID sets value of GiveawayMsgID conditional field. diff --git a/vendor/github.com/gotd/td/tg/tl_payments_get_giveaway_info_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_get_giveaway_info_gen.go index 34f65a61..0c3496d8 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_get_giveaway_info_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_get_giveaway_info_gen.go @@ -32,12 +32,19 @@ var ( ) // PaymentsGetGiveawayInfoRequest represents TL type `payments.getGiveawayInfo#f4239425`. +// Obtain information about a Telegram Premium giveaway »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/method/payments.getGiveawayInfo for reference. type PaymentsGetGiveawayInfoRequest struct { - // Peer field of PaymentsGetGiveawayInfoRequest. + // The peer where the giveaway was posted. Peer InputPeerClass - // MsgID field of PaymentsGetGiveawayInfoRequest. + // Message ID of the messageActionGiveawayLaunch¹ service message + // + // Links: + // 1) https://core.telegram.org/constructor/messageActionGiveawayLaunch MsgID int } @@ -193,6 +200,14 @@ func (g *PaymentsGetGiveawayInfoRequest) GetMsgID() (value int) { } // PaymentsGetGiveawayInfo invokes method payments.getGiveawayInfo#f4239425 returning error if any. +// Obtain information about a Telegram Premium giveaway »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.getGiveawayInfo for reference. func (c *Client) PaymentsGetGiveawayInfo(ctx context.Context, request *PaymentsGetGiveawayInfoRequest) (PaymentsGiveawayInfoClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_payments_get_payment_form_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_get_payment_form_gen.go index 37308876..0e2ab59d 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_get_payment_form_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_get_payment_form_gen.go @@ -244,7 +244,10 @@ func (g *PaymentsGetPaymentFormRequest) GetThemeParams() (value DataJSON, ok boo // // Possible errors: // +// 400 BOOST_PEER_INVALID: The specified boost_peer is invalid. // 400 MESSAGE_ID_INVALID: The provided message id is invalid. +// 400 SLUG_INVALID: The specified invoice slug is invalid. +// 400 UNTIL_DATE_INVALID: Invalid until date provided. // // See https://core.telegram.org/method/payments.getPaymentForm for reference. func (c *Client) PaymentsGetPaymentForm(ctx context.Context, request *PaymentsGetPaymentFormRequest) (*PaymentsPaymentForm, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_payments_get_premium_gift_code_options_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_get_premium_gift_code_options_gen.go index ec3a3cc8..e2b566eb 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_get_premium_gift_code_options_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_get_premium_gift_code_options_gen.go @@ -32,12 +32,19 @@ var ( ) // PaymentsGetPremiumGiftCodeOptionsRequest represents TL type `payments.getPremiumGiftCodeOptions#2757ba54`. +// Obtain a list of Telegram Premium giveaway/gift code »¹ options. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/method/payments.getPremiumGiftCodeOptions for reference. type PaymentsGetPremiumGiftCodeOptionsRequest struct { - // Flags field of PaymentsGetPremiumGiftCodeOptionsRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // BoostPeer field of PaymentsGetPremiumGiftCodeOptionsRequest. + // The channel that will start the giveaway // // Use SetBoostPeer and GetBoostPeer helpers. BoostPeer InputPeerClass @@ -205,6 +212,10 @@ func (g *PaymentsGetPremiumGiftCodeOptionsRequest) GetBoostPeer() (value InputPe } // PaymentsGetPremiumGiftCodeOptions invokes method payments.getPremiumGiftCodeOptions#2757ba54 returning error if any. +// Obtain a list of Telegram Premium giveaway/gift code »¹ options. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/method/payments.getPremiumGiftCodeOptions for reference. func (c *Client) PaymentsGetPremiumGiftCodeOptions(ctx context.Context, request *PaymentsGetPremiumGiftCodeOptionsRequest) ([]PremiumGiftCodeOption, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_payments_giveaway_info_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_giveaway_info_gen.go index 697e6041..b5ba7454 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_giveaway_info_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_giveaway_info_gen.go @@ -32,26 +32,44 @@ var ( ) // PaymentsGiveawayInfo represents TL type `payments.giveawayInfo#4367daa0`. +// Contains info about an ongoing giveaway¹. +// If neither the participating, joined_too_early_date, admin_disallowed_chat_id or +// disallowed_country flags are set, the user is not currently participating in the +// giveaway but could participate by joining all the channels specified in the +// messageMediaGiveaway¹.channels field. +// +// Links: +// 1. https://core.telegram.org/api/giveaways +// 2. https://core.telegram.org/constructor/messageMediaGiveaway // // See https://core.telegram.org/constructor/payments.giveawayInfo for reference. type PaymentsGiveawayInfo struct { - // Flags field of PaymentsGiveawayInfo. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Participating field of PaymentsGiveawayInfo. + // The current user is participating in the giveaway. Participating bool - // PreparingResults field of PaymentsGiveawayInfo. + // If set, the giveaway has ended and the results are being prepared. PreparingResults bool - // StartDate field of PaymentsGiveawayInfo. + // When was the giveaway started StartDate int - // JoinedTooEarlyDate field of PaymentsGiveawayInfo. + // The current user can't participate in the giveaway, because they were already a member + // of the channel when the giveaway started, and the only_new_subscribers was set when + // starting the giveaway. // // Use SetJoinedTooEarlyDate and GetJoinedTooEarlyDate helpers. JoinedTooEarlyDate int - // AdminDisallowedChatID field of PaymentsGiveawayInfo. + // If set, the current user can't participate in the giveaway, because they are an + // administrator in one of the channels (ID specified in this flag) that created the + // giveaway. // // Use SetAdminDisallowedChatID and GetAdminDisallowedChatID helpers. AdminDisallowedChatID int64 - // DisallowedCountry field of PaymentsGiveawayInfo. + // If set, the current user can't participate in this giveaway, because their phone + // number is from the specified disallowed country (specified as a two-letter ISO 3166-1 + // alpha-2 country code). // // Use SetDisallowedCountry and GetDisallowedCountry helpers. DisallowedCountry string @@ -398,26 +416,42 @@ func (g *PaymentsGiveawayInfo) GetDisallowedCountry() (value string, ok bool) { } // PaymentsGiveawayInfoResults represents TL type `payments.giveawayInfoResults#cd5570`. +// A giveaway¹ has ended. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/constructor/payments.giveawayInfoResults for reference. type PaymentsGiveawayInfoResults struct { - // Flags field of PaymentsGiveawayInfoResults. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Winner field of PaymentsGiveawayInfoResults. + // Whether we're one of the winners of this giveaway. Winner bool - // Refunded field of PaymentsGiveawayInfoResults. + // Whether the giveaway was canceled and was fully refunded. Refunded bool - // StartDate field of PaymentsGiveawayInfoResults. + // Start date of the giveaway StartDate int - // GiftCodeSlug field of PaymentsGiveawayInfoResults. + // If we're one of the winners of this giveaway, contains the Premium gift code¹, see + // here »² for more info on the full giveaway flow. + // + // Links: + // 1) https://core.telegram.org/api/links#premium-giftcode-links + // 2) https://core.telegram.org/api/giveaways // // Use SetGiftCodeSlug and GetGiftCodeSlug helpers. GiftCodeSlug string - // FinishDate field of PaymentsGiveawayInfoResults. + // End date of the giveaway. May be bigger than the end date specified in parameters of + // the giveaway. FinishDate int - // WinnersCount field of PaymentsGiveawayInfoResults. + // Number of winners in the giveaway WinnersCount int - // ActivatedCount field of PaymentsGiveawayInfoResults. + // Number of winners, which activated their gift codes¹. + // + // Links: + // 1) https://core.telegram.org/api/links#premium-giftcode-links ActivatedCount int } @@ -784,7 +818,7 @@ type PaymentsGiveawayInfoClass interface { // Zero returns true if current object has a zero value. Zero() bool - // StartDate field of PaymentsGiveawayInfo. + // When was the giveaway started GetStartDate() (value int) } diff --git a/vendor/github.com/gotd/td/tg/tl_payments_launch_prepaid_giveaway_gen.go b/vendor/github.com/gotd/td/tg/tl_payments_launch_prepaid_giveaway_gen.go index fe97ba60..e8752ec5 100644 --- a/vendor/github.com/gotd/td/tg/tl_payments_launch_prepaid_giveaway_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_payments_launch_prepaid_giveaway_gen.go @@ -32,14 +32,18 @@ var ( ) // PaymentsLaunchPrepaidGiveawayRequest represents TL type `payments.launchPrepaidGiveaway#5ff58f20`. +// Launch a prepaid giveaway »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/method/payments.launchPrepaidGiveaway for reference. type PaymentsLaunchPrepaidGiveawayRequest struct { - // Peer field of PaymentsLaunchPrepaidGiveawayRequest. + // The peer where to launch the giveaway. Peer InputPeerClass - // GiveawayID field of PaymentsLaunchPrepaidGiveawayRequest. + // The prepaid giveaway ID. GiveawayID int64 - // Purpose field of PaymentsLaunchPrepaidGiveawayRequest. + // Giveway parameters Purpose InputStorePaymentPurposeClass } @@ -225,6 +229,14 @@ func (l *PaymentsLaunchPrepaidGiveawayRequest) GetPurpose() (value InputStorePay } // PaymentsLaunchPrepaidGiveaway invokes method payments.launchPrepaidGiveaway#5ff58f20 returning error if any. +// Launch a prepaid giveaway »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/payments.launchPrepaidGiveaway for reference. func (c *Client) PaymentsLaunchPrepaidGiveaway(ctx context.Context, request *PaymentsLaunchPrepaidGiveawayRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_peer_color_gen.go b/vendor/github.com/gotd/td/tg/tl_peer_color_gen.go new file mode 100644 index 00000000..643fe844 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_peer_color_gen.go @@ -0,0 +1,261 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// PeerColor represents TL type `peerColor#b54b5acf`. +// Represents a color palette »¹. +// +// Links: +// 1. https://core.telegram.org/api/colors +// +// See https://core.telegram.org/constructor/peerColor for reference. +type PeerColor struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // Color palette ID, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/colors + // + // Use SetColor and GetColor helpers. + Color int + // Custom emoji ID¹ used to generate the pattern. + // + // Links: + // 1) https://core.telegram.org/api/custom-emoji + // + // Use SetBackgroundEmojiID and GetBackgroundEmojiID helpers. + BackgroundEmojiID int64 +} + +// PeerColorTypeID is TL type id of PeerColor. +const PeerColorTypeID = 0xb54b5acf + +// Ensuring interfaces in compile-time for PeerColor. +var ( + _ bin.Encoder = &PeerColor{} + _ bin.Decoder = &PeerColor{} + _ bin.BareEncoder = &PeerColor{} + _ bin.BareDecoder = &PeerColor{} +) + +func (p *PeerColor) Zero() bool { + if p == nil { + return true + } + if !(p.Flags.Zero()) { + return false + } + if !(p.Color == 0) { + return false + } + if !(p.BackgroundEmojiID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PeerColor) String() string { + if p == nil { + return "PeerColor(nil)" + } + type Alias PeerColor + return fmt.Sprintf("PeerColor%+v", Alias(*p)) +} + +// FillFrom fills PeerColor from given interface. +func (p *PeerColor) FillFrom(from interface { + GetColor() (value int, ok bool) + GetBackgroundEmojiID() (value int64, ok bool) +}) { + if val, ok := from.GetColor(); ok { + p.Color = val + } + + if val, ok := from.GetBackgroundEmojiID(); ok { + p.BackgroundEmojiID = val + } + +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PeerColor) TypeID() uint32 { + return PeerColorTypeID +} + +// TypeName returns name of type in TL schema. +func (*PeerColor) TypeName() string { + return "peerColor" +} + +// TypeInfo returns info about TL type. +func (p *PeerColor) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "peerColor", + ID: PeerColorTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Color", + SchemaName: "color", + Null: !p.Flags.Has(0), + }, + { + Name: "BackgroundEmojiID", + SchemaName: "background_emoji_id", + Null: !p.Flags.Has(1), + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (p *PeerColor) SetFlags() { + if !(p.Color == 0) { + p.Flags.Set(0) + } + if !(p.BackgroundEmojiID == 0) { + p.Flags.Set(1) + } +} + +// Encode implements bin.Encoder. +func (p *PeerColor) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode peerColor#b54b5acf as nil") + } + b.PutID(PeerColorTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PeerColor) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode peerColor#b54b5acf as nil") + } + p.SetFlags() + if err := p.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode peerColor#b54b5acf: field flags: %w", err) + } + if p.Flags.Has(0) { + b.PutInt(p.Color) + } + if p.Flags.Has(1) { + b.PutLong(p.BackgroundEmojiID) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PeerColor) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode peerColor#b54b5acf to nil") + } + if err := b.ConsumeID(PeerColorTypeID); err != nil { + return fmt.Errorf("unable to decode peerColor#b54b5acf: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PeerColor) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode peerColor#b54b5acf to nil") + } + { + if err := p.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode peerColor#b54b5acf: field flags: %w", err) + } + } + if p.Flags.Has(0) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode peerColor#b54b5acf: field color: %w", err) + } + p.Color = value + } + if p.Flags.Has(1) { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode peerColor#b54b5acf: field background_emoji_id: %w", err) + } + p.BackgroundEmojiID = value + } + return nil +} + +// SetColor sets value of Color conditional field. +func (p *PeerColor) SetColor(value int) { + p.Flags.Set(0) + p.Color = value +} + +// GetColor returns value of Color conditional field and +// boolean which is true if field was set. +func (p *PeerColor) GetColor() (value int, ok bool) { + if p == nil { + return + } + if !p.Flags.Has(0) { + return value, false + } + return p.Color, true +} + +// SetBackgroundEmojiID sets value of BackgroundEmojiID conditional field. +func (p *PeerColor) SetBackgroundEmojiID(value int64) { + p.Flags.Set(1) + p.BackgroundEmojiID = value +} + +// GetBackgroundEmojiID returns value of BackgroundEmojiID conditional field and +// boolean which is true if field was set. +func (p *PeerColor) GetBackgroundEmojiID() (value int64, ok bool) { + if p == nil { + return + } + if !p.Flags.Has(1) { + return value, false + } + return p.BackgroundEmojiID, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_peer_color_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_peer_color_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_peer_color_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_peer_notify_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_peer_notify_settings_gen.go index 03c7b650..adc46f05 100644 --- a/vendor/github.com/gotd/td/tg/tl_peer_notify_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_peer_notify_settings_gen.go @@ -67,23 +67,23 @@ type PeerNotifySettings struct { // // Use SetOtherSound and GetOtherSound helpers. OtherSound NotificationSoundClass - // StoriesMuted field of PeerNotifySettings. + // Whether story notifications should be disabled. // // Use SetStoriesMuted and GetStoriesMuted helpers. StoriesMuted bool - // StoriesHideSender field of PeerNotifySettings. + // Whether the sender name should be displayed in story notifications. // // Use SetStoriesHideSender and GetStoriesHideSender helpers. StoriesHideSender bool - // StoriesIosSound field of PeerNotifySettings. + // Sound for story notifications on the official iOS application // // Use SetStoriesIosSound and GetStoriesIosSound helpers. StoriesIosSound NotificationSoundClass - // StoriesAndroidSound field of PeerNotifySettings. + // Sound for story notifications on the official Android application // // Use SetStoriesAndroidSound and GetStoriesAndroidSound helpers. StoriesAndroidSound NotificationSoundClass - // StoriesOtherSound field of PeerNotifySettings. + // Sound for story notifications on other applications // // Use SetStoriesOtherSound and GetStoriesOtherSound helpers. StoriesOtherSound NotificationSoundClass diff --git a/vendor/github.com/gotd/td/tg/tl_peer_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_peer_settings_gen.go index e1f1da1a..00cb98d1 100644 --- a/vendor/github.com/gotd/td/tg/tl_peer_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_peer_settings_gen.go @@ -33,7 +33,11 @@ var ( // PeerSettings represents TL type `peerSettings#a518110d`. // List of actions that are possible when interacting with this user, to be shown as -// suggested actions in the chat bar +// suggested actions in the chat action bar »¹, see here »² for more info. +// +// Links: +// 1. https://core.telegram.org/api/action-bar +// 2. https://core.telegram.org/api/action-bar // // See https://core.telegram.org/constructor/peerSettings for reference. type PeerSettings struct { diff --git a/vendor/github.com/gotd/td/tg/tl_peer_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_peer_stories_gen.go index 5cbaaf09..12c5b289 100644 --- a/vendor/github.com/gotd/td/tg/tl_peer_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_peer_stories_gen.go @@ -32,18 +32,25 @@ var ( ) // PeerStories represents TL type `peerStories#9a35e999`. +// Stories¹ associated to a peer +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/peerStories for reference. type PeerStories struct { - // Flags field of PeerStories. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of PeerStories. + // The peer Peer PeerClass - // MaxReadID field of PeerStories. + // If set, contains the ID of the maximum read story // // Use SetMaxReadID and GetMaxReadID helpers. MaxReadID int - // Stories field of PeerStories. + // Stories Stories []StoryItemClass } diff --git a/vendor/github.com/gotd/td/tg/tl_phone_accept_call_gen.go b/vendor/github.com/gotd/td/tg/tl_phone_accept_call_gen.go index bdabad80..a42e6cbe 100644 --- a/vendor/github.com/gotd/td/tg/tl_phone_accept_call_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_phone_accept_call_gen.go @@ -227,6 +227,7 @@ func (a *PhoneAcceptCallRequest) GetProtocol() (value PhoneCallProtocol) { // 400 CALL_ALREADY_DECLINED: The call was already declined. // 500 CALL_OCCUPY_FAILED: The call failed because the user is already making another call. // 400 CALL_PEER_INVALID: The provided call peer object is invalid. +// 406 CALL_PROTOCOL_COMPAT_LAYER_INVALID: The other side of the call does not support any of the VoIP protocols supported by the local client, as specified by the protocol.layer and protocol.library_versions fields. // 400 CALL_PROTOCOL_FLAGS_INVALID: Call protocol flags invalid. // // See https://core.telegram.org/method/phone.acceptCall for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_phone_join_group_call_gen.go b/vendor/github.com/gotd/td/tg/tl_phone_join_group_call_gen.go index 1e2725df..6fedee53 100644 --- a/vendor/github.com/gotd/td/tg/tl_phone_join_group_call_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_phone_join_group_call_gen.go @@ -369,6 +369,7 @@ func (j *PhoneJoinGroupCallRequest) GetParams() (value DataJSON) { // Possible errors: // // 400 DATA_JSON_INVALID: The provided JSON data is invalid. +// 500 GROUPCALL_ADD_PARTICIPANTS_FAILED: // 403 GROUPCALL_FORBIDDEN: The group call has already ended. // 400 GROUPCALL_INVALID: The specified group call is invalid. // 400 GROUPCALL_SSRC_DUPLICATE_MUCH: The app needs to retry joining the group call with a new SSRC value. diff --git a/vendor/github.com/gotd/td/tg/tl_photos_get_user_photos_gen.go b/vendor/github.com/gotd/td/tg/tl_photos_get_user_photos_gen.go index ca6431fd..9634df01 100644 --- a/vendor/github.com/gotd/td/tg/tl_photos_get_user_photos_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_photos_get_user_photos_gen.go @@ -41,7 +41,13 @@ type PhotosGetUserPhotosRequest struct { // Number of list elements to be skipped Offset int // If a positive value was transferred, the method will return only photos with IDs less - // than the set one + // than the set one. This parameter is often useful when refetching file references »¹, + // as in conjuction with limit=1 and offset=-1 the photo² object with the id specified + // in max_id can be fetched. + // + // Links: + // 1) https://core.telegram.org/api/file_reference + // 2) https://core.telegram.org/constructor/photo MaxID int64 // Number of list elements to be returned Limit int diff --git a/vendor/github.com/gotd/td/tg/tl_photos_update_profile_photo_gen.go b/vendor/github.com/gotd/td/tg/tl_photos_update_profile_photo_gen.go index 5cffa469..247e0c40 100644 --- a/vendor/github.com/gotd/td/tg/tl_photos_update_profile_photo_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_photos_update_profile_photo_gen.go @@ -289,7 +289,6 @@ func (u *PhotosUpdateProfilePhotoRequest) GetIDAsNotEmpty() (*InputPhoto, bool) // // 400 ALBUM_PHOTOS_TOO_MANY: You have uploaded too many profile photos, delete some before retrying. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. -// 500 FILE_WRITE_EMPTY: // 400 IMAGE_PROCESS_FAILED: Failure while processing image. // 400 LOCATION_INVALID: The provided location is invalid. // 400 PHOTO_CROP_SIZE_SMALL: Photo is too small. diff --git a/vendor/github.com/gotd/td/tg/tl_photos_upload_profile_photo_gen.go b/vendor/github.com/gotd/td/tg/tl_photos_upload_profile_photo_gen.go index 84d735b4..4bcc23ce 100644 --- a/vendor/github.com/gotd/td/tg/tl_photos_upload_profile_photo_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_photos_upload_profile_photo_gen.go @@ -470,6 +470,7 @@ func (u *PhotosUploadProfilePhotoRequest) GetVideoEmojiMarkup() (value VideoSize // Possible errors: // // 400 ALBUM_PHOTOS_TOO_MANY: You have uploaded too many profile photos, delete some before retrying. +// 400 BOT_INVALID: This is not a valid bot. // 400 EMOJI_MARKUP_INVALID: The specified video_emoji_markup was invalid. // 400 FILE_PARTS_INVALID: The number of file parts is invalid. // 400 IMAGE_PROCESS_FAILED: Failure while processing image. diff --git a/vendor/github.com/gotd/td/tg/tl_post_interaction_counters_gen.go b/vendor/github.com/gotd/td/tg/tl_post_interaction_counters_gen.go new file mode 100644 index 00000000..5b2671f4 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_post_interaction_counters_gen.go @@ -0,0 +1,562 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// PostInteractionCountersMessage represents TL type `postInteractionCountersMessage#e7058e7f`. +// Interaction counters for a message. +// +// See https://core.telegram.org/constructor/postInteractionCountersMessage for reference. +type PostInteractionCountersMessage struct { + // Message ID + MsgID int + // Number of views + Views int + // Number of forwards to public channels + Forwards int + // Number of reactions + Reactions int +} + +// PostInteractionCountersMessageTypeID is TL type id of PostInteractionCountersMessage. +const PostInteractionCountersMessageTypeID = 0xe7058e7f + +// construct implements constructor of PostInteractionCountersClass. +func (p PostInteractionCountersMessage) construct() PostInteractionCountersClass { return &p } + +// Ensuring interfaces in compile-time for PostInteractionCountersMessage. +var ( + _ bin.Encoder = &PostInteractionCountersMessage{} + _ bin.Decoder = &PostInteractionCountersMessage{} + _ bin.BareEncoder = &PostInteractionCountersMessage{} + _ bin.BareDecoder = &PostInteractionCountersMessage{} + + _ PostInteractionCountersClass = &PostInteractionCountersMessage{} +) + +func (p *PostInteractionCountersMessage) Zero() bool { + if p == nil { + return true + } + if !(p.MsgID == 0) { + return false + } + if !(p.Views == 0) { + return false + } + if !(p.Forwards == 0) { + return false + } + if !(p.Reactions == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PostInteractionCountersMessage) String() string { + if p == nil { + return "PostInteractionCountersMessage(nil)" + } + type Alias PostInteractionCountersMessage + return fmt.Sprintf("PostInteractionCountersMessage%+v", Alias(*p)) +} + +// FillFrom fills PostInteractionCountersMessage from given interface. +func (p *PostInteractionCountersMessage) FillFrom(from interface { + GetMsgID() (value int) + GetViews() (value int) + GetForwards() (value int) + GetReactions() (value int) +}) { + p.MsgID = from.GetMsgID() + p.Views = from.GetViews() + p.Forwards = from.GetForwards() + p.Reactions = from.GetReactions() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PostInteractionCountersMessage) TypeID() uint32 { + return PostInteractionCountersMessageTypeID +} + +// TypeName returns name of type in TL schema. +func (*PostInteractionCountersMessage) TypeName() string { + return "postInteractionCountersMessage" +} + +// TypeInfo returns info about TL type. +func (p *PostInteractionCountersMessage) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "postInteractionCountersMessage", + ID: PostInteractionCountersMessageTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "MsgID", + SchemaName: "msg_id", + }, + { + Name: "Views", + SchemaName: "views", + }, + { + Name: "Forwards", + SchemaName: "forwards", + }, + { + Name: "Reactions", + SchemaName: "reactions", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PostInteractionCountersMessage) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode postInteractionCountersMessage#e7058e7f as nil") + } + b.PutID(PostInteractionCountersMessageTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PostInteractionCountersMessage) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode postInteractionCountersMessage#e7058e7f as nil") + } + b.PutInt(p.MsgID) + b.PutInt(p.Views) + b.PutInt(p.Forwards) + b.PutInt(p.Reactions) + return nil +} + +// Decode implements bin.Decoder. +func (p *PostInteractionCountersMessage) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode postInteractionCountersMessage#e7058e7f to nil") + } + if err := b.ConsumeID(PostInteractionCountersMessageTypeID); err != nil { + return fmt.Errorf("unable to decode postInteractionCountersMessage#e7058e7f: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PostInteractionCountersMessage) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode postInteractionCountersMessage#e7058e7f to nil") + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersMessage#e7058e7f: field msg_id: %w", err) + } + p.MsgID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersMessage#e7058e7f: field views: %w", err) + } + p.Views = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersMessage#e7058e7f: field forwards: %w", err) + } + p.Forwards = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersMessage#e7058e7f: field reactions: %w", err) + } + p.Reactions = value + } + return nil +} + +// GetMsgID returns value of MsgID field. +func (p *PostInteractionCountersMessage) GetMsgID() (value int) { + if p == nil { + return + } + return p.MsgID +} + +// GetViews returns value of Views field. +func (p *PostInteractionCountersMessage) GetViews() (value int) { + if p == nil { + return + } + return p.Views +} + +// GetForwards returns value of Forwards field. +func (p *PostInteractionCountersMessage) GetForwards() (value int) { + if p == nil { + return + } + return p.Forwards +} + +// GetReactions returns value of Reactions field. +func (p *PostInteractionCountersMessage) GetReactions() (value int) { + if p == nil { + return + } + return p.Reactions +} + +// PostInteractionCountersStory represents TL type `postInteractionCountersStory#8a480e27`. +// Interaction counters for a story. +// +// See https://core.telegram.org/constructor/postInteractionCountersStory for reference. +type PostInteractionCountersStory struct { + // Story ID + StoryID int + // Number of views + Views int + // Number of forwards and reposts to public chats and channels + Forwards int + // Number of reactions + Reactions int +} + +// PostInteractionCountersStoryTypeID is TL type id of PostInteractionCountersStory. +const PostInteractionCountersStoryTypeID = 0x8a480e27 + +// construct implements constructor of PostInteractionCountersClass. +func (p PostInteractionCountersStory) construct() PostInteractionCountersClass { return &p } + +// Ensuring interfaces in compile-time for PostInteractionCountersStory. +var ( + _ bin.Encoder = &PostInteractionCountersStory{} + _ bin.Decoder = &PostInteractionCountersStory{} + _ bin.BareEncoder = &PostInteractionCountersStory{} + _ bin.BareDecoder = &PostInteractionCountersStory{} + + _ PostInteractionCountersClass = &PostInteractionCountersStory{} +) + +func (p *PostInteractionCountersStory) Zero() bool { + if p == nil { + return true + } + if !(p.StoryID == 0) { + return false + } + if !(p.Views == 0) { + return false + } + if !(p.Forwards == 0) { + return false + } + if !(p.Reactions == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PostInteractionCountersStory) String() string { + if p == nil { + return "PostInteractionCountersStory(nil)" + } + type Alias PostInteractionCountersStory + return fmt.Sprintf("PostInteractionCountersStory%+v", Alias(*p)) +} + +// FillFrom fills PostInteractionCountersStory from given interface. +func (p *PostInteractionCountersStory) FillFrom(from interface { + GetStoryID() (value int) + GetViews() (value int) + GetForwards() (value int) + GetReactions() (value int) +}) { + p.StoryID = from.GetStoryID() + p.Views = from.GetViews() + p.Forwards = from.GetForwards() + p.Reactions = from.GetReactions() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PostInteractionCountersStory) TypeID() uint32 { + return PostInteractionCountersStoryTypeID +} + +// TypeName returns name of type in TL schema. +func (*PostInteractionCountersStory) TypeName() string { + return "postInteractionCountersStory" +} + +// TypeInfo returns info about TL type. +func (p *PostInteractionCountersStory) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "postInteractionCountersStory", + ID: PostInteractionCountersStoryTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StoryID", + SchemaName: "story_id", + }, + { + Name: "Views", + SchemaName: "views", + }, + { + Name: "Forwards", + SchemaName: "forwards", + }, + { + Name: "Reactions", + SchemaName: "reactions", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PostInteractionCountersStory) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode postInteractionCountersStory#8a480e27 as nil") + } + b.PutID(PostInteractionCountersStoryTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PostInteractionCountersStory) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode postInteractionCountersStory#8a480e27 as nil") + } + b.PutInt(p.StoryID) + b.PutInt(p.Views) + b.PutInt(p.Forwards) + b.PutInt(p.Reactions) + return nil +} + +// Decode implements bin.Decoder. +func (p *PostInteractionCountersStory) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode postInteractionCountersStory#8a480e27 to nil") + } + if err := b.ConsumeID(PostInteractionCountersStoryTypeID); err != nil { + return fmt.Errorf("unable to decode postInteractionCountersStory#8a480e27: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PostInteractionCountersStory) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode postInteractionCountersStory#8a480e27 to nil") + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersStory#8a480e27: field story_id: %w", err) + } + p.StoryID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersStory#8a480e27: field views: %w", err) + } + p.Views = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersStory#8a480e27: field forwards: %w", err) + } + p.Forwards = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode postInteractionCountersStory#8a480e27: field reactions: %w", err) + } + p.Reactions = value + } + return nil +} + +// GetStoryID returns value of StoryID field. +func (p *PostInteractionCountersStory) GetStoryID() (value int) { + if p == nil { + return + } + return p.StoryID +} + +// GetViews returns value of Views field. +func (p *PostInteractionCountersStory) GetViews() (value int) { + if p == nil { + return + } + return p.Views +} + +// GetForwards returns value of Forwards field. +func (p *PostInteractionCountersStory) GetForwards() (value int) { + if p == nil { + return + } + return p.Forwards +} + +// GetReactions returns value of Reactions field. +func (p *PostInteractionCountersStory) GetReactions() (value int) { + if p == nil { + return + } + return p.Reactions +} + +// PostInteractionCountersClassName is schema name of PostInteractionCountersClass. +const PostInteractionCountersClassName = "PostInteractionCounters" + +// PostInteractionCountersClass represents PostInteractionCounters generic type. +// +// See https://core.telegram.org/type/PostInteractionCounters for reference. +// +// Example: +// +// g, err := tg.DecodePostInteractionCounters(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tg.PostInteractionCountersMessage: // postInteractionCountersMessage#e7058e7f +// case *tg.PostInteractionCountersStory: // postInteractionCountersStory#8a480e27 +// default: panic(v) +// } +type PostInteractionCountersClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() PostInteractionCountersClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool + + // Number of views + GetViews() (value int) + + // Number of forwards to public channels + GetForwards() (value int) + + // Number of reactions + GetReactions() (value int) +} + +// DecodePostInteractionCounters implements binary de-serialization for PostInteractionCountersClass. +func DecodePostInteractionCounters(buf *bin.Buffer) (PostInteractionCountersClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case PostInteractionCountersMessageTypeID: + // Decoding postInteractionCountersMessage#e7058e7f. + v := PostInteractionCountersMessage{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PostInteractionCountersClass: %w", err) + } + return &v, nil + case PostInteractionCountersStoryTypeID: + // Decoding postInteractionCountersStory#8a480e27. + v := PostInteractionCountersStory{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PostInteractionCountersClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PostInteractionCountersClass: %w", bin.NewUnexpectedID(id)) + } +} + +// PostInteractionCounters boxes the PostInteractionCountersClass providing a helper. +type PostInteractionCountersBox struct { + PostInteractionCounters PostInteractionCountersClass +} + +// Decode implements bin.Decoder for PostInteractionCountersBox. +func (b *PostInteractionCountersBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode PostInteractionCountersBox to nil") + } + v, err := DecodePostInteractionCounters(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PostInteractionCounters = v + return nil +} + +// Encode implements bin.Encode for PostInteractionCountersBox. +func (b *PostInteractionCountersBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PostInteractionCounters == nil { + return fmt.Errorf("unable to encode PostInteractionCountersClass as nil") + } + return b.PostInteractionCounters.Encode(buf) +} diff --git a/vendor/github.com/gotd/td/tg/tl_post_interaction_counters_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_post_interaction_counters_slices_gen.go new file mode 100644 index 00000000..3a55e192 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_post_interaction_counters_slices_gen.go @@ -0,0 +1,307 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// PostInteractionCountersClassArray is adapter for slice of PostInteractionCountersClass. +type PostInteractionCountersClassArray []PostInteractionCountersClass + +// Sort sorts slice of PostInteractionCountersClass. +func (s PostInteractionCountersClassArray) Sort(less func(a, b PostInteractionCountersClass) bool) PostInteractionCountersClassArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of PostInteractionCountersClass. +func (s PostInteractionCountersClassArray) SortStable(less func(a, b PostInteractionCountersClass) bool) PostInteractionCountersClassArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of PostInteractionCountersClass. +func (s PostInteractionCountersClassArray) Retain(keep func(x PostInteractionCountersClass) bool) PostInteractionCountersClassArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s PostInteractionCountersClassArray) First() (v PostInteractionCountersClass, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s PostInteractionCountersClassArray) Last() (v PostInteractionCountersClass, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *PostInteractionCountersClassArray) PopFirst() (v PostInteractionCountersClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero PostInteractionCountersClass + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *PostInteractionCountersClassArray) Pop() (v PostInteractionCountersClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// AsPostInteractionCountersMessage returns copy with only PostInteractionCountersMessage constructors. +func (s PostInteractionCountersClassArray) AsPostInteractionCountersMessage() (to PostInteractionCountersMessageArray) { + for _, elem := range s { + value, ok := elem.(*PostInteractionCountersMessage) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsPostInteractionCountersStory returns copy with only PostInteractionCountersStory constructors. +func (s PostInteractionCountersClassArray) AsPostInteractionCountersStory() (to PostInteractionCountersStoryArray) { + for _, elem := range s { + value, ok := elem.(*PostInteractionCountersStory) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// PostInteractionCountersMessageArray is adapter for slice of PostInteractionCountersMessage. +type PostInteractionCountersMessageArray []PostInteractionCountersMessage + +// Sort sorts slice of PostInteractionCountersMessage. +func (s PostInteractionCountersMessageArray) Sort(less func(a, b PostInteractionCountersMessage) bool) PostInteractionCountersMessageArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of PostInteractionCountersMessage. +func (s PostInteractionCountersMessageArray) SortStable(less func(a, b PostInteractionCountersMessage) bool) PostInteractionCountersMessageArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of PostInteractionCountersMessage. +func (s PostInteractionCountersMessageArray) Retain(keep func(x PostInteractionCountersMessage) bool) PostInteractionCountersMessageArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s PostInteractionCountersMessageArray) First() (v PostInteractionCountersMessage, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s PostInteractionCountersMessageArray) Last() (v PostInteractionCountersMessage, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *PostInteractionCountersMessageArray) PopFirst() (v PostInteractionCountersMessage, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero PostInteractionCountersMessage + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *PostInteractionCountersMessageArray) Pop() (v PostInteractionCountersMessage, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// PostInteractionCountersStoryArray is adapter for slice of PostInteractionCountersStory. +type PostInteractionCountersStoryArray []PostInteractionCountersStory + +// Sort sorts slice of PostInteractionCountersStory. +func (s PostInteractionCountersStoryArray) Sort(less func(a, b PostInteractionCountersStory) bool) PostInteractionCountersStoryArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of PostInteractionCountersStory. +func (s PostInteractionCountersStoryArray) SortStable(less func(a, b PostInteractionCountersStory) bool) PostInteractionCountersStoryArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of PostInteractionCountersStory. +func (s PostInteractionCountersStoryArray) Retain(keep func(x PostInteractionCountersStory) bool) PostInteractionCountersStoryArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s PostInteractionCountersStoryArray) First() (v PostInteractionCountersStory, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s PostInteractionCountersStoryArray) Last() (v PostInteractionCountersStory, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *PostInteractionCountersStoryArray) PopFirst() (v PostInteractionCountersStory, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero PostInteractionCountersStory + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *PostInteractionCountersStoryArray) Pop() (v PostInteractionCountersStory, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_premium_apply_boost_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_apply_boost_gen.go index fb948c65..9135a61c 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_apply_boost_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_apply_boost_gen.go @@ -32,16 +32,26 @@ var ( ) // PremiumApplyBoostRequest represents TL type `premium.applyBoost#6b7da746`. +// Apply one or more boosts »¹ to a peer. +// +// Links: +// 1. https://core.telegram.org/api/boost // // See https://core.telegram.org/method/premium.applyBoost for reference. type PremiumApplyBoostRequest struct { - // Flags field of PremiumApplyBoostRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Slots field of PremiumApplyBoostRequest. + // Which boost slots¹ to assign to this peer. + // + // Links: + // 1) https://core.telegram.org/api/boost // // Use SetSlots and GetSlots helpers. Slots []int - // Peer field of PremiumApplyBoostRequest. + // The peer to boost. Peer InputPeerClass } @@ -245,6 +255,16 @@ func (a *PremiumApplyBoostRequest) GetPeer() (value InputPeerClass) { } // PremiumApplyBoost invokes method premium.applyBoost#6b7da746 returning error if any. +// Apply one or more boosts »¹ to a peer. +// +// Links: +// 1. https://core.telegram.org/api/boost +// +// Possible errors: +// +// 400 BOOSTS_EMPTY: No boost slots were specified. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 SLOTS_EMPTY: The specified slot list is empty. // // See https://core.telegram.org/method/premium.applyBoost for reference. func (c *Client) PremiumApplyBoost(ctx context.Context, request *PremiumApplyBoostRequest) (*PremiumMyBoosts, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_premium_boosts_list_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_boosts_list_gen.go index 75e2df60..90f4a544 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_boosts_list_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_boosts_list_gen.go @@ -32,20 +32,33 @@ var ( ) // PremiumBoostsList represents TL type `premium.boostsList#86f8613c`. +// List of boosts¹ that were applied to a peer by multiple users. +// +// Links: +// 1. https://core.telegram.org/api/boost // // See https://core.telegram.org/constructor/premium.boostsList for reference. type PremiumBoostsList struct { - // Flags field of PremiumBoostsList. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Count field of PremiumBoostsList. + // Total number of results Count int - // Boosts field of PremiumBoostsList. + // Boosts¹ + // + // Links: + // 1) https://core.telegram.org/api/boost Boosts []Boost - // NextOffset field of PremiumBoostsList. + // Offset that can be used for pagination¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets // // Use SetNextOffset and GetNextOffset helpers. NextOffset string - // Users field of PremiumBoostsList. + // Mentioned users Users []UserClass } diff --git a/vendor/github.com/gotd/td/tg/tl_premium_boosts_status_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_boosts_status_gen.go index 1d3ad1f1..605d14ec 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_boosts_status_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_boosts_status_gen.go @@ -32,38 +32,62 @@ var ( ) // PremiumBoostsStatus represents TL type `premium.boostsStatus#4959427a`. +// Contains info about the current boost status¹ of a peer. +// +// Links: +// 1. https://core.telegram.org/api/boost // // See https://core.telegram.org/constructor/premium.boostsStatus for reference. type PremiumBoostsStatus struct { - // Flags field of PremiumBoostsStatus. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // MyBoost field of PremiumBoostsStatus. + // Whether we're currently boosting this channel, my_boost_slots will also be set. MyBoost bool - // Level field of PremiumBoostsStatus. + // The current boost level of the channel. Level int - // CurrentLevelBoosts field of PremiumBoostsStatus. + // The number of boosts acquired so far in the current level. CurrentLevelBoosts int - // Boosts field of PremiumBoostsStatus. + // Total number of boosts acquired so far. Boosts int - // GiftBoosts field of PremiumBoostsStatus. + // The number of boosts acquired from created Telegram Premium gift codes¹ and + // giveaways²; only returned to channel admins. + // + // Links: + // 1) https://core.telegram.org/api/giveaways + // 2) https://core.telegram.org/api/giveaways // // Use SetGiftBoosts and GetGiftBoosts helpers. GiftBoosts int - // NextLevelBoosts field of PremiumBoostsStatus. + // Total number of boosts needed to reach the next level; if absent, the next level isn't + // available. // // Use SetNextLevelBoosts and GetNextLevelBoosts helpers. NextLevelBoosts int - // PremiumAudience field of PremiumBoostsStatus. + // Only returned to channel admins: contains the approximated number of Premium users + // subscribed to the channel, related to the total number of subscribers. // // Use SetPremiumAudience and GetPremiumAudience helpers. PremiumAudience StatsPercentValue - // BoostURL field of PremiumBoostsStatus. + // Boost deep link »¹ that can be used to boost the chat. + // + // Links: + // 1) https://core.telegram.org/api/links#boost-links BoostURL string - // PrepaidGiveaways field of PremiumBoostsStatus. + // A list of prepaid giveaways¹ available for the chat; only returned to channel admins. + // + // Links: + // 1) https://core.telegram.org/api/giveaways // // Use SetPrepaidGiveaways and GetPrepaidGiveaways helpers. PrepaidGiveaways []PrepaidGiveaway - // MyBoostSlots field of PremiumBoostsStatus. + // Indicates which of our boost slots¹ we've assigned to this peer (populated if + // my_boost is set). + // + // Links: + // 1) https://core.telegram.org/api/boost // // Use SetMyBoostSlots and GetMyBoostSlots helpers. MyBoostSlots []int diff --git a/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_list_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_list_gen.go index a758789f..ec6fb97e 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_list_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_list_gen.go @@ -32,18 +32,32 @@ var ( ) // PremiumGetBoostsListRequest represents TL type `premium.getBoostsList#60f67660`. +// Obtains info about the boosts that were applied to a certain channel (admins only) // // See https://core.telegram.org/method/premium.getBoostsList for reference. type PremiumGetBoostsListRequest struct { - // Flags field of PremiumGetBoostsListRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Gifts field of PremiumGetBoostsListRequest. + // Whether to return only info about boosts received from gift codes and giveaways + // created by the channel »¹ + // + // Links: + // 1) https://core.telegram.org/api/giveaways Gifts bool - // Peer field of PremiumGetBoostsListRequest. + // The channel Peer InputPeerClass - // Offset field of PremiumGetBoostsListRequest. + // Offset for pagination, obtained from premium.boostsList¹.next_offset + // + // Links: + // 1) https://core.telegram.org/constructor/premium.boostsList Offset string - // Limit field of PremiumGetBoostsListRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -273,6 +287,12 @@ func (g *PremiumGetBoostsListRequest) GetLimit() (value int) { } // PremiumGetBoostsList invokes method premium.getBoostsList#60f67660 returning error if any. +// Obtains info about the boosts that were applied to a certain channel (admins only) +// +// Possible errors: +// +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/premium.getBoostsList for reference. func (c *Client) PremiumGetBoostsList(ctx context.Context, request *PremiumGetBoostsListRequest) (*PremiumBoostsList, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_status_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_status_gen.go index 29331f21..21ea527c 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_status_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_get_boosts_status_gen.go @@ -32,10 +32,14 @@ var ( ) // PremiumGetBoostsStatusRequest represents TL type `premium.getBoostsStatus#42f1f61`. +// Gets the current number of boosts¹ of a channel. +// +// Links: +// 1. https://core.telegram.org/api/boost // // See https://core.telegram.org/method/premium.getBoostsStatus for reference. type PremiumGetBoostsStatusRequest struct { - // Peer field of PremiumGetBoostsStatusRequest. + // The peer. Peer InputPeerClass } @@ -166,6 +170,14 @@ func (g *PremiumGetBoostsStatusRequest) GetPeer() (value InputPeerClass) { } // PremiumGetBoostsStatus invokes method premium.getBoostsStatus#42f1f61 returning error if any. +// Gets the current number of boosts¹ of a channel. +// +// Links: +// 1. https://core.telegram.org/api/boost +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/premium.getBoostsStatus for reference. func (c *Client) PremiumGetBoostsStatus(ctx context.Context, peer InputPeerClass) (*PremiumBoostsStatus, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_premium_get_my_boosts_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_get_my_boosts_gen.go index d13cc44e..0b7cd65d 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_get_my_boosts_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_get_my_boosts_gen.go @@ -32,6 +32,12 @@ var ( ) // PremiumGetMyBoostsRequest represents TL type `premium.getMyBoosts#be77b4a`. +// Obtain which peers are we currently boosting¹, and how many boost slots² we have +// left. +// +// Links: +// 1. https://core.telegram.org/api/boost +// 2. https://core.telegram.org/api/boost // // See https://core.telegram.org/method/premium.getMyBoosts for reference. type PremiumGetMyBoostsRequest struct { @@ -128,6 +134,12 @@ func (g *PremiumGetMyBoostsRequest) DecodeBare(b *bin.Buffer) error { } // PremiumGetMyBoosts invokes method premium.getMyBoosts#be77b4a returning error if any. +// Obtain which peers are we currently boosting¹, and how many boost slots² we have +// left. +// +// Links: +// 1. https://core.telegram.org/api/boost +// 2. https://core.telegram.org/api/boost // // See https://core.telegram.org/method/premium.getMyBoosts for reference. func (c *Client) PremiumGetMyBoosts(ctx context.Context) (*PremiumMyBoosts, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_gen.go new file mode 100644 index 00000000..bd5b4ede --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_gen.go @@ -0,0 +1,219 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// PremiumGetUserBoostsRequest represents TL type `premium.getUserBoosts#39854d1f`. +// Returns the lists of boost that were applied to a channel by a specific user (admins +// only) +// +// See https://core.telegram.org/method/premium.getUserBoosts for reference. +type PremiumGetUserBoostsRequest struct { + // The channel + Peer InputPeerClass + // The user + UserID InputUserClass +} + +// PremiumGetUserBoostsRequestTypeID is TL type id of PremiumGetUserBoostsRequest. +const PremiumGetUserBoostsRequestTypeID = 0x39854d1f + +// Ensuring interfaces in compile-time for PremiumGetUserBoostsRequest. +var ( + _ bin.Encoder = &PremiumGetUserBoostsRequest{} + _ bin.Decoder = &PremiumGetUserBoostsRequest{} + _ bin.BareEncoder = &PremiumGetUserBoostsRequest{} + _ bin.BareDecoder = &PremiumGetUserBoostsRequest{} +) + +func (g *PremiumGetUserBoostsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Peer == nil) { + return false + } + if !(g.UserID == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *PremiumGetUserBoostsRequest) String() string { + if g == nil { + return "PremiumGetUserBoostsRequest(nil)" + } + type Alias PremiumGetUserBoostsRequest + return fmt.Sprintf("PremiumGetUserBoostsRequest%+v", Alias(*g)) +} + +// FillFrom fills PremiumGetUserBoostsRequest from given interface. +func (g *PremiumGetUserBoostsRequest) FillFrom(from interface { + GetPeer() (value InputPeerClass) + GetUserID() (value InputUserClass) +}) { + g.Peer = from.GetPeer() + g.UserID = from.GetUserID() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumGetUserBoostsRequest) TypeID() uint32 { + return PremiumGetUserBoostsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumGetUserBoostsRequest) TypeName() string { + return "premium.getUserBoosts" +} + +// TypeInfo returns info about TL type. +func (g *PremiumGetUserBoostsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premium.getUserBoosts", + ID: PremiumGetUserBoostsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "UserID", + SchemaName: "user_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *PremiumGetUserBoostsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode premium.getUserBoosts#39854d1f as nil") + } + b.PutID(PremiumGetUserBoostsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *PremiumGetUserBoostsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode premium.getUserBoosts#39854d1f as nil") + } + if g.Peer == nil { + return fmt.Errorf("unable to encode premium.getUserBoosts#39854d1f: field peer is nil") + } + if err := g.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode premium.getUserBoosts#39854d1f: field peer: %w", err) + } + if g.UserID == nil { + return fmt.Errorf("unable to encode premium.getUserBoosts#39854d1f: field user_id is nil") + } + if err := g.UserID.Encode(b); err != nil { + return fmt.Errorf("unable to encode premium.getUserBoosts#39854d1f: field user_id: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (g *PremiumGetUserBoostsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode premium.getUserBoosts#39854d1f to nil") + } + if err := b.ConsumeID(PremiumGetUserBoostsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode premium.getUserBoosts#39854d1f: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *PremiumGetUserBoostsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode premium.getUserBoosts#39854d1f to nil") + } + { + value, err := DecodeInputPeer(b) + if err != nil { + return fmt.Errorf("unable to decode premium.getUserBoosts#39854d1f: field peer: %w", err) + } + g.Peer = value + } + { + value, err := DecodeInputUser(b) + if err != nil { + return fmt.Errorf("unable to decode premium.getUserBoosts#39854d1f: field user_id: %w", err) + } + g.UserID = value + } + return nil +} + +// GetPeer returns value of Peer field. +func (g *PremiumGetUserBoostsRequest) GetPeer() (value InputPeerClass) { + if g == nil { + return + } + return g.Peer +} + +// GetUserID returns value of UserID field. +func (g *PremiumGetUserBoostsRequest) GetUserID() (value InputUserClass) { + if g == nil { + return + } + return g.UserID +} + +// PremiumGetUserBoosts invokes method premium.getUserBoosts#39854d1f returning error if any. +// Returns the lists of boost that were applied to a channel by a specific user (admins +// only) +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// +// See https://core.telegram.org/method/premium.getUserBoosts for reference. +// Can be used by bots. +func (c *Client) PremiumGetUserBoosts(ctx context.Context, request *PremiumGetUserBoostsRequest) (*PremiumBoostsList, error) { + var result PremiumBoostsList + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_premium_get_user_boosts_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_premium_gift_code_option_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_gift_code_option_gen.go index d19ad899..9f5c9068 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_gift_code_option_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_gift_code_option_gen.go @@ -32,26 +32,45 @@ var ( ) // PremiumGiftCodeOption represents TL type `premiumGiftCodeOption#257e962b`. +// Contains info about a giveaway/gift¹ option. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/constructor/premiumGiftCodeOption for reference. type PremiumGiftCodeOption struct { - // Flags field of PremiumGiftCodeOption. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Users field of PremiumGiftCodeOption. + // Number of users which will be able to activate the gift codes. Users int - // Months field of PremiumGiftCodeOption. + // Duration in months of each gifted Telegram Premium¹ subscription. + // + // Links: + // 1) https://core.telegram.org/api/premium Months int - // StoreProduct field of PremiumGiftCodeOption. + // Identifier of the store product associated with the option, official apps only. // // Use SetStoreProduct and GetStoreProduct helpers. StoreProduct string - // StoreQuantity field of PremiumGiftCodeOption. + // Number of times the store product must be paid // // Use SetStoreQuantity and GetStoreQuantity helpers. StoreQuantity int - // Currency field of PremiumGiftCodeOption. + // Three-letter ISO 4217 currency¹ code + // + // Links: + // 1) https://core.telegram.org/bots/payments#supported-currencies Currency string - // Amount field of PremiumGiftCodeOption. + // Total price in the smallest units of the currency (integer, not float/double). For + // example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in + // currencies.json¹, it shows the number of digits past the decimal point for each + // currency (2 for the majority of currencies). + // + // Links: + // 1) https://core.telegram.org/bots/payments/currencies.json Amount int64 } diff --git a/vendor/github.com/gotd/td/tg/tl_premium_my_boosts_gen.go b/vendor/github.com/gotd/td/tg/tl_premium_my_boosts_gen.go index ac54cbd9..15fbc569 100644 --- a/vendor/github.com/gotd/td/tg/tl_premium_my_boosts_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_premium_my_boosts_gen.go @@ -32,14 +32,19 @@ var ( ) // PremiumMyBoosts represents TL type `premium.myBoosts#9ae228e2`. +// A list of peers we are currently boosting¹, and how many boost slots² we have left. +// +// Links: +// 1. https://core.telegram.org/api/boost +// 2. https://core.telegram.org/api/boost // // See https://core.telegram.org/constructor/premium.myBoosts for reference. type PremiumMyBoosts struct { - // MyBoosts field of PremiumMyBoosts. + // Info about boosted peers and remaining boost slots. MyBoosts []MyBoost - // Chats field of PremiumMyBoosts. + // Referenced chats Chats []ChatClass - // Users field of PremiumMyBoosts. + // Referenced users Users []UserClass } diff --git a/vendor/github.com/gotd/td/tg/tl_prepaid_giveaway_gen.go b/vendor/github.com/gotd/td/tg/tl_prepaid_giveaway_gen.go index 55aa8eab..a1a7a6fd 100644 --- a/vendor/github.com/gotd/td/tg/tl_prepaid_giveaway_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_prepaid_giveaway_gen.go @@ -32,16 +32,26 @@ var ( ) // PrepaidGiveaway represents TL type `prepaidGiveaway#b2539d54`. +// Contains info about a prepaid giveaway »¹. +// +// Links: +// 1. https://core.telegram.org/api/giveaways // // See https://core.telegram.org/constructor/prepaidGiveaway for reference. type PrepaidGiveaway struct { - // ID field of PrepaidGiveaway. + // Prepaid giveaway ID. ID int64 - // Months field of PrepaidGiveaway. + // Duration in months of each gifted Telegram Premium¹ subscription. + // + // Links: + // 1) https://core.telegram.org/api/premium Months int - // Quantity field of PrepaidGiveaway. + // Number of given away Telegram Premium¹ subscriptions. + // + // Links: + // 1) https://core.telegram.org/api/premium Quantity int - // Date field of PrepaidGiveaway. + // Payment date. Date int } diff --git a/vendor/github.com/gotd/td/tg/tl_privacy_key_gen.go b/vendor/github.com/gotd/td/tg/tl_privacy_key_gen.go index 5ac5f280..bfb64442 100644 --- a/vendor/github.com/gotd/td/tg/tl_privacy_key_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_privacy_key_gen.go @@ -953,6 +953,7 @@ func (p *PrivacyKeyVoiceMessages) DecodeBare(b *bin.Buffer) error { } // PrivacyKeyAbout represents TL type `privacyKeyAbout#a486b761`. +// Whether people can see your bio // // See https://core.telegram.org/constructor/privacyKeyAbout for reference. type PrivacyKeyAbout struct { diff --git a/vendor/github.com/gotd/td/tg/tl_privacy_rule_gen.go b/vendor/github.com/gotd/td/tg/tl_privacy_rule_gen.go index 42826ccd..a1c164be 100644 --- a/vendor/github.com/gotd/td/tg/tl_privacy_rule_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_privacy_rule_gen.go @@ -1032,6 +1032,10 @@ func (p *PrivacyValueDisallowChatParticipants) GetChats() (value []int64) { } // PrivacyValueAllowCloseFriends represents TL type `privacyValueAllowCloseFriends#f7e8d89b`. +// Allow only close friends »¹ +// +// Links: +// 1. https://core.telegram.org/api/privacy // // See https://core.telegram.org/constructor/privacyValueAllowCloseFriends for reference. type PrivacyValueAllowCloseFriends struct { diff --git a/vendor/github.com/gotd/td/tg/tl_public_forward_gen.go b/vendor/github.com/gotd/td/tg/tl_public_forward_gen.go new file mode 100644 index 00000000..6d22e990 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_public_forward_gen.go @@ -0,0 +1,439 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// PublicForwardMessage represents TL type `publicForwardMessage#1f2bf4a`. +// Contains info about a forward of a story¹ as a message. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// See https://core.telegram.org/constructor/publicForwardMessage for reference. +type PublicForwardMessage struct { + // Info about the message with the reposted story. + Message MessageClass +} + +// PublicForwardMessageTypeID is TL type id of PublicForwardMessage. +const PublicForwardMessageTypeID = 0x1f2bf4a + +// construct implements constructor of PublicForwardClass. +func (p PublicForwardMessage) construct() PublicForwardClass { return &p } + +// Ensuring interfaces in compile-time for PublicForwardMessage. +var ( + _ bin.Encoder = &PublicForwardMessage{} + _ bin.Decoder = &PublicForwardMessage{} + _ bin.BareEncoder = &PublicForwardMessage{} + _ bin.BareDecoder = &PublicForwardMessage{} + + _ PublicForwardClass = &PublicForwardMessage{} +) + +func (p *PublicForwardMessage) Zero() bool { + if p == nil { + return true + } + if !(p.Message == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PublicForwardMessage) String() string { + if p == nil { + return "PublicForwardMessage(nil)" + } + type Alias PublicForwardMessage + return fmt.Sprintf("PublicForwardMessage%+v", Alias(*p)) +} + +// FillFrom fills PublicForwardMessage from given interface. +func (p *PublicForwardMessage) FillFrom(from interface { + GetMessage() (value MessageClass) +}) { + p.Message = from.GetMessage() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PublicForwardMessage) TypeID() uint32 { + return PublicForwardMessageTypeID +} + +// TypeName returns name of type in TL schema. +func (*PublicForwardMessage) TypeName() string { + return "publicForwardMessage" +} + +// TypeInfo returns info about TL type. +func (p *PublicForwardMessage) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "publicForwardMessage", + ID: PublicForwardMessageTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Message", + SchemaName: "message", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PublicForwardMessage) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardMessage#1f2bf4a as nil") + } + b.PutID(PublicForwardMessageTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PublicForwardMessage) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardMessage#1f2bf4a as nil") + } + if p.Message == nil { + return fmt.Errorf("unable to encode publicForwardMessage#1f2bf4a: field message is nil") + } + if err := p.Message.Encode(b); err != nil { + return fmt.Errorf("unable to encode publicForwardMessage#1f2bf4a: field message: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PublicForwardMessage) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardMessage#1f2bf4a to nil") + } + if err := b.ConsumeID(PublicForwardMessageTypeID); err != nil { + return fmt.Errorf("unable to decode publicForwardMessage#1f2bf4a: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PublicForwardMessage) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardMessage#1f2bf4a to nil") + } + { + value, err := DecodeMessage(b) + if err != nil { + return fmt.Errorf("unable to decode publicForwardMessage#1f2bf4a: field message: %w", err) + } + p.Message = value + } + return nil +} + +// GetMessage returns value of Message field. +func (p *PublicForwardMessage) GetMessage() (value MessageClass) { + if p == nil { + return + } + return p.Message +} + +// PublicForwardStory represents TL type `publicForwardStory#edf3add0`. +// Contains info about a forward of a story¹ as a repost by a public channel. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// See https://core.telegram.org/constructor/publicForwardStory for reference. +type PublicForwardStory struct { + // The channel that reposted the story. + Peer PeerClass + // The reposted story (may be different from the original story). + Story StoryItemClass +} + +// PublicForwardStoryTypeID is TL type id of PublicForwardStory. +const PublicForwardStoryTypeID = 0xedf3add0 + +// construct implements constructor of PublicForwardClass. +func (p PublicForwardStory) construct() PublicForwardClass { return &p } + +// Ensuring interfaces in compile-time for PublicForwardStory. +var ( + _ bin.Encoder = &PublicForwardStory{} + _ bin.Decoder = &PublicForwardStory{} + _ bin.BareEncoder = &PublicForwardStory{} + _ bin.BareDecoder = &PublicForwardStory{} + + _ PublicForwardClass = &PublicForwardStory{} +) + +func (p *PublicForwardStory) Zero() bool { + if p == nil { + return true + } + if !(p.Peer == nil) { + return false + } + if !(p.Story == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PublicForwardStory) String() string { + if p == nil { + return "PublicForwardStory(nil)" + } + type Alias PublicForwardStory + return fmt.Sprintf("PublicForwardStory%+v", Alias(*p)) +} + +// FillFrom fills PublicForwardStory from given interface. +func (p *PublicForwardStory) FillFrom(from interface { + GetPeer() (value PeerClass) + GetStory() (value StoryItemClass) +}) { + p.Peer = from.GetPeer() + p.Story = from.GetStory() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PublicForwardStory) TypeID() uint32 { + return PublicForwardStoryTypeID +} + +// TypeName returns name of type in TL schema. +func (*PublicForwardStory) TypeName() string { + return "publicForwardStory" +} + +// TypeInfo returns info about TL type. +func (p *PublicForwardStory) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "publicForwardStory", + ID: PublicForwardStoryTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "Story", + SchemaName: "story", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PublicForwardStory) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardStory#edf3add0 as nil") + } + b.PutID(PublicForwardStoryTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PublicForwardStory) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode publicForwardStory#edf3add0 as nil") + } + if p.Peer == nil { + return fmt.Errorf("unable to encode publicForwardStory#edf3add0: field peer is nil") + } + if err := p.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode publicForwardStory#edf3add0: field peer: %w", err) + } + if p.Story == nil { + return fmt.Errorf("unable to encode publicForwardStory#edf3add0: field story is nil") + } + if err := p.Story.Encode(b); err != nil { + return fmt.Errorf("unable to encode publicForwardStory#edf3add0: field story: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PublicForwardStory) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardStory#edf3add0 to nil") + } + if err := b.ConsumeID(PublicForwardStoryTypeID); err != nil { + return fmt.Errorf("unable to decode publicForwardStory#edf3add0: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PublicForwardStory) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode publicForwardStory#edf3add0 to nil") + } + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode publicForwardStory#edf3add0: field peer: %w", err) + } + p.Peer = value + } + { + value, err := DecodeStoryItem(b) + if err != nil { + return fmt.Errorf("unable to decode publicForwardStory#edf3add0: field story: %w", err) + } + p.Story = value + } + return nil +} + +// GetPeer returns value of Peer field. +func (p *PublicForwardStory) GetPeer() (value PeerClass) { + if p == nil { + return + } + return p.Peer +} + +// GetStory returns value of Story field. +func (p *PublicForwardStory) GetStory() (value StoryItemClass) { + if p == nil { + return + } + return p.Story +} + +// PublicForwardClassName is schema name of PublicForwardClass. +const PublicForwardClassName = "PublicForward" + +// PublicForwardClass represents PublicForward generic type. +// +// See https://core.telegram.org/type/PublicForward for reference. +// +// Example: +// +// g, err := tg.DecodePublicForward(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tg.PublicForwardMessage: // publicForwardMessage#1f2bf4a +// case *tg.PublicForwardStory: // publicForwardStory#edf3add0 +// default: panic(v) +// } +type PublicForwardClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() PublicForwardClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool +} + +// DecodePublicForward implements binary de-serialization for PublicForwardClass. +func DecodePublicForward(buf *bin.Buffer) (PublicForwardClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case PublicForwardMessageTypeID: + // Decoding publicForwardMessage#1f2bf4a. + v := PublicForwardMessage{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", err) + } + return &v, nil + case PublicForwardStoryTypeID: + // Decoding publicForwardStory#edf3add0. + v := PublicForwardStory{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PublicForwardClass: %w", bin.NewUnexpectedID(id)) + } +} + +// PublicForward boxes the PublicForwardClass providing a helper. +type PublicForwardBox struct { + PublicForward PublicForwardClass +} + +// Decode implements bin.Decoder for PublicForwardBox. +func (b *PublicForwardBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode PublicForwardBox to nil") + } + v, err := DecodePublicForward(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PublicForward = v + return nil +} + +// Encode implements bin.Encode for PublicForwardBox. +func (b *PublicForwardBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PublicForward == nil { + return fmt.Errorf("unable to encode PublicForwardClass as nil") + } + return b.PublicForward.Encode(buf) +} diff --git a/vendor/github.com/gotd/td/tg/tl_public_forward_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_public_forward_slices_gen.go new file mode 100644 index 00000000..fc89ae7d --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_public_forward_slices_gen.go @@ -0,0 +1,307 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// PublicForwardClassArray is adapter for slice of PublicForwardClass. +type PublicForwardClassArray []PublicForwardClass + +// Sort sorts slice of PublicForwardClass. +func (s PublicForwardClassArray) Sort(less func(a, b PublicForwardClass) bool) PublicForwardClassArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of PublicForwardClass. +func (s PublicForwardClassArray) SortStable(less func(a, b PublicForwardClass) bool) PublicForwardClassArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of PublicForwardClass. +func (s PublicForwardClassArray) Retain(keep func(x PublicForwardClass) bool) PublicForwardClassArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s PublicForwardClassArray) First() (v PublicForwardClass, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s PublicForwardClassArray) Last() (v PublicForwardClass, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *PublicForwardClassArray) PopFirst() (v PublicForwardClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero PublicForwardClass + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *PublicForwardClassArray) Pop() (v PublicForwardClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// AsPublicForwardMessage returns copy with only PublicForwardMessage constructors. +func (s PublicForwardClassArray) AsPublicForwardMessage() (to PublicForwardMessageArray) { + for _, elem := range s { + value, ok := elem.(*PublicForwardMessage) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsPublicForwardStory returns copy with only PublicForwardStory constructors. +func (s PublicForwardClassArray) AsPublicForwardStory() (to PublicForwardStoryArray) { + for _, elem := range s { + value, ok := elem.(*PublicForwardStory) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// PublicForwardMessageArray is adapter for slice of PublicForwardMessage. +type PublicForwardMessageArray []PublicForwardMessage + +// Sort sorts slice of PublicForwardMessage. +func (s PublicForwardMessageArray) Sort(less func(a, b PublicForwardMessage) bool) PublicForwardMessageArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of PublicForwardMessage. +func (s PublicForwardMessageArray) SortStable(less func(a, b PublicForwardMessage) bool) PublicForwardMessageArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of PublicForwardMessage. +func (s PublicForwardMessageArray) Retain(keep func(x PublicForwardMessage) bool) PublicForwardMessageArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s PublicForwardMessageArray) First() (v PublicForwardMessage, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s PublicForwardMessageArray) Last() (v PublicForwardMessage, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *PublicForwardMessageArray) PopFirst() (v PublicForwardMessage, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero PublicForwardMessage + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *PublicForwardMessageArray) Pop() (v PublicForwardMessage, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// PublicForwardStoryArray is adapter for slice of PublicForwardStory. +type PublicForwardStoryArray []PublicForwardStory + +// Sort sorts slice of PublicForwardStory. +func (s PublicForwardStoryArray) Sort(less func(a, b PublicForwardStory) bool) PublicForwardStoryArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of PublicForwardStory. +func (s PublicForwardStoryArray) SortStable(less func(a, b PublicForwardStory) bool) PublicForwardStoryArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of PublicForwardStory. +func (s PublicForwardStoryArray) Retain(keep func(x PublicForwardStory) bool) PublicForwardStoryArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s PublicForwardStoryArray) First() (v PublicForwardStory, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s PublicForwardStoryArray) Last() (v PublicForwardStory, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *PublicForwardStoryArray) PopFirst() (v PublicForwardStory, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero PublicForwardStory + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *PublicForwardStoryArray) Pop() (v PublicForwardStory, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_reaction_count_gen.go b/vendor/github.com/gotd/td/tg/tl_reaction_count_gen.go index 5a843b2b..4c31630a 100644 --- a/vendor/github.com/gotd/td/tg/tl_reaction_count_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_reaction_count_gen.go @@ -46,9 +46,9 @@ type ReactionCount struct { // // Use SetChosenOrder and GetChosenOrder helpers. ChosenOrder int - // Reaction (a UTF8 emoji) + // The reaction. Reaction ReactionClass - // NUmber of users that reacted with this emoji + // Number of users that reacted with this emoji. Count int } diff --git a/vendor/github.com/gotd/td/tg/tl_registry_gen.go b/vendor/github.com/gotd/td/tg/tl_registry_gen.go index 0c4ca405..39b8da52 100644 --- a/vendor/github.com/gotd/td/tg/tl_registry_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_registry_gen.go @@ -32,7 +32,7 @@ var ( ) // Layer version of schema. -const Layer = 166 +const Layer = 169 // TypesMap returns mapping from type ids to TL type names. func TypesMap() map[uint32]string { @@ -104,7 +104,7 @@ func TypesMap() map[uint32]string { StorageFileMp4TypeID: "storage.fileMp4#b3cea0e4", StorageFileWebpTypeID: "storage.fileWebp#1081464c", UserEmptyTypeID: "userEmpty#d3bc4b7a", - UserTypeID: "user#eb602f25", + UserTypeID: "user#215c4438", UserProfilePhotoEmptyTypeID: "userProfilePhotoEmpty#4f11bae1", UserProfilePhotoTypeID: "userProfilePhoto#82d1f706", UserStatusEmptyTypeID: "userStatusEmpty#9d05049", @@ -116,10 +116,10 @@ func TypesMap() map[uint32]string { ChatEmptyTypeID: "chatEmpty#29562865", ChatTypeID: "chat#41cbf256", ChatForbiddenTypeID: "chatForbidden#6592a1a7", - ChannelTypeID: "channel#1981ea7e", + ChannelTypeID: "channel#aadfc8f", ChannelForbiddenTypeID: "channelForbidden#17d493d5", ChatFullTypeID: "chatFull#c9d31138", - ChannelFullTypeID: "channelFull#723027bd", + ChannelFullTypeID: "channelFull#f2bcb6f", ChatParticipantTypeID: "chatParticipant#c02d4007", ChatParticipantCreatorTypeID: "chatParticipantCreator#e46bcee4", ChatParticipantAdminTypeID: "chatParticipantAdmin#a0933f5b", @@ -144,7 +144,8 @@ func TypesMap() map[uint32]string { MessageMediaPollTypeID: "messageMediaPoll#4bd6e798", MessageMediaDiceTypeID: "messageMediaDice#3f7ee58b", MessageMediaStoryTypeID: "messageMediaStory#68cb6283", - MessageMediaGiveawayTypeID: "messageMediaGiveaway#58260664", + MessageMediaGiveawayTypeID: "messageMediaGiveaway#daad85b0", + MessageMediaGiveawayResultsTypeID: "messageMediaGiveawayResults#c6991068", MessageActionEmptyTypeID: "messageActionEmpty#b6aef7b0", MessageActionChatCreateTypeID: "messageActionChatCreate#bd47cbad", MessageActionChatEditTitleTypeID: "messageActionChatEditTitle#b5a1ce5a", @@ -181,11 +182,11 @@ func TypesMap() map[uint32]string { MessageActionTopicCreateTypeID: "messageActionTopicCreate#d999256", MessageActionTopicEditTypeID: "messageActionTopicEdit#c0944820", MessageActionSuggestProfilePhotoTypeID: "messageActionSuggestProfilePhoto#57de635e", - MessageActionRequestedPeerTypeID: "messageActionRequestedPeer#fe77345d", - MessageActionSetChatWallPaperTypeID: "messageActionSetChatWallPaper#bc44a927", - MessageActionSetSameChatWallPaperTypeID: "messageActionSetSameChatWallPaper#c0787d6d", - MessageActionGiftCodeTypeID: "messageActionGiftCode#d2cfdb0e", + MessageActionRequestedPeerTypeID: "messageActionRequestedPeer#31518e9b", + MessageActionSetChatWallPaperTypeID: "messageActionSetChatWallPaper#5060a3f4", + MessageActionGiftCodeTypeID: "messageActionGiftCode#678c2e09", MessageActionGiveawayLaunchTypeID: "messageActionGiveawayLaunch#332ba9ed", + MessageActionGiveawayResultsTypeID: "messageActionGiveawayResults#2a9fadc5", DialogTypeID: "dialog#d58a08c6", DialogFolderTypeID: "dialogFolder#71bd134c", PhotoEmptyTypeID: "photoEmpty#2331b22d", @@ -377,6 +378,11 @@ func TypesMap() map[uint32]string { UpdateStoryIDTypeID: "updateStoryID#1bf335b9", UpdateStoriesStealthModeTypeID: "updateStoriesStealthMode#2c084dc1", UpdateSentStoryReactionTypeID: "updateSentStoryReaction#7d627683", + UpdateBotChatBoostTypeID: "updateBotChatBoost#904dd49c", + UpdateChannelViewForumAsMessagesTypeID: "updateChannelViewForumAsMessages#7b68920", + UpdatePeerWallpaperTypeID: "updatePeerWallpaper#ae3f101d", + UpdateBotMessageReactionTypeID: "updateBotMessageReaction#ac21d3ce", + UpdateBotMessageReactionsTypeID: "updateBotMessageReactions#9cb7759", UpdatesStateTypeID: "updates.state#a56c2a3e", UpdatesDifferenceEmptyTypeID: "updates.differenceEmpty#5d75a138", UpdatesDifferenceTypeID: "updates.difference#f49ca0", @@ -527,6 +533,7 @@ func TypesMap() map[uint32]string { InputStickerSetEmojiGenericAnimationsTypeID: "inputStickerSetEmojiGenericAnimations#4c4d4ce", InputStickerSetEmojiDefaultStatusesTypeID: "inputStickerSetEmojiDefaultStatuses#29d0f5ee", InputStickerSetEmojiDefaultTopicIconsTypeID: "inputStickerSetEmojiDefaultTopicIcons#44c1f8e9", + InputStickerSetEmojiChannelDefaultStatusesTypeID: "inputStickerSetEmojiChannelDefaultStatuses#49748553", StickerSetTypeID: "stickerSet#2dd14edc", MessagesStickerSetTypeID: "messages.stickerSet#6e153f16", MessagesStickerSetNotModifiedTypeID: "messages.stickerSetNotModified#d3f924eb", @@ -547,7 +554,7 @@ func TypesMap() map[uint32]string { KeyboardButtonUserProfileTypeID: "keyboardButtonUserProfile#308660c1", KeyboardButtonWebViewTypeID: "keyboardButtonWebView#13767230", KeyboardButtonSimpleWebViewTypeID: "keyboardButtonSimpleWebView#a0c0505c", - KeyboardButtonRequestPeerTypeID: "keyboardButtonRequestPeer#d0b468c", + KeyboardButtonRequestPeerTypeID: "keyboardButtonRequestPeer#53d7bfd8", KeyboardButtonRowTypeID: "keyboardButtonRow#77608b83", ReplyKeyboardHideTypeID: "replyKeyboardHide#a03e5b85", ReplyKeyboardForceReplyTypeID: "replyKeyboardForceReply#86b40b08", @@ -821,8 +828,10 @@ func TypesMap() map[uint32]string { ChannelAdminLogEventActionDeleteTopicTypeID: "channelAdminLogEventActionDeleteTopic#ae168909", ChannelAdminLogEventActionPinTopicTypeID: "channelAdminLogEventActionPinTopic#5d8d353b", ChannelAdminLogEventActionToggleAntiSpamTypeID: "channelAdminLogEventActionToggleAntiSpam#64f36dfc", - ChannelAdminLogEventActionChangeColorTypeID: "channelAdminLogEventActionChangeColor#3c2b247b", - ChannelAdminLogEventActionChangeBackgroundEmojiTypeID: "channelAdminLogEventActionChangeBackgroundEmoji#445fc434", + ChannelAdminLogEventActionChangePeerColorTypeID: "channelAdminLogEventActionChangePeerColor#5796e780", + ChannelAdminLogEventActionChangeProfilePeerColorTypeID: "channelAdminLogEventActionChangeProfilePeerColor#5e477b25", + ChannelAdminLogEventActionChangeWallpaperTypeID: "channelAdminLogEventActionChangeWallpaper#31bb5d52", + ChannelAdminLogEventActionChangeEmojiStatusTypeID: "channelAdminLogEventActionChangeEmojiStatus#3ea9feb1", ChannelAdminLogEventTypeID: "channelAdminLogEvent#1fad68cd", ChannelsAdminLogResultsTypeID: "channels.adminLogResults#ed8af74d", ChannelAdminLogEventsFilterTypeID: "channelAdminLogEventsFilter#ea107ae4", @@ -937,7 +946,7 @@ func TypesMap() map[uint32]string { AccountWallPapersNotModifiedTypeID: "account.wallPapersNotModified#1c199183", AccountWallPapersTypeID: "account.wallPapers#cdc3858c", CodeSettingsTypeID: "codeSettings#ad253d78", - WallPaperSettingsTypeID: "wallPaperSettings#1dc1bca4", + WallPaperSettingsTypeID: "wallPaperSettings#372efcd0", AutoDownloadSettingsTypeID: "autoDownloadSettings#baa57628", AccountAutoDownloadSettingsTypeID: "account.autoDownloadSettings#63cacf26", EmojiKeywordTypeID: "emojiKeyword#d5b3b9f9", @@ -989,8 +998,7 @@ func TypesMap() map[uint32]string { StatsGraphAsyncTypeID: "statsGraphAsync#4a27eb2d", StatsGraphErrorTypeID: "statsGraphError#bedc9822", StatsGraphTypeID: "statsGraph#8ea464b6", - MessageInteractionCountersTypeID: "messageInteractionCounters#ad4fc9bd", - StatsBroadcastStatsTypeID: "stats.broadcastStats#bdf78394", + StatsBroadcastStatsTypeID: "stats.broadcastStats#396ca5fc", HelpPromoDataEmptyTypeID: "help.promoDataEmpty#98f6ac75", HelpPromoDataTypeID: "help.promoData#8c39793f", VideoSizeTypeID: "videoSize#de33b094", @@ -1008,11 +1016,11 @@ func TypesMap() map[uint32]string { MessageViewsTypeID: "messageViews#455b853d", MessagesMessageViewsTypeID: "messages.messageViews#b6c4f543", MessagesDiscussionMessageTypeID: "messages.discussionMessage#a6341782", - MessageReplyHeaderTypeID: "messageReplyHeader#6eebcabd", + MessageReplyHeaderTypeID: "messageReplyHeader#afbc09db", MessageReplyStoryHeaderTypeID: "messageReplyStoryHeader#9c98bfc1", MessageRepliesTypeID: "messageReplies#83d60fc2", PeerBlockedTypeID: "peerBlocked#e8fd8014", - StatsMessageStatsTypeID: "stats.messageStats#8999f295", + StatsMessageStatsTypeID: "stats.messageStats#7fe91c14", GroupCallDiscardedTypeID: "groupCallDiscarded#7780bcb4", GroupCallTypeID: "groupCall#d597650c", InputGroupCallTypeID: "inputGroupCall#d8aa840f", @@ -1051,7 +1059,7 @@ func TypesMap() map[uint32]string { AccountResetPasswordFailedWaitTypeID: "account.resetPasswordFailedWait#e3779861", AccountResetPasswordRequestedWaitTypeID: "account.resetPasswordRequestedWait#e9effc7d", AccountResetPasswordOkTypeID: "account.resetPasswordOk#e926d63e", - SponsoredMessageTypeID: "sponsoredMessage#daafff6b", + SponsoredMessageTypeID: "sponsoredMessage#ed5383f7", MessagesSponsoredMessagesTypeID: "messages.sponsoredMessages#c9ee1d87", MessagesSponsoredMessagesEmptyTypeID: "messages.sponsoredMessagesEmpty#1839490f", SearchResultsCalendarPeriodTypeID: "searchResultsCalendarPeriod#c9b0539f", @@ -1101,12 +1109,12 @@ func TypesMap() map[uint32]string { InputInvoiceSlugTypeID: "inputInvoiceSlug#c326caef", InputInvoicePremiumGiftCodeTypeID: "inputInvoicePremiumGiftCode#98986c0d", PaymentsExportedInvoiceTypeID: "payments.exportedInvoice#aed0cbd9", - MessagesTranscribedAudioTypeID: "messages.transcribedAudio#93752c52", + MessagesTranscribedAudioTypeID: "messages.transcribedAudio#cfb9d957", HelpPremiumPromoTypeID: "help.premiumPromo#5334759c", InputStorePaymentPremiumSubscriptionTypeID: "inputStorePaymentPremiumSubscription#a6751e66", InputStorePaymentGiftPremiumTypeID: "inputStorePaymentGiftPremium#616f7fe8", InputStorePaymentPremiumGiftCodeTypeID: "inputStorePaymentPremiumGiftCode#a3805f3f", - InputStorePaymentPremiumGiveawayTypeID: "inputStorePaymentPremiumGiveaway#7c9375e6", + InputStorePaymentPremiumGiveawayTypeID: "inputStorePaymentPremiumGiveaway#160544ca", PremiumGiftOptionTypeID: "premiumGiftOption#74c34319", PaymentFormMethodTypeID: "paymentFormMethod#88f8f21b", EmojiStatusEmptyTypeID: "emojiStatusEmpty#2de11aae", @@ -1179,14 +1187,16 @@ func TypesMap() map[uint32]string { StoryViewsTypeID: "storyViews#8d595cd6", StoryItemDeletedTypeID: "storyItemDeleted#51e6ee4f", StoryItemSkippedTypeID: "storyItemSkipped#ffadc913", - StoryItemTypeID: "storyItem#44c457ce", + StoryItemTypeID: "storyItem#af6365a1", StoriesAllStoriesNotModifiedTypeID: "stories.allStoriesNotModified#1158fe3e", StoriesAllStoriesTypeID: "stories.allStories#6efc5e81", StoriesStoriesTypeID: "stories.stories#5dd8c3c8", StoryViewTypeID: "storyView#b0bdeac5", - StoriesStoryViewsListTypeID: "stories.storyViewsList#46e9b9ec", + StoryViewPublicForwardTypeID: "storyViewPublicForward#9083670b", + StoryViewPublicRepostTypeID: "storyViewPublicRepost#bd74cf49", + StoriesStoryViewsListTypeID: "stories.storyViewsList#59d78fc5", StoriesStoryViewsTypeID: "stories.storyViews#de9eed1d", - InputReplyToMessageTypeID: "inputReplyToMessage#73ec805", + InputReplyToMessageTypeID: "inputReplyToMessage#22c0f6d5", InputReplyToStoryTypeID: "inputReplyToStory#15b0f283", ExportedStoryLinkTypeID: "exportedStoryLink#3fc9053b", StoriesStealthModeTypeID: "storiesStealthMode#712e27fd", @@ -1195,11 +1205,13 @@ func TypesMap() map[uint32]string { InputMediaAreaVenueTypeID: "inputMediaAreaVenue#b282217f", MediaAreaGeoPointTypeID: "mediaAreaGeoPoint#df8b3b22", MediaAreaSuggestedReactionTypeID: "mediaAreaSuggestedReaction#14455871", + MediaAreaChannelPostTypeID: "mediaAreaChannelPost#770416af", + InputMediaAreaChannelPostTypeID: "inputMediaAreaChannelPost#2271f2bf", PeerStoriesTypeID: "peerStories#9a35e999", StoriesPeerStoriesTypeID: "stories.peerStories#cae68768", MessagesWebPageTypeID: "messages.webPage#fd5e12bd", PremiumGiftCodeOptionTypeID: "premiumGiftCodeOption#257e962b", - PaymentsCheckedGiftCodeTypeID: "payments.checkedGiftCode#b722f158", + PaymentsCheckedGiftCodeTypeID: "payments.checkedGiftCode#284a1096", PaymentsGiveawayInfoTypeID: "payments.giveawayInfo#4367daa0", PaymentsGiveawayInfoResultsTypeID: "payments.giveawayInfoResults#cd5570", PrepaidGiveawayTypeID: "prepaidGiveaway#b2539d54", @@ -1208,6 +1220,23 @@ func TypesMap() map[uint32]string { MyBoostTypeID: "myBoost#c448415c", PremiumMyBoostsTypeID: "premium.myBoosts#9ae228e2", PremiumBoostsStatusTypeID: "premium.boostsStatus#4959427a", + StoryFwdHeaderTypeID: "storyFwdHeader#b826e150", + PostInteractionCountersMessageTypeID: "postInteractionCountersMessage#e7058e7f", + PostInteractionCountersStoryTypeID: "postInteractionCountersStory#8a480e27", + StatsStoryStatsTypeID: "stats.storyStats#50cd067c", + PublicForwardMessageTypeID: "publicForwardMessage#1f2bf4a", + PublicForwardStoryTypeID: "publicForwardStory#edf3add0", + StatsPublicForwardsTypeID: "stats.publicForwards#93037e20", + PeerColorTypeID: "peerColor#b54b5acf", + HelpPeerColorSetTypeID: "help.peerColorSet#26219a58", + HelpPeerColorProfileSetTypeID: "help.peerColorProfileSet#767d61eb", + HelpPeerColorOptionTypeID: "help.peerColorOption#ef8430ab", + HelpPeerColorsNotModifiedTypeID: "help.peerColorsNotModified#2ba1f5ce", + HelpPeerColorsTypeID: "help.peerColors#f8ed08", + StoryReactionTypeID: "storyReaction#6090d6d5", + StoryReactionPublicForwardTypeID: "storyReactionPublicForward#bbab2643", + StoryReactionPublicRepostTypeID: "storyReactionPublicRepost#cfcd0f13", + StoriesStoryReactionsListTypeID: "stories.storyReactionsList#aa5f789c", InvokeAfterMsgRequestTypeID: "invokeAfterMsg#cb9f372d", InvokeAfterMsgsRequestTypeID: "invokeAfterMsgs#3dc4b4f0", InitConnectionRequestTypeID: "initConnection#c1cd5ea9", @@ -1325,8 +1354,10 @@ func TypesMap() map[uint32]string { AccountSaveAutoSaveSettingsRequestTypeID: "account.saveAutoSaveSettings#d69b8361", AccountDeleteAutoSaveExceptionsRequestTypeID: "account.deleteAutoSaveExceptions#53bc0020", AccountInvalidateSignInCodesRequestTypeID: "account.invalidateSignInCodes#ca8ae8ba", - AccountUpdateColorRequestTypeID: "account.updateColor#a001cc43", + AccountUpdateColorRequestTypeID: "account.updateColor#7cefa15d", AccountGetDefaultBackgroundEmojisRequestTypeID: "account.getDefaultBackgroundEmojis#a60ab9ce", + AccountGetChannelDefaultEmojiStatusesRequestTypeID: "account.getChannelDefaultEmojiStatuses#7727a7d5", + AccountGetChannelRestrictedStatusEmojisRequestTypeID: "account.getChannelRestrictedStatusEmojis#35a9e0d5", UsersGetUsersRequestTypeID: "users.getUsers#d91a548", UsersGetFullUserRequestTypeID: "users.getFullUser#b60f5918", UsersSetSecureValueErrorsRequestTypeID: "users.setSecureValueErrors#90c894b5", @@ -1533,7 +1564,7 @@ func TypesMap() map[uint32]string { MessagesGetExtendedMediaRequestTypeID: "messages.getExtendedMedia#84f80814", MessagesSetDefaultHistoryTTLRequestTypeID: "messages.setDefaultHistoryTTL#9eb51445", MessagesGetDefaultHistoryTTLRequestTypeID: "messages.getDefaultHistoryTTL#658b7188", - MessagesSendBotRequestedPeerRequestTypeID: "messages.sendBotRequestedPeer#fe38d01b", + MessagesSendBotRequestedPeerRequestTypeID: "messages.sendBotRequestedPeer#91b2d060", MessagesGetEmojiGroupsRequestTypeID: "messages.getEmojiGroups#7488ce5b", MessagesGetEmojiStatusGroupsRequestTypeID: "messages.getEmojiStatusGroups#2ecd56cd", MessagesGetEmojiProfilePhotoGroupsRequestTypeID: "messages.getEmojiProfilePhotoGroups#21a548f3", @@ -1542,6 +1573,7 @@ func TypesMap() map[uint32]string { MessagesGetBotAppRequestTypeID: "messages.getBotApp#34fdc5c3", MessagesRequestAppWebViewRequestTypeID: "messages.requestAppWebView#8c5a3b3c", MessagesSetChatWallPaperRequestTypeID: "messages.setChatWallPaper#8ffacae1", + MessagesSearchEmojiStickerSetsRequestTypeID: "messages.searchEmojiStickerSets#92b4494c", UpdatesGetStateRequestTypeID: "updates.getState#edd4882a", UpdatesGetDifferenceRequestTypeID: "updates.getDifference#19c2f763", UpdatesGetChannelDifferenceRequestTypeID: "updates.getChannelDifference#3173d78", @@ -1563,7 +1595,6 @@ func TypesMap() map[uint32]string { HelpGetAppUpdateRequestTypeID: "help.getAppUpdate#522d5a7d", HelpGetInviteTextRequestTypeID: "help.getInviteText#4d392343", HelpGetSupportRequestTypeID: "help.getSupport#9cdf08cd", - HelpGetAppChangelogRequestTypeID: "help.getAppChangelog#9010ef6f", HelpSetBotUpdatesStatusRequestTypeID: "help.setBotUpdatesStatus#ec22cfcd", HelpGetCDNConfigRequestTypeID: "help.getCdnConfig#52029342", HelpGetRecentMeURLsRequestTypeID: "help.getRecentMeUrls#3dc0f114", @@ -1581,6 +1612,8 @@ func TypesMap() map[uint32]string { HelpDismissSuggestionRequestTypeID: "help.dismissSuggestion#f50dbaa1", HelpGetCountriesListRequestTypeID: "help.getCountriesList#735787a8", HelpGetPremiumPromoRequestTypeID: "help.getPremiumPromo#b81b93d4", + HelpGetPeerColorsRequestTypeID: "help.getPeerColors#da80f42f", + HelpGetPeerProfileColorsRequestTypeID: "help.getPeerProfileColors#abcfa9fd", ChannelsReadHistoryRequestTypeID: "channels.readHistory#cc104937", ChannelsDeleteMessagesRequestTypeID: "channels.deleteMessages#84c1fd4e", ChannelsReportSpamRequestTypeID: "channels.reportSpam#f44a8315", @@ -1637,7 +1670,10 @@ func TypesMap() map[uint32]string { ChannelsReportAntiSpamFalsePositiveRequestTypeID: "channels.reportAntiSpamFalsePositive#a850a693", ChannelsToggleParticipantsHiddenRequestTypeID: "channels.toggleParticipantsHidden#6a6e7854", ChannelsClickSponsoredMessageRequestTypeID: "channels.clickSponsoredMessage#18afbc93", - ChannelsUpdateColorRequestTypeID: "channels.updateColor#621a201f", + ChannelsUpdateColorRequestTypeID: "channels.updateColor#d8aa3671", + ChannelsToggleViewForumAsMessagesRequestTypeID: "channels.toggleViewForumAsMessages#9738bb15", + ChannelsGetChannelRecommendationsRequestTypeID: "channels.getChannelRecommendations#83b70d97", + ChannelsUpdateEmojiStatusRequestTypeID: "channels.updateEmojiStatus#f0d3e6a8", BotsSendCustomRequestRequestTypeID: "bots.sendCustomRequest#aa2769ed", BotsAnswerWebhookJSONQueryRequestTypeID: "bots.answerWebhookJSONQuery#e6213f4d", BotsSetBotCommandsRequestTypeID: "bots.setBotCommands#517165a", @@ -1720,8 +1756,10 @@ func TypesMap() map[uint32]string { StatsGetBroadcastStatsRequestTypeID: "stats.getBroadcastStats#ab42441a", StatsLoadAsyncGraphRequestTypeID: "stats.loadAsyncGraph#621d5fa0", StatsGetMegagroupStatsRequestTypeID: "stats.getMegagroupStats#dcdf8607", - StatsGetMessagePublicForwardsRequestTypeID: "stats.getMessagePublicForwards#5630281b", + StatsGetMessagePublicForwardsRequestTypeID: "stats.getMessagePublicForwards#5f150144", StatsGetMessageStatsRequestTypeID: "stats.getMessageStats#b6e0a3f5", + StatsGetStoryStatsRequestTypeID: "stats.getStoryStats#374fef40", + StatsGetStoryPublicForwardsRequestTypeID: "stats.getStoryPublicForwards#a6437ef6", ChatlistsExportChatlistInviteRequestTypeID: "chatlists.exportChatlistInvite#8472478e", ChatlistsDeleteExportedInviteRequestTypeID: "chatlists.deleteExportedInvite#719c5c5e", ChatlistsEditExportedInviteRequestTypeID: "chatlists.editExportedInvite#653db63d", @@ -1734,7 +1772,7 @@ func TypesMap() map[uint32]string { ChatlistsGetLeaveChatlistSuggestionsRequestTypeID: "chatlists.getLeaveChatlistSuggestions#fdbcd714", ChatlistsLeaveChatlistRequestTypeID: "chatlists.leaveChatlist#74fae13a", StoriesCanSendStoryRequestTypeID: "stories.canSendStory#c7dfdfdd", - StoriesSendStoryRequestTypeID: "stories.sendStory#bcb73644", + StoriesSendStoryRequestTypeID: "stories.sendStory#e4e6694b", StoriesEditStoryRequestTypeID: "stories.editStory#b583ba46", StoriesDeleteStoriesRequestTypeID: "stories.deleteStories#ae59db5f", StoriesTogglePinnedRequestTypeID: "stories.togglePinned#9a75a1ef", @@ -1756,10 +1794,12 @@ func TypesMap() map[uint32]string { StoriesGetPeerMaxIDsRequestTypeID: "stories.getPeerMaxIDs#535983c3", StoriesGetChatsToSendRequestTypeID: "stories.getChatsToSend#a56a8b60", StoriesTogglePeerStoriesHiddenRequestTypeID: "stories.togglePeerStoriesHidden#bd0415c4", + StoriesGetStoryReactionsListRequestTypeID: "stories.getStoryReactionsList#b9b2881f", PremiumGetBoostsListRequestTypeID: "premium.getBoostsList#60f67660", PremiumGetMyBoostsRequestTypeID: "premium.getMyBoosts#be77b4a", PremiumApplyBoostRequestTypeID: "premium.applyBoost#6b7da746", PremiumGetBoostsStatusRequestTypeID: "premium.getBoostsStatus#42f1f61", + PremiumGetUserBoostsRequestTypeID: "premium.getUserBoosts#39854d1f", IntTypeID: "int#a8509bda", LongTypeID: "long#22076cba", DoubleTypeID: "double#2210c154", @@ -1887,6 +1927,7 @@ func NamesMap() map[string]uint32 { "messageMediaDice": MessageMediaDiceTypeID, "messageMediaStory": MessageMediaStoryTypeID, "messageMediaGiveaway": MessageMediaGiveawayTypeID, + "messageMediaGiveawayResults": MessageMediaGiveawayResultsTypeID, "messageActionEmpty": MessageActionEmptyTypeID, "messageActionChatCreate": MessageActionChatCreateTypeID, "messageActionChatEditTitle": MessageActionChatEditTitleTypeID, @@ -1925,9 +1966,9 @@ func NamesMap() map[string]uint32 { "messageActionSuggestProfilePhoto": MessageActionSuggestProfilePhotoTypeID, "messageActionRequestedPeer": MessageActionRequestedPeerTypeID, "messageActionSetChatWallPaper": MessageActionSetChatWallPaperTypeID, - "messageActionSetSameChatWallPaper": MessageActionSetSameChatWallPaperTypeID, "messageActionGiftCode": MessageActionGiftCodeTypeID, "messageActionGiveawayLaunch": MessageActionGiveawayLaunchTypeID, + "messageActionGiveawayResults": MessageActionGiveawayResultsTypeID, "dialog": DialogTypeID, "dialogFolder": DialogFolderTypeID, "photoEmpty": PhotoEmptyTypeID, @@ -2119,6 +2160,11 @@ func NamesMap() map[string]uint32 { "updateStoryID": UpdateStoryIDTypeID, "updateStoriesStealthMode": UpdateStoriesStealthModeTypeID, "updateSentStoryReaction": UpdateSentStoryReactionTypeID, + "updateBotChatBoost": UpdateBotChatBoostTypeID, + "updateChannelViewForumAsMessages": UpdateChannelViewForumAsMessagesTypeID, + "updatePeerWallpaper": UpdatePeerWallpaperTypeID, + "updateBotMessageReaction": UpdateBotMessageReactionTypeID, + "updateBotMessageReactions": UpdateBotMessageReactionsTypeID, "updates.state": UpdatesStateTypeID, "updates.differenceEmpty": UpdatesDifferenceEmptyTypeID, "updates.difference": UpdatesDifferenceTypeID, @@ -2269,6 +2315,7 @@ func NamesMap() map[string]uint32 { "inputStickerSetEmojiGenericAnimations": InputStickerSetEmojiGenericAnimationsTypeID, "inputStickerSetEmojiDefaultStatuses": InputStickerSetEmojiDefaultStatusesTypeID, "inputStickerSetEmojiDefaultTopicIcons": InputStickerSetEmojiDefaultTopicIconsTypeID, + "inputStickerSetEmojiChannelDefaultStatuses": InputStickerSetEmojiChannelDefaultStatusesTypeID, "stickerSet": StickerSetTypeID, "messages.stickerSet": MessagesStickerSetTypeID, "messages.stickerSetNotModified": MessagesStickerSetNotModifiedTypeID, @@ -2563,8 +2610,10 @@ func NamesMap() map[string]uint32 { "channelAdminLogEventActionDeleteTopic": ChannelAdminLogEventActionDeleteTopicTypeID, "channelAdminLogEventActionPinTopic": ChannelAdminLogEventActionPinTopicTypeID, "channelAdminLogEventActionToggleAntiSpam": ChannelAdminLogEventActionToggleAntiSpamTypeID, - "channelAdminLogEventActionChangeColor": ChannelAdminLogEventActionChangeColorTypeID, - "channelAdminLogEventActionChangeBackgroundEmoji": ChannelAdminLogEventActionChangeBackgroundEmojiTypeID, + "channelAdminLogEventActionChangePeerColor": ChannelAdminLogEventActionChangePeerColorTypeID, + "channelAdminLogEventActionChangeProfilePeerColor": ChannelAdminLogEventActionChangeProfilePeerColorTypeID, + "channelAdminLogEventActionChangeWallpaper": ChannelAdminLogEventActionChangeWallpaperTypeID, + "channelAdminLogEventActionChangeEmojiStatus": ChannelAdminLogEventActionChangeEmojiStatusTypeID, "channelAdminLogEvent": ChannelAdminLogEventTypeID, "channels.adminLogResults": ChannelsAdminLogResultsTypeID, "channelAdminLogEventsFilter": ChannelAdminLogEventsFilterTypeID, @@ -2731,7 +2780,6 @@ func NamesMap() map[string]uint32 { "statsGraphAsync": StatsGraphAsyncTypeID, "statsGraphError": StatsGraphErrorTypeID, "statsGraph": StatsGraphTypeID, - "messageInteractionCounters": MessageInteractionCountersTypeID, "stats.broadcastStats": StatsBroadcastStatsTypeID, "help.promoDataEmpty": HelpPromoDataEmptyTypeID, "help.promoData": HelpPromoDataTypeID, @@ -2926,6 +2974,8 @@ func NamesMap() map[string]uint32 { "stories.allStories": StoriesAllStoriesTypeID, "stories.stories": StoriesStoriesTypeID, "storyView": StoryViewTypeID, + "storyViewPublicForward": StoryViewPublicForwardTypeID, + "storyViewPublicRepost": StoryViewPublicRepostTypeID, "stories.storyViewsList": StoriesStoryViewsListTypeID, "stories.storyViews": StoriesStoryViewsTypeID, "inputReplyToMessage": InputReplyToMessageTypeID, @@ -2937,6 +2987,8 @@ func NamesMap() map[string]uint32 { "inputMediaAreaVenue": InputMediaAreaVenueTypeID, "mediaAreaGeoPoint": MediaAreaGeoPointTypeID, "mediaAreaSuggestedReaction": MediaAreaSuggestedReactionTypeID, + "mediaAreaChannelPost": MediaAreaChannelPostTypeID, + "inputMediaAreaChannelPost": InputMediaAreaChannelPostTypeID, "peerStories": PeerStoriesTypeID, "stories.peerStories": StoriesPeerStoriesTypeID, "messages.webPage": MessagesWebPageTypeID, @@ -2950,6 +3002,23 @@ func NamesMap() map[string]uint32 { "myBoost": MyBoostTypeID, "premium.myBoosts": PremiumMyBoostsTypeID, "premium.boostsStatus": PremiumBoostsStatusTypeID, + "storyFwdHeader": StoryFwdHeaderTypeID, + "postInteractionCountersMessage": PostInteractionCountersMessageTypeID, + "postInteractionCountersStory": PostInteractionCountersStoryTypeID, + "stats.storyStats": StatsStoryStatsTypeID, + "publicForwardMessage": PublicForwardMessageTypeID, + "publicForwardStory": PublicForwardStoryTypeID, + "stats.publicForwards": StatsPublicForwardsTypeID, + "peerColor": PeerColorTypeID, + "help.peerColorSet": HelpPeerColorSetTypeID, + "help.peerColorProfileSet": HelpPeerColorProfileSetTypeID, + "help.peerColorOption": HelpPeerColorOptionTypeID, + "help.peerColorsNotModified": HelpPeerColorsNotModifiedTypeID, + "help.peerColors": HelpPeerColorsTypeID, + "storyReaction": StoryReactionTypeID, + "storyReactionPublicForward": StoryReactionPublicForwardTypeID, + "storyReactionPublicRepost": StoryReactionPublicRepostTypeID, + "stories.storyReactionsList": StoriesStoryReactionsListTypeID, "invokeAfterMsg": InvokeAfterMsgRequestTypeID, "invokeAfterMsgs": InvokeAfterMsgsRequestTypeID, "initConnection": InitConnectionRequestTypeID, @@ -3069,6 +3138,8 @@ func NamesMap() map[string]uint32 { "account.invalidateSignInCodes": AccountInvalidateSignInCodesRequestTypeID, "account.updateColor": AccountUpdateColorRequestTypeID, "account.getDefaultBackgroundEmojis": AccountGetDefaultBackgroundEmojisRequestTypeID, + "account.getChannelDefaultEmojiStatuses": AccountGetChannelDefaultEmojiStatusesRequestTypeID, + "account.getChannelRestrictedStatusEmojis": AccountGetChannelRestrictedStatusEmojisRequestTypeID, "users.getUsers": UsersGetUsersRequestTypeID, "users.getFullUser": UsersGetFullUserRequestTypeID, "users.setSecureValueErrors": UsersSetSecureValueErrorsRequestTypeID, @@ -3284,6 +3355,7 @@ func NamesMap() map[string]uint32 { "messages.getBotApp": MessagesGetBotAppRequestTypeID, "messages.requestAppWebView": MessagesRequestAppWebViewRequestTypeID, "messages.setChatWallPaper": MessagesSetChatWallPaperRequestTypeID, + "messages.searchEmojiStickerSets": MessagesSearchEmojiStickerSetsRequestTypeID, "updates.getState": UpdatesGetStateRequestTypeID, "updates.getDifference": UpdatesGetDifferenceRequestTypeID, "updates.getChannelDifference": UpdatesGetChannelDifferenceRequestTypeID, @@ -3305,7 +3377,6 @@ func NamesMap() map[string]uint32 { "help.getAppUpdate": HelpGetAppUpdateRequestTypeID, "help.getInviteText": HelpGetInviteTextRequestTypeID, "help.getSupport": HelpGetSupportRequestTypeID, - "help.getAppChangelog": HelpGetAppChangelogRequestTypeID, "help.setBotUpdatesStatus": HelpSetBotUpdatesStatusRequestTypeID, "help.getCdnConfig": HelpGetCDNConfigRequestTypeID, "help.getRecentMeUrls": HelpGetRecentMeURLsRequestTypeID, @@ -3323,6 +3394,8 @@ func NamesMap() map[string]uint32 { "help.dismissSuggestion": HelpDismissSuggestionRequestTypeID, "help.getCountriesList": HelpGetCountriesListRequestTypeID, "help.getPremiumPromo": HelpGetPremiumPromoRequestTypeID, + "help.getPeerColors": HelpGetPeerColorsRequestTypeID, + "help.getPeerProfileColors": HelpGetPeerProfileColorsRequestTypeID, "channels.readHistory": ChannelsReadHistoryRequestTypeID, "channels.deleteMessages": ChannelsDeleteMessagesRequestTypeID, "channels.reportSpam": ChannelsReportSpamRequestTypeID, @@ -3380,6 +3453,9 @@ func NamesMap() map[string]uint32 { "channels.toggleParticipantsHidden": ChannelsToggleParticipantsHiddenRequestTypeID, "channels.clickSponsoredMessage": ChannelsClickSponsoredMessageRequestTypeID, "channels.updateColor": ChannelsUpdateColorRequestTypeID, + "channels.toggleViewForumAsMessages": ChannelsToggleViewForumAsMessagesRequestTypeID, + "channels.getChannelRecommendations": ChannelsGetChannelRecommendationsRequestTypeID, + "channels.updateEmojiStatus": ChannelsUpdateEmojiStatusRequestTypeID, "bots.sendCustomRequest": BotsSendCustomRequestRequestTypeID, "bots.answerWebhookJSONQuery": BotsAnswerWebhookJSONQueryRequestTypeID, "bots.setBotCommands": BotsSetBotCommandsRequestTypeID, @@ -3464,6 +3540,8 @@ func NamesMap() map[string]uint32 { "stats.getMegagroupStats": StatsGetMegagroupStatsRequestTypeID, "stats.getMessagePublicForwards": StatsGetMessagePublicForwardsRequestTypeID, "stats.getMessageStats": StatsGetMessageStatsRequestTypeID, + "stats.getStoryStats": StatsGetStoryStatsRequestTypeID, + "stats.getStoryPublicForwards": StatsGetStoryPublicForwardsRequestTypeID, "chatlists.exportChatlistInvite": ChatlistsExportChatlistInviteRequestTypeID, "chatlists.deleteExportedInvite": ChatlistsDeleteExportedInviteRequestTypeID, "chatlists.editExportedInvite": ChatlistsEditExportedInviteRequestTypeID, @@ -3498,10 +3576,12 @@ func NamesMap() map[string]uint32 { "stories.getPeerMaxIDs": StoriesGetPeerMaxIDsRequestTypeID, "stories.getChatsToSend": StoriesGetChatsToSendRequestTypeID, "stories.togglePeerStoriesHidden": StoriesTogglePeerStoriesHiddenRequestTypeID, + "stories.getStoryReactionsList": StoriesGetStoryReactionsListRequestTypeID, "premium.getBoostsList": PremiumGetBoostsListRequestTypeID, "premium.getMyBoosts": PremiumGetMyBoostsRequestTypeID, "premium.applyBoost": PremiumApplyBoostRequestTypeID, "premium.getBoostsStatus": PremiumGetBoostsStatusRequestTypeID, + "premium.getUserBoosts": PremiumGetUserBoostsRequestTypeID, "int": IntTypeID, "long": LongTypeID, "double": DoubleTypeID, @@ -3629,6 +3709,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessageMediaDiceTypeID: func() bin.Object { return &MessageMediaDice{} }, MessageMediaStoryTypeID: func() bin.Object { return &MessageMediaStory{} }, MessageMediaGiveawayTypeID: func() bin.Object { return &MessageMediaGiveaway{} }, + MessageMediaGiveawayResultsTypeID: func() bin.Object { return &MessageMediaGiveawayResults{} }, MessageActionEmptyTypeID: func() bin.Object { return &MessageActionEmpty{} }, MessageActionChatCreateTypeID: func() bin.Object { return &MessageActionChatCreate{} }, MessageActionChatEditTitleTypeID: func() bin.Object { return &MessageActionChatEditTitle{} }, @@ -3667,9 +3748,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessageActionSuggestProfilePhotoTypeID: func() bin.Object { return &MessageActionSuggestProfilePhoto{} }, MessageActionRequestedPeerTypeID: func() bin.Object { return &MessageActionRequestedPeer{} }, MessageActionSetChatWallPaperTypeID: func() bin.Object { return &MessageActionSetChatWallPaper{} }, - MessageActionSetSameChatWallPaperTypeID: func() bin.Object { return &MessageActionSetSameChatWallPaper{} }, MessageActionGiftCodeTypeID: func() bin.Object { return &MessageActionGiftCode{} }, MessageActionGiveawayLaunchTypeID: func() bin.Object { return &MessageActionGiveawayLaunch{} }, + MessageActionGiveawayResultsTypeID: func() bin.Object { return &MessageActionGiveawayResults{} }, DialogTypeID: func() bin.Object { return &Dialog{} }, DialogFolderTypeID: func() bin.Object { return &DialogFolder{} }, PhotoEmptyTypeID: func() bin.Object { return &PhotoEmpty{} }, @@ -3861,6 +3942,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { UpdateStoryIDTypeID: func() bin.Object { return &UpdateStoryID{} }, UpdateStoriesStealthModeTypeID: func() bin.Object { return &UpdateStoriesStealthMode{} }, UpdateSentStoryReactionTypeID: func() bin.Object { return &UpdateSentStoryReaction{} }, + UpdateBotChatBoostTypeID: func() bin.Object { return &UpdateBotChatBoost{} }, + UpdateChannelViewForumAsMessagesTypeID: func() bin.Object { return &UpdateChannelViewForumAsMessages{} }, + UpdatePeerWallpaperTypeID: func() bin.Object { return &UpdatePeerWallpaper{} }, + UpdateBotMessageReactionTypeID: func() bin.Object { return &UpdateBotMessageReaction{} }, + UpdateBotMessageReactionsTypeID: func() bin.Object { return &UpdateBotMessageReactions{} }, UpdatesStateTypeID: func() bin.Object { return &UpdatesState{} }, UpdatesDifferenceEmptyTypeID: func() bin.Object { return &UpdatesDifferenceEmpty{} }, UpdatesDifferenceTypeID: func() bin.Object { return &UpdatesDifference{} }, @@ -4011,6 +4097,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InputStickerSetEmojiGenericAnimationsTypeID: func() bin.Object { return &InputStickerSetEmojiGenericAnimations{} }, InputStickerSetEmojiDefaultStatusesTypeID: func() bin.Object { return &InputStickerSetEmojiDefaultStatuses{} }, InputStickerSetEmojiDefaultTopicIconsTypeID: func() bin.Object { return &InputStickerSetEmojiDefaultTopicIcons{} }, + InputStickerSetEmojiChannelDefaultStatusesTypeID: func() bin.Object { return &InputStickerSetEmojiChannelDefaultStatuses{} }, StickerSetTypeID: func() bin.Object { return &StickerSet{} }, MessagesStickerSetTypeID: func() bin.Object { return &MessagesStickerSet{} }, MessagesStickerSetNotModifiedTypeID: func() bin.Object { return &MessagesStickerSetNotModified{} }, @@ -4305,8 +4392,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChannelAdminLogEventActionDeleteTopicTypeID: func() bin.Object { return &ChannelAdminLogEventActionDeleteTopic{} }, ChannelAdminLogEventActionPinTopicTypeID: func() bin.Object { return &ChannelAdminLogEventActionPinTopic{} }, ChannelAdminLogEventActionToggleAntiSpamTypeID: func() bin.Object { return &ChannelAdminLogEventActionToggleAntiSpam{} }, - ChannelAdminLogEventActionChangeColorTypeID: func() bin.Object { return &ChannelAdminLogEventActionChangeColor{} }, - ChannelAdminLogEventActionChangeBackgroundEmojiTypeID: func() bin.Object { return &ChannelAdminLogEventActionChangeBackgroundEmoji{} }, + ChannelAdminLogEventActionChangePeerColorTypeID: func() bin.Object { return &ChannelAdminLogEventActionChangePeerColor{} }, + ChannelAdminLogEventActionChangeProfilePeerColorTypeID: func() bin.Object { return &ChannelAdminLogEventActionChangeProfilePeerColor{} }, + ChannelAdminLogEventActionChangeWallpaperTypeID: func() bin.Object { return &ChannelAdminLogEventActionChangeWallpaper{} }, + ChannelAdminLogEventActionChangeEmojiStatusTypeID: func() bin.Object { return &ChannelAdminLogEventActionChangeEmojiStatus{} }, ChannelAdminLogEventTypeID: func() bin.Object { return &ChannelAdminLogEvent{} }, ChannelsAdminLogResultsTypeID: func() bin.Object { return &ChannelsAdminLogResults{} }, ChannelAdminLogEventsFilterTypeID: func() bin.Object { return &ChannelAdminLogEventsFilter{} }, @@ -4473,7 +4562,6 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StatsGraphAsyncTypeID: func() bin.Object { return &StatsGraphAsync{} }, StatsGraphErrorTypeID: func() bin.Object { return &StatsGraphError{} }, StatsGraphTypeID: func() bin.Object { return &StatsGraph{} }, - MessageInteractionCountersTypeID: func() bin.Object { return &MessageInteractionCounters{} }, StatsBroadcastStatsTypeID: func() bin.Object { return &StatsBroadcastStats{} }, HelpPromoDataEmptyTypeID: func() bin.Object { return &HelpPromoDataEmpty{} }, HelpPromoDataTypeID: func() bin.Object { return &HelpPromoData{} }, @@ -4668,6 +4756,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StoriesAllStoriesTypeID: func() bin.Object { return &StoriesAllStories{} }, StoriesStoriesTypeID: func() bin.Object { return &StoriesStories{} }, StoryViewTypeID: func() bin.Object { return &StoryView{} }, + StoryViewPublicForwardTypeID: func() bin.Object { return &StoryViewPublicForward{} }, + StoryViewPublicRepostTypeID: func() bin.Object { return &StoryViewPublicRepost{} }, StoriesStoryViewsListTypeID: func() bin.Object { return &StoriesStoryViewsList{} }, StoriesStoryViewsTypeID: func() bin.Object { return &StoriesStoryViews{} }, InputReplyToMessageTypeID: func() bin.Object { return &InputReplyToMessage{} }, @@ -4679,6 +4769,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InputMediaAreaVenueTypeID: func() bin.Object { return &InputMediaAreaVenue{} }, MediaAreaGeoPointTypeID: func() bin.Object { return &MediaAreaGeoPoint{} }, MediaAreaSuggestedReactionTypeID: func() bin.Object { return &MediaAreaSuggestedReaction{} }, + MediaAreaChannelPostTypeID: func() bin.Object { return &MediaAreaChannelPost{} }, + InputMediaAreaChannelPostTypeID: func() bin.Object { return &InputMediaAreaChannelPost{} }, PeerStoriesTypeID: func() bin.Object { return &PeerStories{} }, StoriesPeerStoriesTypeID: func() bin.Object { return &StoriesPeerStories{} }, MessagesWebPageTypeID: func() bin.Object { return &MessagesWebPage{} }, @@ -4692,6 +4784,23 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MyBoostTypeID: func() bin.Object { return &MyBoost{} }, PremiumMyBoostsTypeID: func() bin.Object { return &PremiumMyBoosts{} }, PremiumBoostsStatusTypeID: func() bin.Object { return &PremiumBoostsStatus{} }, + StoryFwdHeaderTypeID: func() bin.Object { return &StoryFwdHeader{} }, + PostInteractionCountersMessageTypeID: func() bin.Object { return &PostInteractionCountersMessage{} }, + PostInteractionCountersStoryTypeID: func() bin.Object { return &PostInteractionCountersStory{} }, + StatsStoryStatsTypeID: func() bin.Object { return &StatsStoryStats{} }, + PublicForwardMessageTypeID: func() bin.Object { return &PublicForwardMessage{} }, + PublicForwardStoryTypeID: func() bin.Object { return &PublicForwardStory{} }, + StatsPublicForwardsTypeID: func() bin.Object { return &StatsPublicForwards{} }, + PeerColorTypeID: func() bin.Object { return &PeerColor{} }, + HelpPeerColorSetTypeID: func() bin.Object { return &HelpPeerColorSet{} }, + HelpPeerColorProfileSetTypeID: func() bin.Object { return &HelpPeerColorProfileSet{} }, + HelpPeerColorOptionTypeID: func() bin.Object { return &HelpPeerColorOption{} }, + HelpPeerColorsNotModifiedTypeID: func() bin.Object { return &HelpPeerColorsNotModified{} }, + HelpPeerColorsTypeID: func() bin.Object { return &HelpPeerColors{} }, + StoryReactionTypeID: func() bin.Object { return &StoryReaction{} }, + StoryReactionPublicForwardTypeID: func() bin.Object { return &StoryReactionPublicForward{} }, + StoryReactionPublicRepostTypeID: func() bin.Object { return &StoryReactionPublicRepost{} }, + StoriesStoryReactionsListTypeID: func() bin.Object { return &StoriesStoryReactionsList{} }, InvokeAfterMsgRequestTypeID: func() bin.Object { return &InvokeAfterMsgRequest{} }, InvokeAfterMsgsRequestTypeID: func() bin.Object { return &InvokeAfterMsgsRequest{} }, InitConnectionRequestTypeID: func() bin.Object { return &InitConnectionRequest{} }, @@ -4811,6 +4920,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { AccountInvalidateSignInCodesRequestTypeID: func() bin.Object { return &AccountInvalidateSignInCodesRequest{} }, AccountUpdateColorRequestTypeID: func() bin.Object { return &AccountUpdateColorRequest{} }, AccountGetDefaultBackgroundEmojisRequestTypeID: func() bin.Object { return &AccountGetDefaultBackgroundEmojisRequest{} }, + AccountGetChannelDefaultEmojiStatusesRequestTypeID: func() bin.Object { return &AccountGetChannelDefaultEmojiStatusesRequest{} }, + AccountGetChannelRestrictedStatusEmojisRequestTypeID: func() bin.Object { return &AccountGetChannelRestrictedStatusEmojisRequest{} }, UsersGetUsersRequestTypeID: func() bin.Object { return &UsersGetUsersRequest{} }, UsersGetFullUserRequestTypeID: func() bin.Object { return &UsersGetFullUserRequest{} }, UsersSetSecureValueErrorsRequestTypeID: func() bin.Object { return &UsersSetSecureValueErrorsRequest{} }, @@ -5026,6 +5137,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessagesGetBotAppRequestTypeID: func() bin.Object { return &MessagesGetBotAppRequest{} }, MessagesRequestAppWebViewRequestTypeID: func() bin.Object { return &MessagesRequestAppWebViewRequest{} }, MessagesSetChatWallPaperRequestTypeID: func() bin.Object { return &MessagesSetChatWallPaperRequest{} }, + MessagesSearchEmojiStickerSetsRequestTypeID: func() bin.Object { return &MessagesSearchEmojiStickerSetsRequest{} }, UpdatesGetStateRequestTypeID: func() bin.Object { return &UpdatesGetStateRequest{} }, UpdatesGetDifferenceRequestTypeID: func() bin.Object { return &UpdatesGetDifferenceRequest{} }, UpdatesGetChannelDifferenceRequestTypeID: func() bin.Object { return &UpdatesGetChannelDifferenceRequest{} }, @@ -5047,7 +5159,6 @@ func TypesConstructorMap() map[uint32]func() bin.Object { HelpGetAppUpdateRequestTypeID: func() bin.Object { return &HelpGetAppUpdateRequest{} }, HelpGetInviteTextRequestTypeID: func() bin.Object { return &HelpGetInviteTextRequest{} }, HelpGetSupportRequestTypeID: func() bin.Object { return &HelpGetSupportRequest{} }, - HelpGetAppChangelogRequestTypeID: func() bin.Object { return &HelpGetAppChangelogRequest{} }, HelpSetBotUpdatesStatusRequestTypeID: func() bin.Object { return &HelpSetBotUpdatesStatusRequest{} }, HelpGetCDNConfigRequestTypeID: func() bin.Object { return &HelpGetCDNConfigRequest{} }, HelpGetRecentMeURLsRequestTypeID: func() bin.Object { return &HelpGetRecentMeURLsRequest{} }, @@ -5065,6 +5176,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { HelpDismissSuggestionRequestTypeID: func() bin.Object { return &HelpDismissSuggestionRequest{} }, HelpGetCountriesListRequestTypeID: func() bin.Object { return &HelpGetCountriesListRequest{} }, HelpGetPremiumPromoRequestTypeID: func() bin.Object { return &HelpGetPremiumPromoRequest{} }, + HelpGetPeerColorsRequestTypeID: func() bin.Object { return &HelpGetPeerColorsRequest{} }, + HelpGetPeerProfileColorsRequestTypeID: func() bin.Object { return &HelpGetPeerProfileColorsRequest{} }, ChannelsReadHistoryRequestTypeID: func() bin.Object { return &ChannelsReadHistoryRequest{} }, ChannelsDeleteMessagesRequestTypeID: func() bin.Object { return &ChannelsDeleteMessagesRequest{} }, ChannelsReportSpamRequestTypeID: func() bin.Object { return &ChannelsReportSpamRequest{} }, @@ -5122,6 +5235,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChannelsToggleParticipantsHiddenRequestTypeID: func() bin.Object { return &ChannelsToggleParticipantsHiddenRequest{} }, ChannelsClickSponsoredMessageRequestTypeID: func() bin.Object { return &ChannelsClickSponsoredMessageRequest{} }, ChannelsUpdateColorRequestTypeID: func() bin.Object { return &ChannelsUpdateColorRequest{} }, + ChannelsToggleViewForumAsMessagesRequestTypeID: func() bin.Object { return &ChannelsToggleViewForumAsMessagesRequest{} }, + ChannelsGetChannelRecommendationsRequestTypeID: func() bin.Object { return &ChannelsGetChannelRecommendationsRequest{} }, + ChannelsUpdateEmojiStatusRequestTypeID: func() bin.Object { return &ChannelsUpdateEmojiStatusRequest{} }, BotsSendCustomRequestRequestTypeID: func() bin.Object { return &BotsSendCustomRequestRequest{} }, BotsAnswerWebhookJSONQueryRequestTypeID: func() bin.Object { return &BotsAnswerWebhookJSONQueryRequest{} }, BotsSetBotCommandsRequestTypeID: func() bin.Object { return &BotsSetBotCommandsRequest{} }, @@ -5206,6 +5322,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StatsGetMegagroupStatsRequestTypeID: func() bin.Object { return &StatsGetMegagroupStatsRequest{} }, StatsGetMessagePublicForwardsRequestTypeID: func() bin.Object { return &StatsGetMessagePublicForwardsRequest{} }, StatsGetMessageStatsRequestTypeID: func() bin.Object { return &StatsGetMessageStatsRequest{} }, + StatsGetStoryStatsRequestTypeID: func() bin.Object { return &StatsGetStoryStatsRequest{} }, + StatsGetStoryPublicForwardsRequestTypeID: func() bin.Object { return &StatsGetStoryPublicForwardsRequest{} }, ChatlistsExportChatlistInviteRequestTypeID: func() bin.Object { return &ChatlistsExportChatlistInviteRequest{} }, ChatlistsDeleteExportedInviteRequestTypeID: func() bin.Object { return &ChatlistsDeleteExportedInviteRequest{} }, ChatlistsEditExportedInviteRequestTypeID: func() bin.Object { return &ChatlistsEditExportedInviteRequest{} }, @@ -5240,10 +5358,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StoriesGetPeerMaxIDsRequestTypeID: func() bin.Object { return &StoriesGetPeerMaxIDsRequest{} }, StoriesGetChatsToSendRequestTypeID: func() bin.Object { return &StoriesGetChatsToSendRequest{} }, StoriesTogglePeerStoriesHiddenRequestTypeID: func() bin.Object { return &StoriesTogglePeerStoriesHiddenRequest{} }, + StoriesGetStoryReactionsListRequestTypeID: func() bin.Object { return &StoriesGetStoryReactionsListRequest{} }, PremiumGetBoostsListRequestTypeID: func() bin.Object { return &PremiumGetBoostsListRequest{} }, PremiumGetMyBoostsRequestTypeID: func() bin.Object { return &PremiumGetMyBoostsRequest{} }, PremiumApplyBoostRequestTypeID: func() bin.Object { return &PremiumApplyBoostRequest{} }, PremiumGetBoostsStatusRequestTypeID: func() bin.Object { return &PremiumGetBoostsStatusRequest{} }, + PremiumGetUserBoostsRequestTypeID: func() bin.Object { return &PremiumGetUserBoostsRequest{} }, IntTypeID: func() bin.Object { return &Int{} }, LongTypeID: func() bin.Object { return &Long{} }, DoubleTypeID: func() bin.Object { return &Double{} }, @@ -5420,8 +5540,10 @@ func ClassConstructorsMap() map[string][]uint32 { ChannelAdminLogEventActionDeleteTopicTypeID, ChannelAdminLogEventActionPinTopicTypeID, ChannelAdminLogEventActionToggleAntiSpamTypeID, - ChannelAdminLogEventActionChangeColorTypeID, - ChannelAdminLogEventActionChangeBackgroundEmojiTypeID, + ChannelAdminLogEventActionChangePeerColorTypeID, + ChannelAdminLogEventActionChangeProfilePeerColorTypeID, + ChannelAdminLogEventActionChangeWallpaperTypeID, + ChannelAdminLogEventActionChangeEmojiStatusTypeID, }, ChannelLocationClassName: { ChannelLocationEmptyTypeID, @@ -5609,6 +5731,14 @@ func ClassConstructorsMap() map[string][]uint32 { HelpPassportConfigNotModifiedTypeID, HelpPassportConfigTypeID, }, + HelpPeerColorSetClassName: { + HelpPeerColorSetTypeID, + HelpPeerColorProfileSetTypeID, + }, + HelpPeerColorsClassName: { + HelpPeerColorsNotModifiedTypeID, + HelpPeerColorsTypeID, + }, HelpPromoDataClassName: { HelpPromoDataEmptyTypeID, HelpPromoDataTypeID, @@ -5809,6 +5939,7 @@ func ClassConstructorsMap() map[string][]uint32 { InputStickerSetEmojiGenericAnimationsTypeID, InputStickerSetEmojiDefaultStatusesTypeID, InputStickerSetEmojiDefaultTopicIconsTypeID, + InputStickerSetEmojiChannelDefaultStatusesTypeID, }, InputStickeredMediaClassName: { InputStickeredMediaPhotoTypeID, @@ -5876,6 +6007,8 @@ func ClassConstructorsMap() map[string][]uint32 { InputMediaAreaVenueTypeID, MediaAreaGeoPointTypeID, MediaAreaSuggestedReactionTypeID, + MediaAreaChannelPostTypeID, + InputMediaAreaChannelPostTypeID, }, MessageActionClassName: { MessageActionEmptyTypeID, @@ -5916,9 +6049,9 @@ func ClassConstructorsMap() map[string][]uint32 { MessageActionSuggestProfilePhotoTypeID, MessageActionRequestedPeerTypeID, MessageActionSetChatWallPaperTypeID, - MessageActionSetSameChatWallPaperTypeID, MessageActionGiftCodeTypeID, MessageActionGiveawayLaunchTypeID, + MessageActionGiveawayResultsTypeID, }, MessageClassName: { MessageEmptyTypeID, @@ -5968,6 +6101,7 @@ func ClassConstructorsMap() map[string][]uint32 { MessageMediaDiceTypeID, MessageMediaStoryTypeID, MessageMediaGiveawayTypeID, + MessageMediaGiveawayResultsTypeID, }, MessagePeerVoteClassName: { MessagePeerVoteTypeID, @@ -6183,6 +6317,10 @@ func ClassConstructorsMap() map[string][]uint32 { PhotosPhotosTypeID, PhotosPhotosSliceTypeID, }, + PostInteractionCountersClassName: { + PostInteractionCountersMessageTypeID, + PostInteractionCountersStoryTypeID, + }, PrivacyKeyClassName: { PrivacyKeyStatusTimestampTypeID, PrivacyKeyChatInviteTypeID, @@ -6206,6 +6344,10 @@ func ClassConstructorsMap() map[string][]uint32 { PrivacyValueDisallowChatParticipantsTypeID, PrivacyValueAllowCloseFriendsTypeID, }, + PublicForwardClassName: { + PublicForwardMessageTypeID, + PublicForwardStoryTypeID, + }, ReactionClassName: { ReactionEmptyTypeID, ReactionEmojiTypeID, @@ -6354,6 +6496,16 @@ func ClassConstructorsMap() map[string][]uint32 { StoryItemSkippedTypeID, StoryItemTypeID, }, + StoryReactionClassName: { + StoryReactionTypeID, + StoryReactionPublicForwardTypeID, + StoryReactionPublicRepostTypeID, + }, + StoryViewClassName: { + StoryViewTypeID, + StoryViewPublicForwardTypeID, + StoryViewPublicRepostTypeID, + }, TopPeerCategoryClassName: { TopPeerCategoryBotsPMTypeID, TopPeerCategoryBotsInlineTypeID, @@ -6487,6 +6639,11 @@ func ClassConstructorsMap() map[string][]uint32 { UpdateStoryIDTypeID, UpdateStoriesStealthModeTypeID, UpdateSentStoryReactionTypeID, + UpdateBotChatBoostTypeID, + UpdateChannelViewForumAsMessagesTypeID, + UpdatePeerWallpaperTypeID, + UpdateBotMessageReactionTypeID, + UpdateBotMessageReactionsTypeID, }, UpdatesChannelDifferenceClassName: { UpdatesChannelDifferenceEmptyTypeID, diff --git a/vendor/github.com/gotd/td/tg/tl_server_gen.go b/vendor/github.com/gotd/td/tg/tl_server_gen.go index 8e58181b..ac7489e7 100644 --- a/vendor/github.com/gotd/td/tg/tl_server_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_server_gen.go @@ -2157,6 +2157,40 @@ func (s *ServerDispatcher) OnAccountGetDefaultBackgroundEmojis(f func(ctx contex s.handlers[AccountGetDefaultBackgroundEmojisRequestTypeID] = handler } +func (s *ServerDispatcher) OnAccountGetChannelDefaultEmojiStatuses(f func(ctx context.Context, hash int64) (AccountEmojiStatusesClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request AccountGetChannelDefaultEmojiStatusesRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, request.Hash) + if err != nil { + return nil, err + } + return &AccountEmojiStatusesBox{EmojiStatuses: response}, nil + } + + s.handlers[AccountGetChannelDefaultEmojiStatusesRequestTypeID] = handler +} + +func (s *ServerDispatcher) OnAccountGetChannelRestrictedStatusEmojis(f func(ctx context.Context, hash int64) (EmojiListClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request AccountGetChannelRestrictedStatusEmojisRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, request.Hash) + if err != nil { + return nil, err + } + return &EmojiListBox{EmojiList: response}, nil + } + + s.handlers[AccountGetChannelRestrictedStatusEmojisRequestTypeID] = handler +} + func (s *ServerDispatcher) OnUsersGetUsers(f func(ctx context.Context, id []InputUserClass) ([]UserClass, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request UsersGetUsersRequest @@ -6028,6 +6062,23 @@ func (s *ServerDispatcher) OnMessagesSetChatWallPaper(f func(ctx context.Context s.handlers[MessagesSetChatWallPaperRequestTypeID] = handler } +func (s *ServerDispatcher) OnMessagesSearchEmojiStickerSets(f func(ctx context.Context, request *MessagesSearchEmojiStickerSetsRequest) (MessagesFoundStickerSetsClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request MessagesSearchEmojiStickerSetsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return &MessagesFoundStickerSetsBox{FoundStickerSets: response}, nil + } + + s.handlers[MessagesSearchEmojiStickerSetsRequestTypeID] = handler +} + func (s *ServerDispatcher) OnUpdatesGetState(f func(ctx context.Context) (*UpdatesState, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request UpdatesGetStateRequest @@ -6393,23 +6444,6 @@ func (s *ServerDispatcher) OnHelpGetSupport(f func(ctx context.Context) (*HelpSu s.handlers[HelpGetSupportRequestTypeID] = handler } -func (s *ServerDispatcher) OnHelpGetAppChangelog(f func(ctx context.Context, prevappversion string) (UpdatesClass, error)) { - handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { - var request HelpGetAppChangelogRequest - if err := request.Decode(b); err != nil { - return nil, err - } - - response, err := f(ctx, request.PrevAppVersion) - if err != nil { - return nil, err - } - return &UpdatesBox{Updates: response}, nil - } - - s.handlers[HelpGetAppChangelogRequestTypeID] = handler -} - func (s *ServerDispatcher) OnHelpSetBotUpdatesStatus(f func(ctx context.Context, request *HelpSetBotUpdatesStatusRequest) (bool, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request HelpSetBotUpdatesStatusRequest @@ -6719,6 +6753,40 @@ func (s *ServerDispatcher) OnHelpGetPremiumPromo(f func(ctx context.Context) (*H s.handlers[HelpGetPremiumPromoRequestTypeID] = handler } +func (s *ServerDispatcher) OnHelpGetPeerColors(f func(ctx context.Context, hash int) (HelpPeerColorsClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request HelpGetPeerColorsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, request.Hash) + if err != nil { + return nil, err + } + return &HelpPeerColorsBox{PeerColors: response}, nil + } + + s.handlers[HelpGetPeerColorsRequestTypeID] = handler +} + +func (s *ServerDispatcher) OnHelpGetPeerProfileColors(f func(ctx context.Context, hash int) (HelpPeerColorsClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request HelpGetPeerProfileColorsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, request.Hash) + if err != nil { + return nil, err + } + return &HelpPeerColorsBox{PeerColors: response}, nil + } + + s.handlers[HelpGetPeerProfileColorsRequestTypeID] = handler +} + func (s *ServerDispatcher) OnChannelsReadHistory(f func(ctx context.Context, request *ChannelsReadHistoryRequest) (bool, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request ChannelsReadHistoryRequest @@ -7744,6 +7812,57 @@ func (s *ServerDispatcher) OnChannelsUpdateColor(f func(ctx context.Context, req s.handlers[ChannelsUpdateColorRequestTypeID] = handler } +func (s *ServerDispatcher) OnChannelsToggleViewForumAsMessages(f func(ctx context.Context, request *ChannelsToggleViewForumAsMessagesRequest) (UpdatesClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request ChannelsToggleViewForumAsMessagesRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return &UpdatesBox{Updates: response}, nil + } + + s.handlers[ChannelsToggleViewForumAsMessagesRequestTypeID] = handler +} + +func (s *ServerDispatcher) OnChannelsGetChannelRecommendations(f func(ctx context.Context, channel InputChannelClass) (MessagesChatsClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request ChannelsGetChannelRecommendationsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, request.Channel) + if err != nil { + return nil, err + } + return &MessagesChatsBox{Chats: response}, nil + } + + s.handlers[ChannelsGetChannelRecommendationsRequestTypeID] = handler +} + +func (s *ServerDispatcher) OnChannelsUpdateEmojiStatus(f func(ctx context.Context, request *ChannelsUpdateEmojiStatusRequest) (UpdatesClass, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request ChannelsUpdateEmojiStatusRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return &UpdatesBox{Updates: response}, nil + } + + s.handlers[ChannelsUpdateEmojiStatusRequestTypeID] = handler +} + func (s *ServerDispatcher) OnBotsSendCustomRequest(f func(ctx context.Context, request *BotsSendCustomRequestRequest) (*DataJSON, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request BotsSendCustomRequestRequest @@ -9214,7 +9333,7 @@ func (s *ServerDispatcher) OnStatsGetMegagroupStats(f func(ctx context.Context, s.handlers[StatsGetMegagroupStatsRequestTypeID] = handler } -func (s *ServerDispatcher) OnStatsGetMessagePublicForwards(f func(ctx context.Context, request *StatsGetMessagePublicForwardsRequest) (MessagesMessagesClass, error)) { +func (s *ServerDispatcher) OnStatsGetMessagePublicForwards(f func(ctx context.Context, request *StatsGetMessagePublicForwardsRequest) (*StatsPublicForwards, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request StatsGetMessagePublicForwardsRequest if err := request.Decode(b); err != nil { @@ -9225,7 +9344,7 @@ func (s *ServerDispatcher) OnStatsGetMessagePublicForwards(f func(ctx context.Co if err != nil { return nil, err } - return &MessagesMessagesBox{Messages: response}, nil + return response, nil } s.handlers[StatsGetMessagePublicForwardsRequestTypeID] = handler @@ -9248,6 +9367,40 @@ func (s *ServerDispatcher) OnStatsGetMessageStats(f func(ctx context.Context, re s.handlers[StatsGetMessageStatsRequestTypeID] = handler } +func (s *ServerDispatcher) OnStatsGetStoryStats(f func(ctx context.Context, request *StatsGetStoryStatsRequest) (*StatsStoryStats, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request StatsGetStoryStatsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return response, nil + } + + s.handlers[StatsGetStoryStatsRequestTypeID] = handler +} + +func (s *ServerDispatcher) OnStatsGetStoryPublicForwards(f func(ctx context.Context, request *StatsGetStoryPublicForwardsRequest) (*StatsPublicForwards, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request StatsGetStoryPublicForwardsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return response, nil + } + + s.handlers[StatsGetStoryPublicForwardsRequestTypeID] = handler +} + func (s *ServerDispatcher) OnChatlistsExportChatlistInvite(f func(ctx context.Context, request *ChatlistsExportChatlistInviteRequest) (*ChatlistsExportedChatlistInvite, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request ChatlistsExportChatlistInviteRequest @@ -9854,6 +10007,23 @@ func (s *ServerDispatcher) OnStoriesTogglePeerStoriesHidden(f func(ctx context.C s.handlers[StoriesTogglePeerStoriesHiddenRequestTypeID] = handler } +func (s *ServerDispatcher) OnStoriesGetStoryReactionsList(f func(ctx context.Context, request *StoriesGetStoryReactionsListRequest) (*StoriesStoryReactionsList, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request StoriesGetStoryReactionsListRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return response, nil + } + + s.handlers[StoriesGetStoryReactionsListRequestTypeID] = handler +} + func (s *ServerDispatcher) OnPremiumGetBoostsList(f func(ctx context.Context, request *PremiumGetBoostsListRequest) (*PremiumBoostsList, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request PremiumGetBoostsListRequest @@ -9922,6 +10092,23 @@ func (s *ServerDispatcher) OnPremiumGetBoostsStatus(f func(ctx context.Context, s.handlers[PremiumGetBoostsStatusRequestTypeID] = handler } +func (s *ServerDispatcher) OnPremiumGetUserBoosts(f func(ctx context.Context, request *PremiumGetUserBoostsRequest) (*PremiumBoostsList, error)) { + handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { + var request PremiumGetUserBoostsRequest + if err := request.Decode(b); err != nil { + return nil, err + } + + response, err := f(ctx, &request) + if err != nil { + return nil, err + } + return response, nil + } + + s.handlers[PremiumGetUserBoostsRequestTypeID] = handler +} + func (s *ServerDispatcher) OnTestUseError(f func(ctx context.Context) (*Error, error)) { handler := func(ctx context.Context, b *bin.Buffer) (bin.Encoder, error) { var request TestUseErrorRequest diff --git a/vendor/github.com/gotd/td/tg/tl_sponsored_message_gen.go b/vendor/github.com/gotd/td/tg/tl_sponsored_message_gen.go index 8e725e8a..8442cd46 100644 --- a/vendor/github.com/gotd/td/tg/tl_sponsored_message_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_sponsored_message_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// SponsoredMessage represents TL type `sponsoredMessage#daafff6b`. +// SponsoredMessage represents TL type `sponsoredMessage#ed5383f7`. // A sponsored message¹. // // Links: @@ -72,10 +72,17 @@ type SponsoredMessage struct { // // Use SetStartParam and GetStartParam helpers. StartParam string - // Webpage field of SponsoredMessage. + // Sponsored website // // Use SetWebpage and GetWebpage helpers. Webpage SponsoredWebPage + // Mini App »¹ to open when the sponsored message is clicked. + // + // Links: + // 1) https://core.telegram.org/api/bots/webapps + // + // Use SetApp and GetApp helpers. + App BotAppClass // Sponsored message Message string // Message entities for styled text¹ @@ -85,6 +92,10 @@ type SponsoredMessage struct { // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass + // Text of the sponsored message button. + // + // Use SetButtonText and GetButtonText helpers. + ButtonText string // If set, contains additional information about the sponsor to be shown along with the // message. // @@ -98,7 +109,7 @@ type SponsoredMessage struct { } // SponsoredMessageTypeID is TL type id of SponsoredMessage. -const SponsoredMessageTypeID = 0xdaafff6b +const SponsoredMessageTypeID = 0xed5383f7 // Ensuring interfaces in compile-time for SponsoredMessage. var ( @@ -142,12 +153,18 @@ func (s *SponsoredMessage) Zero() bool { if !(s.Webpage.Zero()) { return false } + if !(s.App == nil) { + return false + } if !(s.Message == "") { return false } if !(s.Entities == nil) { return false } + if !(s.ButtonText == "") { + return false + } if !(s.SponsorInfo == "") { return false } @@ -178,8 +195,10 @@ func (s *SponsoredMessage) FillFrom(from interface { GetChannelPost() (value int, ok bool) GetStartParam() (value string, ok bool) GetWebpage() (value SponsoredWebPage, ok bool) + GetApp() (value BotAppClass, ok bool) GetMessage() (value string) GetEntities() (value []MessageEntityClass, ok bool) + GetButtonText() (value string, ok bool) GetSponsorInfo() (value string, ok bool) GetAdditionalInfo() (value string, ok bool) }) { @@ -210,11 +229,19 @@ func (s *SponsoredMessage) FillFrom(from interface { s.Webpage = val } + if val, ok := from.GetApp(); ok { + s.App = val + } + s.Message = from.GetMessage() if val, ok := from.GetEntities(); ok { s.Entities = val } + if val, ok := from.GetButtonText(); ok { + s.ButtonText = val + } + if val, ok := from.GetSponsorInfo(); ok { s.SponsorInfo = val } @@ -292,6 +319,11 @@ func (s *SponsoredMessage) TypeInfo() tdp.Type { SchemaName: "webpage", Null: !s.Flags.Has(9), }, + { + Name: "App", + SchemaName: "app", + Null: !s.Flags.Has(10), + }, { Name: "Message", SchemaName: "message", @@ -301,6 +333,11 @@ func (s *SponsoredMessage) TypeInfo() tdp.Type { SchemaName: "entities", Null: !s.Flags.Has(1), }, + { + Name: "ButtonText", + SchemaName: "button_text", + Null: !s.Flags.Has(11), + }, { Name: "SponsorInfo", SchemaName: "sponsor_info", @@ -341,9 +378,15 @@ func (s *SponsoredMessage) SetFlags() { if !(s.Webpage.Zero()) { s.Flags.Set(9) } + if !(s.App == nil) { + s.Flags.Set(10) + } if !(s.Entities == nil) { s.Flags.Set(1) } + if !(s.ButtonText == "") { + s.Flags.Set(11) + } if !(s.SponsorInfo == "") { s.Flags.Set(7) } @@ -355,7 +398,7 @@ func (s *SponsoredMessage) SetFlags() { // Encode implements bin.Encoder. func (s *SponsoredMessage) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sponsoredMessage#daafff6b as nil") + return fmt.Errorf("can't encode sponsoredMessage#ed5383f7 as nil") } b.PutID(SponsoredMessageTypeID) return s.EncodeBare(b) @@ -364,27 +407,27 @@ func (s *SponsoredMessage) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *SponsoredMessage) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sponsoredMessage#daafff6b as nil") + return fmt.Errorf("can't encode sponsoredMessage#ed5383f7 as nil") } s.SetFlags() if err := s.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field flags: %w", err) + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field flags: %w", err) } b.PutBytes(s.RandomID) if s.Flags.Has(3) { if s.FromID == nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field from_id is nil") + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field from_id is nil") } if err := s.FromID.Encode(b); err != nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field from_id: %w", err) + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field from_id: %w", err) } } if s.Flags.Has(4) { if s.ChatInvite == nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field chat_invite is nil") + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field chat_invite is nil") } if err := s.ChatInvite.Encode(b); err != nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field chat_invite: %w", err) + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field chat_invite: %w", err) } } if s.Flags.Has(4) { @@ -398,7 +441,15 @@ func (s *SponsoredMessage) EncodeBare(b *bin.Buffer) error { } if s.Flags.Has(9) { if err := s.Webpage.Encode(b); err != nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field webpage: %w", err) + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field webpage: %w", err) + } + } + if s.Flags.Has(10) { + if s.App == nil { + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field app is nil") + } + if err := s.App.Encode(b); err != nil { + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field app: %w", err) } } b.PutString(s.Message) @@ -406,13 +457,16 @@ func (s *SponsoredMessage) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(s.Entities)) for idx, v := range s.Entities { if v == nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode sponsoredMessage#daafff6b: field entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode sponsoredMessage#ed5383f7: field entities element with index %d: %w", idx, err) } } } + if s.Flags.Has(11) { + b.PutString(s.ButtonText) + } if s.Flags.Has(7) { b.PutString(s.SponsorInfo) } @@ -425,10 +479,10 @@ func (s *SponsoredMessage) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *SponsoredMessage) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sponsoredMessage#daafff6b to nil") + return fmt.Errorf("can't decode sponsoredMessage#ed5383f7 to nil") } if err := b.ConsumeID(SponsoredMessageTypeID); err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: %w", err) } return s.DecodeBare(b) } @@ -436,11 +490,11 @@ func (s *SponsoredMessage) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *SponsoredMessage) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sponsoredMessage#daafff6b to nil") + return fmt.Errorf("can't decode sponsoredMessage#ed5383f7 to nil") } { if err := s.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field flags: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field flags: %w", err) } } s.Recommended = s.Flags.Has(5) @@ -448,61 +502,68 @@ func (s *SponsoredMessage) DecodeBare(b *bin.Buffer) error { { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field random_id: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field random_id: %w", err) } s.RandomID = value } if s.Flags.Has(3) { value, err := DecodePeer(b) if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field from_id: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field from_id: %w", err) } s.FromID = value } if s.Flags.Has(4) { value, err := DecodeChatInvite(b) if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field chat_invite: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field chat_invite: %w", err) } s.ChatInvite = value } if s.Flags.Has(4) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field chat_invite_hash: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field chat_invite_hash: %w", err) } s.ChatInviteHash = value } if s.Flags.Has(2) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field channel_post: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field channel_post: %w", err) } s.ChannelPost = value } if s.Flags.Has(0) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field start_param: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field start_param: %w", err) } s.StartParam = value } if s.Flags.Has(9) { if err := s.Webpage.Decode(b); err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field webpage: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field webpage: %w", err) } } + if s.Flags.Has(10) { + value, err := DecodeBotApp(b) + if err != nil { + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field app: %w", err) + } + s.App = value + } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field message: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field message: %w", err) } s.Message = value } if s.Flags.Has(1) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field entities: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field entities: %w", err) } if headerLen > 0 { @@ -511,22 +572,29 @@ func (s *SponsoredMessage) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field entities: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field entities: %w", err) } s.Entities = append(s.Entities, value) } } + if s.Flags.Has(11) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field button_text: %w", err) + } + s.ButtonText = value + } if s.Flags.Has(7) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field sponsor_info: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field sponsor_info: %w", err) } s.SponsorInfo = value } if s.Flags.Has(8) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sponsoredMessage#daafff6b: field additional_info: %w", err) + return fmt.Errorf("unable to decode sponsoredMessage#ed5383f7: field additional_info: %w", err) } s.AdditionalInfo = value } @@ -687,6 +755,24 @@ func (s *SponsoredMessage) GetWebpage() (value SponsoredWebPage, ok bool) { return s.Webpage, true } +// SetApp sets value of App conditional field. +func (s *SponsoredMessage) SetApp(value BotAppClass) { + s.Flags.Set(10) + s.App = value +} + +// GetApp returns value of App conditional field and +// boolean which is true if field was set. +func (s *SponsoredMessage) GetApp() (value BotAppClass, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(10) { + return value, false + } + return s.App, true +} + // GetMessage returns value of Message field. func (s *SponsoredMessage) GetMessage() (value string) { if s == nil { @@ -713,6 +799,24 @@ func (s *SponsoredMessage) GetEntities() (value []MessageEntityClass, ok bool) { return s.Entities, true } +// SetButtonText sets value of ButtonText conditional field. +func (s *SponsoredMessage) SetButtonText(value string) { + s.Flags.Set(11) + s.ButtonText = value +} + +// GetButtonText returns value of ButtonText conditional field and +// boolean which is true if field was set. +func (s *SponsoredMessage) GetButtonText() (value string, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(11) { + return value, false + } + return s.ButtonText, true +} + // SetSponsorInfo sets value of SponsorInfo conditional field. func (s *SponsoredMessage) SetSponsorInfo(value string) { s.Flags.Set(7) @@ -749,6 +853,15 @@ func (s *SponsoredMessage) GetAdditionalInfo() (value string, ok bool) { return s.AdditionalInfo, true } +// GetAppAsModified returns mapped value of App conditional field and +// boolean which is true if field was set. +func (s *SponsoredMessage) GetAppAsModified() (*BotApp, bool) { + if value, ok := s.GetApp(); ok { + return value.AsModified() + } + return nil, false +} + // MapEntities returns field Entities wrapped in MessageEntityClassArray helper. func (s *SponsoredMessage) MapEntities() (value MessageEntityClassArray, ok bool) { if !s.Flags.Has(1) { diff --git a/vendor/github.com/gotd/td/tg/tl_sponsored_web_page_gen.go b/vendor/github.com/gotd/td/tg/tl_sponsored_web_page_gen.go index 89a8dbe1..5ac9fe37 100644 --- a/vendor/github.com/gotd/td/tg/tl_sponsored_web_page_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_sponsored_web_page_gen.go @@ -32,16 +32,20 @@ var ( ) // SponsoredWebPage represents TL type `sponsoredWebPage#3db8ec63`. +// Represents a sponsored website. // // See https://core.telegram.org/constructor/sponsoredWebPage for reference. type SponsoredWebPage struct { - // Flags field of SponsoredWebPage. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // URL field of SponsoredWebPage. + // Web page URL. URL string - // SiteName field of SponsoredWebPage. + // Website name. SiteName string - // Photo field of SponsoredWebPage. + // Optional image preview. // // Use SetPhoto and GetPhoto helpers. Photo PhotoClass diff --git a/vendor/github.com/gotd/td/tg/tl_stats_broadcast_stats_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_broadcast_stats_gen.go index 90d060b5..2493a273 100644 --- a/vendor/github.com/gotd/td/tg/tl_stats_broadcast_stats_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stats_broadcast_stats_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// StatsBroadcastStats represents TL type `stats.broadcastStats#bdf78394`. +// StatsBroadcastStats represents TL type `stats.broadcastStats#396ca5fc`. // Channel statistics¹. // // Links: @@ -43,16 +43,36 @@ type StatsBroadcastStats struct { Period StatsDateRangeDays // Follower count change for period in consideration Followers StatsAbsValueAndPrev - // total_viewcount/postcount, for posts posted during the period in consideration - // (views_per_post). Note that in this case, current refers to the period in - // consideration (min_date till max_date), and prev refers to the previous period - // ((min_date - (max_date - min_date)) till min_date). + // total_viewcount/postcount, for posts posted during the period in consideration. Note + // that in this case, current refers to the period in consideration (min_date till + // max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) + // till min_date). ViewsPerPost StatsAbsValueAndPrev - // total_viewcount/postcount, for posts posted during the period in consideration - // (views_per_post). Note that in this case, current refers to the period in - // consideration (min_date till max_date), and prev refers to the previous period - // ((min_date - (max_date - min_date)) till min_date) + // total_sharecount/postcount, for posts posted during the period in consideration. Note + // that in this case, current refers to the period in consideration (min_date till + // max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) + // till min_date) SharesPerPost StatsAbsValueAndPrev + // total_reactions/postcount, for posts posted during the period in consideration. Note + // that in this case, current refers to the period in consideration (min_date till + // max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) + // till min_date) + ReactionsPerPost StatsAbsValueAndPrev + // total_views/storycount, for posts posted during the period in consideration. Note that + // in this case, current refers to the period in consideration (min_date till max_date), + // and prev refers to the previous period ((min_date - (max_date - min_date)) till + // min_date) + ViewsPerStory StatsAbsValueAndPrev + // total_shares/storycount, for posts posted during the period in consideration. Note + // that in this case, current refers to the period in consideration (min_date till + // max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) + // till min_date) + SharesPerStory StatsAbsValueAndPrev + // total_reactions/storycount, for posts posted during the period in consideration. Note + // that in this case, current refers to the period in consideration (min_date till + // max_date), and prev refers to the previous period ((min_date - (max_date - min_date)) + // till min_date) + ReactionsPerStory StatsAbsValueAndPrev // Percentage of subscribers with enabled notifications EnabledNotifications StatsPercentValue // Channel growth graph (absolute subscriber count) @@ -73,12 +93,19 @@ type StatsBroadcastStats struct { NewFollowersBySourceGraph StatsGraphClass // Subscriber language graph (pie chart) LanguagesGraph StatsGraphClass - // Recent message interactions - RecentMessageInteractions []MessageInteractionCounters + // A graph containing the number of reactions on posts categorized by emotion + ReactionsByEmotionGraph StatsGraphClass + // A graph containing the number of story views and shares + StoryInteractionsGraph StatsGraphClass + // A graph containing the number of reactions on stories categorized by emotion + StoryReactionsByEmotionGraph StatsGraphClass + // Detailed statistics about number of views and shares of recently sent messages and + // stories + RecentPostsInteractions []PostInteractionCountersClass } // StatsBroadcastStatsTypeID is TL type id of StatsBroadcastStats. -const StatsBroadcastStatsTypeID = 0xbdf78394 +const StatsBroadcastStatsTypeID = 0x396ca5fc // Ensuring interfaces in compile-time for StatsBroadcastStats. var ( @@ -104,6 +131,18 @@ func (b *StatsBroadcastStats) Zero() bool { if !(b.SharesPerPost.Zero()) { return false } + if !(b.ReactionsPerPost.Zero()) { + return false + } + if !(b.ViewsPerStory.Zero()) { + return false + } + if !(b.SharesPerStory.Zero()) { + return false + } + if !(b.ReactionsPerStory.Zero()) { + return false + } if !(b.EnabledNotifications.Zero()) { return false } @@ -134,7 +173,16 @@ func (b *StatsBroadcastStats) Zero() bool { if !(b.LanguagesGraph == nil) { return false } - if !(b.RecentMessageInteractions == nil) { + if !(b.ReactionsByEmotionGraph == nil) { + return false + } + if !(b.StoryInteractionsGraph == nil) { + return false + } + if !(b.StoryReactionsByEmotionGraph == nil) { + return false + } + if !(b.RecentPostsInteractions == nil) { return false } @@ -156,6 +204,10 @@ func (b *StatsBroadcastStats) FillFrom(from interface { GetFollowers() (value StatsAbsValueAndPrev) GetViewsPerPost() (value StatsAbsValueAndPrev) GetSharesPerPost() (value StatsAbsValueAndPrev) + GetReactionsPerPost() (value StatsAbsValueAndPrev) + GetViewsPerStory() (value StatsAbsValueAndPrev) + GetSharesPerStory() (value StatsAbsValueAndPrev) + GetReactionsPerStory() (value StatsAbsValueAndPrev) GetEnabledNotifications() (value StatsPercentValue) GetGrowthGraph() (value StatsGraphClass) GetFollowersGraph() (value StatsGraphClass) @@ -166,12 +218,19 @@ func (b *StatsBroadcastStats) FillFrom(from interface { GetViewsBySourceGraph() (value StatsGraphClass) GetNewFollowersBySourceGraph() (value StatsGraphClass) GetLanguagesGraph() (value StatsGraphClass) - GetRecentMessageInteractions() (value []MessageInteractionCounters) + GetReactionsByEmotionGraph() (value StatsGraphClass) + GetStoryInteractionsGraph() (value StatsGraphClass) + GetStoryReactionsByEmotionGraph() (value StatsGraphClass) + GetRecentPostsInteractions() (value []PostInteractionCountersClass) }) { b.Period = from.GetPeriod() b.Followers = from.GetFollowers() b.ViewsPerPost = from.GetViewsPerPost() b.SharesPerPost = from.GetSharesPerPost() + b.ReactionsPerPost = from.GetReactionsPerPost() + b.ViewsPerStory = from.GetViewsPerStory() + b.SharesPerStory = from.GetSharesPerStory() + b.ReactionsPerStory = from.GetReactionsPerStory() b.EnabledNotifications = from.GetEnabledNotifications() b.GrowthGraph = from.GetGrowthGraph() b.FollowersGraph = from.GetFollowersGraph() @@ -182,7 +241,10 @@ func (b *StatsBroadcastStats) FillFrom(from interface { b.ViewsBySourceGraph = from.GetViewsBySourceGraph() b.NewFollowersBySourceGraph = from.GetNewFollowersBySourceGraph() b.LanguagesGraph = from.GetLanguagesGraph() - b.RecentMessageInteractions = from.GetRecentMessageInteractions() + b.ReactionsByEmotionGraph = from.GetReactionsByEmotionGraph() + b.StoryInteractionsGraph = from.GetStoryInteractionsGraph() + b.StoryReactionsByEmotionGraph = from.GetStoryReactionsByEmotionGraph() + b.RecentPostsInteractions = from.GetRecentPostsInteractions() } // TypeID returns type id in TL schema. @@ -224,6 +286,22 @@ func (b *StatsBroadcastStats) TypeInfo() tdp.Type { Name: "SharesPerPost", SchemaName: "shares_per_post", }, + { + Name: "ReactionsPerPost", + SchemaName: "reactions_per_post", + }, + { + Name: "ViewsPerStory", + SchemaName: "views_per_story", + }, + { + Name: "SharesPerStory", + SchemaName: "shares_per_story", + }, + { + Name: "ReactionsPerStory", + SchemaName: "reactions_per_story", + }, { Name: "EnabledNotifications", SchemaName: "enabled_notifications", @@ -265,8 +343,20 @@ func (b *StatsBroadcastStats) TypeInfo() tdp.Type { SchemaName: "languages_graph", }, { - Name: "RecentMessageInteractions", - SchemaName: "recent_message_interactions", + Name: "ReactionsByEmotionGraph", + SchemaName: "reactions_by_emotion_graph", + }, + { + Name: "StoryInteractionsGraph", + SchemaName: "story_interactions_graph", + }, + { + Name: "StoryReactionsByEmotionGraph", + SchemaName: "story_reactions_by_emotion_graph", + }, + { + Name: "RecentPostsInteractions", + SchemaName: "recent_posts_interactions", }, } return typ @@ -275,7 +365,7 @@ func (b *StatsBroadcastStats) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (b *StatsBroadcastStats) Encode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode stats.broadcastStats#bdf78394 as nil") + return fmt.Errorf("can't encode stats.broadcastStats#396ca5fc as nil") } buf.PutID(StatsBroadcastStatsTypeID) return b.EncodeBare(buf) @@ -284,81 +374,114 @@ func (b *StatsBroadcastStats) Encode(buf *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (b *StatsBroadcastStats) EncodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode stats.broadcastStats#bdf78394 as nil") + return fmt.Errorf("can't encode stats.broadcastStats#396ca5fc as nil") } if err := b.Period.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field period: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field period: %w", err) } if err := b.Followers.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field followers: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field followers: %w", err) } if err := b.ViewsPerPost.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field views_per_post: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field views_per_post: %w", err) } if err := b.SharesPerPost.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field shares_per_post: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field shares_per_post: %w", err) + } + if err := b.ReactionsPerPost.Encode(buf); err != nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field reactions_per_post: %w", err) + } + if err := b.ViewsPerStory.Encode(buf); err != nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field views_per_story: %w", err) + } + if err := b.SharesPerStory.Encode(buf); err != nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field shares_per_story: %w", err) + } + if err := b.ReactionsPerStory.Encode(buf); err != nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field reactions_per_story: %w", err) } if err := b.EnabledNotifications.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field enabled_notifications: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field enabled_notifications: %w", err) } if b.GrowthGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field growth_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field growth_graph is nil") } if err := b.GrowthGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field growth_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field growth_graph: %w", err) } if b.FollowersGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field followers_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field followers_graph is nil") } if err := b.FollowersGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field followers_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field followers_graph: %w", err) } if b.MuteGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field mute_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field mute_graph is nil") } if err := b.MuteGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field mute_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field mute_graph: %w", err) } if b.TopHoursGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field top_hours_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field top_hours_graph is nil") } if err := b.TopHoursGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field top_hours_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field top_hours_graph: %w", err) } if b.InteractionsGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field interactions_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field interactions_graph is nil") } if err := b.InteractionsGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field interactions_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field interactions_graph: %w", err) } if b.IvInteractionsGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field iv_interactions_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field iv_interactions_graph is nil") } if err := b.IvInteractionsGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field iv_interactions_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field iv_interactions_graph: %w", err) } if b.ViewsBySourceGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field views_by_source_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field views_by_source_graph is nil") } if err := b.ViewsBySourceGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field views_by_source_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field views_by_source_graph: %w", err) } if b.NewFollowersBySourceGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field new_followers_by_source_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field new_followers_by_source_graph is nil") } if err := b.NewFollowersBySourceGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field new_followers_by_source_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field new_followers_by_source_graph: %w", err) } if b.LanguagesGraph == nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field languages_graph is nil") + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field languages_graph is nil") } if err := b.LanguagesGraph.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field languages_graph: %w", err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field languages_graph: %w", err) } - buf.PutVectorHeader(len(b.RecentMessageInteractions)) - for idx, v := range b.RecentMessageInteractions { + if b.ReactionsByEmotionGraph == nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field reactions_by_emotion_graph is nil") + } + if err := b.ReactionsByEmotionGraph.Encode(buf); err != nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field reactions_by_emotion_graph: %w", err) + } + if b.StoryInteractionsGraph == nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field story_interactions_graph is nil") + } + if err := b.StoryInteractionsGraph.Encode(buf); err != nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field story_interactions_graph: %w", err) + } + if b.StoryReactionsByEmotionGraph == nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field story_reactions_by_emotion_graph is nil") + } + if err := b.StoryReactionsByEmotionGraph.Encode(buf); err != nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field story_reactions_by_emotion_graph: %w", err) + } + buf.PutVectorHeader(len(b.RecentPostsInteractions)) + for idx, v := range b.RecentPostsInteractions { + if v == nil { + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field recent_posts_interactions element with index %d is nil", idx) + } if err := v.Encode(buf); err != nil { - return fmt.Errorf("unable to encode stats.broadcastStats#bdf78394: field recent_message_interactions element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stats.broadcastStats#396ca5fc: field recent_posts_interactions element with index %d: %w", idx, err) } } return nil @@ -367,10 +490,10 @@ func (b *StatsBroadcastStats) EncodeBare(buf *bin.Buffer) error { // Decode implements bin.Decoder. func (b *StatsBroadcastStats) Decode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode stats.broadcastStats#bdf78394 to nil") + return fmt.Errorf("can't decode stats.broadcastStats#396ca5fc to nil") } if err := buf.ConsumeID(StatsBroadcastStatsTypeID); err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: %w", err) } return b.DecodeBare(buf) } @@ -378,111 +501,152 @@ func (b *StatsBroadcastStats) Decode(buf *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (b *StatsBroadcastStats) DecodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode stats.broadcastStats#bdf78394 to nil") + return fmt.Errorf("can't decode stats.broadcastStats#396ca5fc to nil") } { if err := b.Period.Decode(buf); err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field period: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field period: %w", err) } } { if err := b.Followers.Decode(buf); err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field followers: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field followers: %w", err) } } { if err := b.ViewsPerPost.Decode(buf); err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field views_per_post: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field views_per_post: %w", err) } } { if err := b.SharesPerPost.Decode(buf); err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field shares_per_post: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field shares_per_post: %w", err) + } + } + { + if err := b.ReactionsPerPost.Decode(buf); err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field reactions_per_post: %w", err) + } + } + { + if err := b.ViewsPerStory.Decode(buf); err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field views_per_story: %w", err) + } + } + { + if err := b.SharesPerStory.Decode(buf); err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field shares_per_story: %w", err) + } + } + { + if err := b.ReactionsPerStory.Decode(buf); err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field reactions_per_story: %w", err) } } { if err := b.EnabledNotifications.Decode(buf); err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field enabled_notifications: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field enabled_notifications: %w", err) } } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field growth_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field growth_graph: %w", err) } b.GrowthGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field followers_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field followers_graph: %w", err) } b.FollowersGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field mute_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field mute_graph: %w", err) } b.MuteGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field top_hours_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field top_hours_graph: %w", err) } b.TopHoursGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field interactions_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field interactions_graph: %w", err) } b.InteractionsGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field iv_interactions_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field iv_interactions_graph: %w", err) } b.IvInteractionsGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field views_by_source_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field views_by_source_graph: %w", err) } b.ViewsBySourceGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field new_followers_by_source_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field new_followers_by_source_graph: %w", err) } b.NewFollowersBySourceGraph = value } { value, err := DecodeStatsGraph(buf) if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field languages_graph: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field languages_graph: %w", err) } b.LanguagesGraph = value } + { + value, err := DecodeStatsGraph(buf) + if err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field reactions_by_emotion_graph: %w", err) + } + b.ReactionsByEmotionGraph = value + } + { + value, err := DecodeStatsGraph(buf) + if err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field story_interactions_graph: %w", err) + } + b.StoryInteractionsGraph = value + } + { + value, err := DecodeStatsGraph(buf) + if err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field story_reactions_by_emotion_graph: %w", err) + } + b.StoryReactionsByEmotionGraph = value + } { headerLen, err := buf.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field recent_message_interactions: %w", err) + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field recent_posts_interactions: %w", err) } if headerLen > 0 { - b.RecentMessageInteractions = make([]MessageInteractionCounters, 0, headerLen%bin.PreallocateLimit) + b.RecentPostsInteractions = make([]PostInteractionCountersClass, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - var value MessageInteractionCounters - if err := value.Decode(buf); err != nil { - return fmt.Errorf("unable to decode stats.broadcastStats#bdf78394: field recent_message_interactions: %w", err) + value, err := DecodePostInteractionCounters(buf) + if err != nil { + return fmt.Errorf("unable to decode stats.broadcastStats#396ca5fc: field recent_posts_interactions: %w", err) } - b.RecentMessageInteractions = append(b.RecentMessageInteractions, value) + b.RecentPostsInteractions = append(b.RecentPostsInteractions, value) } } return nil @@ -520,6 +684,38 @@ func (b *StatsBroadcastStats) GetSharesPerPost() (value StatsAbsValueAndPrev) { return b.SharesPerPost } +// GetReactionsPerPost returns value of ReactionsPerPost field. +func (b *StatsBroadcastStats) GetReactionsPerPost() (value StatsAbsValueAndPrev) { + if b == nil { + return + } + return b.ReactionsPerPost +} + +// GetViewsPerStory returns value of ViewsPerStory field. +func (b *StatsBroadcastStats) GetViewsPerStory() (value StatsAbsValueAndPrev) { + if b == nil { + return + } + return b.ViewsPerStory +} + +// GetSharesPerStory returns value of SharesPerStory field. +func (b *StatsBroadcastStats) GetSharesPerStory() (value StatsAbsValueAndPrev) { + if b == nil { + return + } + return b.SharesPerStory +} + +// GetReactionsPerStory returns value of ReactionsPerStory field. +func (b *StatsBroadcastStats) GetReactionsPerStory() (value StatsAbsValueAndPrev) { + if b == nil { + return + } + return b.ReactionsPerStory +} + // GetEnabledNotifications returns value of EnabledNotifications field. func (b *StatsBroadcastStats) GetEnabledNotifications() (value StatsPercentValue) { if b == nil { @@ -600,10 +796,39 @@ func (b *StatsBroadcastStats) GetLanguagesGraph() (value StatsGraphClass) { return b.LanguagesGraph } -// GetRecentMessageInteractions returns value of RecentMessageInteractions field. -func (b *StatsBroadcastStats) GetRecentMessageInteractions() (value []MessageInteractionCounters) { +// GetReactionsByEmotionGraph returns value of ReactionsByEmotionGraph field. +func (b *StatsBroadcastStats) GetReactionsByEmotionGraph() (value StatsGraphClass) { if b == nil { return } - return b.RecentMessageInteractions + return b.ReactionsByEmotionGraph +} + +// GetStoryInteractionsGraph returns value of StoryInteractionsGraph field. +func (b *StatsBroadcastStats) GetStoryInteractionsGraph() (value StatsGraphClass) { + if b == nil { + return + } + return b.StoryInteractionsGraph +} + +// GetStoryReactionsByEmotionGraph returns value of StoryReactionsByEmotionGraph field. +func (b *StatsBroadcastStats) GetStoryReactionsByEmotionGraph() (value StatsGraphClass) { + if b == nil { + return + } + return b.StoryReactionsByEmotionGraph +} + +// GetRecentPostsInteractions returns value of RecentPostsInteractions field. +func (b *StatsBroadcastStats) GetRecentPostsInteractions() (value []PostInteractionCountersClass) { + if b == nil { + return + } + return b.RecentPostsInteractions +} + +// MapRecentPostsInteractions returns field RecentPostsInteractions wrapped in PostInteractionCountersClassArray helper. +func (b *StatsBroadcastStats) MapRecentPostsInteractions() (value PostInteractionCountersClassArray) { + return PostInteractionCountersClassArray(b.RecentPostsInteractions) } diff --git a/vendor/github.com/gotd/td/tg/tl_stats_get_message_public_forwards_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_get_message_public_forwards_gen.go index fc36add1..e820bada 100644 --- a/vendor/github.com/gotd/td/tg/tl_stats_get_message_public_forwards_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stats_get_message_public_forwards_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// StatsGetMessagePublicForwardsRequest represents TL type `stats.getMessagePublicForwards#5630281b`. +// StatsGetMessagePublicForwardsRequest represents TL type `stats.getMessagePublicForwards#5f150144`. // Obtains a list of messages, indicating to which other public channels was a channel // message forwarded. // Will return a list of messages¹ with peer_id equal to the public channel to which @@ -46,21 +46,8 @@ type StatsGetMessagePublicForwardsRequest struct { Channel InputChannelClass // Source message ID MsgID int - // Initially 0, then set to the next_rate parameter of messages.messagesSlice¹ - // - // Links: - // 1) https://core.telegram.org/constructor/messages.messagesSlice - OffsetRate int - // Offsets for pagination, for more info click here¹ - // - // Links: - // 1) https://core.telegram.org/api/offsets - OffsetPeer InputPeerClass - // Offsets for pagination, for more info click here¹ - // - // Links: - // 1) https://core.telegram.org/api/offsets - OffsetID int + // Offset field of StatsGetMessagePublicForwardsRequest. + Offset string // Maximum number of results to return, see pagination¹ // // Links: @@ -69,7 +56,7 @@ type StatsGetMessagePublicForwardsRequest struct { } // StatsGetMessagePublicForwardsRequestTypeID is TL type id of StatsGetMessagePublicForwardsRequest. -const StatsGetMessagePublicForwardsRequestTypeID = 0x5630281b +const StatsGetMessagePublicForwardsRequestTypeID = 0x5f150144 // Ensuring interfaces in compile-time for StatsGetMessagePublicForwardsRequest. var ( @@ -89,13 +76,7 @@ func (g *StatsGetMessagePublicForwardsRequest) Zero() bool { if !(g.MsgID == 0) { return false } - if !(g.OffsetRate == 0) { - return false - } - if !(g.OffsetPeer == nil) { - return false - } - if !(g.OffsetID == 0) { + if !(g.Offset == "") { return false } if !(g.Limit == 0) { @@ -118,16 +99,12 @@ func (g *StatsGetMessagePublicForwardsRequest) String() string { func (g *StatsGetMessagePublicForwardsRequest) FillFrom(from interface { GetChannel() (value InputChannelClass) GetMsgID() (value int) - GetOffsetRate() (value int) - GetOffsetPeer() (value InputPeerClass) - GetOffsetID() (value int) + GetOffset() (value string) GetLimit() (value int) }) { g.Channel = from.GetChannel() g.MsgID = from.GetMsgID() - g.OffsetRate = from.GetOffsetRate() - g.OffsetPeer = from.GetOffsetPeer() - g.OffsetID = from.GetOffsetID() + g.Offset = from.GetOffset() g.Limit = from.GetLimit() } @@ -163,16 +140,8 @@ func (g *StatsGetMessagePublicForwardsRequest) TypeInfo() tdp.Type { SchemaName: "msg_id", }, { - Name: "OffsetRate", - SchemaName: "offset_rate", - }, - { - Name: "OffsetPeer", - SchemaName: "offset_peer", - }, - { - Name: "OffsetID", - SchemaName: "offset_id", + Name: "Offset", + SchemaName: "offset", }, { Name: "Limit", @@ -185,7 +154,7 @@ func (g *StatsGetMessagePublicForwardsRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *StatsGetMessagePublicForwardsRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode stats.getMessagePublicForwards#5630281b as nil") + return fmt.Errorf("can't encode stats.getMessagePublicForwards#5f150144 as nil") } b.PutID(StatsGetMessagePublicForwardsRequestTypeID) return g.EncodeBare(b) @@ -194,23 +163,16 @@ func (g *StatsGetMessagePublicForwardsRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *StatsGetMessagePublicForwardsRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode stats.getMessagePublicForwards#5630281b as nil") + return fmt.Errorf("can't encode stats.getMessagePublicForwards#5f150144 as nil") } if g.Channel == nil { - return fmt.Errorf("unable to encode stats.getMessagePublicForwards#5630281b: field channel is nil") + return fmt.Errorf("unable to encode stats.getMessagePublicForwards#5f150144: field channel is nil") } if err := g.Channel.Encode(b); err != nil { - return fmt.Errorf("unable to encode stats.getMessagePublicForwards#5630281b: field channel: %w", err) + return fmt.Errorf("unable to encode stats.getMessagePublicForwards#5f150144: field channel: %w", err) } b.PutInt(g.MsgID) - b.PutInt(g.OffsetRate) - if g.OffsetPeer == nil { - return fmt.Errorf("unable to encode stats.getMessagePublicForwards#5630281b: field offset_peer is nil") - } - if err := g.OffsetPeer.Encode(b); err != nil { - return fmt.Errorf("unable to encode stats.getMessagePublicForwards#5630281b: field offset_peer: %w", err) - } - b.PutInt(g.OffsetID) + b.PutString(g.Offset) b.PutInt(g.Limit) return nil } @@ -218,10 +180,10 @@ func (g *StatsGetMessagePublicForwardsRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *StatsGetMessagePublicForwardsRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode stats.getMessagePublicForwards#5630281b to nil") + return fmt.Errorf("can't decode stats.getMessagePublicForwards#5f150144 to nil") } if err := b.ConsumeID(StatsGetMessagePublicForwardsRequestTypeID); err != nil { - return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5630281b: %w", err) + return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5f150144: %w", err) } return g.DecodeBare(b) } @@ -229,47 +191,33 @@ func (g *StatsGetMessagePublicForwardsRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *StatsGetMessagePublicForwardsRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode stats.getMessagePublicForwards#5630281b to nil") + return fmt.Errorf("can't decode stats.getMessagePublicForwards#5f150144 to nil") } { value, err := DecodeInputChannel(b) if err != nil { - return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5630281b: field channel: %w", err) + return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5f150144: field channel: %w", err) } g.Channel = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5630281b: field msg_id: %w", err) + return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5f150144: field msg_id: %w", err) } g.MsgID = value } { - value, err := b.Int() + value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5630281b: field offset_rate: %w", err) + return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5f150144: field offset: %w", err) } - g.OffsetRate = value - } - { - value, err := DecodeInputPeer(b) - if err != nil { - return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5630281b: field offset_peer: %w", err) - } - g.OffsetPeer = value + g.Offset = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5630281b: field offset_id: %w", err) - } - g.OffsetID = value - } - { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5630281b: field limit: %w", err) + return fmt.Errorf("unable to decode stats.getMessagePublicForwards#5f150144: field limit: %w", err) } g.Limit = value } @@ -292,28 +240,12 @@ func (g *StatsGetMessagePublicForwardsRequest) GetMsgID() (value int) { return g.MsgID } -// GetOffsetRate returns value of OffsetRate field. -func (g *StatsGetMessagePublicForwardsRequest) GetOffsetRate() (value int) { +// GetOffset returns value of Offset field. +func (g *StatsGetMessagePublicForwardsRequest) GetOffset() (value string) { if g == nil { return } - return g.OffsetRate -} - -// GetOffsetPeer returns value of OffsetPeer field. -func (g *StatsGetMessagePublicForwardsRequest) GetOffsetPeer() (value InputPeerClass) { - if g == nil { - return - } - return g.OffsetPeer -} - -// GetOffsetID returns value of OffsetID field. -func (g *StatsGetMessagePublicForwardsRequest) GetOffsetID() (value int) { - if g == nil { - return - } - return g.OffsetID + return g.Offset } // GetLimit returns value of Limit field. @@ -329,7 +261,7 @@ func (g *StatsGetMessagePublicForwardsRequest) GetChannelAsNotEmpty() (NotEmptyI return g.Channel.AsNotEmpty() } -// StatsGetMessagePublicForwards invokes method stats.getMessagePublicForwards#5630281b returning error if any. +// StatsGetMessagePublicForwards invokes method stats.getMessagePublicForwards#5f150144 returning error if any. // Obtains a list of messages, indicating to which other public channels was a channel // message forwarded. // Will return a list of messages¹ with peer_id equal to the public channel to which @@ -346,11 +278,11 @@ func (g *StatsGetMessagePublicForwardsRequest) GetChannelAsNotEmpty() (NotEmptyI // 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stats.getMessagePublicForwards for reference. -func (c *Client) StatsGetMessagePublicForwards(ctx context.Context, request *StatsGetMessagePublicForwardsRequest) (MessagesMessagesClass, error) { - var result MessagesMessagesBox +func (c *Client) StatsGetMessagePublicForwards(ctx context.Context, request *StatsGetMessagePublicForwardsRequest) (*StatsPublicForwards, error) { + var result StatsPublicForwards if err := c.rpc.Invoke(ctx, request, &result); err != nil { return nil, err } - return result.Messages, nil + return &result, nil } diff --git a/vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_gen.go new file mode 100644 index 00000000..a1bc0549 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_gen.go @@ -0,0 +1,282 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StatsGetStoryPublicForwardsRequest represents TL type `stats.getStoryPublicForwards#a6437ef6`. +// Obtain forwards of a story¹ as a message to public chats and reposts by public +// channels. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// See https://core.telegram.org/method/stats.getStoryPublicForwards for reference. +type StatsGetStoryPublicForwardsRequest struct { + // Peer where the story was originally posted + Peer InputPeerClass + // Story¹ ID + // + // Links: + // 1) https://core.telegram.org/api/stories + ID int + // Offset for pagination, from stats.PublicForwards¹.next_offset. + // + // Links: + // 1) https://core.telegram.org/constructor/stats.publicForwards + Offset string + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets + Limit int +} + +// StatsGetStoryPublicForwardsRequestTypeID is TL type id of StatsGetStoryPublicForwardsRequest. +const StatsGetStoryPublicForwardsRequestTypeID = 0xa6437ef6 + +// Ensuring interfaces in compile-time for StatsGetStoryPublicForwardsRequest. +var ( + _ bin.Encoder = &StatsGetStoryPublicForwardsRequest{} + _ bin.Decoder = &StatsGetStoryPublicForwardsRequest{} + _ bin.BareEncoder = &StatsGetStoryPublicForwardsRequest{} + _ bin.BareDecoder = &StatsGetStoryPublicForwardsRequest{} +) + +func (g *StatsGetStoryPublicForwardsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Peer == nil) { + return false + } + if !(g.ID == 0) { + return false + } + if !(g.Offset == "") { + return false + } + if !(g.Limit == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *StatsGetStoryPublicForwardsRequest) String() string { + if g == nil { + return "StatsGetStoryPublicForwardsRequest(nil)" + } + type Alias StatsGetStoryPublicForwardsRequest + return fmt.Sprintf("StatsGetStoryPublicForwardsRequest%+v", Alias(*g)) +} + +// FillFrom fills StatsGetStoryPublicForwardsRequest from given interface. +func (g *StatsGetStoryPublicForwardsRequest) FillFrom(from interface { + GetPeer() (value InputPeerClass) + GetID() (value int) + GetOffset() (value string) + GetLimit() (value int) +}) { + g.Peer = from.GetPeer() + g.ID = from.GetID() + g.Offset = from.GetOffset() + g.Limit = from.GetLimit() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StatsGetStoryPublicForwardsRequest) TypeID() uint32 { + return StatsGetStoryPublicForwardsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*StatsGetStoryPublicForwardsRequest) TypeName() string { + return "stats.getStoryPublicForwards" +} + +// TypeInfo returns info about TL type. +func (g *StatsGetStoryPublicForwardsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "stats.getStoryPublicForwards", + ID: StatsGetStoryPublicForwardsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "Offset", + SchemaName: "offset", + }, + { + Name: "Limit", + SchemaName: "limit", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *StatsGetStoryPublicForwardsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode stats.getStoryPublicForwards#a6437ef6 as nil") + } + b.PutID(StatsGetStoryPublicForwardsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *StatsGetStoryPublicForwardsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode stats.getStoryPublicForwards#a6437ef6 as nil") + } + if g.Peer == nil { + return fmt.Errorf("unable to encode stats.getStoryPublicForwards#a6437ef6: field peer is nil") + } + if err := g.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.getStoryPublicForwards#a6437ef6: field peer: %w", err) + } + b.PutInt(g.ID) + b.PutString(g.Offset) + b.PutInt(g.Limit) + return nil +} + +// Decode implements bin.Decoder. +func (g *StatsGetStoryPublicForwardsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode stats.getStoryPublicForwards#a6437ef6 to nil") + } + if err := b.ConsumeID(StatsGetStoryPublicForwardsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode stats.getStoryPublicForwards#a6437ef6: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *StatsGetStoryPublicForwardsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode stats.getStoryPublicForwards#a6437ef6 to nil") + } + { + value, err := DecodeInputPeer(b) + if err != nil { + return fmt.Errorf("unable to decode stats.getStoryPublicForwards#a6437ef6: field peer: %w", err) + } + g.Peer = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stats.getStoryPublicForwards#a6437ef6: field id: %w", err) + } + g.ID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode stats.getStoryPublicForwards#a6437ef6: field offset: %w", err) + } + g.Offset = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stats.getStoryPublicForwards#a6437ef6: field limit: %w", err) + } + g.Limit = value + } + return nil +} + +// GetPeer returns value of Peer field. +func (g *StatsGetStoryPublicForwardsRequest) GetPeer() (value InputPeerClass) { + if g == nil { + return + } + return g.Peer +} + +// GetID returns value of ID field. +func (g *StatsGetStoryPublicForwardsRequest) GetID() (value int) { + if g == nil { + return + } + return g.ID +} + +// GetOffset returns value of Offset field. +func (g *StatsGetStoryPublicForwardsRequest) GetOffset() (value string) { + if g == nil { + return + } + return g.Offset +} + +// GetLimit returns value of Limit field. +func (g *StatsGetStoryPublicForwardsRequest) GetLimit() (value int) { + if g == nil { + return + } + return g.Limit +} + +// StatsGetStoryPublicForwards invokes method stats.getStoryPublicForwards#a6437ef6 returning error if any. +// Obtain forwards of a story¹ as a message to public chats and reposts by public +// channels. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// +// See https://core.telegram.org/method/stats.getStoryPublicForwards for reference. +func (c *Client) StatsGetStoryPublicForwards(ctx context.Context, request *StatsGetStoryPublicForwardsRequest) (*StatsPublicForwards, error) { + var result StatsPublicForwards + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_get_story_public_forwards_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_gen.go new file mode 100644 index 00000000..588b8e43 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_gen.go @@ -0,0 +1,275 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StatsGetStoryStatsRequest represents TL type `stats.getStoryStats#374fef40`. +// Get statistics¹ for a certain story². +// +// Links: +// 1. https://core.telegram.org/api/stats +// 2. https://core.telegram.org/api/stories +// +// See https://core.telegram.org/method/stats.getStoryStats for reference. +type StatsGetStoryStatsRequest struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // Whether to enable the dark theme for graph colors + Dark bool + // The peer that posted the story + Peer InputPeerClass + // Story ID + ID int +} + +// StatsGetStoryStatsRequestTypeID is TL type id of StatsGetStoryStatsRequest. +const StatsGetStoryStatsRequestTypeID = 0x374fef40 + +// Ensuring interfaces in compile-time for StatsGetStoryStatsRequest. +var ( + _ bin.Encoder = &StatsGetStoryStatsRequest{} + _ bin.Decoder = &StatsGetStoryStatsRequest{} + _ bin.BareEncoder = &StatsGetStoryStatsRequest{} + _ bin.BareDecoder = &StatsGetStoryStatsRequest{} +) + +func (g *StatsGetStoryStatsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Flags.Zero()) { + return false + } + if !(g.Dark == false) { + return false + } + if !(g.Peer == nil) { + return false + } + if !(g.ID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *StatsGetStoryStatsRequest) String() string { + if g == nil { + return "StatsGetStoryStatsRequest(nil)" + } + type Alias StatsGetStoryStatsRequest + return fmt.Sprintf("StatsGetStoryStatsRequest%+v", Alias(*g)) +} + +// FillFrom fills StatsGetStoryStatsRequest from given interface. +func (g *StatsGetStoryStatsRequest) FillFrom(from interface { + GetDark() (value bool) + GetPeer() (value InputPeerClass) + GetID() (value int) +}) { + g.Dark = from.GetDark() + g.Peer = from.GetPeer() + g.ID = from.GetID() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StatsGetStoryStatsRequest) TypeID() uint32 { + return StatsGetStoryStatsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*StatsGetStoryStatsRequest) TypeName() string { + return "stats.getStoryStats" +} + +// TypeInfo returns info about TL type. +func (g *StatsGetStoryStatsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "stats.getStoryStats", + ID: StatsGetStoryStatsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Dark", + SchemaName: "dark", + Null: !g.Flags.Has(0), + }, + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "ID", + SchemaName: "id", + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (g *StatsGetStoryStatsRequest) SetFlags() { + if !(g.Dark == false) { + g.Flags.Set(0) + } +} + +// Encode implements bin.Encoder. +func (g *StatsGetStoryStatsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode stats.getStoryStats#374fef40 as nil") + } + b.PutID(StatsGetStoryStatsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *StatsGetStoryStatsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode stats.getStoryStats#374fef40 as nil") + } + g.SetFlags() + if err := g.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.getStoryStats#374fef40: field flags: %w", err) + } + if g.Peer == nil { + return fmt.Errorf("unable to encode stats.getStoryStats#374fef40: field peer is nil") + } + if err := g.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.getStoryStats#374fef40: field peer: %w", err) + } + b.PutInt(g.ID) + return nil +} + +// Decode implements bin.Decoder. +func (g *StatsGetStoryStatsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode stats.getStoryStats#374fef40 to nil") + } + if err := b.ConsumeID(StatsGetStoryStatsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode stats.getStoryStats#374fef40: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *StatsGetStoryStatsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode stats.getStoryStats#374fef40 to nil") + } + { + if err := g.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode stats.getStoryStats#374fef40: field flags: %w", err) + } + } + g.Dark = g.Flags.Has(0) + { + value, err := DecodeInputPeer(b) + if err != nil { + return fmt.Errorf("unable to decode stats.getStoryStats#374fef40: field peer: %w", err) + } + g.Peer = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stats.getStoryStats#374fef40: field id: %w", err) + } + g.ID = value + } + return nil +} + +// SetDark sets value of Dark conditional field. +func (g *StatsGetStoryStatsRequest) SetDark(value bool) { + if value { + g.Flags.Set(0) + g.Dark = true + } else { + g.Flags.Unset(0) + g.Dark = false + } +} + +// GetDark returns value of Dark conditional field. +func (g *StatsGetStoryStatsRequest) GetDark() (value bool) { + if g == nil { + return + } + return g.Flags.Has(0) +} + +// GetPeer returns value of Peer field. +func (g *StatsGetStoryStatsRequest) GetPeer() (value InputPeerClass) { + if g == nil { + return + } + return g.Peer +} + +// GetID returns value of ID field. +func (g *StatsGetStoryStatsRequest) GetID() (value int) { + if g == nil { + return + } + return g.ID +} + +// StatsGetStoryStats invokes method stats.getStoryStats#374fef40 returning error if any. +// Get statistics¹ for a certain story². +// +// Links: +// 1. https://core.telegram.org/api/stats +// 2. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// +// See https://core.telegram.org/method/stats.getStoryStats for reference. +func (c *Client) StatsGetStoryStats(ctx context.Context, request *StatsGetStoryStatsRequest) (*StatsStoryStats, error) { + var result StatsStoryStats + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_get_story_stats_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_stats_message_stats_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_message_stats_gen.go index a2d0e3f9..dcc4420f 100644 --- a/vendor/github.com/gotd/td/tg/tl_stats_message_stats_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stats_message_stats_gen.go @@ -31,17 +31,19 @@ var ( _ = tdjson.Encoder{} ) -// StatsMessageStats represents TL type `stats.messageStats#8999f295`. +// StatsMessageStats represents TL type `stats.messageStats#7fe91c14`. // Message statistics // // See https://core.telegram.org/constructor/stats.messageStats for reference. type StatsMessageStats struct { // Message view graph ViewsGraph StatsGraphClass + // A graph containing the number of reactions on stories categorized by emotion + ReactionsByEmotionGraph StatsGraphClass } // StatsMessageStatsTypeID is TL type id of StatsMessageStats. -const StatsMessageStatsTypeID = 0x8999f295 +const StatsMessageStatsTypeID = 0x7fe91c14 // Ensuring interfaces in compile-time for StatsMessageStats. var ( @@ -58,6 +60,9 @@ func (m *StatsMessageStats) Zero() bool { if !(m.ViewsGraph == nil) { return false } + if !(m.ReactionsByEmotionGraph == nil) { + return false + } return true } @@ -74,8 +79,10 @@ func (m *StatsMessageStats) String() string { // FillFrom fills StatsMessageStats from given interface. func (m *StatsMessageStats) FillFrom(from interface { GetViewsGraph() (value StatsGraphClass) + GetReactionsByEmotionGraph() (value StatsGraphClass) }) { m.ViewsGraph = from.GetViewsGraph() + m.ReactionsByEmotionGraph = from.GetReactionsByEmotionGraph() } // TypeID returns type id in TL schema. @@ -105,6 +112,10 @@ func (m *StatsMessageStats) TypeInfo() tdp.Type { Name: "ViewsGraph", SchemaName: "views_graph", }, + { + Name: "ReactionsByEmotionGraph", + SchemaName: "reactions_by_emotion_graph", + }, } return typ } @@ -112,7 +123,7 @@ func (m *StatsMessageStats) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *StatsMessageStats) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode stats.messageStats#8999f295 as nil") + return fmt.Errorf("can't encode stats.messageStats#7fe91c14 as nil") } b.PutID(StatsMessageStatsTypeID) return m.EncodeBare(b) @@ -121,13 +132,19 @@ func (m *StatsMessageStats) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *StatsMessageStats) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode stats.messageStats#8999f295 as nil") + return fmt.Errorf("can't encode stats.messageStats#7fe91c14 as nil") } if m.ViewsGraph == nil { - return fmt.Errorf("unable to encode stats.messageStats#8999f295: field views_graph is nil") + return fmt.Errorf("unable to encode stats.messageStats#7fe91c14: field views_graph is nil") } if err := m.ViewsGraph.Encode(b); err != nil { - return fmt.Errorf("unable to encode stats.messageStats#8999f295: field views_graph: %w", err) + return fmt.Errorf("unable to encode stats.messageStats#7fe91c14: field views_graph: %w", err) + } + if m.ReactionsByEmotionGraph == nil { + return fmt.Errorf("unable to encode stats.messageStats#7fe91c14: field reactions_by_emotion_graph is nil") + } + if err := m.ReactionsByEmotionGraph.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.messageStats#7fe91c14: field reactions_by_emotion_graph: %w", err) } return nil } @@ -135,10 +152,10 @@ func (m *StatsMessageStats) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *StatsMessageStats) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode stats.messageStats#8999f295 to nil") + return fmt.Errorf("can't decode stats.messageStats#7fe91c14 to nil") } if err := b.ConsumeID(StatsMessageStatsTypeID); err != nil { - return fmt.Errorf("unable to decode stats.messageStats#8999f295: %w", err) + return fmt.Errorf("unable to decode stats.messageStats#7fe91c14: %w", err) } return m.DecodeBare(b) } @@ -146,15 +163,22 @@ func (m *StatsMessageStats) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *StatsMessageStats) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode stats.messageStats#8999f295 to nil") + return fmt.Errorf("can't decode stats.messageStats#7fe91c14 to nil") } { value, err := DecodeStatsGraph(b) if err != nil { - return fmt.Errorf("unable to decode stats.messageStats#8999f295: field views_graph: %w", err) + return fmt.Errorf("unable to decode stats.messageStats#7fe91c14: field views_graph: %w", err) } m.ViewsGraph = value } + { + value, err := DecodeStatsGraph(b) + if err != nil { + return fmt.Errorf("unable to decode stats.messageStats#7fe91c14: field reactions_by_emotion_graph: %w", err) + } + m.ReactionsByEmotionGraph = value + } return nil } @@ -165,3 +189,11 @@ func (m *StatsMessageStats) GetViewsGraph() (value StatsGraphClass) { } return m.ViewsGraph } + +// GetReactionsByEmotionGraph returns value of ReactionsByEmotionGraph field. +func (m *StatsMessageStats) GetReactionsByEmotionGraph() (value StatsGraphClass) { + if m == nil { + return + } + return m.ReactionsByEmotionGraph +} diff --git a/vendor/github.com/gotd/td/tg/tl_stats_public_forwards_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_public_forwards_gen.go new file mode 100644 index 00000000..112aea64 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_public_forwards_gen.go @@ -0,0 +1,388 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StatsPublicForwards represents TL type `stats.publicForwards#93037e20`. +// Contains info about the forwards of a story¹ as a message to public chats and reposts +// by public channels. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// See https://core.telegram.org/constructor/stats.publicForwards for reference. +type StatsPublicForwards struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // Total number of results + Count int + // Info about the forwards of a story. + Forwards []PublicForwardClass + // Offset used for pagination¹. + // + // Links: + // 1) https://core.telegram.org/api/offsets + // + // Use SetNextOffset and GetNextOffset helpers. + NextOffset string + // Mentioned chats + Chats []ChatClass + // Mentioned users + Users []UserClass +} + +// StatsPublicForwardsTypeID is TL type id of StatsPublicForwards. +const StatsPublicForwardsTypeID = 0x93037e20 + +// Ensuring interfaces in compile-time for StatsPublicForwards. +var ( + _ bin.Encoder = &StatsPublicForwards{} + _ bin.Decoder = &StatsPublicForwards{} + _ bin.BareEncoder = &StatsPublicForwards{} + _ bin.BareDecoder = &StatsPublicForwards{} +) + +func (p *StatsPublicForwards) Zero() bool { + if p == nil { + return true + } + if !(p.Flags.Zero()) { + return false + } + if !(p.Count == 0) { + return false + } + if !(p.Forwards == nil) { + return false + } + if !(p.NextOffset == "") { + return false + } + if !(p.Chats == nil) { + return false + } + if !(p.Users == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *StatsPublicForwards) String() string { + if p == nil { + return "StatsPublicForwards(nil)" + } + type Alias StatsPublicForwards + return fmt.Sprintf("StatsPublicForwards%+v", Alias(*p)) +} + +// FillFrom fills StatsPublicForwards from given interface. +func (p *StatsPublicForwards) FillFrom(from interface { + GetCount() (value int) + GetForwards() (value []PublicForwardClass) + GetNextOffset() (value string, ok bool) + GetChats() (value []ChatClass) + GetUsers() (value []UserClass) +}) { + p.Count = from.GetCount() + p.Forwards = from.GetForwards() + if val, ok := from.GetNextOffset(); ok { + p.NextOffset = val + } + + p.Chats = from.GetChats() + p.Users = from.GetUsers() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StatsPublicForwards) TypeID() uint32 { + return StatsPublicForwardsTypeID +} + +// TypeName returns name of type in TL schema. +func (*StatsPublicForwards) TypeName() string { + return "stats.publicForwards" +} + +// TypeInfo returns info about TL type. +func (p *StatsPublicForwards) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "stats.publicForwards", + ID: StatsPublicForwardsTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Count", + SchemaName: "count", + }, + { + Name: "Forwards", + SchemaName: "forwards", + }, + { + Name: "NextOffset", + SchemaName: "next_offset", + Null: !p.Flags.Has(0), + }, + { + Name: "Chats", + SchemaName: "chats", + }, + { + Name: "Users", + SchemaName: "users", + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (p *StatsPublicForwards) SetFlags() { + if !(p.NextOffset == "") { + p.Flags.Set(0) + } +} + +// Encode implements bin.Encoder. +func (p *StatsPublicForwards) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode stats.publicForwards#93037e20 as nil") + } + b.PutID(StatsPublicForwardsTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *StatsPublicForwards) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode stats.publicForwards#93037e20 as nil") + } + p.SetFlags() + if err := p.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.publicForwards#93037e20: field flags: %w", err) + } + b.PutInt(p.Count) + b.PutVectorHeader(len(p.Forwards)) + for idx, v := range p.Forwards { + if v == nil { + return fmt.Errorf("unable to encode stats.publicForwards#93037e20: field forwards element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.publicForwards#93037e20: field forwards element with index %d: %w", idx, err) + } + } + if p.Flags.Has(0) { + b.PutString(p.NextOffset) + } + b.PutVectorHeader(len(p.Chats)) + for idx, v := range p.Chats { + if v == nil { + return fmt.Errorf("unable to encode stats.publicForwards#93037e20: field chats element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.publicForwards#93037e20: field chats element with index %d: %w", idx, err) + } + } + b.PutVectorHeader(len(p.Users)) + for idx, v := range p.Users { + if v == nil { + return fmt.Errorf("unable to encode stats.publicForwards#93037e20: field users element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.publicForwards#93037e20: field users element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (p *StatsPublicForwards) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode stats.publicForwards#93037e20 to nil") + } + if err := b.ConsumeID(StatsPublicForwardsTypeID); err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *StatsPublicForwards) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode stats.publicForwards#93037e20 to nil") + } + { + if err := p.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field flags: %w", err) + } + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field count: %w", err) + } + p.Count = value + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field forwards: %w", err) + } + + if headerLen > 0 { + p.Forwards = make([]PublicForwardClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodePublicForward(b) + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field forwards: %w", err) + } + p.Forwards = append(p.Forwards, value) + } + } + if p.Flags.Has(0) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field next_offset: %w", err) + } + p.NextOffset = value + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field chats: %w", err) + } + + if headerLen > 0 { + p.Chats = make([]ChatClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeChat(b) + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field chats: %w", err) + } + p.Chats = append(p.Chats, value) + } + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field users: %w", err) + } + + if headerLen > 0 { + p.Users = make([]UserClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeUser(b) + if err != nil { + return fmt.Errorf("unable to decode stats.publicForwards#93037e20: field users: %w", err) + } + p.Users = append(p.Users, value) + } + } + return nil +} + +// GetCount returns value of Count field. +func (p *StatsPublicForwards) GetCount() (value int) { + if p == nil { + return + } + return p.Count +} + +// GetForwards returns value of Forwards field. +func (p *StatsPublicForwards) GetForwards() (value []PublicForwardClass) { + if p == nil { + return + } + return p.Forwards +} + +// SetNextOffset sets value of NextOffset conditional field. +func (p *StatsPublicForwards) SetNextOffset(value string) { + p.Flags.Set(0) + p.NextOffset = value +} + +// GetNextOffset returns value of NextOffset conditional field and +// boolean which is true if field was set. +func (p *StatsPublicForwards) GetNextOffset() (value string, ok bool) { + if p == nil { + return + } + if !p.Flags.Has(0) { + return value, false + } + return p.NextOffset, true +} + +// GetChats returns value of Chats field. +func (p *StatsPublicForwards) GetChats() (value []ChatClass) { + if p == nil { + return + } + return p.Chats +} + +// GetUsers returns value of Users field. +func (p *StatsPublicForwards) GetUsers() (value []UserClass) { + if p == nil { + return + } + return p.Users +} + +// MapForwards returns field Forwards wrapped in PublicForwardClassArray helper. +func (p *StatsPublicForwards) MapForwards() (value PublicForwardClassArray) { + return PublicForwardClassArray(p.Forwards) +} + +// MapChats returns field Chats wrapped in ChatClassArray helper. +func (p *StatsPublicForwards) MapChats() (value ChatClassArray) { + return ChatClassArray(p.Chats) +} + +// MapUsers returns field Users wrapped in UserClassArray helper. +func (p *StatsPublicForwards) MapUsers() (value UserClassArray) { + return UserClassArray(p.Users) +} diff --git a/vendor/github.com/gotd/td/tg/tl_stats_public_forwards_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_public_forwards_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_public_forwards_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_stats_story_stats_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_story_stats_gen.go new file mode 100644 index 00000000..1fa0c77b --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_story_stats_gen.go @@ -0,0 +1,204 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StatsStoryStats represents TL type `stats.storyStats#50cd067c`. +// Contains statistics¹ about a story². +// +// Links: +// 1. https://core.telegram.org/api/stats +// 2. https://core.telegram.org/api/stories +// +// See https://core.telegram.org/constructor/stats.storyStats for reference. +type StatsStoryStats struct { + // A graph containing the number of story views and shares + ViewsGraph StatsGraphClass + // A bar graph containing the number of story reactions categorized by "emotion" (i.e. + // Positive, Negative, Other, etc...) + ReactionsByEmotionGraph StatsGraphClass +} + +// StatsStoryStatsTypeID is TL type id of StatsStoryStats. +const StatsStoryStatsTypeID = 0x50cd067c + +// Ensuring interfaces in compile-time for StatsStoryStats. +var ( + _ bin.Encoder = &StatsStoryStats{} + _ bin.Decoder = &StatsStoryStats{} + _ bin.BareEncoder = &StatsStoryStats{} + _ bin.BareDecoder = &StatsStoryStats{} +) + +func (s *StatsStoryStats) Zero() bool { + if s == nil { + return true + } + if !(s.ViewsGraph == nil) { + return false + } + if !(s.ReactionsByEmotionGraph == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StatsStoryStats) String() string { + if s == nil { + return "StatsStoryStats(nil)" + } + type Alias StatsStoryStats + return fmt.Sprintf("StatsStoryStats%+v", Alias(*s)) +} + +// FillFrom fills StatsStoryStats from given interface. +func (s *StatsStoryStats) FillFrom(from interface { + GetViewsGraph() (value StatsGraphClass) + GetReactionsByEmotionGraph() (value StatsGraphClass) +}) { + s.ViewsGraph = from.GetViewsGraph() + s.ReactionsByEmotionGraph = from.GetReactionsByEmotionGraph() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StatsStoryStats) TypeID() uint32 { + return StatsStoryStatsTypeID +} + +// TypeName returns name of type in TL schema. +func (*StatsStoryStats) TypeName() string { + return "stats.storyStats" +} + +// TypeInfo returns info about TL type. +func (s *StatsStoryStats) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "stats.storyStats", + ID: StatsStoryStatsTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ViewsGraph", + SchemaName: "views_graph", + }, + { + Name: "ReactionsByEmotionGraph", + SchemaName: "reactions_by_emotion_graph", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StatsStoryStats) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode stats.storyStats#50cd067c as nil") + } + b.PutID(StatsStoryStatsTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StatsStoryStats) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode stats.storyStats#50cd067c as nil") + } + if s.ViewsGraph == nil { + return fmt.Errorf("unable to encode stats.storyStats#50cd067c: field views_graph is nil") + } + if err := s.ViewsGraph.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.storyStats#50cd067c: field views_graph: %w", err) + } + if s.ReactionsByEmotionGraph == nil { + return fmt.Errorf("unable to encode stats.storyStats#50cd067c: field reactions_by_emotion_graph is nil") + } + if err := s.ReactionsByEmotionGraph.Encode(b); err != nil { + return fmt.Errorf("unable to encode stats.storyStats#50cd067c: field reactions_by_emotion_graph: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StatsStoryStats) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode stats.storyStats#50cd067c to nil") + } + if err := b.ConsumeID(StatsStoryStatsTypeID); err != nil { + return fmt.Errorf("unable to decode stats.storyStats#50cd067c: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StatsStoryStats) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode stats.storyStats#50cd067c to nil") + } + { + value, err := DecodeStatsGraph(b) + if err != nil { + return fmt.Errorf("unable to decode stats.storyStats#50cd067c: field views_graph: %w", err) + } + s.ViewsGraph = value + } + { + value, err := DecodeStatsGraph(b) + if err != nil { + return fmt.Errorf("unable to decode stats.storyStats#50cd067c: field reactions_by_emotion_graph: %w", err) + } + s.ReactionsByEmotionGraph = value + } + return nil +} + +// GetViewsGraph returns value of ViewsGraph field. +func (s *StatsStoryStats) GetViewsGraph() (value StatsGraphClass) { + if s == nil { + return + } + return s.ViewsGraph +} + +// GetReactionsByEmotionGraph returns value of ReactionsByEmotionGraph field. +func (s *StatsStoryStats) GetReactionsByEmotionGraph() (value StatsGraphClass) { + if s == nil { + return + } + return s.ReactionsByEmotionGraph +} diff --git a/vendor/github.com/gotd/td/tg/tl_stats_story_stats_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_stats_story_stats_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stats_story_stats_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_sticker_set_gen.go b/vendor/github.com/gotd/td/tg/tl_sticker_set_gen.go index 440908b6..7250ac62 100644 --- a/vendor/github.com/gotd/td/tg/tl_sticker_set_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_sticker_set_gen.go @@ -54,8 +54,12 @@ type StickerSet struct { Videos bool // This is a custom emoji stickerset Emojis bool - // TextColor field of StickerSet. + // Whether the color of this TGS custom emoji stickerset should be changed to the text + // color when used in messages, the accent color if used as emoji status, white on chat + // photos, or another appropriate color based on context. TextColor bool + // ChannelEmojiStatus field of StickerSet. + ChannelEmojiStatus bool // When was this stickerset installed // // Use SetInstalledDate and GetInstalledDate helpers. @@ -136,6 +140,9 @@ func (s *StickerSet) Zero() bool { if !(s.TextColor == false) { return false } + if !(s.ChannelEmojiStatus == false) { + return false + } if !(s.InstalledDate == 0) { return false } @@ -191,6 +198,7 @@ func (s *StickerSet) FillFrom(from interface { GetVideos() (value bool) GetEmojis() (value bool) GetTextColor() (value bool) + GetChannelEmojiStatus() (value bool) GetInstalledDate() (value int, ok bool) GetID() (value int64) GetAccessHash() (value int64) @@ -210,6 +218,7 @@ func (s *StickerSet) FillFrom(from interface { s.Videos = from.GetVideos() s.Emojis = from.GetEmojis() s.TextColor = from.GetTextColor() + s.ChannelEmojiStatus = from.GetChannelEmojiStatus() if val, ok := from.GetInstalledDate(); ok { s.InstalledDate = val } @@ -296,6 +305,11 @@ func (s *StickerSet) TypeInfo() tdp.Type { SchemaName: "text_color", Null: !s.Flags.Has(9), }, + { + Name: "ChannelEmojiStatus", + SchemaName: "channel_emoji_status", + Null: !s.Flags.Has(10), + }, { Name: "InstalledDate", SchemaName: "installed_date", @@ -372,6 +386,9 @@ func (s *StickerSet) SetFlags() { if !(s.TextColor == false) { s.Flags.Set(9) } + if !(s.ChannelEmojiStatus == false) { + s.Flags.Set(10) + } if !(s.InstalledDate == 0) { s.Flags.Set(0) } @@ -467,6 +484,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { s.Videos = s.Flags.Has(6) s.Emojis = s.Flags.Has(7) s.TextColor = s.Flags.Has(9) + s.ChannelEmojiStatus = s.Flags.Has(10) if s.Flags.Has(0) { value, err := b.Int() if err != nil { @@ -690,6 +708,25 @@ func (s *StickerSet) GetTextColor() (value bool) { return s.Flags.Has(9) } +// SetChannelEmojiStatus sets value of ChannelEmojiStatus conditional field. +func (s *StickerSet) SetChannelEmojiStatus(value bool) { + if value { + s.Flags.Set(10) + s.ChannelEmojiStatus = true + } else { + s.Flags.Unset(10) + s.ChannelEmojiStatus = false + } +} + +// GetChannelEmojiStatus returns value of ChannelEmojiStatus conditional field. +func (s *StickerSet) GetChannelEmojiStatus() (value bool) { + if s == nil { + return + } + return s.Flags.Has(10) +} + // SetInstalledDate sets value of InstalledDate conditional field. func (s *StickerSet) SetInstalledDate(value int) { s.Flags.Set(0) diff --git a/vendor/github.com/gotd/td/tg/tl_stories_activate_stealth_mode_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_activate_stealth_mode_gen.go index d82c2cd5..c2eab595 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_activate_stealth_mode_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_activate_stealth_mode_gen.go @@ -32,14 +32,34 @@ var ( ) // StoriesActivateStealthModeRequest represents TL type `stories.activateStealthMode#57bbd166`. +// Activates stories stealth mode¹, see here »² for more info. +// Will return an updateStoriesStealthMode¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#stealth-mode +// 2. https://core.telegram.org/api/stories#stealth-mode +// 3. https://core.telegram.org/constructor/updateStoriesStealthMode // // See https://core.telegram.org/method/stories.activateStealthMode for reference. type StoriesActivateStealthModeRequest struct { - // Flags field of StoriesActivateStealthModeRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Past field of StoriesActivateStealthModeRequest. + // Whether to erase views from any stories opened in the past stories_stealth_past_period + // seconds »¹, as specified by the client configuration². + // + // Links: + // 1) https://core.telegram.org/api/config#stories-stealth-past-period + // 2) https://core.telegram.org/api/config#client-configuration Past bool - // Future field of StoriesActivateStealthModeRequest. + // Whether to hide future story views for the next stories_stealth_future_period seconds + // »¹, as specified by the client configuration². + // + // Links: + // 1) https://core.telegram.org/api/config#stories-stealth-future-period + // 2) https://core.telegram.org/api/config#client-configuration Future bool } @@ -222,6 +242,13 @@ func (a *StoriesActivateStealthModeRequest) GetFuture() (value bool) { } // StoriesActivateStealthMode invokes method stories.activateStealthMode#57bbd166 returning error if any. +// Activates stories stealth mode¹, see here »² for more info. +// Will return an updateStoriesStealthMode¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#stealth-mode +// 2. https://core.telegram.org/api/stories#stealth-mode +// 3. https://core.telegram.org/constructor/updateStoriesStealthMode // // See https://core.telegram.org/method/stories.activateStealthMode for reference. func (c *Client) StoriesActivateStealthMode(ctx context.Context, request *StoriesActivateStealthModeRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_all_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_all_stories_gen.go index 67b4008d..48b4c107 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_all_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_all_stories_gen.go @@ -32,14 +32,24 @@ var ( ) // StoriesAllStoriesNotModified represents TL type `stories.allStoriesNotModified#1158fe3e`. +// The list of active (or active and hidden) stories¹ has not changed. +// +// Links: +// 1. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/constructor/stories.allStoriesNotModified for reference. type StoriesAllStoriesNotModified struct { - // Flags field of StoriesAllStoriesNotModified. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // State field of StoriesAllStoriesNotModified. + // State to use to ask for updates State string - // StealthMode field of StoriesAllStoriesNotModified. + // Current stealth mode¹ information + // + // Links: + // 1) https://core.telegram.org/api/stories#stealth-mode StealthMode StoriesStealthMode } @@ -211,24 +221,37 @@ func (a *StoriesAllStoriesNotModified) GetStealthMode() (value StoriesStealthMod } // StoriesAllStories represents TL type `stories.allStories#6efc5e81`. +// Full list of active (or active and hidden) stories¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/constructor/stories.allStories for reference. type StoriesAllStories struct { - // Flags field of StoriesAllStories. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // HasMore field of StoriesAllStories. + // Whether more results can be fetched as described here »¹. + // + // Links: + // 1) https://core.telegram.org/api/stories#watching-stories HasMore bool - // Count field of StoriesAllStories. + // Total number of active (or active and hidden) stories Count int - // State field of StoriesAllStories. + // State to use for pagination State string - // PeerStories field of StoriesAllStories. + // Stories PeerStories []PeerStories - // Chats field of StoriesAllStories. + // Mentioned chats Chats []ChatClass - // Users field of StoriesAllStories. + // Mentioned users Users []UserClass - // StealthMode field of StoriesAllStories. + // Current stealth mode¹ information + // + // Links: + // 1) https://core.telegram.org/api/stories#stealth-mode StealthMode StoriesStealthMode } @@ -629,10 +652,13 @@ type StoriesAllStoriesClass interface { // Zero returns true if current object has a zero value. Zero() bool - // State field of StoriesAllStoriesNotModified. + // State to use to ask for updates GetState() (value string) - // StealthMode field of StoriesAllStoriesNotModified. + // Current stealth mode¹ information + // + // Links: + // 1) https://core.telegram.org/api/stories#stealth-mode GetStealthMode() (value StoriesStealthMode) // AsModified tries to map StoriesAllStoriesClass to StoriesAllStories. diff --git a/vendor/github.com/gotd/td/tg/tl_stories_can_send_story_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_can_send_story_gen.go index 2d05afeb..76c6d741 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_can_send_story_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_can_send_story_gen.go @@ -32,10 +32,11 @@ var ( ) // StoriesCanSendStoryRequest represents TL type `stories.canSendStory#c7dfdfdd`. +// Check whether we can post stories as the specified peer. // // See https://core.telegram.org/method/stories.canSendStory for reference. type StoriesCanSendStoryRequest struct { - // Peer field of StoriesCanSendStoryRequest. + // The peer from which we wish to post stories. Peer InputPeerClass } @@ -166,6 +167,17 @@ func (c *StoriesCanSendStoryRequest) GetPeer() (value InputPeerClass) { } // StoriesCanSendStory invokes method stories.canSendStory#c7dfdfdd returning error if any. +// Check whether we can post stories as the specified peer. +// +// Possible errors: +// +// 400 BOOSTS_REQUIRED: The specified channel must first be boosted by its users in order to perform this action. +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// 400 STORIES_TOO_MUCH: You have hit the maximum active stories limit as specified by the story_expiring_limit_* client configuration parameters: you should buy a Premium subscription, delete an active story, or wait for the oldest story to expire. +// 400 STORY_SEND_FLOOD_MONTHLY_%d: You've hit the monthly story limit as specified by the stories_sent_monthly_limit_* client configuration parameters: wait for the specified number of seconds before posting a new story. +// 400 STORY_SEND_FLOOD_WEEKLY_%d: You've hit the weekly story limit as specified by the stories_sent_weekly_limit_* client configuration parameters: wait for the specified number of seconds before posting a new story. // // See https://core.telegram.org/method/stories.canSendStory for reference. func (c *Client) StoriesCanSendStory(ctx context.Context, peer InputPeerClass) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_delete_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_delete_stories_gen.go index 4dabf7bc..9f457682 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_delete_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_delete_stories_gen.go @@ -32,12 +32,16 @@ var ( ) // StoriesDeleteStoriesRequest represents TL type `stories.deleteStories#ae59db5f`. +// Deletes some posted stories¹. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.deleteStories for reference. type StoriesDeleteStoriesRequest struct { - // Peer field of StoriesDeleteStoriesRequest. + // Channel/user from where to delete stories. Peer InputPeerClass - // ID field of StoriesDeleteStoriesRequest. + // IDs of stories to delete. ID []int } @@ -206,6 +210,14 @@ func (d *StoriesDeleteStoriesRequest) GetID() (value []int) { } // StoriesDeleteStories invokes method stories.deleteStories#ae59db5f returning error if any. +// Deletes some posted stories¹. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.deleteStories for reference. func (c *Client) StoriesDeleteStories(ctx context.Context, request *StoriesDeleteStoriesRequest) ([]int, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_edit_story_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_edit_story_gen.go index d94e87c0..0a772884 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_edit_story_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_edit_story_gen.go @@ -32,32 +32,52 @@ var ( ) // StoriesEditStoryRequest represents TL type `stories.editStory#b583ba46`. +// Edit an uploaded story¹ +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.editStory for reference. type StoriesEditStoryRequest struct { - // Flags field of StoriesEditStoryRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of StoriesEditStoryRequest. + // Peer where the story was posted. Peer InputPeerClass - // ID field of StoriesEditStoryRequest. + // ID of story to edit. ID int - // Media field of StoriesEditStoryRequest. + // If specified, replaces the story media. // // Use SetMedia and GetMedia helpers. Media InputMediaClass - // MediaAreas field of StoriesEditStoryRequest. + // Media areas¹ associated to the story, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/api/stories#media-areas + // 2) https://core.telegram.org/api/stories#media-areas // // Use SetMediaAreas and GetMediaAreas helpers. MediaAreas []MediaAreaClass - // Caption field of StoriesEditStoryRequest. + // If specified, replaces the story caption. // // Use SetCaption and GetCaption helpers. Caption string - // Entities field of StoriesEditStoryRequest. + // Message entities for styled text in the caption¹, if allowed by the stories_entities + // client configuration parameter »². + // + // Links: + // 1) https://core.telegram.org/api/entities + // 2) https://core.telegram.org/api/config#stories-entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // PrivacyRules field of StoriesEditStoryRequest. + // If specified, alters the privacy settings »¹ of the story, changing who can or can't + // view the story. + // + // Links: + // 1) https://core.telegram.org/api/privacy // // Use SetPrivacyRules and GetPrivacyRules helpers. PrivacyRules []InputPrivacyRuleClass @@ -534,6 +554,15 @@ func (e *StoriesEditStoryRequest) MapPrivacyRules() (value InputPrivacyRuleClass } // StoriesEditStory invokes method stories.editStory#b583ba46 returning error if any. +// Edit an uploaded story¹ +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_NOT_MODIFIED: The new story information you passed is equal to the previous story information, thus it wasn't modified. // // See https://core.telegram.org/method/stories.editStory for reference. func (c *Client) StoriesEditStory(ctx context.Context, request *StoriesEditStoryRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_export_story_link_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_export_story_link_gen.go index 9496960f..940bbe59 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_export_story_link_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_export_story_link_gen.go @@ -32,12 +32,16 @@ var ( ) // StoriesExportStoryLinkRequest represents TL type `stories.exportStoryLink#7b8def20`. +// Generate a story deep link¹ for a specific story +// +// Links: +// 1. https://core.telegram.org/api/links#story-links // // See https://core.telegram.org/method/stories.exportStoryLink for reference. type StoriesExportStoryLinkRequest struct { - // Peer field of StoriesExportStoryLinkRequest. + // Peer where the story was posted Peer InputPeerClass - // ID field of StoriesExportStoryLinkRequest. + // Story ID ID int } @@ -193,6 +197,15 @@ func (e *StoriesExportStoryLinkRequest) GetID() (value int) { } // StoriesExportStoryLink invokes method stories.exportStoryLink#7b8def20 returning error if any. +// Generate a story deep link¹ for a specific story +// +// Links: +// 1. https://core.telegram.org/api/links#story-links +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 USER_PUBLIC_MISSING: // // See https://core.telegram.org/method/stories.exportStoryLink for reference. func (c *Client) StoriesExportStoryLink(ctx context.Context, request *StoriesExportStoryLinkRequest) (*ExportedStoryLink, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_all_read_peer_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_all_read_peer_stories_gen.go index 43cec63b..6b918739 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_all_read_peer_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_all_read_peer_stories_gen.go @@ -32,6 +32,12 @@ var ( ) // StoriesGetAllReadPeerStoriesRequest represents TL type `stories.getAllReadPeerStories#9b5ae7f9`. +// Obtain the latest read story ID for all peers when first logging in, returned as a +// list of updateReadStories¹ updates, see here »² for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/updateReadStories +// 2. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/method/stories.getAllReadPeerStories for reference. type StoriesGetAllReadPeerStoriesRequest struct { @@ -128,6 +134,12 @@ func (g *StoriesGetAllReadPeerStoriesRequest) DecodeBare(b *bin.Buffer) error { } // StoriesGetAllReadPeerStories invokes method stories.getAllReadPeerStories#9b5ae7f9 returning error if any. +// Obtain the latest read story ID for all peers when first logging in, returned as a +// list of updateReadStories¹ updates, see here »² for more info. +// +// Links: +// 1. https://core.telegram.org/constructor/updateReadStories +// 2. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/method/stories.getAllReadPeerStories for reference. func (c *Client) StoriesGetAllReadPeerStories(ctx context.Context) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_all_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_all_stories_gen.go index 5329f696..7de11047 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_all_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_all_stories_gen.go @@ -32,16 +32,40 @@ var ( ) // StoriesGetAllStoriesRequest represents TL type `stories.getAllStories#eeb0d625`. +// Fetch the List of active (or active and hidden) stories, see here »¹ for more info +// on watching stories. +// +// Links: +// 1. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/method/stories.getAllStories for reference. type StoriesGetAllStoriesRequest struct { - // Flags field of StoriesGetAllStoriesRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Next field of StoriesGetAllStoriesRequest. + // If next and state are both set, uses the passed state to paginate to the next results; + // if neither state nor next are set, fetches the initial page; if state is set and next + // is not set, check for changes in the active/hidden peerset, see here »¹ for more + // info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/stories#watching-stories Next bool - // Hidden field of StoriesGetAllStoriesRequest. + // If set, fetches the hidden active story list, otherwise fetches the active story list, + // see here »¹ for more info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/stories#watching-stories Hidden bool - // State field of StoriesGetAllStoriesRequest. + // If next and state are both set, uses the passed state to paginate to the next results; + // if neither state nor next are set, fetches the initial page; if state is set and next + // is not set, check for changes in the active/hidden peerset, see here »¹ for more + // info on the full flow. + // + // Links: + // 1) https://core.telegram.org/api/stories#watching-stories // // Use SetState and GetState helpers. State string @@ -270,6 +294,11 @@ func (g *StoriesGetAllStoriesRequest) GetState() (value string, ok bool) { } // StoriesGetAllStories invokes method stories.getAllStories#eeb0d625 returning error if any. +// Fetch the List of active (or active and hidden) stories, see here »¹ for more info +// on watching stories. +// +// Links: +// 1. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/method/stories.getAllStories for reference. func (c *Client) StoriesGetAllStories(ctx context.Context, request *StoriesGetAllStoriesRequest) (StoriesAllStoriesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_chats_to_send_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_chats_to_send_gen.go index 3ac9fe33..b76e495e 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_chats_to_send_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_chats_to_send_gen.go @@ -32,6 +32,10 @@ var ( ) // StoriesGetChatsToSendRequest represents TL type `stories.getChatsToSend#a56a8b60`. +// Obtain a list of channels where the user can post stories¹ +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.getChatsToSend for reference. type StoriesGetChatsToSendRequest struct { @@ -128,6 +132,10 @@ func (g *StoriesGetChatsToSendRequest) DecodeBare(b *bin.Buffer) error { } // StoriesGetChatsToSend invokes method stories.getChatsToSend#a56a8b60 returning error if any. +// Obtain a list of channels where the user can post stories¹ +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.getChatsToSend for reference. func (c *Client) StoriesGetChatsToSend(ctx context.Context) (MessagesChatsClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_peer_max_ids_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_peer_max_ids_gen.go index dafacc8c..cb95d029 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_peer_max_ids_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_peer_max_ids_gen.go @@ -32,10 +32,11 @@ var ( ) // StoriesGetPeerMaxIDsRequest represents TL type `stories.getPeerMaxIDs#535983c3`. +// Get the IDs of the maximum read stories for a set of peers. // // See https://core.telegram.org/method/stories.getPeerMaxIDs for reference. type StoriesGetPeerMaxIDsRequest struct { - // ID field of StoriesGetPeerMaxIDsRequest. + // Peers ID []InputPeerClass } @@ -184,6 +185,7 @@ func (g *StoriesGetPeerMaxIDsRequest) MapID() (value InputPeerClassArray) { } // StoriesGetPeerMaxIDs invokes method stories.getPeerMaxIDs#535983c3 returning error if any. +// Get the IDs of the maximum read stories for a set of peers. // // See https://core.telegram.org/method/stories.getPeerMaxIDs for reference. func (c *Client) StoriesGetPeerMaxIDs(ctx context.Context, id []InputPeerClass) ([]int, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_peer_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_peer_stories_gen.go index 74f01d40..099ab70b 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_peer_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_peer_stories_gen.go @@ -32,10 +32,14 @@ var ( ) // StoriesGetPeerStoriesRequest represents TL type `stories.getPeerStories#2c4ada50`. +// Fetch the full active story list¹ of a specific peer. +// +// Links: +// 1. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/method/stories.getPeerStories for reference. type StoriesGetPeerStoriesRequest struct { - // Peer field of StoriesGetPeerStoriesRequest. + // Peer whose stories should be fetched Peer InputPeerClass } @@ -166,6 +170,17 @@ func (g *StoriesGetPeerStoriesRequest) GetPeer() (value InputPeerClass) { } // StoriesGetPeerStories invokes method stories.getPeerStories#2c4ada50 returning error if any. +// Fetch the full active story list¹ of a specific peer. +// +// Links: +// 1. https://core.telegram.org/api/stories#watching-stories +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 MSG_ID_INVALID: Invalid message ID provided. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.getPeerStories for reference. func (c *Client) StoriesGetPeerStories(ctx context.Context, peer InputPeerClass) (*StoriesPeerStories, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_pinned_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_pinned_stories_gen.go index 36c83af4..3e7240ff 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_pinned_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_pinned_stories_gen.go @@ -32,14 +32,24 @@ var ( ) // StoriesGetPinnedStoriesRequest represents TL type `stories.getPinnedStories#5821a5dc`. +// Fetch the stories¹ pinned on a peer's profile. +// +// Links: +// 1. https://core.telegram.org/api/stories#pinned-or-archived-stories // // See https://core.telegram.org/method/stories.getPinnedStories for reference. type StoriesGetPinnedStoriesRequest struct { - // Peer field of StoriesGetPinnedStoriesRequest. + // Peer whose pinned stories should be fetched Peer InputPeerClass - // OffsetID field of StoriesGetPinnedStoriesRequest. + // Offsets for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets OffsetID int - // Limit field of StoriesGetPinnedStoriesRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -220,6 +230,15 @@ func (g *StoriesGetPinnedStoriesRequest) GetLimit() (value int) { } // StoriesGetPinnedStories invokes method stories.getPinnedStories#5821a5dc returning error if any. +// Fetch the stories¹ pinned on a peer's profile. +// +// Links: +// 1. https://core.telegram.org/api/stories#pinned-or-archived-stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/stories.getPinnedStories for reference. func (c *Client) StoriesGetPinnedStories(ctx context.Context, request *StoriesGetPinnedStoriesRequest) (*StoriesStories, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_stories_archive_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_stories_archive_gen.go index db8ff15d..fbdf5ce1 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_stories_archive_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_stories_archive_gen.go @@ -32,14 +32,24 @@ var ( ) // StoriesGetStoriesArchiveRequest represents TL type `stories.getStoriesArchive#b4352016`. +// Fetch the story archive »¹ of a peer we control. +// +// Links: +// 1. https://core.telegram.org/api/stories#pinned-or-archived-stories // // See https://core.telegram.org/method/stories.getStoriesArchive for reference. type StoriesGetStoriesArchiveRequest struct { - // Peer field of StoriesGetStoriesArchiveRequest. + // Peer whose archived stories should be fetched Peer InputPeerClass - // OffsetID field of StoriesGetStoriesArchiveRequest. + // Offsets for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets OffsetID int - // Limit field of StoriesGetStoriesArchiveRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -220,6 +230,15 @@ func (g *StoriesGetStoriesArchiveRequest) GetLimit() (value int) { } // StoriesGetStoriesArchive invokes method stories.getStoriesArchive#b4352016 returning error if any. +// Fetch the story archive »¹ of a peer we control. +// +// Links: +// 1. https://core.telegram.org/api/stories#pinned-or-archived-stories +// +// Possible errors: +// +// 400 CHAT_ADMIN_REQUIRED: You must be an admin in this chat to do this. +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.getStoriesArchive for reference. func (c *Client) StoriesGetStoriesArchive(ctx context.Context, request *StoriesGetStoriesArchiveRequest) (*StoriesStories, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_stories_by_id_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_stories_by_id_gen.go index ba1bbaf3..7dd3a3df 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_stories_by_id_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_stories_by_id_gen.go @@ -32,12 +32,16 @@ var ( ) // StoriesGetStoriesByIDRequest represents TL type `stories.getStoriesByID#5774ca74`. +// Obtain full info about a set of stories¹ by their IDs. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.getStoriesByID for reference. type StoriesGetStoriesByIDRequest struct { - // Peer field of StoriesGetStoriesByIDRequest. + // Peer where the stories were posted Peer InputPeerClass - // ID field of StoriesGetStoriesByIDRequest. + // Story IDs ID []int } @@ -206,6 +210,17 @@ func (g *StoriesGetStoriesByIDRequest) GetID() (value []int) { } // StoriesGetStoriesByID invokes method stories.getStoriesByID#5774ca74 returning error if any. +// Obtain full info about a set of stories¹ by their IDs. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORIES_NEVER_CREATED: +// 400 STORY_ID_EMPTY: You specified no story IDs. // // See https://core.telegram.org/method/stories.getStoriesByID for reference. func (c *Client) StoriesGetStoriesByID(ctx context.Context, request *StoriesGetStoriesByIDRequest) (*StoriesStories, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_stories_views_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_stories_views_gen.go index ca6a26e8..fe7c0508 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_stories_views_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_stories_views_gen.go @@ -32,12 +32,17 @@ var ( ) // StoriesGetStoriesViewsRequest represents TL type `stories.getStoriesViews#28e16cc8`. +// Obtain info about the view count, forward count, reactions and recent viewers of one +// or more stories¹. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.getStoriesViews for reference. type StoriesGetStoriesViewsRequest struct { - // Peer field of StoriesGetStoriesViewsRequest. + // Peer whose stories should be fetched Peer InputPeerClass - // ID field of StoriesGetStoriesViewsRequest. + // Story IDs ID []int } @@ -206,6 +211,18 @@ func (g *StoriesGetStoriesViewsRequest) GetID() (value []int) { } // StoriesGetStoriesViews invokes method stories.getStoriesViews#28e16cc8 returning error if any. +// Obtain info about the view count, forward count, reactions and recent viewers of one +// or more stories¹. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 CHANNEL_INVALID: The provided channel is invalid. +// 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_ID_EMPTY: You specified no story IDs. // // See https://core.telegram.org/method/stories.getStoriesViews for reference. func (c *Client) StoriesGetStoriesViews(ctx context.Context, request *StoriesGetStoriesViewsRequest) (*StoriesStoryViews, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_gen.go new file mode 100644 index 00000000..0600c764 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_gen.go @@ -0,0 +1,386 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoriesGetStoryReactionsListRequest represents TL type `stories.getStoryReactionsList#b9b2881f`. +// +// See https://core.telegram.org/method/stories.getStoryReactionsList for reference. +type StoriesGetStoryReactionsListRequest struct { + // Flags field of StoriesGetStoryReactionsListRequest. + Flags bin.Fields + // ForwardsFirst field of StoriesGetStoryReactionsListRequest. + ForwardsFirst bool + // Peer field of StoriesGetStoryReactionsListRequest. + Peer InputPeerClass + // ID field of StoriesGetStoryReactionsListRequest. + ID int + // Reaction field of StoriesGetStoryReactionsListRequest. + // + // Use SetReaction and GetReaction helpers. + Reaction ReactionClass + // Offset field of StoriesGetStoryReactionsListRequest. + // + // Use SetOffset and GetOffset helpers. + Offset string + // Limit field of StoriesGetStoryReactionsListRequest. + Limit int +} + +// StoriesGetStoryReactionsListRequestTypeID is TL type id of StoriesGetStoryReactionsListRequest. +const StoriesGetStoryReactionsListRequestTypeID = 0xb9b2881f + +// Ensuring interfaces in compile-time for StoriesGetStoryReactionsListRequest. +var ( + _ bin.Encoder = &StoriesGetStoryReactionsListRequest{} + _ bin.Decoder = &StoriesGetStoryReactionsListRequest{} + _ bin.BareEncoder = &StoriesGetStoryReactionsListRequest{} + _ bin.BareDecoder = &StoriesGetStoryReactionsListRequest{} +) + +func (g *StoriesGetStoryReactionsListRequest) Zero() bool { + if g == nil { + return true + } + if !(g.Flags.Zero()) { + return false + } + if !(g.ForwardsFirst == false) { + return false + } + if !(g.Peer == nil) { + return false + } + if !(g.ID == 0) { + return false + } + if !(g.Reaction == nil) { + return false + } + if !(g.Offset == "") { + return false + } + if !(g.Limit == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *StoriesGetStoryReactionsListRequest) String() string { + if g == nil { + return "StoriesGetStoryReactionsListRequest(nil)" + } + type Alias StoriesGetStoryReactionsListRequest + return fmt.Sprintf("StoriesGetStoryReactionsListRequest%+v", Alias(*g)) +} + +// FillFrom fills StoriesGetStoryReactionsListRequest from given interface. +func (g *StoriesGetStoryReactionsListRequest) FillFrom(from interface { + GetForwardsFirst() (value bool) + GetPeer() (value InputPeerClass) + GetID() (value int) + GetReaction() (value ReactionClass, ok bool) + GetOffset() (value string, ok bool) + GetLimit() (value int) +}) { + g.ForwardsFirst = from.GetForwardsFirst() + g.Peer = from.GetPeer() + g.ID = from.GetID() + if val, ok := from.GetReaction(); ok { + g.Reaction = val + } + + if val, ok := from.GetOffset(); ok { + g.Offset = val + } + + g.Limit = from.GetLimit() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoriesGetStoryReactionsListRequest) TypeID() uint32 { + return StoriesGetStoryReactionsListRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoriesGetStoryReactionsListRequest) TypeName() string { + return "stories.getStoryReactionsList" +} + +// TypeInfo returns info about TL type. +func (g *StoriesGetStoryReactionsListRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "stories.getStoryReactionsList", + ID: StoriesGetStoryReactionsListRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ForwardsFirst", + SchemaName: "forwards_first", + Null: !g.Flags.Has(2), + }, + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "Reaction", + SchemaName: "reaction", + Null: !g.Flags.Has(0), + }, + { + Name: "Offset", + SchemaName: "offset", + Null: !g.Flags.Has(1), + }, + { + Name: "Limit", + SchemaName: "limit", + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (g *StoriesGetStoryReactionsListRequest) SetFlags() { + if !(g.ForwardsFirst == false) { + g.Flags.Set(2) + } + if !(g.Reaction == nil) { + g.Flags.Set(0) + } + if !(g.Offset == "") { + g.Flags.Set(1) + } +} + +// Encode implements bin.Encoder. +func (g *StoriesGetStoryReactionsListRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode stories.getStoryReactionsList#b9b2881f as nil") + } + b.PutID(StoriesGetStoryReactionsListRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *StoriesGetStoryReactionsListRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode stories.getStoryReactionsList#b9b2881f as nil") + } + g.SetFlags() + if err := g.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.getStoryReactionsList#b9b2881f: field flags: %w", err) + } + if g.Peer == nil { + return fmt.Errorf("unable to encode stories.getStoryReactionsList#b9b2881f: field peer is nil") + } + if err := g.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.getStoryReactionsList#b9b2881f: field peer: %w", err) + } + b.PutInt(g.ID) + if g.Flags.Has(0) { + if g.Reaction == nil { + return fmt.Errorf("unable to encode stories.getStoryReactionsList#b9b2881f: field reaction is nil") + } + if err := g.Reaction.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.getStoryReactionsList#b9b2881f: field reaction: %w", err) + } + } + if g.Flags.Has(1) { + b.PutString(g.Offset) + } + b.PutInt(g.Limit) + return nil +} + +// Decode implements bin.Decoder. +func (g *StoriesGetStoryReactionsListRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode stories.getStoryReactionsList#b9b2881f to nil") + } + if err := b.ConsumeID(StoriesGetStoryReactionsListRequestTypeID); err != nil { + return fmt.Errorf("unable to decode stories.getStoryReactionsList#b9b2881f: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *StoriesGetStoryReactionsListRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode stories.getStoryReactionsList#b9b2881f to nil") + } + { + if err := g.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode stories.getStoryReactionsList#b9b2881f: field flags: %w", err) + } + } + g.ForwardsFirst = g.Flags.Has(2) + { + value, err := DecodeInputPeer(b) + if err != nil { + return fmt.Errorf("unable to decode stories.getStoryReactionsList#b9b2881f: field peer: %w", err) + } + g.Peer = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stories.getStoryReactionsList#b9b2881f: field id: %w", err) + } + g.ID = value + } + if g.Flags.Has(0) { + value, err := DecodeReaction(b) + if err != nil { + return fmt.Errorf("unable to decode stories.getStoryReactionsList#b9b2881f: field reaction: %w", err) + } + g.Reaction = value + } + if g.Flags.Has(1) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode stories.getStoryReactionsList#b9b2881f: field offset: %w", err) + } + g.Offset = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stories.getStoryReactionsList#b9b2881f: field limit: %w", err) + } + g.Limit = value + } + return nil +} + +// SetForwardsFirst sets value of ForwardsFirst conditional field. +func (g *StoriesGetStoryReactionsListRequest) SetForwardsFirst(value bool) { + if value { + g.Flags.Set(2) + g.ForwardsFirst = true + } else { + g.Flags.Unset(2) + g.ForwardsFirst = false + } +} + +// GetForwardsFirst returns value of ForwardsFirst conditional field. +func (g *StoriesGetStoryReactionsListRequest) GetForwardsFirst() (value bool) { + if g == nil { + return + } + return g.Flags.Has(2) +} + +// GetPeer returns value of Peer field. +func (g *StoriesGetStoryReactionsListRequest) GetPeer() (value InputPeerClass) { + if g == nil { + return + } + return g.Peer +} + +// GetID returns value of ID field. +func (g *StoriesGetStoryReactionsListRequest) GetID() (value int) { + if g == nil { + return + } + return g.ID +} + +// SetReaction sets value of Reaction conditional field. +func (g *StoriesGetStoryReactionsListRequest) SetReaction(value ReactionClass) { + g.Flags.Set(0) + g.Reaction = value +} + +// GetReaction returns value of Reaction conditional field and +// boolean which is true if field was set. +func (g *StoriesGetStoryReactionsListRequest) GetReaction() (value ReactionClass, ok bool) { + if g == nil { + return + } + if !g.Flags.Has(0) { + return value, false + } + return g.Reaction, true +} + +// SetOffset sets value of Offset conditional field. +func (g *StoriesGetStoryReactionsListRequest) SetOffset(value string) { + g.Flags.Set(1) + g.Offset = value +} + +// GetOffset returns value of Offset conditional field and +// boolean which is true if field was set. +func (g *StoriesGetStoryReactionsListRequest) GetOffset() (value string, ok bool) { + if g == nil { + return + } + if !g.Flags.Has(1) { + return value, false + } + return g.Offset, true +} + +// GetLimit returns value of Limit field. +func (g *StoriesGetStoryReactionsListRequest) GetLimit() (value int) { + if g == nil { + return + } + return g.Limit +} + +// StoriesGetStoryReactionsList invokes method stories.getStoryReactionsList#b9b2881f returning error if any. +// +// See https://core.telegram.org/method/stories.getStoryReactionsList for reference. +func (c *Client) StoriesGetStoryReactionsList(ctx context.Context, request *StoriesGetStoryReactionsListRequest) (*StoriesStoryReactionsList, error) { + var result StoriesStoryReactionsList + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_story_reactions_list_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_stories_get_story_views_list_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_get_story_views_list_gen.go index 6cc4ac25..0d8d1cce 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_get_story_views_list_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_get_story_views_list_gen.go @@ -32,26 +32,50 @@ var ( ) // StoriesGetStoryViewsListRequest represents TL type `stories.getStoryViewsList#7ed23c57`. +// Obtain the list of users that have viewed a specific story we posted¹ +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.getStoryViewsList for reference. type StoriesGetStoryViewsListRequest struct { - // Flags field of StoriesGetStoryViewsListRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // JustContacts field of StoriesGetStoryViewsListRequest. + // Whether to only fetch view reaction/views made by our contacts¹ + // + // Links: + // 1) https://core.telegram.org/api/contacts JustContacts bool - // ReactionsFirst field of StoriesGetStoryViewsListRequest. + // Whether to return storyView¹ info about users that reacted to the story (i.e. if set, + // the server will first sort results by view date as usual, and then also additionally + // sort the list by putting storyView²s with an associated reaction first in the list). + // + // Links: + // 1) https://core.telegram.org/constructor/storyView + // 2) https://core.telegram.org/constructor/storyView ReactionsFirst bool - // Peer field of StoriesGetStoryViewsListRequest. + // ForwardsFirst field of StoriesGetStoryViewsListRequest. + ForwardsFirst bool + // Peer where the story was posted Peer InputPeerClass - // Q field of StoriesGetStoryViewsListRequest. + // Search for specific peers // // Use SetQ and GetQ helpers. Q string - // ID field of StoriesGetStoryViewsListRequest. + // Story ID ID int - // Offset field of StoriesGetStoryViewsListRequest. + // Offset for pagination, obtained from stories.storyViewsList¹.next_offset + // + // Links: + // 1) https://core.telegram.org/constructor/stories.storyViewsList Offset string - // Limit field of StoriesGetStoryViewsListRequest. + // Maximum number of results to return, see pagination¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets Limit int } @@ -79,6 +103,9 @@ func (g *StoriesGetStoryViewsListRequest) Zero() bool { if !(g.ReactionsFirst == false) { return false } + if !(g.ForwardsFirst == false) { + return false + } if !(g.Peer == nil) { return false } @@ -111,6 +138,7 @@ func (g *StoriesGetStoryViewsListRequest) String() string { func (g *StoriesGetStoryViewsListRequest) FillFrom(from interface { GetJustContacts() (value bool) GetReactionsFirst() (value bool) + GetForwardsFirst() (value bool) GetPeer() (value InputPeerClass) GetQ() (value string, ok bool) GetID() (value int) @@ -119,6 +147,7 @@ func (g *StoriesGetStoryViewsListRequest) FillFrom(from interface { }) { g.JustContacts = from.GetJustContacts() g.ReactionsFirst = from.GetReactionsFirst() + g.ForwardsFirst = from.GetForwardsFirst() g.Peer = from.GetPeer() if val, ok := from.GetQ(); ok { g.Q = val @@ -162,6 +191,11 @@ func (g *StoriesGetStoryViewsListRequest) TypeInfo() tdp.Type { SchemaName: "reactions_first", Null: !g.Flags.Has(2), }, + { + Name: "ForwardsFirst", + SchemaName: "forwards_first", + Null: !g.Flags.Has(3), + }, { Name: "Peer", SchemaName: "peer", @@ -195,6 +229,9 @@ func (g *StoriesGetStoryViewsListRequest) SetFlags() { if !(g.ReactionsFirst == false) { g.Flags.Set(2) } + if !(g.ForwardsFirst == false) { + g.Flags.Set(3) + } if !(g.Q == "") { g.Flags.Set(1) } @@ -256,6 +293,7 @@ func (g *StoriesGetStoryViewsListRequest) DecodeBare(b *bin.Buffer) error { } g.JustContacts = g.Flags.Has(0) g.ReactionsFirst = g.Flags.Has(2) + g.ForwardsFirst = g.Flags.Has(3) { value, err := DecodeInputPeer(b) if err != nil { @@ -332,6 +370,25 @@ func (g *StoriesGetStoryViewsListRequest) GetReactionsFirst() (value bool) { return g.Flags.Has(2) } +// SetForwardsFirst sets value of ForwardsFirst conditional field. +func (g *StoriesGetStoryViewsListRequest) SetForwardsFirst(value bool) { + if value { + g.Flags.Set(3) + g.ForwardsFirst = true + } else { + g.Flags.Unset(3) + g.ForwardsFirst = false + } +} + +// GetForwardsFirst returns value of ForwardsFirst conditional field. +func (g *StoriesGetStoryViewsListRequest) GetForwardsFirst() (value bool) { + if g == nil { + return + } + return g.Flags.Has(3) +} + // GetPeer returns value of Peer field. func (g *StoriesGetStoryViewsListRequest) GetPeer() (value InputPeerClass) { if g == nil { @@ -383,6 +440,15 @@ func (g *StoriesGetStoryViewsListRequest) GetLimit() (value int) { } // StoriesGetStoryViewsList invokes method stories.getStoryViewsList#7ed23c57 returning error if any. +// Obtain the list of users that have viewed a specific story we posted¹ +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_ID_INVALID: The specified story ID is invalid. // // See https://core.telegram.org/method/stories.getStoryViewsList for reference. func (c *Client) StoriesGetStoryViewsList(ctx context.Context, request *StoriesGetStoryViewsListRequest) (*StoriesStoryViewsList, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_increment_story_views_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_increment_story_views_gen.go index 8925acb4..67ba12dd 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_increment_story_views_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_increment_story_views_gen.go @@ -32,12 +32,13 @@ var ( ) // StoriesIncrementStoryViewsRequest represents TL type `stories.incrementStoryViews#b2028afb`. +// Increment the view counter of one or more stories. // // See https://core.telegram.org/method/stories.incrementStoryViews for reference. type StoriesIncrementStoryViewsRequest struct { - // Peer field of StoriesIncrementStoryViewsRequest. + // Peer where the stories were posted. Peer InputPeerClass - // ID field of StoriesIncrementStoryViewsRequest. + // IDs of the stories (maximum 200 at a time). ID []int } @@ -206,6 +207,12 @@ func (i *StoriesIncrementStoryViewsRequest) GetID() (value []int) { } // StoriesIncrementStoryViews invokes method stories.incrementStoryViews#b2028afb returning error if any. +// Increment the view counter of one or more stories. +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORY_ID_EMPTY: You specified no story IDs. // // See https://core.telegram.org/method/stories.incrementStoryViews for reference. func (c *Client) StoriesIncrementStoryViews(ctx context.Context, request *StoriesIncrementStoryViewsRequest) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_peer_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_peer_stories_gen.go index fe6ad161..e3be4db7 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_peer_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_peer_stories_gen.go @@ -32,14 +32,18 @@ var ( ) // StoriesPeerStories represents TL type `stories.peerStories#cae68768`. +// Active story list¹ of a specific peer. +// +// Links: +// 1. https://core.telegram.org/api/stories#watching-stories // // See https://core.telegram.org/constructor/stories.peerStories for reference. type StoriesPeerStories struct { - // Stories field of StoriesPeerStories. + // Stories Stories PeerStories - // Chats field of StoriesPeerStories. + // Mentioned chats Chats []ChatClass - // Users field of StoriesPeerStories. + // Mentioned users Users []UserClass } diff --git a/vendor/github.com/gotd/td/tg/tl_stories_read_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_read_stories_gen.go index 49243c80..4be91483 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_read_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_read_stories_gen.go @@ -32,12 +32,17 @@ var ( ) // StoriesReadStoriesRequest represents TL type `stories.readStories#a556dac8`. +// Mark all stories up to a certain ID as read, for a given peer; will emit an +// updateReadStories¹ update to all logged-in sessions. +// +// Links: +// 1. https://core.telegram.org/constructor/updateReadStories // // See https://core.telegram.org/method/stories.readStories for reference. type StoriesReadStoriesRequest struct { - // Peer field of StoriesReadStoriesRequest. + // The peer whose stories should be marked as read. Peer InputPeerClass - // MaxID field of StoriesReadStoriesRequest. + // Mark all stories up to and including this ID as read MaxID int } @@ -193,6 +198,17 @@ func (r *StoriesReadStoriesRequest) GetMaxID() (value int) { } // StoriesReadStories invokes method stories.readStories#a556dac8 returning error if any. +// Mark all stories up to a certain ID as read, for a given peer; will emit an +// updateReadStories¹ update to all logged-in sessions. +// +// Links: +// 1. https://core.telegram.org/constructor/updateReadStories +// +// Possible errors: +// +// 400 MAX_ID_INVALID: The provided max ID is invalid. +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 STORIES_NEVER_CREATED: // // See https://core.telegram.org/method/stories.readStories for reference. func (c *Client) StoriesReadStories(ctx context.Context, request *StoriesReadStoriesRequest) ([]int, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_report_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_report_gen.go index e71e90bf..bca9a163 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_report_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_report_gen.go @@ -32,16 +32,17 @@ var ( ) // StoriesReportRequest represents TL type `stories.report#1923fa8c`. +// Report a story. // // See https://core.telegram.org/method/stories.report for reference. type StoriesReportRequest struct { - // Peer field of StoriesReportRequest. + // The peer that uploaded the story. Peer InputPeerClass - // ID field of StoriesReportRequest. + // IDs of the stories to report. ID []int - // Reason field of StoriesReportRequest. + // Why are these storeis being reported. Reason ReportReasonClass - // Message field of StoriesReportRequest. + // Comment for report moderation Message string } @@ -265,6 +266,11 @@ func (r *StoriesReportRequest) GetMessage() (value string) { } // StoriesReport invokes method stories.report#1923fa8c returning error if any. +// Report a story. +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.report for reference. func (c *Client) StoriesReport(ctx context.Context, request *StoriesReportRequest) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_send_reaction_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_send_reaction_gen.go index 8ec97848..875f1ecc 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_send_reaction_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_send_reaction_gen.go @@ -32,18 +32,25 @@ var ( ) // StoriesSendReactionRequest represents TL type `stories.sendReaction#7fd736b2`. +// React to a story. // // See https://core.telegram.org/method/stories.sendReaction for reference. type StoriesSendReactionRequest struct { - // Flags field of StoriesSendReactionRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // AddToRecent field of StoriesSendReactionRequest. + // Whether to add this reaction to the recent reactions list »¹. + // + // Links: + // 1) https://core.telegram.org/api/reactions#recent-reactions AddToRecent bool - // Peer field of StoriesSendReactionRequest. + // The peer that sent the story Peer InputPeerClass - // StoryID field of StoriesSendReactionRequest. + // ID of the story to react to StoryID int - // Reaction field of StoriesSendReactionRequest. + // Reaction Reaction ReactionClass } @@ -278,6 +285,13 @@ func (s *StoriesSendReactionRequest) GetReaction() (value ReactionClass) { } // StoriesSendReaction invokes method stories.sendReaction#7fd736b2 returning error if any. +// React to a story. +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 REACTION_INVALID: The specified reaction is invalid. +// 400 STORY_ID_EMPTY: You specified no story IDs. // // See https://core.telegram.org/method/stories.sendReaction for reference. func (c *Client) StoriesSendReaction(ctx context.Context, request *StoriesSendReactionRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_send_story_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_send_story_gen.go index e08e4930..13074ba8 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_send_story_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_send_story_gen.go @@ -31,44 +31,82 @@ var ( _ = tdjson.Encoder{} ) -// StoriesSendStoryRequest represents TL type `stories.sendStory#bcb73644`. +// StoriesSendStoryRequest represents TL type `stories.sendStory#e4e6694b`. +// Uploads a Telegram Story¹. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/method/stories.sendStory for reference. type StoriesSendStoryRequest struct { - // Flags field of StoriesSendStoryRequest. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Pinned field of StoriesSendStoryRequest. + // Whether to add the story to the profile automatically upon expiration. If not set, the + // story will only be added to the archive, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/stories Pinned bool - // Noforwards field of StoriesSendStoryRequest. + // If set, disables forwards, screenshots, and downloads. Noforwards bool - // Peer field of StoriesSendStoryRequest. + // Set this flag when reposting stories with fwd_from_id+fwd_from_id, if the media was + // modified before reposting. + FwdModified bool + // The peer to send the story as. Peer InputPeerClass - // Media field of StoriesSendStoryRequest. + // The story media. Media InputMediaClass - // MediaAreas field of StoriesSendStoryRequest. + // Media areas¹ associated to the story, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/api/stories#media-areas + // 2) https://core.telegram.org/api/stories#media-areas // // Use SetMediaAreas and GetMediaAreas helpers. MediaAreas []MediaAreaClass - // Caption field of StoriesSendStoryRequest. + // Story caption. // // Use SetCaption and GetCaption helpers. Caption string - // Entities field of StoriesSendStoryRequest. + // Message entities for styled text¹, if allowed by the stories_entities client + // configuration parameter »². + // + // Links: + // 1) https://core.telegram.org/api/entities + // 2) https://core.telegram.org/api/config#stories-entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // PrivacyRules field of StoriesSendStoryRequest. + // Privacy rules¹ for the story, indicating who can or can't view the story. + // + // Links: + // 1) https://core.telegram.org/api/privacy PrivacyRules []InputPrivacyRuleClass - // RandomID field of StoriesSendStoryRequest. + // Unique client message ID required to prevent message resending. RandomID int64 - // Period field of StoriesSendStoryRequest. + // Period after which the story is moved to archive (and to the profile if pinned is set) + // in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram + // Premium users, and 86400 otherwise. // // Use SetPeriod and GetPeriod helpers. Period int + // If set, indicates that this story is a repost of story with ID fwd_from_story posted + // by the peer in fwd_from_id. + // + // Use SetFwdFromID and GetFwdFromID helpers. + FwdFromID InputPeerClass + // If set, indicates that this story is a repost of story with ID fwd_from_story posted + // by the peer in fwd_from_id. + // + // Use SetFwdFromStory and GetFwdFromStory helpers. + FwdFromStory int } // StoriesSendStoryRequestTypeID is TL type id of StoriesSendStoryRequest. -const StoriesSendStoryRequestTypeID = 0xbcb73644 +const StoriesSendStoryRequestTypeID = 0xe4e6694b // Ensuring interfaces in compile-time for StoriesSendStoryRequest. var ( @@ -91,6 +129,9 @@ func (s *StoriesSendStoryRequest) Zero() bool { if !(s.Noforwards == false) { return false } + if !(s.FwdModified == false) { + return false + } if !(s.Peer == nil) { return false } @@ -115,6 +156,12 @@ func (s *StoriesSendStoryRequest) Zero() bool { if !(s.Period == 0) { return false } + if !(s.FwdFromID == nil) { + return false + } + if !(s.FwdFromStory == 0) { + return false + } return true } @@ -132,6 +179,7 @@ func (s *StoriesSendStoryRequest) String() string { func (s *StoriesSendStoryRequest) FillFrom(from interface { GetPinned() (value bool) GetNoforwards() (value bool) + GetFwdModified() (value bool) GetPeer() (value InputPeerClass) GetMedia() (value InputMediaClass) GetMediaAreas() (value []MediaAreaClass, ok bool) @@ -140,9 +188,12 @@ func (s *StoriesSendStoryRequest) FillFrom(from interface { GetPrivacyRules() (value []InputPrivacyRuleClass) GetRandomID() (value int64) GetPeriod() (value int, ok bool) + GetFwdFromID() (value InputPeerClass, ok bool) + GetFwdFromStory() (value int, ok bool) }) { s.Pinned = from.GetPinned() s.Noforwards = from.GetNoforwards() + s.FwdModified = from.GetFwdModified() s.Peer = from.GetPeer() s.Media = from.GetMedia() if val, ok := from.GetMediaAreas(); ok { @@ -163,6 +214,14 @@ func (s *StoriesSendStoryRequest) FillFrom(from interface { s.Period = val } + if val, ok := from.GetFwdFromID(); ok { + s.FwdFromID = val + } + + if val, ok := from.GetFwdFromStory(); ok { + s.FwdFromStory = val + } + } // TypeID returns type id in TL schema. @@ -198,6 +257,11 @@ func (s *StoriesSendStoryRequest) TypeInfo() tdp.Type { SchemaName: "noforwards", Null: !s.Flags.Has(4), }, + { + Name: "FwdModified", + SchemaName: "fwd_modified", + Null: !s.Flags.Has(7), + }, { Name: "Peer", SchemaName: "peer", @@ -234,6 +298,16 @@ func (s *StoriesSendStoryRequest) TypeInfo() tdp.Type { SchemaName: "period", Null: !s.Flags.Has(3), }, + { + Name: "FwdFromID", + SchemaName: "fwd_from_id", + Null: !s.Flags.Has(6), + }, + { + Name: "FwdFromStory", + SchemaName: "fwd_from_story", + Null: !s.Flags.Has(6), + }, } return typ } @@ -246,6 +320,9 @@ func (s *StoriesSendStoryRequest) SetFlags() { if !(s.Noforwards == false) { s.Flags.Set(4) } + if !(s.FwdModified == false) { + s.Flags.Set(7) + } if !(s.MediaAreas == nil) { s.Flags.Set(5) } @@ -258,12 +335,18 @@ func (s *StoriesSendStoryRequest) SetFlags() { if !(s.Period == 0) { s.Flags.Set(3) } + if !(s.FwdFromID == nil) { + s.Flags.Set(6) + } + if !(s.FwdFromStory == 0) { + s.Flags.Set(6) + } } // Encode implements bin.Encoder. func (s *StoriesSendStoryRequest) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stories.sendStory#bcb73644 as nil") + return fmt.Errorf("can't encode stories.sendStory#e4e6694b as nil") } b.PutID(StoriesSendStoryRequestTypeID) return s.EncodeBare(b) @@ -272,32 +355,32 @@ func (s *StoriesSendStoryRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StoriesSendStoryRequest) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stories.sendStory#bcb73644 as nil") + return fmt.Errorf("can't encode stories.sendStory#e4e6694b as nil") } s.SetFlags() if err := s.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field flags: %w", err) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field flags: %w", err) } if s.Peer == nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field peer is nil") + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field peer is nil") } if err := s.Peer.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field peer: %w", err) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field peer: %w", err) } if s.Media == nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field media is nil") + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field media is nil") } if err := s.Media.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field media: %w", err) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field media: %w", err) } if s.Flags.Has(5) { b.PutVectorHeader(len(s.MediaAreas)) for idx, v := range s.MediaAreas { if v == nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field media_areas element with index %d is nil", idx) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field media_areas element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field media_areas element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field media_areas element with index %d: %w", idx, err) } } } @@ -308,36 +391,47 @@ func (s *StoriesSendStoryRequest) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(s.Entities)) for idx, v := range s.Entities { if v == nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field entities element with index %d: %w", idx, err) } } } b.PutVectorHeader(len(s.PrivacyRules)) for idx, v := range s.PrivacyRules { if v == nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field privacy_rules element with index %d is nil", idx) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field privacy_rules element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.sendStory#bcb73644: field privacy_rules element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field privacy_rules element with index %d: %w", idx, err) } } b.PutLong(s.RandomID) if s.Flags.Has(3) { b.PutInt(s.Period) } + if s.Flags.Has(6) { + if s.FwdFromID == nil { + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field fwd_from_id is nil") + } + if err := s.FwdFromID.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.sendStory#e4e6694b: field fwd_from_id: %w", err) + } + } + if s.Flags.Has(6) { + b.PutInt(s.FwdFromStory) + } return nil } // Decode implements bin.Decoder. func (s *StoriesSendStoryRequest) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stories.sendStory#bcb73644 to nil") + return fmt.Errorf("can't decode stories.sendStory#e4e6694b to nil") } if err := b.ConsumeID(StoriesSendStoryRequestTypeID); err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: %w", err) } return s.DecodeBare(b) } @@ -345,33 +439,34 @@ func (s *StoriesSendStoryRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StoriesSendStoryRequest) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stories.sendStory#bcb73644 to nil") + return fmt.Errorf("can't decode stories.sendStory#e4e6694b to nil") } { if err := s.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field flags: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field flags: %w", err) } } s.Pinned = s.Flags.Has(2) s.Noforwards = s.Flags.Has(4) + s.FwdModified = s.Flags.Has(7) { value, err := DecodeInputPeer(b) if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field peer: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field peer: %w", err) } s.Peer = value } { value, err := DecodeInputMedia(b) if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field media: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field media: %w", err) } s.Media = value } if s.Flags.Has(5) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field media_areas: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field media_areas: %w", err) } if headerLen > 0 { @@ -380,7 +475,7 @@ func (s *StoriesSendStoryRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMediaArea(b) if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field media_areas: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field media_areas: %w", err) } s.MediaAreas = append(s.MediaAreas, value) } @@ -388,14 +483,14 @@ func (s *StoriesSendStoryRequest) DecodeBare(b *bin.Buffer) error { if s.Flags.Has(0) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field caption: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field caption: %w", err) } s.Caption = value } if s.Flags.Has(1) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field entities: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field entities: %w", err) } if headerLen > 0 { @@ -404,7 +499,7 @@ func (s *StoriesSendStoryRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field entities: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field entities: %w", err) } s.Entities = append(s.Entities, value) } @@ -412,7 +507,7 @@ func (s *StoriesSendStoryRequest) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field privacy_rules: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field privacy_rules: %w", err) } if headerLen > 0 { @@ -421,7 +516,7 @@ func (s *StoriesSendStoryRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeInputPrivacyRule(b) if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field privacy_rules: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field privacy_rules: %w", err) } s.PrivacyRules = append(s.PrivacyRules, value) } @@ -429,17 +524,31 @@ func (s *StoriesSendStoryRequest) DecodeBare(b *bin.Buffer) error { { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field random_id: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field random_id: %w", err) } s.RandomID = value } if s.Flags.Has(3) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stories.sendStory#bcb73644: field period: %w", err) + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field period: %w", err) } s.Period = value } + if s.Flags.Has(6) { + value, err := DecodeInputPeer(b) + if err != nil { + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field fwd_from_id: %w", err) + } + s.FwdFromID = value + } + if s.Flags.Has(6) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stories.sendStory#e4e6694b: field fwd_from_story: %w", err) + } + s.FwdFromStory = value + } return nil } @@ -481,6 +590,25 @@ func (s *StoriesSendStoryRequest) GetNoforwards() (value bool) { return s.Flags.Has(4) } +// SetFwdModified sets value of FwdModified conditional field. +func (s *StoriesSendStoryRequest) SetFwdModified(value bool) { + if value { + s.Flags.Set(7) + s.FwdModified = true + } else { + s.Flags.Unset(7) + s.FwdModified = false + } +} + +// GetFwdModified returns value of FwdModified conditional field. +func (s *StoriesSendStoryRequest) GetFwdModified() (value bool) { + if s == nil { + return + } + return s.Flags.Has(7) +} + // GetPeer returns value of Peer field. func (s *StoriesSendStoryRequest) GetPeer() (value InputPeerClass) { if s == nil { @@ -585,6 +713,42 @@ func (s *StoriesSendStoryRequest) GetPeriod() (value int, ok bool) { return s.Period, true } +// SetFwdFromID sets value of FwdFromID conditional field. +func (s *StoriesSendStoryRequest) SetFwdFromID(value InputPeerClass) { + s.Flags.Set(6) + s.FwdFromID = value +} + +// GetFwdFromID returns value of FwdFromID conditional field and +// boolean which is true if field was set. +func (s *StoriesSendStoryRequest) GetFwdFromID() (value InputPeerClass, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(6) { + return value, false + } + return s.FwdFromID, true +} + +// SetFwdFromStory sets value of FwdFromStory conditional field. +func (s *StoriesSendStoryRequest) SetFwdFromStory(value int) { + s.Flags.Set(6) + s.FwdFromStory = value +} + +// GetFwdFromStory returns value of FwdFromStory conditional field and +// boolean which is true if field was set. +func (s *StoriesSendStoryRequest) GetFwdFromStory() (value int, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(6) { + return value, false + } + return s.FwdFromStory, true +} + // MapMediaAreas returns field MediaAreas wrapped in MediaAreaClassArray helper. func (s *StoriesSendStoryRequest) MapMediaAreas() (value MediaAreaClassArray, ok bool) { if !s.Flags.Has(5) { @@ -606,7 +770,24 @@ func (s *StoriesSendStoryRequest) MapPrivacyRules() (value InputPrivacyRuleClass return InputPrivacyRuleClassArray(s.PrivacyRules) } -// StoriesSendStory invokes method stories.sendStory#bcb73644 returning error if any. +// StoriesSendStory invokes method stories.sendStory#e4e6694b returning error if any. +// Uploads a Telegram Story¹. +// +// Links: +// 1. https://core.telegram.org/api/stories +// +// Possible errors: +// +// 400 IMAGE_PROCESS_FAILED: Failure while processing image. +// 400 MEDIA_EMPTY: The provided media object is invalid. +// 400 MEDIA_FILE_INVALID: The specified media file is invalid. +// 400 MEDIA_TYPE_INVALID: The specified media type cannot be used in stories. +// 400 MEDIA_VIDEO_STORY_MISSING: +// 400 PEER_ID_INVALID: The provided peer id is invalid. +// 400 PREMIUM_ACCOUNT_REQUIRED: A premium account is required to execute this action. +// 400 STORIES_TOO_MUCH: You have hit the maximum active stories limit as specified by the story_expiring_limit_* client configuration parameters: you should buy a Premium subscription, delete an active story, or wait for the oldest story to expire. +// 400 STORY_PERIOD_INVALID: The specified story period is invalid for this account. +// 400 VENUE_ID_INVALID: The specified venue ID is invalid. // // See https://core.telegram.org/method/stories.sendStory for reference. func (c *Client) StoriesSendStory(ctx context.Context, request *StoriesSendStoryRequest) (UpdatesClass, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_stealth_mode_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_stealth_mode_gen.go index 92023fd2..5a48fdbc 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_stealth_mode_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_stealth_mode_gen.go @@ -32,16 +32,23 @@ var ( ) // StoriesStealthMode represents TL type `storiesStealthMode#712e27fd`. +// Information about the current stealth mode¹ session. +// +// Links: +// 1. https://core.telegram.org/api/stories#stealth-mode // // See https://core.telegram.org/constructor/storiesStealthMode for reference. type StoriesStealthMode struct { - // Flags field of StoriesStealthMode. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // ActiveUntilDate field of StoriesStealthMode. + // The date up to which stealth mode will be active. // // Use SetActiveUntilDate and GetActiveUntilDate helpers. ActiveUntilDate int - // CooldownUntilDate field of StoriesStealthMode. + // The date starting from which the user will be allowed to re-enable stealth mode again. // // Use SetCooldownUntilDate and GetCooldownUntilDate helpers. CooldownUntilDate int diff --git a/vendor/github.com/gotd/td/tg/tl_stories_stories_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_stories_gen.go index 90826ff4..67f14e8b 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_stories_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_stories_gen.go @@ -32,16 +32,20 @@ var ( ) // StoriesStories represents TL type `stories.stories#5dd8c3c8`. +// List of stories¹ +// +// Links: +// 1. https://core.telegram.org/api/stories#pinned-or-archived-stories // // See https://core.telegram.org/constructor/stories.stories for reference. type StoriesStories struct { - // Count field of StoriesStories. + // Total number of stories that can be fetched Count int - // Stories field of StoriesStories. + // Stories Stories []StoryItemClass - // Chats field of StoriesStories. + // Mentioned chats Chats []ChatClass - // Users field of StoriesStories. + // Mentioned users Users []UserClass } diff --git a/vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_gen.go new file mode 100644 index 00000000..da005f17 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_gen.go @@ -0,0 +1,377 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoriesStoryReactionsList represents TL type `stories.storyReactionsList#aa5f789c`. +// +// See https://core.telegram.org/constructor/stories.storyReactionsList for reference. +type StoriesStoryReactionsList struct { + // Flags field of StoriesStoryReactionsList. + Flags bin.Fields + // Count field of StoriesStoryReactionsList. + Count int + // Reactions field of StoriesStoryReactionsList. + Reactions []StoryReactionClass + // Chats field of StoriesStoryReactionsList. + Chats []ChatClass + // Users field of StoriesStoryReactionsList. + Users []UserClass + // NextOffset field of StoriesStoryReactionsList. + // + // Use SetNextOffset and GetNextOffset helpers. + NextOffset string +} + +// StoriesStoryReactionsListTypeID is TL type id of StoriesStoryReactionsList. +const StoriesStoryReactionsListTypeID = 0xaa5f789c + +// Ensuring interfaces in compile-time for StoriesStoryReactionsList. +var ( + _ bin.Encoder = &StoriesStoryReactionsList{} + _ bin.Decoder = &StoriesStoryReactionsList{} + _ bin.BareEncoder = &StoriesStoryReactionsList{} + _ bin.BareDecoder = &StoriesStoryReactionsList{} +) + +func (s *StoriesStoryReactionsList) Zero() bool { + if s == nil { + return true + } + if !(s.Flags.Zero()) { + return false + } + if !(s.Count == 0) { + return false + } + if !(s.Reactions == nil) { + return false + } + if !(s.Chats == nil) { + return false + } + if !(s.Users == nil) { + return false + } + if !(s.NextOffset == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoriesStoryReactionsList) String() string { + if s == nil { + return "StoriesStoryReactionsList(nil)" + } + type Alias StoriesStoryReactionsList + return fmt.Sprintf("StoriesStoryReactionsList%+v", Alias(*s)) +} + +// FillFrom fills StoriesStoryReactionsList from given interface. +func (s *StoriesStoryReactionsList) FillFrom(from interface { + GetCount() (value int) + GetReactions() (value []StoryReactionClass) + GetChats() (value []ChatClass) + GetUsers() (value []UserClass) + GetNextOffset() (value string, ok bool) +}) { + s.Count = from.GetCount() + s.Reactions = from.GetReactions() + s.Chats = from.GetChats() + s.Users = from.GetUsers() + if val, ok := from.GetNextOffset(); ok { + s.NextOffset = val + } + +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoriesStoryReactionsList) TypeID() uint32 { + return StoriesStoryReactionsListTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoriesStoryReactionsList) TypeName() string { + return "stories.storyReactionsList" +} + +// TypeInfo returns info about TL type. +func (s *StoriesStoryReactionsList) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "stories.storyReactionsList", + ID: StoriesStoryReactionsListTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Count", + SchemaName: "count", + }, + { + Name: "Reactions", + SchemaName: "reactions", + }, + { + Name: "Chats", + SchemaName: "chats", + }, + { + Name: "Users", + SchemaName: "users", + }, + { + Name: "NextOffset", + SchemaName: "next_offset", + Null: !s.Flags.Has(0), + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (s *StoriesStoryReactionsList) SetFlags() { + if !(s.NextOffset == "") { + s.Flags.Set(0) + } +} + +// Encode implements bin.Encoder. +func (s *StoriesStoryReactionsList) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode stories.storyReactionsList#aa5f789c as nil") + } + b.PutID(StoriesStoryReactionsListTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoriesStoryReactionsList) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode stories.storyReactionsList#aa5f789c as nil") + } + s.SetFlags() + if err := s.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.storyReactionsList#aa5f789c: field flags: %w", err) + } + b.PutInt(s.Count) + b.PutVectorHeader(len(s.Reactions)) + for idx, v := range s.Reactions { + if v == nil { + return fmt.Errorf("unable to encode stories.storyReactionsList#aa5f789c: field reactions element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.storyReactionsList#aa5f789c: field reactions element with index %d: %w", idx, err) + } + } + b.PutVectorHeader(len(s.Chats)) + for idx, v := range s.Chats { + if v == nil { + return fmt.Errorf("unable to encode stories.storyReactionsList#aa5f789c: field chats element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.storyReactionsList#aa5f789c: field chats element with index %d: %w", idx, err) + } + } + b.PutVectorHeader(len(s.Users)) + for idx, v := range s.Users { + if v == nil { + return fmt.Errorf("unable to encode stories.storyReactionsList#aa5f789c: field users element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.storyReactionsList#aa5f789c: field users element with index %d: %w", idx, err) + } + } + if s.Flags.Has(0) { + b.PutString(s.NextOffset) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoriesStoryReactionsList) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode stories.storyReactionsList#aa5f789c to nil") + } + if err := b.ConsumeID(StoriesStoryReactionsListTypeID); err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoriesStoryReactionsList) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode stories.storyReactionsList#aa5f789c to nil") + } + { + if err := s.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field flags: %w", err) + } + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field count: %w", err) + } + s.Count = value + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field reactions: %w", err) + } + + if headerLen > 0 { + s.Reactions = make([]StoryReactionClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeStoryReaction(b) + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field reactions: %w", err) + } + s.Reactions = append(s.Reactions, value) + } + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field chats: %w", err) + } + + if headerLen > 0 { + s.Chats = make([]ChatClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeChat(b) + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field chats: %w", err) + } + s.Chats = append(s.Chats, value) + } + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field users: %w", err) + } + + if headerLen > 0 { + s.Users = make([]UserClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeUser(b) + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field users: %w", err) + } + s.Users = append(s.Users, value) + } + } + if s.Flags.Has(0) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode stories.storyReactionsList#aa5f789c: field next_offset: %w", err) + } + s.NextOffset = value + } + return nil +} + +// GetCount returns value of Count field. +func (s *StoriesStoryReactionsList) GetCount() (value int) { + if s == nil { + return + } + return s.Count +} + +// GetReactions returns value of Reactions field. +func (s *StoriesStoryReactionsList) GetReactions() (value []StoryReactionClass) { + if s == nil { + return + } + return s.Reactions +} + +// GetChats returns value of Chats field. +func (s *StoriesStoryReactionsList) GetChats() (value []ChatClass) { + if s == nil { + return + } + return s.Chats +} + +// GetUsers returns value of Users field. +func (s *StoriesStoryReactionsList) GetUsers() (value []UserClass) { + if s == nil { + return + } + return s.Users +} + +// SetNextOffset sets value of NextOffset conditional field. +func (s *StoriesStoryReactionsList) SetNextOffset(value string) { + s.Flags.Set(0) + s.NextOffset = value +} + +// GetNextOffset returns value of NextOffset conditional field and +// boolean which is true if field was set. +func (s *StoriesStoryReactionsList) GetNextOffset() (value string, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(0) { + return value, false + } + return s.NextOffset, true +} + +// MapReactions returns field Reactions wrapped in StoryReactionClassArray helper. +func (s *StoriesStoryReactionsList) MapReactions() (value StoryReactionClassArray) { + return StoryReactionClassArray(s.Reactions) +} + +// MapChats returns field Chats wrapped in ChatClassArray helper. +func (s *StoriesStoryReactionsList) MapChats() (value ChatClassArray) { + return ChatClassArray(s.Chats) +} + +// MapUsers returns field Users wrapped in UserClassArray helper. +func (s *StoriesStoryReactionsList) MapUsers() (value UserClassArray) { + return UserClassArray(s.Users) +} diff --git a/vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_stories_story_reactions_list_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_stories_story_views_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_story_views_gen.go index 857e19b0..10f8adb6 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_story_views_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_story_views_gen.go @@ -32,12 +32,16 @@ var ( ) // StoriesStoryViews represents TL type `stories.storyViews#de9eed1d`. +// Reaction and view counters for a list of stories¹ +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/stories.storyViews for reference. type StoriesStoryViews struct { - // Views field of StoriesStoryViews. + // View date and reaction information of multiple stories Views []StoryViews - // Users field of StoriesStoryViews. + // Mentioned users Users []UserClass } diff --git a/vendor/github.com/gotd/td/tg/tl_stories_story_views_list_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_story_views_list_gen.go index 9dea76a3..b53bbe50 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_story_views_list_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_story_views_list_gen.go @@ -31,28 +31,41 @@ var ( _ = tdjson.Encoder{} ) -// StoriesStoryViewsList represents TL type `stories.storyViewsList#46e9b9ec`. +// StoriesStoryViewsList represents TL type `stories.storyViewsList#59d78fc5`. +// Reaction and view counters for a story¹ +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/stories.storyViewsList for reference. type StoriesStoryViewsList struct { - // Flags field of StoriesStoryViewsList. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Count field of StoriesStoryViewsList. + // Total number of results that can be fetched Count int - // ReactionsCount field of StoriesStoryViewsList. + // ViewsCount field of StoriesStoryViewsList. + ViewsCount int + // ForwardsCount field of StoriesStoryViewsList. + ForwardsCount int + // Number of reactions that were added to the story ReactionsCount int - // Views field of StoriesStoryViewsList. - Views []StoryView - // Users field of StoriesStoryViewsList. + // Story view date and reaction information + Views []StoryViewClass + // Chats field of StoriesStoryViewsList. + Chats []ChatClass + // Mentioned users Users []UserClass - // NextOffset field of StoriesStoryViewsList. + // Offset for pagination // // Use SetNextOffset and GetNextOffset helpers. NextOffset string } // StoriesStoryViewsListTypeID is TL type id of StoriesStoryViewsList. -const StoriesStoryViewsListTypeID = 0x46e9b9ec +const StoriesStoryViewsListTypeID = 0x59d78fc5 // Ensuring interfaces in compile-time for StoriesStoryViewsList. var ( @@ -72,12 +85,21 @@ func (s *StoriesStoryViewsList) Zero() bool { if !(s.Count == 0) { return false } + if !(s.ViewsCount == 0) { + return false + } + if !(s.ForwardsCount == 0) { + return false + } if !(s.ReactionsCount == 0) { return false } if !(s.Views == nil) { return false } + if !(s.Chats == nil) { + return false + } if !(s.Users == nil) { return false } @@ -100,14 +122,20 @@ func (s *StoriesStoryViewsList) String() string { // FillFrom fills StoriesStoryViewsList from given interface. func (s *StoriesStoryViewsList) FillFrom(from interface { GetCount() (value int) + GetViewsCount() (value int) + GetForwardsCount() (value int) GetReactionsCount() (value int) - GetViews() (value []StoryView) + GetViews() (value []StoryViewClass) + GetChats() (value []ChatClass) GetUsers() (value []UserClass) GetNextOffset() (value string, ok bool) }) { s.Count = from.GetCount() + s.ViewsCount = from.GetViewsCount() + s.ForwardsCount = from.GetForwardsCount() s.ReactionsCount = from.GetReactionsCount() s.Views = from.GetViews() + s.Chats = from.GetChats() s.Users = from.GetUsers() if val, ok := from.GetNextOffset(); ok { s.NextOffset = val @@ -142,6 +170,14 @@ func (s *StoriesStoryViewsList) TypeInfo() tdp.Type { Name: "Count", SchemaName: "count", }, + { + Name: "ViewsCount", + SchemaName: "views_count", + }, + { + Name: "ForwardsCount", + SchemaName: "forwards_count", + }, { Name: "ReactionsCount", SchemaName: "reactions_count", @@ -150,6 +186,10 @@ func (s *StoriesStoryViewsList) TypeInfo() tdp.Type { Name: "Views", SchemaName: "views", }, + { + Name: "Chats", + SchemaName: "chats", + }, { Name: "Users", SchemaName: "users", @@ -173,7 +213,7 @@ func (s *StoriesStoryViewsList) SetFlags() { // Encode implements bin.Encoder. func (s *StoriesStoryViewsList) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stories.storyViewsList#46e9b9ec as nil") + return fmt.Errorf("can't encode stories.storyViewsList#59d78fc5 as nil") } b.PutID(StoriesStoryViewsListTypeID) return s.EncodeBare(b) @@ -182,27 +222,41 @@ func (s *StoriesStoryViewsList) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StoriesStoryViewsList) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stories.storyViewsList#46e9b9ec as nil") + return fmt.Errorf("can't encode stories.storyViewsList#59d78fc5 as nil") } s.SetFlags() if err := s.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.storyViewsList#46e9b9ec: field flags: %w", err) + return fmt.Errorf("unable to encode stories.storyViewsList#59d78fc5: field flags: %w", err) } b.PutInt(s.Count) + b.PutInt(s.ViewsCount) + b.PutInt(s.ForwardsCount) b.PutInt(s.ReactionsCount) b.PutVectorHeader(len(s.Views)) for idx, v := range s.Views { + if v == nil { + return fmt.Errorf("unable to encode stories.storyViewsList#59d78fc5: field views element with index %d is nil", idx) + } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.storyViewsList#46e9b9ec: field views element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stories.storyViewsList#59d78fc5: field views element with index %d: %w", idx, err) + } + } + b.PutVectorHeader(len(s.Chats)) + for idx, v := range s.Chats { + if v == nil { + return fmt.Errorf("unable to encode stories.storyViewsList#59d78fc5: field chats element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode stories.storyViewsList#59d78fc5: field chats element with index %d: %w", idx, err) } } b.PutVectorHeader(len(s.Users)) for idx, v := range s.Users { if v == nil { - return fmt.Errorf("unable to encode stories.storyViewsList#46e9b9ec: field users element with index %d is nil", idx) + return fmt.Errorf("unable to encode stories.storyViewsList#59d78fc5: field users element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode stories.storyViewsList#46e9b9ec: field users element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stories.storyViewsList#59d78fc5: field users element with index %d: %w", idx, err) } } if s.Flags.Has(0) { @@ -214,10 +268,10 @@ func (s *StoriesStoryViewsList) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StoriesStoryViewsList) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stories.storyViewsList#46e9b9ec to nil") + return fmt.Errorf("can't decode stories.storyViewsList#59d78fc5 to nil") } if err := b.ConsumeID(StoriesStoryViewsListTypeID); err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: %w", err) } return s.DecodeBare(b) } @@ -225,40 +279,54 @@ func (s *StoriesStoryViewsList) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StoriesStoryViewsList) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stories.storyViewsList#46e9b9ec to nil") + return fmt.Errorf("can't decode stories.storyViewsList#59d78fc5 to nil") } { if err := s.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field flags: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field flags: %w", err) } } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field count: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field count: %w", err) } s.Count = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field reactions_count: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field views_count: %w", err) + } + s.ViewsCount = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field forwards_count: %w", err) + } + s.ForwardsCount = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field reactions_count: %w", err) } s.ReactionsCount = value } { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field views: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field views: %w", err) } if headerLen > 0 { - s.Views = make([]StoryView, 0, headerLen%bin.PreallocateLimit) + s.Views = make([]StoryViewClass, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - var value StoryView - if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field views: %w", err) + value, err := DecodeStoryView(b) + if err != nil { + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field views: %w", err) } s.Views = append(s.Views, value) } @@ -266,7 +334,24 @@ func (s *StoriesStoryViewsList) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field users: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field chats: %w", err) + } + + if headerLen > 0 { + s.Chats = make([]ChatClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeChat(b) + if err != nil { + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field chats: %w", err) + } + s.Chats = append(s.Chats, value) + } + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field users: %w", err) } if headerLen > 0 { @@ -275,7 +360,7 @@ func (s *StoriesStoryViewsList) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeUser(b) if err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field users: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field users: %w", err) } s.Users = append(s.Users, value) } @@ -283,7 +368,7 @@ func (s *StoriesStoryViewsList) DecodeBare(b *bin.Buffer) error { if s.Flags.Has(0) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stories.storyViewsList#46e9b9ec: field next_offset: %w", err) + return fmt.Errorf("unable to decode stories.storyViewsList#59d78fc5: field next_offset: %w", err) } s.NextOffset = value } @@ -298,6 +383,22 @@ func (s *StoriesStoryViewsList) GetCount() (value int) { return s.Count } +// GetViewsCount returns value of ViewsCount field. +func (s *StoriesStoryViewsList) GetViewsCount() (value int) { + if s == nil { + return + } + return s.ViewsCount +} + +// GetForwardsCount returns value of ForwardsCount field. +func (s *StoriesStoryViewsList) GetForwardsCount() (value int) { + if s == nil { + return + } + return s.ForwardsCount +} + // GetReactionsCount returns value of ReactionsCount field. func (s *StoriesStoryViewsList) GetReactionsCount() (value int) { if s == nil { @@ -307,13 +408,21 @@ func (s *StoriesStoryViewsList) GetReactionsCount() (value int) { } // GetViews returns value of Views field. -func (s *StoriesStoryViewsList) GetViews() (value []StoryView) { +func (s *StoriesStoryViewsList) GetViews() (value []StoryViewClass) { if s == nil { return } return s.Views } +// GetChats returns value of Chats field. +func (s *StoriesStoryViewsList) GetChats() (value []ChatClass) { + if s == nil { + return + } + return s.Chats +} + // GetUsers returns value of Users field. func (s *StoriesStoryViewsList) GetUsers() (value []UserClass) { if s == nil { @@ -340,6 +449,16 @@ func (s *StoriesStoryViewsList) GetNextOffset() (value string, ok bool) { return s.NextOffset, true } +// MapViews returns field Views wrapped in StoryViewClassArray helper. +func (s *StoriesStoryViewsList) MapViews() (value StoryViewClassArray) { + return StoryViewClassArray(s.Views) +} + +// MapChats returns field Chats wrapped in ChatClassArray helper. +func (s *StoriesStoryViewsList) MapChats() (value ChatClassArray) { + return ChatClassArray(s.Chats) +} + // MapUsers returns field Users wrapped in UserClassArray helper. func (s *StoriesStoryViewsList) MapUsers() (value UserClassArray) { return UserClassArray(s.Users) diff --git a/vendor/github.com/gotd/td/tg/tl_stories_toggle_all_stories_hidden_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_toggle_all_stories_hidden_gen.go index 604c5a6d..7b836ecb 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_toggle_all_stories_hidden_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_toggle_all_stories_hidden_gen.go @@ -32,10 +32,12 @@ var ( ) // StoriesToggleAllStoriesHiddenRequest represents TL type `stories.toggleAllStoriesHidden#7c2557c4`. +// Hide the active stories of a specific peer, preventing them from being displayed on +// the action bar on the homescreen. // // See https://core.telegram.org/method/stories.toggleAllStoriesHidden for reference. type StoriesToggleAllStoriesHiddenRequest struct { - // Hidden field of StoriesToggleAllStoriesHiddenRequest. + // Whether to hide or unhide all active stories of the peer Hidden bool } @@ -161,6 +163,8 @@ func (t *StoriesToggleAllStoriesHiddenRequest) GetHidden() (value bool) { } // StoriesToggleAllStoriesHidden invokes method stories.toggleAllStoriesHidden#7c2557c4 returning error if any. +// Hide the active stories of a specific peer, preventing them from being displayed on +// the action bar on the homescreen. // // See https://core.telegram.org/method/stories.toggleAllStoriesHidden for reference. func (c *Client) StoriesToggleAllStoriesHidden(ctx context.Context, hidden bool) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_toggle_peer_stories_hidden_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_toggle_peer_stories_hidden_gen.go index 74648902..1915781e 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_toggle_peer_stories_hidden_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_toggle_peer_stories_hidden_gen.go @@ -32,12 +32,17 @@ var ( ) // StoriesTogglePeerStoriesHiddenRequest represents TL type `stories.togglePeerStoriesHidden#bd0415c4`. +// Hide the active stories of a user, preventing them from being displayed on the action +// bar on the homescreen, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stories#hiding-stories-of-other-users // // See https://core.telegram.org/method/stories.togglePeerStoriesHidden for reference. type StoriesTogglePeerStoriesHiddenRequest struct { - // Peer field of StoriesTogglePeerStoriesHiddenRequest. + // Peer whose stories should be (un)hidden. Peer InputPeerClass - // Hidden field of StoriesTogglePeerStoriesHiddenRequest. + // Whether to hide or unhide stories. Hidden bool } @@ -193,6 +198,15 @@ func (t *StoriesTogglePeerStoriesHiddenRequest) GetHidden() (value bool) { } // StoriesTogglePeerStoriesHidden invokes method stories.togglePeerStoriesHidden#bd0415c4 returning error if any. +// Hide the active stories of a user, preventing them from being displayed on the action +// bar on the homescreen, see here »¹ for more info. +// +// Links: +// 1. https://core.telegram.org/api/stories#hiding-stories-of-other-users +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.togglePeerStoriesHidden for reference. func (c *Client) StoriesTogglePeerStoriesHidden(ctx context.Context, request *StoriesTogglePeerStoriesHiddenRequest) (bool, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_stories_toggle_pinned_gen.go b/vendor/github.com/gotd/td/tg/tl_stories_toggle_pinned_gen.go index 4486134c..cc0fc9d2 100644 --- a/vendor/github.com/gotd/td/tg/tl_stories_toggle_pinned_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_stories_toggle_pinned_gen.go @@ -32,14 +32,15 @@ var ( ) // StoriesTogglePinnedRequest represents TL type `stories.togglePinned#9a75a1ef`. +// Pin or unpin one or more stories // // See https://core.telegram.org/method/stories.togglePinned for reference. type StoriesTogglePinnedRequest struct { - // Peer field of StoriesTogglePinnedRequest. + // Peer where to pin or unpin stories Peer InputPeerClass - // ID field of StoriesTogglePinnedRequest. + // IDs of stories to pin or unpin ID []int - // Pinned field of StoriesTogglePinnedRequest. + // Whether to pin or unpin the stories Pinned bool } @@ -233,6 +234,11 @@ func (t *StoriesTogglePinnedRequest) GetPinned() (value bool) { } // StoriesTogglePinned invokes method stories.togglePinned#9a75a1ef returning error if any. +// Pin or unpin one or more stories +// +// Possible errors: +// +// 400 PEER_ID_INVALID: The provided peer id is invalid. // // See https://core.telegram.org/method/stories.togglePinned for reference. func (c *Client) StoriesTogglePinned(ctx context.Context, request *StoriesTogglePinnedRequest) ([]int, error) { diff --git a/vendor/github.com/gotd/td/tg/tl_story_fwd_header_gen.go b/vendor/github.com/gotd/td/tg/tl_story_fwd_header_gen.go new file mode 100644 index 00000000..bfd4b68e --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_story_fwd_header_gen.go @@ -0,0 +1,343 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoryFwdHeader represents TL type `storyFwdHeader#b826e150`. +// Contains info about the original poster of a reposted story. +// +// See https://core.telegram.org/constructor/storyFwdHeader for reference. +type StoryFwdHeader struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // Whether the story media was modified before reposting it (for example by overlaying a + // round video with a reaction). + Modified bool + // Peer that originally posted the story; will be empty for stories forwarded from a user + // with forwards privacy enabled, in which case from_name will be set, instead. + // + // Use SetFrom and GetFrom helpers. + From PeerClass + // Will be set for stories forwarded from a user with forwards privacy enabled, in which + // case from will also be empty. + // + // Use SetFromName and GetFromName helpers. + FromName string + // , contains the story ID + // + // Use SetStoryID and GetStoryID helpers. + StoryID int +} + +// StoryFwdHeaderTypeID is TL type id of StoryFwdHeader. +const StoryFwdHeaderTypeID = 0xb826e150 + +// Ensuring interfaces in compile-time for StoryFwdHeader. +var ( + _ bin.Encoder = &StoryFwdHeader{} + _ bin.Decoder = &StoryFwdHeader{} + _ bin.BareEncoder = &StoryFwdHeader{} + _ bin.BareDecoder = &StoryFwdHeader{} +) + +func (s *StoryFwdHeader) Zero() bool { + if s == nil { + return true + } + if !(s.Flags.Zero()) { + return false + } + if !(s.Modified == false) { + return false + } + if !(s.From == nil) { + return false + } + if !(s.FromName == "") { + return false + } + if !(s.StoryID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryFwdHeader) String() string { + if s == nil { + return "StoryFwdHeader(nil)" + } + type Alias StoryFwdHeader + return fmt.Sprintf("StoryFwdHeader%+v", Alias(*s)) +} + +// FillFrom fills StoryFwdHeader from given interface. +func (s *StoryFwdHeader) FillFrom(from interface { + GetModified() (value bool) + GetFrom() (value PeerClass, ok bool) + GetFromName() (value string, ok bool) + GetStoryID() (value int, ok bool) +}) { + s.Modified = from.GetModified() + if val, ok := from.GetFrom(); ok { + s.From = val + } + + if val, ok := from.GetFromName(); ok { + s.FromName = val + } + + if val, ok := from.GetStoryID(); ok { + s.StoryID = val + } + +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryFwdHeader) TypeID() uint32 { + return StoryFwdHeaderTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryFwdHeader) TypeName() string { + return "storyFwdHeader" +} + +// TypeInfo returns info about TL type. +func (s *StoryFwdHeader) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyFwdHeader", + ID: StoryFwdHeaderTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Modified", + SchemaName: "modified", + Null: !s.Flags.Has(3), + }, + { + Name: "From", + SchemaName: "from", + Null: !s.Flags.Has(0), + }, + { + Name: "FromName", + SchemaName: "from_name", + Null: !s.Flags.Has(1), + }, + { + Name: "StoryID", + SchemaName: "story_id", + Null: !s.Flags.Has(2), + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (s *StoryFwdHeader) SetFlags() { + if !(s.Modified == false) { + s.Flags.Set(3) + } + if !(s.From == nil) { + s.Flags.Set(0) + } + if !(s.FromName == "") { + s.Flags.Set(1) + } + if !(s.StoryID == 0) { + s.Flags.Set(2) + } +} + +// Encode implements bin.Encoder. +func (s *StoryFwdHeader) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyFwdHeader#b826e150 as nil") + } + b.PutID(StoryFwdHeaderTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryFwdHeader) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyFwdHeader#b826e150 as nil") + } + s.SetFlags() + if err := s.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyFwdHeader#b826e150: field flags: %w", err) + } + if s.Flags.Has(0) { + if s.From == nil { + return fmt.Errorf("unable to encode storyFwdHeader#b826e150: field from is nil") + } + if err := s.From.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyFwdHeader#b826e150: field from: %w", err) + } + } + if s.Flags.Has(1) { + b.PutString(s.FromName) + } + if s.Flags.Has(2) { + b.PutInt(s.StoryID) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryFwdHeader) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyFwdHeader#b826e150 to nil") + } + if err := b.ConsumeID(StoryFwdHeaderTypeID); err != nil { + return fmt.Errorf("unable to decode storyFwdHeader#b826e150: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryFwdHeader) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyFwdHeader#b826e150 to nil") + } + { + if err := s.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyFwdHeader#b826e150: field flags: %w", err) + } + } + s.Modified = s.Flags.Has(3) + if s.Flags.Has(0) { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode storyFwdHeader#b826e150: field from: %w", err) + } + s.From = value + } + if s.Flags.Has(1) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode storyFwdHeader#b826e150: field from_name: %w", err) + } + s.FromName = value + } + if s.Flags.Has(2) { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode storyFwdHeader#b826e150: field story_id: %w", err) + } + s.StoryID = value + } + return nil +} + +// SetModified sets value of Modified conditional field. +func (s *StoryFwdHeader) SetModified(value bool) { + if value { + s.Flags.Set(3) + s.Modified = true + } else { + s.Flags.Unset(3) + s.Modified = false + } +} + +// GetModified returns value of Modified conditional field. +func (s *StoryFwdHeader) GetModified() (value bool) { + if s == nil { + return + } + return s.Flags.Has(3) +} + +// SetFrom sets value of From conditional field. +func (s *StoryFwdHeader) SetFrom(value PeerClass) { + s.Flags.Set(0) + s.From = value +} + +// GetFrom returns value of From conditional field and +// boolean which is true if field was set. +func (s *StoryFwdHeader) GetFrom() (value PeerClass, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(0) { + return value, false + } + return s.From, true +} + +// SetFromName sets value of FromName conditional field. +func (s *StoryFwdHeader) SetFromName(value string) { + s.Flags.Set(1) + s.FromName = value +} + +// GetFromName returns value of FromName conditional field and +// boolean which is true if field was set. +func (s *StoryFwdHeader) GetFromName() (value string, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(1) { + return value, false + } + return s.FromName, true +} + +// SetStoryID sets value of StoryID conditional field. +func (s *StoryFwdHeader) SetStoryID(value int) { + s.Flags.Set(2) + s.StoryID = value +} + +// GetStoryID returns value of StoryID conditional field and +// boolean which is true if field was set. +func (s *StoryFwdHeader) GetStoryID() (value int, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(2) { + return value, false + } + return s.StoryID, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_story_fwd_header_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_story_fwd_header_slices_gen.go new file mode 100644 index 00000000..fe21471a --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_story_fwd_header_slices_gen.go @@ -0,0 +1,35 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) diff --git a/vendor/github.com/gotd/td/tg/tl_story_item_gen.go b/vendor/github.com/gotd/td/tg/tl_story_item_gen.go index e21ec320..4cf670a1 100644 --- a/vendor/github.com/gotd/td/tg/tl_story_item_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_story_item_gen.go @@ -32,10 +32,11 @@ var ( ) // StoryItemDeleted represents TL type `storyItemDeleted#51e6ee4f`. +// Represents a previously active story, that was deleted // // See https://core.telegram.org/constructor/storyItemDeleted for reference. type StoryItemDeleted struct { - // ID field of StoryItemDeleted. + // Story ID ID int } @@ -166,18 +167,31 @@ func (s *StoryItemDeleted) GetID() (value int) { } // StoryItemSkipped represents TL type `storyItemSkipped#ffadc913`. +// Represents an active story, whose full information was omitted for space and +// performance reasons; use stories.getStoriesByID¹ to fetch full info about the skipped +// story when and if needed. +// +// Links: +// 1. https://core.telegram.org/method/stories.getStoriesByID // // See https://core.telegram.org/constructor/storyItemSkipped for reference. type StoryItemSkipped struct { - // Flags field of StoryItemSkipped. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // CloseFriends field of StoryItemSkipped. + // Whether this story can only be viewed by our close friends, see here »¹ for more + // info + // + // Links: + // 1) https://core.telegram.org/api/privacy CloseFriends bool - // ID field of StoryItemSkipped. + // Story ID ID int - // Date field of StoryItemSkipped. + // When was the story posted. Date int - // ExpireDate field of StoryItemSkipped. + // When does the story expire. ExpireDate int } @@ -406,66 +420,102 @@ func (s *StoryItemSkipped) GetExpireDate() (value int) { return s.ExpireDate } -// StoryItem represents TL type `storyItem#44c457ce`. +// StoryItem represents TL type `storyItem#af6365a1`. +// Represents a story¹. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/storyItem for reference. type StoryItem struct { - // Flags field of StoryItem. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Pinned field of StoryItem. + // Whether this story is pinned on the user's profile Pinned bool - // Public field of StoryItem. + // Whether this story is public and can be viewed by everyone Public bool - // CloseFriends field of StoryItem. + // Whether this story can only be viewed by our close friends, see here »¹ for more + // info + // + // Links: + // 1) https://core.telegram.org/api/privacy CloseFriends bool - // Min field of StoryItem. + // Full information about this story was omitted for space and performance reasons; use + // stories.getStoriesByID¹ to fetch full info about this story when and if needed. + // + // Links: + // 1) https://core.telegram.org/method/stories.getStoriesByID Min bool - // Noforwards field of StoryItem. + // Whether this story is protected¹ and thus cannot be forwarded; clients should also + // prevent users from saving attached media (i.e. videos should only be streamed, photos + // should be kept in RAM, et cetera). + // + // Links: + // 1) https://telegram.org/blog/protected-content-delete-by-date-and-more Noforwards bool - // Edited field of StoryItem. + // Indicates whether the story was edited. Edited bool - // Contacts field of StoryItem. + // Whether this story can only be viewed by our contacts Contacts bool - // SelectedContacts field of StoryItem. + // Whether this story can only be viewed by a select list of our contacts SelectedContacts bool - // Out field of StoryItem. + // indicates whether we sent this story. Out bool - // ID field of StoryItem. + // ID of the story. ID int - // Date field of StoryItem. + // When was the story posted. Date int - // ExpireDate field of StoryItem. + // For reposted stories »¹, contains info about the original story. + // + // Links: + // 1) https://core.telegram.org/api/stories#reposting-stories + // + // Use SetFwdFrom and GetFwdFrom helpers. + FwdFrom StoryFwdHeader + // When does the story expire. ExpireDate int - // Caption field of StoryItem. + // Story caption. // // Use SetCaption and GetCaption helpers. Caption string - // Entities field of StoryItem. + // Message entities for styled text¹ + // + // Links: + // 1) https://core.telegram.org/api/entities // // Use SetEntities and GetEntities helpers. Entities []MessageEntityClass - // Media field of StoryItem. + // Story media. Media MessageMediaClass - // MediaAreas field of StoryItem. + // List of media areas, see here »¹ for more info on media areas. + // + // Links: + // 1) https://core.telegram.org/api/stories#media-areas // // Use SetMediaAreas and GetMediaAreas helpers. MediaAreas []MediaAreaClass - // Privacy field of StoryItem. + // Privacy rules¹ indicating who can and can't view this story + // + // Links: + // 1) https://core.telegram.org/api/privacy // // Use SetPrivacy and GetPrivacy helpers. Privacy []PrivacyRuleClass - // Views field of StoryItem. + // View date and reaction information // // Use SetViews and GetViews helpers. Views StoryViews - // SentReaction field of StoryItem. + // The reaction we sent. // // Use SetSentReaction and GetSentReaction helpers. SentReaction ReactionClass } // StoryItemTypeID is TL type id of StoryItem. -const StoryItemTypeID = 0x44c457ce +const StoryItemTypeID = 0xaf6365a1 // construct implements constructor of StoryItemClass. func (s StoryItem) construct() StoryItemClass { return &s } @@ -520,6 +570,9 @@ func (s *StoryItem) Zero() bool { if !(s.Date == 0) { return false } + if !(s.FwdFrom.Zero()) { + return false + } if !(s.ExpireDate == 0) { return false } @@ -570,6 +623,7 @@ func (s *StoryItem) FillFrom(from interface { GetOut() (value bool) GetID() (value int) GetDate() (value int) + GetFwdFrom() (value StoryFwdHeader, ok bool) GetExpireDate() (value int) GetCaption() (value string, ok bool) GetEntities() (value []MessageEntityClass, ok bool) @@ -590,6 +644,10 @@ func (s *StoryItem) FillFrom(from interface { s.Out = from.GetOut() s.ID = from.GetID() s.Date = from.GetDate() + if val, ok := from.GetFwdFrom(); ok { + s.FwdFrom = val + } + s.ExpireDate = from.GetExpireDate() if val, ok := from.GetCaption(); ok { s.Caption = val @@ -694,6 +752,11 @@ func (s *StoryItem) TypeInfo() tdp.Type { Name: "Date", SchemaName: "date", }, + { + Name: "FwdFrom", + SchemaName: "fwd_from", + Null: !s.Flags.Has(17), + }, { Name: "ExpireDate", SchemaName: "expire_date", @@ -765,6 +828,9 @@ func (s *StoryItem) SetFlags() { if !(s.Out == false) { s.Flags.Set(16) } + if !(s.FwdFrom.Zero()) { + s.Flags.Set(17) + } if !(s.Caption == "") { s.Flags.Set(0) } @@ -788,7 +854,7 @@ func (s *StoryItem) SetFlags() { // Encode implements bin.Encoder. func (s *StoryItem) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode storyItem#44c457ce as nil") + return fmt.Errorf("can't encode storyItem#af6365a1 as nil") } b.PutID(StoryItemTypeID) return s.EncodeBare(b) @@ -797,14 +863,19 @@ func (s *StoryItem) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StoryItem) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode storyItem#44c457ce as nil") + return fmt.Errorf("can't encode storyItem#af6365a1 as nil") } s.SetFlags() if err := s.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field flags: %w", err) + return fmt.Errorf("unable to encode storyItem#af6365a1: field flags: %w", err) } b.PutInt(s.ID) b.PutInt(s.Date) + if s.Flags.Has(17) { + if err := s.FwdFrom.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyItem#af6365a1: field fwd_from: %w", err) + } + } b.PutInt(s.ExpireDate) if s.Flags.Has(0) { b.PutString(s.Caption) @@ -813,27 +884,27 @@ func (s *StoryItem) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(s.Entities)) for idx, v := range s.Entities { if v == nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field entities element with index %d is nil", idx) + return fmt.Errorf("unable to encode storyItem#af6365a1: field entities element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field entities element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode storyItem#af6365a1: field entities element with index %d: %w", idx, err) } } } if s.Media == nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field media is nil") + return fmt.Errorf("unable to encode storyItem#af6365a1: field media is nil") } if err := s.Media.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field media: %w", err) + return fmt.Errorf("unable to encode storyItem#af6365a1: field media: %w", err) } if s.Flags.Has(14) { b.PutVectorHeader(len(s.MediaAreas)) for idx, v := range s.MediaAreas { if v == nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field media_areas element with index %d is nil", idx) + return fmt.Errorf("unable to encode storyItem#af6365a1: field media_areas element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field media_areas element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode storyItem#af6365a1: field media_areas element with index %d: %w", idx, err) } } } @@ -841,24 +912,24 @@ func (s *StoryItem) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(s.Privacy)) for idx, v := range s.Privacy { if v == nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field privacy element with index %d is nil", idx) + return fmt.Errorf("unable to encode storyItem#af6365a1: field privacy element with index %d is nil", idx) } if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field privacy element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode storyItem#af6365a1: field privacy element with index %d: %w", idx, err) } } } if s.Flags.Has(3) { if err := s.Views.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field views: %w", err) + return fmt.Errorf("unable to encode storyItem#af6365a1: field views: %w", err) } } if s.Flags.Has(15) { if s.SentReaction == nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field sent_reaction is nil") + return fmt.Errorf("unable to encode storyItem#af6365a1: field sent_reaction is nil") } if err := s.SentReaction.Encode(b); err != nil { - return fmt.Errorf("unable to encode storyItem#44c457ce: field sent_reaction: %w", err) + return fmt.Errorf("unable to encode storyItem#af6365a1: field sent_reaction: %w", err) } } return nil @@ -867,10 +938,10 @@ func (s *StoryItem) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StoryItem) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode storyItem#44c457ce to nil") + return fmt.Errorf("can't decode storyItem#af6365a1 to nil") } if err := b.ConsumeID(StoryItemTypeID); err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: %w", err) } return s.DecodeBare(b) } @@ -878,11 +949,11 @@ func (s *StoryItem) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StoryItem) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode storyItem#44c457ce to nil") + return fmt.Errorf("can't decode storyItem#af6365a1 to nil") } { if err := s.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field flags: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field flags: %w", err) } } s.Pinned = s.Flags.Has(5) @@ -897,35 +968,40 @@ func (s *StoryItem) DecodeBare(b *bin.Buffer) error { { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field id: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field id: %w", err) } s.ID = value } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field date: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field date: %w", err) } s.Date = value } + if s.Flags.Has(17) { + if err := s.FwdFrom.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyItem#af6365a1: field fwd_from: %w", err) + } + } { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field expire_date: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field expire_date: %w", err) } s.ExpireDate = value } if s.Flags.Has(0) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field caption: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field caption: %w", err) } s.Caption = value } if s.Flags.Has(1) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field entities: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field entities: %w", err) } if headerLen > 0 { @@ -934,7 +1010,7 @@ func (s *StoryItem) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMessageEntity(b) if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field entities: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field entities: %w", err) } s.Entities = append(s.Entities, value) } @@ -942,14 +1018,14 @@ func (s *StoryItem) DecodeBare(b *bin.Buffer) error { { value, err := DecodeMessageMedia(b) if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field media: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field media: %w", err) } s.Media = value } if s.Flags.Has(14) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field media_areas: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field media_areas: %w", err) } if headerLen > 0 { @@ -958,7 +1034,7 @@ func (s *StoryItem) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodeMediaArea(b) if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field media_areas: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field media_areas: %w", err) } s.MediaAreas = append(s.MediaAreas, value) } @@ -966,7 +1042,7 @@ func (s *StoryItem) DecodeBare(b *bin.Buffer) error { if s.Flags.Has(2) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field privacy: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field privacy: %w", err) } if headerLen > 0 { @@ -975,20 +1051,20 @@ func (s *StoryItem) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := DecodePrivacyRule(b) if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field privacy: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field privacy: %w", err) } s.Privacy = append(s.Privacy, value) } } if s.Flags.Has(3) { if err := s.Views.Decode(b); err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field views: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field views: %w", err) } } if s.Flags.Has(15) { value, err := DecodeReaction(b) if err != nil { - return fmt.Errorf("unable to decode storyItem#44c457ce: field sent_reaction: %w", err) + return fmt.Errorf("unable to decode storyItem#af6365a1: field sent_reaction: %w", err) } s.SentReaction = value } @@ -1182,6 +1258,24 @@ func (s *StoryItem) GetDate() (value int) { return s.Date } +// SetFwdFrom sets value of FwdFrom conditional field. +func (s *StoryItem) SetFwdFrom(value StoryFwdHeader) { + s.Flags.Set(17) + s.FwdFrom = value +} + +// GetFwdFrom returns value of FwdFrom conditional field and +// boolean which is true if field was set. +func (s *StoryItem) GetFwdFrom() (value StoryFwdHeader, ok bool) { + if s == nil { + return + } + if !s.Flags.Has(17) { + return value, false + } + return s.FwdFrom, true +} + // GetExpireDate returns value of ExpireDate field. func (s *StoryItem) GetExpireDate() (value int) { if s == nil { @@ -1346,7 +1440,7 @@ const StoryItemClassName = "StoryItem" // switch v := g.(type) { // case *tg.StoryItemDeleted: // storyItemDeleted#51e6ee4f // case *tg.StoryItemSkipped: // storyItemSkipped#ffadc913 -// case *tg.StoryItem: // storyItem#44c457ce +// case *tg.StoryItem: // storyItem#af6365a1 // default: panic(v) // } type StoryItemClass interface { @@ -1367,7 +1461,7 @@ type StoryItemClass interface { // Zero returns true if current object has a zero value. Zero() bool - // ID field of StoryItemDeleted. + // Story ID GetID() (value int) } @@ -1393,7 +1487,7 @@ func DecodeStoryItem(buf *bin.Buffer) (StoryItemClass, error) { } return &v, nil case StoryItemTypeID: - // Decoding storyItem#44c457ce. + // Decoding storyItem#af6365a1. v := StoryItem{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode StoryItemClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_story_reaction_gen.go b/vendor/github.com/gotd/td/tg/tl_story_reaction_gen.go new file mode 100644 index 00000000..34f35334 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_story_reaction_gen.go @@ -0,0 +1,637 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoryReaction represents TL type `storyReaction#6090d6d5`. +// +// See https://core.telegram.org/constructor/storyReaction for reference. +type StoryReaction struct { + // PeerID field of StoryReaction. + PeerID PeerClass + // Date field of StoryReaction. + Date int + // Reaction field of StoryReaction. + Reaction ReactionClass +} + +// StoryReactionTypeID is TL type id of StoryReaction. +const StoryReactionTypeID = 0x6090d6d5 + +// construct implements constructor of StoryReactionClass. +func (s StoryReaction) construct() StoryReactionClass { return &s } + +// Ensuring interfaces in compile-time for StoryReaction. +var ( + _ bin.Encoder = &StoryReaction{} + _ bin.Decoder = &StoryReaction{} + _ bin.BareEncoder = &StoryReaction{} + _ bin.BareDecoder = &StoryReaction{} + + _ StoryReactionClass = &StoryReaction{} +) + +func (s *StoryReaction) Zero() bool { + if s == nil { + return true + } + if !(s.PeerID == nil) { + return false + } + if !(s.Date == 0) { + return false + } + if !(s.Reaction == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryReaction) String() string { + if s == nil { + return "StoryReaction(nil)" + } + type Alias StoryReaction + return fmt.Sprintf("StoryReaction%+v", Alias(*s)) +} + +// FillFrom fills StoryReaction from given interface. +func (s *StoryReaction) FillFrom(from interface { + GetPeerID() (value PeerClass) + GetDate() (value int) + GetReaction() (value ReactionClass) +}) { + s.PeerID = from.GetPeerID() + s.Date = from.GetDate() + s.Reaction = from.GetReaction() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryReaction) TypeID() uint32 { + return StoryReactionTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryReaction) TypeName() string { + return "storyReaction" +} + +// TypeInfo returns info about TL type. +func (s *StoryReaction) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyReaction", + ID: StoryReactionTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "PeerID", + SchemaName: "peer_id", + }, + { + Name: "Date", + SchemaName: "date", + }, + { + Name: "Reaction", + SchemaName: "reaction", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryReaction) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyReaction#6090d6d5 as nil") + } + b.PutID(StoryReactionTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryReaction) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyReaction#6090d6d5 as nil") + } + if s.PeerID == nil { + return fmt.Errorf("unable to encode storyReaction#6090d6d5: field peer_id is nil") + } + if err := s.PeerID.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyReaction#6090d6d5: field peer_id: %w", err) + } + b.PutInt(s.Date) + if s.Reaction == nil { + return fmt.Errorf("unable to encode storyReaction#6090d6d5: field reaction is nil") + } + if err := s.Reaction.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyReaction#6090d6d5: field reaction: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryReaction) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyReaction#6090d6d5 to nil") + } + if err := b.ConsumeID(StoryReactionTypeID); err != nil { + return fmt.Errorf("unable to decode storyReaction#6090d6d5: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryReaction) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyReaction#6090d6d5 to nil") + } + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode storyReaction#6090d6d5: field peer_id: %w", err) + } + s.PeerID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode storyReaction#6090d6d5: field date: %w", err) + } + s.Date = value + } + { + value, err := DecodeReaction(b) + if err != nil { + return fmt.Errorf("unable to decode storyReaction#6090d6d5: field reaction: %w", err) + } + s.Reaction = value + } + return nil +} + +// GetPeerID returns value of PeerID field. +func (s *StoryReaction) GetPeerID() (value PeerClass) { + if s == nil { + return + } + return s.PeerID +} + +// GetDate returns value of Date field. +func (s *StoryReaction) GetDate() (value int) { + if s == nil { + return + } + return s.Date +} + +// GetReaction returns value of Reaction field. +func (s *StoryReaction) GetReaction() (value ReactionClass) { + if s == nil { + return + } + return s.Reaction +} + +// StoryReactionPublicForward represents TL type `storyReactionPublicForward#bbab2643`. +// +// See https://core.telegram.org/constructor/storyReactionPublicForward for reference. +type StoryReactionPublicForward struct { + // Message field of StoryReactionPublicForward. + Message MessageClass +} + +// StoryReactionPublicForwardTypeID is TL type id of StoryReactionPublicForward. +const StoryReactionPublicForwardTypeID = 0xbbab2643 + +// construct implements constructor of StoryReactionClass. +func (s StoryReactionPublicForward) construct() StoryReactionClass { return &s } + +// Ensuring interfaces in compile-time for StoryReactionPublicForward. +var ( + _ bin.Encoder = &StoryReactionPublicForward{} + _ bin.Decoder = &StoryReactionPublicForward{} + _ bin.BareEncoder = &StoryReactionPublicForward{} + _ bin.BareDecoder = &StoryReactionPublicForward{} + + _ StoryReactionClass = &StoryReactionPublicForward{} +) + +func (s *StoryReactionPublicForward) Zero() bool { + if s == nil { + return true + } + if !(s.Message == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryReactionPublicForward) String() string { + if s == nil { + return "StoryReactionPublicForward(nil)" + } + type Alias StoryReactionPublicForward + return fmt.Sprintf("StoryReactionPublicForward%+v", Alias(*s)) +} + +// FillFrom fills StoryReactionPublicForward from given interface. +func (s *StoryReactionPublicForward) FillFrom(from interface { + GetMessage() (value MessageClass) +}) { + s.Message = from.GetMessage() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryReactionPublicForward) TypeID() uint32 { + return StoryReactionPublicForwardTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryReactionPublicForward) TypeName() string { + return "storyReactionPublicForward" +} + +// TypeInfo returns info about TL type. +func (s *StoryReactionPublicForward) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyReactionPublicForward", + ID: StoryReactionPublicForwardTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Message", + SchemaName: "message", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryReactionPublicForward) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyReactionPublicForward#bbab2643 as nil") + } + b.PutID(StoryReactionPublicForwardTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryReactionPublicForward) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyReactionPublicForward#bbab2643 as nil") + } + if s.Message == nil { + return fmt.Errorf("unable to encode storyReactionPublicForward#bbab2643: field message is nil") + } + if err := s.Message.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyReactionPublicForward#bbab2643: field message: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryReactionPublicForward) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyReactionPublicForward#bbab2643 to nil") + } + if err := b.ConsumeID(StoryReactionPublicForwardTypeID); err != nil { + return fmt.Errorf("unable to decode storyReactionPublicForward#bbab2643: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryReactionPublicForward) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyReactionPublicForward#bbab2643 to nil") + } + { + value, err := DecodeMessage(b) + if err != nil { + return fmt.Errorf("unable to decode storyReactionPublicForward#bbab2643: field message: %w", err) + } + s.Message = value + } + return nil +} + +// GetMessage returns value of Message field. +func (s *StoryReactionPublicForward) GetMessage() (value MessageClass) { + if s == nil { + return + } + return s.Message +} + +// StoryReactionPublicRepost represents TL type `storyReactionPublicRepost#cfcd0f13`. +// +// See https://core.telegram.org/constructor/storyReactionPublicRepost for reference. +type StoryReactionPublicRepost struct { + // PeerID field of StoryReactionPublicRepost. + PeerID PeerClass + // Story field of StoryReactionPublicRepost. + Story StoryItemClass +} + +// StoryReactionPublicRepostTypeID is TL type id of StoryReactionPublicRepost. +const StoryReactionPublicRepostTypeID = 0xcfcd0f13 + +// construct implements constructor of StoryReactionClass. +func (s StoryReactionPublicRepost) construct() StoryReactionClass { return &s } + +// Ensuring interfaces in compile-time for StoryReactionPublicRepost. +var ( + _ bin.Encoder = &StoryReactionPublicRepost{} + _ bin.Decoder = &StoryReactionPublicRepost{} + _ bin.BareEncoder = &StoryReactionPublicRepost{} + _ bin.BareDecoder = &StoryReactionPublicRepost{} + + _ StoryReactionClass = &StoryReactionPublicRepost{} +) + +func (s *StoryReactionPublicRepost) Zero() bool { + if s == nil { + return true + } + if !(s.PeerID == nil) { + return false + } + if !(s.Story == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryReactionPublicRepost) String() string { + if s == nil { + return "StoryReactionPublicRepost(nil)" + } + type Alias StoryReactionPublicRepost + return fmt.Sprintf("StoryReactionPublicRepost%+v", Alias(*s)) +} + +// FillFrom fills StoryReactionPublicRepost from given interface. +func (s *StoryReactionPublicRepost) FillFrom(from interface { + GetPeerID() (value PeerClass) + GetStory() (value StoryItemClass) +}) { + s.PeerID = from.GetPeerID() + s.Story = from.GetStory() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryReactionPublicRepost) TypeID() uint32 { + return StoryReactionPublicRepostTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryReactionPublicRepost) TypeName() string { + return "storyReactionPublicRepost" +} + +// TypeInfo returns info about TL type. +func (s *StoryReactionPublicRepost) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyReactionPublicRepost", + ID: StoryReactionPublicRepostTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "PeerID", + SchemaName: "peer_id", + }, + { + Name: "Story", + SchemaName: "story", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StoryReactionPublicRepost) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyReactionPublicRepost#cfcd0f13 as nil") + } + b.PutID(StoryReactionPublicRepostTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryReactionPublicRepost) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyReactionPublicRepost#cfcd0f13 as nil") + } + if s.PeerID == nil { + return fmt.Errorf("unable to encode storyReactionPublicRepost#cfcd0f13: field peer_id is nil") + } + if err := s.PeerID.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyReactionPublicRepost#cfcd0f13: field peer_id: %w", err) + } + if s.Story == nil { + return fmt.Errorf("unable to encode storyReactionPublicRepost#cfcd0f13: field story is nil") + } + if err := s.Story.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyReactionPublicRepost#cfcd0f13: field story: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryReactionPublicRepost) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyReactionPublicRepost#cfcd0f13 to nil") + } + if err := b.ConsumeID(StoryReactionPublicRepostTypeID); err != nil { + return fmt.Errorf("unable to decode storyReactionPublicRepost#cfcd0f13: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryReactionPublicRepost) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyReactionPublicRepost#cfcd0f13 to nil") + } + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode storyReactionPublicRepost#cfcd0f13: field peer_id: %w", err) + } + s.PeerID = value + } + { + value, err := DecodeStoryItem(b) + if err != nil { + return fmt.Errorf("unable to decode storyReactionPublicRepost#cfcd0f13: field story: %w", err) + } + s.Story = value + } + return nil +} + +// GetPeerID returns value of PeerID field. +func (s *StoryReactionPublicRepost) GetPeerID() (value PeerClass) { + if s == nil { + return + } + return s.PeerID +} + +// GetStory returns value of Story field. +func (s *StoryReactionPublicRepost) GetStory() (value StoryItemClass) { + if s == nil { + return + } + return s.Story +} + +// StoryReactionClassName is schema name of StoryReactionClass. +const StoryReactionClassName = "StoryReaction" + +// StoryReactionClass represents StoryReaction generic type. +// +// See https://core.telegram.org/type/StoryReaction for reference. +// +// Example: +// +// g, err := tg.DecodeStoryReaction(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tg.StoryReaction: // storyReaction#6090d6d5 +// case *tg.StoryReactionPublicForward: // storyReactionPublicForward#bbab2643 +// case *tg.StoryReactionPublicRepost: // storyReactionPublicRepost#cfcd0f13 +// default: panic(v) +// } +type StoryReactionClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() StoryReactionClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool +} + +// DecodeStoryReaction implements binary de-serialization for StoryReactionClass. +func DecodeStoryReaction(buf *bin.Buffer) (StoryReactionClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case StoryReactionTypeID: + // Decoding storyReaction#6090d6d5. + v := StoryReaction{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryReactionClass: %w", err) + } + return &v, nil + case StoryReactionPublicForwardTypeID: + // Decoding storyReactionPublicForward#bbab2643. + v := StoryReactionPublicForward{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryReactionClass: %w", err) + } + return &v, nil + case StoryReactionPublicRepostTypeID: + // Decoding storyReactionPublicRepost#cfcd0f13. + v := StoryReactionPublicRepost{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryReactionClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StoryReactionClass: %w", bin.NewUnexpectedID(id)) + } +} + +// StoryReaction boxes the StoryReactionClass providing a helper. +type StoryReactionBox struct { + StoryReaction StoryReactionClass +} + +// Decode implements bin.Decoder for StoryReactionBox. +func (b *StoryReactionBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode StoryReactionBox to nil") + } + v, err := DecodeStoryReaction(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StoryReaction = v + return nil +} + +// Encode implements bin.Encode for StoryReactionBox. +func (b *StoryReactionBox) Encode(buf *bin.Buffer) error { + if b == nil || b.StoryReaction == nil { + return fmt.Errorf("unable to encode StoryReactionClass as nil") + } + return b.StoryReaction.Encode(buf) +} diff --git a/vendor/github.com/gotd/td/tg/tl_story_reaction_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_story_reaction_slices_gen.go new file mode 100644 index 00000000..07545086 --- /dev/null +++ b/vendor/github.com/gotd/td/tg/tl_story_reaction_slices_gen.go @@ -0,0 +1,416 @@ +//go:build !no_gotd_slices +// +build !no_gotd_slices + +// Code generated by gotdgen, DO NOT EDIT. + +package tg + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// StoryReactionClassArray is adapter for slice of StoryReactionClass. +type StoryReactionClassArray []StoryReactionClass + +// Sort sorts slice of StoryReactionClass. +func (s StoryReactionClassArray) Sort(less func(a, b StoryReactionClass) bool) StoryReactionClassArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryReactionClass. +func (s StoryReactionClassArray) SortStable(less func(a, b StoryReactionClass) bool) StoryReactionClassArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryReactionClass. +func (s StoryReactionClassArray) Retain(keep func(x StoryReactionClass) bool) StoryReactionClassArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryReactionClassArray) First() (v StoryReactionClass, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryReactionClassArray) Last() (v StoryReactionClass, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryReactionClassArray) PopFirst() (v StoryReactionClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryReactionClass + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryReactionClassArray) Pop() (v StoryReactionClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// AsStoryReaction returns copy with only StoryReaction constructors. +func (s StoryReactionClassArray) AsStoryReaction() (to StoryReactionArray) { + for _, elem := range s { + value, ok := elem.(*StoryReaction) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsStoryReactionPublicForward returns copy with only StoryReactionPublicForward constructors. +func (s StoryReactionClassArray) AsStoryReactionPublicForward() (to StoryReactionPublicForwardArray) { + for _, elem := range s { + value, ok := elem.(*StoryReactionPublicForward) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsStoryReactionPublicRepost returns copy with only StoryReactionPublicRepost constructors. +func (s StoryReactionClassArray) AsStoryReactionPublicRepost() (to StoryReactionPublicRepostArray) { + for _, elem := range s { + value, ok := elem.(*StoryReactionPublicRepost) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// StoryReactionArray is adapter for slice of StoryReaction. +type StoryReactionArray []StoryReaction + +// Sort sorts slice of StoryReaction. +func (s StoryReactionArray) Sort(less func(a, b StoryReaction) bool) StoryReactionArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryReaction. +func (s StoryReactionArray) SortStable(less func(a, b StoryReaction) bool) StoryReactionArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryReaction. +func (s StoryReactionArray) Retain(keep func(x StoryReaction) bool) StoryReactionArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryReactionArray) First() (v StoryReaction, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryReactionArray) Last() (v StoryReaction, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryReactionArray) PopFirst() (v StoryReaction, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryReaction + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryReactionArray) Pop() (v StoryReaction, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// SortByDate sorts slice of StoryReaction by Date. +func (s StoryReactionArray) SortByDate() StoryReactionArray { + return s.Sort(func(a, b StoryReaction) bool { + return a.GetDate() < b.GetDate() + }) +} + +// SortStableByDate sorts slice of StoryReaction by Date. +func (s StoryReactionArray) SortStableByDate() StoryReactionArray { + return s.SortStable(func(a, b StoryReaction) bool { + return a.GetDate() < b.GetDate() + }) +} + +// StoryReactionPublicForwardArray is adapter for slice of StoryReactionPublicForward. +type StoryReactionPublicForwardArray []StoryReactionPublicForward + +// Sort sorts slice of StoryReactionPublicForward. +func (s StoryReactionPublicForwardArray) Sort(less func(a, b StoryReactionPublicForward) bool) StoryReactionPublicForwardArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryReactionPublicForward. +func (s StoryReactionPublicForwardArray) SortStable(less func(a, b StoryReactionPublicForward) bool) StoryReactionPublicForwardArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryReactionPublicForward. +func (s StoryReactionPublicForwardArray) Retain(keep func(x StoryReactionPublicForward) bool) StoryReactionPublicForwardArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryReactionPublicForwardArray) First() (v StoryReactionPublicForward, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryReactionPublicForwardArray) Last() (v StoryReactionPublicForward, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryReactionPublicForwardArray) PopFirst() (v StoryReactionPublicForward, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryReactionPublicForward + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryReactionPublicForwardArray) Pop() (v StoryReactionPublicForward, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// StoryReactionPublicRepostArray is adapter for slice of StoryReactionPublicRepost. +type StoryReactionPublicRepostArray []StoryReactionPublicRepost + +// Sort sorts slice of StoryReactionPublicRepost. +func (s StoryReactionPublicRepostArray) Sort(less func(a, b StoryReactionPublicRepost) bool) StoryReactionPublicRepostArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryReactionPublicRepost. +func (s StoryReactionPublicRepostArray) SortStable(less func(a, b StoryReactionPublicRepost) bool) StoryReactionPublicRepostArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryReactionPublicRepost. +func (s StoryReactionPublicRepostArray) Retain(keep func(x StoryReactionPublicRepost) bool) StoryReactionPublicRepostArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryReactionPublicRepostArray) First() (v StoryReactionPublicRepost, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryReactionPublicRepostArray) Last() (v StoryReactionPublicRepost, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryReactionPublicRepostArray) PopFirst() (v StoryReactionPublicRepost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryReactionPublicRepost + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryReactionPublicRepostArray) Pop() (v StoryReactionPublicRepost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_story_view_gen.go b/vendor/github.com/gotd/td/tg/tl_story_view_gen.go index 65bc96b8..0429f3fd 100644 --- a/vendor/github.com/gotd/td/tg/tl_story_view_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_story_view_gen.go @@ -32,20 +32,34 @@ var ( ) // StoryView represents TL type `storyView#b0bdeac5`. +// Story¹ view date and reaction information +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/storyView for reference. type StoryView struct { - // Flags field of StoryView. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Blocked field of StoryView. + // Whether we have completely blocked¹ this user, including from viewing more of our + // stories. + // + // Links: + // 1) https://core.telegram.org/api/block Blocked bool - // BlockedMyStoriesFrom field of StoryView. + // Whether we have blocked¹ this user from viewing more of our stories. + // + // Links: + // 1) https://core.telegram.org/api/block BlockedMyStoriesFrom bool - // UserID field of StoryView. + // The user that viewed the story UserID int64 - // Date field of StoryView. + // When did the user view the story Date int - // Reaction field of StoryView. + // If present, contains the reaction that the user left on the story // // Use SetReaction and GetReaction helpers. Reaction ReactionClass @@ -54,12 +68,17 @@ type StoryView struct { // StoryViewTypeID is TL type id of StoryView. const StoryViewTypeID = 0xb0bdeac5 +// construct implements constructor of StoryViewClass. +func (s StoryView) construct() StoryViewClass { return &s } + // Ensuring interfaces in compile-time for StoryView. var ( _ bin.Encoder = &StoryView{} _ bin.Decoder = &StoryView{} _ bin.BareEncoder = &StoryView{} _ bin.BareDecoder = &StoryView{} + + _ StoryViewClass = &StoryView{} ) func (s *StoryView) Zero() bool { @@ -327,3 +346,599 @@ func (s *StoryView) GetReaction() (value ReactionClass, ok bool) { } return s.Reaction, true } + +// StoryViewPublicForward represents TL type `storyViewPublicForward#9083670b`. +// +// See https://core.telegram.org/constructor/storyViewPublicForward for reference. +type StoryViewPublicForward struct { + // Flags field of StoryViewPublicForward. + Flags bin.Fields + // Blocked field of StoryViewPublicForward. + Blocked bool + // BlockedMyStoriesFrom field of StoryViewPublicForward. + BlockedMyStoriesFrom bool + // Message field of StoryViewPublicForward. + Message MessageClass +} + +// StoryViewPublicForwardTypeID is TL type id of StoryViewPublicForward. +const StoryViewPublicForwardTypeID = 0x9083670b + +// construct implements constructor of StoryViewClass. +func (s StoryViewPublicForward) construct() StoryViewClass { return &s } + +// Ensuring interfaces in compile-time for StoryViewPublicForward. +var ( + _ bin.Encoder = &StoryViewPublicForward{} + _ bin.Decoder = &StoryViewPublicForward{} + _ bin.BareEncoder = &StoryViewPublicForward{} + _ bin.BareDecoder = &StoryViewPublicForward{} + + _ StoryViewClass = &StoryViewPublicForward{} +) + +func (s *StoryViewPublicForward) Zero() bool { + if s == nil { + return true + } + if !(s.Flags.Zero()) { + return false + } + if !(s.Blocked == false) { + return false + } + if !(s.BlockedMyStoriesFrom == false) { + return false + } + if !(s.Message == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryViewPublicForward) String() string { + if s == nil { + return "StoryViewPublicForward(nil)" + } + type Alias StoryViewPublicForward + return fmt.Sprintf("StoryViewPublicForward%+v", Alias(*s)) +} + +// FillFrom fills StoryViewPublicForward from given interface. +func (s *StoryViewPublicForward) FillFrom(from interface { + GetBlocked() (value bool) + GetBlockedMyStoriesFrom() (value bool) + GetMessage() (value MessageClass) +}) { + s.Blocked = from.GetBlocked() + s.BlockedMyStoriesFrom = from.GetBlockedMyStoriesFrom() + s.Message = from.GetMessage() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryViewPublicForward) TypeID() uint32 { + return StoryViewPublicForwardTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryViewPublicForward) TypeName() string { + return "storyViewPublicForward" +} + +// TypeInfo returns info about TL type. +func (s *StoryViewPublicForward) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyViewPublicForward", + ID: StoryViewPublicForwardTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Blocked", + SchemaName: "blocked", + Null: !s.Flags.Has(0), + }, + { + Name: "BlockedMyStoriesFrom", + SchemaName: "blocked_my_stories_from", + Null: !s.Flags.Has(1), + }, + { + Name: "Message", + SchemaName: "message", + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (s *StoryViewPublicForward) SetFlags() { + if !(s.Blocked == false) { + s.Flags.Set(0) + } + if !(s.BlockedMyStoriesFrom == false) { + s.Flags.Set(1) + } +} + +// Encode implements bin.Encoder. +func (s *StoryViewPublicForward) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewPublicForward#9083670b as nil") + } + b.PutID(StoryViewPublicForwardTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryViewPublicForward) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewPublicForward#9083670b as nil") + } + s.SetFlags() + if err := s.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyViewPublicForward#9083670b: field flags: %w", err) + } + if s.Message == nil { + return fmt.Errorf("unable to encode storyViewPublicForward#9083670b: field message is nil") + } + if err := s.Message.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyViewPublicForward#9083670b: field message: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryViewPublicForward) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewPublicForward#9083670b to nil") + } + if err := b.ConsumeID(StoryViewPublicForwardTypeID); err != nil { + return fmt.Errorf("unable to decode storyViewPublicForward#9083670b: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryViewPublicForward) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewPublicForward#9083670b to nil") + } + { + if err := s.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyViewPublicForward#9083670b: field flags: %w", err) + } + } + s.Blocked = s.Flags.Has(0) + s.BlockedMyStoriesFrom = s.Flags.Has(1) + { + value, err := DecodeMessage(b) + if err != nil { + return fmt.Errorf("unable to decode storyViewPublicForward#9083670b: field message: %w", err) + } + s.Message = value + } + return nil +} + +// SetBlocked sets value of Blocked conditional field. +func (s *StoryViewPublicForward) SetBlocked(value bool) { + if value { + s.Flags.Set(0) + s.Blocked = true + } else { + s.Flags.Unset(0) + s.Blocked = false + } +} + +// GetBlocked returns value of Blocked conditional field. +func (s *StoryViewPublicForward) GetBlocked() (value bool) { + if s == nil { + return + } + return s.Flags.Has(0) +} + +// SetBlockedMyStoriesFrom sets value of BlockedMyStoriesFrom conditional field. +func (s *StoryViewPublicForward) SetBlockedMyStoriesFrom(value bool) { + if value { + s.Flags.Set(1) + s.BlockedMyStoriesFrom = true + } else { + s.Flags.Unset(1) + s.BlockedMyStoriesFrom = false + } +} + +// GetBlockedMyStoriesFrom returns value of BlockedMyStoriesFrom conditional field. +func (s *StoryViewPublicForward) GetBlockedMyStoriesFrom() (value bool) { + if s == nil { + return + } + return s.Flags.Has(1) +} + +// GetMessage returns value of Message field. +func (s *StoryViewPublicForward) GetMessage() (value MessageClass) { + if s == nil { + return + } + return s.Message +} + +// StoryViewPublicRepost represents TL type `storyViewPublicRepost#bd74cf49`. +// +// See https://core.telegram.org/constructor/storyViewPublicRepost for reference. +type StoryViewPublicRepost struct { + // Flags field of StoryViewPublicRepost. + Flags bin.Fields + // Blocked field of StoryViewPublicRepost. + Blocked bool + // BlockedMyStoriesFrom field of StoryViewPublicRepost. + BlockedMyStoriesFrom bool + // PeerID field of StoryViewPublicRepost. + PeerID PeerClass + // Story field of StoryViewPublicRepost. + Story StoryItemClass +} + +// StoryViewPublicRepostTypeID is TL type id of StoryViewPublicRepost. +const StoryViewPublicRepostTypeID = 0xbd74cf49 + +// construct implements constructor of StoryViewClass. +func (s StoryViewPublicRepost) construct() StoryViewClass { return &s } + +// Ensuring interfaces in compile-time for StoryViewPublicRepost. +var ( + _ bin.Encoder = &StoryViewPublicRepost{} + _ bin.Decoder = &StoryViewPublicRepost{} + _ bin.BareEncoder = &StoryViewPublicRepost{} + _ bin.BareDecoder = &StoryViewPublicRepost{} + + _ StoryViewClass = &StoryViewPublicRepost{} +) + +func (s *StoryViewPublicRepost) Zero() bool { + if s == nil { + return true + } + if !(s.Flags.Zero()) { + return false + } + if !(s.Blocked == false) { + return false + } + if !(s.BlockedMyStoriesFrom == false) { + return false + } + if !(s.PeerID == nil) { + return false + } + if !(s.Story == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StoryViewPublicRepost) String() string { + if s == nil { + return "StoryViewPublicRepost(nil)" + } + type Alias StoryViewPublicRepost + return fmt.Sprintf("StoryViewPublicRepost%+v", Alias(*s)) +} + +// FillFrom fills StoryViewPublicRepost from given interface. +func (s *StoryViewPublicRepost) FillFrom(from interface { + GetBlocked() (value bool) + GetBlockedMyStoriesFrom() (value bool) + GetPeerID() (value PeerClass) + GetStory() (value StoryItemClass) +}) { + s.Blocked = from.GetBlocked() + s.BlockedMyStoriesFrom = from.GetBlockedMyStoriesFrom() + s.PeerID = from.GetPeerID() + s.Story = from.GetStory() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StoryViewPublicRepost) TypeID() uint32 { + return StoryViewPublicRepostTypeID +} + +// TypeName returns name of type in TL schema. +func (*StoryViewPublicRepost) TypeName() string { + return "storyViewPublicRepost" +} + +// TypeInfo returns info about TL type. +func (s *StoryViewPublicRepost) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "storyViewPublicRepost", + ID: StoryViewPublicRepostTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Blocked", + SchemaName: "blocked", + Null: !s.Flags.Has(0), + }, + { + Name: "BlockedMyStoriesFrom", + SchemaName: "blocked_my_stories_from", + Null: !s.Flags.Has(1), + }, + { + Name: "PeerID", + SchemaName: "peer_id", + }, + { + Name: "Story", + SchemaName: "story", + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (s *StoryViewPublicRepost) SetFlags() { + if !(s.Blocked == false) { + s.Flags.Set(0) + } + if !(s.BlockedMyStoriesFrom == false) { + s.Flags.Set(1) + } +} + +// Encode implements bin.Encoder. +func (s *StoryViewPublicRepost) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewPublicRepost#bd74cf49 as nil") + } + b.PutID(StoryViewPublicRepostTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StoryViewPublicRepost) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode storyViewPublicRepost#bd74cf49 as nil") + } + s.SetFlags() + if err := s.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyViewPublicRepost#bd74cf49: field flags: %w", err) + } + if s.PeerID == nil { + return fmt.Errorf("unable to encode storyViewPublicRepost#bd74cf49: field peer_id is nil") + } + if err := s.PeerID.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyViewPublicRepost#bd74cf49: field peer_id: %w", err) + } + if s.Story == nil { + return fmt.Errorf("unable to encode storyViewPublicRepost#bd74cf49: field story is nil") + } + if err := s.Story.Encode(b); err != nil { + return fmt.Errorf("unable to encode storyViewPublicRepost#bd74cf49: field story: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StoryViewPublicRepost) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewPublicRepost#bd74cf49 to nil") + } + if err := b.ConsumeID(StoryViewPublicRepostTypeID); err != nil { + return fmt.Errorf("unable to decode storyViewPublicRepost#bd74cf49: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StoryViewPublicRepost) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode storyViewPublicRepost#bd74cf49 to nil") + } + { + if err := s.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode storyViewPublicRepost#bd74cf49: field flags: %w", err) + } + } + s.Blocked = s.Flags.Has(0) + s.BlockedMyStoriesFrom = s.Flags.Has(1) + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode storyViewPublicRepost#bd74cf49: field peer_id: %w", err) + } + s.PeerID = value + } + { + value, err := DecodeStoryItem(b) + if err != nil { + return fmt.Errorf("unable to decode storyViewPublicRepost#bd74cf49: field story: %w", err) + } + s.Story = value + } + return nil +} + +// SetBlocked sets value of Blocked conditional field. +func (s *StoryViewPublicRepost) SetBlocked(value bool) { + if value { + s.Flags.Set(0) + s.Blocked = true + } else { + s.Flags.Unset(0) + s.Blocked = false + } +} + +// GetBlocked returns value of Blocked conditional field. +func (s *StoryViewPublicRepost) GetBlocked() (value bool) { + if s == nil { + return + } + return s.Flags.Has(0) +} + +// SetBlockedMyStoriesFrom sets value of BlockedMyStoriesFrom conditional field. +func (s *StoryViewPublicRepost) SetBlockedMyStoriesFrom(value bool) { + if value { + s.Flags.Set(1) + s.BlockedMyStoriesFrom = true + } else { + s.Flags.Unset(1) + s.BlockedMyStoriesFrom = false + } +} + +// GetBlockedMyStoriesFrom returns value of BlockedMyStoriesFrom conditional field. +func (s *StoryViewPublicRepost) GetBlockedMyStoriesFrom() (value bool) { + if s == nil { + return + } + return s.Flags.Has(1) +} + +// GetPeerID returns value of PeerID field. +func (s *StoryViewPublicRepost) GetPeerID() (value PeerClass) { + if s == nil { + return + } + return s.PeerID +} + +// GetStory returns value of Story field. +func (s *StoryViewPublicRepost) GetStory() (value StoryItemClass) { + if s == nil { + return + } + return s.Story +} + +// StoryViewClassName is schema name of StoryViewClass. +const StoryViewClassName = "StoryView" + +// StoryViewClass represents StoryView generic type. +// +// See https://core.telegram.org/type/StoryView for reference. +// +// Example: +// +// g, err := tg.DecodeStoryView(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tg.StoryView: // storyView#b0bdeac5 +// case *tg.StoryViewPublicForward: // storyViewPublicForward#9083670b +// case *tg.StoryViewPublicRepost: // storyViewPublicRepost#bd74cf49 +// default: panic(v) +// } +type StoryViewClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() StoryViewClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool + + // Whether we have completely blocked¹ this user, including from viewing more of our + // stories. + // + // Links: + // 1) https://core.telegram.org/api/block + GetBlocked() (value bool) + + // Whether we have blocked¹ this user from viewing more of our stories. + // + // Links: + // 1) https://core.telegram.org/api/block + GetBlockedMyStoriesFrom() (value bool) +} + +// DecodeStoryView implements binary de-serialization for StoryViewClass. +func DecodeStoryView(buf *bin.Buffer) (StoryViewClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case StoryViewTypeID: + // Decoding storyView#b0bdeac5. + v := StoryView{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryViewClass: %w", err) + } + return &v, nil + case StoryViewPublicForwardTypeID: + // Decoding storyViewPublicForward#9083670b. + v := StoryViewPublicForward{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryViewClass: %w", err) + } + return &v, nil + case StoryViewPublicRepostTypeID: + // Decoding storyViewPublicRepost#bd74cf49. + v := StoryViewPublicRepost{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StoryViewClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StoryViewClass: %w", bin.NewUnexpectedID(id)) + } +} + +// StoryView boxes the StoryViewClass providing a helper. +type StoryViewBox struct { + StoryView StoryViewClass +} + +// Decode implements bin.Decoder for StoryViewBox. +func (b *StoryViewBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode StoryViewBox to nil") + } + v, err := DecodeStoryView(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StoryView = v + return nil +} + +// Encode implements bin.Encode for StoryViewBox. +func (b *StoryViewBox) Encode(buf *bin.Buffer) error { + if b == nil || b.StoryView == nil { + return fmt.Errorf("unable to encode StoryViewClass as nil") + } + return b.StoryView.Encode(buf) +} diff --git a/vendor/github.com/gotd/td/tg/tl_story_view_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_story_view_slices_gen.go index fe21471a..d0de2f4a 100644 --- a/vendor/github.com/gotd/td/tg/tl_story_view_slices_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_story_view_slices_gen.go @@ -33,3 +33,384 @@ var ( _ = tgerr.Error{} _ = tdjson.Encoder{} ) + +// StoryViewClassArray is adapter for slice of StoryViewClass. +type StoryViewClassArray []StoryViewClass + +// Sort sorts slice of StoryViewClass. +func (s StoryViewClassArray) Sort(less func(a, b StoryViewClass) bool) StoryViewClassArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryViewClass. +func (s StoryViewClassArray) SortStable(less func(a, b StoryViewClass) bool) StoryViewClassArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryViewClass. +func (s StoryViewClassArray) Retain(keep func(x StoryViewClass) bool) StoryViewClassArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryViewClassArray) First() (v StoryViewClass, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryViewClassArray) Last() (v StoryViewClass, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryViewClassArray) PopFirst() (v StoryViewClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryViewClass + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryViewClassArray) Pop() (v StoryViewClass, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// AsStoryView returns copy with only StoryView constructors. +func (s StoryViewClassArray) AsStoryView() (to StoryViewArray) { + for _, elem := range s { + value, ok := elem.(*StoryView) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsStoryViewPublicForward returns copy with only StoryViewPublicForward constructors. +func (s StoryViewClassArray) AsStoryViewPublicForward() (to StoryViewPublicForwardArray) { + for _, elem := range s { + value, ok := elem.(*StoryViewPublicForward) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsStoryViewPublicRepost returns copy with only StoryViewPublicRepost constructors. +func (s StoryViewClassArray) AsStoryViewPublicRepost() (to StoryViewPublicRepostArray) { + for _, elem := range s { + value, ok := elem.(*StoryViewPublicRepost) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// StoryViewArray is adapter for slice of StoryView. +type StoryViewArray []StoryView + +// Sort sorts slice of StoryView. +func (s StoryViewArray) Sort(less func(a, b StoryView) bool) StoryViewArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryView. +func (s StoryViewArray) SortStable(less func(a, b StoryView) bool) StoryViewArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryView. +func (s StoryViewArray) Retain(keep func(x StoryView) bool) StoryViewArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryViewArray) First() (v StoryView, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryViewArray) Last() (v StoryView, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryViewArray) PopFirst() (v StoryView, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryView + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryViewArray) Pop() (v StoryView, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// SortByDate sorts slice of StoryView by Date. +func (s StoryViewArray) SortByDate() StoryViewArray { + return s.Sort(func(a, b StoryView) bool { + return a.GetDate() < b.GetDate() + }) +} + +// SortStableByDate sorts slice of StoryView by Date. +func (s StoryViewArray) SortStableByDate() StoryViewArray { + return s.SortStable(func(a, b StoryView) bool { + return a.GetDate() < b.GetDate() + }) +} + +// StoryViewPublicForwardArray is adapter for slice of StoryViewPublicForward. +type StoryViewPublicForwardArray []StoryViewPublicForward + +// Sort sorts slice of StoryViewPublicForward. +func (s StoryViewPublicForwardArray) Sort(less func(a, b StoryViewPublicForward) bool) StoryViewPublicForwardArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryViewPublicForward. +func (s StoryViewPublicForwardArray) SortStable(less func(a, b StoryViewPublicForward) bool) StoryViewPublicForwardArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryViewPublicForward. +func (s StoryViewPublicForwardArray) Retain(keep func(x StoryViewPublicForward) bool) StoryViewPublicForwardArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryViewPublicForwardArray) First() (v StoryViewPublicForward, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryViewPublicForwardArray) Last() (v StoryViewPublicForward, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryViewPublicForwardArray) PopFirst() (v StoryViewPublicForward, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryViewPublicForward + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryViewPublicForwardArray) Pop() (v StoryViewPublicForward, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// StoryViewPublicRepostArray is adapter for slice of StoryViewPublicRepost. +type StoryViewPublicRepostArray []StoryViewPublicRepost + +// Sort sorts slice of StoryViewPublicRepost. +func (s StoryViewPublicRepostArray) Sort(less func(a, b StoryViewPublicRepost) bool) StoryViewPublicRepostArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of StoryViewPublicRepost. +func (s StoryViewPublicRepostArray) SortStable(less func(a, b StoryViewPublicRepost) bool) StoryViewPublicRepostArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of StoryViewPublicRepost. +func (s StoryViewPublicRepostArray) Retain(keep func(x StoryViewPublicRepost) bool) StoryViewPublicRepostArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s StoryViewPublicRepostArray) First() (v StoryViewPublicRepost, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s StoryViewPublicRepostArray) Last() (v StoryViewPublicRepost, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *StoryViewPublicRepostArray) PopFirst() (v StoryViewPublicRepost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero StoryViewPublicRepost + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *StoryViewPublicRepostArray) Pop() (v StoryViewPublicRepost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_story_views_gen.go b/vendor/github.com/gotd/td/tg/tl_story_views_gen.go index f260725a..6afcd4b2 100644 --- a/vendor/github.com/gotd/td/tg/tl_story_views_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_story_views_gen.go @@ -32,28 +32,39 @@ var ( ) // StoryViews represents TL type `storyViews#8d595cd6`. +// Aggregated view and reaction information of a story¹. +// +// Links: +// 1. https://core.telegram.org/api/stories // // See https://core.telegram.org/constructor/storyViews for reference. type StoryViews struct { - // Flags field of StoryViews. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // HasViewers field of StoryViews. + // If set, indicates that the viewers list is currently viewable, and was not yet deleted + // because the story has expired while the user didn't have a Premium¹ account. + // + // Links: + // 1) https://core.telegram.org/api/premium HasViewers bool - // ViewsCount field of StoryViews. + // View counter of the story ViewsCount int - // ForwardsCount field of StoryViews. + // Forward counter of the story // // Use SetForwardsCount and GetForwardsCount helpers. ForwardsCount int - // Reactions field of StoryViews. + // All reactions sent to this story // // Use SetReactions and GetReactions helpers. Reactions []ReactionCount - // ReactionsCount field of StoryViews. + // Number of reactions added to the story // // Use SetReactionsCount and GetReactionsCount helpers. ReactionsCount int - // RecentViewers field of StoryViews. + // User IDs of some recent viewers of the story // // Use SetRecentViewers and GetRecentViewers helpers. RecentViewers []int64 diff --git a/vendor/github.com/gotd/td/tg/tl_update_gen.go b/vendor/github.com/gotd/td/tg/tl_update_gen.go index f0107464..a58f8d85 100644 --- a/vendor/github.com/gotd/td/tg/tl_update_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_update_gen.go @@ -1515,24 +1515,34 @@ func (u *UpdateUserName) GetUsernames() (value []Username) { } // UpdateNewAuthorization represents TL type `updateNewAuthorization#8951abef`. +// A new session logged into the current user's account through an unknown device. // // See https://core.telegram.org/constructor/updateNewAuthorization for reference. type UpdateNewAuthorization struct { - // Flags field of UpdateNewAuthorization. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Unconfirmed field of UpdateNewAuthorization. + // Whether the session is unconfirmed, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/auth#confirming-login Unconfirmed bool - // Hash field of UpdateNewAuthorization. + // Hash for pagination, for more info click here¹ + // + // Links: + // 1) https://core.telegram.org/api/offsets#hash-generation Hash int64 - // Date field of UpdateNewAuthorization. + // Authorization date // // Use SetDate and GetDate helpers. Date int - // Device field of UpdateNewAuthorization. + // Name of device, for example Android // // Use SetDevice and GetDevice helpers. Device string - // Location field of UpdateNewAuthorization. + // Location, for example USA, NY (IP=1.2.3.4) // // Use SetLocation and GetLocation helpers. Location string @@ -3275,7 +3285,8 @@ type UpdateServiceNotification struct { Flags bin.Fields // If set, the message must be displayed in a popup. Popup bool - // InvertMedia field of UpdateServiceNotification. + // If set, any eventual webpage preview will be shown on top of the message instead of at + // the bottom. InvertMedia bool // When was the notification receivedThe message must also be stored locally as part of // the message history with the user id 777000 (Telegram Notifications). @@ -4771,7 +4782,10 @@ func (u *UpdateWebPage) GetPtsCount() (value int) { // // See https://core.telegram.org/constructor/updateReadMessagesContents for reference. type UpdateReadMessagesContents struct { - // Flags field of UpdateReadMessagesContents. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // IDs of read messages Messages []int @@ -4785,7 +4799,7 @@ type UpdateReadMessagesContents struct { // Links: // 1) https://core.telegram.org/api/updates PtsCount int - // Date field of UpdateReadMessagesContents. + // When was the last message in messages marked as read. // // Use SetDate and GetDate helpers. Date int @@ -5250,7 +5264,8 @@ func (u *UpdateChannelTooLong) GetPts() (value int, ok bool) { } // UpdateChannel represents TL type `updateChannel#635b4c09`. -// A new channel is available +// A new channel or supergroup is available, or info about an existing channel has +// changed and must be refeteched. // // See https://core.telegram.org/constructor/updateChannel for reference. type UpdateChannel struct { @@ -14399,13 +14414,13 @@ func (u *UpdateLoginToken) DecodeBare(b *bin.Buffer) error { } // UpdateMessagePollVote represents TL type `updateMessagePollVote#24f40e77`. -// A specific user has voted in a poll +// A specific peer has voted in a poll // // See https://core.telegram.org/constructor/updateMessagePollVote for reference. type UpdateMessagePollVote struct { // Poll ID PollID int64 - // Peer field of UpdateMessagePollVote. + // The peer that voted in the poll Peer PeerClass // Chosen option(s) Options [][]byte @@ -15991,17 +16006,27 @@ func (u *UpdateReadChannelDiscussionOutbox) GetReadMaxID() (value int) { } // UpdatePeerBlocked represents TL type `updatePeerBlocked#ebe07752`. -// A peer was blocked +// We blocked a peer, see here »¹ for more info on blocklists. +// +// Links: +// 1. https://core.telegram.org/api/block // // See https://core.telegram.org/constructor/updatePeerBlocked for reference. type UpdatePeerBlocked struct { - // Flags field of UpdatePeerBlocked. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Whether the peer was blocked or unblocked Blocked bool - // BlockedMyStoriesFrom field of UpdatePeerBlocked. + // Whether the peer was added/removed to/from the story blocklist; if not set, this + // update affects the main blocklist, see here »¹ for more info. + // + // Links: + // 1) https://core.telegram.org/api/block BlockedMyStoriesFrom bool - // The blocked peer + // The (un)blocked peer PeerID PeerClass } @@ -22656,12 +22681,13 @@ func (u *UpdateGroupInvitePrivacyForbidden) GetUserID() (value int64) { } // UpdateStory represents TL type `updateStory#75b3b798`. +// A new story was posted. // // See https://core.telegram.org/constructor/updateStory for reference. type UpdateStory struct { - // Peer field of UpdateStory. + // ID of the poster. Peer PeerClass - // Story field of UpdateStory. + // The story that was posted. Story StoryItemClass } @@ -22827,12 +22853,13 @@ func (u *UpdateStory) GetStory() (value StoryItemClass) { } // UpdateReadStories represents TL type `updateReadStories#f74e932b`. +// Stories of a specific peer were marked as read. // // See https://core.telegram.org/constructor/updateReadStories for reference. type UpdateReadStories struct { - // Peer field of UpdateReadStories. + // The peer Peer PeerClass - // MaxID field of UpdateReadStories. + // ID of the last story that was marked as read MaxID int } @@ -22993,12 +23020,26 @@ func (u *UpdateReadStories) GetMaxID() (value int) { } // UpdateStoryID represents TL type `updateStoryID#1bf335b9`. +// A story was successfully uploaded. +// Once a story is successfully uploaded, an updateStoryID¹ will be returned, indicating +// the story ID (id) that was attributed to the story (like for messages, random_id +// indicates the random_id that was passed to stories.sendStory²: this way, you can tell +// which story was assigned a specific id by checking which stories.sendStory³ call has +// the returned random_id). +// +// Links: +// 1. https://core.telegram.org/constructor/updateStoryID +// 2. https://core.telegram.org/method/stories.sendStory +// 3. https://core.telegram.org/method/stories.sendStory // // See https://core.telegram.org/constructor/updateStoryID for reference. type UpdateStoryID struct { - // ID field of UpdateStoryID. + // The id that was attributed to the story. ID int - // RandomID field of UpdateStoryID. + // The random_id that was passed to stories.sendStory¹. + // + // Links: + // 1) https://core.telegram.org/method/stories.sendStory RandomID int64 } @@ -23154,10 +23195,17 @@ func (u *UpdateStoryID) GetRandomID() (value int64) { } // UpdateStoriesStealthMode represents TL type `updateStoriesStealthMode#2c084dc1`. +// Indicates that stories stealth mode¹ was activated. +// +// Links: +// 1. https://core.telegram.org/api/stories#stealth-mode // // See https://core.telegram.org/constructor/updateStoriesStealthMode for reference. type UpdateStoriesStealthMode struct { - // StealthMode field of UpdateStoriesStealthMode. + // Information about the current stealth mode¹ session. + // + // Links: + // 1) https://core.telegram.org/api/stories#stealth-mode StealthMode StoriesStealthMode } @@ -23288,14 +23336,18 @@ func (u *UpdateStoriesStealthMode) GetStealthMode() (value StoriesStealthMode) { } // UpdateSentStoryReaction represents TL type `updateSentStoryReaction#7d627683`. +// Indicates we reacted to a story »¹. +// +// Links: +// 1. https://core.telegram.org/api/stories#reactions // // See https://core.telegram.org/constructor/updateSentStoryReaction for reference. type UpdateSentStoryReaction struct { - // Peer field of UpdateSentStoryReaction. + // The peer that sent the story Peer PeerClass - // StoryID field of UpdateSentStoryReaction. + // ID of the story we reacted to StoryID int - // Reaction field of UpdateSentStoryReaction. + // The reaction that was sent Reaction ReactionClass } @@ -23485,6 +23537,1251 @@ func (u *UpdateSentStoryReaction) GetReaction() (value ReactionClass) { return u.Reaction } +// UpdateBotChatBoost represents TL type `updateBotChatBoost#904dd49c`. +// A channel boost¹ has changed (bots only) +// +// Links: +// 1. https://core.telegram.org/api/boost +// +// See https://core.telegram.org/constructor/updateBotChatBoost for reference. +type UpdateBotChatBoost struct { + // Channel + Peer PeerClass + // New boost information + Boost Boost + // QTS¹ event sequence identifier + // + // Links: + // 1) https://core.telegram.org/api/updates + Qts int +} + +// UpdateBotChatBoostTypeID is TL type id of UpdateBotChatBoost. +const UpdateBotChatBoostTypeID = 0x904dd49c + +// construct implements constructor of UpdateClass. +func (u UpdateBotChatBoost) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateBotChatBoost. +var ( + _ bin.Encoder = &UpdateBotChatBoost{} + _ bin.Decoder = &UpdateBotChatBoost{} + _ bin.BareEncoder = &UpdateBotChatBoost{} + _ bin.BareDecoder = &UpdateBotChatBoost{} + + _ UpdateClass = &UpdateBotChatBoost{} +) + +func (u *UpdateBotChatBoost) Zero() bool { + if u == nil { + return true + } + if !(u.Peer == nil) { + return false + } + if !(u.Boost.Zero()) { + return false + } + if !(u.Qts == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateBotChatBoost) String() string { + if u == nil { + return "UpdateBotChatBoost(nil)" + } + type Alias UpdateBotChatBoost + return fmt.Sprintf("UpdateBotChatBoost%+v", Alias(*u)) +} + +// FillFrom fills UpdateBotChatBoost from given interface. +func (u *UpdateBotChatBoost) FillFrom(from interface { + GetPeer() (value PeerClass) + GetBoost() (value Boost) + GetQts() (value int) +}) { + u.Peer = from.GetPeer() + u.Boost = from.GetBoost() + u.Qts = from.GetQts() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateBotChatBoost) TypeID() uint32 { + return UpdateBotChatBoostTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateBotChatBoost) TypeName() string { + return "updateBotChatBoost" +} + +// TypeInfo returns info about TL type. +func (u *UpdateBotChatBoost) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateBotChatBoost", + ID: UpdateBotChatBoostTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "Boost", + SchemaName: "boost", + }, + { + Name: "Qts", + SchemaName: "qts", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateBotChatBoost) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateBotChatBoost#904dd49c as nil") + } + b.PutID(UpdateBotChatBoostTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateBotChatBoost) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateBotChatBoost#904dd49c as nil") + } + if u.Peer == nil { + return fmt.Errorf("unable to encode updateBotChatBoost#904dd49c: field peer is nil") + } + if err := u.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotChatBoost#904dd49c: field peer: %w", err) + } + if err := u.Boost.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotChatBoost#904dd49c: field boost: %w", err) + } + b.PutInt(u.Qts) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateBotChatBoost) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateBotChatBoost#904dd49c to nil") + } + if err := b.ConsumeID(UpdateBotChatBoostTypeID); err != nil { + return fmt.Errorf("unable to decode updateBotChatBoost#904dd49c: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateBotChatBoost) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateBotChatBoost#904dd49c to nil") + } + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode updateBotChatBoost#904dd49c: field peer: %w", err) + } + u.Peer = value + } + { + if err := u.Boost.Decode(b); err != nil { + return fmt.Errorf("unable to decode updateBotChatBoost#904dd49c: field boost: %w", err) + } + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateBotChatBoost#904dd49c: field qts: %w", err) + } + u.Qts = value + } + return nil +} + +// GetPeer returns value of Peer field. +func (u *UpdateBotChatBoost) GetPeer() (value PeerClass) { + if u == nil { + return + } + return u.Peer +} + +// GetBoost returns value of Boost field. +func (u *UpdateBotChatBoost) GetBoost() (value Boost) { + if u == nil { + return + } + return u.Boost +} + +// GetQts returns value of Qts field. +func (u *UpdateBotChatBoost) GetQts() (value int) { + if u == nil { + return + } + return u.Qts +} + +// UpdateChannelViewForumAsMessages represents TL type `updateChannelViewForumAsMessages#7b68920`. +// Users may also choose to display messages from all topics as if they were sent to a +// normal group, using a "View as messages" setting in the local client. +// This setting only affects the current account, and is synced to other logged in +// sessions using the channels.toggleViewForumAsMessages¹ method; invoking this method +// will update the value of the view_forum_as_messages flag of channelFull² or dialog³ +// and emit an updateChannelViewForumAsMessages⁴. +// +// Links: +// 1. https://core.telegram.org/method/channels.toggleViewForumAsMessages +// 2. https://core.telegram.org/constructor/channelFull +// 3. https://core.telegram.org/constructor/dialog +// 4. https://core.telegram.org/constructor/updateChannelViewForumAsMessages +// +// See https://core.telegram.org/constructor/updateChannelViewForumAsMessages for reference. +type UpdateChannelViewForumAsMessages struct { + // The forum ID + ChannelID int64 + // The new value of the toggle. + Enabled bool +} + +// UpdateChannelViewForumAsMessagesTypeID is TL type id of UpdateChannelViewForumAsMessages. +const UpdateChannelViewForumAsMessagesTypeID = 0x7b68920 + +// construct implements constructor of UpdateClass. +func (u UpdateChannelViewForumAsMessages) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateChannelViewForumAsMessages. +var ( + _ bin.Encoder = &UpdateChannelViewForumAsMessages{} + _ bin.Decoder = &UpdateChannelViewForumAsMessages{} + _ bin.BareEncoder = &UpdateChannelViewForumAsMessages{} + _ bin.BareDecoder = &UpdateChannelViewForumAsMessages{} + + _ UpdateClass = &UpdateChannelViewForumAsMessages{} +) + +func (u *UpdateChannelViewForumAsMessages) Zero() bool { + if u == nil { + return true + } + if !(u.ChannelID == 0) { + return false + } + if !(u.Enabled == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateChannelViewForumAsMessages) String() string { + if u == nil { + return "UpdateChannelViewForumAsMessages(nil)" + } + type Alias UpdateChannelViewForumAsMessages + return fmt.Sprintf("UpdateChannelViewForumAsMessages%+v", Alias(*u)) +} + +// FillFrom fills UpdateChannelViewForumAsMessages from given interface. +func (u *UpdateChannelViewForumAsMessages) FillFrom(from interface { + GetChannelID() (value int64) + GetEnabled() (value bool) +}) { + u.ChannelID = from.GetChannelID() + u.Enabled = from.GetEnabled() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateChannelViewForumAsMessages) TypeID() uint32 { + return UpdateChannelViewForumAsMessagesTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateChannelViewForumAsMessages) TypeName() string { + return "updateChannelViewForumAsMessages" +} + +// TypeInfo returns info about TL type. +func (u *UpdateChannelViewForumAsMessages) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateChannelViewForumAsMessages", + ID: UpdateChannelViewForumAsMessagesTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ChannelID", + SchemaName: "channel_id", + }, + { + Name: "Enabled", + SchemaName: "enabled", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateChannelViewForumAsMessages) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChannelViewForumAsMessages#7b68920 as nil") + } + b.PutID(UpdateChannelViewForumAsMessagesTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateChannelViewForumAsMessages) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateChannelViewForumAsMessages#7b68920 as nil") + } + b.PutLong(u.ChannelID) + b.PutBool(u.Enabled) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateChannelViewForumAsMessages) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChannelViewForumAsMessages#7b68920 to nil") + } + if err := b.ConsumeID(UpdateChannelViewForumAsMessagesTypeID); err != nil { + return fmt.Errorf("unable to decode updateChannelViewForumAsMessages#7b68920: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateChannelViewForumAsMessages) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateChannelViewForumAsMessages#7b68920 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode updateChannelViewForumAsMessages#7b68920: field channel_id: %w", err) + } + u.ChannelID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode updateChannelViewForumAsMessages#7b68920: field enabled: %w", err) + } + u.Enabled = value + } + return nil +} + +// GetChannelID returns value of ChannelID field. +func (u *UpdateChannelViewForumAsMessages) GetChannelID() (value int64) { + if u == nil { + return + } + return u.ChannelID +} + +// GetEnabled returns value of Enabled field. +func (u *UpdateChannelViewForumAsMessages) GetEnabled() (value bool) { + if u == nil { + return + } + return u.Enabled +} + +// UpdatePeerWallpaper represents TL type `updatePeerWallpaper#ae3f101d`. +// The wallpaper »¹ of a given peer has changed. +// +// Links: +// 1. https://core.telegram.org/api/wallpapers +// +// See https://core.telegram.org/constructor/updatePeerWallpaper for reference. +type UpdatePeerWallpaper struct { + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields + Flags bin.Fields + // Whether the other user has chosen a custom wallpaper for us using messages + // setChatWallPaper¹ and the for_both flag, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/method/messages.setChatWallPaper + // 2) https://core.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chat + WallpaperOverridden bool + // The peer where the wallpaper has changed. + Peer PeerClass + // The new wallpaper, if none the wallpaper was removed and the default wallpaper should + // be used. + // + // Use SetWallpaper and GetWallpaper helpers. + Wallpaper WallPaperClass +} + +// UpdatePeerWallpaperTypeID is TL type id of UpdatePeerWallpaper. +const UpdatePeerWallpaperTypeID = 0xae3f101d + +// construct implements constructor of UpdateClass. +func (u UpdatePeerWallpaper) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdatePeerWallpaper. +var ( + _ bin.Encoder = &UpdatePeerWallpaper{} + _ bin.Decoder = &UpdatePeerWallpaper{} + _ bin.BareEncoder = &UpdatePeerWallpaper{} + _ bin.BareDecoder = &UpdatePeerWallpaper{} + + _ UpdateClass = &UpdatePeerWallpaper{} +) + +func (u *UpdatePeerWallpaper) Zero() bool { + if u == nil { + return true + } + if !(u.Flags.Zero()) { + return false + } + if !(u.WallpaperOverridden == false) { + return false + } + if !(u.Peer == nil) { + return false + } + if !(u.Wallpaper == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdatePeerWallpaper) String() string { + if u == nil { + return "UpdatePeerWallpaper(nil)" + } + type Alias UpdatePeerWallpaper + return fmt.Sprintf("UpdatePeerWallpaper%+v", Alias(*u)) +} + +// FillFrom fills UpdatePeerWallpaper from given interface. +func (u *UpdatePeerWallpaper) FillFrom(from interface { + GetWallpaperOverridden() (value bool) + GetPeer() (value PeerClass) + GetWallpaper() (value WallPaperClass, ok bool) +}) { + u.WallpaperOverridden = from.GetWallpaperOverridden() + u.Peer = from.GetPeer() + if val, ok := from.GetWallpaper(); ok { + u.Wallpaper = val + } + +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdatePeerWallpaper) TypeID() uint32 { + return UpdatePeerWallpaperTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdatePeerWallpaper) TypeName() string { + return "updatePeerWallpaper" +} + +// TypeInfo returns info about TL type. +func (u *UpdatePeerWallpaper) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updatePeerWallpaper", + ID: UpdatePeerWallpaperTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "WallpaperOverridden", + SchemaName: "wallpaper_overridden", + Null: !u.Flags.Has(1), + }, + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "Wallpaper", + SchemaName: "wallpaper", + Null: !u.Flags.Has(0), + }, + } + return typ +} + +// SetFlags sets flags for non-zero fields. +func (u *UpdatePeerWallpaper) SetFlags() { + if !(u.WallpaperOverridden == false) { + u.Flags.Set(1) + } + if !(u.Wallpaper == nil) { + u.Flags.Set(0) + } +} + +// Encode implements bin.Encoder. +func (u *UpdatePeerWallpaper) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updatePeerWallpaper#ae3f101d as nil") + } + b.PutID(UpdatePeerWallpaperTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdatePeerWallpaper) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updatePeerWallpaper#ae3f101d as nil") + } + u.SetFlags() + if err := u.Flags.Encode(b); err != nil { + return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field flags: %w", err) + } + if u.Peer == nil { + return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field peer is nil") + } + if err := u.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field peer: %w", err) + } + if u.Flags.Has(0) { + if u.Wallpaper == nil { + return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field wallpaper is nil") + } + if err := u.Wallpaper.Encode(b); err != nil { + return fmt.Errorf("unable to encode updatePeerWallpaper#ae3f101d: field wallpaper: %w", err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdatePeerWallpaper) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updatePeerWallpaper#ae3f101d to nil") + } + if err := b.ConsumeID(UpdatePeerWallpaperTypeID); err != nil { + return fmt.Errorf("unable to decode updatePeerWallpaper#ae3f101d: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdatePeerWallpaper) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updatePeerWallpaper#ae3f101d to nil") + } + { + if err := u.Flags.Decode(b); err != nil { + return fmt.Errorf("unable to decode updatePeerWallpaper#ae3f101d: field flags: %w", err) + } + } + u.WallpaperOverridden = u.Flags.Has(1) + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode updatePeerWallpaper#ae3f101d: field peer: %w", err) + } + u.Peer = value + } + if u.Flags.Has(0) { + value, err := DecodeWallPaper(b) + if err != nil { + return fmt.Errorf("unable to decode updatePeerWallpaper#ae3f101d: field wallpaper: %w", err) + } + u.Wallpaper = value + } + return nil +} + +// SetWallpaperOverridden sets value of WallpaperOverridden conditional field. +func (u *UpdatePeerWallpaper) SetWallpaperOverridden(value bool) { + if value { + u.Flags.Set(1) + u.WallpaperOverridden = true + } else { + u.Flags.Unset(1) + u.WallpaperOverridden = false + } +} + +// GetWallpaperOverridden returns value of WallpaperOverridden conditional field. +func (u *UpdatePeerWallpaper) GetWallpaperOverridden() (value bool) { + if u == nil { + return + } + return u.Flags.Has(1) +} + +// GetPeer returns value of Peer field. +func (u *UpdatePeerWallpaper) GetPeer() (value PeerClass) { + if u == nil { + return + } + return u.Peer +} + +// SetWallpaper sets value of Wallpaper conditional field. +func (u *UpdatePeerWallpaper) SetWallpaper(value WallPaperClass) { + u.Flags.Set(0) + u.Wallpaper = value +} + +// GetWallpaper returns value of Wallpaper conditional field and +// boolean which is true if field was set. +func (u *UpdatePeerWallpaper) GetWallpaper() (value WallPaperClass, ok bool) { + if u == nil { + return + } + if !u.Flags.Has(0) { + return value, false + } + return u.Wallpaper, true +} + +// UpdateBotMessageReaction represents TL type `updateBotMessageReaction#ac21d3ce`. +// +// See https://core.telegram.org/constructor/updateBotMessageReaction for reference. +type UpdateBotMessageReaction struct { + // Peer field of UpdateBotMessageReaction. + Peer PeerClass + // MsgID field of UpdateBotMessageReaction. + MsgID int + // Date field of UpdateBotMessageReaction. + Date int + // Actor field of UpdateBotMessageReaction. + Actor PeerClass + // OldReactions field of UpdateBotMessageReaction. + OldReactions []ReactionClass + // NewReactions field of UpdateBotMessageReaction. + NewReactions []ReactionClass + // Qts field of UpdateBotMessageReaction. + Qts int +} + +// UpdateBotMessageReactionTypeID is TL type id of UpdateBotMessageReaction. +const UpdateBotMessageReactionTypeID = 0xac21d3ce + +// construct implements constructor of UpdateClass. +func (u UpdateBotMessageReaction) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateBotMessageReaction. +var ( + _ bin.Encoder = &UpdateBotMessageReaction{} + _ bin.Decoder = &UpdateBotMessageReaction{} + _ bin.BareEncoder = &UpdateBotMessageReaction{} + _ bin.BareDecoder = &UpdateBotMessageReaction{} + + _ UpdateClass = &UpdateBotMessageReaction{} +) + +func (u *UpdateBotMessageReaction) Zero() bool { + if u == nil { + return true + } + if !(u.Peer == nil) { + return false + } + if !(u.MsgID == 0) { + return false + } + if !(u.Date == 0) { + return false + } + if !(u.Actor == nil) { + return false + } + if !(u.OldReactions == nil) { + return false + } + if !(u.NewReactions == nil) { + return false + } + if !(u.Qts == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateBotMessageReaction) String() string { + if u == nil { + return "UpdateBotMessageReaction(nil)" + } + type Alias UpdateBotMessageReaction + return fmt.Sprintf("UpdateBotMessageReaction%+v", Alias(*u)) +} + +// FillFrom fills UpdateBotMessageReaction from given interface. +func (u *UpdateBotMessageReaction) FillFrom(from interface { + GetPeer() (value PeerClass) + GetMsgID() (value int) + GetDate() (value int) + GetActor() (value PeerClass) + GetOldReactions() (value []ReactionClass) + GetNewReactions() (value []ReactionClass) + GetQts() (value int) +}) { + u.Peer = from.GetPeer() + u.MsgID = from.GetMsgID() + u.Date = from.GetDate() + u.Actor = from.GetActor() + u.OldReactions = from.GetOldReactions() + u.NewReactions = from.GetNewReactions() + u.Qts = from.GetQts() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateBotMessageReaction) TypeID() uint32 { + return UpdateBotMessageReactionTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateBotMessageReaction) TypeName() string { + return "updateBotMessageReaction" +} + +// TypeInfo returns info about TL type. +func (u *UpdateBotMessageReaction) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateBotMessageReaction", + ID: UpdateBotMessageReactionTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "MsgID", + SchemaName: "msg_id", + }, + { + Name: "Date", + SchemaName: "date", + }, + { + Name: "Actor", + SchemaName: "actor", + }, + { + Name: "OldReactions", + SchemaName: "old_reactions", + }, + { + Name: "NewReactions", + SchemaName: "new_reactions", + }, + { + Name: "Qts", + SchemaName: "qts", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateBotMessageReaction) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateBotMessageReaction#ac21d3ce as nil") + } + b.PutID(UpdateBotMessageReactionTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateBotMessageReaction) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateBotMessageReaction#ac21d3ce as nil") + } + if u.Peer == nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field peer is nil") + } + if err := u.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field peer: %w", err) + } + b.PutInt(u.MsgID) + b.PutInt(u.Date) + if u.Actor == nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field actor is nil") + } + if err := u.Actor.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field actor: %w", err) + } + b.PutVectorHeader(len(u.OldReactions)) + for idx, v := range u.OldReactions { + if v == nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field old_reactions element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field old_reactions element with index %d: %w", idx, err) + } + } + b.PutVectorHeader(len(u.NewReactions)) + for idx, v := range u.NewReactions { + if v == nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field new_reactions element with index %d is nil", idx) + } + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotMessageReaction#ac21d3ce: field new_reactions element with index %d: %w", idx, err) + } + } + b.PutInt(u.Qts) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateBotMessageReaction) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateBotMessageReaction#ac21d3ce to nil") + } + if err := b.ConsumeID(UpdateBotMessageReactionTypeID); err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateBotMessageReaction) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateBotMessageReaction#ac21d3ce to nil") + } + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field peer: %w", err) + } + u.Peer = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field msg_id: %w", err) + } + u.MsgID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field date: %w", err) + } + u.Date = value + } + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field actor: %w", err) + } + u.Actor = value + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field old_reactions: %w", err) + } + + if headerLen > 0 { + u.OldReactions = make([]ReactionClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeReaction(b) + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field old_reactions: %w", err) + } + u.OldReactions = append(u.OldReactions, value) + } + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field new_reactions: %w", err) + } + + if headerLen > 0 { + u.NewReactions = make([]ReactionClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodeReaction(b) + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field new_reactions: %w", err) + } + u.NewReactions = append(u.NewReactions, value) + } + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReaction#ac21d3ce: field qts: %w", err) + } + u.Qts = value + } + return nil +} + +// GetPeer returns value of Peer field. +func (u *UpdateBotMessageReaction) GetPeer() (value PeerClass) { + if u == nil { + return + } + return u.Peer +} + +// GetMsgID returns value of MsgID field. +func (u *UpdateBotMessageReaction) GetMsgID() (value int) { + if u == nil { + return + } + return u.MsgID +} + +// GetDate returns value of Date field. +func (u *UpdateBotMessageReaction) GetDate() (value int) { + if u == nil { + return + } + return u.Date +} + +// GetActor returns value of Actor field. +func (u *UpdateBotMessageReaction) GetActor() (value PeerClass) { + if u == nil { + return + } + return u.Actor +} + +// GetOldReactions returns value of OldReactions field. +func (u *UpdateBotMessageReaction) GetOldReactions() (value []ReactionClass) { + if u == nil { + return + } + return u.OldReactions +} + +// GetNewReactions returns value of NewReactions field. +func (u *UpdateBotMessageReaction) GetNewReactions() (value []ReactionClass) { + if u == nil { + return + } + return u.NewReactions +} + +// GetQts returns value of Qts field. +func (u *UpdateBotMessageReaction) GetQts() (value int) { + if u == nil { + return + } + return u.Qts +} + +// MapOldReactions returns field OldReactions wrapped in ReactionClassArray helper. +func (u *UpdateBotMessageReaction) MapOldReactions() (value ReactionClassArray) { + return ReactionClassArray(u.OldReactions) +} + +// MapNewReactions returns field NewReactions wrapped in ReactionClassArray helper. +func (u *UpdateBotMessageReaction) MapNewReactions() (value ReactionClassArray) { + return ReactionClassArray(u.NewReactions) +} + +// UpdateBotMessageReactions represents TL type `updateBotMessageReactions#9cb7759`. +// +// See https://core.telegram.org/constructor/updateBotMessageReactions for reference. +type UpdateBotMessageReactions struct { + // Peer field of UpdateBotMessageReactions. + Peer PeerClass + // MsgID field of UpdateBotMessageReactions. + MsgID int + // Date field of UpdateBotMessageReactions. + Date int + // Reactions field of UpdateBotMessageReactions. + Reactions []ReactionCount + // Qts field of UpdateBotMessageReactions. + Qts int +} + +// UpdateBotMessageReactionsTypeID is TL type id of UpdateBotMessageReactions. +const UpdateBotMessageReactionsTypeID = 0x9cb7759 + +// construct implements constructor of UpdateClass. +func (u UpdateBotMessageReactions) construct() UpdateClass { return &u } + +// Ensuring interfaces in compile-time for UpdateBotMessageReactions. +var ( + _ bin.Encoder = &UpdateBotMessageReactions{} + _ bin.Decoder = &UpdateBotMessageReactions{} + _ bin.BareEncoder = &UpdateBotMessageReactions{} + _ bin.BareDecoder = &UpdateBotMessageReactions{} + + _ UpdateClass = &UpdateBotMessageReactions{} +) + +func (u *UpdateBotMessageReactions) Zero() bool { + if u == nil { + return true + } + if !(u.Peer == nil) { + return false + } + if !(u.MsgID == 0) { + return false + } + if !(u.Date == 0) { + return false + } + if !(u.Reactions == nil) { + return false + } + if !(u.Qts == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UpdateBotMessageReactions) String() string { + if u == nil { + return "UpdateBotMessageReactions(nil)" + } + type Alias UpdateBotMessageReactions + return fmt.Sprintf("UpdateBotMessageReactions%+v", Alias(*u)) +} + +// FillFrom fills UpdateBotMessageReactions from given interface. +func (u *UpdateBotMessageReactions) FillFrom(from interface { + GetPeer() (value PeerClass) + GetMsgID() (value int) + GetDate() (value int) + GetReactions() (value []ReactionCount) + GetQts() (value int) +}) { + u.Peer = from.GetPeer() + u.MsgID = from.GetMsgID() + u.Date = from.GetDate() + u.Reactions = from.GetReactions() + u.Qts = from.GetQts() +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UpdateBotMessageReactions) TypeID() uint32 { + return UpdateBotMessageReactionsTypeID +} + +// TypeName returns name of type in TL schema. +func (*UpdateBotMessageReactions) TypeName() string { + return "updateBotMessageReactions" +} + +// TypeInfo returns info about TL type. +func (u *UpdateBotMessageReactions) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "updateBotMessageReactions", + ID: UpdateBotMessageReactionsTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Peer", + SchemaName: "peer", + }, + { + Name: "MsgID", + SchemaName: "msg_id", + }, + { + Name: "Date", + SchemaName: "date", + }, + { + Name: "Reactions", + SchemaName: "reactions", + }, + { + Name: "Qts", + SchemaName: "qts", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UpdateBotMessageReactions) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateBotMessageReactions#9cb7759 as nil") + } + b.PutID(UpdateBotMessageReactionsTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UpdateBotMessageReactions) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode updateBotMessageReactions#9cb7759 as nil") + } + if u.Peer == nil { + return fmt.Errorf("unable to encode updateBotMessageReactions#9cb7759: field peer is nil") + } + if err := u.Peer.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotMessageReactions#9cb7759: field peer: %w", err) + } + b.PutInt(u.MsgID) + b.PutInt(u.Date) + b.PutVectorHeader(len(u.Reactions)) + for idx, v := range u.Reactions { + if err := v.Encode(b); err != nil { + return fmt.Errorf("unable to encode updateBotMessageReactions#9cb7759: field reactions element with index %d: %w", idx, err) + } + } + b.PutInt(u.Qts) + return nil +} + +// Decode implements bin.Decoder. +func (u *UpdateBotMessageReactions) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateBotMessageReactions#9cb7759 to nil") + } + if err := b.ConsumeID(UpdateBotMessageReactionsTypeID); err != nil { + return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UpdateBotMessageReactions) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode updateBotMessageReactions#9cb7759 to nil") + } + { + value, err := DecodePeer(b) + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field peer: %w", err) + } + u.Peer = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field msg_id: %w", err) + } + u.MsgID = value + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field date: %w", err) + } + u.Date = value + } + { + headerLen, err := b.VectorHeader() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field reactions: %w", err) + } + + if headerLen > 0 { + u.Reactions = make([]ReactionCount, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value ReactionCount + if err := value.Decode(b); err != nil { + return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field reactions: %w", err) + } + u.Reactions = append(u.Reactions, value) + } + } + { + value, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode updateBotMessageReactions#9cb7759: field qts: %w", err) + } + u.Qts = value + } + return nil +} + +// GetPeer returns value of Peer field. +func (u *UpdateBotMessageReactions) GetPeer() (value PeerClass) { + if u == nil { + return + } + return u.Peer +} + +// GetMsgID returns value of MsgID field. +func (u *UpdateBotMessageReactions) GetMsgID() (value int) { + if u == nil { + return + } + return u.MsgID +} + +// GetDate returns value of Date field. +func (u *UpdateBotMessageReactions) GetDate() (value int) { + if u == nil { + return + } + return u.Date +} + +// GetReactions returns value of Reactions field. +func (u *UpdateBotMessageReactions) GetReactions() (value []ReactionCount) { + if u == nil { + return + } + return u.Reactions +} + +// GetQts returns value of Qts field. +func (u *UpdateBotMessageReactions) GetQts() (value int) { + if u == nil { + return + } + return u.Qts +} + // UpdateClassName is schema name of UpdateClass. const UpdateClassName = "Update" @@ -23616,6 +24913,11 @@ const UpdateClassName = "Update" // case *tg.UpdateStoryID: // updateStoryID#1bf335b9 // case *tg.UpdateStoriesStealthMode: // updateStoriesStealthMode#2c084dc1 // case *tg.UpdateSentStoryReaction: // updateSentStoryReaction#7d627683 +// case *tg.UpdateBotChatBoost: // updateBotChatBoost#904dd49c +// case *tg.UpdateChannelViewForumAsMessages: // updateChannelViewForumAsMessages#7b68920 +// case *tg.UpdatePeerWallpaper: // updatePeerWallpaper#ae3f101d +// case *tg.UpdateBotMessageReaction: // updateBotMessageReaction#ac21d3ce +// case *tg.UpdateBotMessageReactions: // updateBotMessageReactions#9cb7759 // default: panic(v) // } type UpdateClass interface { @@ -24463,6 +25765,41 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) } return &v, nil + case UpdateBotChatBoostTypeID: + // Decoding updateBotChatBoost#904dd49c. + v := UpdateBotChatBoost{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case UpdateChannelViewForumAsMessagesTypeID: + // Decoding updateChannelViewForumAsMessages#7b68920. + v := UpdateChannelViewForumAsMessages{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case UpdatePeerWallpaperTypeID: + // Decoding updatePeerWallpaper#ae3f101d. + v := UpdatePeerWallpaper{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case UpdateBotMessageReactionTypeID: + // Decoding updateBotMessageReaction#ac21d3ce. + v := UpdateBotMessageReaction{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil + case UpdateBotMessageReactionsTypeID: + // Decoding updateBotMessageReactions#9cb7759. + v := UpdateBotMessageReactions{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode UpdateClass: %w", bin.NewUnexpectedID(id)) } diff --git a/vendor/github.com/gotd/td/tg/tl_update_slices_gen.go b/vendor/github.com/gotd/td/tg/tl_update_slices_gen.go index 88afe7e1..109235eb 100644 --- a/vendor/github.com/gotd/td/tg/tl_update_slices_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_update_slices_gen.go @@ -1442,6 +1442,71 @@ func (s UpdateClassArray) AsUpdateSentStoryReaction() (to UpdateSentStoryReactio return to } +// AsUpdateBotChatBoost returns copy with only UpdateBotChatBoost constructors. +func (s UpdateClassArray) AsUpdateBotChatBoost() (to UpdateBotChatBoostArray) { + for _, elem := range s { + value, ok := elem.(*UpdateBotChatBoost) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsUpdateChannelViewForumAsMessages returns copy with only UpdateChannelViewForumAsMessages constructors. +func (s UpdateClassArray) AsUpdateChannelViewForumAsMessages() (to UpdateChannelViewForumAsMessagesArray) { + for _, elem := range s { + value, ok := elem.(*UpdateChannelViewForumAsMessages) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsUpdatePeerWallpaper returns copy with only UpdatePeerWallpaper constructors. +func (s UpdateClassArray) AsUpdatePeerWallpaper() (to UpdatePeerWallpaperArray) { + for _, elem := range s { + value, ok := elem.(*UpdatePeerWallpaper) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsUpdateBotMessageReaction returns copy with only UpdateBotMessageReaction constructors. +func (s UpdateClassArray) AsUpdateBotMessageReaction() (to UpdateBotMessageReactionArray) { + for _, elem := range s { + value, ok := elem.(*UpdateBotMessageReaction) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + +// AsUpdateBotMessageReactions returns copy with only UpdateBotMessageReactions constructors. +func (s UpdateClassArray) AsUpdateBotMessageReactions() (to UpdateBotMessageReactionsArray) { + for _, elem := range s { + value, ok := elem.(*UpdateBotMessageReactions) + if !ok { + continue + } + to = append(to, *value) + } + + return to +} + // UpdateNewMessageArray is adapter for slice of UpdateNewMessage. type UpdateNewMessageArray []UpdateNewMessage @@ -10043,3 +10108,441 @@ func (s *UpdateSentStoryReactionArray) Pop() (v UpdateSentStoryReaction, ok bool return v, true } + +// UpdateBotChatBoostArray is adapter for slice of UpdateBotChatBoost. +type UpdateBotChatBoostArray []UpdateBotChatBoost + +// Sort sorts slice of UpdateBotChatBoost. +func (s UpdateBotChatBoostArray) Sort(less func(a, b UpdateBotChatBoost) bool) UpdateBotChatBoostArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of UpdateBotChatBoost. +func (s UpdateBotChatBoostArray) SortStable(less func(a, b UpdateBotChatBoost) bool) UpdateBotChatBoostArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of UpdateBotChatBoost. +func (s UpdateBotChatBoostArray) Retain(keep func(x UpdateBotChatBoost) bool) UpdateBotChatBoostArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s UpdateBotChatBoostArray) First() (v UpdateBotChatBoost, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s UpdateBotChatBoostArray) Last() (v UpdateBotChatBoost, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *UpdateBotChatBoostArray) PopFirst() (v UpdateBotChatBoost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero UpdateBotChatBoost + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *UpdateBotChatBoostArray) Pop() (v UpdateBotChatBoost, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// UpdateChannelViewForumAsMessagesArray is adapter for slice of UpdateChannelViewForumAsMessages. +type UpdateChannelViewForumAsMessagesArray []UpdateChannelViewForumAsMessages + +// Sort sorts slice of UpdateChannelViewForumAsMessages. +func (s UpdateChannelViewForumAsMessagesArray) Sort(less func(a, b UpdateChannelViewForumAsMessages) bool) UpdateChannelViewForumAsMessagesArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of UpdateChannelViewForumAsMessages. +func (s UpdateChannelViewForumAsMessagesArray) SortStable(less func(a, b UpdateChannelViewForumAsMessages) bool) UpdateChannelViewForumAsMessagesArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of UpdateChannelViewForumAsMessages. +func (s UpdateChannelViewForumAsMessagesArray) Retain(keep func(x UpdateChannelViewForumAsMessages) bool) UpdateChannelViewForumAsMessagesArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s UpdateChannelViewForumAsMessagesArray) First() (v UpdateChannelViewForumAsMessages, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s UpdateChannelViewForumAsMessagesArray) Last() (v UpdateChannelViewForumAsMessages, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *UpdateChannelViewForumAsMessagesArray) PopFirst() (v UpdateChannelViewForumAsMessages, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero UpdateChannelViewForumAsMessages + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *UpdateChannelViewForumAsMessagesArray) Pop() (v UpdateChannelViewForumAsMessages, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// UpdatePeerWallpaperArray is adapter for slice of UpdatePeerWallpaper. +type UpdatePeerWallpaperArray []UpdatePeerWallpaper + +// Sort sorts slice of UpdatePeerWallpaper. +func (s UpdatePeerWallpaperArray) Sort(less func(a, b UpdatePeerWallpaper) bool) UpdatePeerWallpaperArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of UpdatePeerWallpaper. +func (s UpdatePeerWallpaperArray) SortStable(less func(a, b UpdatePeerWallpaper) bool) UpdatePeerWallpaperArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of UpdatePeerWallpaper. +func (s UpdatePeerWallpaperArray) Retain(keep func(x UpdatePeerWallpaper) bool) UpdatePeerWallpaperArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s UpdatePeerWallpaperArray) First() (v UpdatePeerWallpaper, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s UpdatePeerWallpaperArray) Last() (v UpdatePeerWallpaper, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *UpdatePeerWallpaperArray) PopFirst() (v UpdatePeerWallpaper, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero UpdatePeerWallpaper + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *UpdatePeerWallpaperArray) Pop() (v UpdatePeerWallpaper, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// UpdateBotMessageReactionArray is adapter for slice of UpdateBotMessageReaction. +type UpdateBotMessageReactionArray []UpdateBotMessageReaction + +// Sort sorts slice of UpdateBotMessageReaction. +func (s UpdateBotMessageReactionArray) Sort(less func(a, b UpdateBotMessageReaction) bool) UpdateBotMessageReactionArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of UpdateBotMessageReaction. +func (s UpdateBotMessageReactionArray) SortStable(less func(a, b UpdateBotMessageReaction) bool) UpdateBotMessageReactionArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of UpdateBotMessageReaction. +func (s UpdateBotMessageReactionArray) Retain(keep func(x UpdateBotMessageReaction) bool) UpdateBotMessageReactionArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s UpdateBotMessageReactionArray) First() (v UpdateBotMessageReaction, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s UpdateBotMessageReactionArray) Last() (v UpdateBotMessageReaction, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *UpdateBotMessageReactionArray) PopFirst() (v UpdateBotMessageReaction, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero UpdateBotMessageReaction + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *UpdateBotMessageReactionArray) Pop() (v UpdateBotMessageReaction, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// SortByDate sorts slice of UpdateBotMessageReaction by Date. +func (s UpdateBotMessageReactionArray) SortByDate() UpdateBotMessageReactionArray { + return s.Sort(func(a, b UpdateBotMessageReaction) bool { + return a.GetDate() < b.GetDate() + }) +} + +// SortStableByDate sorts slice of UpdateBotMessageReaction by Date. +func (s UpdateBotMessageReactionArray) SortStableByDate() UpdateBotMessageReactionArray { + return s.SortStable(func(a, b UpdateBotMessageReaction) bool { + return a.GetDate() < b.GetDate() + }) +} + +// UpdateBotMessageReactionsArray is adapter for slice of UpdateBotMessageReactions. +type UpdateBotMessageReactionsArray []UpdateBotMessageReactions + +// Sort sorts slice of UpdateBotMessageReactions. +func (s UpdateBotMessageReactionsArray) Sort(less func(a, b UpdateBotMessageReactions) bool) UpdateBotMessageReactionsArray { + sort.Slice(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// SortStable sorts slice of UpdateBotMessageReactions. +func (s UpdateBotMessageReactionsArray) SortStable(less func(a, b UpdateBotMessageReactions) bool) UpdateBotMessageReactionsArray { + sort.SliceStable(s, func(i, j int) bool { + return less(s[i], s[j]) + }) + return s +} + +// Retain filters in-place slice of UpdateBotMessageReactions. +func (s UpdateBotMessageReactionsArray) Retain(keep func(x UpdateBotMessageReactions) bool) UpdateBotMessageReactionsArray { + n := 0 + for _, x := range s { + if keep(x) { + s[n] = x + n++ + } + } + s = s[:n] + + return s +} + +// First returns first element of slice (if exists). +func (s UpdateBotMessageReactionsArray) First() (v UpdateBotMessageReactions, ok bool) { + if len(s) < 1 { + return + } + return s[0], true +} + +// Last returns last element of slice (if exists). +func (s UpdateBotMessageReactionsArray) Last() (v UpdateBotMessageReactions, ok bool) { + if len(s) < 1 { + return + } + return s[len(s)-1], true +} + +// PopFirst returns first element of slice (if exists) and deletes it. +func (s *UpdateBotMessageReactionsArray) PopFirst() (v UpdateBotMessageReactions, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[0] + + // Delete by index from SliceTricks. + copy(a[0:], a[1:]) + var zero UpdateBotMessageReactions + a[len(a)-1] = zero + a = a[:len(a)-1] + *s = a + + return v, true +} + +// Pop returns last element of slice (if exists) and deletes it. +func (s *UpdateBotMessageReactionsArray) Pop() (v UpdateBotMessageReactions, ok bool) { + if s == nil || len(*s) < 1 { + return + } + + a := *s + v = a[len(a)-1] + a = a[:len(a)-1] + *s = a + + return v, true +} + +// SortByDate sorts slice of UpdateBotMessageReactions by Date. +func (s UpdateBotMessageReactionsArray) SortByDate() UpdateBotMessageReactionsArray { + return s.Sort(func(a, b UpdateBotMessageReactions) bool { + return a.GetDate() < b.GetDate() + }) +} + +// SortStableByDate sorts slice of UpdateBotMessageReactions by Date. +func (s UpdateBotMessageReactionsArray) SortStableByDate() UpdateBotMessageReactionsArray { + return s.SortStable(func(a, b UpdateBotMessageReactions) bool { + return a.GetDate() < b.GetDate() + }) +} diff --git a/vendor/github.com/gotd/td/tg/tl_updates_classifier_gen.go b/vendor/github.com/gotd/td/tg/tl_updates_classifier_gen.go index 285a9279..60ceee86 100644 --- a/vendor/github.com/gotd/td/tg/tl_updates_classifier_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_updates_classifier_gen.go @@ -70,6 +70,12 @@ func IsQtsUpdate(u UpdateClass) (qts int, ok bool) { return u.Qts, true case *UpdateBotChatInviteRequester: return u.Qts, true + case *UpdateBotChatBoost: + return u.Qts, true + case *UpdateBotMessageReaction: + return u.Qts, true + case *UpdateBotMessageReactions: + return u.Qts, true } return diff --git a/vendor/github.com/gotd/td/tg/tl_updates_get_difference_gen.go b/vendor/github.com/gotd/td/tg/tl_updates_get_difference_gen.go index 55586bb7..82d9c1c6 100644 --- a/vendor/github.com/gotd/td/tg/tl_updates_get_difference_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_updates_get_difference_gen.go @@ -49,7 +49,7 @@ type UpdatesGetDifferenceRequest struct { // Links: // 1) https://core.telegram.org/api/updates Pts int - // PtsLimit field of UpdatesGetDifferenceRequest. + // PTS limit // // Use SetPtsLimit and GetPtsLimit helpers. PtsLimit int @@ -73,7 +73,7 @@ type UpdatesGetDifferenceRequest struct { // Links: // 1) https://core.telegram.org/api/updates Qts int - // QtsLimit field of UpdatesGetDifferenceRequest. + // QTS limit // // Use SetQtsLimit and GetQtsLimit helpers. QtsLimit int diff --git a/vendor/github.com/gotd/td/tg/tl_upload_get_cdn_file_hashes_gen.go b/vendor/github.com/gotd/td/tg/tl_upload_get_cdn_file_hashes_gen.go index 733ab72f..ae1084d5 100644 --- a/vendor/github.com/gotd/td/tg/tl_upload_get_cdn_file_hashes_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_upload_get_cdn_file_hashes_gen.go @@ -200,6 +200,7 @@ func (g *UploadGetCDNFileHashesRequest) GetOffset() (value int64) { // Possible errors: // // 400 CDN_METHOD_INVALID: You can't call this method in a CDN DC. +// 400 FILE_TOKEN_INVALID: The specified file token is invalid. // 400 RSA_DECRYPT_FAILED: Internal RSA decryption failed. // // See https://core.telegram.org/method/upload.getCdnFileHashes for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_upload_get_file_gen.go b/vendor/github.com/gotd/td/tg/tl_upload_get_file_gen.go index 8eac86ca..dbfcaefc 100644 --- a/vendor/github.com/gotd/td/tg/tl_upload_get_file_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_upload_get_file_gen.go @@ -320,11 +320,12 @@ func (g *UploadGetFileRequest) GetLimit() (value int) { // // Possible errors: // +// 400 CDN_METHOD_INVALID: You can't call this method in a CDN DC. // 400 CHANNEL_INVALID: The provided channel is invalid. // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. -// 400 FILE_REFERENCE_*: The file reference expired, it must be refreshed. // 406 FILEREF_UPGRADE_NEEDED: The client has to be updated in order to support file references. // 400 FILE_ID_INVALID: The provided file id is invalid. +// 400 FILE_REFERENCE_*: The file reference expired, it must be refreshed. // 400 FILE_REFERENCE_EXPIRED: File reference expired, it must be refetched as described in the documentation. // 400 LIMIT_INVALID: The provided limit is invalid. // 400 LOCATION_INVALID: The provided location is invalid. diff --git a/vendor/github.com/gotd/td/tg/tl_upload_reupload_cdn_file_gen.go b/vendor/github.com/gotd/td/tg/tl_upload_reupload_cdn_file_gen.go index 45d3f9b9..f2311192 100644 --- a/vendor/github.com/gotd/td/tg/tl_upload_reupload_cdn_file_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_upload_reupload_cdn_file_gen.go @@ -199,6 +199,7 @@ func (r *UploadReuploadCDNFileRequest) GetRequestToken() (value []byte) { // // Possible errors: // +// 400 CDN_METHOD_INVALID: You can't call this method in a CDN DC. // 500 CDN_UPLOAD_TIMEOUT: A server-side timeout occurred while reuploading the file to the CDN DC. // 400 FILE_TOKEN_INVALID: The specified file token is invalid. // 400 RSA_DECRYPT_FAILED: Internal RSA decryption failed. diff --git a/vendor/github.com/gotd/td/tg/tl_user_full_gen.go b/vendor/github.com/gotd/td/tg/tl_user_full_gen.go index 756579ac..17d8fe86 100644 --- a/vendor/github.com/gotd/td/tg/tl_user_full_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_user_full_gen.go @@ -64,10 +64,23 @@ type UserFull struct { // Links: // 1) https://core.telegram.org/api/translation TranslationsDisabled bool - // StoriesPinnedAvailable field of UserFull. + // Whether this user has some pinned stories¹. + // + // Links: + // 1) https://core.telegram.org/api/stories#pinned-or-archived-stories StoriesPinnedAvailable bool - // BlockedMyStoriesFrom field of UserFull. + // Whether we've blocked this user, preventing them from seeing our stories »¹. + // + // Links: + // 1) https://core.telegram.org/api/block BlockedMyStoriesFrom bool + // Whether the other user has chosen a custom wallpaper for us using messages + // setChatWallPaper¹ and the for_both flag, see here »² for more info. + // + // Links: + // 1) https://core.telegram.org/method/messages.setChatWallPaper + // 2) https://core.telegram.org/api/wallpapers#installing-wallpapers-in-a-specific-chat + WallpaperOverridden bool // User ID ID int64 // Bio of the user @@ -153,7 +166,10 @@ type UserFull struct { // // Use SetWallpaper and GetWallpaper helpers. Wallpaper WallPaperClass - // Stories field of UserFull. + // Active stories »¹ + // + // Links: + // 1) https://core.telegram.org/api/stories // // Use SetStories and GetStories helpers. Stories PeerStories @@ -207,6 +223,9 @@ func (u *UserFull) Zero() bool { if !(u.BlockedMyStoriesFrom == false) { return false } + if !(u.WallpaperOverridden == false) { + return false + } if !(u.ID == 0) { return false } @@ -289,6 +308,7 @@ func (u *UserFull) FillFrom(from interface { GetTranslationsDisabled() (value bool) GetStoriesPinnedAvailable() (value bool) GetBlockedMyStoriesFrom() (value bool) + GetWallpaperOverridden() (value bool) GetID() (value int64) GetAbout() (value string, ok bool) GetSettings() (value PeerSettings) @@ -319,6 +339,7 @@ func (u *UserFull) FillFrom(from interface { u.TranslationsDisabled = from.GetTranslationsDisabled() u.StoriesPinnedAvailable = from.GetStoriesPinnedAvailable() u.BlockedMyStoriesFrom = from.GetBlockedMyStoriesFrom() + u.WallpaperOverridden = from.GetWallpaperOverridden() u.ID = from.GetID() if val, ok := from.GetAbout(); ok { u.About = val @@ -458,6 +479,11 @@ func (u *UserFull) TypeInfo() tdp.Type { SchemaName: "blocked_my_stories_from", Null: !u.Flags.Has(27), }, + { + Name: "WallpaperOverridden", + SchemaName: "wallpaper_overridden", + Null: !u.Flags.Has(28), + }, { Name: "ID", SchemaName: "id", @@ -585,6 +611,9 @@ func (u *UserFull) SetFlags() { if !(u.BlockedMyStoriesFrom == false) { u.Flags.Set(27) } + if !(u.WallpaperOverridden == false) { + u.Flags.Set(28) + } if !(u.About == "") { u.Flags.Set(1) } @@ -770,6 +799,7 @@ func (u *UserFull) DecodeBare(b *bin.Buffer) error { u.TranslationsDisabled = u.Flags.Has(23) u.StoriesPinnedAvailable = u.Flags.Has(26) u.BlockedMyStoriesFrom = u.Flags.Has(27) + u.WallpaperOverridden = u.Flags.Has(28) { value, err := b.Long() if err != nil { @@ -1094,6 +1124,25 @@ func (u *UserFull) GetBlockedMyStoriesFrom() (value bool) { return u.Flags.Has(27) } +// SetWallpaperOverridden sets value of WallpaperOverridden conditional field. +func (u *UserFull) SetWallpaperOverridden(value bool) { + if value { + u.Flags.Set(28) + u.WallpaperOverridden = true + } else { + u.Flags.Unset(28) + u.WallpaperOverridden = false + } +} + +// GetWallpaperOverridden returns value of WallpaperOverridden conditional field. +func (u *UserFull) GetWallpaperOverridden() (value bool) { + if u == nil { + return + } + return u.Flags.Has(28) +} + // GetID returns value of ID field. func (u *UserFull) GetID() (value int64) { if u == nil { diff --git a/vendor/github.com/gotd/td/tg/tl_user_gen.go b/vendor/github.com/gotd/td/tg/tl_user_gen.go index 2e5795d6..473e28d5 100644 --- a/vendor/github.com/gotd/td/tg/tl_user_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_user_gen.go @@ -166,7 +166,7 @@ func (u *UserEmpty) GetID() (value int64) { return u.ID } -// User represents TL type `user#eb602f25`. +// User represents TL type `user#215c4438`. // Indicates info about a certain user // // See https://core.telegram.org/constructor/user for reference. @@ -230,11 +230,17 @@ type User struct { // Whether we can edit the profile picture, name, about text and description of this bot // because we own it. BotCanEdit bool - // CloseFriend field of User. + // Whether we marked this user as a close friend, see here » for more info¹ + // + // Links: + // 1) https://core.telegram.org/api/privacy CloseFriend bool - // StoriesHidden field of User. + // Whether we have hidden »¹ all active stories of this user. + // + // Links: + // 1) https://core.telegram.org/api/stories#hiding-stories-of-other-users StoriesHidden bool - // StoriesUnavailable field of User. + // No stories from this user are visible. StoriesUnavailable bool // ID of the user ID int64 @@ -296,22 +302,31 @@ type User struct { // // Use SetUsernames and GetUsernames helpers. Usernames []Username - // StoriesMaxID field of User. + // ID of the maximum read story¹. + // + // Links: + // 1) https://core.telegram.org/api/stories // // Use SetStoriesMaxID and GetStoriesMaxID helpers. StoriesMaxID int - // Color field of User. + // The user's accent color¹. + // + // Links: + // 1) https://core.telegram.org/api/colors // // Use SetColor and GetColor helpers. - Color int - // BackgroundEmojiID field of User. + Color PeerColor + // The user's profile color¹. // - // Use SetBackgroundEmojiID and GetBackgroundEmojiID helpers. - BackgroundEmojiID int64 + // Links: + // 1) https://core.telegram.org/api/colors + // + // Use SetProfileColor and GetProfileColor helpers. + ProfileColor PeerColor } // UserTypeID is TL type id of User. -const UserTypeID = 0xeb602f25 +const UserTypeID = 0x215c4438 // construct implements constructor of UserClass. func (u User) construct() UserClass { return &u } @@ -447,10 +462,10 @@ func (u *User) Zero() bool { if !(u.StoriesMaxID == 0) { return false } - if !(u.Color == 0) { + if !(u.Color.Zero()) { return false } - if !(u.BackgroundEmojiID == 0) { + if !(u.ProfileColor.Zero()) { return false } @@ -505,8 +520,8 @@ func (u *User) FillFrom(from interface { GetEmojiStatus() (value EmojiStatusClass, ok bool) GetUsernames() (value []Username, ok bool) GetStoriesMaxID() (value int, ok bool) - GetColor() (value int, ok bool) - GetBackgroundEmojiID() (value int64, ok bool) + GetColor() (value PeerColor, ok bool) + GetProfileColor() (value PeerColor, ok bool) }) { u.Self = from.GetSelf() u.Contact = from.GetContact() @@ -591,8 +606,8 @@ func (u *User) FillFrom(from interface { u.Color = val } - if val, ok := from.GetBackgroundEmojiID(); ok { - u.BackgroundEmojiID = val + if val, ok := from.GetProfileColor(); ok { + u.ProfileColor = val } } @@ -807,12 +822,12 @@ func (u *User) TypeInfo() tdp.Type { { Name: "Color", SchemaName: "color", - Null: !u.Flags2.Has(7), + Null: !u.Flags2.Has(8), }, { - Name: "BackgroundEmojiID", - SchemaName: "background_emoji_id", - Null: !u.Flags2.Has(6), + Name: "ProfileColor", + SchemaName: "profile_color", + Null: !u.Flags2.Has(9), }, } return typ @@ -928,18 +943,18 @@ func (u *User) SetFlags() { if !(u.StoriesMaxID == 0) { u.Flags2.Set(5) } - if !(u.Color == 0) { - u.Flags2.Set(7) + if !(u.Color.Zero()) { + u.Flags2.Set(8) } - if !(u.BackgroundEmojiID == 0) { - u.Flags2.Set(6) + if !(u.ProfileColor.Zero()) { + u.Flags2.Set(9) } } // Encode implements bin.Encoder. func (u *User) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode user#eb602f25 as nil") + return fmt.Errorf("can't encode user#215c4438 as nil") } b.PutID(UserTypeID) return u.EncodeBare(b) @@ -948,14 +963,14 @@ func (u *User) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *User) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode user#eb602f25 as nil") + return fmt.Errorf("can't encode user#215c4438 as nil") } u.SetFlags() if err := u.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#eb602f25: field flags: %w", err) + return fmt.Errorf("unable to encode user#215c4438: field flags: %w", err) } if err := u.Flags2.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#eb602f25: field flags2: %w", err) + return fmt.Errorf("unable to encode user#215c4438: field flags2: %w", err) } b.PutLong(u.ID) if u.Flags.Has(0) { @@ -975,18 +990,18 @@ func (u *User) EncodeBare(b *bin.Buffer) error { } if u.Flags.Has(5) { if u.Photo == nil { - return fmt.Errorf("unable to encode user#eb602f25: field photo is nil") + return fmt.Errorf("unable to encode user#215c4438: field photo is nil") } if err := u.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#eb602f25: field photo: %w", err) + return fmt.Errorf("unable to encode user#215c4438: field photo: %w", err) } } if u.Flags.Has(6) { if u.Status == nil { - return fmt.Errorf("unable to encode user#eb602f25: field status is nil") + return fmt.Errorf("unable to encode user#215c4438: field status is nil") } if err := u.Status.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#eb602f25: field status: %w", err) + return fmt.Errorf("unable to encode user#215c4438: field status: %w", err) } } if u.Flags.Has(14) { @@ -996,7 +1011,7 @@ func (u *User) EncodeBare(b *bin.Buffer) error { b.PutVectorHeader(len(u.RestrictionReason)) for idx, v := range u.RestrictionReason { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#eb602f25: field restriction_reason element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode user#215c4438: field restriction_reason element with index %d: %w", idx, err) } } } @@ -1008,28 +1023,32 @@ func (u *User) EncodeBare(b *bin.Buffer) error { } if u.Flags.Has(30) { if u.EmojiStatus == nil { - return fmt.Errorf("unable to encode user#eb602f25: field emoji_status is nil") + return fmt.Errorf("unable to encode user#215c4438: field emoji_status is nil") } if err := u.EmojiStatus.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#eb602f25: field emoji_status: %w", err) + return fmt.Errorf("unable to encode user#215c4438: field emoji_status: %w", err) } } if u.Flags2.Has(0) { b.PutVectorHeader(len(u.Usernames)) for idx, v := range u.Usernames { if err := v.Encode(b); err != nil { - return fmt.Errorf("unable to encode user#eb602f25: field usernames element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode user#215c4438: field usernames element with index %d: %w", idx, err) } } } if u.Flags2.Has(5) { b.PutInt(u.StoriesMaxID) } - if u.Flags2.Has(7) { - b.PutInt(u.Color) + if u.Flags2.Has(8) { + if err := u.Color.Encode(b); err != nil { + return fmt.Errorf("unable to encode user#215c4438: field color: %w", err) + } } - if u.Flags2.Has(6) { - b.PutLong(u.BackgroundEmojiID) + if u.Flags2.Has(9) { + if err := u.ProfileColor.Encode(b); err != nil { + return fmt.Errorf("unable to encode user#215c4438: field profile_color: %w", err) + } } return nil } @@ -1037,10 +1056,10 @@ func (u *User) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *User) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode user#eb602f25 to nil") + return fmt.Errorf("can't decode user#215c4438 to nil") } if err := b.ConsumeID(UserTypeID); err != nil { - return fmt.Errorf("unable to decode user#eb602f25: %w", err) + return fmt.Errorf("unable to decode user#215c4438: %w", err) } return u.DecodeBare(b) } @@ -1048,11 +1067,11 @@ func (u *User) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *User) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode user#eb602f25 to nil") + return fmt.Errorf("can't decode user#215c4438 to nil") } { if err := u.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field flags: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field flags: %w", err) } } u.Self = u.Flags.Has(10) @@ -1075,7 +1094,7 @@ func (u *User) DecodeBare(b *bin.Buffer) error { u.AttachMenuEnabled = u.Flags.Has(29) { if err := u.Flags2.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field flags2: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field flags2: %w", err) } } u.BotCanEdit = u.Flags2.Has(1) @@ -1085,70 +1104,70 @@ func (u *User) DecodeBare(b *bin.Buffer) error { { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field id: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field id: %w", err) } u.ID = value } if u.Flags.Has(0) { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field access_hash: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field access_hash: %w", err) } u.AccessHash = value } if u.Flags.Has(1) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field first_name: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field first_name: %w", err) } u.FirstName = value } if u.Flags.Has(2) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field last_name: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field last_name: %w", err) } u.LastName = value } if u.Flags.Has(3) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field username: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field username: %w", err) } u.Username = value } if u.Flags.Has(4) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field phone: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field phone: %w", err) } u.Phone = value } if u.Flags.Has(5) { value, err := DecodeUserProfilePhoto(b) if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field photo: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field photo: %w", err) } u.Photo = value } if u.Flags.Has(6) { value, err := DecodeUserStatus(b) if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field status: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field status: %w", err) } u.Status = value } if u.Flags.Has(14) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field bot_info_version: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field bot_info_version: %w", err) } u.BotInfoVersion = value } if u.Flags.Has(18) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field restriction_reason: %w", err) } if headerLen > 0 { @@ -1157,7 +1176,7 @@ func (u *User) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value RestrictionReason if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field restriction_reason: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field restriction_reason: %w", err) } u.RestrictionReason = append(u.RestrictionReason, value) } @@ -1165,28 +1184,28 @@ func (u *User) DecodeBare(b *bin.Buffer) error { if u.Flags.Has(19) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field bot_inline_placeholder: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field bot_inline_placeholder: %w", err) } u.BotInlinePlaceholder = value } if u.Flags.Has(22) { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field lang_code: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field lang_code: %w", err) } u.LangCode = value } if u.Flags.Has(30) { value, err := DecodeEmojiStatus(b) if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field emoji_status: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field emoji_status: %w", err) } u.EmojiStatus = value } if u.Flags2.Has(0) { headerLen, err := b.VectorHeader() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field usernames: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field usernames: %w", err) } if headerLen > 0 { @@ -1195,7 +1214,7 @@ func (u *User) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value Username if err := value.Decode(b); err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field usernames: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field usernames: %w", err) } u.Usernames = append(u.Usernames, value) } @@ -1203,23 +1222,19 @@ func (u *User) DecodeBare(b *bin.Buffer) error { if u.Flags2.Has(5) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field stories_max_id: %w", err) + return fmt.Errorf("unable to decode user#215c4438: field stories_max_id: %w", err) } u.StoriesMaxID = value } - if u.Flags2.Has(7) { - value, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field color: %w", err) + if u.Flags2.Has(8) { + if err := u.Color.Decode(b); err != nil { + return fmt.Errorf("unable to decode user#215c4438: field color: %w", err) } - u.Color = value } - if u.Flags2.Has(6) { - value, err := b.Long() - if err != nil { - return fmt.Errorf("unable to decode user#eb602f25: field background_emoji_id: %w", err) + if u.Flags2.Has(9) { + if err := u.ProfileColor.Decode(b); err != nil { + return fmt.Errorf("unable to decode user#215c4438: field profile_color: %w", err) } - u.BackgroundEmojiID = value } return nil } @@ -1903,39 +1918,39 @@ func (u *User) GetStoriesMaxID() (value int, ok bool) { } // SetColor sets value of Color conditional field. -func (u *User) SetColor(value int) { - u.Flags2.Set(7) +func (u *User) SetColor(value PeerColor) { + u.Flags2.Set(8) u.Color = value } // GetColor returns value of Color conditional field and // boolean which is true if field was set. -func (u *User) GetColor() (value int, ok bool) { +func (u *User) GetColor() (value PeerColor, ok bool) { if u == nil { return } - if !u.Flags2.Has(7) { + if !u.Flags2.Has(8) { return value, false } return u.Color, true } -// SetBackgroundEmojiID sets value of BackgroundEmojiID conditional field. -func (u *User) SetBackgroundEmojiID(value int64) { - u.Flags2.Set(6) - u.BackgroundEmojiID = value +// SetProfileColor sets value of ProfileColor conditional field. +func (u *User) SetProfileColor(value PeerColor) { + u.Flags2.Set(9) + u.ProfileColor = value } -// GetBackgroundEmojiID returns value of BackgroundEmojiID conditional field and +// GetProfileColor returns value of ProfileColor conditional field and // boolean which is true if field was set. -func (u *User) GetBackgroundEmojiID() (value int64, ok bool) { +func (u *User) GetProfileColor() (value PeerColor, ok bool) { if u == nil { return } - if !u.Flags2.Has(6) { + if !u.Flags2.Has(9) { return value, false } - return u.BackgroundEmojiID, true + return u.ProfileColor, true } // UserClassName is schema name of UserClass. @@ -1953,7 +1968,7 @@ const UserClassName = "User" // } // switch v := g.(type) { // case *tg.UserEmpty: // userEmpty#d3bc4b7a -// case *tg.User: // user#eb602f25 +// case *tg.User: // user#215c4438 // default: panic(v) // } type UserClass interface { @@ -2028,7 +2043,7 @@ func DecodeUser(buf *bin.Buffer) (UserClass, error) { } return &v, nil case UserTypeID: - // Decoding user#eb602f25. + // Decoding user#215c4438. v := User{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UserClass: %w", err) diff --git a/vendor/github.com/gotd/td/tg/tl_users_get_full_user_gen.go b/vendor/github.com/gotd/td/tg/tl_users_get_full_user_gen.go index 1474fff8..46cfad98 100644 --- a/vendor/github.com/gotd/td/tg/tl_users_get_full_user_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_users_get_full_user_gen.go @@ -174,7 +174,6 @@ func (g *UsersGetFullUserRequest) GetID() (value InputUserClass) { // 400 CHANNEL_PRIVATE: You haven't joined this channel/supergroup. // 400 MSG_ID_INVALID: Invalid message ID provided. // 400 USERNAME_OCCUPIED: The provided username is already occupied. -// 500 USERNAME_UNSYNCHRONIZED: // 400 USER_ID_INVALID: The provided user ID is invalid. // // See https://core.telegram.org/method/users.getFullUser for reference. diff --git a/vendor/github.com/gotd/td/tg/tl_wall_paper_settings_gen.go b/vendor/github.com/gotd/td/tg/tl_wall_paper_settings_gen.go index 14e9118a..15b354db 100644 --- a/vendor/github.com/gotd/td/tg/tl_wall_paper_settings_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_wall_paper_settings_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// WallPaperSettings represents TL type `wallPaperSettings#1dc1bca4`. +// WallPaperSettings represents TL type `wallPaperSettings#372efcd0`. // Wallpaper¹ rendering information. // // Links: @@ -95,10 +95,14 @@ type WallPaperSettings struct { // // Use SetRotation and GetRotation helpers. Rotation int + // Emoticon field of WallPaperSettings. + // + // Use SetEmoticon and GetEmoticon helpers. + Emoticon string } // WallPaperSettingsTypeID is TL type id of WallPaperSettings. -const WallPaperSettingsTypeID = 0x1dc1bca4 +const WallPaperSettingsTypeID = 0x372efcd0 // Ensuring interfaces in compile-time for WallPaperSettings. var ( @@ -139,6 +143,9 @@ func (w *WallPaperSettings) Zero() bool { if !(w.Rotation == 0) { return false } + if !(w.Emoticon == "") { + return false + } return true } @@ -162,6 +169,7 @@ func (w *WallPaperSettings) FillFrom(from interface { GetFourthBackgroundColor() (value int, ok bool) GetIntensity() (value int, ok bool) GetRotation() (value int, ok bool) + GetEmoticon() (value string, ok bool) }) { w.Blur = from.GetBlur() w.Motion = from.GetMotion() @@ -189,6 +197,10 @@ func (w *WallPaperSettings) FillFrom(from interface { w.Rotation = val } + if val, ok := from.GetEmoticon(); ok { + w.Emoticon = val + } + } // TypeID returns type id in TL schema. @@ -254,6 +266,11 @@ func (w *WallPaperSettings) TypeInfo() tdp.Type { SchemaName: "rotation", Null: !w.Flags.Has(4), }, + { + Name: "Emoticon", + SchemaName: "emoticon", + Null: !w.Flags.Has(7), + }, } return typ } @@ -284,12 +301,15 @@ func (w *WallPaperSettings) SetFlags() { if !(w.Rotation == 0) { w.Flags.Set(4) } + if !(w.Emoticon == "") { + w.Flags.Set(7) + } } // Encode implements bin.Encoder. func (w *WallPaperSettings) Encode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode wallPaperSettings#1dc1bca4 as nil") + return fmt.Errorf("can't encode wallPaperSettings#372efcd0 as nil") } b.PutID(WallPaperSettingsTypeID) return w.EncodeBare(b) @@ -298,11 +318,11 @@ func (w *WallPaperSettings) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (w *WallPaperSettings) EncodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't encode wallPaperSettings#1dc1bca4 as nil") + return fmt.Errorf("can't encode wallPaperSettings#372efcd0 as nil") } w.SetFlags() if err := w.Flags.Encode(b); err != nil { - return fmt.Errorf("unable to encode wallPaperSettings#1dc1bca4: field flags: %w", err) + return fmt.Errorf("unable to encode wallPaperSettings#372efcd0: field flags: %w", err) } if w.Flags.Has(0) { b.PutInt(w.BackgroundColor) @@ -322,16 +342,19 @@ func (w *WallPaperSettings) EncodeBare(b *bin.Buffer) error { if w.Flags.Has(4) { b.PutInt(w.Rotation) } + if w.Flags.Has(7) { + b.PutString(w.Emoticon) + } return nil } // Decode implements bin.Decoder. func (w *WallPaperSettings) Decode(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode wallPaperSettings#1dc1bca4 to nil") + return fmt.Errorf("can't decode wallPaperSettings#372efcd0 to nil") } if err := b.ConsumeID(WallPaperSettingsTypeID); err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: %w", err) } return w.DecodeBare(b) } @@ -339,11 +362,11 @@ func (w *WallPaperSettings) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (w *WallPaperSettings) DecodeBare(b *bin.Buffer) error { if w == nil { - return fmt.Errorf("can't decode wallPaperSettings#1dc1bca4 to nil") + return fmt.Errorf("can't decode wallPaperSettings#372efcd0 to nil") } { if err := w.Flags.Decode(b); err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: field flags: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field flags: %w", err) } } w.Blur = w.Flags.Has(1) @@ -351,45 +374,52 @@ func (w *WallPaperSettings) DecodeBare(b *bin.Buffer) error { if w.Flags.Has(0) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: field background_color: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field background_color: %w", err) } w.BackgroundColor = value } if w.Flags.Has(4) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: field second_background_color: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field second_background_color: %w", err) } w.SecondBackgroundColor = value } if w.Flags.Has(5) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: field third_background_color: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field third_background_color: %w", err) } w.ThirdBackgroundColor = value } if w.Flags.Has(6) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: field fourth_background_color: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field fourth_background_color: %w", err) } w.FourthBackgroundColor = value } if w.Flags.Has(3) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: field intensity: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field intensity: %w", err) } w.Intensity = value } if w.Flags.Has(4) { value, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode wallPaperSettings#1dc1bca4: field rotation: %w", err) + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field rotation: %w", err) } w.Rotation = value } + if w.Flags.Has(7) { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode wallPaperSettings#372efcd0: field emoticon: %w", err) + } + w.Emoticon = value + } return nil } @@ -538,3 +568,21 @@ func (w *WallPaperSettings) GetRotation() (value int, ok bool) { } return w.Rotation, true } + +// SetEmoticon sets value of Emoticon conditional field. +func (w *WallPaperSettings) SetEmoticon(value string) { + w.Flags.Set(7) + w.Emoticon = value +} + +// GetEmoticon returns value of Emoticon conditional field and +// boolean which is true if field was set. +func (w *WallPaperSettings) GetEmoticon() (value string, ok bool) { + if w == nil { + return + } + if !w.Flags.Has(7) { + return value, false + } + return w.Emoticon, true +} diff --git a/vendor/github.com/gotd/td/tg/tl_web_page_attribute_gen.go b/vendor/github.com/gotd/td/tg/tl_web_page_attribute_gen.go index b6654376..1241f032 100644 --- a/vendor/github.com/gotd/td/tg/tl_web_page_attribute_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_web_page_attribute_gen.go @@ -283,16 +283,27 @@ func (w *WebPageAttributeTheme) MapDocuments() (value DocumentClassArray, ok boo } // WebPageAttributeStory represents TL type `webPageAttributeStory#2e94c3e7`. +// Webpage preview of a Telegram story // // See https://core.telegram.org/constructor/webPageAttributeStory for reference. type WebPageAttributeStory struct { - // Flags field of WebPageAttributeStory. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // Peer field of WebPageAttributeStory. + // Peer that posted the story Peer PeerClass - // ID field of WebPageAttributeStory. + // Story ID¹ + // + // Links: + // 1) https://core.telegram.org/api/stories#watching-stories ID int - // Story field of WebPageAttributeStory. + // May contain the story, if not the story should be fetched when and if needed using + // stories.getStoriesByID¹ with the above id and peer. + // + // Links: + // 1) https://core.telegram.org/method/stories.getStoriesByID // // Use SetStory and GetStory helpers. Story StoryItemClass diff --git a/vendor/github.com/gotd/td/tg/tl_web_page_gen.go b/vendor/github.com/gotd/td/tg/tl_web_page_gen.go index 4e9ff15b..92bbb3f5 100644 --- a/vendor/github.com/gotd/td/tg/tl_web_page_gen.go +++ b/vendor/github.com/gotd/td/tg/tl_web_page_gen.go @@ -36,11 +36,14 @@ var ( // // See https://core.telegram.org/constructor/webPageEmpty for reference. type WebPageEmpty struct { - // Flags field of WebPageEmpty. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // Preview ID ID int64 - // URL field of WebPageEmpty. + // URL of the webpage. // // Use SetURL and GetURL helpers. URL string @@ -237,11 +240,14 @@ func (w *WebPageEmpty) GetURL() (value string, ok bool) { // // See https://core.telegram.org/constructor/webPagePending for reference. type WebPagePending struct { - // Flags field of WebPagePending. + // Flags, see TL conditional fields¹ + // + // Links: + // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields // ID of preview ID int64 - // URL field of WebPagePending. + // URL of the webpage // // Use SetURL and GetURL helpers. URL string @@ -470,7 +476,7 @@ type WebPage struct { // Links: // 1) https://core.telegram.org/mtproto/TL-combinators#conditional-fields Flags bin.Fields - // HasLargeMedia field of WebPage. + // Whether the size of the media in the preview can be changed. HasLargeMedia bool // Preview ID ID int64 diff --git a/vendor/github.com/jackc/pgservicefile/.travis.yml b/vendor/github.com/jackc/pgservicefile/.travis.yml deleted file mode 100644 index e176228e..00000000 --- a/vendor/github.com/jackc/pgservicefile/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -language: go - -go: - - 1.x - - tip - -matrix: - allow_failures: - - go: tip diff --git a/vendor/github.com/jackc/pgservicefile/README.md b/vendor/github.com/jackc/pgservicefile/README.md index e50ca126..2fc7e012 100644 --- a/vendor/github.com/jackc/pgservicefile/README.md +++ b/vendor/github.com/jackc/pgservicefile/README.md @@ -1,5 +1,6 @@ -[![](https://godoc.org/github.com/jackc/pgservicefile?status.svg)](https://godoc.org/github.com/jackc/pgservicefile) -[![Build Status](https://travis-ci.org/jackc/pgservicefile.svg)](https://travis-ci.org/jackc/pgservicefile) +[![Go Reference](https://pkg.go.dev/badge/github.com/jackc/pgservicefile.svg)](https://pkg.go.dev/github.com/jackc/pgservicefile) +[![Build Status](https://github.com/jackc/pgservicefile/actions/workflows/ci.yml/badge.svg)](https://github.com/jackc/pgservicefile/actions/workflows/ci.yml) + # pgservicefile diff --git a/vendor/github.com/jackc/pgx/v5/CHANGELOG.md b/vendor/github.com/jackc/pgx/v5/CHANGELOG.md index 63ee30d5..f5612277 100644 --- a/vendor/github.com/jackc/pgx/v5/CHANGELOG.md +++ b/vendor/github.com/jackc/pgx/v5/CHANGELOG.md @@ -1,3 +1,12 @@ +# 5.5.1 (December 9, 2023) + +* Add CopyFromFunc helper function. (robford) +* Add PgConn.Deallocate method that uses PostgreSQL protocol Close message. +* pgx uses new PgConn.Deallocate method. This allows deallocating statements to work in a failed transaction. This fixes a case where the prepared statement map could become invalid. +* Fix: Prefer driver.Valuer over json.Marshaler for json fields. (Jacopo) +* Fix: simple protocol SQL sanitizer previously panicked if an invalid $0 placeholder was used. This now returns an error instead. (maksymnevajdev) +* Add pgtype.Numeric.ScanScientific (Eshton Robateau) + # 5.5.0 (November 4, 2023) * Add CollectExactlyOneRow. (Julien GOTTELAND) diff --git a/vendor/github.com/jackc/pgx/v5/README.md b/vendor/github.com/jackc/pgx/v5/README.md index 2a9efc23..8b890836 100644 --- a/vendor/github.com/jackc/pgx/v5/README.md +++ b/vendor/github.com/jackc/pgx/v5/README.md @@ -92,7 +92,7 @@ See the presentation at Golang Estonia, [PGX Top to Bottom](https://www.youtube. ## Supported Go and PostgreSQL Versions -pgx supports the same versions of Go and PostgreSQL that are supported by their respective teams. For [Go](https://golang.org/doc/devel/release.html#policy) that is the two most recent major releases and for [PostgreSQL](https://www.postgresql.org/support/versioning/) the major releases in the last 5 years. This means pgx supports Go 1.20 and higher and PostgreSQL 11 and higher. pgx also is tested against the latest version of [CockroachDB](https://www.cockroachlabs.com/product/). +pgx supports the same versions of Go and PostgreSQL that are supported by their respective teams. For [Go](https://golang.org/doc/devel/release.html#policy) that is the two most recent major releases and for [PostgreSQL](https://www.postgresql.org/support/versioning/) the major releases in the last 5 years. This means pgx supports Go 1.20 and higher and PostgreSQL 12 and higher. pgx also is tested against the latest version of [CockroachDB](https://www.cockroachlabs.com/product/). ## Version Policy diff --git a/vendor/github.com/jackc/pgx/v5/batch.go b/vendor/github.com/jackc/pgx/v5/batch.go index 8f6ea4f0..9b943621 100644 --- a/vendor/github.com/jackc/pgx/v5/batch.go +++ b/vendor/github.com/jackc/pgx/v5/batch.go @@ -61,6 +61,8 @@ type Batch struct { } // Queue queues a query to batch b. query can be an SQL query or the name of a prepared statement. +// The only pgx option argument that is supported is QueryRewriter. Queries are executed using the +// connection's DefaultQueryExecMode. func (b *Batch) Queue(query string, arguments ...any) *QueuedQuery { qq := &QueuedQuery{ query: query, diff --git a/vendor/github.com/jackc/pgx/v5/conn.go b/vendor/github.com/jackc/pgx/v5/conn.go index 0426873c..d85cf127 100644 --- a/vendor/github.com/jackc/pgx/v5/conn.go +++ b/vendor/github.com/jackc/pgx/v5/conn.go @@ -338,17 +338,26 @@ func (c *Conn) Prepare(ctx context.Context, name, sql string) (sd *pgconn.Statem return sd, nil } -// Deallocate releases a prepared statement. +// Deallocate releases a prepared statement. Calling Deallocate on a non-existent prepared statement will succeed. func (c *Conn) Deallocate(ctx context.Context, name string) error { var psName string - if sd, ok := c.preparedStatements[name]; ok { - delete(c.preparedStatements, name) + sd := c.preparedStatements[name] + if sd != nil { psName = sd.Name } else { psName = name } - _, err := c.pgConn.Exec(ctx, "deallocate "+quoteIdentifier(psName)).ReadAll() - return err + + err := c.pgConn.Deallocate(ctx, psName) + if err != nil { + return err + } + + if sd != nil { + delete(c.preparedStatements, name) + } + + return nil } // DeallocateAll releases all previously prepared statements from the server and client, where it also resets the statement and description cache. @@ -466,7 +475,7 @@ optionLoop: if queryRewriter != nil { sql, arguments, err = queryRewriter.RewriteQuery(ctx, c, sql, arguments) if err != nil { - return pgconn.CommandTag{}, fmt.Errorf("rewrite query failed: %v", err) + return pgconn.CommandTag{}, fmt.Errorf("rewrite query failed: %w", err) } } @@ -733,7 +742,7 @@ optionLoop: sql, args, err = queryRewriter.RewriteQuery(ctx, c, sql, args) if err != nil { rows := c.getRows(ctx, originalSQL, originalArgs) - err = fmt.Errorf("rewrite query failed: %v", err) + err = fmt.Errorf("rewrite query failed: %w", err) rows.fatal(err) return rows, err } @@ -893,8 +902,6 @@ func (c *Conn) SendBatch(ctx context.Context, b *Batch) (br BatchResults) { return &batchResults{ctx: ctx, conn: c, err: err} } - mode := c.config.DefaultQueryExecMode - for _, bi := range b.queuedQueries { var queryRewriter QueryRewriter sql := bi.query @@ -902,6 +909,7 @@ func (c *Conn) SendBatch(ctx context.Context, b *Batch) (br BatchResults) { optionLoop: for len(arguments) > 0 { + // Update Batch.Queue function comment when additional options are implemented switch arg := arguments[0].(type) { case QueryRewriter: queryRewriter = arg @@ -915,7 +923,7 @@ func (c *Conn) SendBatch(ctx context.Context, b *Batch) (br BatchResults) { var err error sql, arguments, err = queryRewriter.RewriteQuery(ctx, c, sql, arguments) if err != nil { - return &batchResults{ctx: ctx, conn: c, err: fmt.Errorf("rewrite query failed: %v", err)} + return &batchResults{ctx: ctx, conn: c, err: fmt.Errorf("rewrite query failed: %w", err)} } } @@ -923,6 +931,8 @@ func (c *Conn) SendBatch(ctx context.Context, b *Batch) (br BatchResults) { bi.arguments = arguments } + // TODO: changing mode per batch? Update Batch.Queue function comment when implemented + mode := c.config.DefaultQueryExecMode if mode == QueryExecModeSimpleProtocol { return c.sendBatchQueryExecModeSimpleProtocol(ctx, b) } diff --git a/vendor/github.com/jackc/pgx/v5/copy_from.go b/vendor/github.com/jackc/pgx/v5/copy_from.go index a2c227fd..abcd2239 100644 --- a/vendor/github.com/jackc/pgx/v5/copy_from.go +++ b/vendor/github.com/jackc/pgx/v5/copy_from.go @@ -64,6 +64,33 @@ func (cts *copyFromSlice) Err() error { return cts.err } +// CopyFromFunc returns a CopyFromSource interface that relies on nxtf for values. +// nxtf returns rows until it either signals an 'end of data' by returning row=nil and err=nil, +// or it returns an error. If nxtf returns an error, the copy is aborted. +func CopyFromFunc(nxtf func() (row []any, err error)) CopyFromSource { + return ©FromFunc{next: nxtf} +} + +type copyFromFunc struct { + next func() ([]any, error) + valueRow []any + err error +} + +func (g *copyFromFunc) Next() bool { + g.valueRow, g.err = g.next() + // only return true if valueRow exists and no error + return g.valueRow != nil && g.err == nil +} + +func (g *copyFromFunc) Values() ([]any, error) { + return g.valueRow, g.err +} + +func (g *copyFromFunc) Err() error { + return g.err +} + // CopyFromSource is the interface used by *Conn.CopyFrom as the source for copy data. type CopyFromSource interface { // Next returns true if there is another row and makes the next row data diff --git a/vendor/github.com/jackc/pgx/v5/extended_query_builder.go b/vendor/github.com/jackc/pgx/v5/extended_query_builder.go index 0bbdfbb5..9c9de5b2 100644 --- a/vendor/github.com/jackc/pgx/v5/extended_query_builder.go +++ b/vendor/github.com/jackc/pgx/v5/extended_query_builder.go @@ -36,7 +36,7 @@ func (eqb *ExtendedQueryBuilder) Build(m *pgtype.Map, sd *pgconn.StatementDescri for i := range args { err := eqb.appendParam(m, sd.ParamOIDs[i], -1, args[i]) if err != nil { - err = fmt.Errorf("failed to encode args[%d]: %v", i, err) + err = fmt.Errorf("failed to encode args[%d]: %w", i, err) return err } } diff --git a/vendor/github.com/jackc/pgx/v5/internal/sanitize/sanitize.go b/vendor/github.com/jackc/pgx/v5/internal/sanitize/sanitize.go index e9e6d228..f9091cd4 100644 --- a/vendor/github.com/jackc/pgx/v5/internal/sanitize/sanitize.go +++ b/vendor/github.com/jackc/pgx/v5/internal/sanitize/sanitize.go @@ -35,6 +35,11 @@ func (q *Query) Sanitize(args ...any) (string, error) { str = part case int: argIdx := part - 1 + + if argIdx < 0 { + return "", fmt.Errorf("first sql argument must be > 0") + } + if argIdx >= len(args) { return "", fmt.Errorf("insufficient arguments") } diff --git a/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go b/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go index 4ed90def..1ccdc4db 100644 --- a/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go +++ b/vendor/github.com/jackc/pgx/v5/pgconn/pgconn.go @@ -813,6 +813,9 @@ type StatementDescription struct { // Prepare creates a prepared statement. If the name is empty, the anonymous prepared statement will be used. This // allows Prepare to also to describe statements without creating a server-side prepared statement. +// +// Prepare does not send a PREPARE statement to the server. It uses the PostgreSQL Parse and Describe protocol messages +// directly. func (pgConn *PgConn) Prepare(ctx context.Context, name, sql string, paramOIDs []uint32) (*StatementDescription, error) { if err := pgConn.lock(); err != nil { return nil, err @@ -869,6 +872,52 @@ readloop: return psd, nil } +// Deallocate deallocates a prepared statement. +// +// Deallocate does not send a DEALLOCATE statement to the server. It uses the PostgreSQL Close protocol message +// directly. This has slightly different behavior than executing DEALLOCATE statement. +// - Deallocate can succeed in an aborted transaction. +// - Deallocating a non-existent prepared statement is not an error. +func (pgConn *PgConn) Deallocate(ctx context.Context, name string) error { + if err := pgConn.lock(); err != nil { + return err + } + defer pgConn.unlock() + + if ctx != context.Background() { + select { + case <-ctx.Done(): + return newContextAlreadyDoneError(ctx) + default: + } + pgConn.contextWatcher.Watch(ctx) + defer pgConn.contextWatcher.Unwatch() + } + + pgConn.frontend.SendClose(&pgproto3.Close{ObjectType: 'S', Name: name}) + pgConn.frontend.SendSync(&pgproto3.Sync{}) + err := pgConn.flushWithPotentialWriteReadDeadlock() + if err != nil { + pgConn.asyncClose() + return err + } + + for { + msg, err := pgConn.receiveMessage() + if err != nil { + pgConn.asyncClose() + return normalizeTimeoutError(ctx, err) + } + + switch msg := msg.(type) { + case *pgproto3.ErrorResponse: + return ErrorResponseToPgError(msg) + case *pgproto3.ReadyForQuery: + return nil + } + } +} + // ErrorResponseToPgError converts a wire protocol error message to a *PgError. func ErrorResponseToPgError(msg *pgproto3.ErrorResponse) *PgError { return &PgError{ diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/array.go b/vendor/github.com/jackc/pgx/v5/pgtype/array.go index 73761956..06b824ad 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/array.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/array.go @@ -110,7 +110,7 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { r, _, err := buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } var explicitDimensions []ArrayDimension @@ -122,7 +122,7 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { for { r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } if r == '=' { @@ -133,12 +133,12 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { lower, err := arrayParseInteger(buf) if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } if r != ':' { @@ -147,12 +147,12 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { upper, err := arrayParseInteger(buf) if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } if r != ']' { @@ -164,12 +164,12 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } } if r != '{' { - return nil, fmt.Errorf("invalid array, expected '{': %v", err) + return nil, fmt.Errorf("invalid array, expected '{' got %v", r) } implicitDimensions := []ArrayDimension{{LowerBound: 1, Length: 0}} @@ -178,7 +178,7 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { for { r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } if r == '{' { @@ -195,7 +195,7 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { for { r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } switch r { @@ -214,7 +214,7 @@ func parseUntypedTextArray(src string) (*untypedTextArray, error) { buf.UnreadRune() value, quoted, err := arrayParseValue(buf) if err != nil { - return nil, fmt.Errorf("invalid array value: %v", err) + return nil, fmt.Errorf("invalid array value: %w", err) } if currentDim == counterDim { implicitDimensions[currentDim].Length++ diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/builtin_wrappers.go b/vendor/github.com/jackc/pgx/v5/pgtype/builtin_wrappers.go index 8bf367c1..b39d3fa1 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/builtin_wrappers.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/builtin_wrappers.go @@ -231,7 +231,7 @@ func (w *uint64Wrapper) ScanNumeric(v Numeric) error { bi, err := v.toBigInt() if err != nil { - return fmt.Errorf("cannot scan into *uint64: %v", err) + return fmt.Errorf("cannot scan into *uint64: %w", err) } if !bi.IsUint64() { @@ -284,7 +284,7 @@ func (w *uintWrapper) ScanNumeric(v Numeric) error { bi, err := v.toBigInt() if err != nil { - return fmt.Errorf("cannot scan into *uint: %v", err) + return fmt.Errorf("cannot scan into *uint: %w", err) } if !bi.IsUint64() { diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/date.go b/vendor/github.com/jackc/pgx/v5/pgtype/date.go index 009fc0db..784b16de 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/date.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/date.go @@ -282,17 +282,17 @@ func (scanPlanTextAnyToDateScanner) Scan(src []byte, dst any) error { if match != nil { year, err := strconv.ParseInt(match[1], 10, 32) if err != nil { - return fmt.Errorf("BUG: cannot parse date that regexp matched (year): %v", err) + return fmt.Errorf("BUG: cannot parse date that regexp matched (year): %w", err) } month, err := strconv.ParseInt(match[2], 10, 32) if err != nil { - return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %v", err) + return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %w", err) } day, err := strconv.ParseInt(match[3], 10, 32) if err != nil { - return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %v", err) + return fmt.Errorf("BUG: cannot parse date that regexp matched (month): %w", err) } // BC matched diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/json.go b/vendor/github.com/jackc/pgx/v5/pgtype/json.go index d332dd0d..3f1a750f 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/json.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/json.go @@ -25,18 +25,21 @@ func (c JSONCodec) PlanEncode(m *Map, oid uint32, format int16, value any) Encod case []byte: return encodePlanJSONCodecEitherFormatByteSlice{} + // Cannot rely on driver.Valuer being handled later because anything can be marshalled. + // + // https://github.com/jackc/pgx/issues/1430 + // + // Check for driver.Valuer must come before json.Marshaler so that it is guaranteed to beused + // when both are implemented https://github.com/jackc/pgx/issues/1805 + case driver.Valuer: + return &encodePlanDriverValuer{m: m, oid: oid, formatCode: format} + // Must come before trying wrap encode plans because a pointer to a struct may be unwrapped to a struct that can be // marshalled. // // https://github.com/jackc/pgx/issues/1681 case json.Marshaler: return encodePlanJSONCodecEitherFormatMarshal{} - - // Cannot rely on driver.Valuer being handled later because anything can be marshalled. - // - // https://github.com/jackc/pgx/issues/1430 - case driver.Valuer: - return &encodePlanDriverValuer{m: m, oid: oid, formatCode: format} } // Because anything can be marshalled the normal wrapping in Map.PlanScan doesn't get a chance to run. So try the diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/multirange.go b/vendor/github.com/jackc/pgx/v5/pgtype/multirange.go index 34950b34..e5763788 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/multirange.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/multirange.go @@ -339,18 +339,18 @@ func parseUntypedTextMultirange(src []byte) ([]string, error) { r, _, err := buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid array: %v", err) + return nil, fmt.Errorf("invalid array: %w", err) } if r != '{' { - return nil, fmt.Errorf("invalid multirange, expected '{': %v", err) + return nil, fmt.Errorf("invalid multirange, expected '{' got %v", r) } parseValueLoop: for { r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid multirange: %v", err) + return nil, fmt.Errorf("invalid multirange: %w", err) } switch r { @@ -361,7 +361,7 @@ parseValueLoop: buf.UnreadRune() value, err := parseRange(buf) if err != nil { - return nil, fmt.Errorf("invalid multirange value: %v", err) + return nil, fmt.Errorf("invalid multirange value: %w", err) } elements = append(elements, value) } diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/numeric.go b/vendor/github.com/jackc/pgx/v5/pgtype/numeric.go index 0e58fd07..4dbec786 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/numeric.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/numeric.go @@ -119,6 +119,26 @@ func (n Numeric) Int64Value() (Int8, error) { return Int8{Int64: bi.Int64(), Valid: true}, nil } +func (n *Numeric) ScanScientific(src string) error { + if !strings.ContainsAny("eE", src) { + return scanPlanTextAnyToNumericScanner{}.Scan([]byte(src), n) + } + + if bigF, ok := new(big.Float).SetString(string(src)); ok { + smallF, _ := bigF.Float64() + src = strconv.FormatFloat(smallF, 'f', -1, 64) + } + + num, exp, err := parseNumericString(src) + if err != nil { + return err + } + + *n = Numeric{Int: num, Exp: exp, Valid: true} + + return nil +} + func (n *Numeric) toBigInt() (*big.Int, error) { if n.Exp == 0 { return n.Int, nil diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/range.go b/vendor/github.com/jackc/pgx/v5/pgtype/range.go index 8f408f9f..16427ccc 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/range.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/range.go @@ -40,7 +40,7 @@ func parseUntypedTextRange(src string) (*untypedTextRange, error) { r, _, err := buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid lower bound: %v", err) + return nil, fmt.Errorf("invalid lower bound: %w", err) } switch r { case '(': @@ -53,7 +53,7 @@ func parseUntypedTextRange(src string) (*untypedTextRange, error) { r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid lower value: %v", err) + return nil, fmt.Errorf("invalid lower value: %w", err) } buf.UnreadRune() @@ -62,13 +62,13 @@ func parseUntypedTextRange(src string) (*untypedTextRange, error) { } else { utr.Lower, err = rangeParseValue(buf) if err != nil { - return nil, fmt.Errorf("invalid lower value: %v", err) + return nil, fmt.Errorf("invalid lower value: %w", err) } } r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("missing range separator: %v", err) + return nil, fmt.Errorf("missing range separator: %w", err) } if r != ',' { return nil, fmt.Errorf("missing range separator: %v", r) @@ -76,7 +76,7 @@ func parseUntypedTextRange(src string) (*untypedTextRange, error) { r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("invalid upper value: %v", err) + return nil, fmt.Errorf("invalid upper value: %w", err) } if r == ')' || r == ']' { @@ -85,12 +85,12 @@ func parseUntypedTextRange(src string) (*untypedTextRange, error) { buf.UnreadRune() utr.Upper, err = rangeParseValue(buf) if err != nil { - return nil, fmt.Errorf("invalid upper value: %v", err) + return nil, fmt.Errorf("invalid upper value: %w", err) } r, _, err = buf.ReadRune() if err != nil { - return nil, fmt.Errorf("missing upper bound: %v", err) + return nil, fmt.Errorf("missing upper bound: %w", err) } switch r { case ')': diff --git a/vendor/github.com/jackc/pgx/v5/pgtype/range_codec.go b/vendor/github.com/jackc/pgx/v5/pgtype/range_codec.go index 8cfb3a63..684f1bf7 100644 --- a/vendor/github.com/jackc/pgx/v5/pgtype/range_codec.go +++ b/vendor/github.com/jackc/pgx/v5/pgtype/range_codec.go @@ -120,7 +120,7 @@ func (plan *encodePlanRangeCodecRangeValuerToBinary) Encode(value any, buf []byt buf, err = lowerPlan.Encode(lower, buf) if err != nil { - return nil, fmt.Errorf("failed to encode %v as element of range: %v", lower, err) + return nil, fmt.Errorf("failed to encode %v as element of range: %w", lower, err) } if buf == nil { return nil, fmt.Errorf("Lower cannot be NULL unless LowerType is Unbounded") @@ -144,7 +144,7 @@ func (plan *encodePlanRangeCodecRangeValuerToBinary) Encode(value any, buf []byt buf, err = upperPlan.Encode(upper, buf) if err != nil { - return nil, fmt.Errorf("failed to encode %v as element of range: %v", upper, err) + return nil, fmt.Errorf("failed to encode %v as element of range: %w", upper, err) } if buf == nil { return nil, fmt.Errorf("Upper cannot be NULL unless UpperType is Unbounded") @@ -194,7 +194,7 @@ func (plan *encodePlanRangeCodecRangeValuerToText) Encode(value any, buf []byte) buf, err = lowerPlan.Encode(lower, buf) if err != nil { - return nil, fmt.Errorf("failed to encode %v as element of range: %v", lower, err) + return nil, fmt.Errorf("failed to encode %v as element of range: %w", lower, err) } if buf == nil { return nil, fmt.Errorf("Lower cannot be NULL unless LowerType is Unbounded") @@ -215,7 +215,7 @@ func (plan *encodePlanRangeCodecRangeValuerToText) Encode(value any, buf []byte) buf, err = upperPlan.Encode(upper, buf) if err != nil { - return nil, fmt.Errorf("failed to encode %v as element of range: %v", upper, err) + return nil, fmt.Errorf("failed to encode %v as element of range: %w", upper, err) } if buf == nil { return nil, fmt.Errorf("Upper cannot be NULL unless UpperType is Unbounded") @@ -282,7 +282,7 @@ func (plan *scanPlanBinaryRangeToRangeScanner) Scan(src []byte, target any) erro err = lowerPlan.Scan(ubr.Lower, lowerTarget) if err != nil { - return fmt.Errorf("cannot scan into %v from range element: %v", lowerTarget, err) + return fmt.Errorf("cannot scan into %v from range element: %w", lowerTarget, err) } } @@ -294,7 +294,7 @@ func (plan *scanPlanBinaryRangeToRangeScanner) Scan(src []byte, target any) erro err = upperPlan.Scan(ubr.Upper, upperTarget) if err != nil { - return fmt.Errorf("cannot scan into %v from range element: %v", upperTarget, err) + return fmt.Errorf("cannot scan into %v from range element: %w", upperTarget, err) } } @@ -332,7 +332,7 @@ func (plan *scanPlanTextRangeToRangeScanner) Scan(src []byte, target any) error err = lowerPlan.Scan([]byte(utr.Lower), lowerTarget) if err != nil { - return fmt.Errorf("cannot scan into %v from range element: %v", lowerTarget, err) + return fmt.Errorf("cannot scan into %v from range element: %w", lowerTarget, err) } } @@ -344,7 +344,7 @@ func (plan *scanPlanTextRangeToRangeScanner) Scan(src []byte, target any) error err = upperPlan.Scan([]byte(utr.Upper), upperTarget) if err != nil { - return fmt.Errorf("cannot scan into %v from range element: %v", upperTarget, err) + return fmt.Errorf("cannot scan into %v from range element: %w", upperTarget, err) } } diff --git a/vendor/github.com/jackc/pgx/v5/stdlib/sql.go b/vendor/github.com/jackc/pgx/v5/stdlib/sql.go index c5be1a3f..86a4c932 100644 --- a/vendor/github.com/jackc/pgx/v5/stdlib/sql.go +++ b/vendor/github.com/jackc/pgx/v5/stdlib/sql.go @@ -31,7 +31,7 @@ // with sql.Open. // // connConfig, _ := pgx.ParseConfig(os.Getenv("DATABASE_URL")) -// connConfig.Logger = myLogger +// connConfig.Tracer = &tracelog.TraceLog{Logger: myLogger, LogLevel: tracelog.LogLevelInfo} // connStr := stdlib.RegisterConnConfig(connConfig) // db, _ := sql.Open("pgx", connStr) // @@ -840,7 +840,7 @@ func (r *Rows) Next(dest []driver.Value) error { var err error dest[i], err = r.valueFuncs[i](rv) if err != nil { - return fmt.Errorf("convert field %d failed: %v", i, err) + return fmt.Errorf("convert field %d failed: %w", i, err) } } else { dest[i] = nil diff --git a/vendor/github.com/klauspost/compress/README.md b/vendor/github.com/klauspost/compress/README.md index 43de4867..7e83f583 100644 --- a/vendor/github.com/klauspost/compress/README.md +++ b/vendor/github.com/klauspost/compress/README.md @@ -16,6 +16,14 @@ This package provides various compression algorithms. # changelog +* Oct 22nd, 2023 - [v1.17.2](https://github.com/klauspost/compress/releases/tag/v1.17.2) + * zstd: Fix rare *CORRUPTION* output in "best" mode. See https://github.com/klauspost/compress/pull/876 + +* Oct 14th, 2023 - [v1.17.1](https://github.com/klauspost/compress/releases/tag/v1.17.1) + * s2: Fix S2 "best" dictionary wrong encoding by @klauspost in https://github.com/klauspost/compress/pull/871 + * flate: Reduce allocations in decompressor and minor code improvements by @fakefloordiv in https://github.com/klauspost/compress/pull/869 + * s2: Fix EstimateBlockSize on 6&7 length input by @klauspost in https://github.com/klauspost/compress/pull/867 + * Sept 19th, 2023 - [v1.17.0](https://github.com/klauspost/compress/releases/tag/v1.17.0) * Add experimental dictionary builder https://github.com/klauspost/compress/pull/853 * Add xerial snappy read/writer https://github.com/klauspost/compress/pull/838 diff --git a/vendor/github.com/klauspost/compress/fse/compress.go b/vendor/github.com/klauspost/compress/fse/compress.go index 65d77735..074018d8 100644 --- a/vendor/github.com/klauspost/compress/fse/compress.go +++ b/vendor/github.com/klauspost/compress/fse/compress.go @@ -212,7 +212,7 @@ func (s *Scratch) writeCount() error { previous0 bool charnum uint16 - maxHeaderSize = ((int(s.symbolLen) * int(tableLog)) >> 3) + 3 + maxHeaderSize = ((int(s.symbolLen)*int(tableLog) + 4 + 2) >> 3) + 3 // Write Table Size bitStream = uint32(tableLog - minTablelog) diff --git a/vendor/github.com/klauspost/compress/gzip/gunzip.go b/vendor/github.com/klauspost/compress/gzip/gunzip.go index dc2362a6..00a0a2c3 100644 --- a/vendor/github.com/klauspost/compress/gzip/gunzip.go +++ b/vendor/github.com/klauspost/compress/gzip/gunzip.go @@ -238,6 +238,11 @@ func (z *Reader) readHeader() (hdr Header, err error) { } } + // Reserved FLG bits must be zero. + if flg>>5 != 0 { + return hdr, ErrHeader + } + z.digest = 0 if z.decompressor == nil { z.decompressor = flate.NewReader(z.r) diff --git a/vendor/github.com/klauspost/compress/huff0/bytereader.go b/vendor/github.com/klauspost/compress/huff0/bytereader.go deleted file mode 100644 index 4dcab8d2..00000000 --- a/vendor/github.com/klauspost/compress/huff0/bytereader.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2018 Klaus Post. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. -// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. - -package huff0 - -// byteReader provides a byte reader that reads -// little endian values from a byte stream. -// The input stream is manually advanced. -// The reader performs no bounds checks. -type byteReader struct { - b []byte - off int -} - -// init will initialize the reader and set the input. -func (b *byteReader) init(in []byte) { - b.b = in - b.off = 0 -} - -// Int32 returns a little endian int32 starting at current offset. -func (b byteReader) Int32() int32 { - v3 := int32(b.b[b.off+3]) - v2 := int32(b.b[b.off+2]) - v1 := int32(b.b[b.off+1]) - v0 := int32(b.b[b.off]) - return (v3 << 24) | (v2 << 16) | (v1 << 8) | v0 -} - -// Uint32 returns a little endian uint32 starting at current offset. -func (b byteReader) Uint32() uint32 { - v3 := uint32(b.b[b.off+3]) - v2 := uint32(b.b[b.off+2]) - v1 := uint32(b.b[b.off+1]) - v0 := uint32(b.b[b.off]) - return (v3 << 24) | (v2 << 16) | (v1 << 8) | v0 -} - -// remain will return the number of bytes remaining. -func (b byteReader) remain() int { - return len(b.b) - b.off -} diff --git a/vendor/github.com/klauspost/compress/huff0/compress.go b/vendor/github.com/klauspost/compress/huff0/compress.go index 518436cf..84aa3d12 100644 --- a/vendor/github.com/klauspost/compress/huff0/compress.go +++ b/vendor/github.com/klauspost/compress/huff0/compress.go @@ -350,6 +350,7 @@ func (s *Scratch) compress4Xp(src []byte) ([]byte, error) { // Does not update s.clearCount. func (s *Scratch) countSimple(in []byte) (max int, reuse bool) { reuse = true + _ = s.count // Assert that s != nil to speed up the following loop. for _, v := range in { s.count[v]++ } @@ -415,7 +416,7 @@ func (s *Scratch) validateTable(c cTable) bool { // minTableLog provides the minimum logSize to safely represent a distribution. func (s *Scratch) minTableLog() uint8 { - minBitsSrc := highBit32(uint32(s.br.remain())) + 1 + minBitsSrc := highBit32(uint32(s.srcLen)) + 1 minBitsSymbols := highBit32(uint32(s.symbolLen-1)) + 2 if minBitsSrc < minBitsSymbols { return uint8(minBitsSrc) @@ -427,7 +428,7 @@ func (s *Scratch) minTableLog() uint8 { func (s *Scratch) optimalTableLog() { tableLog := s.TableLog minBits := s.minTableLog() - maxBitsSrc := uint8(highBit32(uint32(s.br.remain()-1))) - 1 + maxBitsSrc := uint8(highBit32(uint32(s.srcLen-1))) - 1 if maxBitsSrc < tableLog { // Accuracy can be reduced tableLog = maxBitsSrc diff --git a/vendor/github.com/klauspost/compress/huff0/huff0.go b/vendor/github.com/klauspost/compress/huff0/huff0.go index e8ad17ad..77ecd68e 100644 --- a/vendor/github.com/klauspost/compress/huff0/huff0.go +++ b/vendor/github.com/klauspost/compress/huff0/huff0.go @@ -88,7 +88,7 @@ type Scratch struct { // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded. MaxDecodedSize int - br byteReader + srcLen int // MaxSymbolValue will override the maximum symbol value of the next block. MaxSymbolValue uint8 @@ -170,7 +170,7 @@ func (s *Scratch) prepare(in []byte) (*Scratch, error) { if s.fse == nil { s.fse = &fse.Scratch{} } - s.br.init(in) + s.srcLen = len(in) return s, nil } diff --git a/vendor/github.com/klauspost/compress/zstd/README.md b/vendor/github.com/klauspost/compress/zstd/README.md index bdd49c8b..92e2347b 100644 --- a/vendor/github.com/klauspost/compress/zstd/README.md +++ b/vendor/github.com/klauspost/compress/zstd/README.md @@ -259,7 +259,7 @@ nyc-taxi-data-10M.csv gzkp 1 3325605752 922273214 13929 227.68 ## Decompressor -Staus: STABLE - there may still be subtle bugs, but a wide variety of content has been tested. +Status: STABLE - there may still be subtle bugs, but a wide variety of content has been tested. This library is being continuously [fuzz-tested](https://github.com/klauspost/compress-fuzz), kindly supplied by [fuzzit.dev](https://fuzzit.dev/). diff --git a/vendor/github.com/klauspost/compress/zstd/enc_best.go b/vendor/github.com/klauspost/compress/zstd/enc_best.go index 858f8f43..c81a1535 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_best.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_best.go @@ -43,7 +43,7 @@ func (m *match) estBits(bitsPerByte int32) { if m.rep < 0 { ofc = ofCode(uint32(m.s-m.offset) + 3) } else { - ofc = ofCode(uint32(m.rep)) + ofc = ofCode(uint32(m.rep) & 3) } // Cost, excluding ofTT, mlTT := fsePredefEnc[tableOffsets].ct.symbolTT[ofc], fsePredefEnc[tableMatchLengths].ct.symbolTT[mlc] @@ -227,7 +227,7 @@ encodeLoop: } } l := 4 + e.matchlen(s+4, offset+4, src) - if rep < 0 { + if true { // Extend candidate match backwards as far as possible. tMin := s - e.maxMatchOff if tMin < 0 { @@ -282,6 +282,7 @@ encodeLoop: // Load next and check... e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: candidateL.offset} e.table[nextHashS] = prevEntry{offset: s + e.cur, prev: candidateS.offset} + index0 := s + 1 // Look far ahead, unless we have a really long match already... if best.length < goodEnough { @@ -357,19 +358,16 @@ encodeLoop: blk.sequences = append(blk.sequences, seq) // Index old s + 1 -> s - 1 - index0 := s + 1 s = best.s + best.length - nextEmit = s - if s >= sLimit { - if debugEncoder { - println("repeat ended", s, best.length) - } - break encodeLoop - } + // Index skipped... + end := s + if s > sLimit+4 { + end = sLimit + 4 + } off := index0 + e.cur - for index0 < s { + for index0 < end { cv0 := load6432(src, index0) h0 := hashLen(cv0, bestLongTableBits, bestLongLen) h1 := hashLen(cv0, bestShortTableBits, bestShortLen) @@ -378,6 +376,7 @@ encodeLoop: off++ index0++ } + switch best.rep { case 2, 4 | 1: offset1, offset2 = offset2, offset1 @@ -386,12 +385,17 @@ encodeLoop: case 4 | 3: offset1, offset2, offset3 = offset1-1, offset1, offset2 } + if s >= sLimit { + if debugEncoder { + println("repeat ended", s, best.length) + } + break encodeLoop + } continue } // A 4-byte match has been found. Update recent offsets. // We'll later see if more than 4 bytes. - index0 := s + 1 s = best.s t := best.offset offset1, offset2, offset3 = s-t, offset1, offset2 @@ -419,19 +423,25 @@ encodeLoop: } blk.sequences = append(blk.sequences, seq) nextEmit = s - if s >= sLimit { - break encodeLoop + + // Index old s + 1 -> s - 1 or sLimit + end := s + if s > sLimit-4 { + end = sLimit - 4 } - // Index old s + 1 -> s - 1 - for index0 < s { + off := index0 + e.cur + for index0 < end { cv0 := load6432(src, index0) h0 := hashLen(cv0, bestLongTableBits, bestLongLen) h1 := hashLen(cv0, bestShortTableBits, bestShortLen) - off := index0 + e.cur e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} e.table[h1] = prevEntry{offset: off, prev: e.table[h1].offset} index0++ + off++ + } + if s >= sLimit { + break encodeLoop } } diff --git a/vendor/github.com/klauspost/compress/zstd/enc_better.go b/vendor/github.com/klauspost/compress/zstd/enc_better.go index 8582f31a..20d25b0e 100644 --- a/vendor/github.com/klauspost/compress/zstd/enc_better.go +++ b/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -145,7 +145,7 @@ encodeLoop: var t int32 // We allow the encoder to optionally turn off repeat offsets across blocks canRepeat := len(blk.sequences) > 2 - var matched int32 + var matched, index0 int32 for { if debugAsserts && canRepeat && offset1 == 0 { @@ -162,6 +162,7 @@ encodeLoop: off := s + e.cur e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset} e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)} + index0 = s + 1 if canRepeat { if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { @@ -258,7 +259,6 @@ encodeLoop: } blk.sequences = append(blk.sequences, seq) - index0 := s + repOff2 s += lenght + repOff2 nextEmit = s if s >= sLimit { @@ -498,15 +498,15 @@ encodeLoop: } // Index match start+1 (long) -> s - 1 - index0 := s - l + 1 + off := index0 + e.cur for index0 < s-1 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 h0 := hashLen(cv0, betterLongTableBits, betterLongLen) - off := index0 + e.cur e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} e.table[hashLen(cv1, betterShortTableBits, betterShortLen)] = tableEntry{offset: off + 1, val: uint32(cv1)} index0 += 2 + off += 2 } cv = load6432(src, s) @@ -672,7 +672,7 @@ encodeLoop: var t int32 // We allow the encoder to optionally turn off repeat offsets across blocks canRepeat := len(blk.sequences) > 2 - var matched int32 + var matched, index0 int32 for { if debugAsserts && canRepeat && offset1 == 0 { @@ -691,6 +691,7 @@ encodeLoop: e.markLongShardDirty(nextHashL) e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)} e.markShortShardDirty(nextHashS) + index0 = s + 1 if canRepeat { if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { @@ -726,7 +727,6 @@ encodeLoop: blk.sequences = append(blk.sequences, seq) // Index match start+1 (long) -> s - 1 - index0 := s + repOff s += lenght + repOff nextEmit = s @@ -790,7 +790,6 @@ encodeLoop: } blk.sequences = append(blk.sequences, seq) - index0 := s + repOff2 s += lenght + repOff2 nextEmit = s if s >= sLimit { @@ -1024,18 +1023,18 @@ encodeLoop: } // Index match start+1 (long) -> s - 1 - index0 := s - l + 1 + off := index0 + e.cur for index0 < s-1 { cv0 := load6432(src, index0) cv1 := cv0 >> 8 h0 := hashLen(cv0, betterLongTableBits, betterLongLen) - off := index0 + e.cur e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} e.markLongShardDirty(h0) h1 := hashLen(cv1, betterShortTableBits, betterShortLen) e.table[h1] = tableEntry{offset: off + 1, val: uint32(cv1)} e.markShortShardDirty(h1) index0 += 2 + off += 2 } cv = load6432(src, s) diff --git a/vendor/github.com/mattn/go-sqlite3/sqlite3.go b/vendor/github.com/mattn/go-sqlite3/sqlite3.go index 5e4e2ff5..57641823 100644 --- a/vendor/github.com/mattn/go-sqlite3/sqlite3.go +++ b/vendor/github.com/mattn/go-sqlite3/sqlite3.go @@ -21,7 +21,6 @@ package sqlite3 #cgo CFLAGS: -DSQLITE_DEFAULT_WAL_SYNCHRONOUS=1 #cgo CFLAGS: -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT #cgo CFLAGS: -Wno-deprecated-declarations -#cgo linux,!android CFLAGS: -DHAVE_PREAD64=1 -DHAVE_PWRITE64=1 #cgo openbsd CFLAGS: -I/usr/local/include #cgo openbsd LDFLAGS: -L/usr/local/lib #ifndef USE_LIBSQLITE3 @@ -48,6 +47,18 @@ package sqlite3 # define SQLITE_DETERMINISTIC 0 #endif +#if defined(HAVE_PREAD64) && defined(HAVE_PWRITE64) +# undef USE_PREAD +# undef USE_PWRITE +# define USE_PREAD64 1 +# define USE_PWRITE64 1 +#elif defined(HAVE_PREAD) && defined(HAVE_PWRITE) +# undef USE_PREAD +# undef USE_PWRITE +# define USE_PREAD64 1 +# define USE_PWRITE64 1 +#endif + static int _sqlite3_open_v2(const char *filename, sqlite3 **ppDb, int flags, const char *zVfs) { #ifdef SQLITE_OPEN_URI diff --git a/vendor/github.com/minio/minio-go/v7/README.md b/vendor/github.com/minio/minio-go/v7/README.md index 9b6bbbec..82f70a13 100644 --- a/vendor/github.com/minio/minio-go/v7/README.md +++ b/vendor/github.com/minio/minio-go/v7/README.md @@ -1,23 +1,28 @@ # MinIO Go Client SDK for Amazon S3 Compatible Cloud Storage [![Slack](https://slack.min.io/slack?type=svg)](https://slack.min.io) [![Sourcegraph](https://sourcegraph.com/github.com/minio/minio-go/-/badge.svg)](https://sourcegraph.com/github.com/minio/minio-go?badge) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/minio/minio-go/blob/master/LICENSE) -The MinIO Go Client SDK provides simple APIs to access any Amazon S3 compatible object storage. +The MinIO Go Client SDK provides straightforward APIs to access any Amazon S3 compatible object storage. -This quickstart guide will show you how to install the MinIO client SDK, connect to MinIO, and provide a walkthrough for a simple file uploader. For a complete list of APIs and examples, please take a look at the [Go Client API Reference](https://min.io/docs/minio/linux/developers/go/API.html). +This Quickstart Guide covers how to install the MinIO client SDK, connect to MinIO, and create a sample file uploader. +For a complete list of APIs and examples, see the [godoc documentation](https://pkg.go.dev/github.com/minio/minio-go/v7) or [Go Client API Reference](https://min.io/docs/minio/linux/developers/go/API.html). -This document assumes that you have a working [Go development environment](https://golang.org/doc/install). +These examples presume a working [Go development environment](https://golang.org/doc/install) and the [MinIO `mc` command line tool](https://min.io/docs/minio/linux/reference/minio-mc.html). ## Download from Github + +From your project directory: + ```sh go get github.com/minio/minio-go/v7 ``` -## Initialize MinIO Client -MinIO client requires the following four parameters specified to connect to an Amazon S3 compatible object storage. +## Initialize a MinIO Client Object -| Parameter | Description| -| :--- | :--- | -| endpoint | URL to object storage service. | -| _minio.Options_ | All the options such as credentials, custom transport etc. | +The MinIO client requires the following parameters to connect to an Amazon S3 compatible object storage: + +| Parameter | Description | +| ----------------- | ---------------------------------------------------------- | +| `endpoint` | URL to object storage service. | +| `_minio.Options_` | All the options such as credentials, custom transport etc. | ```go package main @@ -48,13 +53,25 @@ func main() { } ``` -## Quick Start Example - File Uploader -This example program connects to an object storage server, creates a bucket and uploads a file to the bucket. +## Example - File Uploader -We will use the MinIO server running at [https://play.min.io](https://play.min.io) in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public. +This sample code connects to an object storage server, creates a bucket, and uploads a file to the bucket. +It uses the MinIO `play` server, a public MinIO cluster located at [https://play.min.io](https://play.min.io). + +The `play` server runs the latest stable version of MinIO and may be used for testing and development. +The access credentials shown in this example are open to the public and all data uploaded to `play` should be considered public and non-protected. ### FileUploader.go + +This example does the following: + +- Connects to the MinIO `play` server using the provided credentials. +- Creates a bucket named `testbucket`. +- Uploads a file named `testdata` from `/tmp`. +- Verifies the file was created using `mc ls`. + ```go +// FileUploader.go MinIO example package main import ( @@ -81,8 +98,8 @@ func main() { log.Fatalln(err) } - // Make a new bucket called mymusic. - bucketName := "mymusic" + // Make a new bucket called testbucket. + bucketName := "testbucket" location := "us-east-1" err = minioClient.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{Region: location}) @@ -98,12 +115,13 @@ func main() { log.Printf("Successfully created %s\n", bucketName) } - // Upload the zip file - objectName := "golden-oldies.zip" - filePath := "/tmp/golden-oldies.zip" - contentType := "application/zip" + // Upload the test file + // Change the value of filePath if the file is in another location + objectName := "testdata" + filePath := "/tmp/testdata" + contentType := "application/octet-stream" - // Upload the zip file with FPutObject + // Upload the test file with FPutObject info, err := minioClient.FPutObject(ctx, bucketName, objectName, filePath, minio.PutObjectOptions{ContentType: contentType}) if err != nil { log.Fatalln(err) @@ -113,22 +131,51 @@ func main() { } ``` -### Run FileUploader -```sh -go run file-uploader.go -2016/08/13 17:03:28 Successfully created mymusic -2016/08/13 17:03:40 Successfully uploaded golden-oldies.zip of size 16253413 +**1. Create a test file containing data:** -mc ls play/mymusic/ -[2016-05-27 16:02:16 PDT] 17MiB golden-oldies.zip +You can do this with `dd` on Linux or macOS systems: + +```sh +dd if=/dev/urandom of=/tmp/testdata bs=2048 count=10 +``` + +or `fsutil` on Windows: + +```sh +fsutil file createnew "C:\Users\\Desktop\sample.txt" 20480 +``` + +**2. Run FileUploader with the following commands:** + +```sh +go mod init example/FileUploader +go get github.com/minio/minio-go/v7 +go get github.com/minio/minio-go/v7/pkg/credentials +go run FileUploader.go +``` + +The output resembles the following: + +```sh +2023/11/01 14:27:55 Successfully created testbucket +2023/11/01 14:27:55 Successfully uploaded testdata of size 20480 +``` + +**3. Verify the Uploaded File With `mc ls`:** + +```sh +mc ls play/testbucket +[2023-11-01 14:27:55 UTC] 20KiB STANDARD TestDataFile ``` ## API Reference + The full API Reference is available here. * [Complete API Reference](https://min.io/docs/minio/linux/developers/go/API.html) ### API Reference : Bucket Operations + * [`MakeBucket`](https://min.io/docs/minio/linux/developers/go/API.html#MakeBucket) * [`ListBuckets`](https://min.io/docs/minio/linux/developers/go/API.html#ListBuckets) * [`BucketExists`](https://min.io/docs/minio/linux/developers/go/API.html#BucketExists) @@ -137,10 +184,12 @@ The full API Reference is available here. * [`ListIncompleteUploads`](https://min.io/docs/minio/linux/developers/go/API.html#ListIncompleteUploads) ### API Reference : Bucket policy Operations + * [`SetBucketPolicy`](https://min.io/docs/minio/linux/developers/go/API.html#SetBucketPolicy) * [`GetBucketPolicy`](https://min.io/docs/minio/linux/developers/go/API.html#GetBucketPolicy) ### API Reference : Bucket notification Operations + * [`SetBucketNotification`](https://min.io/docs/minio/linux/developers/go/API.html#SetBucketNotification) * [`GetBucketNotification`](https://min.io/docs/minio/linux/developers/go/API.html#GetBucketNotification) * [`RemoveAllBucketNotification`](https://min.io/docs/minio/linux/developers/go/API.html#RemoveAllBucketNotification) @@ -148,10 +197,12 @@ The full API Reference is available here. * [`ListenNotification`](https://min.io/docs/minio/linux/developers/go/API.html#ListenNotification) (MinIO Extension) ### API Reference : File Object Operations + * [`FPutObject`](https://min.io/docs/minio/linux/developers/go/API.html#FPutObject) * [`FGetObject`](https://min.io/docs/minio/linux/developers/go/API.html#FGetObject) ### API Reference : Object Operations + * [`GetObject`](https://min.io/docs/minio/linux/developers/go/API.html#GetObject) * [`PutObject`](https://min.io/docs/minio/linux/developers/go/API.html#PutObject) * [`PutObjectStreaming`](https://min.io/docs/minio/linux/developers/go/API.html#PutObjectStreaming) @@ -162,14 +213,15 @@ The full API Reference is available here. * [`RemoveIncompleteUpload`](https://min.io/docs/minio/linux/developers/go/API.html#RemoveIncompleteUpload) * [`SelectObjectContent`](https://min.io/docs/minio/linux/developers/go/API.html#SelectObjectContent) - ### API Reference : Presigned Operations + * [`PresignedGetObject`](https://min.io/docs/minio/linux/developers/go/API.html#PresignedGetObject) * [`PresignedPutObject`](https://min.io/docs/minio/linux/developers/go/API.html#PresignedPutObject) * [`PresignedHeadObject`](https://min.io/docs/minio/linux/developers/go/API.html#PresignedHeadObject) * [`PresignedPostPolicy`](https://min.io/docs/minio/linux/developers/go/API.html#PresignedPostPolicy) ### API Reference : Client custom settings + * [`SetAppInfo`](https://min.io/docs/minio/linux/developers/go/API.html#SetAppInfo) * [`TraceOn`](https://min.io/docs/minio/linux/developers/go/API.html#TraceOn) * [`TraceOff`](https://min.io/docs/minio/linux/developers/go/API.html#TraceOff) @@ -177,6 +229,7 @@ The full API Reference is available here. ## Full Examples ### Full Examples : Bucket Operations + * [makebucket.go](https://github.com/minio/minio-go/blob/master/examples/s3/makebucket.go) * [listbuckets.go](https://github.com/minio/minio-go/blob/master/examples/s3/listbuckets.go) * [bucketexists.go](https://github.com/minio/minio-go/blob/master/examples/s3/bucketexists.go) @@ -186,25 +239,30 @@ The full API Reference is available here. * [listincompleteuploads.go](https://github.com/minio/minio-go/blob/master/examples/s3/listincompleteuploads.go) ### Full Examples : Bucket policy Operations + * [setbucketpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketpolicy.go) * [getbucketpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketpolicy.go) * [listbucketpolicies.go](https://github.com/minio/minio-go/blob/master/examples/s3/listbucketpolicies.go) ### Full Examples : Bucket lifecycle Operations + * [setbucketlifecycle.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketlifecycle.go) * [getbucketlifecycle.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketlifecycle.go) ### Full Examples : Bucket encryption Operations + * [setbucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketencryption.go) * [getbucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketencryption.go) * [deletebucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/deletebucketencryption.go) ### Full Examples : Bucket replication Operations + * [setbucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketreplication.go) * [getbucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketreplication.go) * [removebucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/removebucketreplication.go) ### Full Examples : Bucket notification Operations + * [setbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketnotification.go) * [getbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketnotification.go) * [removeallbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeallbucketnotification.go) @@ -212,10 +270,12 @@ The full API Reference is available here. * [listennotification.go](https://github.com/minio/minio-go/blob/master/examples/minio/listen-notification.go) (MinIO Extension) ### Full Examples : File Object Operations + * [fputobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/fputobject.go) * [fgetobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/fgetobject.go) ### Full Examples : Object Operations + * [putobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/putobject.go) * [getobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/getobject.go) * [statobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/statobject.go) @@ -225,22 +285,28 @@ The full API Reference is available here. * [removeobjects.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeobjects.go) ### Full Examples : Encrypted Object Operations + * [put-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/put-encrypted-object.go) * [get-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/get-encrypted-object.go) * [fput-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/fputencrypted-object.go) ### Full Examples : Presigned Operations + * [presignedgetobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedgetobject.go) * [presignedputobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedputobject.go) * [presignedheadobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedheadobject.go) * [presignedpostpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedpostpolicy.go) ## Explore Further + +* [Godoc Documentation](https://pkg.go.dev/github.com/minio/minio-go/v7) * [Complete Documentation](https://min.io/docs/minio/kubernetes/upstream/index.html) * [MinIO Go Client SDK API Reference](https://min.io/docs/minio/linux/developers/go/API.html) ## Contribute + [Contributors Guide](https://github.com/minio/minio-go/blob/master/CONTRIBUTING.md) ## License + This SDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](https://github.com/minio/minio-go/blob/master/LICENSE) and [NOTICE](https://github.com/minio/minio-go/blob/master/NOTICE) for more information. diff --git a/vendor/github.com/minio/minio-go/v7/api-get-object.go b/vendor/github.com/minio/minio-go/v7/api-get-object.go index e31e4cf9..9e6b1543 100644 --- a/vendor/github.com/minio/minio-go/v7/api-get-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-get-object.go @@ -550,6 +550,8 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { } } + newOffset := o.currOffset + // Switch through whence. switch whence { default: @@ -558,12 +560,12 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { if o.objectInfo.Size > -1 && offset > o.objectInfo.Size { return 0, io.EOF } - o.currOffset = offset + newOffset = offset case 1: if o.objectInfo.Size > -1 && o.currOffset+offset > o.objectInfo.Size { return 0, io.EOF } - o.currOffset += offset + newOffset += offset case 2: // If we don't know the object size return an error for io.SeekEnd if o.objectInfo.Size < 0 { @@ -579,7 +581,7 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { if o.objectInfo.Size+offset < 0 { return 0, errInvalidArgument(fmt.Sprintf("Seeking at negative offset not allowed for %d", whence)) } - o.currOffset = o.objectInfo.Size + offset + newOffset = o.objectInfo.Size + offset } // Reset the saved error since we successfully seeked, let the Read // and ReadAt decide. @@ -587,8 +589,9 @@ func (o *Object) Seek(offset int64, whence int) (n int64, err error) { o.prevErr = nil } - // Ask lower level to fetch again from source - o.seekData = true + // Ask lower level to fetch again from source when necessary + o.seekData = (newOffset != o.currOffset) || o.seekData + o.currOffset = newOffset // Return the effective offset. return o.currOffset, nil diff --git a/vendor/github.com/minio/minio-go/v7/api-get-options.go b/vendor/github.com/minio/minio-go/v7/api-get-options.go index bb86a599..a0216e20 100644 --- a/vendor/github.com/minio/minio-go/v7/api-get-options.go +++ b/vendor/github.com/minio/minio-go/v7/api-get-options.go @@ -87,10 +87,10 @@ func (o *GetObjectOptions) Set(key, value string) { } // SetReqParam - set request query string parameter -// supported key: see supportedQueryValues. +// supported key: see supportedQueryValues and allowedCustomQueryPrefix. // If an unsupported key is passed in, it will be ignored and nothing will be done. func (o *GetObjectOptions) SetReqParam(key, value string) { - if !isStandardQueryValue(key) { + if !isCustomQueryValue(key) && !isStandardQueryValue(key) { // do nothing return } @@ -101,10 +101,10 @@ func (o *GetObjectOptions) SetReqParam(key, value string) { } // AddReqParam - add request query string parameter -// supported key: see supportedQueryValues. +// supported key: see supportedQueryValues and allowedCustomQueryPrefix. // If an unsupported key is passed in, it will be ignored and nothing will be done. func (o *GetObjectOptions) AddReqParam(key, value string) { - if !isStandardQueryValue(key) { + if !isCustomQueryValue(key) && !isStandardQueryValue(key) { // do nothing return } diff --git a/vendor/github.com/minio/minio-go/v7/api-object-tagging.go b/vendor/github.com/minio/minio-go/v7/api-object-tagging.go index 305c36de..6623e262 100644 --- a/vendor/github.com/minio/minio-go/v7/api-object-tagging.go +++ b/vendor/github.com/minio/minio-go/v7/api-object-tagging.go @@ -32,6 +32,12 @@ import ( // to update tag(s) of a specific object version type PutObjectTaggingOptions struct { VersionID string + Internal AdvancedObjectTaggingOptions +} + +// AdvancedObjectTaggingOptions for internal use by MinIO server - not intended for client use. +type AdvancedObjectTaggingOptions struct { + ReplicationProxyRequest string } // PutObjectTagging replaces or creates object tag(s) and can target @@ -50,7 +56,10 @@ func (c *Client) PutObjectTagging(ctx context.Context, bucketName, objectName st if opts.VersionID != "" { urlValues.Set("versionId", opts.VersionID) } - + headers := make(http.Header, 0) + if opts.Internal.ReplicationProxyRequest != "" { + headers.Set(minIOBucketReplicationProxyRequest, opts.Internal.ReplicationProxyRequest) + } reqBytes, err := xml.Marshal(otags) if err != nil { return err @@ -63,6 +72,7 @@ func (c *Client) PutObjectTagging(ctx context.Context, bucketName, objectName st contentBody: bytes.NewReader(reqBytes), contentLength: int64(len(reqBytes)), contentMD5Base64: sumMD5Base64(reqBytes), + customHeader: headers, } // Execute PUT to set a object tagging. @@ -83,6 +93,7 @@ func (c *Client) PutObjectTagging(ctx context.Context, bucketName, objectName st // to fetch the tagging key/value pairs type GetObjectTaggingOptions struct { VersionID string + Internal AdvancedObjectTaggingOptions } // GetObjectTagging fetches object tag(s) with options to target @@ -96,12 +107,16 @@ func (c *Client) GetObjectTagging(ctx context.Context, bucketName, objectName st if opts.VersionID != "" { urlValues.Set("versionId", opts.VersionID) } - + headers := make(http.Header, 0) + if opts.Internal.ReplicationProxyRequest != "" { + headers.Set(minIOBucketReplicationProxyRequest, opts.Internal.ReplicationProxyRequest) + } // Execute GET on object to get object tag(s) resp, err := c.executeMethod(ctx, http.MethodGet, requestMetadata{ - bucketName: bucketName, - objectName: objectName, - queryValues: urlValues, + bucketName: bucketName, + objectName: objectName, + queryValues: urlValues, + customHeader: headers, }) defer closeResponse(resp) @@ -121,6 +136,7 @@ func (c *Client) GetObjectTagging(ctx context.Context, bucketName, objectName st // RemoveObjectTaggingOptions holds the version id of the object to remove type RemoveObjectTaggingOptions struct { VersionID string + Internal AdvancedObjectTaggingOptions } // RemoveObjectTagging removes object tag(s) with options to control a specific object @@ -134,12 +150,16 @@ func (c *Client) RemoveObjectTagging(ctx context.Context, bucketName, objectName if opts.VersionID != "" { urlValues.Set("versionId", opts.VersionID) } - + headers := make(http.Header, 0) + if opts.Internal.ReplicationProxyRequest != "" { + headers.Set(minIOBucketReplicationProxyRequest, opts.Internal.ReplicationProxyRequest) + } // Execute DELETE on object to remove object tag(s) resp, err := c.executeMethod(ctx, http.MethodDelete, requestMetadata{ - bucketName: bucketName, - objectName: objectName, - queryValues: urlValues, + bucketName: bucketName, + objectName: objectName, + queryValues: urlValues, + customHeader: headers, }) defer closeResponse(resp) diff --git a/vendor/github.com/minio/minio-go/v7/api-put-object.go b/vendor/github.com/minio/minio-go/v7/api-put-object.go index 2c4de4f9..bbd8924e 100644 --- a/vendor/github.com/minio/minio-go/v7/api-put-object.go +++ b/vendor/github.com/minio/minio-go/v7/api-put-object.go @@ -77,6 +77,7 @@ type PutObjectOptions struct { ContentDisposition string ContentLanguage string CacheControl string + Expires time.Time Mode RetentionMode RetainUntilDate time.Time ServerSideEncryption encrypt.ServerSide @@ -153,6 +154,10 @@ func (opts PutObjectOptions) Header() (header http.Header) { header.Set("Cache-Control", opts.CacheControl) } + if !opts.Expires.IsZero() { + header.Set("Expires", opts.Expires.UTC().Format(http.TimeFormat)) + } + if opts.Mode != "" { header.Set(amzLockMode, opts.Mode.String()) } diff --git a/vendor/github.com/minio/minio-go/v7/api-putobject-snowball.go b/vendor/github.com/minio/minio-go/v7/api-putobject-snowball.go index 983ed674..eb4da414 100644 --- a/vendor/github.com/minio/minio-go/v7/api-putobject-snowball.go +++ b/vendor/github.com/minio/minio-go/v7/api-putobject-snowball.go @@ -24,6 +24,7 @@ import ( "context" "fmt" "io" + "net/http" "os" "strings" "sync" @@ -70,6 +71,14 @@ type SnowballObject struct { // Exactly 'Size' number of bytes must be provided. Content io.Reader + // VersionID of the object; if empty, a new versionID will be generated + VersionID string + + // Headers contains more options for this object upload, the same as you + // would include in a regular PutObject operation, such as user metadata + // and content-disposition, expires, .. + Headers http.Header + // Close will be called when an object has finished processing. // Note that if PutObjectsSnowball returns because of an error, // objects not consumed from the input will NOT have been closed. @@ -181,6 +190,14 @@ objectLoop: header.ModTime = time.Now().UTC() } + header.PAXRecords = make(map[string]string) + if obj.VersionID != "" { + header.PAXRecords["minio.versionId"] = obj.VersionID + } + for k, vals := range obj.Headers { + header.PAXRecords["minio.metadata."+k] = strings.Join(vals, ",") + } + if err := t.WriteHeader(&header); err != nil { closeObj() return err diff --git a/vendor/github.com/minio/minio-go/v7/api.go b/vendor/github.com/minio/minio-go/v7/api.go index e8e324a9..f8a9b34c 100644 --- a/vendor/github.com/minio/minio-go/v7/api.go +++ b/vendor/github.com/minio/minio-go/v7/api.go @@ -127,7 +127,7 @@ type Options struct { // Global constants. const ( libraryName = "minio-go" - libraryVersion = "v7.0.63" + libraryVersion = "v7.0.66" ) // User Agent should always following the below style. diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go index 1c73d100..800c4a29 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/assume_role.go @@ -93,7 +93,8 @@ type STSAssumeRoleOptions struct { AccessKey string SecretKey string - Policy string // Optional to assign a policy to the assumed role + SessionToken string // Optional if the first request is made with temporary credentials. + Policy string // Optional to assign a policy to the assumed role Location string // Optional commonly needed with AWS STS. DurationSeconds int // Optional defaults to 1 hour. @@ -101,6 +102,7 @@ type STSAssumeRoleOptions struct { // Optional only valid if using with AWS STS RoleARN string RoleSessionName string + ExternalID string } // NewSTSAssumeRole returns a pointer to a new @@ -161,6 +163,9 @@ func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssume if opts.Policy != "" { v.Set("Policy", opts.Policy) } + if opts.ExternalID != "" { + v.Set("ExternalId", opts.ExternalID) + } u, err := url.Parse(endpoint) if err != nil { @@ -181,6 +186,9 @@ func getAssumeRoleCredentials(clnt *http.Client, endpoint string, opts STSAssume } req.Header.Set("Content-Type", "application/x-www-form-urlencoded") req.Header.Set("X-Amz-Content-Sha256", hex.EncodeToString(hash.Sum(nil))) + if opts.SessionToken != "" { + req.Header.Set("X-Amz-Security-Token", opts.SessionToken) + } req = signer.SignV4STS(*req, opts.AccessKey, opts.SecretKey, opts.Location) resp, err := clnt.Do(req) diff --git a/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go b/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go index 0c9536de..c5153c4c 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/credentials/iam_aws.go @@ -54,19 +54,36 @@ type IAM struct { // Custom endpoint to fetch IAM role credentials. Endpoint string + + // Region configurable custom region for STS + Region string + + // Support for container authorization token https://docs.aws.amazon.com/sdkref/latest/guide/feature-container-credentials.html + Container struct { + AuthorizationToken string + CredentialsFullURI string + CredentialsRelativeURI string + } + + // EKS based k8s RBAC authorization - https://docs.aws.amazon.com/eks/latest/userguide/pod-configuration.html + EKSIdentity struct { + TokenFile string + RoleARN string + RoleSessionName string + } } // IAM Roles for Amazon EC2 // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html const ( - defaultIAMRoleEndpoint = "http://169.254.169.254" - defaultECSRoleEndpoint = "http://169.254.170.2" - defaultSTSRoleEndpoint = "https://sts.amazonaws.com" - defaultIAMSecurityCredsPath = "/latest/meta-data/iam/security-credentials/" - tokenRequestTTLHeader = "X-aws-ec2-metadata-token-ttl-seconds" - tokenPath = "/latest/api/token" - tokenTTL = "21600" - tokenRequestHeader = "X-aws-ec2-metadata-token" + DefaultIAMRoleEndpoint = "http://169.254.169.254" + DefaultECSRoleEndpoint = "http://169.254.170.2" + DefaultSTSRoleEndpoint = "https://sts.amazonaws.com" + DefaultIAMSecurityCredsPath = "/latest/meta-data/iam/security-credentials/" + TokenRequestTTLHeader = "X-aws-ec2-metadata-token-ttl-seconds" + TokenPath = "/latest/api/token" + TokenTTL = "21600" + TokenRequestHeader = "X-aws-ec2-metadata-token" ) // NewIAM returns a pointer to a new Credentials object wrapping the IAM. @@ -84,21 +101,55 @@ func NewIAM(endpoint string) *Credentials { // the desired func (m *IAM) Retrieve() (Value, error) { token := os.Getenv("AWS_CONTAINER_AUTHORIZATION_TOKEN") + if token == "" { + token = m.Container.AuthorizationToken + } + + relativeURI := os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI") + if relativeURI == "" { + relativeURI = m.Container.CredentialsRelativeURI + } + + fullURI := os.Getenv("AWS_CONTAINER_CREDENTIALS_FULL_URI") + if fullURI == "" { + fullURI = m.Container.CredentialsFullURI + } + + identityFile := os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE") + if identityFile == "" { + identityFile = m.EKSIdentity.TokenFile + } + + roleArn := os.Getenv("AWS_ROLE_ARN") + if roleArn == "" { + roleArn = m.EKSIdentity.RoleARN + } + + roleSessionName := os.Getenv("AWS_ROLE_SESSION_NAME") + if roleSessionName == "" { + roleSessionName = m.EKSIdentity.RoleSessionName + } + + region := os.Getenv("AWS_REGION") + if region == "" { + region = m.Region + } + var roleCreds ec2RoleCredRespBody var err error endpoint := m.Endpoint switch { - case len(os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE")) > 0: + case identityFile != "": if len(endpoint) == 0 { - if len(os.Getenv("AWS_REGION")) > 0 { - if strings.HasPrefix(os.Getenv("AWS_REGION"), "cn-") { - endpoint = "https://sts." + os.Getenv("AWS_REGION") + ".amazonaws.com.cn" + if region != "" { + if strings.HasPrefix(region, "cn-") { + endpoint = "https://sts." + region + ".amazonaws.com.cn" } else { - endpoint = "https://sts." + os.Getenv("AWS_REGION") + ".amazonaws.com" + endpoint = "https://sts." + region + ".amazonaws.com" } } else { - endpoint = defaultSTSRoleEndpoint + endpoint = DefaultSTSRoleEndpoint } } @@ -106,15 +157,15 @@ func (m *IAM) Retrieve() (Value, error) { Client: m.Client, STSEndpoint: endpoint, GetWebIDTokenExpiry: func() (*WebIdentityToken, error) { - token, err := os.ReadFile(os.Getenv("AWS_WEB_IDENTITY_TOKEN_FILE")) + token, err := os.ReadFile(identityFile) if err != nil { return nil, err } return &WebIdentityToken{Token: string(token)}, nil }, - RoleARN: os.Getenv("AWS_ROLE_ARN"), - roleSessionName: os.Getenv("AWS_ROLE_SESSION_NAME"), + RoleARN: roleArn, + roleSessionName: roleSessionName, } stsWebIdentityCreds, err := creds.Retrieve() @@ -123,17 +174,16 @@ func (m *IAM) Retrieve() (Value, error) { } return stsWebIdentityCreds, err - case len(os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI")) > 0: + case relativeURI != "": if len(endpoint) == 0 { - endpoint = fmt.Sprintf("%s%s", defaultECSRoleEndpoint, - os.Getenv("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI")) + endpoint = fmt.Sprintf("%s%s", DefaultECSRoleEndpoint, relativeURI) } roleCreds, err = getEcsTaskCredentials(m.Client, endpoint, token) - case len(os.Getenv("AWS_CONTAINER_CREDENTIALS_FULL_URI")) > 0: + case fullURI != "": if len(endpoint) == 0 { - endpoint = os.Getenv("AWS_CONTAINER_CREDENTIALS_FULL_URI") + endpoint = fullURI var ok bool if ok, err = isLoopback(endpoint); !ok { if err == nil { @@ -189,7 +239,7 @@ func getIAMRoleURL(endpoint string) (*url.URL, error) { if err != nil { return nil, err } - u.Path = defaultIAMSecurityCredsPath + u.Path = DefaultIAMSecurityCredsPath return u, nil } @@ -203,7 +253,7 @@ func listRoleNames(client *http.Client, u *url.URL, token string) ([]string, err return nil, err } if token != "" { - req.Header.Add(tokenRequestHeader, token) + req.Header.Add(TokenRequestHeader, token) } resp, err := client.Do(req) if err != nil { @@ -258,11 +308,11 @@ func fetchIMDSToken(client *http.Client, endpoint string) (string, error) { ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel() - req, err := http.NewRequestWithContext(ctx, http.MethodPut, endpoint+tokenPath, nil) + req, err := http.NewRequestWithContext(ctx, http.MethodPut, endpoint+TokenPath, nil) if err != nil { return "", err } - req.Header.Add(tokenRequestTTLHeader, tokenTTL) + req.Header.Add(TokenRequestTTLHeader, TokenTTL) resp, err := client.Do(req) if err != nil { return "", err @@ -285,7 +335,7 @@ func fetchIMDSToken(client *http.Client, endpoint string) (string, error) { // reading the response an error will be returned. func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, error) { if endpoint == "" { - endpoint = defaultIAMRoleEndpoint + endpoint = DefaultIAMRoleEndpoint } // https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configuring-instance-metadata-service.html @@ -332,7 +382,7 @@ func getCredentials(client *http.Client, endpoint string) (ec2RoleCredRespBody, return ec2RoleCredRespBody{}, err } if token != "" { - req.Header.Add(tokenRequestHeader, token) + req.Header.Add(TokenRequestHeader, token) } resp, err := client.Do(req) diff --git a/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go b/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go index 830061b8..c52f78c3 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/lifecycle/lifecycle.go @@ -211,35 +211,43 @@ func (t Transition) MarshalXML(en *xml.Encoder, startElement xml.StartElement) e // And And Rule for LifecycleTag, to be used in LifecycleRuleFilter type And struct { - XMLName xml.Name `xml:"And" json:"-"` - Prefix string `xml:"Prefix" json:"Prefix,omitempty"` - Tags []Tag `xml:"Tag" json:"Tags,omitempty"` + XMLName xml.Name `xml:"And" json:"-"` + Prefix string `xml:"Prefix" json:"Prefix,omitempty"` + Tags []Tag `xml:"Tag" json:"Tags,omitempty"` + ObjectSizeLessThan int64 `xml:"ObjectSizeLessThan,omitempty" json:"ObjectSizeLessThan,omitempty"` + ObjectSizeGreaterThan int64 `xml:"ObjectSizeGreaterThan,omitempty" json:"ObjectSizeGreaterThan,omitempty"` } // IsEmpty returns true if Tags field is null func (a And) IsEmpty() bool { - return len(a.Tags) == 0 && a.Prefix == "" + return len(a.Tags) == 0 && a.Prefix == "" && + a.ObjectSizeLessThan == 0 && a.ObjectSizeGreaterThan == 0 } // Filter will be used in selecting rule(s) for lifecycle configuration type Filter struct { - XMLName xml.Name `xml:"Filter" json:"-"` - And And `xml:"And,omitempty" json:"And,omitempty"` - Prefix string `xml:"Prefix,omitempty" json:"Prefix,omitempty"` - Tag Tag `xml:"Tag,omitempty" json:"Tag,omitempty"` + XMLName xml.Name `xml:"Filter" json:"-"` + And And `xml:"And,omitempty" json:"And,omitempty"` + Prefix string `xml:"Prefix,omitempty" json:"Prefix,omitempty"` + Tag Tag `xml:"Tag,omitempty" json:"Tag,omitempty"` + ObjectSizeLessThan int64 `xml:"ObjectSizeLessThan,omitempty" json:"ObjectSizeLessThan,omitempty"` + ObjectSizeGreaterThan int64 `xml:"ObjectSizeGreaterThan,omitempty" json:"ObjectSizeGreaterThan,omitempty"` } // IsNull returns true if all Filter fields are empty. func (f Filter) IsNull() bool { - return f.Tag.IsEmpty() && f.And.IsEmpty() && f.Prefix == "" + return f.Tag.IsEmpty() && f.And.IsEmpty() && f.Prefix == "" && + f.ObjectSizeLessThan == 0 && f.ObjectSizeGreaterThan == 0 } // MarshalJSON customizes json encoding by removing empty values. func (f Filter) MarshalJSON() ([]byte, error) { type filter struct { - And *And `json:"And,omitempty"` - Prefix string `json:"Prefix,omitempty"` - Tag *Tag `json:"Tag,omitempty"` + And *And `json:"And,omitempty"` + Prefix string `json:"Prefix,omitempty"` + Tag *Tag `json:"Tag,omitempty"` + ObjectSizeLessThan int64 `json:"ObjectSizeLessThan,omitempty"` + ObjectSizeGreaterThan int64 `json:"ObjectSizeGreaterThan,omitempty"` } newf := filter{ @@ -251,6 +259,8 @@ func (f Filter) MarshalJSON() ([]byte, error) { if !f.And.IsEmpty() { newf.And = &f.And } + newf.ObjectSizeLessThan = f.ObjectSizeLessThan + newf.ObjectSizeGreaterThan = f.ObjectSizeGreaterThan return json.Marshal(newf) } @@ -271,7 +281,19 @@ func (f Filter) MarshalXML(e *xml.Encoder, start xml.StartElement) error { return err } default: - // Always print Prefix field when both And & Tag are empty + if f.ObjectSizeLessThan > 0 { + if err := e.EncodeElement(f.ObjectSizeLessThan, xml.StartElement{Name: xml.Name{Local: "ObjectSizeLessThan"}}); err != nil { + return err + } + break + } + if f.ObjectSizeGreaterThan > 0 { + if err := e.EncodeElement(f.ObjectSizeGreaterThan, xml.StartElement{Name: xml.Name{Local: "ObjectSizeGreaterThan"}}); err != nil { + return err + } + break + } + // Print empty Prefix field only when everything else is empty if err := e.EncodeElement(f.Prefix, xml.StartElement{Name: xml.Name{Local: "Prefix"}}); err != nil { return err } diff --git a/vendor/github.com/minio/minio-go/v7/pkg/notification/notification.go b/vendor/github.com/minio/minio-go/v7/pkg/notification/notification.go index 01cc26fc..a44799d2 100644 --- a/vendor/github.com/minio/minio-go/v7/pkg/notification/notification.go +++ b/vendor/github.com/minio/minio-go/v7/pkg/notification/notification.go @@ -37,9 +37,15 @@ const ( ObjectCreatedPut EventType = "s3:ObjectCreated:Put" ObjectCreatedPost EventType = "s3:ObjectCreated:Post" ObjectCreatedCopy EventType = "s3:ObjectCreated:Copy" + ObjectCreatedDeleteTagging EventType = "s3:ObjectCreated:DeleteTagging" ObjectCreatedCompleteMultipartUpload EventType = "s3:ObjectCreated:CompleteMultipartUpload" + ObjectCreatedPutLegalHold EventType = "s3:ObjectCreated:PutLegalHold" + ObjectCreatedPutRetention EventType = "s3:ObjectCreated:PutRetention" + ObjectCreatedPutTagging EventType = "s3:ObjectCreated:PutTagging" ObjectAccessedGet EventType = "s3:ObjectAccessed:Get" ObjectAccessedHead EventType = "s3:ObjectAccessed:Head" + ObjectAccessedGetRetention EventType = "s3:ObjectAccessed:GetRetention" + ObjectAccessedGetLegalHold EventType = "s3:ObjectAccessed:GetLegalHold" ObjectAccessedAll EventType = "s3:ObjectAccessed:*" ObjectRemovedAll EventType = "s3:ObjectRemoved:*" ObjectRemovedDelete EventType = "s3:ObjectRemoved:Delete" @@ -56,6 +62,9 @@ const ( ObjectReplicationOperationMissedThreshold EventType = "s3:Replication:OperationMissedThreshold" ObjectReplicationOperationNotTracked EventType = "s3:Replication:OperationNotTracked" ObjectReplicationOperationReplicatedAfterThreshold EventType = "s3:Replication:OperationReplicatedAfterThreshold" + ObjectScannerManyVersions EventType = "s3:Scanner:ManyVersions" + ObjectScannerBigPrefix EventType = "s3:Scanner:BigPrefix" + ObjectScannerAll EventType = "s3:Scanner:*" BucketCreatedAll EventType = "s3:BucketCreated:*" BucketRemovedAll EventType = "s3:BucketRemoved:*" ) diff --git a/vendor/github.com/minio/minio-go/v7/s3-endpoints.go b/vendor/github.com/minio/minio-go/v7/s3-endpoints.go index 0a26edd5..b1de7b62 100644 --- a/vendor/github.com/minio/minio-go/v7/s3-endpoints.go +++ b/vendor/github.com/minio/minio-go/v7/s3-endpoints.go @@ -50,6 +50,7 @@ var awsS3EndpointMap = map[string]string{ "cn-northwest-1": "s3.dualstack.cn-northwest-1.amazonaws.com.cn", "ap-southeast-3": "s3.dualstack.ap-southeast-3.amazonaws.com", "ap-southeast-4": "s3.dualstack.ap-southeast-4.amazonaws.com", + "il-central-1": "s3.dualstack.il-central-1.amazonaws.com", } // getS3Endpoint get Amazon S3 endpoint based on the bucket location. diff --git a/vendor/github.com/minio/minio-go/v7/utils.go b/vendor/github.com/minio/minio-go/v7/utils.go index 6a93561e..e39eba02 100644 --- a/vendor/github.com/minio/minio-go/v7/utils.go +++ b/vendor/github.com/minio/minio-go/v7/utils.go @@ -528,6 +528,14 @@ func isStandardQueryValue(qsKey string) bool { return supportedQueryValues[qsKey] } +// Per documentation at https://docs.aws.amazon.com/AmazonS3/latest/userguide/LogFormat.html#LogFormatCustom, the +// set of query params starting with "x-" are ignored by S3. +const allowedCustomQueryPrefix = "x-" + +func isCustomQueryValue(qsKey string) bool { + return strings.HasPrefix(qsKey, allowedCustomQueryPrefix) +} + var ( md5Pool = sync.Pool{New: func() interface{} { return md5.New() }} sha256Pool = sync.Pool{New: func() interface{} { return sha256.New() }} diff --git a/vendor/github.com/pierrec/lz4/v4/writer.go b/vendor/github.com/pierrec/lz4/v4/writer.go index 77699f2b..4358adee 100644 --- a/vendor/github.com/pierrec/lz4/v4/writer.go +++ b/vendor/github.com/pierrec/lz4/v4/writer.go @@ -150,6 +150,10 @@ func (w *Writer) Flush() (err error) { case writeState: case errorState: return w.state.err + case newState: + if err = w.init(); w.state.next(err) { + return + } default: return nil } diff --git a/vendor/github.com/sashabaranov/go-openai/assistant.go b/vendor/github.com/sashabaranov/go-openai/assistant.go index de49be68..bd335833 100644 --- a/vendor/github.com/sashabaranov/go-openai/assistant.go +++ b/vendor/github.com/sashabaranov/go-openai/assistant.go @@ -22,6 +22,8 @@ type Assistant struct { Model string `json:"model"` Instructions *string `json:"instructions,omitempty"` Tools []AssistantTool `json:"tools,omitempty"` + FileIDs []string `json:"file_ids,omitempty"` + Metadata map[string]any `json:"metadata,omitempty"` httpHeader } @@ -52,7 +54,9 @@ type AssistantRequest struct { // AssistantsList is a list of assistants. type AssistantsList struct { Assistants []Assistant `json:"data"` - + LastID *string `json:"last_id"` + FirstID *string `json:"first_id"` + HasMore bool `json:"has_more"` httpHeader } diff --git a/vendor/github.com/sashabaranov/go-openai/chat.go b/vendor/github.com/sashabaranov/go-openai/chat.go index ebdc0e24..5b87b6bd 100644 --- a/vendor/github.com/sashabaranov/go-openai/chat.go +++ b/vendor/github.com/sashabaranov/go-openai/chat.go @@ -2,6 +2,7 @@ package openai import ( "context" + "encoding/json" "errors" "net/http" ) @@ -20,6 +21,7 @@ const chatCompletionsSuffix = "/chat/completions" var ( ErrChatCompletionInvalidModel = errors.New("this model is not supported with this method, please use CreateCompletion client method instead") //nolint:lll ErrChatCompletionStreamNotSupported = errors.New("streaming is not supported with this method, please use CreateChatCompletionStream") //nolint:lll + ErrContentFieldsMisused = errors.New("can't use both Content and MultiContent properties simultaneously") ) type Hate struct { @@ -51,9 +53,36 @@ type PromptAnnotation struct { ContentFilterResults ContentFilterResults `json:"content_filter_results,omitempty"` } +type ImageURLDetail string + +const ( + ImageURLDetailHigh ImageURLDetail = "high" + ImageURLDetailLow ImageURLDetail = "low" + ImageURLDetailAuto ImageURLDetail = "auto" +) + +type ChatMessageImageURL struct { + URL string `json:"url,omitempty"` + Detail ImageURLDetail `json:"detail,omitempty"` +} + +type ChatMessagePartType string + +const ( + ChatMessagePartTypeText ChatMessagePartType = "text" + ChatMessagePartTypeImageURL ChatMessagePartType = "image_url" +) + +type ChatMessagePart struct { + Type ChatMessagePartType `json:"type,omitempty"` + Text string `json:"text,omitempty"` + ImageURL *ChatMessageImageURL `json:"image_url,omitempty"` +} + type ChatCompletionMessage struct { - Role string `json:"role"` - Content string `json:"content"` + Role string `json:"role"` + Content string `json:"content"` + MultiContent []ChatMessagePart // This property isn't in the official documentation, but it's in // the documentation for the official library for python: @@ -70,6 +99,64 @@ type ChatCompletionMessage struct { ToolCallID string `json:"tool_call_id,omitempty"` } +func (m ChatCompletionMessage) MarshalJSON() ([]byte, error) { + if m.Content != "" && m.MultiContent != nil { + return nil, ErrContentFieldsMisused + } + if len(m.MultiContent) > 0 { + msg := struct { + Role string `json:"role"` + Content string `json:"-"` + MultiContent []ChatMessagePart `json:"content,omitempty"` + Name string `json:"name,omitempty"` + FunctionCall *FunctionCall `json:"function_call,omitempty"` + ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCallID string `json:"tool_call_id,omitempty"` + }(m) + return json.Marshal(msg) + } + msg := struct { + Role string `json:"role"` + Content string `json:"content"` + MultiContent []ChatMessagePart `json:"-"` + Name string `json:"name,omitempty"` + FunctionCall *FunctionCall `json:"function_call,omitempty"` + ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCallID string `json:"tool_call_id,omitempty"` + }(m) + return json.Marshal(msg) +} + +func (m *ChatCompletionMessage) UnmarshalJSON(bs []byte) error { + msg := struct { + Role string `json:"role"` + Content string `json:"content"` + MultiContent []ChatMessagePart + Name string `json:"name,omitempty"` + FunctionCall *FunctionCall `json:"function_call,omitempty"` + ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCallID string `json:"tool_call_id,omitempty"` + }{} + if err := json.Unmarshal(bs, &msg); err == nil { + *m = ChatCompletionMessage(msg) + return nil + } + multiMsg := struct { + Role string `json:"role"` + Content string + MultiContent []ChatMessagePart `json:"content"` + Name string `json:"name,omitempty"` + FunctionCall *FunctionCall `json:"function_call,omitempty"` + ToolCalls []ToolCall `json:"tool_calls,omitempty"` + ToolCallID string `json:"tool_call_id,omitempty"` + }{} + if err := json.Unmarshal(bs, &multiMsg); err != nil { + return err + } + *m = ChatCompletionMessage(multiMsg) + return nil +} + type ToolCall struct { // Index is not nil only in chat completion chunk object Index *int `json:"index,omitempty"` diff --git a/vendor/github.com/sashabaranov/go-openai/files.go b/vendor/github.com/sashabaranov/go-openai/files.go index 9e521fbb..a37d45f1 100644 --- a/vendor/github.com/sashabaranov/go-openai/files.go +++ b/vendor/github.com/sashabaranov/go-openai/files.go @@ -15,6 +15,26 @@ type FileRequest struct { Purpose string `json:"purpose"` } +// PurposeType represents the purpose of the file when uploading. +type PurposeType string + +const ( + PurposeFineTune PurposeType = "fine-tune" + PurposeFineTuneResults PurposeType = "fine-tune-results" + PurposeAssistants PurposeType = "assistants" + PurposeAssistantsOutput PurposeType = "assistants_output" +) + +// FileBytesRequest represents a file upload request. +type FileBytesRequest struct { + // the name of the uploaded file in OpenAI + Name string + // the bytes of the file + Bytes []byte + // the purpose of the file + Purpose PurposeType +} + // File struct represents an OpenAPI file. type File struct { Bytes int `json:"bytes"` @@ -36,6 +56,37 @@ type FilesList struct { httpHeader } +// CreateFileBytes uploads bytes directly to OpenAI without requiring a local file. +func (c *Client) CreateFileBytes(ctx context.Context, request FileBytesRequest) (file File, err error) { + var b bytes.Buffer + reader := bytes.NewReader(request.Bytes) + builder := c.createFormBuilder(&b) + + err = builder.WriteField("purpose", string(request.Purpose)) + if err != nil { + return + } + + err = builder.CreateFormFileReader("file", reader, request.Name) + if err != nil { + return + } + + err = builder.Close() + if err != nil { + return + } + + req, err := c.newRequest(ctx, http.MethodPost, c.fullURL("/files"), + withBody(&b), withContentType(builder.FormDataContentType())) + if err != nil { + return + } + + err = c.sendRequest(req, &file) + return +} + // CreateFile uploads a jsonl file to GPT3 // FilePath must be a local file path. func (c *Client) CreateFile(ctx context.Context, request FileRequest) (file File, err error) { diff --git a/vendor/github.com/sashabaranov/go-openai/messages.go b/vendor/github.com/sashabaranov/go-openai/messages.go index 4e691a8b..ead247f5 100644 --- a/vendor/github.com/sashabaranov/go-openai/messages.go +++ b/vendor/github.com/sashabaranov/go-openai/messages.go @@ -29,6 +29,11 @@ type Message struct { type MessagesList struct { Messages []Message `json:"data"` + Object string `json:"object"` + FirstID *string `json:"first_id"` + LastID *string `json:"last_id"` + HasMore bool `json:"has_more"` + httpHeader } @@ -71,7 +76,7 @@ type MessageFilesList struct { // CreateMessage creates a new message. func (c *Client) CreateMessage(ctx context.Context, threadID string, request MessageRequest) (msg Message, err error) { urlSuffix := fmt.Sprintf("/threads/%s/%s", threadID, messagesSuffix) - req, err := c.newRequest(ctx, http.MethodPost, c.fullURL(urlSuffix), withBody(request)) + req, err := c.newRequest(ctx, http.MethodPost, c.fullURL(urlSuffix), withBody(request), withBetaAssistantV1()) if err != nil { return } diff --git a/vendor/github.com/sashabaranov/go-openai/run.go b/vendor/github.com/sashabaranov/go-openai/run.go index 7ff730fe..dbb708a1 100644 --- a/vendor/github.com/sashabaranov/go-openai/run.go +++ b/vendor/github.com/sashabaranov/go-openai/run.go @@ -142,21 +142,21 @@ const ( type StepDetails struct { Type RunStepType `json:"type"` MessageCreation *StepDetailsMessageCreation `json:"message_creation,omitempty"` - ToolCalls *StepDetailsToolCalls `json:"tool_calls,omitempty"` + ToolCalls []ToolCall `json:"tool_calls,omitempty"` } type StepDetailsMessageCreation struct { MessageID string `json:"message_id"` } -type StepDetailsToolCalls struct { - ToolCalls []ToolCall `json:"tool_calls"` -} - // RunStepList is a list of steps. type RunStepList struct { RunSteps []RunStep `json:"data"` + FirstID string `json:"first_id"` + LastID string `json:"last_id"` + HasMore bool `json:"has_more"` + httpHeader } diff --git a/vendor/github.com/sashabaranov/go-openai/speech.go b/vendor/github.com/sashabaranov/go-openai/speech.go index a3d5f5dc..f2442b92 100644 --- a/vendor/github.com/sashabaranov/go-openai/speech.go +++ b/vendor/github.com/sashabaranov/go-openai/speech.go @@ -10,8 +10,9 @@ import ( type SpeechModel string const ( - TTSModel1 SpeechModel = "tts-1" - TTsModel1HD SpeechModel = "tts-1-hd" + TTSModel1 SpeechModel = "tts-1" + TTSModel1HD SpeechModel = "tts-1-hd" + TTSModelCanary SpeechModel = "canary-tts" ) type SpeechVoice string @@ -57,7 +58,7 @@ func contains[T comparable](s []T, e T) bool { } func isValidSpeechModel(model SpeechModel) bool { - return contains([]SpeechModel{TTSModel1, TTsModel1HD}, model) + return contains([]SpeechModel{TTSModel1, TTSModel1HD, TTSModelCanary}, model) } func isValidVoice(voice SpeechVoice) bool { diff --git a/vendor/github.com/segmentio/kafka-go/README.md b/vendor/github.com/segmentio/kafka-go/README.md index 304c1603..e1787882 100644 --- a/vendor/github.com/segmentio/kafka-go/README.md +++ b/vendor/github.com/segmentio/kafka-go/README.md @@ -401,7 +401,7 @@ for i := 0; i < retries; i++ { // attempt to create topic prior to publishing the message err = w.WriteMessages(ctx, messages...) - if errors.Is(err, LeaderNotAvailable) || errors.Is(err, context.DeadlineExceeded) { + if errors.Is(err, kafka.LeaderNotAvailable) || errors.Is(err, context.DeadlineExceeded) { time.Sleep(time.Millisecond * 250) continue } diff --git a/vendor/github.com/segmentio/kafka-go/alterpartitionreassignments.go b/vendor/github.com/segmentio/kafka-go/alterpartitionreassignments.go index ec76dbd8..dd67d003 100644 --- a/vendor/github.com/segmentio/kafka-go/alterpartitionreassignments.go +++ b/vendor/github.com/segmentio/kafka-go/alterpartitionreassignments.go @@ -13,7 +13,8 @@ type AlterPartitionReassignmentsRequest struct { // Address of the kafka broker to send the request to. Addr net.Addr - // Topic is the name of the topic to alter partitions in. + // Topic is the name of the topic to alter partitions in. Keep this field empty and use Topic in AlterPartitionReassignmentsRequestAssignment to + // reassign to multiple topics. Topic string // Assignments is the list of partition reassignments to submit to the API. @@ -26,10 +27,13 @@ type AlterPartitionReassignmentsRequest struct { // AlterPartitionReassignmentsRequestAssignment contains the requested reassignments for a single // partition. type AlterPartitionReassignmentsRequestAssignment struct { + // Topic is the name of the topic to alter partitions in. If empty, the value of Topic in AlterPartitionReassignmentsRequest is used. + Topic string + // PartitionID is the ID of the partition to make the reassignments in. PartitionID int - // BrokerIDs is a slice of brokers to set the partition replicas to. + // BrokerIDs is a slice of brokers to set the partition replicas to, or null to cancel a pending reassignment for this partition. BrokerIDs []int } @@ -46,6 +50,9 @@ type AlterPartitionReassignmentsResponse struct { // AlterPartitionReassignmentsResponsePartitionResult contains the detailed result of // doing reassignments for a single partition. type AlterPartitionReassignmentsResponsePartitionResult struct { + // Topic is the topic name. + Topic string + // PartitionID is the ID of the partition that was altered. PartitionID int @@ -58,16 +65,29 @@ func (c *Client) AlterPartitionReassignments( ctx context.Context, req *AlterPartitionReassignmentsRequest, ) (*AlterPartitionReassignmentsResponse, error) { - apiPartitions := []alterpartitionreassignments.RequestPartition{} + apiTopicMap := make(map[string]*alterpartitionreassignments.RequestTopic) for _, assignment := range req.Assignments { + topic := assignment.Topic + if topic == "" { + topic = req.Topic + } + + apiTopic := apiTopicMap[topic] + if apiTopic == nil { + apiTopic = &alterpartitionreassignments.RequestTopic{ + Name: topic, + } + apiTopicMap[topic] = apiTopic + } + replicas := []int32{} for _, brokerID := range assignment.BrokerIDs { replicas = append(replicas, int32(brokerID)) } - apiPartitions = append( - apiPartitions, + apiTopic.Partitions = append( + apiTopic.Partitions, alterpartitionreassignments.RequestPartition{ PartitionIndex: int32(assignment.PartitionID), Replicas: replicas, @@ -77,12 +97,10 @@ func (c *Client) AlterPartitionReassignments( apiReq := &alterpartitionreassignments.Request{ TimeoutMs: int32(req.Timeout.Milliseconds()), - Topics: []alterpartitionreassignments.RequestTopic{ - { - Name: req.Topic, - Partitions: apiPartitions, - }, - }, + } + + for _, apiTopic := range apiTopicMap { + apiReq.Topics = append(apiReq.Topics, *apiTopic) } protoResp, err := c.roundTrip( @@ -104,6 +122,7 @@ func (c *Client) AlterPartitionReassignments( resp.PartitionResults = append( resp.PartitionResults, AlterPartitionReassignmentsResponsePartitionResult{ + Topic: topicResult.Name, PartitionID: int(partitionResult.PartitionIndex), Error: makeError(partitionResult.ErrorCode, partitionResult.ErrorMessage), }, diff --git a/vendor/github.com/segmentio/kafka-go/balancer.go b/vendor/github.com/segmentio/kafka-go/balancer.go index f4768cf8..ee3a2588 100644 --- a/vendor/github.com/segmentio/kafka-go/balancer.go +++ b/vendor/github.com/segmentio/kafka-go/balancer.go @@ -7,7 +7,6 @@ import ( "math/rand" "sort" "sync" - "sync/atomic" ) // The Balancer interface provides an abstraction of the message distribution @@ -36,11 +35,16 @@ func (f BalancerFunc) Balance(msg Message, partitions ...int) int { } // RoundRobin is an Balancer implementation that equally distributes messages -// across all available partitions. +// across all available partitions. It can take an optional chunk size to send +// ChunkSize messages to the same partition before moving to the next partition. +// This can be used to improve batch sizes. type RoundRobin struct { + ChunkSize int // Use a 32 bits integer so RoundRobin values don't need to be aligned to - // apply atomic increments. - offset uint32 + // apply increments. + counter uint32 + + mutex sync.Mutex } // Balance satisfies the Balancer interface. @@ -49,8 +53,17 @@ func (rr *RoundRobin) Balance(msg Message, partitions ...int) int { } func (rr *RoundRobin) balance(partitions []int) int { - length := uint32(len(partitions)) - offset := atomic.AddUint32(&rr.offset, 1) - 1 + rr.mutex.Lock() + defer rr.mutex.Unlock() + + if rr.ChunkSize < 1 { + rr.ChunkSize = 1 + } + + length := len(partitions) + counterNow := rr.counter + offset := int(counterNow / uint32(rr.ChunkSize)) + rr.counter++ return partitions[offset%length] } @@ -122,7 +135,7 @@ var ( // // The logic to calculate the partition is: // -// hasher.Sum32() % len(partitions) => partition +// hasher.Sum32() % len(partitions) => partition // // By default, Hash uses the FNV-1a algorithm. This is the same algorithm used // by the Sarama Producer and ensures that messages produced by kafka-go will @@ -173,7 +186,7 @@ func (h *Hash) Balance(msg Message, partitions ...int) int { // // The logic to calculate the partition is: // -// (int32(hasher.Sum32()) & 0x7fffffff) % len(partitions) => partition +// (int32(hasher.Sum32()) & 0x7fffffff) % len(partitions) => partition // // By default, ReferenceHash uses the FNV-1a algorithm. This is the same algorithm as // the Sarama NewReferenceHashPartitioner and ensures that messages produced by kafka-go will diff --git a/vendor/github.com/segmentio/kafka-go/createacls.go b/vendor/github.com/segmentio/kafka-go/createacls.go index 672f6fdc..60197417 100644 --- a/vendor/github.com/segmentio/kafka-go/createacls.go +++ b/vendor/github.com/segmentio/kafka-go/createacls.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "net" + "strings" "time" "github.com/segmentio/kafka-go/protocol/createacls" @@ -42,6 +43,43 @@ const ( ACLPermissionTypeAllow ACLPermissionType = 3 ) +func (apt ACLPermissionType) String() string { + mapping := map[ACLPermissionType]string{ + ACLPermissionTypeUnknown: "Unknown", + ACLPermissionTypeAny: "Any", + ACLPermissionTypeDeny: "Deny", + ACLPermissionTypeAllow: "Allow", + } + s, ok := mapping[apt] + if !ok { + s = mapping[ACLPermissionTypeUnknown] + } + return s +} + +// MarshalText transforms an ACLPermissionType into its string representation. +func (apt ACLPermissionType) MarshalText() ([]byte, error) { + return []byte(apt.String()), nil +} + +// UnmarshalText takes a string representation of the resource type and converts it to an ACLPermissionType. +func (apt *ACLPermissionType) UnmarshalText(text []byte) error { + normalized := strings.ToLower(string(text)) + mapping := map[string]ACLPermissionType{ + "unknown": ACLPermissionTypeUnknown, + "any": ACLPermissionTypeAny, + "deny": ACLPermissionTypeDeny, + "allow": ACLPermissionTypeAllow, + } + parsed, ok := mapping[normalized] + if !ok { + *apt = ACLPermissionTypeUnknown + return fmt.Errorf("cannot parse %s as an ACLPermissionType", normalized) + } + *apt = parsed + return nil +} + type ACLOperationType int8 const ( @@ -60,6 +98,62 @@ const ( ACLOperationTypeIdempotentWrite ACLOperationType = 12 ) +func (aot ACLOperationType) String() string { + mapping := map[ACLOperationType]string{ + ACLOperationTypeUnknown: "Unknown", + ACLOperationTypeAny: "Any", + ACLOperationTypeAll: "All", + ACLOperationTypeRead: "Read", + ACLOperationTypeWrite: "Write", + ACLOperationTypeCreate: "Create", + ACLOperationTypeDelete: "Delete", + ACLOperationTypeAlter: "Alter", + ACLOperationTypeDescribe: "Describe", + ACLOperationTypeClusterAction: "ClusterAction", + ACLOperationTypeDescribeConfigs: "DescribeConfigs", + ACLOperationTypeAlterConfigs: "AlterConfigs", + ACLOperationTypeIdempotentWrite: "IdempotentWrite", + } + s, ok := mapping[aot] + if !ok { + s = mapping[ACLOperationTypeUnknown] + } + return s +} + +// MarshalText transforms an ACLOperationType into its string representation. +func (aot ACLOperationType) MarshalText() ([]byte, error) { + return []byte(aot.String()), nil +} + +// UnmarshalText takes a string representation of the resource type and converts it to an ACLPermissionType. +func (aot *ACLOperationType) UnmarshalText(text []byte) error { + normalized := strings.ToLower(string(text)) + mapping := map[string]ACLOperationType{ + "unknown": ACLOperationTypeUnknown, + "any": ACLOperationTypeAny, + "all": ACLOperationTypeAll, + "read": ACLOperationTypeRead, + "write": ACLOperationTypeWrite, + "create": ACLOperationTypeCreate, + "delete": ACLOperationTypeDelete, + "alter": ACLOperationTypeAlter, + "describe": ACLOperationTypeDescribe, + "clusteraction": ACLOperationTypeClusterAction, + "describeconfigs": ACLOperationTypeDescribeConfigs, + "alterconfigs": ACLOperationTypeAlterConfigs, + "idempotentwrite": ACLOperationTypeIdempotentWrite, + } + parsed, ok := mapping[normalized] + if !ok { + *aot = ACLOperationTypeUnknown + return fmt.Errorf("cannot parse %s as an ACLOperationType", normalized) + } + *aot = parsed + return nil + +} + type ACLEntry struct { ResourceType ResourceType ResourceName string diff --git a/vendor/github.com/segmentio/kafka-go/listpartitionreassignments.go b/vendor/github.com/segmentio/kafka-go/listpartitionreassignments.go new file mode 100644 index 00000000..aa01fff3 --- /dev/null +++ b/vendor/github.com/segmentio/kafka-go/listpartitionreassignments.go @@ -0,0 +1,135 @@ +package kafka + +import ( + "context" + "net" + "time" + + "github.com/segmentio/kafka-go/protocol/listpartitionreassignments" +) + +// ListPartitionReassignmentsRequest is a request to the ListPartitionReassignments API. +type ListPartitionReassignmentsRequest struct { + // Address of the kafka broker to send the request to. + Addr net.Addr + + // Topics we want reassignments for, mapped by their name, or nil to list everything. + Topics map[string]ListPartitionReassignmentsRequestTopic + + // Timeout is the amount of time to wait for the request to complete. + Timeout time.Duration +} + +// ListPartitionReassignmentsRequestTopic contains the requested partitions for a single +// topic. +type ListPartitionReassignmentsRequestTopic struct { + // The partitions to list partition reassignments for. + PartitionIndexes []int +} + +// ListPartitionReassignmentsResponse is a response from the ListPartitionReassignments API. +type ListPartitionReassignmentsResponse struct { + // Error is set to a non-nil value including the code and message if a top-level + // error was encountered. + Error error + + // Topics contains results for each topic, mapped by their name. + Topics map[string]ListPartitionReassignmentsResponseTopic +} + +// ListPartitionReassignmentsResponseTopic contains the detailed result of +// ongoing reassignments for a topic. +type ListPartitionReassignmentsResponseTopic struct { + // Partitions contains result for topic partitions. + Partitions []ListPartitionReassignmentsResponsePartition +} + +// ListPartitionReassignmentsResponsePartition contains the detailed result of +// ongoing reassignments for a single partition. +type ListPartitionReassignmentsResponsePartition struct { + // PartitionIndex contains index of the partition. + PartitionIndex int + + // Replicas contains the current replica set. + Replicas []int + + // AddingReplicas contains the set of replicas we are currently adding. + AddingReplicas []int + + // RemovingReplicas contains the set of replicas we are currently removing. + RemovingReplicas []int +} + +func (c *Client) ListPartitionReassignments( + ctx context.Context, + req *ListPartitionReassignmentsRequest, +) (*ListPartitionReassignmentsResponse, error) { + apiReq := &listpartitionreassignments.Request{ + TimeoutMs: int32(req.Timeout.Milliseconds()), + } + + for topicName, topicReq := range req.Topics { + apiReq.Topics = append( + apiReq.Topics, + listpartitionreassignments.RequestTopic{ + Name: topicName, + PartitionIndexes: intToInt32Array(topicReq.PartitionIndexes), + }, + ) + } + + protoResp, err := c.roundTrip( + ctx, + req.Addr, + apiReq, + ) + if err != nil { + return nil, err + } + apiResp := protoResp.(*listpartitionreassignments.Response) + + resp := &ListPartitionReassignmentsResponse{ + Error: makeError(apiResp.ErrorCode, apiResp.ErrorMessage), + Topics: make(map[string]ListPartitionReassignmentsResponseTopic), + } + + for _, topicResult := range apiResp.Topics { + respTopic := ListPartitionReassignmentsResponseTopic{} + for _, partitionResult := range topicResult.Partitions { + respTopic.Partitions = append( + respTopic.Partitions, + ListPartitionReassignmentsResponsePartition{ + PartitionIndex: int(partitionResult.PartitionIndex), + Replicas: int32ToIntArray(partitionResult.Replicas), + AddingReplicas: int32ToIntArray(partitionResult.AddingReplicas), + RemovingReplicas: int32ToIntArray(partitionResult.RemovingReplicas), + }, + ) + } + resp.Topics[topicResult.Name] = respTopic + } + + return resp, nil +} + +func intToInt32Array(arr []int) []int32 { + if arr == nil { + return nil + } + res := make([]int32, len(arr)) + for i := range arr { + res[i] = int32(arr[i]) + } + return res +} + +func int32ToIntArray(arr []int32) []int { + if arr == nil { + return nil + } + res := make([]int, len(arr)) + for i := range arr { + res[i] = int(arr[i]) + } + return res +} diff --git a/vendor/github.com/segmentio/kafka-go/protocol/alterpartitionreassignments/alterpartitionreassignments.go b/vendor/github.com/segmentio/kafka-go/protocol/alterpartitionreassignments/alterpartitionreassignments.go index 4894a2e6..7f8d2ed2 100644 --- a/vendor/github.com/segmentio/kafka-go/protocol/alterpartitionreassignments/alterpartitionreassignments.go +++ b/vendor/github.com/segmentio/kafka-go/protocol/alterpartitionreassignments/alterpartitionreassignments.go @@ -23,7 +23,7 @@ type RequestTopic struct { type RequestPartition struct { PartitionIndex int32 `kafka:"min=v0,max=v0"` - Replicas []int32 `kafka:"min=v0,max=v0"` + Replicas []int32 `kafka:"min=v0,max=v0,nullable"` } func (r *Request) ApiKey() protocol.ApiKey { diff --git a/vendor/github.com/segmentio/kafka-go/protocol/listpartitionreassignments/listpartitionreassignments.go b/vendor/github.com/segmentio/kafka-go/protocol/listpartitionreassignments/listpartitionreassignments.go new file mode 100644 index 00000000..d26a6410 --- /dev/null +++ b/vendor/github.com/segmentio/kafka-go/protocol/listpartitionreassignments/listpartitionreassignments.go @@ -0,0 +1,70 @@ +package listpartitionreassignments + +import "github.com/segmentio/kafka-go/protocol" + +func init() { + protocol.Register(&Request{}, &Response{}) +} + +// Detailed API definition: https://kafka.apache.org/protocol#The_Messages_ListPartitionReassignments. + +type Request struct { + // We need at least one tagged field to indicate that this is a "flexible" message + // type. + _ struct{} `kafka:"min=v0,max=v0,tag"` + + TimeoutMs int32 `kafka:"min=v0,max=v0"` + Topics []RequestTopic `kafka:"min=v0,max=v0,nullable"` +} + +type RequestTopic struct { + // We need at least one tagged field to indicate that this is a "flexible" message + // type. + _ struct{} `kafka:"min=v0,max=v0,tag"` + + Name string `kafka:"min=v0,max=v0"` + PartitionIndexes []int32 `kafka:"min=v0,max=v0"` +} + +func (r *Request) ApiKey() protocol.ApiKey { + return protocol.ListPartitionReassignments +} + +func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) { + return cluster.Brokers[cluster.Controller], nil +} + +type Response struct { + // We need at least one tagged field to indicate that this is a "flexible" message + // type. + _ struct{} `kafka:"min=v0,max=v0,tag"` + + ThrottleTimeMs int32 `kafka:"min=v0,max=v0"` + ErrorCode int16 `kafka:"min=v0,max=v0"` + ErrorMessage string `kafka:"min=v0,max=v0,nullable"` + Topics []ResponseTopic `kafka:"min=v0,max=v0"` +} + +type ResponseTopic struct { + // We need at least one tagged field to indicate that this is a "flexible" message + // type. + _ struct{} `kafka:"min=v0,max=v0,tag"` + + Name string `kafka:"min=v0,max=v0"` + Partitions []ResponsePartition `kafka:"min=v0,max=v0"` +} + +type ResponsePartition struct { + // We need at least one tagged field to indicate that this is a "flexible" message + // type. + _ struct{} `kafka:"min=v0,max=v0,tag"` + + PartitionIndex int32 `kafka:"min=v0,max=v0"` + Replicas []int32 `kafka:"min=v0,max=v0"` + AddingReplicas []int32 `kafka:"min=v0,max=v0"` + RemovingReplicas []int32 `kafka:"min=v0,max=v0"` +} + +func (r *Response) ApiKey() protocol.ApiKey { + return protocol.ListPartitionReassignments +} diff --git a/vendor/github.com/segmentio/kafka-go/protocol/protocol.go b/vendor/github.com/segmentio/kafka-go/protocol/protocol.go index ebf91a79..3d0a7b8d 100644 --- a/vendor/github.com/segmentio/kafka-go/protocol/protocol.go +++ b/vendor/github.com/segmentio/kafka-go/protocol/protocol.go @@ -213,6 +213,37 @@ func Register(req, res Message) { } } +// OverrideTypeMessage is an interface implemented by messages that want to override the standard +// request/response types for a given API. +type OverrideTypeMessage interface { + TypeKey() OverrideTypeKey +} + +type OverrideTypeKey int16 + +const ( + RawProduceOverride OverrideTypeKey = 0 +) + +var overrideApiTypes [numApis]map[OverrideTypeKey]apiType + +func RegisterOverride(req, res Message, key OverrideTypeKey) { + k1 := req.ApiKey() + k2 := res.ApiKey() + + if k1 != k2 { + panic(fmt.Sprintf("[%T/%T]: request and response API keys mismatch: %d != %d", req, res, k1, k2)) + } + + if overrideApiTypes[k1] == nil { + overrideApiTypes[k1] = make(map[OverrideTypeKey]apiType) + } + overrideApiTypes[k1][key] = apiType{ + requests: typesOf(req), + responses: typesOf(res), + } +} + func typesOf(v interface{}) []messageType { return makeTypes(reflect.TypeOf(v).Elem()) } diff --git a/vendor/github.com/segmentio/kafka-go/protocol/rawproduce/rawproduce.go b/vendor/github.com/segmentio/kafka-go/protocol/rawproduce/rawproduce.go new file mode 100644 index 00000000..bad83138 --- /dev/null +++ b/vendor/github.com/segmentio/kafka-go/protocol/rawproduce/rawproduce.go @@ -0,0 +1,91 @@ +package rawproduce + +import ( + "fmt" + + "github.com/segmentio/kafka-go/protocol" + "github.com/segmentio/kafka-go/protocol/produce" +) + +func init() { + // Register a type override so that raw produce requests will be encoded with the correct type. + req := &Request{} + protocol.RegisterOverride(req, &produce.Response{}, req.TypeKey()) +} + +type Request struct { + TransactionalID string `kafka:"min=v3,max=v8,nullable"` + Acks int16 `kafka:"min=v0,max=v8"` + Timeout int32 `kafka:"min=v0,max=v8"` + Topics []RequestTopic `kafka:"min=v0,max=v8"` +} + +func (r *Request) ApiKey() protocol.ApiKey { return protocol.Produce } + +func (r *Request) TypeKey() protocol.OverrideTypeKey { return protocol.RawProduceOverride } + +func (r *Request) Broker(cluster protocol.Cluster) (protocol.Broker, error) { + broker := protocol.Broker{ID: -1} + + for i := range r.Topics { + t := &r.Topics[i] + + topic, ok := cluster.Topics[t.Topic] + if !ok { + return broker, NewError(protocol.NewErrNoTopic(t.Topic)) + } + + for j := range t.Partitions { + p := &t.Partitions[j] + + partition, ok := topic.Partitions[p.Partition] + if !ok { + return broker, NewError(protocol.NewErrNoPartition(t.Topic, p.Partition)) + } + + if b, ok := cluster.Brokers[partition.Leader]; !ok { + return broker, NewError(protocol.NewErrNoLeader(t.Topic, p.Partition)) + } else if broker.ID < 0 { + broker = b + } else if b.ID != broker.ID { + return broker, NewError(fmt.Errorf("mismatching leaders (%d!=%d)", b.ID, broker.ID)) + } + } + } + + return broker, nil +} + +func (r *Request) HasResponse() bool { + return r.Acks != 0 +} + +type RequestTopic struct { + Topic string `kafka:"min=v0,max=v8"` + Partitions []RequestPartition `kafka:"min=v0,max=v8"` +} + +type RequestPartition struct { + Partition int32 `kafka:"min=v0,max=v8"` + RecordSet protocol.RawRecordSet `kafka:"min=v0,max=v8"` +} + +var ( + _ protocol.BrokerMessage = (*Request)(nil) +) + +type Error struct { + Err error +} + +func NewError(err error) *Error { + return &Error{Err: err} +} + +func (e *Error) Error() string { + return fmt.Sprintf("fetch request error: %v", e.Err) +} + +func (e *Error) Unwrap() error { + return e.Err +} diff --git a/vendor/github.com/segmentio/kafka-go/protocol/record.go b/vendor/github.com/segmentio/kafka-go/protocol/record.go index 84594868..e11af4dc 100644 --- a/vendor/github.com/segmentio/kafka-go/protocol/record.go +++ b/vendor/github.com/segmentio/kafka-go/protocol/record.go @@ -292,6 +292,46 @@ func (rs *RecordSet) WriteTo(w io.Writer) (int64, error) { return n, nil } +// RawRecordSet represents a record set for a RawProduce request. The record set is +// represented as a raw sequence of pre-encoded record set bytes. +type RawRecordSet struct { + // Reader exposes the raw sequence of record set bytes. + Reader io.Reader +} + +// ReadFrom reads the representation of a record set from r into rrs. It re-uses the +// existing RecordSet.ReadFrom implementation to first read/decode data into a RecordSet, +// then writes/encodes the RecordSet to a buffer referenced by the RawRecordSet. +// +// Note: re-using the RecordSet.ReadFrom implementation makes this suboptimal from a +// performance standpoint as it require an extra copy of the record bytes. Holding off +// on optimizing, as this code path is only invoked in tests. +func (rrs *RawRecordSet) ReadFrom(r io.Reader) (int64, error) { + rs := &RecordSet{} + n, err := rs.ReadFrom(r) + if err != nil { + return 0, err + } + + buf := &bytes.Buffer{} + rs.WriteTo(buf) + *rrs = RawRecordSet{ + Reader: buf, + } + + return n, nil +} + +// WriteTo writes the RawRecordSet to an io.Writer. Since this is a raw record set representation, all that is +// done here is copying bytes from the underlying reader to the specified writer. +func (rrs *RawRecordSet) WriteTo(w io.Writer) (int64, error) { + if rrs.Reader == nil { + return 0, ErrNoRecord + } + + return io.Copy(w, rrs.Reader) +} + func makeTime(t int64) time.Time { return time.Unix(t/1000, (t%1000)*int64(time.Millisecond)) } diff --git a/vendor/github.com/segmentio/kafka-go/protocol/request.go b/vendor/github.com/segmentio/kafka-go/protocol/request.go index 8b99e053..135b938b 100644 --- a/vendor/github.com/segmentio/kafka-go/protocol/request.go +++ b/vendor/github.com/segmentio/kafka-go/protocol/request.go @@ -81,6 +81,12 @@ func WriteRequest(w io.Writer, apiVersion int16, correlationID int32, clientID s return fmt.Errorf("unsupported api: %s", apiNames[apiKey]) } + if typedMessage, ok := msg.(OverrideTypeMessage); ok { + typeKey := typedMessage.TypeKey() + overrideType := overrideApiTypes[apiKey][typeKey] + t = &overrideType + } + minVersion := t.minVersion() maxVersion := t.maxVersion() diff --git a/vendor/github.com/segmentio/kafka-go/protocol/response.go b/vendor/github.com/segmentio/kafka-go/protocol/response.go index 61948031..a43bd023 100644 --- a/vendor/github.com/segmentio/kafka-go/protocol/response.go +++ b/vendor/github.com/segmentio/kafka-go/protocol/response.go @@ -95,6 +95,12 @@ func WriteResponse(w io.Writer, apiVersion int16, correlationID int32, msg Messa return fmt.Errorf("unsupported api: %s", apiNames[apiKey]) } + if typedMessage, ok := msg.(OverrideTypeMessage); ok { + typeKey := typedMessage.TypeKey() + overrideType := overrideApiTypes[apiKey][typeKey] + t = &overrideType + } + minVersion := t.minVersion() maxVersion := t.maxVersion() diff --git a/vendor/github.com/segmentio/kafka-go/rawproduce.go b/vendor/github.com/segmentio/kafka-go/rawproduce.go new file mode 100644 index 00000000..5928cb2f --- /dev/null +++ b/vendor/github.com/segmentio/kafka-go/rawproduce.go @@ -0,0 +1,103 @@ +package kafka + +import ( + "context" + "errors" + "fmt" + "net" + + "github.com/segmentio/kafka-go/protocol" + produceAPI "github.com/segmentio/kafka-go/protocol/produce" + "github.com/segmentio/kafka-go/protocol/rawproduce" +) + +// RawProduceRequest represents a request sent to a kafka broker to produce records +// to a topic partition. The request contains a pre-encoded/raw record set. +type RawProduceRequest struct { + // Address of the kafka broker to send the request to. + Addr net.Addr + + // The topic to produce the records to. + Topic string + + // The partition to produce the records to. + Partition int + + // The level of required acknowledgements to ask the kafka broker for. + RequiredAcks RequiredAcks + + // The message format version used when encoding the records. + // + // By default, the client automatically determine which version should be + // used based on the version of the Produce API supported by the server. + MessageVersion int + + // An optional transaction id when producing to the kafka broker is part of + // a transaction. + TransactionalID string + + // The sequence of records to produce to the topic partition. + RawRecords protocol.RawRecordSet +} + +// RawProduce sends a raw produce request to a kafka broker and returns the response. +// +// If the request contained no records, an error wrapping protocol.ErrNoRecord +// is returned. +// +// When the request is configured with RequiredAcks=none, both the response and +// the error will be nil on success. +func (c *Client) RawProduce(ctx context.Context, req *RawProduceRequest) (*ProduceResponse, error) { + m, err := c.roundTrip(ctx, req.Addr, &rawproduce.Request{ + TransactionalID: req.TransactionalID, + Acks: int16(req.RequiredAcks), + Timeout: c.timeoutMs(ctx, defaultProduceTimeout), + Topics: []rawproduce.RequestTopic{{ + Topic: req.Topic, + Partitions: []rawproduce.RequestPartition{{ + Partition: int32(req.Partition), + RecordSet: req.RawRecords, + }}, + }}, + }) + + switch { + case err == nil: + case errors.Is(err, protocol.ErrNoRecord): + return new(ProduceResponse), nil + default: + return nil, fmt.Errorf("kafka.(*Client).RawProduce: %w", err) + } + + if req.RequiredAcks == RequireNone { + return nil, nil + } + + res := m.(*produceAPI.Response) + if len(res.Topics) == 0 { + return nil, fmt.Errorf("kafka.(*Client).RawProduce: %w", protocol.ErrNoTopic) + } + topic := &res.Topics[0] + if len(topic.Partitions) == 0 { + return nil, fmt.Errorf("kafka.(*Client).RawProduce: %w", protocol.ErrNoPartition) + } + partition := &topic.Partitions[0] + + ret := &ProduceResponse{ + Throttle: makeDuration(res.ThrottleTimeMs), + Error: makeError(partition.ErrorCode, partition.ErrorMessage), + BaseOffset: partition.BaseOffset, + LogAppendTime: makeTime(partition.LogAppendTime), + LogStartOffset: partition.LogStartOffset, + } + + if len(partition.RecordErrors) != 0 { + ret.RecordErrors = make(map[int]error, len(partition.RecordErrors)) + + for _, recErr := range partition.RecordErrors { + ret.RecordErrors[int(recErr.BatchIndex)] = errors.New(recErr.BatchIndexErrorMessage) + } + } + + return ret, nil +} diff --git a/vendor/github.com/segmentio/kafka-go/resource.go b/vendor/github.com/segmentio/kafka-go/resource.go index f5c2e73a..b9be107c 100644 --- a/vendor/github.com/segmentio/kafka-go/resource.go +++ b/vendor/github.com/segmentio/kafka-go/resource.go @@ -1,5 +1,10 @@ package kafka +import ( + "fmt" + "strings" +) + // https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/resource/ResourceType.java type ResourceType int8 @@ -15,6 +20,50 @@ const ( ResourceTypeDelegationToken ResourceType = 6 ) +func (rt ResourceType) String() string { + mapping := map[ResourceType]string{ + ResourceTypeUnknown: "Unknown", + ResourceTypeAny: "Any", + ResourceTypeTopic: "Topic", + ResourceTypeGroup: "Group", + // Note that ResourceTypeBroker and ResourceTypeCluster have the same value. + // A map cannot have duplicate values so we just use the same value for both. + ResourceTypeCluster: "Cluster", + ResourceTypeTransactionalID: "Transactionalid", + ResourceTypeDelegationToken: "Delegationtoken", + } + s, ok := mapping[rt] + if !ok { + s = mapping[ResourceTypeUnknown] + } + return s +} + +func (rt ResourceType) MarshalText() ([]byte, error) { + return []byte(rt.String()), nil +} + +func (rt *ResourceType) UnmarshalText(text []byte) error { + normalized := strings.ToLower(string(text)) + mapping := map[string]ResourceType{ + "unknown": ResourceTypeUnknown, + "any": ResourceTypeAny, + "topic": ResourceTypeTopic, + "group": ResourceTypeGroup, + "broker": ResourceTypeBroker, + "cluster": ResourceTypeCluster, + "transactionalid": ResourceTypeTransactionalID, + "delegationtoken": ResourceTypeDelegationToken, + } + parsed, ok := mapping[normalized] + if !ok { + *rt = ResourceTypeUnknown + return fmt.Errorf("cannot parse %s as a ResourceType", normalized) + } + *rt = parsed + return nil +} + // https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/resource/PatternType.java type PatternType int8 @@ -35,3 +84,40 @@ const ( // that start with 'foo'. PatternTypePrefixed PatternType = 4 ) + +func (pt PatternType) String() string { + mapping := map[PatternType]string{ + PatternTypeUnknown: "Unknown", + PatternTypeAny: "Any", + PatternTypeMatch: "Match", + PatternTypeLiteral: "Literal", + PatternTypePrefixed: "Prefixed", + } + s, ok := mapping[pt] + if !ok { + s = mapping[PatternTypeUnknown] + } + return s +} + +func (pt PatternType) MarshalText() ([]byte, error) { + return []byte(pt.String()), nil +} + +func (pt *PatternType) UnmarshalText(text []byte) error { + normalized := strings.ToLower(string(text)) + mapping := map[string]PatternType{ + "unknown": PatternTypeUnknown, + "any": PatternTypeAny, + "match": PatternTypeMatch, + "literal": PatternTypeLiteral, + "prefixed": PatternTypePrefixed, + } + parsed, ok := mapping[normalized] + if !ok { + *pt = PatternTypeUnknown + return fmt.Errorf("cannot parse %s as a PatternType", normalized) + } + *pt = parsed + return nil +} diff --git a/vendor/github.com/valyala/fasthttp/.golangci.yml b/vendor/github.com/valyala/fasthttp/.golangci.yml new file mode 100644 index 00000000..ad75ddf9 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/.golangci.yml @@ -0,0 +1,70 @@ +# This file contains configuration options for golangci-lint. +# https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml + +run: + # Timeout for analysis. + timeout: 5m + +linters: + enable-all: true + disable: + - cyclop + - depguard + - dupl + - errname + - errorlint + - exhaustive + - exhaustruct + - forcetypeassert + - funlen + - gochecknoglobals + - gocognit + - goconst + - gocyclo + - godot + - goerr113 + - gomnd + - gosec + - inamedparam + - ireturn + - lll + - maintidx + - nakedret + - nestif + - nlreturn + - noctx + - nonamedreturns + - paralleltest + - perfsprint + - revive + - stylecheck + - testableexamples + - testpackage + - thelper + - tparallel + - unparam + - usestdlibvars + - varnamelen + - wastedassign + - whitespace + - wrapcheck + - wsl + + # Deprecated linters + - deadcode + - exhaustivestruct + - golint + - ifshort + - interfacer + - maligned + - nosnakecase + - scopelint + - structcheck + - varcheck + +linters-settings: + # Show all issues from a linter. + max-issues-per-linter: 0 + + # Show all issues with the same text. + max-same-issues: 0 diff --git a/vendor/github.com/valyala/fasthttp/b2s_new.go b/vendor/github.com/valyala/fasthttp/b2s_new.go index 2f7d6f7e..a45222c1 100644 --- a/vendor/github.com/valyala/fasthttp/b2s_new.go +++ b/vendor/github.com/valyala/fasthttp/b2s_new.go @@ -1,5 +1,4 @@ //go:build go1.20 -// +build go1.20 package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/b2s_old.go b/vendor/github.com/valyala/fasthttp/b2s_old.go index 6b9f799a..f6e9466a 100644 --- a/vendor/github.com/valyala/fasthttp/b2s_old.go +++ b/vendor/github.com/valyala/fasthttp/b2s_old.go @@ -1,5 +1,4 @@ //go:build !go1.20 -// +build !go1.20 package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/brotli.go b/vendor/github.com/valyala/fasthttp/brotli.go index c829c39f..032bd953 100644 --- a/vendor/github.com/valyala/fasthttp/brotli.go +++ b/vendor/github.com/valyala/fasthttp/brotli.go @@ -132,7 +132,17 @@ func WriteBrotliLevel(w io.Writer, p []byte, level int) (int, error) { } } -var stacklessWriteBrotli = stackless.NewFunc(nonblockingWriteBrotli) +var ( + stacklessWriteBrotliOnce sync.Once + stacklessWriteBrotliFunc func(ctx interface{}) bool +) + +func stacklessWriteBrotli(ctx interface{}) { + stacklessWriteBrotliOnce.Do(func() { + stacklessWriteBrotliFunc = stackless.NewFunc(nonblockingWriteBrotli) + }) + stacklessWriteBrotliFunc(ctx) +} func nonblockingWriteBrotli(ctxv interface{}) { ctx := ctxv.(*compressCtx) diff --git a/vendor/github.com/valyala/fasthttp/bytesconv_32.go b/vendor/github.com/valyala/fasthttp/bytesconv_32.go index b5748833..baa94595 100644 --- a/vendor/github.com/valyala/fasthttp/bytesconv_32.go +++ b/vendor/github.com/valyala/fasthttp/bytesconv_32.go @@ -1,5 +1,4 @@ //go:build !amd64 && !arm64 && !ppc64 && !ppc64le && !s390x -// +build !amd64,!arm64,!ppc64,!ppc64le,!s390x package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/bytesconv_64.go b/vendor/github.com/valyala/fasthttp/bytesconv_64.go index 94d0ec68..e7c01bba 100644 --- a/vendor/github.com/valyala/fasthttp/bytesconv_64.go +++ b/vendor/github.com/valyala/fasthttp/bytesconv_64.go @@ -1,5 +1,4 @@ //go:build amd64 || arm64 || ppc64 || ppc64le || s390x -// +build amd64 arm64 ppc64 ppc64le s390x package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/client.go b/vendor/github.com/valyala/fasthttp/client.go index d1c8549a..498de057 100644 --- a/vendor/github.com/valyala/fasthttp/client.go +++ b/vendor/github.com/valyala/fasthttp/client.go @@ -1064,16 +1064,17 @@ func doRequestFollowRedirects(req *Request, resp *Response, url string, maxRedir err = ErrMissingLocation break } - url = getRedirectURL(url, location) + url = getRedirectURL(url, location, req.DisableRedirectPathNormalizing) } return statusCode, body, err } -func getRedirectURL(baseURL string, location []byte) string { +func getRedirectURL(baseURL string, location []byte, disablePathNormalizing bool) string { u := AcquireURI() u.Update(baseURL) u.UpdateBytes(location) + u.DisablePathNormalizing = disablePathNormalizing redirectURL := u.String() ReleaseURI(u) return redirectURL @@ -1473,6 +1474,7 @@ func (c *HostClient) acquireConn(reqTimeout time.Duration, connectionClose bool) return nil, ErrNoFreeConns } + //nolint:dupword // reqTimeout c.MaxConnWaitTimeout wait duration // d1 d2 min(d1, d2) // 0(not set) d2 d2 @@ -1840,6 +1842,9 @@ func (c *HostClient) dialHostHard(dialTimeout time.Duration) (conn net.Conn, err dial := c.Dial if dialTimeout != 0 && dial == nil { dial = func(addr string) (net.Conn, error) { + if c.DialDualStack { + return DialDualStackTimeout(addr, dialTimeout) + } return DialTimeout(addr, dialTimeout) } } @@ -2538,8 +2543,8 @@ func (c *PipelineClient) newConnClient() *pipelineConnClient { } // ErrPipelineOverflow may be returned from PipelineClient.Do* -// if the requests' queue is overflown. -var ErrPipelineOverflow = errors.New("pipelined requests' queue has been overflown. Increase MaxConns and/or MaxPendingRequests") +// if the requests' queue is overflowed. +var ErrPipelineOverflow = errors.New("pipelined requests' queue has been overflowed. Increase MaxConns and/or MaxPendingRequests") // DefaultMaxPendingRequests is the default value // for PipelineClient.MaxPendingRequests. diff --git a/vendor/github.com/valyala/fasthttp/coarseTime.go b/vendor/github.com/valyala/fasthttp/coarsetime.go similarity index 100% rename from vendor/github.com/valyala/fasthttp/coarseTime.go rename to vendor/github.com/valyala/fasthttp/coarsetime.go diff --git a/vendor/github.com/valyala/fasthttp/compress.go b/vendor/github.com/valyala/fasthttp/compress.go index 50d381b8..1f44f1e6 100644 --- a/vendor/github.com/valyala/fasthttp/compress.go +++ b/vendor/github.com/valyala/fasthttp/compress.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" "io" - "os" + "io/fs" "sync" "github.com/klauspost/compress/flate" @@ -177,7 +177,17 @@ func WriteGzipLevel(w io.Writer, p []byte, level int) (int, error) { } } -var stacklessWriteGzip = stackless.NewFunc(nonblockingWriteGzip) +var ( + stacklessWriteGzipOnce sync.Once + stacklessWriteGzipFunc func(ctx interface{}) bool +) + +func stacklessWriteGzip(ctx interface{}) { + stacklessWriteGzipOnce.Do(func() { + stacklessWriteGzipFunc = stackless.NewFunc(nonblockingWriteGzip) + }) + stacklessWriteGzipFunc(ctx) +} func nonblockingWriteGzip(ctxv interface{}) { ctx := ctxv.(*compressCtx) @@ -270,7 +280,17 @@ func WriteDeflateLevel(w io.Writer, p []byte, level int) (int, error) { } } -var stacklessWriteDeflate = stackless.NewFunc(nonblockingWriteDeflate) +var ( + stacklessWriteDeflateOnce sync.Once + stacklessWriteDeflateFunc func(ctx interface{}) bool +) + +func stacklessWriteDeflate(ctx interface{}) { + stacklessWriteDeflateOnce.Do(func() { + stacklessWriteDeflateFunc = stackless.NewFunc(nonblockingWriteDeflate) + }) + stacklessWriteDeflateFunc(ctx) +} func nonblockingWriteDeflate(ctxv interface{}) { ctx := ctxv.(*compressCtx) @@ -421,7 +441,7 @@ func newCompressWriterPoolMap() []*sync.Pool { return m } -func isFileCompressible(f *os.File, minCompressRatio float64) bool { +func isFileCompressible(f fs.File, minCompressRatio float64) bool { // Try compressing the first 4kb of the file // and see if it can be compressed by more than // the given minCompressRatio. @@ -433,7 +453,11 @@ func isFileCompressible(f *os.File, minCompressRatio float64) bool { } _, err := copyZeroAlloc(zw, lr) releaseStacklessGzipWriter(zw, CompressDefaultCompression) - f.Seek(0, 0) //nolint:errcheck + seeker, ok := f.(io.Seeker) + if !ok { + return false + } + seeker.Seek(0, io.SeekStart) //nolint:errcheck if err != nil { return false } diff --git a/vendor/github.com/valyala/fasthttp/examples/README.md b/vendor/github.com/valyala/fasthttp/examples/README.md new file mode 100644 index 00000000..b0535a75 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/README.md @@ -0,0 +1,4 @@ +# Code examples + +* [HelloWorld server](helloworldserver) +* [Static file server](fileserver) diff --git a/vendor/github.com/valyala/fasthttp/examples/client/Makefile b/vendor/github.com/valyala/fasthttp/examples/client/Makefile new file mode 100644 index 00000000..d2844fb6 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/client/Makefile @@ -0,0 +1,6 @@ +client: clean + go get -u github.com/valyala/fasthttp + go build + +clean: + rm -f client diff --git a/vendor/github.com/valyala/fasthttp/examples/client/README.md b/vendor/github.com/valyala/fasthttp/examples/client/README.md new file mode 100644 index 00000000..cef2d353 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/client/README.md @@ -0,0 +1,21 @@ +# Client Example + +The Client is useful when working with multiple hostnames. + +See the simplest `sendGetRequest()` for GET and more advanced `sendPostRequest()` for a POST request. + +The `sendPostRequest()` also shows: +* Per-request timeout with `DoTimeout()` +* Send a body as bytes slice with `SetBodyRaw()`. This is useful if you generated a request body. Otherwise, prefer `SetBody()` which copies it. +* Parse JSON from response +* Gracefully show error messages i.e. timeouts as warnings and other errors as a failures with detailed error messages. + +## How to build and run +Start a web server on localhost:8080 then execute: + + make + ./client + +## Client vs HostClient +Internally the Client creates a dedicated HostClient for each domain/IP address and cleans unused after period of time. +So if you have a single heavily loaded API endpoint it's better to use HostClient. See an example in the [examples/host_client](../host_client/) diff --git a/vendor/github.com/valyala/fasthttp/examples/client/client.go b/vendor/github.com/valyala/fasthttp/examples/client/client.go new file mode 100644 index 00000000..617fd125 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/client/client.go @@ -0,0 +1,132 @@ +package main + +import ( + "encoding/json" + "errors" + "fmt" + "io" + "net/http" + "os" + "reflect" + "time" + + "github.com/valyala/fasthttp" +) + +var headerContentTypeJson = []byte("application/json") + +var client *fasthttp.Client + +type Entity struct { + Id int + Name string +} + +func main() { + // You may read the timeouts from some config + readTimeout, _ := time.ParseDuration("500ms") + writeTimeout, _ := time.ParseDuration("500ms") + maxIdleConnDuration, _ := time.ParseDuration("1h") + client = &fasthttp.Client{ + ReadTimeout: readTimeout, + WriteTimeout: writeTimeout, + MaxIdleConnDuration: maxIdleConnDuration, + NoDefaultUserAgentHeader: true, // Don't send: User-Agent: fasthttp + DisableHeaderNamesNormalizing: true, // If you set the case on your headers correctly you can enable this + DisablePathNormalizing: true, + // increase DNS cache time to an hour instead of default minute + Dial: (&fasthttp.TCPDialer{ + Concurrency: 4096, + DNSCacheDuration: time.Hour, + }).Dial, + } + sendGetRequest() + sendPostRequest() +} + +func sendGetRequest() { + req := fasthttp.AcquireRequest() + req.SetRequestURI("http://localhost:8080/") + req.Header.SetMethod(fasthttp.MethodGet) + resp := fasthttp.AcquireResponse() + err := client.Do(req, resp) + fasthttp.ReleaseRequest(req) + if err == nil { + fmt.Printf("DEBUG Response: %s\n", resp.Body()) + } else { + fmt.Fprintf(os.Stderr, "ERR Connection error: %v\n", err) + } + fasthttp.ReleaseResponse(resp) +} + +func sendPostRequest() { + // per-request timeout + reqTimeout := time.Duration(100) * time.Millisecond + + reqEntity := &Entity{ + Name: "New entity", + } + reqEntityBytes, _ := json.Marshal(reqEntity) + + req := fasthttp.AcquireRequest() + req.SetRequestURI("http://localhost:8080/") + req.Header.SetMethod(fasthttp.MethodPost) + req.Header.SetContentTypeBytes(headerContentTypeJson) + req.SetBodyRaw(reqEntityBytes) + + resp := fasthttp.AcquireResponse() + err := client.DoTimeout(req, resp, reqTimeout) + fasthttp.ReleaseRequest(req) + defer fasthttp.ReleaseResponse(resp) + + if err != nil { + errName, known := httpConnError(err) + if known { + fmt.Fprintf(os.Stderr, "WARN conn error: %v\n", errName) + } else { + fmt.Fprintf(os.Stderr, "ERR conn failure: %v %v\n", errName, err) + } + + return + } + + statusCode := resp.StatusCode() + respBody := resp.Body() + fmt.Printf("DEBUG Response: %s\n", respBody) + + if statusCode != http.StatusOK { + fmt.Fprintf(os.Stderr, "ERR invalid HTTP response code: %d\n", statusCode) + + return + } + + respEntity := &Entity{} + err = json.Unmarshal(respBody, respEntity) + if err == nil || errors.Is(err, io.EOF) { + fmt.Printf("DEBUG Parsed Response: %v\n", respEntity) + } else { + fmt.Fprintf(os.Stderr, "ERR failed to parse response: %v\n", err) + } +} + +func httpConnError(err error) (string, bool) { + var ( + errName string + known = true + ) + + switch { + case errors.Is(err, fasthttp.ErrTimeout): + errName = "timeout" + case errors.Is(err, fasthttp.ErrNoFreeConns): + errName = "conn_limit" + case errors.Is(err, fasthttp.ErrConnectionClosed): + errName = "conn_close" + case reflect.TypeOf(err).String() == "*net.OpError": + errName = "timeout" + default: + known = false + } + + return errName, known +} diff --git a/vendor/github.com/valyala/fasthttp/examples/fileserver/Makefile b/vendor/github.com/valyala/fasthttp/examples/fileserver/Makefile new file mode 100644 index 00000000..0c000b3c --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/fileserver/Makefile @@ -0,0 +1,7 @@ +fileserver: clean + go get -u github.com/valyala/fasthttp + go get -u github.com/valyala/fasthttp/expvarhandler + go build + +clean: + rm -f fileserver diff --git a/vendor/github.com/valyala/fasthttp/examples/fileserver/README.md b/vendor/github.com/valyala/fasthttp/examples/fileserver/README.md new file mode 100644 index 00000000..e23f831f --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/fileserver/README.md @@ -0,0 +1,84 @@ +# Static file server example + +* Serves files from the given directory. +* Supports transparent response compression. +* Supports byte range responses. +* Generates directory index pages. +* Supports TLS (aka SSL or HTTPS). +* Supports virtual hosts. +* Exports various stats on /stats path. + +# How to build + +``` +make +``` + +# How to run + +``` +./fileserver -h +./fileserver -addr=tcp.addr.to.listen:to -dir=/path/to/directory/to/serve +``` + +# fileserver vs nginx performance comparison + +Serving default nginx path (`/usr/share/nginx/html` on ubuntu). + +* nginx + +``` +$ ./wrk -t 4 -c 16 -d 10 http://localhost:80 +Running 10s test @ http://localhost:80 + 4 threads and 16 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 397.76us 1.08ms 20.23ms 95.19% + Req/Sec 21.20k 2.49k 31.34k 79.65% + 850220 requests in 10.10s, 695.65MB read +Requests/sec: 84182.71 +Transfer/sec: 68.88MB +``` + +* fileserver + +``` +$ ./wrk -t 4 -c 16 -d 10 http://localhost:8080 +Running 10s test @ http://localhost:8080 + 4 threads and 16 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 447.99us 1.59ms 27.20ms 94.79% + Req/Sec 37.13k 3.99k 47.86k 76.00% + 1478457 requests in 10.02s, 1.03GB read +Requests/sec: 147597.06 +Transfer/sec: 105.15MB +``` + +8 pipelined requests + +* nginx + +``` +$ ./wrk -s pipeline.lua -t 4 -c 16 -d 10 http://localhost:80 -- 8 +Running 10s test @ http://localhost:80 + 4 threads and 16 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 1.34ms 2.15ms 30.91ms 92.16% + Req/Sec 33.54k 7.36k 108.12k 76.81% + 1339908 requests in 10.10s, 1.07GB read +Requests/sec: 132705.81 +Transfer/sec: 108.58MB +``` + +* fileserver + +``` +$ ./wrk -s pipeline.lua -t 4 -c 16 -d 10 http://localhost:8080 -- 8 +Running 10s test @ http://localhost:8080 + 4 threads and 16 connections + Thread Stats Avg Stdev Max +/- Stdev + Latency 2.08ms 6.33ms 88.26ms 92.83% + Req/Sec 116.54k 14.66k 167.98k 69.00% + 4642226 requests in 10.03s, 3.23GB read +Requests/sec: 462769.41 +Transfer/sec: 329.67MB +``` diff --git a/vendor/github.com/valyala/fasthttp/examples/fileserver/fileserver.go b/vendor/github.com/valyala/fasthttp/examples/fileserver/fileserver.go new file mode 100644 index 00000000..2a915bea --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/fileserver/fileserver.go @@ -0,0 +1,120 @@ +// Example static file server. +// +// Serves static files from the given directory. +// Exports various stats at /stats . +package main + +import ( + "expvar" + "flag" + "log" + + "github.com/valyala/fasthttp" + "github.com/valyala/fasthttp/expvarhandler" +) + +var ( + addr = flag.String("addr", "localhost:8080", "TCP address to listen to") + addrTLS = flag.String("addrTLS", "", "TCP address to listen to TLS (aka SSL or HTTPS) requests. Leave empty for disabling TLS") + byteRange = flag.Bool("byteRange", false, "Enables byte range requests if set to true") + certFile = flag.String("certFile", "./ssl-cert.pem", "Path to TLS certificate file") + compress = flag.Bool("compress", false, "Enables transparent response compression if set to true") + dir = flag.String("dir", "/usr/share/nginx/html", "Directory to serve static files from") + generateIndexPages = flag.Bool("generateIndexPages", true, "Whether to generate directory index pages") + keyFile = flag.String("keyFile", "./ssl-cert.key", "Path to TLS key file") + vhost = flag.Bool("vhost", false, "Enables virtual hosting by prepending the requested path with the requested hostname") +) + +func main() { + // Parse command-line flags. + flag.Parse() + + // Setup FS handler + fs := &fasthttp.FS{ + Root: *dir, + IndexNames: []string{"index.html"}, + GenerateIndexPages: *generateIndexPages, + Compress: *compress, + AcceptByteRange: *byteRange, + } + if *vhost { + fs.PathRewrite = fasthttp.NewVHostPathRewriter(0) + } + fsHandler := fs.NewRequestHandler() + + // Create RequestHandler serving server stats on /stats and files + // on other requested paths. + // /stats output may be filtered using regexps. For example: + // + // * /stats?r=fs will show only stats (expvars) containing 'fs' + // in their names. + requestHandler := func(ctx *fasthttp.RequestCtx) { + switch string(ctx.Path()) { + case "/stats": + expvarhandler.ExpvarHandler(ctx) + default: + fsHandler(ctx) + updateFSCounters(ctx) + } + } + + // Start HTTP server. + if len(*addr) > 0 { + log.Printf("Starting HTTP server on %q", *addr) + go func() { + if err := fasthttp.ListenAndServe(*addr, requestHandler); err != nil { + log.Fatalf("error in ListenAndServe: %v", err) + } + }() + } + + // Start HTTPS server. + if len(*addrTLS) > 0 { + log.Printf("Starting HTTPS server on %q", *addrTLS) + go func() { + if err := fasthttp.ListenAndServeTLS(*addrTLS, *certFile, *keyFile, requestHandler); err != nil { + log.Fatalf("error in ListenAndServeTLS: %v", err) + } + }() + } + + log.Printf("Serving files from directory %q", *dir) + log.Printf("See stats at http://%s/stats", *addr) + + // Wait forever. + select {} +} + +func updateFSCounters(ctx *fasthttp.RequestCtx) { + // Increment the number of fsHandler calls. + fsCalls.Add(1) + + // Update other stats counters + resp := &ctx.Response + switch resp.StatusCode() { + case fasthttp.StatusOK: + fsOKResponses.Add(1) + fsResponseBodyBytes.Add(int64(resp.Header.ContentLength())) + case fasthttp.StatusNotModified: + fsNotModifiedResponses.Add(1) + case fasthttp.StatusNotFound: + fsNotFoundResponses.Add(1) + default: + fsOtherResponses.Add(1) + } +} + +// Various counters - see https://pkg.go.dev/expvar for details. +var ( + // Counter for total number of fs calls + fsCalls = expvar.NewInt("fsCalls") + + // Counters for various response status codes + fsOKResponses = expvar.NewInt("fsOKResponses") + fsNotModifiedResponses = expvar.NewInt("fsNotModifiedResponses") + fsNotFoundResponses = expvar.NewInt("fsNotFoundResponses") + fsOtherResponses = expvar.NewInt("fsOtherResponses") + + // Total size in bytes for OK response bodies served. + fsResponseBodyBytes = expvar.NewInt("fsResponseBodyBytes") +) diff --git a/vendor/github.com/valyala/fasthttp/fasthttputil/rsa.key b/vendor/github.com/valyala/fasthttp/examples/fileserver/ssl-cert-snakeoil.key similarity index 100% rename from vendor/github.com/valyala/fasthttp/fasthttputil/rsa.key rename to vendor/github.com/valyala/fasthttp/examples/fileserver/ssl-cert-snakeoil.key diff --git a/vendor/github.com/valyala/fasthttp/fasthttputil/rsa.pem b/vendor/github.com/valyala/fasthttp/examples/fileserver/ssl-cert-snakeoil.pem similarity index 100% rename from vendor/github.com/valyala/fasthttp/fasthttputil/rsa.pem rename to vendor/github.com/valyala/fasthttp/examples/fileserver/ssl-cert-snakeoil.pem diff --git a/vendor/github.com/valyala/fasthttp/examples/helloworldserver/Makefile b/vendor/github.com/valyala/fasthttp/examples/helloworldserver/Makefile new file mode 100644 index 00000000..ce30ae9f --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/helloworldserver/Makefile @@ -0,0 +1,6 @@ +helloworldserver: clean + go get -u github.com/valyala/fasthttp + go build + +clean: + rm -f helloworldserver diff --git a/vendor/github.com/valyala/fasthttp/examples/helloworldserver/README.md b/vendor/github.com/valyala/fasthttp/examples/helloworldserver/README.md new file mode 100644 index 00000000..80e801ec --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/helloworldserver/README.md @@ -0,0 +1,17 @@ +# HelloWorld server example + +* Displays various request info. +* Sets response headers and cookies. +* Supports transparent compression. + +# How to build + +``` +make +``` + +# How to run + +``` +./helloworldserver -addr=tcp.addr.to.listen:to +``` diff --git a/vendor/github.com/valyala/fasthttp/examples/helloworldserver/helloworldserver.go b/vendor/github.com/valyala/fasthttp/examples/helloworldserver/helloworldserver.go new file mode 100644 index 00000000..a22e0b78 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/helloworldserver/helloworldserver.go @@ -0,0 +1,55 @@ +package main + +import ( + "flag" + "fmt" + "log" + + "github.com/valyala/fasthttp" +) + +var ( + addr = flag.String("addr", ":8080", "TCP address to listen to") + compress = flag.Bool("compress", false, "Whether to enable transparent response compression") +) + +func main() { + flag.Parse() + + h := requestHandler + if *compress { + h = fasthttp.CompressHandler(h) + } + + if err := fasthttp.ListenAndServe(*addr, h); err != nil { + log.Fatalf("Error in ListenAndServe: %v", err) + } +} + +func requestHandler(ctx *fasthttp.RequestCtx) { + fmt.Fprintf(ctx, "Hello, world!\n\n") + + fmt.Fprintf(ctx, "Request method is %q\n", ctx.Method()) + fmt.Fprintf(ctx, "RequestURI is %q\n", ctx.RequestURI()) + fmt.Fprintf(ctx, "Requested path is %q\n", ctx.Path()) + fmt.Fprintf(ctx, "Host is %q\n", ctx.Host()) + fmt.Fprintf(ctx, "Query string is %q\n", ctx.QueryArgs()) + fmt.Fprintf(ctx, "User-Agent is %q\n", ctx.UserAgent()) + fmt.Fprintf(ctx, "Connection has been established at %s\n", ctx.ConnTime()) + fmt.Fprintf(ctx, "Request has been started at %s\n", ctx.Time()) + fmt.Fprintf(ctx, "Serial request number for the current connection is %d\n", ctx.ConnRequestNum()) + fmt.Fprintf(ctx, "Your ip is %q\n\n", ctx.RemoteIP()) + + fmt.Fprintf(ctx, "Raw request is:\n---CUT---\n%s\n---CUT---", &ctx.Request) + + ctx.SetContentType("text/plain; charset=utf8") + + // Set arbitrary headers + ctx.Response.Header.Set("X-My-Header", "my-header-value") + + // Set cookies + var c fasthttp.Cookie + c.SetKey("cookie-name") + c.SetValue("cookie-value") + ctx.Response.Header.SetCookie(&c) +} diff --git a/vendor/github.com/valyala/fasthttp/examples/host_client/Makefile b/vendor/github.com/valyala/fasthttp/examples/host_client/Makefile new file mode 100644 index 00000000..161ab445 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/host_client/Makefile @@ -0,0 +1,6 @@ +host_client: clean + go get -u github.com/valyala/fasthttp + go build + +clean: + rm -f host_client diff --git a/vendor/github.com/valyala/fasthttp/examples/host_client/README.md b/vendor/github.com/valyala/fasthttp/examples/host_client/README.md new file mode 100644 index 00000000..e40b3976 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/host_client/README.md @@ -0,0 +1,13 @@ +# Host Client Example + +The HostClient is useful when calling an API from a single host. +The example also shows how to use URI. +You may create the parsed URI once and reuse it in many requests. +The URI has a username and password for Basic Auth but you may also set other parts i.e. `SetPath()`, `SetQueryString()`. + +# How to build and run +Start a web server on localhost:8080 then execute: + + make + ./host_client + diff --git a/vendor/github.com/valyala/fasthttp/examples/host_client/hostclient.go b/vendor/github.com/valyala/fasthttp/examples/host_client/hostclient.go new file mode 100644 index 00000000..997abd4c --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/host_client/hostclient.go @@ -0,0 +1,35 @@ +package main + +import ( + "fmt" + "os" + + "github.com/valyala/fasthttp" +) + +func main() { + // Get URI from a pool + url := fasthttp.AcquireURI() + url.Parse(nil, []byte("http://localhost:8080/")) + url.SetUsername("Aladdin") + url.SetPassword("Open Sesame") + + hc := &fasthttp.HostClient{ + Addr: "localhost:8080", // The host address and port must be set explicitly + } + + req := fasthttp.AcquireRequest() + req.SetURI(url) // copy url into request + fasthttp.ReleaseURI(url) // now you may release the URI + + req.Header.SetMethod(fasthttp.MethodGet) + resp := fasthttp.AcquireResponse() + err := hc.Do(req, resp) + fasthttp.ReleaseRequest(req) + if err == nil { + fmt.Printf("Response: %s\n", resp.Body()) + } else { + fmt.Fprintf(os.Stderr, "Connection error: %v\n", err) + } + fasthttp.ReleaseResponse(resp) +} diff --git a/vendor/github.com/valyala/fasthttp/examples/letsencrypt/letsencryptserver.go b/vendor/github.com/valyala/fasthttp/examples/letsencrypt/letsencryptserver.go new file mode 100644 index 00000000..d0871687 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/letsencrypt/letsencryptserver.go @@ -0,0 +1,41 @@ +package main + +import ( + "crypto/tls" + "net" + + "github.com/valyala/fasthttp" + "golang.org/x/crypto/acme" + "golang.org/x/crypto/acme/autocert" +) + +func requestHandler(ctx *fasthttp.RequestCtx) { + ctx.SetBodyString("hello from https!") +} + +func main() { + m := &autocert.Manager{ + Prompt: autocert.AcceptTOS, + HostPolicy: autocert.HostWhitelist("example.com"), // Replace with your domain. + Cache: autocert.DirCache("./certs"), + } + + cfg := &tls.Config{ + GetCertificate: m.GetCertificate, + NextProtos: []string{ + "http/1.1", acme.ALPNProto, + }, + } + + // Let's Encrypt tls-alpn-01 only works on port 443. + ln, err := net.Listen("tcp4", "0.0.0.0:443") /* #nosec G102 */ + if err != nil { + panic(err) + } + + lnTls := tls.NewListener(ln, cfg) + + if err := fasthttp.Serve(lnTls, requestHandler); err != nil { + panic(err) + } +} diff --git a/vendor/github.com/valyala/fasthttp/examples/multidomain/Makefile b/vendor/github.com/valyala/fasthttp/examples/multidomain/Makefile new file mode 100644 index 00000000..0787e505 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/multidomain/Makefile @@ -0,0 +1,6 @@ +writer: clean + go get -u github.com/valyala/fasthttp + go build + +clean: + rm -f multidomain diff --git a/vendor/github.com/valyala/fasthttp/examples/multidomain/README.md b/vendor/github.com/valyala/fasthttp/examples/multidomain/README.md new file mode 100644 index 00000000..12c09eca --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/multidomain/README.md @@ -0,0 +1,15 @@ +# Multidomain using SSL certs example + +* Prints two messages depending on visited host. + +# How to build + +``` +make +``` + +# How to run + +``` +./multidomain +``` diff --git a/vendor/github.com/valyala/fasthttp/examples/multidomain/multidomain.go b/vendor/github.com/valyala/fasthttp/examples/multidomain/multidomain.go new file mode 100644 index 00000000..9b5ca15d --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/examples/multidomain/multidomain.go @@ -0,0 +1,63 @@ +package main + +import ( + "fmt" + + "github.com/valyala/fasthttp" +) + +var domains = make(map[string]fasthttp.RequestHandler) + +func main() { + server := &fasthttp.Server{ + // You can check the access using openssl command: + // $ openssl s_client -connect localhost:8080 << EOF + // > GET / + // > Host: localhost + // > EOF + // + // $ openssl s_client -connect localhost:8080 << EOF + // > GET / + // > Host: 127.0.0.1:8080 + // > EOF + // + Handler: func(ctx *fasthttp.RequestCtx) { + h, ok := domains[string(ctx.Host())] + if !ok { + ctx.NotFound() + return + } + h(ctx) + }, + } + + // preparing first host + cert, priv, err := fasthttp.GenerateTestCertificate("localhost:8080") + if err != nil { + panic(err) + } + domains["localhost:8080"] = func(ctx *fasthttp.RequestCtx) { + ctx.WriteString("You are accessing to localhost:8080\n") + } + + err = server.AppendCertEmbed(cert, priv) + if err != nil { + panic(err) + } + + // preparing second host + cert, priv, err = fasthttp.GenerateTestCertificate("127.0.0.1") + if err != nil { + panic(err) + } + domains["127.0.0.1:8080"] = func(ctx *fasthttp.RequestCtx) { + ctx.WriteString("You are accessing to 127.0.0.1:8080\n") + } + + err = server.AppendCertEmbed(cert, priv) + if err != nil { + panic(err) + } + + fmt.Println(server.ListenAndServeTLS(":8080", "", "")) +} diff --git a/vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_test.go b/vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_test.go new file mode 100644 index 00000000..698285d7 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_test.go @@ -0,0 +1,273 @@ +package fasthttputil + +import ( + "bytes" + "context" + "fmt" + "io" + "net" + "net/http" + "sync" + "testing" + "time" +) + +func TestInmemoryListener(t *testing.T) { + ln := NewInmemoryListener() + + ch := make(chan struct{}) + for i := 0; i < 10; i++ { + go func(n int) { + conn, err := ln.Dial() + if err != nil { + t.Errorf("unexpected error: %v", err) + } + defer conn.Close() + req := fmt.Sprintf("request_%d", n) + nn, err := conn.Write([]byte(req)) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if nn != len(req) { + t.Errorf("unexpected number of bytes written: %d. Expecting %d", nn, len(req)) + } + buf := make([]byte, 30) + nn, err = conn.Read(buf) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + buf = buf[:nn] + resp := fmt.Sprintf("response_%d", n) + if nn != len(resp) { + t.Errorf("unexpected number of bytes read: %d. Expecting %d", nn, len(resp)) + } + if string(buf) != resp { + t.Errorf("unexpected response %q. Expecting %q", buf, resp) + } + ch <- struct{}{} + }(i) + } + + serverCh := make(chan struct{}) + go func() { + for { + conn, err := ln.Accept() + if err != nil { + close(serverCh) + return + } + defer conn.Close() + buf := make([]byte, 30) + n, err := conn.Read(buf) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + buf = buf[:n] + if !bytes.HasPrefix(buf, []byte("request_")) { + t.Errorf("unexpected request prefix %q. Expecting %q", buf, "request_") + } + resp := fmt.Sprintf("response_%s", buf[len("request_"):]) + n, err = conn.Write([]byte(resp)) + if err != nil { + t.Errorf("unexpected error: %v", err) + } + if n != len(resp) { + t.Errorf("unexpected number of bytes written: %d. Expecting %d", n, len(resp)) + } + } + }() + + for i := 0; i < 10; i++ { + select { + case <-ch: + case <-time.After(time.Second): + t.Fatalf("timeout") + } + } + + if err := ln.Close(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + select { + case <-serverCh: + case <-time.After(time.Second): + t.Fatalf("timeout") + } +} + +// echoServerHandler implements http.Handler. +type echoServerHandler struct { + t *testing.T +} + +func (s *echoServerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(200) + time.Sleep(time.Millisecond * 100) + if _, err := io.Copy(w, r.Body); err != nil { + s.t.Fatalf("unexpected error: %v", err) + } +} + +func testInmemoryListenerHTTP(t *testing.T, f func(t *testing.T, client *http.Client)) { + ln := NewInmemoryListener() + defer ln.Close() + + client := &http.Client{ + Transport: &http.Transport{ + DialContext: func(ctx context.Context, network, addr string) (net.Conn, error) { + return ln.Dial() + }, + }, + Timeout: time.Second, + } + + server := &http.Server{ + Handler: &echoServerHandler{t}, + } + + go func() { + if err := server.Serve(ln); err != nil && err != http.ErrServerClosed { + t.Errorf("unexpected error: %v", err) + } + }() + + f(t, client) + + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*100) + defer cancel() + server.Shutdown(ctx) //nolint:errcheck +} + +func testInmemoryListenerHTTPSingle(t *testing.T, client *http.Client, content string) { + res, err := client.Post("http://...", "text/plain", bytes.NewBufferString(content)) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + defer func() { _ = res.Body.Close() }() + b, err := io.ReadAll(res.Body) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + s := string(b) + if string(b) != content { + t.Fatalf("unexpected response %q, expecting %q", s, content) + } +} + +func TestInmemoryListenerHTTPSingle(t *testing.T) { + testInmemoryListenerHTTP(t, func(t *testing.T, client *http.Client) { + testInmemoryListenerHTTPSingle(t, client, "request") + }) +} + +func TestInmemoryListenerHTTPSerial(t *testing.T) { + testInmemoryListenerHTTP(t, func(t *testing.T, client *http.Client) { + for i := 0; i < 10; i++ { + testInmemoryListenerHTTPSingle(t, client, fmt.Sprintf("request_%d", i)) + } + }) +} + +func TestInmemoryListenerHTTPConcurrent(t *testing.T) { + testInmemoryListenerHTTP(t, func(t *testing.T, client *http.Client) { + var wg sync.WaitGroup + for i := 0; i < 10; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + testInmemoryListenerHTTPSingle(t, client, fmt.Sprintf("request_%d", i)) + }(i) + } + wg.Wait() + }) +} + +func acceptLoop(ln net.Listener) { + for { + conn, err := ln.Accept() + if err != nil { + panic(err) + } + + conn.Close() + } +} + +func TestInmemoryListenerAddrDefault(t *testing.T) { + ln := NewInmemoryListener() + + verifyAddr(t, ln.Addr(), inmemoryAddr(0)) + + go func() { + c, err := ln.Dial() + if err != nil { + panic(err) + } + + c.Close() + }() + + lc, err := ln.Accept() + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + verifyAddr(t, lc.LocalAddr(), inmemoryAddr(0)) + verifyAddr(t, lc.RemoteAddr(), pipeAddr(0)) + + go acceptLoop(ln) + + c, err := ln.Dial() + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + verifyAddr(t, c.LocalAddr(), pipeAddr(0)) + verifyAddr(t, c.RemoteAddr(), inmemoryAddr(0)) +} + +func verifyAddr(t *testing.T, got, expected net.Addr) { + if got != expected { + t.Fatalf("unexpected addr: %v. Expecting %v", got, expected) + } +} + +func TestInmemoryListenerAddrCustom(t *testing.T) { + ln := NewInmemoryListener() + + listenerAddr := &net.TCPAddr{IP: net.IPv4(127, 0, 0, 1), Port: 12345} + + ln.SetLocalAddr(listenerAddr) + + verifyAddr(t, ln.Addr(), listenerAddr) + + go func() { + c, err := ln.Dial() + if err != nil { + panic(err) + } + + c.Close() + }() + + lc, err := ln.Accept() + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + verifyAddr(t, lc.LocalAddr(), listenerAddr) + verifyAddr(t, lc.RemoteAddr(), pipeAddr(0)) + + go acceptLoop(ln) + + clientAddr := &net.TCPAddr{IP: net.IPv4(127, 0, 0, 2), Port: 65432} + + c, err := ln.DialWithLocalAddr(clientAddr) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + + verifyAddr(t, c.LocalAddr(), clientAddr) + verifyAddr(t, c.RemoteAddr(), listenerAddr) +} diff --git a/vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_timing_test.go b/vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_timing_test.go new file mode 100644 index 00000000..ee398009 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/fasthttputil/inmemory_listener_timing_test.go @@ -0,0 +1,155 @@ +package fasthttputil_test + +import ( + "crypto/tls" + "net" + "testing" + + "github.com/valyala/fasthttp" + "github.com/valyala/fasthttp/fasthttputil" +) + +var ( + certblock = []byte(`-----BEGIN CERTIFICATE----- +MIICujCCAaKgAwIBAgIJAMbXnKZ/cikUMA0GCSqGSIb3DQEBCwUAMBUxEzARBgNV +BAMTCnVidW50dS5uYW4wHhcNMTUwMjA0MDgwMTM5WhcNMjUwMjAxMDgwMTM5WjAV +MRMwEQYDVQQDEwp1YnVudHUubmFuMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA+CELrALPDyXZxt5lEbfwF7YAvnHqizmrSePSSRNVT05DAMvqBNX9V75D +K2LB6pg3+hllc4FV68i+FMKtv5yUpuenXYTeeZyPKEjd3bcsFAfP0oXpRDe955Te ++z3g/bZejZLD8Fmiq6satBZWm0T2UkAn5oGW4Q1fEmvJnwpBVNBtJYrepCxnHgij +L5lvvQc+3m7GJlXZlTMZnyCUrRQ+OJVhU3VHOuViEihHVthC3FHn29Mzi8PtDwm1 +xRiR+ceZLZLFvPgQZNh5IBnkES/6jwnHLYW0nDtFYDY98yd2WS9Dm0gwG7zQxvOY +6HjYwzauQ0/wQGdGzkmxBbIfn/QQMwIDAQABow0wCzAJBgNVHRMEAjAAMA0GCSqG +SIb3DQEBCwUAA4IBAQBQjKm/4KN/iTgXbLTL3i7zaxYXFLXsnT1tF+ay4VA8aj98 +L3JwRTciZ3A5iy/W4VSCt3eASwOaPWHKqDBB5RTtL73LoAqsWmO3APOGQAbixcQ2 +45GXi05OKeyiYRi1Nvq7Unv9jUkRDHUYVPZVSAjCpsXzPhFkmZoTRxmx5l0ZF7Li +K91lI5h+eFq0dwZwrmlPambyh1vQUi70VHv8DNToVU29kel7YLbxGbuqETfhrcy6 +X+Mha6RYITkAn5FqsZcKMsc9eYGEF4l3XV+oS7q6xfTxktYJMFTI18J0lQ2Lv/CI +whdMnYGntDQBE/iFCrJEGNsKGc38796GBOb5j+zd +-----END CERTIFICATE----- +`) + keyblock = []byte(`-----BEGIN PRIVATE KEY----- +MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQD4IQusAs8PJdnG +3mURt/AXtgC+ceqLOatJ49JJE1VPTkMAy+oE1f1XvkMrYsHqmDf6GWVzgVXryL4U +wq2/nJSm56ddhN55nI8oSN3dtywUB8/ShelEN73nlN77PeD9tl6NksPwWaKrqxq0 +FlabRPZSQCfmgZbhDV8Sa8mfCkFU0G0lit6kLGceCKMvmW+9Bz7ebsYmVdmVMxmf +IJStFD44lWFTdUc65WISKEdW2ELcUefb0zOLw+0PCbXFGJH5x5ktksW8+BBk2Hkg +GeQRL/qPCccthbScO0VgNj3zJ3ZZL0ObSDAbvNDG85joeNjDNq5DT/BAZ0bOSbEF +sh+f9BAzAgMBAAECggEBAJWv2cq7Jw6MVwSRxYca38xuD6TUNBopgBvjREixURW2 +sNUaLuMb9Omp7fuOaE2N5rcJ+xnjPGIxh/oeN5MQctz9gwn3zf6vY+15h97pUb4D +uGvYPRDaT8YVGS+X9NMZ4ZCmqW2lpWzKnCFoGHcy8yZLbcaxBsRdvKzwOYGoPiFb +K2QuhXZ/1UPmqK9i2DFKtj40X6vBszTNboFxOVpXrPu0FJwLVSDf2hSZ4fMM0DH3 +YqwKcYf5te+hxGKgrqRA3tn0NCWii0in6QIwXMC+kMw1ebg/tZKqyDLMNptAK8J+ +DVw9m5X1seUHS5ehU/g2jrQrtK5WYn7MrFK4lBzlRwECgYEA/d1TeANYECDWRRDk +B0aaRZs87Rwl/J9PsvbsKvtU/bX+OfSOUjOa9iQBqn0LmU8GqusEET/QVUfocVwV +Bggf/5qDLxz100Rj0ags/yE/kNr0Bb31kkkKHFMnCT06YasR7qKllwrAlPJvQv9x +IzBKq+T/Dx08Wep9bCRSFhzRCnsCgYEA+jdeZXTDr/Vz+D2B3nAw1frqYFfGnEVY +wqmoK3VXMDkGuxsloO2rN+SyiUo3JNiQNPDub/t7175GH5pmKtZOlftePANsUjBj +wZ1D0rI5Bxu/71ibIUYIRVmXsTEQkh/ozoh3jXCZ9+bLgYiYx7789IUZZSokFQ3D +FICUT9KJ36kCgYAGoq9Y1rWJjmIrYfqj2guUQC+CfxbbGIrrwZqAsRsSmpwvhZ3m +tiSZxG0quKQB+NfSxdvQW5ulbwC7Xc3K35F+i9pb8+TVBdeaFkw+yu6vaZmxQLrX +fQM/pEjD7A7HmMIaO7QaU5SfEAsqdCTP56Y8AftMuNXn/8IRfo2KuGwaWwKBgFpU +ILzJoVdlad9E/Rw7LjYhZfkv1uBVXIyxyKcfrkEXZSmozDXDdxsvcZCEfVHM6Ipk +K/+7LuMcqp4AFEAEq8wTOdq6daFaHLkpt/FZK6M4TlruhtpFOPkoNc3e45eM83OT +6mziKINJC1CQ6m65sQHpBtjxlKMRG8rL/D6wx9s5AoGBAMRlqNPMwglT3hvDmsAt +9Lf9pdmhERUlHhD8bj8mDaBj2Aqv7f6VRJaYZqP403pKKQexuqcn80mtjkSAPFkN +Cj7BVt/RXm5uoxDTnfi26RF9F6yNDEJ7UU9+peBr99aazF/fTgW/1GcMkQnum8uV +c257YgaWmjK9uB0Y2r2VxS0G +-----END PRIVATE KEY-----`) +) + +// BenchmarkPlainStreaming measures end-to-end plaintext streaming performance +// for fasthttp client and server. +// +// It issues http requests over a small number of keep-alive connections. +func BenchmarkPlainStreaming(b *testing.B) { + benchmark(b, streamingHandler, false) +} + +// BenchmarkPlainHandshake measures end-to-end plaintext handshake performance +// for fasthttp client and server. +// +// It re-establishes new connection per each http request. +func BenchmarkPlainHandshake(b *testing.B) { + benchmark(b, handshakeHandler, false) +} + +// BenchmarkTLSStreaming measures end-to-end TLS streaming performance +// for fasthttp client and server. +// +// It issues http requests over a small number of TLS keep-alive connections. +func BenchmarkTLSStreaming(b *testing.B) { + benchmark(b, streamingHandler, true) +} + +func benchmark(b *testing.B, h fasthttp.RequestHandler, isTLS bool) { + var serverTLSConfig, clientTLSConfig *tls.Config + if isTLS { + cert, err := tls.X509KeyPair(certblock, keyblock) + if err != nil { + b.Fatalf("cannot load TLS certificate: %v", err) + } + serverTLSConfig = &tls.Config{ + Certificates: []tls.Certificate{cert}, + PreferServerCipherSuites: true, + } + serverTLSConfig.CurvePreferences = []tls.CurveID{} + clientTLSConfig = &tls.Config{ + InsecureSkipVerify: true, + } + } + ln := fasthttputil.NewInmemoryListener() + serverStopCh := make(chan struct{}) + go func() { + serverLn := net.Listener(ln) + if serverTLSConfig != nil { + serverLn = tls.NewListener(serverLn, serverTLSConfig) + } + if err := fasthttp.Serve(serverLn, h); err != nil { + b.Errorf("unexpected error in server: %v", err) + } + close(serverStopCh) + }() + c := &fasthttp.HostClient{ + Dial: func(addr string) (net.Conn, error) { + return ln.Dial() + }, + IsTLS: isTLS, + TLSConfig: clientTLSConfig, + } + + b.RunParallel(func(pb *testing.PB) { + runRequests(b, pb, c, isTLS) + }) + ln.Close() + <-serverStopCh +} + +func streamingHandler(ctx *fasthttp.RequestCtx) { + ctx.WriteString("foobar") //nolint:errcheck +} + +func handshakeHandler(ctx *fasthttp.RequestCtx) { + streamingHandler(ctx) + + // Explicitly close connection after each response. + ctx.SetConnectionClose() +} + +func runRequests(b *testing.B, pb *testing.PB, c *fasthttp.HostClient, isTLS bool) { + var req fasthttp.Request + if isTLS { + req.SetRequestURI("https://foo.bar/baz") + } else { + req.SetRequestURI("http://foo.bar/baz") + } + var resp fasthttp.Response + for pb.Next() { + if err := c.Do(&req, &resp); err != nil { + b.Fatalf("unexpected error: %v", err) + } + if resp.StatusCode() != fasthttp.StatusOK { + b.Fatalf("unexpected status code: %d. Expecting %d", resp.StatusCode(), fasthttp.StatusOK) + } + } +} diff --git a/vendor/github.com/valyala/fasthttp/fasthttputil/pipeconns_test.go b/vendor/github.com/valyala/fasthttp/fasthttputil/pipeconns_test.go new file mode 100644 index 00000000..9ac7ee14 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/fasthttputil/pipeconns_test.go @@ -0,0 +1,407 @@ +package fasthttputil + +import ( + "bytes" + "fmt" + "io" + "net" + "testing" + "time" +) + +func TestPipeConnsWriteTimeout(t *testing.T) { + t.Parallel() + + pc := NewPipeConns() + c1 := pc.Conn1() + + deadline := time.Now().Add(time.Millisecond) + if err := c1.SetWriteDeadline(deadline); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + data := []byte("foobar") + for { + _, err := c1.Write(data) + if err != nil { + if err == ErrTimeout { + break + } + t.Fatalf("unexpected error: %v", err) + } + } + + for i := 0; i < 10; i++ { + _, err := c1.Write(data) + if err == nil { + t.Fatalf("expecting error") + } + if err != ErrTimeout { + t.Fatalf("unexpected error: %v. Expecting %v", err, ErrTimeout) + } + } + + // read the written data + c2 := pc.Conn2() + if err := c2.SetReadDeadline(time.Now().Add(10 * time.Millisecond)); err != nil { + t.Fatalf("unexpected error: %v", err) + } + for { + _, err := c2.Read(data) + if err != nil { + if err == ErrTimeout { + break + } + t.Fatalf("unexpected error: %v", err) + } + } + + for i := 0; i < 10; i++ { + _, err := c2.Read(data) + if err == nil { + t.Fatalf("expecting error") + } + if err != ErrTimeout { + t.Fatalf("unexpected error: %v. Expecting %v", err, ErrTimeout) + } + } +} + +func TestPipeConnsPositiveReadTimeout(t *testing.T) { + t.Parallel() + + testPipeConnsReadTimeout(t, time.Millisecond) +} + +func TestPipeConnsNegativeReadTimeout(t *testing.T) { + t.Parallel() + + testPipeConnsReadTimeout(t, -time.Second) +} + +var zeroTime time.Time + +func testPipeConnsReadTimeout(t *testing.T, timeout time.Duration) { + pc := NewPipeConns() + c1 := pc.Conn1() + + deadline := time.Now().Add(timeout) + if err := c1.SetReadDeadline(deadline); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + var buf [1]byte + for i := 0; i < 10; i++ { + _, err := c1.Read(buf[:]) + if err == nil { + t.Fatalf("expecting error on iteration %d", i) + } + if err != ErrTimeout { + t.Fatalf("unexpected error on iteration %d: %v. Expecting %v", i, err, ErrTimeout) + } + } + + // disable deadline and send data from c2 to c1 + if err := c1.SetReadDeadline(zeroTime); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + data := []byte("foobar") + c2 := pc.Conn2() + if _, err := c2.Write(data); err != nil { + t.Fatalf("unexpected error: %v", err) + } + dataBuf := make([]byte, len(data)) + if _, err := io.ReadFull(c1, dataBuf); err != nil { + t.Fatalf("unexpected error: %v", err) + } + if !bytes.Equal(data, dataBuf) { + t.Fatalf("unexpected data received: %q. Expecting %q", dataBuf, data) + } +} + +func TestPipeConnsCloseWhileReadWriteConcurrent(t *testing.T) { + t.Parallel() + + concurrency := 4 + ch := make(chan struct{}, concurrency) + for i := 0; i < concurrency; i++ { + go func() { + testPipeConnsCloseWhileReadWriteSerial(t) + ch <- struct{}{} + }() + } + + for i := 0; i < concurrency; i++ { + select { + case <-ch: + case <-time.After(5 * time.Second): + t.Fatalf("timeout") + } + } +} + +func TestPipeConnsCloseWhileReadWriteSerial(t *testing.T) { + t.Parallel() + + testPipeConnsCloseWhileReadWriteSerial(t) +} + +func testPipeConnsCloseWhileReadWriteSerial(t *testing.T) { + for i := 0; i < 10; i++ { + testPipeConnsCloseWhileReadWrite(t) + } +} + +func testPipeConnsCloseWhileReadWrite(t *testing.T) { + pc := NewPipeConns() + c1 := pc.Conn1() + c2 := pc.Conn2() + + readCh := make(chan error) + go func() { + var err error + if _, err = io.Copy(io.Discard, c1); err != nil { + if err != errConnectionClosed { + err = fmt.Errorf("unexpected error: %w", err) + } else { + err = nil + } + } + readCh <- err + }() + + writeCh := make(chan error) + go func() { + var err error + for { + if _, err = c2.Write([]byte("foobar")); err != nil { + if err != errConnectionClosed { + err = fmt.Errorf("unexpected error: %w", err) + } else { + err = nil + } + break + } + } + writeCh <- err + }() + + time.Sleep(10 * time.Millisecond) + if err := c1.Close(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + if err := c2.Close(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + select { + case err := <-readCh: + if err != nil { + t.Fatalf("unexpected error in reader: %v", err) + } + case <-time.After(time.Second): + t.Fatalf("timeout") + } + select { + case err := <-writeCh: + if err != nil { + t.Fatalf("unexpected error in writer: %v", err) + } + case <-time.After(time.Second): + t.Fatalf("timeout") + } +} + +func TestPipeConnsReadWriteSerial(t *testing.T) { + t.Parallel() + + testPipeConnsReadWriteSerial(t) +} + +func TestPipeConnsReadWriteConcurrent(t *testing.T) { + t.Parallel() + + testConcurrency(t, 10, testPipeConnsReadWriteSerial) +} + +func testPipeConnsReadWriteSerial(t *testing.T) { + pc := NewPipeConns() + testPipeConnsReadWrite(t, pc.Conn1(), pc.Conn2()) + + pc = NewPipeConns() + testPipeConnsReadWrite(t, pc.Conn2(), pc.Conn1()) +} + +func testPipeConnsReadWrite(t *testing.T, c1, c2 net.Conn) { + defer c1.Close() + defer c2.Close() + + var buf [32]byte + for i := 0; i < 10; i++ { + // The first write + s1 := fmt.Sprintf("foo_%d", i) + n, err := c1.Write([]byte(s1)) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if n != len(s1) { + t.Fatalf("unexpected number of bytes written: %d. Expecting %d", n, len(s1)) + } + + // The second write + s2 := fmt.Sprintf("bar_%d", i) + n, err = c1.Write([]byte(s2)) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if n != len(s2) { + t.Fatalf("unexpected number of bytes written: %d. Expecting %d", n, len(s2)) + } + + // Read data written above in two writes + s := s1 + s2 + n, err = c2.Read(buf[:]) + if err != nil { + t.Fatalf("unexpected error: %v", err) + } + if n != len(s) { + t.Fatalf("unexpected number of bytes read: %d. Expecting %d", n, len(s)) + } + if string(buf[:n]) != s { + t.Fatalf("unexpected string read: %q. Expecting %q", buf[:n], s) + } + } +} + +func TestPipeConnsCloseSerial(t *testing.T) { + t.Parallel() + + testPipeConnsCloseSerial(t) +} + +func TestPipeConnsCloseConcurrent(t *testing.T) { + t.Parallel() + + testConcurrency(t, 10, testPipeConnsCloseSerial) +} + +func testPipeConnsCloseSerial(t *testing.T) { + pc := NewPipeConns() + testPipeConnsClose(t, pc.Conn1(), pc.Conn2()) + + pc = NewPipeConns() + testPipeConnsClose(t, pc.Conn2(), pc.Conn1()) +} + +func testPipeConnsClose(t *testing.T, c1, c2 net.Conn) { + if err := c1.Close(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + var buf [10]byte + + // attempt writing to closed conn + for i := 0; i < 10; i++ { + n, err := c1.Write(buf[:]) + if err == nil { + t.Fatalf("expecting error") + } + if n != 0 { + t.Fatalf("unexpected number of bytes written: %d. Expecting 0", n) + } + } + + // attempt reading from closed conn + for i := 0; i < 10; i++ { + n, err := c2.Read(buf[:]) + if err == nil { + t.Fatalf("expecting error") + } + if err != io.EOF { + t.Fatalf("unexpected error: %v. Expecting %v", err, io.EOF) + } + if n != 0 { + t.Fatalf("unexpected number of bytes read: %d. Expecting 0", n) + } + } + + if err := c2.Close(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + + // attempt closing already closed conns + for i := 0; i < 10; i++ { + if err := c1.Close(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + if err := c2.Close(); err != nil { + t.Fatalf("unexpected error: %v", err) + } + } +} + +func testConcurrency(t *testing.T, concurrency int, f func(*testing.T)) { + ch := make(chan struct{}, concurrency) + for i := 0; i < concurrency; i++ { + go func() { + f(t) + ch <- struct{}{} + }() + } + + for i := 0; i < concurrency; i++ { + select { + case <-ch: + case <-time.After(time.Second): + t.Fatalf("timeout") + } + } +} + +func TestPipeConnsAddrDefault(t *testing.T) { + t.Parallel() + + pc := NewPipeConns() + c1 := pc.Conn1() + + if c1.LocalAddr() != pipeAddr(0) { + t.Fatalf("unexpected local address: %v", c1.LocalAddr()) + } + + if c1.RemoteAddr() != pipeAddr(0) { + t.Fatalf("unexpected remote address: %v", c1.RemoteAddr()) + } +} + +func TestPipeConnsAddrCustom(t *testing.T) { + t.Parallel() + + pc := NewPipeConns() + + addr1 := &net.TCPAddr{IP: net.IPv4(1, 2, 3, 4), Port: 1234} + addr2 := &net.TCPAddr{IP: net.IPv4(5, 6, 7, 8), Port: 5678} + addr3 := &net.TCPAddr{IP: net.IPv4(9, 10, 11, 12), Port: 9012} + addr4 := &net.TCPAddr{IP: net.IPv4(13, 14, 15, 16), Port: 3456} + + pc.SetAddresses(addr1, addr2, addr3, addr4) + + c1 := pc.Conn1() + + if c1.LocalAddr() != addr1 { + t.Fatalf("unexpected local address: %v", c1.LocalAddr()) + } + + if c1.RemoteAddr() != addr2 { + t.Fatalf("unexpected remote address: %v", c1.RemoteAddr()) + } + + c2 := pc.Conn1() + + if c2.LocalAddr() != addr1 { + t.Fatalf("unexpected local address: %v", c2.LocalAddr()) + } + + if c2.RemoteAddr() != addr2 { + t.Fatalf("unexpected remote address: %v", c2.RemoteAddr()) + } +} diff --git a/vendor/github.com/valyala/fasthttp/fs.go b/vendor/github.com/valyala/fasthttp/fs.go index fc679de3..c231d803 100644 --- a/vendor/github.com/valyala/fasthttp/fs.go +++ b/vendor/github.com/valyala/fasthttp/fs.go @@ -6,6 +6,7 @@ import ( "fmt" "html" "io" + "io/fs" "mime" "net/http" "os" @@ -136,6 +137,32 @@ var ( rootFSHandler RequestHandler ) +// ServeFS returns HTTP response containing compressed file contents from the given fs.FS's path. +// +// HTTP response may contain uncompressed file contents in the following cases: +// +// - Missing 'Accept-Encoding: gzip' request header. +// - No write access to directory containing the file. +// +// Directory contents is returned if path points to directory. +// +// See also ServeFile. +func ServeFS(ctx *RequestCtx, filesystem fs.FS, path string) { + f := &FS{ + FS: filesystem, + Root: "", + AllowEmptyRoot: true, + GenerateIndexPages: true, + Compress: true, + CompressBrotli: true, + AcceptByteRange: true, + } + handler := f.NewRequestHandler() + + ctx.Request.SetRequestURI(path) + handler(ctx) +} + // PathRewriteFunc must return new request path based on arbitrary ctx // info such as ctx.Path(). // @@ -225,6 +252,9 @@ func NewPathPrefixStripper(prefixSize int) PathRewriteFunc { type FS struct { noCopy noCopy + // FS is filesystem to serve files from. eg: embed.FS os.DirFS + FS fs.FS + // Path to the root directory to serve files from. Root string @@ -296,6 +326,11 @@ type FS struct { // "Cannot open requested path" PathNotFound RequestHandler + // SkipCache if true, will cache no file handler. + // + // By default is false. + SkipCache bool + // Expiration duration for inactive file handlers. // // FSHandlerCacheDuration is used by default. @@ -391,16 +426,20 @@ func (fs *FS) NewRequestHandler() RequestHandler { } func (fs *FS) normalizeRoot(root string) string { - // Serve files from the current working directory if Root is empty or if Root is a relative path. - if (!fs.AllowEmptyRoot && len(root) == 0) || (len(root) > 0 && !filepath.IsAbs(root)) { - path, err := os.Getwd() - if err != nil { - path = "." + // fs.FS uses relative paths, that paths are slash-separated on all systems, even Windows. + if fs.FS == nil { + // Serve files from the current working directory if Root is empty or if Root is a relative path. + if (!fs.AllowEmptyRoot && len(root) == 0) || (len(root) > 0 && !filepath.IsAbs(root)) { + path, err := os.Getwd() + if err != nil { + path = "." + } + root = path + "/" + root } - root = path + "/" + root + + // convert the root directory slashes to the native format + root = filepath.FromSlash(root) } - // convert the root directory slashes to the native format - root = filepath.FromSlash(root) // strip trailing slashes from the root path for len(root) > 0 && root[len(root)-1] == os.PathSeparator { @@ -419,11 +458,6 @@ func (fs *FS) initRequestHandler() { compressRoot = fs.normalizeRoot(compressRoot) } - cacheDuration := fs.CacheDuration - if cacheDuration <= 0 { - cacheDuration = FSHandlerCacheDuration - } - compressedFileSuffixes := fs.CompressedFileSuffixes if len(compressedFileSuffixes["br"]) == 0 || len(compressedFileSuffixes["gzip"]) == 0 || compressedFileSuffixes["br"] == compressedFileSuffixes["gzip"] { @@ -440,6 +474,7 @@ func (fs *FS) initRequestHandler() { } h := &fsHandler{ + filesystem: fs.FS, root: root, indexNames: fs.IndexNames, pathRewrite: fs.PathRewrite, @@ -449,45 +484,20 @@ func (fs *FS) initRequestHandler() { compressRoot: compressRoot, pathNotFound: fs.PathNotFound, acceptByteRange: fs.AcceptByteRange, - cacheDuration: cacheDuration, compressedFileSuffixes: compressedFileSuffixes, - cache: make(map[string]*fsFile), - cacheBrotli: make(map[string]*fsFile), - cacheGzip: make(map[string]*fsFile), } - go func() { - var pendingFiles []*fsFile + h.cacheManager = newCacheManager(fs) - clean := func() { - pendingFiles = h.cleanCache(pendingFiles) - } - - if fs.CleanStop != nil { - t := time.NewTicker(cacheDuration / 2) - for { - select { - case <-t.C: - clean() - case _, stillOpen := <-fs.CleanStop: - // Ignore values send on the channel, only stop when it is closed. - if !stillOpen { - t.Stop() - return - } - } - } - } - for { - time.Sleep(cacheDuration / 2) - clean() - } - }() + if h.filesystem == nil { + h.filesystem = &osFS{} // It provides os.Open and os.Stat + } fs.h = h.handleRequest } type fsHandler struct { + filesystem fs.FS root string indexNames []string pathRewrite PathRewriteFunc @@ -497,20 +507,17 @@ type fsHandler struct { compressBrotli bool compressRoot string acceptByteRange bool - cacheDuration time.Duration compressedFileSuffixes map[string]string - cache map[string]*fsFile - cacheBrotli map[string]*fsFile - cacheGzip map[string]*fsFile - cacheLock sync.Mutex + cacheManager cacheManager smallFileReaderPool sync.Pool } type fsFile struct { h *fsHandler - f *os.File + f fs.File + filename string // fs.FileInfo.Name() return filename, isn't filepath. dirIndex []byte contentType string contentLength int @@ -555,6 +562,9 @@ func (ff *fsFile) smallFileReader() (io.Reader, error) { const maxSmallFileSize = 2 * 4096 func (ff *fsFile) isBig() bool { + if _, ok := ff.h.filesystem.(*osFS); !ok { // fs.FS only uses bigFileReader, memory cache uses fsSmallFileReader + return ff.f != nil + } return ff.contentLength > maxSmallFileSize && len(ff.dirIndex) == 0 } @@ -577,7 +587,7 @@ func (ff *fsFile) bigFileReader() (io.Reader, error) { return r, nil } - f, err := os.Open(ff.f.Name()) + f, err := ff.h.filesystem.Open(ff.filename) if err != nil { return nil, fmt.Errorf("cannot open already opened file: %w", err) } @@ -603,25 +613,29 @@ func (ff *fsFile) Release() { } func (ff *fsFile) decReadersCount() { - ff.h.cacheLock.Lock() - ff.readersCount-- - if ff.readersCount < 0 { - ff.readersCount = 0 - } - ff.h.cacheLock.Unlock() + ff.h.cacheManager.WithLock(func() { + ff.readersCount-- + if ff.readersCount < 0 { + ff.readersCount = 0 + } + }) } // bigFileReader attempts to trigger sendfile // for sending big files over the wire. type bigFileReader struct { - f *os.File + f fs.File ff *fsFile r io.Reader lr io.LimitedReader } func (r *bigFileReader) UpdateByteRange(startPos, endPos int) error { - if _, err := r.f.Seek(int64(startPos), 0); err != nil { + seeker, ok := r.f.(io.Seeker) + if !ok { + return errors.New("must implement io.Seeker") + } + if _, err := seeker.Seek(int64(startPos), io.SeekStart); err != nil { return err } r.r = &r.lr @@ -646,7 +660,12 @@ func (r *bigFileReader) WriteTo(w io.Writer) (int64, error) { func (r *bigFileReader) Close() error { r.r = r.f - n, err := r.f.Seek(0, 0) + seeker, ok := r.f.(io.Seeker) + if !ok { + _ = r.f.Close() + return errors.New("must implement io.Seeker") + } + n, err := seeker.Seek(0, io.SeekStart) if err == nil { if n == 0 { ff := r.ff @@ -655,7 +674,7 @@ func (r *bigFileReader) Close() error { ff.bigFilesLock.Unlock() } else { _ = r.f.Close() - err = errors.New("bug: File.Seek(0,0) returned (non-zero, nil)") + err = errors.New("bug: File.Seek(0, io.SeekStart) returned (non-zero, nil)") } } else { _ = r.f.Close() @@ -697,7 +716,11 @@ func (r *fsSmallFileReader) Read(p []byte) (int, error) { ff := r.ff if ff.f != nil { - n, err := ff.f.ReadAt(p, int64(r.startPos)) + ra, ok := ff.f.(io.ReaderAt) + if !ok { + return 0, errors.New("must implement io.ReaderAt") + } + n, err := ra.ReadAt(p, int64(r.startPos)) r.startPos += n return n, err } @@ -732,7 +755,11 @@ func (r *fsSmallFileReader) WriteTo(w io.Writer) (int64, error) { if len(buf) > tailLen { buf = buf[:tailLen] } - n, err = ff.f.ReadAt(buf, int64(curPos)) + ra, ok := ff.f.(io.ReaderAt) + if !ok { + return 0, errors.New("must implement io.ReaderAt") + } + n, err = ra.ReadAt(buf, int64(curPos)) nw, errw := w.Write(buf[:n]) curPos += nw if errw == nil && nw != n { @@ -750,10 +777,164 @@ func (r *fsSmallFileReader) WriteTo(w io.Writer) (int64, error) { return int64(curPos - r.startPos), err } -func (h *fsHandler) cleanCache(pendingFiles []*fsFile) []*fsFile { +type cacheManager interface { + WithLock(work func()) + GetFileFromCache(cacheKind CacheKind, path string) (*fsFile, bool) + SetFileToCache(cacheKind CacheKind, path string, ff *fsFile) *fsFile +} + +var ( + _ cacheManager = (*inMemoryCacheManager)(nil) + _ cacheManager = (*noopCacheManager)(nil) +) + +type CacheKind uint8 + +const ( + defaultCacheKind CacheKind = iota + brotliCacheKind + gzipCacheKind +) + +func newCacheManager(fs *FS) cacheManager { + if fs.SkipCache { + return &noopCacheManager{} + } + + cacheDuration := fs.CacheDuration + if cacheDuration <= 0 { + cacheDuration = FSHandlerCacheDuration + } + + instance := &inMemoryCacheManager{ + cacheDuration: cacheDuration, + cache: make(map[string]*fsFile), + cacheBrotli: make(map[string]*fsFile), + cacheGzip: make(map[string]*fsFile), + } + + go instance.handleCleanCache(fs.CleanStop) + + return instance +} + +type noopCacheManager struct { + cacheLock sync.Mutex +} + +func (n *noopCacheManager) WithLock(work func()) { + n.cacheLock.Lock() + + work() + + n.cacheLock.Unlock() +} + +func (*noopCacheManager) GetFileFromCache(cacheKind CacheKind, path string) (*fsFile, bool) { + return nil, false +} + +func (*noopCacheManager) SetFileToCache(cacheKind CacheKind, path string, ff *fsFile) *fsFile { + return ff +} + +type inMemoryCacheManager struct { + cacheDuration time.Duration + cache map[string]*fsFile + cacheBrotli map[string]*fsFile + cacheGzip map[string]*fsFile + cacheLock sync.Mutex +} + +func (cm *inMemoryCacheManager) WithLock(work func()) { + cm.cacheLock.Lock() + + work() + + cm.cacheLock.Unlock() +} + +func (cm *inMemoryCacheManager) getFsCache(cacheKind CacheKind) map[string]*fsFile { + fileCache := cm.cache + switch cacheKind { + case brotliCacheKind: + fileCache = cm.cacheBrotli + case gzipCacheKind: + fileCache = cm.cacheGzip + } + + return fileCache +} + +func (cm *inMemoryCacheManager) GetFileFromCache(cacheKind CacheKind, path string) (*fsFile, bool) { + fileCache := cm.getFsCache(cacheKind) + + cm.cacheLock.Lock() + ff, ok := fileCache[path] + if ok { + ff.readersCount++ + } + cm.cacheLock.Unlock() + + return ff, ok +} + +func (cm *inMemoryCacheManager) SetFileToCache(cacheKind CacheKind, path string, ff *fsFile) *fsFile { + fileCache := cm.getFsCache(cacheKind) + + cm.cacheLock.Lock() + ff1, ok := fileCache[path] + if !ok { + fileCache[path] = ff + ff.readersCount++ + } else { + ff1.readersCount++ + } + cm.cacheLock.Unlock() + + if ok { + // The file has been already opened by another + // goroutine, so close the current file and use + // the file opened by another goroutine instead. + ff.Release() + ff = ff1 + } + + return ff +} + +func (cm *inMemoryCacheManager) handleCleanCache(cleanStop chan struct{}) { + var pendingFiles []*fsFile + + clean := func() { + pendingFiles = cm.cleanCache(pendingFiles) + } + + if cleanStop != nil { + t := time.NewTicker(cm.cacheDuration / 2) + for { + select { + case <-t.C: + clean() + case _, stillOpen := <-cleanStop: + // Ignore values send on the channel, only stop when it is closed. + if !stillOpen { + t.Stop() + return + } + } + } + } + for { + time.Sleep(cm.cacheDuration / 2) + clean() + } +} + +func (cm *inMemoryCacheManager) cleanCache(pendingFiles []*fsFile) []*fsFile { var filesToRelease []*fsFile - h.cacheLock.Lock() + cm.cacheLock.Lock() // Close files which couldn't be closed before due to non-zero // readers count on the previous run. @@ -767,11 +948,11 @@ func (h *fsHandler) cleanCache(pendingFiles []*fsFile) []*fsFile { } pendingFiles = remainingFiles - pendingFiles, filesToRelease = cleanCacheNolock(h.cache, pendingFiles, filesToRelease, h.cacheDuration) - pendingFiles, filesToRelease = cleanCacheNolock(h.cacheBrotli, pendingFiles, filesToRelease, h.cacheDuration) - pendingFiles, filesToRelease = cleanCacheNolock(h.cacheGzip, pendingFiles, filesToRelease, h.cacheDuration) + pendingFiles, filesToRelease = cleanCacheNolock(cm.cache, pendingFiles, filesToRelease, cm.cacheDuration) + pendingFiles, filesToRelease = cleanCacheNolock(cm.cacheBrotli, pendingFiles, filesToRelease, cm.cacheDuration) + pendingFiles, filesToRelease = cleanCacheNolock(cm.cacheGzip, pendingFiles, filesToRelease, cm.cacheDuration) - h.cacheLock.Unlock() + cm.cacheLock.Unlock() for _, ff := range filesToRelease { ff.Release() @@ -799,6 +980,12 @@ func cleanCacheNolock(cache map[string]*fsFile, pendingFiles, filesToRelease []* } func (h *fsHandler) pathToFilePath(path string) string { + if _, ok := h.filesystem.(*osFS); !ok { + if len(path) < 1 { + return path + } + return path[1:] + } return filepath.FromSlash(h.root + path) } @@ -839,30 +1026,25 @@ func (h *fsHandler) handleRequest(ctx *RequestCtx) { } mustCompress := false - fileCache := h.cache + fileCacheKind := defaultCacheKind fileEncoding := "" byteRange := ctx.Request.Header.peek(strRange) if len(byteRange) == 0 && h.compress { if h.compressBrotli && ctx.Request.Header.HasAcceptEncodingBytes(strBr) { mustCompress = true - fileCache = h.cacheBrotli + fileCacheKind = brotliCacheKind fileEncoding = "br" } else if ctx.Request.Header.HasAcceptEncodingBytes(strGzip) { mustCompress = true - fileCache = h.cacheGzip + fileCacheKind = gzipCacheKind fileEncoding = "gzip" } } - h.cacheLock.Lock() - ff, ok := fileCache[string(path)] - if ok { - ff.readersCount++ - } - h.cacheLock.Unlock() + pathStr := string(path) + ff, ok := h.cacheManager.GetFileFromCache(fileCacheKind, pathStr) if !ok { - pathStr := string(path) filePath := h.pathToFilePath(pathStr) var err error @@ -895,23 +1077,7 @@ func (h *fsHandler) handleRequest(ctx *RequestCtx) { return } - h.cacheLock.Lock() - ff1, ok := fileCache[pathStr] - if !ok { - fileCache[pathStr] = ff - ff.readersCount++ - } else { - ff1.readersCount++ - } - h.cacheLock.Unlock() - - if ok { - // The file has been already opened by another - // goroutine, so close the current file and use - // the file opened by another goroutine instead. - ff.Release() - ff = ff1 - } + ff = h.cacheManager.SetFileToCache(fileCacheKind, pathStr, ff) } if !ctx.IfModifiedSince(ff.lastModified) { @@ -1051,7 +1217,7 @@ func (h *fsHandler) openIndexFile(ctx *RequestCtx, dirPath string, mustCompress if err == nil { return ff, nil } - if !os.IsNotExist(err) { + if !errors.Is(err, fs.ErrNotExist) { return nil, fmt.Errorf("cannot open file %q: %w", indexFilePath, err) } } @@ -1060,7 +1226,7 @@ func (h *fsHandler) openIndexFile(ctx *RequestCtx, dirPath string, mustCompress return nil, fmt.Errorf("cannot access directory without index page. Directory %q", dirPath) } - return h.createDirIndex(ctx.URI(), dirPath, mustCompress, fileEncoding) + return h.createDirIndex(ctx, dirPath, mustCompress, fileEncoding) } var ( @@ -1068,9 +1234,11 @@ var ( errNoCreatePermission = errors.New("no 'create file' permissions") ) -func (h *fsHandler) createDirIndex(base *URI, dirPath string, mustCompress bool, fileEncoding string) (*fsFile, error) { +func (h *fsHandler) createDirIndex(ctx *RequestCtx, dirPath string, mustCompress bool, fileEncoding string) (*fsFile, error) { w := &bytebufferpool.ByteBuffer{} + base := ctx.URI() + basePathEscaped := html.EscapeString(string(base.Path())) _, _ = fmt.Fprintf(w, "%s", basePathEscaped) _, _ = fmt.Fprintf(w, "

%s

", basePathEscaped) @@ -1084,28 +1252,29 @@ func (h *fsHandler) createDirIndex(base *URI, dirPath string, mustCompress bool, _, _ = fmt.Fprintf(w, `
  • ..
  • `, parentPathEscaped) } - f, err := os.Open(dirPath) + dirEntries, err := fs.ReadDir(h.filesystem, dirPath) if err != nil { return nil, err } - fileinfos, err := f.Readdir(0) - _ = f.Close() - if err != nil { - return nil, err - } - - fm := make(map[string]os.FileInfo, len(fileinfos)) - filenames := make([]string, 0, len(fileinfos)) + fm := make(map[string]fs.FileInfo, len(dirEntries)) + filenames := make([]string, 0, len(dirEntries)) nestedContinue: - for _, fi := range fileinfos { - name := fi.Name() + for _, de := range dirEntries { + name := de.Name() for _, cfs := range h.compressedFileSuffixes { if strings.HasSuffix(name, cfs) { // Do not show compressed files on index page. continue nestedContinue } } + fi, err := de.Info() + if err != nil { + ctx.Logger().Printf("cannot fetch information from dir entry %q: %v, skip", name, err) + + continue nestedContinue + } + fm[name] = fi filenames = append(filenames, name) } @@ -1163,7 +1332,7 @@ const ( ) func (h *fsHandler) compressAndOpenFSFile(filePath string, fileEncoding string) (*fsFile, error) { - f, err := os.Open(filePath) + f, err := h.filesystem.Open(filePath) if err != nil { return nil, err } @@ -1182,10 +1351,15 @@ func (h *fsHandler) compressAndOpenFSFile(filePath string, fileEncoding string) if strings.HasSuffix(filePath, h.compressedFileSuffixes[fileEncoding]) || fileInfo.Size() > fsMaxCompressibleFileSize || !isFileCompressible(f, fsMinCompressRatio) { - return h.newFSFile(f, fileInfo, false, "") + return h.newFSFile(f, fileInfo, false, filePath, "") } compressedFilePath := h.filePathToCompressed(filePath) + + if _, ok := h.filesystem.(*osFS); !ok { + return h.newCompressedFSFileCache(f, fileInfo, compressedFilePath, fileEncoding) + } + if compressedFilePath != filePath { if err := os.MkdirAll(filepath.Dir(compressedFilePath), os.ModePerm); err != nil { return nil, err @@ -1207,7 +1381,7 @@ func (h *fsHandler) compressAndOpenFSFile(filePath string, fileEncoding string) return ff, err } -func (h *fsHandler) compressFileNolock(f *os.File, fileInfo os.FileInfo, filePath, compressedFilePath string, fileEncoding string) (*fsFile, error) { +func (h *fsHandler) compressFileNolock(f fs.File, fileInfo fs.FileInfo, filePath, compressedFilePath string, fileEncoding string) (*fsFile, error) { // Attempt to open compressed file created by another concurrent // goroutine. // It is safe opening such a file, since the file creation @@ -1223,7 +1397,7 @@ func (h *fsHandler) compressFileNolock(f *os.File, fileInfo os.FileInfo, filePat zf, err := os.Create(tmpFilePath) if err != nil { _ = f.Close() - if !os.IsPermission(err) { + if !errors.Is(err, fs.ErrPermission) { return nil, fmt.Errorf("cannot create temporary file %q: %w", tmpFilePath, err) } return nil, errNoCreatePermission @@ -1258,8 +1432,71 @@ func (h *fsHandler) compressFileNolock(f *os.File, fileInfo os.FileInfo, filePat return h.newCompressedFSFile(compressedFilePath, fileEncoding) } +// newCompressedFSFileCache use memory cache compressed files +func (h *fsHandler) newCompressedFSFileCache(f fs.File, fileInfo fs.FileInfo, filePath, fileEncoding string) (*fsFile, error) { + var ( + w = &bytebufferpool.ByteBuffer{} + err error + ) + + if fileEncoding == "br" { + zw := acquireStacklessBrotliWriter(w, CompressDefaultCompression) + _, err = copyZeroAlloc(zw, f) + if err1 := zw.Flush(); err == nil { + err = err1 + } + releaseStacklessBrotliWriter(zw, CompressDefaultCompression) + } else if fileEncoding == "gzip" { + zw := acquireStacklessGzipWriter(w, CompressDefaultCompression) + _, err = copyZeroAlloc(zw, f) + if err1 := zw.Flush(); err == nil { + err = err1 + } + releaseStacklessGzipWriter(zw, CompressDefaultCompression) + } + defer func() { _ = f.Close() }() + + if err != nil { + return nil, fmt.Errorf("error when compressing file %q: %w", filePath, err) + } + + seeker, ok := f.(io.Seeker) + if !ok { + return nil, errors.New("not implemented io.Seeker") + } + if _, err = seeker.Seek(0, io.SeekStart); err != nil { + return nil, err + } + + ext := fileExtension(fileInfo.Name(), false, h.compressedFileSuffixes[fileEncoding]) + contentType := mime.TypeByExtension(ext) + if len(contentType) == 0 { + data, err := readFileHeader(f, false, fileEncoding) + if err != nil { + return nil, fmt.Errorf("cannot read header of the file %q: %w", fileInfo.Name(), err) + } + contentType = http.DetectContentType(data) + } + + dirIndex := w.B + lastModified := fileInfo.ModTime() + ff := &fsFile{ + h: h, + dirIndex: dirIndex, + contentType: contentType, + contentLength: len(dirIndex), + compressed: true, + lastModified: lastModified, + lastModifiedStr: AppendHTTPDate(nil, lastModified), + + t: time.Now(), + } + + return ff, nil +} + func (h *fsHandler) newCompressedFSFile(filePath string, fileEncoding string) (*fsFile, error) { - f, err := os.Open(filePath) + f, err := h.filesystem.Open(filePath) if err != nil { return nil, fmt.Errorf("cannot open compressed file %q: %w", filePath, err) } @@ -1268,7 +1505,7 @@ func (h *fsHandler) newCompressedFSFile(filePath string, fileEncoding string) (* _ = f.Close() return nil, fmt.Errorf("cannot obtain info for compressed file %q: %w", filePath, err) } - return h.newFSFile(f, fileInfo, true, fileEncoding) + return h.newFSFile(f, fileInfo, true, filePath, fileEncoding) } func (h *fsHandler) openFSFile(filePath string, mustCompress bool, fileEncoding string) (*fsFile, error) { @@ -1277,9 +1514,9 @@ func (h *fsHandler) openFSFile(filePath string, mustCompress bool, fileEncoding filePath += h.compressedFileSuffixes[fileEncoding] } - f, err := os.Open(filePath) + f, err := h.filesystem.Open(filePath) if err != nil { - if mustCompress && os.IsNotExist(err) { + if mustCompress && errors.Is(err, fs.ErrNotExist) { return h.compressAndOpenFSFile(filePathOriginal, fileEncoding) } return nil, err @@ -1301,7 +1538,7 @@ func (h *fsHandler) openFSFile(filePath string, mustCompress bool, fileEncoding } if mustCompress { - fileInfoOriginal, err := os.Stat(filePathOriginal) + fileInfoOriginal, err := fs.Stat(h.filesystem, filePathOriginal) if err != nil { _ = f.Close() return nil, fmt.Errorf("cannot obtain info for original file %q: %w", filePathOriginal, err) @@ -1318,10 +1555,10 @@ func (h *fsHandler) openFSFile(filePath string, mustCompress bool, fileEncoding } } - return h.newFSFile(f, fileInfo, mustCompress, fileEncoding) + return h.newFSFile(f, fileInfo, mustCompress, filePath, fileEncoding) } -func (h *fsHandler) newFSFile(f *os.File, fileInfo os.FileInfo, compressed bool, fileEncoding string) (*fsFile, error) { +func (h *fsHandler) newFSFile(f fs.File, fileInfo fs.FileInfo, compressed bool, filePath, fileEncoding string) (*fsFile, error) { n := fileInfo.Size() contentLength := int(n) if n != int64(contentLength) { @@ -1335,7 +1572,7 @@ func (h *fsHandler) newFSFile(f *os.File, fileInfo os.FileInfo, compressed bool, if len(contentType) == 0 { data, err := readFileHeader(f, compressed, fileEncoding) if err != nil { - return nil, fmt.Errorf("cannot read header of the file %q: %w", f.Name(), err) + return nil, fmt.Errorf("cannot read header of the file %q: %w", fileInfo.Name(), err) } contentType = http.DetectContentType(data) } @@ -1344,6 +1581,7 @@ func (h *fsHandler) newFSFile(f *os.File, fileInfo os.FileInfo, compressed bool, ff := &fsFile{ h: h, f: f, + filename: filePath, contentType: contentType, contentLength: contentLength, compressed: compressed, @@ -1355,8 +1593,8 @@ func (h *fsHandler) newFSFile(f *os.File, fileInfo os.FileInfo, compressed bool, return ff, nil } -func readFileHeader(f *os.File, compressed bool, fileEncoding string) ([]byte, error) { - r := io.Reader(f) +func readFileHeader(f io.Reader, compressed bool, fileEncoding string) ([]byte, error) { + r := f var ( br *brotli.Reader zr *gzip.Reader @@ -1381,7 +1619,11 @@ func readFileHeader(f *os.File, compressed bool, fileEncoding string) ([]byte, e N: 512, } data, err := io.ReadAll(lr) - if _, err := f.Seek(0, 0); err != nil { + seeker, ok := f.(io.Seeker) + if !ok { + return nil, errors.New("must implement io.Seeker") + } + if _, err := seeker.Seek(0, io.SeekStart); err != nil { return nil, err } @@ -1456,3 +1698,10 @@ func getFileLock(absPath string) *sync.Mutex { filelock := v.(*sync.Mutex) return filelock } + +var _ fs.FS = (*osFS)(nil) + +type osFS struct{} + +func (o *osFS) Open(name string) (fs.File, error) { return os.Open(name) } +func (o *osFS) Stat(name string) (fs.FileInfo, error) { return os.Stat(name) } diff --git a/vendor/github.com/valyala/fasthttp/header.go b/vendor/github.com/valyala/fasthttp/header.go index f6a0fb15..e295fb7f 100644 --- a/vendor/github.com/valyala/fasthttp/header.go +++ b/vendor/github.com/valyala/fasthttp/header.go @@ -1025,6 +1025,7 @@ func (h *RequestHeader) SetNoDefaultContentType(noDefaultContentType bool) { // Reset clears request header. func (h *RequestHeader) Reset() { + h.disableSpecialHeader = false h.disableNormalizing = false h.SetNoDefaultContentType(false) h.resetSkipNormalize() diff --git a/vendor/github.com/valyala/fasthttp/http.go b/vendor/github.com/valyala/fasthttp/http.go index 0a5b446e..2dd90610 100644 --- a/vendor/github.com/valyala/fasthttp/http.go +++ b/vendor/github.com/valyala/fasthttp/http.go @@ -71,6 +71,12 @@ type Request struct { // Use Host header (request.Header.SetHost) instead of the host from SetRequestURI, SetHost, or URI().SetHost UseHostHeader bool + + // DisableRedirectPathNormalizing disables redirect path normalization when used with DoRedirects. + // + // By default redirect path values are normalized, i.e. + // extra slashes are removed, special characters are encoded. + DisableRedirectPathNormalizing bool } // Response represents HTTP response. @@ -1080,6 +1086,7 @@ func (req *Request) Reset() { req.resetSkipHeader() req.timeout = 0 req.UseHostHeader = false + req.DisableRedirectPathNormalizing = false } func (req *Request) resetSkipHeader() { diff --git a/vendor/github.com/valyala/fasthttp/reuseport/reuseport.go b/vendor/github.com/valyala/fasthttp/reuseport/reuseport.go index 6e13acbd..8ad9b06c 100644 --- a/vendor/github.com/valyala/fasthttp/reuseport/reuseport.go +++ b/vendor/github.com/valyala/fasthttp/reuseport/reuseport.go @@ -1,5 +1,4 @@ //go:build !windows && !aix -// +build !windows,!aix // Package reuseport provides TCP net.Listener with SO_REUSEPORT support. // diff --git a/vendor/github.com/valyala/fasthttp/round2_32.go b/vendor/github.com/valyala/fasthttp/round2_32.go index 2990e421..f7276fc1 100644 --- a/vendor/github.com/valyala/fasthttp/round2_32.go +++ b/vendor/github.com/valyala/fasthttp/round2_32.go @@ -1,5 +1,4 @@ //go:build !amd64 && !arm64 && !ppc64 && !ppc64le && !s390x -// +build !amd64,!arm64,!ppc64,!ppc64le,!s390x package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/round2_64.go b/vendor/github.com/valyala/fasthttp/round2_64.go index 8a8e2a23..e74368cc 100644 --- a/vendor/github.com/valyala/fasthttp/round2_64.go +++ b/vendor/github.com/valyala/fasthttp/round2_64.go @@ -1,5 +1,4 @@ //go:build amd64 || arm64 || ppc64 || ppc64le || s390x -// +build amd64 arm64 ppc64 ppc64le s390x package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/s2b_new.go b/vendor/github.com/valyala/fasthttp/s2b_new.go index 45ec2dba..aedc448e 100644 --- a/vendor/github.com/valyala/fasthttp/s2b_new.go +++ b/vendor/github.com/valyala/fasthttp/s2b_new.go @@ -1,5 +1,4 @@ //go:build go1.20 -// +build go1.20 package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/s2b_old.go b/vendor/github.com/valyala/fasthttp/s2b_old.go index d269cba7..50a034b8 100644 --- a/vendor/github.com/valyala/fasthttp/s2b_old.go +++ b/vendor/github.com/valyala/fasthttp/s2b_old.go @@ -1,5 +1,4 @@ //go:build !go1.20 -// +build !go1.20 package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/server.go b/vendor/github.com/valyala/fasthttp/server.go index 51dc2184..9cfc1753 100644 --- a/vendor/github.com/valyala/fasthttp/server.go +++ b/vendor/github.com/valyala/fasthttp/server.go @@ -2551,9 +2551,7 @@ func (c *hijackConn) Close() error { return nil } - conn := c.Conn - c.s.releaseHijackConn(c) - return conn.Close() + return c.Conn.Close() } // LastTimeoutErrorResponse returns the last timeout response set diff --git a/vendor/github.com/valyala/fasthttp/stackless/writer.go b/vendor/github.com/valyala/fasthttp/stackless/writer.go index b0d3e8dd..347e464a 100644 --- a/vendor/github.com/valyala/fasthttp/stackless/writer.go +++ b/vendor/github.com/valyala/fasthttp/stackless/writer.go @@ -4,6 +4,7 @@ import ( "errors" "fmt" "io" + "sync" "github.com/valyala/bytebufferpool" ) @@ -98,7 +99,17 @@ func (w *writer) do(op op) error { var errHighLoad = errors.New("cannot compress data due to high load") -var stacklessWriterFunc = NewFunc(writerFunc) +var ( + stacklessWriterFuncOnce sync.Once + stacklessWriterFuncFunc func(ctx interface{}) bool +) + +func stacklessWriterFunc(ctx interface{}) bool { + stacklessWriterFuncOnce.Do(func() { + stacklessWriterFuncFunc = NewFunc(writerFunc) + }) + return stacklessWriterFuncFunc(ctx) +} func writerFunc(ctx interface{}) { w := ctx.(*writer) diff --git a/vendor/github.com/valyala/fasthttp/tcp.go b/vendor/github.com/valyala/fasthttp/tcp.go index 54d30334..7e804374 100644 --- a/vendor/github.com/valyala/fasthttp/tcp.go +++ b/vendor/github.com/valyala/fasthttp/tcp.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/tcp_windows.go b/vendor/github.com/valyala/fasthttp/tcp_windows.go index 5c33025f..d71950b9 100644 --- a/vendor/github.com/valyala/fasthttp/tcp_windows.go +++ b/vendor/github.com/valyala/fasthttp/tcp_windows.go @@ -1,6 +1,3 @@ -//go:build windows -// +build windows - package fasthttp import ( diff --git a/vendor/github.com/valyala/fasthttp/testdata/test.png b/vendor/github.com/valyala/fasthttp/testdata/test.png new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/vendor/github.com/valyala/fasthttp/testdata/test.png @@ -0,0 +1 @@ + diff --git a/vendor/github.com/valyala/fasthttp/uri_unix.go b/vendor/github.com/valyala/fasthttp/uri_unix.go index c2ac8fa4..1226fc97 100644 --- a/vendor/github.com/valyala/fasthttp/uri_unix.go +++ b/vendor/github.com/valyala/fasthttp/uri_unix.go @@ -1,5 +1,4 @@ //go:build !windows -// +build !windows package fasthttp diff --git a/vendor/github.com/valyala/fasthttp/uri_windows.go b/vendor/github.com/valyala/fasthttp/uri_windows.go index 903fba76..46f4b07a 100644 --- a/vendor/github.com/valyala/fasthttp/uri_windows.go +++ b/vendor/github.com/valyala/fasthttp/uri_windows.go @@ -1,6 +1,3 @@ -//go:build windows -// +build windows - package fasthttp func addLeadingSlash(dst, src []byte) []byte { diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres/internal/v0/app/constants/constants.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres/internal/v0/app/constants/constants.go deleted file mode 100644 index 34bcdb7b..00000000 --- a/vendor/gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres/internal/v0/app/constants/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -// модуль для хранения постоянных переменных, констант -package constants - -import ( - "time" - - "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections" -) - -// Layout - формат текстовой даты для загрузки из json -var Layout = "2006-01-02 15:04:05.999999999 Z0700 MST" - -// Loc - Системная локальная time zone -var Loc = time.Local - -// LocationUTC - time zone UTC -var LocationUTC, _ = time.LoadLocation("UTC") - -// Date1Test - дата начала загрузки из СТЕК при запуске тестов -var Date1Test = time.Date(2023, time.September, 01, 0, 0, 0, 0, LocationUTC) - -// Date2Test - дата окончания загрузки из СТЕК при запуске тестов -var Date2Test = time.Date(2023, time.September, 22, 23, 59, 59, 0, LocationUTC) - -//var Date2Test = carbon.Time2Carbon(Date1Test).EndOfMonth().EndOfDay().Carbon2Time() - -// SERVICE_NAME - название данного сервиса -var SERVICE_NAME = "stack_exchange" - -// CONNECTION_ID - ИД в БД Рапира в таблице connections -var CONNECTION_ID int64 = 3 //7 - -// BRANCH_ID - ИД в БД Рапира в таблице branches -var BRANCH_ID int64 = 2 //20954 - -// NEED_UPGRADE_TEST - надо ли обновлять записи в БД Рапира, при запуске тестов -const NEED_UPGRADE_TEST = true - -// CONNECTION - объект Соединение, настроенный -var CONNECTION = connections.Connection{ID: CONNECTION_ID, BranchID: BRANCH_ID, IsLegal: true} - -// CAMUNDA - -// CAMUNDA_JOBTYPE - имя задачи в CAMUNDA -var CAMUNDA_JOBTYPE = "stack_exchange" - -// CAMUNDA_ID - ИД сервиса в CAMUNDA -var CAMUNDA_ID = "BS012_100_006" - -// CAMUNDA_BPMNFILE - путь к файлу бизнес процесса .bpmn -// не нужен -var CAMUNDA_BPMNFILE = "" - -//var CAMUNDA_BPMNFILE = "bpmn/claim_process.bpmn" diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/functions/calc_struct_version/calc_struct_version.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/calc_struct_version/calc_struct_version.go similarity index 100% rename from vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/functions/calc_struct_version/calc_struct_version.go rename to vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/calc_struct_version/calc_struct_version.go diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants/constants.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants/constants.go new file mode 100644 index 00000000..aa949388 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants/constants.go @@ -0,0 +1,20 @@ +package constants + +import ( + "errors" +) + +// CONNECTION_ID_TEST - Connection ID для тестов +const CONNECTION_ID_TEST = 3 + +// TIMEOUT_DB_SECONDS - время ожидания в секундах +const TIMEOUT_DB_SECONDS = 30 + +// TEXT_RECORD_NOT_FOUND - текст ошибки, если нет записи +const TEXT_RECORD_NOT_FOUND = "record not found" + +// TextCrudIsNotInit - текст ошибки, если не инициализирован crud +const TextCrudIsNotInit = "Need initializate crud with InitCrudTransport_NRPC() function at first." + +// ErrorCrudIsNotInit - ошибка, если не инициализирован crud +var ErrorCrudIsNotInit error = errors.New(TextCrudIsNotInit) diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/tables/table_connections/table_connections.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/tables/table_connections/table_connections.go new file mode 100644 index 00000000..55eb2e23 --- /dev/null +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/tables/table_connections/table_connections.go @@ -0,0 +1,16 @@ +package table_connections + +// Table_Connection - модель для таблицы connections: Подключения к БД СТЕКа. +type Table_Connection struct { + BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:null"` //Филиал (ИД) + DbName string `json:"db_name" gorm:"column:db_name;default:\"\""` //Имя таблицы + DbScheme string `json:"db_scheme" gorm:"column:db_scheme;default:\"\""` //Имя схемы + ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement:true"` //Уникальный технический идентификатор + IsLegal bool `json:"is_legal" gorm:"column:is_legal"` //Это соединение для юридических лиц + Login string `json:"login" gorm:"column:login;default:\"\""` //Логин + Name string `json:"name" gorm:"column:name;default:\"\""` //Наименование + Password string `json:"password" gorm:"column:password;default:\"\""` //Пароль + Port string `json:"port" gorm:"column:port;default:\"\""` //Номер порта + Server string `json:"server" gorm:"column:server;default:\"\""` //Имя сервера, или ip-адрес + +} diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections.go index df4681e5..c0c24dbe 100644 --- a/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections.go +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections.go @@ -1,18 +1,10 @@ package connections -import () +import ( + table_connections "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/tables/table_connections" +) -// Connection - модель для таблицы connections: Подключения к БД СТЕКа. +// Connection type Connection struct { - BranchID int64 `json:"branch_id" gorm:"column:branch_id;default:0" db:"branch_id"` //Филиал (ИД) - DbName string `json:"db_name" gorm:"column:db_name;default:\"\"" db:"db_name"` //Имя таблицы - DbScheme string `json:"db_scheme" gorm:"column:db_scheme;default:\"\"" db:"db_scheme"` //Имя схемы - ID int64 `json:"id" gorm:"column:id;primaryKey;autoIncrement:true;default:0" db:"id"` //Уникальный технический идентификатор - IsLegal bool `json:"is_legal" gorm:"column:is_legal" db:"is_legal"` //Это соединение для юридических лиц - Login string `json:"login" gorm:"column:login;default:\"\"" db:"login"` //Логин - Name string `json:"name" gorm:"column:name;default:\"\"" db:"name"` //Наименование - Password string `json:"password" gorm:"column:password;default:\"\"" db:"password"` //Пароль - Port string `json:"port" gorm:"column:port;default:\"\"" db:"port"` //Номер порта - Server string `json:"server" gorm:"column:server;default:\"\"" db:"server"` //Имя сервера, или ip-адрес - + table_connections.Table_Connection } diff --git a/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections_crud.go b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections_crud.go index 4f811f4b..8b107ab8 100644 --- a/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections_crud.go +++ b/vendor/gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections/connections_crud.go @@ -1,12 +1,13 @@ -//File generated automatic with crud_generator app -//Do not change anything here. +//Файл создан автоматически кодогенератором crud_generator +//Не изменяйте ничего здесь. package connections import ( "encoding/json" "github.com/vmihailenco/msgpack/v5" - "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/functions/calc_struct_version" + "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/calc_struct_version" + "gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants" "reflect" ) @@ -16,6 +17,7 @@ var versionConnection uint32 // crud_Connection - объект контроллер crud операций var crud_Connection ICrud_Connection +// интерфейс стандартных CRUD операций, для использования в DB или GRPC или NRPC type ICrud_Connection interface { Read(*Connection) error Save(*Connection) error @@ -90,6 +92,10 @@ func (m Connection) GetJSON() (string, error) { // Read - находит запись в БД по ID, и заполняет в объект func (m *Connection) Read() error { + if crud_Connection == nil { + return constants.ErrorCrudIsNotInit + } + err := crud_Connection.Read(m) return err @@ -97,6 +103,10 @@ func (m *Connection) Read() error { // Save - записывает объект в БД по ID func (m *Connection) Save() error { + if crud_Connection == nil { + return constants.ErrorCrudIsNotInit + } + err := crud_Connection.Save(m) return err @@ -104,6 +114,10 @@ func (m *Connection) Save() error { // Update - обновляет объект в БД по ID func (m *Connection) Update() error { + if crud_Connection == nil { + return constants.ErrorCrudIsNotInit + } + err := crud_Connection.Update(m) return err @@ -111,6 +125,10 @@ func (m *Connection) Update() error { // Create - создаёт объект в БД с новым ID func (m *Connection) Create() error { + if crud_Connection == nil { + return constants.ErrorCrudIsNotInit + } + err := crud_Connection.Create(m) return err diff --git a/vendor/go.mau.fi/whatsmeow/appstate.go b/vendor/go.mau.fi/whatsmeow/appstate.go index 3c128db6..a1c9146c 100644 --- a/vendor/go.mau.fi/whatsmeow/appstate.go +++ b/vendor/go.mau.fi/whatsmeow/appstate.go @@ -223,6 +223,41 @@ func (cli *Client) dispatchAppState(mutation appstate.Mutation, fullSync bool, e Action: mutation.Action.GetUserStatusMuteAction(), FromFullSync: fullSync, } + case appstate.IndexLabelEdit: + act := mutation.Action.GetLabelEditAction() + eventToDispatch = &events.LabelEdit{ + Timestamp: ts, + LabelID: mutation.Index[1], + Action: act, + FromFullSync: fullSync, + } + case appstate.IndexLabelAssociationChat: + if len(mutation.Index) < 3 { + return + } + jid, _ = types.ParseJID(mutation.Index[2]) + act := mutation.Action.GetLabelAssociationAction() + eventToDispatch = &events.LabelAssociationChat{ + JID: jid, + Timestamp: ts, + LabelID: mutation.Index[1], + Action: act, + FromFullSync: fullSync, + } + case appstate.IndexLabelAssociationMessage: + if len(mutation.Index) < 6 { + return + } + jid, _ = types.ParseJID(mutation.Index[2]) + act := mutation.Action.GetLabelAssociationAction() + eventToDispatch = &events.LabelAssociationMessage{ + JID: jid, + Timestamp: ts, + LabelID: mutation.Index[1], + MessageID: mutation.Index[3], + Action: act, + FromFullSync: fullSync, + } } if storeUpdateError != nil { cli.Log.Errorf("Failed to update device store after app state mutation: %v", storeUpdateError) diff --git a/vendor/go.mau.fi/whatsmeow/appstate/encode.go b/vendor/go.mau.fi/whatsmeow/appstate/encode.go index 1cb7d659..2358c903 100644 --- a/vendor/go.mau.fi/whatsmeow/appstate/encode.go +++ b/vendor/go.mau.fi/whatsmeow/appstate/encode.go @@ -123,6 +123,96 @@ func BuildArchive(target types.JID, archive bool, lastMessageTimestamp time.Time return result } +func newLabelChatMutation(target types.JID, labelID string, labeled bool) MutationInfo { + return MutationInfo{ + Index: []string{IndexLabelAssociationChat, labelID, target.String()}, + Version: 3, + Value: &waProto.SyncActionValue{ + LabelAssociationAction: &waProto.LabelAssociationAction{ + Labeled: &labeled, + }, + }, + } +} + +// BuildLabelChat builds an app state patch for labeling or un(labeling) a chat. +func BuildLabelChat(target types.JID, labelID string, labeled bool) PatchInfo { + return PatchInfo{ + Type: WAPatchRegular, + Mutations: []MutationInfo{ + newLabelChatMutation(target, labelID, labeled), + }, + } +} + +func newLabelMessageMutation(target types.JID, labelID, messageID string, labeled bool) MutationInfo { + return MutationInfo{ + Index: []string{IndexLabelAssociationMessage, labelID, target.String(), messageID, "0", "0"}, + Version: 3, + Value: &waProto.SyncActionValue{ + LabelAssociationAction: &waProto.LabelAssociationAction{ + Labeled: &labeled, + }, + }, + } +} + +// BuildLabelMessage builds an app state patch for labeling or un(labeling) a message. +func BuildLabelMessage(target types.JID, labelID, messageID string, labeled bool) PatchInfo { + return PatchInfo{ + Type: WAPatchRegular, + Mutations: []MutationInfo{ + newLabelMessageMutation(target, labelID, messageID, labeled), + }, + } +} + +func newLabelEditMutation(labelID string, labelName string, labelColor int32, deleted bool) MutationInfo { + return MutationInfo{ + Index: []string{IndexLabelEdit, labelID}, + Version: 3, + Value: &waProto.SyncActionValue{ + LabelEditAction: &waProto.LabelEditAction{ + Name: &labelName, + Color: &labelColor, + Deleted: &deleted, + }, + }, + } +} + +// BuildLabelEdit builds an app state patch for editing a label. +func BuildLabelEdit(labelID string, labelName string, labelColor int32, deleted bool) PatchInfo { + return PatchInfo{ + Type: WAPatchRegular, + Mutations: []MutationInfo{ + newLabelEditMutation(labelID, labelName, labelColor, deleted), + }, + } +} + +func newSettingPushNameMutation(pushName string) MutationInfo { + return MutationInfo{ + Index: []string{IndexSettingPushName}, + Version: 1, + Value: &waProto.SyncActionValue{ + PushNameSetting: &waProto.PushNameSetting{ + Name: &pushName, + }, + }, + } +} + +// BuildSettingPushName builds an app state patch for setting the push name. +func BuildSettingPushName(pushName string) PatchInfo { + return PatchInfo{ + Type: WAPatchCriticalBlock, + Mutations: []MutationInfo{ + newSettingPushNameMutation(pushName), + }, + } +} + func (proc *Processor) EncodePatch(keyID []byte, state HashState, patchInfo PatchInfo) ([]byte, error) { keys, err := proc.getAppStateKey(keyID) if err != nil { diff --git a/vendor/go.mau.fi/whatsmeow/appstate/keys.go b/vendor/go.mau.fi/whatsmeow/appstate/keys.go index 95f7d134..98d38c2c 100644 --- a/vendor/go.mau.fi/whatsmeow/appstate/keys.go +++ b/vendor/go.mau.fi/whatsmeow/appstate/keys.go @@ -37,18 +37,21 @@ var AllPatchNames = [...]WAPatchName{WAPatchCriticalBlock, WAPatchCriticalUnbloc // Constants for the first part of app state indexes. const ( - IndexMute = "mute" - IndexPin = "pin_v1" - IndexArchive = "archive" - IndexContact = "contact" - IndexClearChat = "clearChat" - IndexDeleteChat = "deleteChat" - IndexStar = "star" - IndexDeleteMessageForMe = "deleteMessageForMe" - IndexMarkChatAsRead = "markChatAsRead" - IndexSettingPushName = "setting_pushName" - IndexSettingUnarchiveChats = "setting_unarchiveChats" - IndexUserStatusMute = "userStatusMute" + IndexMute = "mute" + IndexPin = "pin_v1" + IndexArchive = "archive" + IndexContact = "contact" + IndexClearChat = "clearChat" + IndexDeleteChat = "deleteChat" + IndexStar = "star" + IndexDeleteMessageForMe = "deleteMessageForMe" + IndexMarkChatAsRead = "markChatAsRead" + IndexSettingPushName = "setting_pushName" + IndexSettingUnarchiveChats = "setting_unarchiveChats" + IndexUserStatusMute = "userStatusMute" + IndexLabelEdit = "label_edit" + IndexLabelAssociationChat = "label_jid" + IndexLabelAssociationMessage = "label_message" ) type Processor struct { diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go index af565e28..271c3f10 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go +++ b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.go @@ -1839,6 +1839,65 @@ func (ContextInfo_AdReplyInfo_MediaType) EnumDescriptor() ([]byte, []int) { return file_binary_proto_def_proto_rawDescGZIP(), []int{47, 4, 0} } +type ForwardedNewsletterMessageInfo_ContentType int32 + +const ( + ForwardedNewsletterMessageInfo_UPDATE ForwardedNewsletterMessageInfo_ContentType = 1 + ForwardedNewsletterMessageInfo_UPDATE_CARD ForwardedNewsletterMessageInfo_ContentType = 2 + ForwardedNewsletterMessageInfo_LINK_CARD ForwardedNewsletterMessageInfo_ContentType = 3 +) + +// Enum value maps for ForwardedNewsletterMessageInfo_ContentType. +var ( + ForwardedNewsletterMessageInfo_ContentType_name = map[int32]string{ + 1: "UPDATE", + 2: "UPDATE_CARD", + 3: "LINK_CARD", + } + ForwardedNewsletterMessageInfo_ContentType_value = map[string]int32{ + "UPDATE": 1, + "UPDATE_CARD": 2, + "LINK_CARD": 3, + } +) + +func (x ForwardedNewsletterMessageInfo_ContentType) Enum() *ForwardedNewsletterMessageInfo_ContentType { + p := new(ForwardedNewsletterMessageInfo_ContentType) + *p = x + return p +} + +func (x ForwardedNewsletterMessageInfo_ContentType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (ForwardedNewsletterMessageInfo_ContentType) Descriptor() protoreflect.EnumDescriptor { + return file_binary_proto_def_proto_enumTypes[28].Descriptor() +} + +func (ForwardedNewsletterMessageInfo_ContentType) Type() protoreflect.EnumType { + return &file_binary_proto_def_proto_enumTypes[28] +} + +func (x ForwardedNewsletterMessageInfo_ContentType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *ForwardedNewsletterMessageInfo_ContentType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = ForwardedNewsletterMessageInfo_ContentType(num) + return nil +} + +// Deprecated: Use ForwardedNewsletterMessageInfo_ContentType.Descriptor instead. +func (ForwardedNewsletterMessageInfo_ContentType) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{48, 0} +} + type BotPluginMetadata_SearchProvider int32 const ( @@ -1869,11 +1928,11 @@ func (x BotPluginMetadata_SearchProvider) String() string { } func (BotPluginMetadata_SearchProvider) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[28].Descriptor() + return file_binary_proto_def_proto_enumTypes[29].Descriptor() } func (BotPluginMetadata_SearchProvider) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[28] + return &file_binary_proto_def_proto_enumTypes[29] } func (x BotPluginMetadata_SearchProvider) Number() protoreflect.EnumNumber { @@ -1892,7 +1951,7 @@ func (x *BotPluginMetadata_SearchProvider) UnmarshalJSON(b []byte) error { // Deprecated: Use BotPluginMetadata_SearchProvider.Descriptor instead. func (BotPluginMetadata_SearchProvider) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{49, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{50, 0} } type BotPluginMetadata_PluginType int32 @@ -1925,11 +1984,11 @@ func (x BotPluginMetadata_PluginType) String() string { } func (BotPluginMetadata_PluginType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[29].Descriptor() + return file_binary_proto_def_proto_enumTypes[30].Descriptor() } func (BotPluginMetadata_PluginType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[29] + return &file_binary_proto_def_proto_enumTypes[30] } func (x BotPluginMetadata_PluginType) Number() protoreflect.EnumNumber { @@ -1948,7 +2007,7 @@ func (x *BotPluginMetadata_PluginType) UnmarshalJSON(b []byte) error { // Deprecated: Use BotPluginMetadata_PluginType.Descriptor instead. func (BotPluginMetadata_PluginType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{49, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{50, 1} } type PaymentBackground_Type int32 @@ -1981,11 +2040,11 @@ func (x PaymentBackground_Type) String() string { } func (PaymentBackground_Type) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[30].Descriptor() + return file_binary_proto_def_proto_enumTypes[31].Descriptor() } func (PaymentBackground_Type) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[30] + return &file_binary_proto_def_proto_enumTypes[31] } func (x PaymentBackground_Type) Number() protoreflect.EnumNumber { @@ -2004,7 +2063,7 @@ func (x *PaymentBackground_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentBackground_Type.Descriptor instead. func (PaymentBackground_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{55, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{56, 0} } type VideoMessage_Attribution int32 @@ -2040,11 +2099,11 @@ func (x VideoMessage_Attribution) String() string { } func (VideoMessage_Attribution) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[31].Descriptor() + return file_binary_proto_def_proto_enumTypes[32].Descriptor() } func (VideoMessage_Attribution) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[31] + return &file_binary_proto_def_proto_enumTypes[32] } func (x VideoMessage_Attribution) Number() protoreflect.EnumNumber { @@ -2063,7 +2122,7 @@ func (x *VideoMessage_Attribution) UnmarshalJSON(b []byte) error { // Deprecated: Use VideoMessage_Attribution.Descriptor instead. func (VideoMessage_Attribution) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{60, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{61, 0} } type ScheduledCallEditMessage_EditType int32 @@ -2096,11 +2155,11 @@ func (x ScheduledCallEditMessage_EditType) String() string { } func (ScheduledCallEditMessage_EditType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[32].Descriptor() + return file_binary_proto_def_proto_enumTypes[33].Descriptor() } func (ScheduledCallEditMessage_EditType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[32] + return &file_binary_proto_def_proto_enumTypes[33] } func (x ScheduledCallEditMessage_EditType) Number() protoreflect.EnumNumber { @@ -2119,7 +2178,7 @@ func (x *ScheduledCallEditMessage_EditType) UnmarshalJSON(b []byte) error { // Deprecated: Use ScheduledCallEditMessage_EditType.Descriptor instead. func (ScheduledCallEditMessage_EditType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{67, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{68, 0} } type ScheduledCallCreationMessage_CallType int32 @@ -2155,11 +2214,11 @@ func (x ScheduledCallCreationMessage_CallType) String() string { } func (ScheduledCallCreationMessage_CallType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[33].Descriptor() + return file_binary_proto_def_proto_enumTypes[34].Descriptor() } func (ScheduledCallCreationMessage_CallType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[33] + return &file_binary_proto_def_proto_enumTypes[34] } func (x ScheduledCallCreationMessage_CallType) Number() protoreflect.EnumNumber { @@ -2178,7 +2237,7 @@ func (x *ScheduledCallCreationMessage_CallType) UnmarshalJSON(b []byte) error { // Deprecated: Use ScheduledCallCreationMessage_CallType.Descriptor instead. func (ScheduledCallCreationMessage_CallType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{68, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{69, 0} } type RequestWelcomeMessageMetadata_LocalChatState int32 @@ -2211,11 +2270,11 @@ func (x RequestWelcomeMessageMetadata_LocalChatState) String() string { } func (RequestWelcomeMessageMetadata_LocalChatState) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[34].Descriptor() + return file_binary_proto_def_proto_enumTypes[35].Descriptor() } func (RequestWelcomeMessageMetadata_LocalChatState) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[34] + return &file_binary_proto_def_proto_enumTypes[35] } func (x RequestWelcomeMessageMetadata_LocalChatState) Number() protoreflect.EnumNumber { @@ -2234,7 +2293,7 @@ func (x *RequestWelcomeMessageMetadata_LocalChatState) UnmarshalJSON(b []byte) e // Deprecated: Use RequestWelcomeMessageMetadata_LocalChatState.Descriptor instead. func (RequestWelcomeMessageMetadata_LocalChatState) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{69, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{70, 0} } type ProtocolMessage_Type int32 @@ -2306,11 +2365,11 @@ func (x ProtocolMessage_Type) String() string { } func (ProtocolMessage_Type) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[35].Descriptor() + return file_binary_proto_def_proto_enumTypes[36].Descriptor() } func (ProtocolMessage_Type) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[35] + return &file_binary_proto_def_proto_enumTypes[36] } func (x ProtocolMessage_Type) Number() protoreflect.EnumNumber { @@ -2329,7 +2388,7 @@ func (x *ProtocolMessage_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use ProtocolMessage_Type.Descriptor instead. func (ProtocolMessage_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{73, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{74, 0} } type PinInChatMessage_Type int32 @@ -2365,11 +2424,11 @@ func (x PinInChatMessage_Type) String() string { } func (PinInChatMessage_Type) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[36].Descriptor() + return file_binary_proto_def_proto_enumTypes[37].Descriptor() } func (PinInChatMessage_Type) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[36] + return &file_binary_proto_def_proto_enumTypes[37] } func (x PinInChatMessage_Type) Number() protoreflect.EnumNumber { @@ -2388,7 +2447,7 @@ func (x *PinInChatMessage_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use PinInChatMessage_Type.Descriptor instead. func (PinInChatMessage_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{80, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{81, 0} } type PaymentInviteMessage_ServiceType int32 @@ -2427,11 +2486,11 @@ func (x PaymentInviteMessage_ServiceType) String() string { } func (PaymentInviteMessage_ServiceType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[37].Descriptor() + return file_binary_proto_def_proto_enumTypes[38].Descriptor() } func (PaymentInviteMessage_ServiceType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[37] + return &file_binary_proto_def_proto_enumTypes[38] } func (x PaymentInviteMessage_ServiceType) Number() protoreflect.EnumNumber { @@ -2450,7 +2509,7 @@ func (x *PaymentInviteMessage_ServiceType) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentInviteMessage_ServiceType.Descriptor instead. func (PaymentInviteMessage_ServiceType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{83, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{84, 0} } type OrderMessage_OrderSurface int32 @@ -2480,11 +2539,11 @@ func (x OrderMessage_OrderSurface) String() string { } func (OrderMessage_OrderSurface) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[38].Descriptor() + return file_binary_proto_def_proto_enumTypes[39].Descriptor() } func (OrderMessage_OrderSurface) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[38] + return &file_binary_proto_def_proto_enumTypes[39] } func (x OrderMessage_OrderSurface) Number() protoreflect.EnumNumber { @@ -2503,7 +2562,7 @@ func (x *OrderMessage_OrderSurface) UnmarshalJSON(b []byte) error { // Deprecated: Use OrderMessage_OrderSurface.Descriptor instead. func (OrderMessage_OrderSurface) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{84, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{85, 0} } type OrderMessage_OrderStatus int32 @@ -2539,11 +2598,11 @@ func (x OrderMessage_OrderStatus) String() string { } func (OrderMessage_OrderStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[39].Descriptor() + return file_binary_proto_def_proto_enumTypes[40].Descriptor() } func (OrderMessage_OrderStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[39] + return &file_binary_proto_def_proto_enumTypes[40] } func (x OrderMessage_OrderStatus) Number() protoreflect.EnumNumber { @@ -2562,7 +2621,7 @@ func (x *OrderMessage_OrderStatus) UnmarshalJSON(b []byte) error { // Deprecated: Use OrderMessage_OrderStatus.Descriptor instead. func (OrderMessage_OrderStatus) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{84, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{85, 1} } type ListResponseMessage_ListType int32 @@ -2595,11 +2654,11 @@ func (x ListResponseMessage_ListType) String() string { } func (ListResponseMessage_ListType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[40].Descriptor() + return file_binary_proto_def_proto_enumTypes[41].Descriptor() } func (ListResponseMessage_ListType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[40] + return &file_binary_proto_def_proto_enumTypes[41] } func (x ListResponseMessage_ListType) Number() protoreflect.EnumNumber { @@ -2618,7 +2677,7 @@ func (x *ListResponseMessage_ListType) UnmarshalJSON(b []byte) error { // Deprecated: Use ListResponseMessage_ListType.Descriptor instead. func (ListResponseMessage_ListType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{89, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 0} } type ListMessage_ListType int32 @@ -2654,11 +2713,11 @@ func (x ListMessage_ListType) String() string { } func (ListMessage_ListType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[41].Descriptor() + return file_binary_proto_def_proto_enumTypes[42].Descriptor() } func (ListMessage_ListType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[41] + return &file_binary_proto_def_proto_enumTypes[42] } func (x ListMessage_ListType) Number() protoreflect.EnumNumber { @@ -2677,7 +2736,7 @@ func (x *ListMessage_ListType) UnmarshalJSON(b []byte) error { // Deprecated: Use ListMessage_ListType.Descriptor instead. func (ListMessage_ListType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 0} } type InvoiceMessage_AttachmentType int32 @@ -2710,11 +2769,11 @@ func (x InvoiceMessage_AttachmentType) String() string { } func (InvoiceMessage_AttachmentType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[42].Descriptor() + return file_binary_proto_def_proto_enumTypes[43].Descriptor() } func (InvoiceMessage_AttachmentType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[42] + return &file_binary_proto_def_proto_enumTypes[43] } func (x InvoiceMessage_AttachmentType) Number() protoreflect.EnumNumber { @@ -2733,7 +2792,7 @@ func (x *InvoiceMessage_AttachmentType) UnmarshalJSON(b []byte) error { // Deprecated: Use InvoiceMessage_AttachmentType.Descriptor instead. func (InvoiceMessage_AttachmentType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{92, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{93, 0} } type InteractiveResponseMessage_Body_Format int32 @@ -2766,11 +2825,11 @@ func (x InteractiveResponseMessage_Body_Format) String() string { } func (InteractiveResponseMessage_Body_Format) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[43].Descriptor() + return file_binary_proto_def_proto_enumTypes[44].Descriptor() } func (InteractiveResponseMessage_Body_Format) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[43] + return &file_binary_proto_def_proto_enumTypes[44] } func (x InteractiveResponseMessage_Body_Format) Number() protoreflect.EnumNumber { @@ -2789,7 +2848,7 @@ func (x *InteractiveResponseMessage_Body_Format) UnmarshalJSON(b []byte) error { // Deprecated: Use InteractiveResponseMessage_Body_Format.Descriptor instead. func (InteractiveResponseMessage_Body_Format) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{93, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{94, 1, 0} } type PastParticipant_LeaveReason int32 @@ -2822,11 +2881,11 @@ func (x PastParticipant_LeaveReason) String() string { } func (PastParticipant_LeaveReason) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[44].Descriptor() + return file_binary_proto_def_proto_enumTypes[45].Descriptor() } func (PastParticipant_LeaveReason) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[44] + return &file_binary_proto_def_proto_enumTypes[45] } func (x PastParticipant_LeaveReason) Number() protoreflect.EnumNumber { @@ -2845,7 +2904,7 @@ func (x *PastParticipant_LeaveReason) UnmarshalJSON(b []byte) error { // Deprecated: Use PastParticipant_LeaveReason.Descriptor instead. func (PastParticipant_LeaveReason) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{99, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{101, 0} } type HistorySync_HistorySyncType int32 @@ -2893,11 +2952,11 @@ func (x HistorySync_HistorySyncType) String() string { } func (HistorySync_HistorySyncType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[45].Descriptor() + return file_binary_proto_def_proto_enumTypes[46].Descriptor() } func (HistorySync_HistorySyncType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[45] + return &file_binary_proto_def_proto_enumTypes[46] } func (x HistorySync_HistorySyncType) Number() protoreflect.EnumNumber { @@ -2916,7 +2975,7 @@ func (x *HistorySync_HistorySyncType) UnmarshalJSON(b []byte) error { // Deprecated: Use HistorySync_HistorySyncType.Descriptor instead. func (HistorySync_HistorySyncType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{101, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{103, 0} } type HistorySync_BotAIWaitListState int32 @@ -2949,11 +3008,11 @@ func (x HistorySync_BotAIWaitListState) String() string { } func (HistorySync_BotAIWaitListState) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[46].Descriptor() + return file_binary_proto_def_proto_enumTypes[47].Descriptor() } func (HistorySync_BotAIWaitListState) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[46] + return &file_binary_proto_def_proto_enumTypes[47] } func (x HistorySync_BotAIWaitListState) Number() protoreflect.EnumNumber { @@ -2972,7 +3031,7 @@ func (x *HistorySync_BotAIWaitListState) UnmarshalJSON(b []byte) error { // Deprecated: Use HistorySync_BotAIWaitListState.Descriptor instead. func (HistorySync_BotAIWaitListState) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{101, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{103, 1} } type GroupParticipant_Rank int32 @@ -3008,11 +3067,11 @@ func (x GroupParticipant_Rank) String() string { } func (GroupParticipant_Rank) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[47].Descriptor() + return file_binary_proto_def_proto_enumTypes[48].Descriptor() } func (GroupParticipant_Rank) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[47] + return &file_binary_proto_def_proto_enumTypes[48] } func (x GroupParticipant_Rank) Number() protoreflect.EnumNumber { @@ -3031,7 +3090,7 @@ func (x *GroupParticipant_Rank) UnmarshalJSON(b []byte) error { // Deprecated: Use GroupParticipant_Rank.Descriptor instead. func (GroupParticipant_Rank) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{103, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{105, 0} } type Conversation_EndOfHistoryTransferType int32 @@ -3067,11 +3126,11 @@ func (x Conversation_EndOfHistoryTransferType) String() string { } func (Conversation_EndOfHistoryTransferType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[48].Descriptor() + return file_binary_proto_def_proto_enumTypes[49].Descriptor() } func (Conversation_EndOfHistoryTransferType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[48] + return &file_binary_proto_def_proto_enumTypes[49] } func (x Conversation_EndOfHistoryTransferType) Number() protoreflect.EnumNumber { @@ -3090,7 +3149,7 @@ func (x *Conversation_EndOfHistoryTransferType) UnmarshalJSON(b []byte) error { // Deprecated: Use Conversation_EndOfHistoryTransferType.Descriptor instead. func (Conversation_EndOfHistoryTransferType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{105, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{107, 0} } type MediaRetryNotification_ResultType int32 @@ -3129,11 +3188,11 @@ func (x MediaRetryNotification_ResultType) String() string { } func (MediaRetryNotification_ResultType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[49].Descriptor() + return file_binary_proto_def_proto_enumTypes[50].Descriptor() } func (MediaRetryNotification_ResultType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[49] + return &file_binary_proto_def_proto_enumTypes[50] } func (x MediaRetryNotification_ResultType) Number() protoreflect.EnumNumber { @@ -3152,7 +3211,7 @@ func (x *MediaRetryNotification_ResultType) UnmarshalJSON(b []byte) error { // Deprecated: Use MediaRetryNotification_ResultType.Descriptor instead. func (MediaRetryNotification_ResultType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{109, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{111, 0} } type SyncdMutation_SyncdOperation int32 @@ -3185,11 +3244,11 @@ func (x SyncdMutation_SyncdOperation) String() string { } func (SyncdMutation_SyncdOperation) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[50].Descriptor() + return file_binary_proto_def_proto_enumTypes[51].Descriptor() } func (SyncdMutation_SyncdOperation) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[50] + return &file_binary_proto_def_proto_enumTypes[51] } func (x SyncdMutation_SyncdOperation) Number() protoreflect.EnumNumber { @@ -3208,7 +3267,7 @@ func (x *SyncdMutation_SyncdOperation) UnmarshalJSON(b []byte) error { // Deprecated: Use SyncdMutation_SyncdOperation.Descriptor instead. func (SyncdMutation_SyncdOperation) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{117, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{119, 0} } type StatusPrivacyAction_StatusDistributionMode int32 @@ -3244,11 +3303,11 @@ func (x StatusPrivacyAction_StatusDistributionMode) String() string { } func (StatusPrivacyAction_StatusDistributionMode) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[51].Descriptor() + return file_binary_proto_def_proto_enumTypes[52].Descriptor() } func (StatusPrivacyAction_StatusDistributionMode) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[51] + return &file_binary_proto_def_proto_enumTypes[52] } func (x StatusPrivacyAction_StatusDistributionMode) Number() protoreflect.EnumNumber { @@ -3267,7 +3326,7 @@ func (x *StatusPrivacyAction_StatusDistributionMode) UnmarshalJSON(b []byte) err // Deprecated: Use StatusPrivacyAction_StatusDistributionMode.Descriptor instead. func (StatusPrivacyAction_StatusDistributionMode) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{130, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{132, 0} } type MarketingMessageAction_MarketingMessagePrototypeType int32 @@ -3297,11 +3356,11 @@ func (x MarketingMessageAction_MarketingMessagePrototypeType) String() string { } func (MarketingMessageAction_MarketingMessagePrototypeType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[52].Descriptor() + return file_binary_proto_def_proto_enumTypes[53].Descriptor() } func (MarketingMessageAction_MarketingMessagePrototypeType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[52] + return &file_binary_proto_def_proto_enumTypes[53] } func (x MarketingMessageAction_MarketingMessagePrototypeType) Number() protoreflect.EnumNumber { @@ -3320,7 +3379,78 @@ func (x *MarketingMessageAction_MarketingMessagePrototypeType) UnmarshalJSON(b [ // Deprecated: Use MarketingMessageAction_MarketingMessagePrototypeType.Descriptor instead. func (MarketingMessageAction_MarketingMessagePrototypeType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{145, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{148, 0} +} + +type PatchDebugData_Platform int32 + +const ( + PatchDebugData_ANDROID PatchDebugData_Platform = 0 + PatchDebugData_SMBA PatchDebugData_Platform = 1 + PatchDebugData_IPHONE PatchDebugData_Platform = 2 + PatchDebugData_SMBI PatchDebugData_Platform = 3 + PatchDebugData_WEB PatchDebugData_Platform = 4 + PatchDebugData_UWP PatchDebugData_Platform = 5 + PatchDebugData_DARWIN PatchDebugData_Platform = 6 +) + +// Enum value maps for PatchDebugData_Platform. +var ( + PatchDebugData_Platform_name = map[int32]string{ + 0: "ANDROID", + 1: "SMBA", + 2: "IPHONE", + 3: "SMBI", + 4: "WEB", + 5: "UWP", + 6: "DARWIN", + } + PatchDebugData_Platform_value = map[string]int32{ + "ANDROID": 0, + "SMBA": 1, + "IPHONE": 2, + "SMBI": 3, + "WEB": 4, + "UWP": 5, + "DARWIN": 6, + } +) + +func (x PatchDebugData_Platform) Enum() *PatchDebugData_Platform { + p := new(PatchDebugData_Platform) + *p = x + return p +} + +func (x PatchDebugData_Platform) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PatchDebugData_Platform) Descriptor() protoreflect.EnumDescriptor { + return file_binary_proto_def_proto_enumTypes[54].Descriptor() +} + +func (PatchDebugData_Platform) Type() protoreflect.EnumType { + return &file_binary_proto_def_proto_enumTypes[54] +} + +func (x PatchDebugData_Platform) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *PatchDebugData_Platform) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = PatchDebugData_Platform(num) + return nil +} + +// Deprecated: Use PatchDebugData_Platform.Descriptor instead. +func (PatchDebugData_Platform) EnumDescriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{170, 0} } type CallLogRecord_SilenceReason int32 @@ -3359,11 +3489,11 @@ func (x CallLogRecord_SilenceReason) String() string { } func (CallLogRecord_SilenceReason) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[53].Descriptor() + return file_binary_proto_def_proto_enumTypes[55].Descriptor() } func (CallLogRecord_SilenceReason) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[53] + return &file_binary_proto_def_proto_enumTypes[55] } func (x CallLogRecord_SilenceReason) Number() protoreflect.EnumNumber { @@ -3382,7 +3512,7 @@ func (x *CallLogRecord_SilenceReason) UnmarshalJSON(b []byte) error { // Deprecated: Use CallLogRecord_SilenceReason.Descriptor instead. func (CallLogRecord_SilenceReason) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 0} } type CallLogRecord_CallType int32 @@ -3418,11 +3548,11 @@ func (x CallLogRecord_CallType) String() string { } func (CallLogRecord_CallType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[54].Descriptor() + return file_binary_proto_def_proto_enumTypes[56].Descriptor() } func (CallLogRecord_CallType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[54] + return &file_binary_proto_def_proto_enumTypes[56] } func (x CallLogRecord_CallType) Number() protoreflect.EnumNumber { @@ -3441,7 +3571,7 @@ func (x *CallLogRecord_CallType) UnmarshalJSON(b []byte) error { // Deprecated: Use CallLogRecord_CallType.Descriptor instead. func (CallLogRecord_CallType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 1} } type CallLogRecord_CallResult int32 @@ -3501,11 +3631,11 @@ func (x CallLogRecord_CallResult) String() string { } func (CallLogRecord_CallResult) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[55].Descriptor() + return file_binary_proto_def_proto_enumTypes[57].Descriptor() } func (CallLogRecord_CallResult) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[55] + return &file_binary_proto_def_proto_enumTypes[57] } func (x CallLogRecord_CallResult) Number() protoreflect.EnumNumber { @@ -3524,7 +3654,7 @@ func (x *CallLogRecord_CallResult) UnmarshalJSON(b []byte) error { // Deprecated: Use CallLogRecord_CallResult.Descriptor instead. func (CallLogRecord_CallResult) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 2} } type BizIdentityInfo_VerifiedLevelValue int32 @@ -3560,11 +3690,11 @@ func (x BizIdentityInfo_VerifiedLevelValue) String() string { } func (BizIdentityInfo_VerifiedLevelValue) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[56].Descriptor() + return file_binary_proto_def_proto_enumTypes[58].Descriptor() } func (BizIdentityInfo_VerifiedLevelValue) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[56] + return &file_binary_proto_def_proto_enumTypes[58] } func (x BizIdentityInfo_VerifiedLevelValue) Number() protoreflect.EnumNumber { @@ -3583,7 +3713,7 @@ func (x *BizIdentityInfo_VerifiedLevelValue) UnmarshalJSON(b []byte) error { // Deprecated: Use BizIdentityInfo_VerifiedLevelValue.Descriptor instead. func (BizIdentityInfo_VerifiedLevelValue) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{174, 0} } type BizIdentityInfo_HostStorageType int32 @@ -3616,11 +3746,11 @@ func (x BizIdentityInfo_HostStorageType) String() string { } func (BizIdentityInfo_HostStorageType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[57].Descriptor() + return file_binary_proto_def_proto_enumTypes[59].Descriptor() } func (BizIdentityInfo_HostStorageType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[57] + return &file_binary_proto_def_proto_enumTypes[59] } func (x BizIdentityInfo_HostStorageType) Number() protoreflect.EnumNumber { @@ -3639,7 +3769,7 @@ func (x *BizIdentityInfo_HostStorageType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizIdentityInfo_HostStorageType.Descriptor instead. func (BizIdentityInfo_HostStorageType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{174, 1} } type BizIdentityInfo_ActualActorsType int32 @@ -3672,11 +3802,11 @@ func (x BizIdentityInfo_ActualActorsType) String() string { } func (BizIdentityInfo_ActualActorsType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[58].Descriptor() + return file_binary_proto_def_proto_enumTypes[60].Descriptor() } func (BizIdentityInfo_ActualActorsType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[58] + return &file_binary_proto_def_proto_enumTypes[60] } func (x BizIdentityInfo_ActualActorsType) Number() protoreflect.EnumNumber { @@ -3695,7 +3825,7 @@ func (x *BizIdentityInfo_ActualActorsType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizIdentityInfo_ActualActorsType.Descriptor instead. func (BizIdentityInfo_ActualActorsType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{174, 2} } type BizAccountLinkInfo_HostStorageType int32 @@ -3728,11 +3858,11 @@ func (x BizAccountLinkInfo_HostStorageType) String() string { } func (BizAccountLinkInfo_HostStorageType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[59].Descriptor() + return file_binary_proto_def_proto_enumTypes[61].Descriptor() } func (BizAccountLinkInfo_HostStorageType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[59] + return &file_binary_proto_def_proto_enumTypes[61] } func (x BizAccountLinkInfo_HostStorageType) Number() protoreflect.EnumNumber { @@ -3751,7 +3881,7 @@ func (x *BizAccountLinkInfo_HostStorageType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizAccountLinkInfo_HostStorageType.Descriptor instead. func (BizAccountLinkInfo_HostStorageType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{173, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{176, 0} } type BizAccountLinkInfo_AccountType int32 @@ -3781,11 +3911,11 @@ func (x BizAccountLinkInfo_AccountType) String() string { } func (BizAccountLinkInfo_AccountType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[60].Descriptor() + return file_binary_proto_def_proto_enumTypes[62].Descriptor() } func (BizAccountLinkInfo_AccountType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[60] + return &file_binary_proto_def_proto_enumTypes[62] } func (x BizAccountLinkInfo_AccountType) Number() protoreflect.EnumNumber { @@ -3804,7 +3934,7 @@ func (x *BizAccountLinkInfo_AccountType) UnmarshalJSON(b []byte) error { // Deprecated: Use BizAccountLinkInfo_AccountType.Descriptor instead. func (BizAccountLinkInfo_AccountType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{173, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{176, 1} } type ClientPayload_Product int32 @@ -3843,11 +3973,11 @@ func (x ClientPayload_Product) String() string { } func (ClientPayload_Product) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[61].Descriptor() + return file_binary_proto_def_proto_enumTypes[63].Descriptor() } func (ClientPayload_Product) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[61] + return &file_binary_proto_def_proto_enumTypes[63] } func (x ClientPayload_Product) Number() protoreflect.EnumNumber { @@ -3866,7 +3996,7 @@ func (x *ClientPayload_Product) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_Product.Descriptor instead. func (ClientPayload_Product) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 0} } type ClientPayload_IOSAppExtension int32 @@ -3902,11 +4032,11 @@ func (x ClientPayload_IOSAppExtension) String() string { } func (ClientPayload_IOSAppExtension) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[62].Descriptor() + return file_binary_proto_def_proto_enumTypes[64].Descriptor() } func (ClientPayload_IOSAppExtension) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[62] + return &file_binary_proto_def_proto_enumTypes[64] } func (x ClientPayload_IOSAppExtension) Number() protoreflect.EnumNumber { @@ -3925,7 +4055,7 @@ func (x *ClientPayload_IOSAppExtension) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_IOSAppExtension.Descriptor instead. func (ClientPayload_IOSAppExtension) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 1} } type ClientPayload_ConnectType int32 @@ -3997,11 +4127,11 @@ func (x ClientPayload_ConnectType) String() string { } func (ClientPayload_ConnectType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[63].Descriptor() + return file_binary_proto_def_proto_enumTypes[65].Descriptor() } func (ClientPayload_ConnectType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[63] + return &file_binary_proto_def_proto_enumTypes[65] } func (x ClientPayload_ConnectType) Number() protoreflect.EnumNumber { @@ -4020,7 +4150,7 @@ func (x *ClientPayload_ConnectType) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_ConnectType.Descriptor instead. func (ClientPayload_ConnectType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 2} } type ClientPayload_ConnectReason int32 @@ -4068,11 +4198,11 @@ func (x ClientPayload_ConnectReason) String() string { } func (ClientPayload_ConnectReason) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[64].Descriptor() + return file_binary_proto_def_proto_enumTypes[66].Descriptor() } func (ClientPayload_ConnectReason) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[64] + return &file_binary_proto_def_proto_enumTypes[66] } func (x ClientPayload_ConnectReason) Number() protoreflect.EnumNumber { @@ -4091,7 +4221,7 @@ func (x *ClientPayload_ConnectReason) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_ConnectReason.Descriptor instead. func (ClientPayload_ConnectReason) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 3} } type ClientPayload_WebInfo_WebSubPlatform int32 @@ -4133,11 +4263,11 @@ func (x ClientPayload_WebInfo_WebSubPlatform) String() string { } func (ClientPayload_WebInfo_WebSubPlatform) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[65].Descriptor() + return file_binary_proto_def_proto_enumTypes[67].Descriptor() } func (ClientPayload_WebInfo_WebSubPlatform) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[65] + return &file_binary_proto_def_proto_enumTypes[67] } func (x ClientPayload_WebInfo_WebSubPlatform) Number() protoreflect.EnumNumber { @@ -4156,7 +4286,7 @@ func (x *ClientPayload_WebInfo_WebSubPlatform) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_WebInfo_WebSubPlatform.Descriptor instead. func (ClientPayload_WebInfo_WebSubPlatform) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 0, 0} } type ClientPayload_UserAgent_ReleaseChannel int32 @@ -4195,11 +4325,11 @@ func (x ClientPayload_UserAgent_ReleaseChannel) String() string { } func (ClientPayload_UserAgent_ReleaseChannel) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[66].Descriptor() + return file_binary_proto_def_proto_enumTypes[68].Descriptor() } func (ClientPayload_UserAgent_ReleaseChannel) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[66] + return &file_binary_proto_def_proto_enumTypes[68] } func (x ClientPayload_UserAgent_ReleaseChannel) Number() protoreflect.EnumNumber { @@ -4218,7 +4348,7 @@ func (x *ClientPayload_UserAgent_ReleaseChannel) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_UserAgent_ReleaseChannel.Descriptor instead. func (ClientPayload_UserAgent_ReleaseChannel) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 1, 0} } type ClientPayload_UserAgent_Platform int32 @@ -4350,11 +4480,11 @@ func (x ClientPayload_UserAgent_Platform) String() string { } func (ClientPayload_UserAgent_Platform) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[67].Descriptor() + return file_binary_proto_def_proto_enumTypes[69].Descriptor() } func (ClientPayload_UserAgent_Platform) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[67] + return &file_binary_proto_def_proto_enumTypes[69] } func (x ClientPayload_UserAgent_Platform) Number() protoreflect.EnumNumber { @@ -4373,7 +4503,7 @@ func (x *ClientPayload_UserAgent_Platform) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_UserAgent_Platform.Descriptor instead. func (ClientPayload_UserAgent_Platform) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 1, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 1, 1} } type ClientPayload_UserAgent_DeviceType int32 @@ -4415,11 +4545,11 @@ func (x ClientPayload_UserAgent_DeviceType) String() string { } func (ClientPayload_UserAgent_DeviceType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[68].Descriptor() + return file_binary_proto_def_proto_enumTypes[70].Descriptor() } func (ClientPayload_UserAgent_DeviceType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[68] + return &file_binary_proto_def_proto_enumTypes[70] } func (x ClientPayload_UserAgent_DeviceType) Number() protoreflect.EnumNumber { @@ -4438,7 +4568,7 @@ func (x *ClientPayload_UserAgent_DeviceType) UnmarshalJSON(b []byte) error { // Deprecated: Use ClientPayload_UserAgent_DeviceType.Descriptor instead. func (ClientPayload_UserAgent_DeviceType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 1, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 1, 2} } type ClientPayload_DNSSource_DNSResolutionMethod int32 @@ -4480,11 +4610,11 @@ func (x ClientPayload_DNSSource_DNSResolutionMethod) String() string { } func (ClientPayload_DNSSource_DNSResolutionMethod) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[69].Descriptor() + return file_binary_proto_def_proto_enumTypes[71].Descriptor() } func (ClientPayload_DNSSource_DNSResolutionMethod) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[69] + return &file_binary_proto_def_proto_enumTypes[71] } func (x ClientPayload_DNSSource_DNSResolutionMethod) Number() protoreflect.EnumNumber { @@ -4503,7 +4633,7 @@ func (x *ClientPayload_DNSSource_DNSResolutionMethod) UnmarshalJSON(b []byte) er // Deprecated: Use ClientPayload_DNSSource_DNSResolutionMethod.Descriptor instead. func (ClientPayload_DNSSource_DNSResolutionMethod) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 4, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 4, 0} } type WebMessageInfo_StubType int32 @@ -4708,6 +4838,8 @@ const ( WebMessageInfo_SUPPORT_AI_EDUCATION WebMessageInfo_StubType = 196 WebMessageInfo_BIZ_BOT_3P_MESSAGING_ENABLED WebMessageInfo_StubType = 197 WebMessageInfo_REMINDER_SETUP_MESSAGE WebMessageInfo_StubType = 198 + WebMessageInfo_REMINDER_SENT_MESSAGE WebMessageInfo_StubType = 199 + WebMessageInfo_REMINDER_CANCEL_MESSAGE WebMessageInfo_StubType = 200 ) // Enum value maps for WebMessageInfo_StubType. @@ -4912,6 +5044,8 @@ var ( 196: "SUPPORT_AI_EDUCATION", 197: "BIZ_BOT_3P_MESSAGING_ENABLED", 198: "REMINDER_SETUP_MESSAGE", + 199: "REMINDER_SENT_MESSAGE", + 200: "REMINDER_CANCEL_MESSAGE", } WebMessageInfo_StubType_value = map[string]int32{ "UNKNOWN": 0, @@ -5113,6 +5247,8 @@ var ( "SUPPORT_AI_EDUCATION": 196, "BIZ_BOT_3P_MESSAGING_ENABLED": 197, "REMINDER_SETUP_MESSAGE": 198, + "REMINDER_SENT_MESSAGE": 199, + "REMINDER_CANCEL_MESSAGE": 200, } ) @@ -5127,11 +5263,11 @@ func (x WebMessageInfo_StubType) String() string { } func (WebMessageInfo_StubType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[70].Descriptor() + return file_binary_proto_def_proto_enumTypes[72].Descriptor() } func (WebMessageInfo_StubType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[70] + return &file_binary_proto_def_proto_enumTypes[72] } func (x WebMessageInfo_StubType) Number() protoreflect.EnumNumber { @@ -5150,7 +5286,7 @@ func (x *WebMessageInfo_StubType) UnmarshalJSON(b []byte) error { // Deprecated: Use WebMessageInfo_StubType.Descriptor instead. func (WebMessageInfo_StubType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{180, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{183, 0} } type WebMessageInfo_Status int32 @@ -5195,11 +5331,11 @@ func (x WebMessageInfo_Status) String() string { } func (WebMessageInfo_Status) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[71].Descriptor() + return file_binary_proto_def_proto_enumTypes[73].Descriptor() } func (WebMessageInfo_Status) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[71] + return &file_binary_proto_def_proto_enumTypes[73] } func (x WebMessageInfo_Status) Number() protoreflect.EnumNumber { @@ -5218,7 +5354,7 @@ func (x *WebMessageInfo_Status) UnmarshalJSON(b []byte) error { // Deprecated: Use WebMessageInfo_Status.Descriptor instead. func (WebMessageInfo_Status) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{180, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{183, 1} } type WebMessageInfo_BizPrivacyStatus int32 @@ -5257,11 +5393,11 @@ func (x WebMessageInfo_BizPrivacyStatus) String() string { } func (WebMessageInfo_BizPrivacyStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[72].Descriptor() + return file_binary_proto_def_proto_enumTypes[74].Descriptor() } func (WebMessageInfo_BizPrivacyStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[72] + return &file_binary_proto_def_proto_enumTypes[74] } func (x WebMessageInfo_BizPrivacyStatus) Number() protoreflect.EnumNumber { @@ -5280,7 +5416,7 @@ func (x *WebMessageInfo_BizPrivacyStatus) UnmarshalJSON(b []byte) error { // Deprecated: Use WebMessageInfo_BizPrivacyStatus.Descriptor instead. func (WebMessageInfo_BizPrivacyStatus) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{180, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{183, 2} } type WebFeatures_Flag int32 @@ -5319,11 +5455,11 @@ func (x WebFeatures_Flag) String() string { } func (WebFeatures_Flag) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[73].Descriptor() + return file_binary_proto_def_proto_enumTypes[75].Descriptor() } func (WebFeatures_Flag) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[73] + return &file_binary_proto_def_proto_enumTypes[75] } func (x WebFeatures_Flag) Number() protoreflect.EnumNumber { @@ -5342,7 +5478,7 @@ func (x *WebFeatures_Flag) UnmarshalJSON(b []byte) error { // Deprecated: Use WebFeatures_Flag.Descriptor instead. func (WebFeatures_Flag) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{184, 0} } type PinInChat_Type int32 @@ -5378,11 +5514,11 @@ func (x PinInChat_Type) String() string { } func (PinInChat_Type) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[74].Descriptor() + return file_binary_proto_def_proto_enumTypes[76].Descriptor() } func (PinInChat_Type) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[74] + return &file_binary_proto_def_proto_enumTypes[76] } func (x PinInChat_Type) Number() protoreflect.EnumNumber { @@ -5401,7 +5537,7 @@ func (x *PinInChat_Type) UnmarshalJSON(b []byte) error { // Deprecated: Use PinInChat_Type.Descriptor instead. func (PinInChat_Type) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{188, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{192, 0} } type PaymentInfo_TxnStatus int32 @@ -5524,11 +5660,11 @@ func (x PaymentInfo_TxnStatus) String() string { } func (PaymentInfo_TxnStatus) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[75].Descriptor() + return file_binary_proto_def_proto_enumTypes[77].Descriptor() } func (PaymentInfo_TxnStatus) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[75] + return &file_binary_proto_def_proto_enumTypes[77] } func (x PaymentInfo_TxnStatus) Number() protoreflect.EnumNumber { @@ -5547,7 +5683,7 @@ func (x *PaymentInfo_TxnStatus) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentInfo_TxnStatus.Descriptor instead. func (PaymentInfo_TxnStatus) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{190, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{194, 0} } type PaymentInfo_Status int32 @@ -5610,11 +5746,11 @@ func (x PaymentInfo_Status) String() string { } func (PaymentInfo_Status) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[76].Descriptor() + return file_binary_proto_def_proto_enumTypes[78].Descriptor() } func (PaymentInfo_Status) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[76] + return &file_binary_proto_def_proto_enumTypes[78] } func (x PaymentInfo_Status) Number() protoreflect.EnumNumber { @@ -5633,7 +5769,7 @@ func (x *PaymentInfo_Status) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentInfo_Status.Descriptor instead. func (PaymentInfo_Status) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{190, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{194, 1} } type PaymentInfo_Currency int32 @@ -5666,11 +5802,11 @@ func (x PaymentInfo_Currency) String() string { } func (PaymentInfo_Currency) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[77].Descriptor() + return file_binary_proto_def_proto_enumTypes[79].Descriptor() } func (PaymentInfo_Currency) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[77] + return &file_binary_proto_def_proto_enumTypes[79] } func (x PaymentInfo_Currency) Number() protoreflect.EnumNumber { @@ -5689,7 +5825,7 @@ func (x *PaymentInfo_Currency) UnmarshalJSON(b []byte) error { // Deprecated: Use PaymentInfo_Currency.Descriptor instead. func (PaymentInfo_Currency) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{190, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{194, 2} } type QP_FilterResult int32 @@ -5725,11 +5861,11 @@ func (x QP_FilterResult) String() string { } func (QP_FilterResult) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[78].Descriptor() + return file_binary_proto_def_proto_enumTypes[80].Descriptor() } func (QP_FilterResult) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[78] + return &file_binary_proto_def_proto_enumTypes[80] } func (x QP_FilterResult) Number() protoreflect.EnumNumber { @@ -5748,7 +5884,7 @@ func (x *QP_FilterResult) UnmarshalJSON(b []byte) error { // Deprecated: Use QP_FilterResult.Descriptor instead. func (QP_FilterResult) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{198, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{203, 0} } type QP_FilterClientNotSupportedConfig int32 @@ -5781,11 +5917,11 @@ func (x QP_FilterClientNotSupportedConfig) String() string { } func (QP_FilterClientNotSupportedConfig) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[79].Descriptor() + return file_binary_proto_def_proto_enumTypes[81].Descriptor() } func (QP_FilterClientNotSupportedConfig) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[79] + return &file_binary_proto_def_proto_enumTypes[81] } func (x QP_FilterClientNotSupportedConfig) Number() protoreflect.EnumNumber { @@ -5804,7 +5940,7 @@ func (x *QP_FilterClientNotSupportedConfig) UnmarshalJSON(b []byte) error { // Deprecated: Use QP_FilterClientNotSupportedConfig.Descriptor instead. func (QP_FilterClientNotSupportedConfig) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{198, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{203, 1} } type QP_ClauseType int32 @@ -5840,11 +5976,11 @@ func (x QP_ClauseType) String() string { } func (QP_ClauseType) Descriptor() protoreflect.EnumDescriptor { - return file_binary_proto_def_proto_enumTypes[80].Descriptor() + return file_binary_proto_def_proto_enumTypes[82].Descriptor() } func (QP_ClauseType) Type() protoreflect.EnumType { - return &file_binary_proto_def_proto_enumTypes[80] + return &file_binary_proto_def_proto_enumTypes[82] } func (x QP_ClauseType) Number() protoreflect.EnumNumber { @@ -5863,7 +5999,7 @@ func (x *QP_ClauseType) UnmarshalJSON(b []byte) error { // Deprecated: Use QP_ClauseType.Descriptor instead. func (QP_ClauseType) EnumDescriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{198, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{203, 2} } type ADVSignedKeyIndexList struct { @@ -6519,6 +6655,7 @@ type ImageMessage struct { ThumbnailSha256 []byte `protobuf:"bytes,27,opt,name=thumbnailSha256" json:"thumbnailSha256,omitempty"` ThumbnailEncSha256 []byte `protobuf:"bytes,28,opt,name=thumbnailEncSha256" json:"thumbnailEncSha256,omitempty"` StaticUrl *string `protobuf:"bytes,29,opt,name=staticUrl" json:"staticUrl,omitempty"` + Annotations []*InteractiveAnnotation `protobuf:"bytes,30,rep,name=annotations" json:"annotations,omitempty"` } func (x *ImageMessage) Reset() { @@ -6735,6 +6872,13 @@ func (x *ImageMessage) GetStaticUrl() string { return "" } +func (x *ImageMessage) GetAnnotations() []*InteractiveAnnotation { + if x != nil { + return x.Annotations + } + return nil +} + type HistorySyncNotification struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9451,7 +9595,8 @@ type InteractiveAnnotation struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - PolygonVertices []*Point `protobuf:"bytes,1,rep,name=polygonVertices" json:"polygonVertices,omitempty"` + PolygonVertices []*Point `protobuf:"bytes,1,rep,name=polygonVertices" json:"polygonVertices,omitempty"` + ShouldSkipConfirmation *bool `protobuf:"varint,4,opt,name=shouldSkipConfirmation" json:"shouldSkipConfirmation,omitempty"` // Types that are assignable to Action: // // *InteractiveAnnotation_Location @@ -9498,6 +9643,13 @@ func (x *InteractiveAnnotation) GetPolygonVertices() []*Point { return nil } +func (x *InteractiveAnnotation) GetShouldSkipConfirmation() bool { + if x != nil && x.ShouldSkipConfirmation != nil { + return *x.ShouldSkipConfirmation + } + return false +} + func (m *InteractiveAnnotation) GetAction() isInteractiveAnnotation_Action { if m != nil { return m.Action @@ -10175,9 +10327,11 @@ type ForwardedNewsletterMessageInfo struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - NewsletterJid *string `protobuf:"bytes,1,opt,name=newsletterJid" json:"newsletterJid,omitempty"` - ServerMessageId *int32 `protobuf:"varint,2,opt,name=serverMessageId" json:"serverMessageId,omitempty"` - NewsletterName *string `protobuf:"bytes,3,opt,name=newsletterName" json:"newsletterName,omitempty"` + NewsletterJid *string `protobuf:"bytes,1,opt,name=newsletterJid" json:"newsletterJid,omitempty"` + ServerMessageId *int32 `protobuf:"varint,2,opt,name=serverMessageId" json:"serverMessageId,omitempty"` + NewsletterName *string `protobuf:"bytes,3,opt,name=newsletterName" json:"newsletterName,omitempty"` + ContentType *ForwardedNewsletterMessageInfo_ContentType `protobuf:"varint,4,opt,name=contentType,enum=proto.ForwardedNewsletterMessageInfo_ContentType" json:"contentType,omitempty"` + AccessibilityText *string `protobuf:"bytes,5,opt,name=accessibilityText" json:"accessibilityText,omitempty"` } func (x *ForwardedNewsletterMessageInfo) Reset() { @@ -10233,6 +10387,75 @@ func (x *ForwardedNewsletterMessageInfo) GetNewsletterName() string { return "" } +func (x *ForwardedNewsletterMessageInfo) GetContentType() ForwardedNewsletterMessageInfo_ContentType { + if x != nil && x.ContentType != nil { + return *x.ContentType + } + return ForwardedNewsletterMessageInfo_UPDATE +} + +func (x *ForwardedNewsletterMessageInfo) GetAccessibilityText() string { + if x != nil && x.AccessibilityText != nil { + return *x.AccessibilityText + } + return "" +} + +type BotSuggestedPromptMetadata struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SuggestedPrompts []string `protobuf:"bytes,1,rep,name=suggestedPrompts" json:"suggestedPrompts,omitempty"` + SelectedPromptIndex *uint32 `protobuf:"varint,2,opt,name=selectedPromptIndex" json:"selectedPromptIndex,omitempty"` +} + +func (x *BotSuggestedPromptMetadata) Reset() { + *x = BotSuggestedPromptMetadata{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[49] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BotSuggestedPromptMetadata) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BotSuggestedPromptMetadata) ProtoMessage() {} + +func (x *BotSuggestedPromptMetadata) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[49] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use BotSuggestedPromptMetadata.ProtoReflect.Descriptor instead. +func (*BotSuggestedPromptMetadata) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{49} +} + +func (x *BotSuggestedPromptMetadata) GetSuggestedPrompts() []string { + if x != nil { + return x.SuggestedPrompts + } + return nil +} + +func (x *BotSuggestedPromptMetadata) GetSelectedPromptIndex() uint32 { + if x != nil && x.SelectedPromptIndex != nil { + return *x.SelectedPromptIndex + } + return 0 +} + type BotPluginMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -10249,7 +10472,7 @@ type BotPluginMetadata struct { func (x *BotPluginMetadata) Reset() { *x = BotPluginMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[49] + mi := &file_binary_proto_def_proto_msgTypes[50] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10262,7 +10485,7 @@ func (x *BotPluginMetadata) String() string { func (*BotPluginMetadata) ProtoMessage() {} func (x *BotPluginMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[49] + mi := &file_binary_proto_def_proto_msgTypes[50] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10275,7 +10498,7 @@ func (x *BotPluginMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use BotPluginMetadata.ProtoReflect.Descriptor instead. func (*BotPluginMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{49} + return file_binary_proto_def_proto_rawDescGZIP(), []int{50} } func (x *BotPluginMetadata) GetProvider() BotPluginMetadata_SearchProvider { @@ -10325,15 +10548,16 @@ type BotMetadata struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - AvatarMetadata *BotAvatarMetadata `protobuf:"bytes,1,opt,name=avatarMetadata" json:"avatarMetadata,omitempty"` - PersonaId *string `protobuf:"bytes,2,opt,name=personaId" json:"personaId,omitempty"` - PluginMetadata *BotPluginMetadata `protobuf:"bytes,3,opt,name=pluginMetadata" json:"pluginMetadata,omitempty"` + AvatarMetadata *BotAvatarMetadata `protobuf:"bytes,1,opt,name=avatarMetadata" json:"avatarMetadata,omitempty"` + PersonaId *string `protobuf:"bytes,2,opt,name=personaId" json:"personaId,omitempty"` + PluginMetadata *BotPluginMetadata `protobuf:"bytes,3,opt,name=pluginMetadata" json:"pluginMetadata,omitempty"` + SuggestedPromptMetadata *BotSuggestedPromptMetadata `protobuf:"bytes,4,opt,name=suggestedPromptMetadata" json:"suggestedPromptMetadata,omitempty"` } func (x *BotMetadata) Reset() { *x = BotMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[50] + mi := &file_binary_proto_def_proto_msgTypes[51] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10346,7 +10570,7 @@ func (x *BotMetadata) String() string { func (*BotMetadata) ProtoMessage() {} func (x *BotMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[50] + mi := &file_binary_proto_def_proto_msgTypes[51] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10359,7 +10583,7 @@ func (x *BotMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use BotMetadata.ProtoReflect.Descriptor instead. func (*BotMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{50} + return file_binary_proto_def_proto_rawDescGZIP(), []int{51} } func (x *BotMetadata) GetAvatarMetadata() *BotAvatarMetadata { @@ -10383,6 +10607,13 @@ func (x *BotMetadata) GetPluginMetadata() *BotPluginMetadata { return nil } +func (x *BotMetadata) GetSuggestedPromptMetadata() *BotSuggestedPromptMetadata { + if x != nil { + return x.SuggestedPromptMetadata + } + return nil +} + type BotAvatarMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -10398,7 +10629,7 @@ type BotAvatarMetadata struct { func (x *BotAvatarMetadata) Reset() { *x = BotAvatarMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[51] + mi := &file_binary_proto_def_proto_msgTypes[52] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10411,7 +10642,7 @@ func (x *BotAvatarMetadata) String() string { func (*BotAvatarMetadata) ProtoMessage() {} func (x *BotAvatarMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[51] + mi := &file_binary_proto_def_proto_msgTypes[52] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10424,7 +10655,7 @@ func (x *BotAvatarMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use BotAvatarMetadata.ProtoReflect.Descriptor instead. func (*BotAvatarMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{51} + return file_binary_proto_def_proto_rawDescGZIP(), []int{52} } func (x *BotAvatarMetadata) GetSentiment() uint32 { @@ -10474,7 +10705,7 @@ type ActionLink struct { func (x *ActionLink) Reset() { *x = ActionLink{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[52] + mi := &file_binary_proto_def_proto_msgTypes[53] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10487,7 +10718,7 @@ func (x *ActionLink) String() string { func (*ActionLink) ProtoMessage() {} func (x *ActionLink) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[52] + mi := &file_binary_proto_def_proto_msgTypes[53] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10500,7 +10731,7 @@ func (x *ActionLink) ProtoReflect() protoreflect.Message { // Deprecated: Use ActionLink.ProtoReflect.Descriptor instead. func (*ActionLink) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{52} + return file_binary_proto_def_proto_rawDescGZIP(), []int{53} } func (x *ActionLink) GetUrl() string { @@ -10534,7 +10765,7 @@ type TemplateButton struct { func (x *TemplateButton) Reset() { *x = TemplateButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[53] + mi := &file_binary_proto_def_proto_msgTypes[54] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10547,7 +10778,7 @@ func (x *TemplateButton) String() string { func (*TemplateButton) ProtoMessage() {} func (x *TemplateButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[53] + mi := &file_binary_proto_def_proto_msgTypes[54] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10560,7 +10791,7 @@ func (x *TemplateButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton.ProtoReflect.Descriptor instead. func (*TemplateButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{53} + return file_binary_proto_def_proto_rawDescGZIP(), []int{54} } func (x *TemplateButton) GetIndex() uint32 { @@ -10634,7 +10865,7 @@ type Point struct { func (x *Point) Reset() { *x = Point{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[54] + mi := &file_binary_proto_def_proto_msgTypes[55] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10647,7 +10878,7 @@ func (x *Point) String() string { func (*Point) ProtoMessage() {} func (x *Point) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[54] + mi := &file_binary_proto_def_proto_msgTypes[55] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10660,7 +10891,7 @@ func (x *Point) ProtoReflect() protoreflect.Message { // Deprecated: Use Point.ProtoReflect.Descriptor instead. func (*Point) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{54} + return file_binary_proto_def_proto_rawDescGZIP(), []int{55} } func (x *Point) GetXDeprecated() int32 { @@ -10711,7 +10942,7 @@ type PaymentBackground struct { func (x *PaymentBackground) Reset() { *x = PaymentBackground{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[55] + mi := &file_binary_proto_def_proto_msgTypes[56] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10724,7 +10955,7 @@ func (x *PaymentBackground) String() string { func (*PaymentBackground) ProtoMessage() {} func (x *PaymentBackground) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[55] + mi := &file_binary_proto_def_proto_msgTypes[56] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10737,7 +10968,7 @@ func (x *PaymentBackground) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentBackground.ProtoReflect.Descriptor instead. func (*PaymentBackground) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{55} + return file_binary_proto_def_proto_rawDescGZIP(), []int{56} } func (x *PaymentBackground) GetId() string { @@ -10823,7 +11054,7 @@ type Money struct { func (x *Money) Reset() { *x = Money{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[56] + mi := &file_binary_proto_def_proto_msgTypes[57] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10836,7 +11067,7 @@ func (x *Money) String() string { func (*Money) ProtoMessage() {} func (x *Money) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[56] + mi := &file_binary_proto_def_proto_msgTypes[57] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10849,7 +11080,7 @@ func (x *Money) ProtoReflect() protoreflect.Message { // Deprecated: Use Money.ProtoReflect.Descriptor instead. func (*Money) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{56} + return file_binary_proto_def_proto_rawDescGZIP(), []int{57} } func (x *Money) GetValue() int64 { @@ -10949,7 +11180,7 @@ type Message struct { func (x *Message) Reset() { *x = Message{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[57] + mi := &file_binary_proto_def_proto_msgTypes[58] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -10962,7 +11193,7 @@ func (x *Message) String() string { func (*Message) ProtoMessage() {} func (x *Message) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[57] + mi := &file_binary_proto_def_proto_msgTypes[58] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -10975,7 +11206,7 @@ func (x *Message) ProtoReflect() protoreflect.Message { // Deprecated: Use Message.ProtoReflect.Descriptor instead. func (*Message) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{57} + return file_binary_proto_def_proto_rawDescGZIP(), []int{58} } func (x *Message) GetConversation() string { @@ -11453,7 +11684,7 @@ type MessageSecretMessage struct { func (x *MessageSecretMessage) Reset() { *x = MessageSecretMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[58] + mi := &file_binary_proto_def_proto_msgTypes[59] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11466,7 +11697,7 @@ func (x *MessageSecretMessage) String() string { func (*MessageSecretMessage) ProtoMessage() {} func (x *MessageSecretMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[58] + mi := &file_binary_proto_def_proto_msgTypes[59] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11479,7 +11710,7 @@ func (x *MessageSecretMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageSecretMessage.ProtoReflect.Descriptor instead. func (*MessageSecretMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{58} + return file_binary_proto_def_proto_rawDescGZIP(), []int{59} } func (x *MessageSecretMessage) GetVersion() int32 { @@ -11521,7 +11752,7 @@ type MessageContextInfo struct { func (x *MessageContextInfo) Reset() { *x = MessageContextInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[59] + mi := &file_binary_proto_def_proto_msgTypes[60] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11534,7 +11765,7 @@ func (x *MessageContextInfo) String() string { func (*MessageContextInfo) ProtoMessage() {} func (x *MessageContextInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[59] + mi := &file_binary_proto_def_proto_msgTypes[60] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11547,7 +11778,7 @@ func (x *MessageContextInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageContextInfo.ProtoReflect.Descriptor instead. func (*MessageContextInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{59} + return file_binary_proto_def_proto_rawDescGZIP(), []int{60} } func (x *MessageContextInfo) GetDeviceListMetadata() *DeviceListMetadata { @@ -11634,12 +11865,13 @@ type VideoMessage struct { ThumbnailSha256 []byte `protobuf:"bytes,22,opt,name=thumbnailSha256" json:"thumbnailSha256,omitempty"` ThumbnailEncSha256 []byte `protobuf:"bytes,23,opt,name=thumbnailEncSha256" json:"thumbnailEncSha256,omitempty"` StaticUrl *string `protobuf:"bytes,24,opt,name=staticUrl" json:"staticUrl,omitempty"` + Annotations []*InteractiveAnnotation `protobuf:"bytes,25,rep,name=annotations" json:"annotations,omitempty"` } func (x *VideoMessage) Reset() { *x = VideoMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[60] + mi := &file_binary_proto_def_proto_msgTypes[61] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11652,7 +11884,7 @@ func (x *VideoMessage) String() string { func (*VideoMessage) ProtoMessage() {} func (x *VideoMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[60] + mi := &file_binary_proto_def_proto_msgTypes[61] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11665,7 +11897,7 @@ func (x *VideoMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use VideoMessage.ProtoReflect.Descriptor instead. func (*VideoMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{60} + return file_binary_proto_def_proto_rawDescGZIP(), []int{61} } func (x *VideoMessage) GetUrl() string { @@ -11829,6 +12061,13 @@ func (x *VideoMessage) GetStaticUrl() string { return "" } +func (x *VideoMessage) GetAnnotations() []*InteractiveAnnotation { + if x != nil { + return x.Annotations + } + return nil +} + type TemplateMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -11848,7 +12087,7 @@ type TemplateMessage struct { func (x *TemplateMessage) Reset() { *x = TemplateMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[61] + mi := &file_binary_proto_def_proto_msgTypes[62] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11861,7 +12100,7 @@ func (x *TemplateMessage) String() string { func (*TemplateMessage) ProtoMessage() {} func (x *TemplateMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[61] + mi := &file_binary_proto_def_proto_msgTypes[62] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11874,7 +12113,7 @@ func (x *TemplateMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateMessage.ProtoReflect.Descriptor instead. func (*TemplateMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{61} + return file_binary_proto_def_proto_rawDescGZIP(), []int{62} } func (x *TemplateMessage) GetContextInfo() *ContextInfo { @@ -11963,7 +12202,7 @@ type TemplateButtonReplyMessage struct { func (x *TemplateButtonReplyMessage) Reset() { *x = TemplateButtonReplyMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[62] + mi := &file_binary_proto_def_proto_msgTypes[63] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -11976,7 +12215,7 @@ func (x *TemplateButtonReplyMessage) String() string { func (*TemplateButtonReplyMessage) ProtoMessage() {} func (x *TemplateButtonReplyMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[62] + mi := &file_binary_proto_def_proto_msgTypes[63] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -11989,7 +12228,7 @@ func (x *TemplateButtonReplyMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButtonReplyMessage.ProtoReflect.Descriptor instead. func (*TemplateButtonReplyMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{62} + return file_binary_proto_def_proto_rawDescGZIP(), []int{63} } func (x *TemplateButtonReplyMessage) GetSelectedId() string { @@ -12040,7 +12279,7 @@ type StickerSyncRMRMessage struct { func (x *StickerSyncRMRMessage) Reset() { *x = StickerSyncRMRMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[63] + mi := &file_binary_proto_def_proto_msgTypes[64] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12053,7 +12292,7 @@ func (x *StickerSyncRMRMessage) String() string { func (*StickerSyncRMRMessage) ProtoMessage() {} func (x *StickerSyncRMRMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[63] + mi := &file_binary_proto_def_proto_msgTypes[64] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12066,7 +12305,7 @@ func (x *StickerSyncRMRMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerSyncRMRMessage.ProtoReflect.Descriptor instead. func (*StickerSyncRMRMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{63} + return file_binary_proto_def_proto_rawDescGZIP(), []int{64} } func (x *StickerSyncRMRMessage) GetFilehash() []string { @@ -12119,7 +12358,7 @@ type StickerMessage struct { func (x *StickerMessage) Reset() { *x = StickerMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[64] + mi := &file_binary_proto_def_proto_msgTypes[65] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12132,7 +12371,7 @@ func (x *StickerMessage) String() string { func (*StickerMessage) ProtoMessage() {} func (x *StickerMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[64] + mi := &file_binary_proto_def_proto_msgTypes[65] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12145,7 +12384,7 @@ func (x *StickerMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerMessage.ProtoReflect.Descriptor instead. func (*StickerMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{64} + return file_binary_proto_def_proto_rawDescGZIP(), []int{65} } func (x *StickerMessage) GetUrl() string { @@ -12293,7 +12532,7 @@ type SenderKeyDistributionMessage struct { func (x *SenderKeyDistributionMessage) Reset() { *x = SenderKeyDistributionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[65] + mi := &file_binary_proto_def_proto_msgTypes[66] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12306,7 +12545,7 @@ func (x *SenderKeyDistributionMessage) String() string { func (*SenderKeyDistributionMessage) ProtoMessage() {} func (x *SenderKeyDistributionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[65] + mi := &file_binary_proto_def_proto_msgTypes[66] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12319,7 +12558,7 @@ func (x *SenderKeyDistributionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SenderKeyDistributionMessage.ProtoReflect.Descriptor instead. func (*SenderKeyDistributionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{65} + return file_binary_proto_def_proto_rawDescGZIP(), []int{66} } func (x *SenderKeyDistributionMessage) GetGroupId() string { @@ -12349,7 +12588,7 @@ type SendPaymentMessage struct { func (x *SendPaymentMessage) Reset() { *x = SendPaymentMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[66] + mi := &file_binary_proto_def_proto_msgTypes[67] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12362,7 +12601,7 @@ func (x *SendPaymentMessage) String() string { func (*SendPaymentMessage) ProtoMessage() {} func (x *SendPaymentMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[66] + mi := &file_binary_proto_def_proto_msgTypes[67] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12375,7 +12614,7 @@ func (x *SendPaymentMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SendPaymentMessage.ProtoReflect.Descriptor instead. func (*SendPaymentMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{66} + return file_binary_proto_def_proto_rawDescGZIP(), []int{67} } func (x *SendPaymentMessage) GetNoteMessage() *Message { @@ -12411,7 +12650,7 @@ type ScheduledCallEditMessage struct { func (x *ScheduledCallEditMessage) Reset() { *x = ScheduledCallEditMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[67] + mi := &file_binary_proto_def_proto_msgTypes[68] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12424,7 +12663,7 @@ func (x *ScheduledCallEditMessage) String() string { func (*ScheduledCallEditMessage) ProtoMessage() {} func (x *ScheduledCallEditMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[67] + mi := &file_binary_proto_def_proto_msgTypes[68] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12437,7 +12676,7 @@ func (x *ScheduledCallEditMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ScheduledCallEditMessage.ProtoReflect.Descriptor instead. func (*ScheduledCallEditMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{67} + return file_binary_proto_def_proto_rawDescGZIP(), []int{68} } func (x *ScheduledCallEditMessage) GetKey() *MessageKey { @@ -12467,7 +12706,7 @@ type ScheduledCallCreationMessage struct { func (x *ScheduledCallCreationMessage) Reset() { *x = ScheduledCallCreationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[68] + mi := &file_binary_proto_def_proto_msgTypes[69] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12480,7 +12719,7 @@ func (x *ScheduledCallCreationMessage) String() string { func (*ScheduledCallCreationMessage) ProtoMessage() {} func (x *ScheduledCallCreationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[68] + mi := &file_binary_proto_def_proto_msgTypes[69] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12493,7 +12732,7 @@ func (x *ScheduledCallCreationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ScheduledCallCreationMessage.ProtoReflect.Descriptor instead. func (*ScheduledCallCreationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{68} + return file_binary_proto_def_proto_rawDescGZIP(), []int{69} } func (x *ScheduledCallCreationMessage) GetScheduledTimestampMs() int64 { @@ -12528,7 +12767,7 @@ type RequestWelcomeMessageMetadata struct { func (x *RequestWelcomeMessageMetadata) Reset() { *x = RequestWelcomeMessageMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[69] + mi := &file_binary_proto_def_proto_msgTypes[70] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12541,7 +12780,7 @@ func (x *RequestWelcomeMessageMetadata) String() string { func (*RequestWelcomeMessageMetadata) ProtoMessage() {} func (x *RequestWelcomeMessageMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[69] + mi := &file_binary_proto_def_proto_msgTypes[70] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12554,7 +12793,7 @@ func (x *RequestWelcomeMessageMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestWelcomeMessageMetadata.ProtoReflect.Descriptor instead. func (*RequestWelcomeMessageMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{69} + return file_binary_proto_def_proto_rawDescGZIP(), []int{70} } func (x *RequestWelcomeMessageMetadata) GetLocalChatState() RequestWelcomeMessageMetadata_LocalChatState { @@ -12575,7 +12814,7 @@ type RequestPhoneNumberMessage struct { func (x *RequestPhoneNumberMessage) Reset() { *x = RequestPhoneNumberMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[70] + mi := &file_binary_proto_def_proto_msgTypes[71] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12588,7 +12827,7 @@ func (x *RequestPhoneNumberMessage) String() string { func (*RequestPhoneNumberMessage) ProtoMessage() {} func (x *RequestPhoneNumberMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[70] + mi := &file_binary_proto_def_proto_msgTypes[71] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12601,7 +12840,7 @@ func (x *RequestPhoneNumberMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestPhoneNumberMessage.ProtoReflect.Descriptor instead. func (*RequestPhoneNumberMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{70} + return file_binary_proto_def_proto_rawDescGZIP(), []int{71} } func (x *RequestPhoneNumberMessage) GetContextInfo() *ContextInfo { @@ -12628,7 +12867,7 @@ type RequestPaymentMessage struct { func (x *RequestPaymentMessage) Reset() { *x = RequestPaymentMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[71] + mi := &file_binary_proto_def_proto_msgTypes[72] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12641,7 +12880,7 @@ func (x *RequestPaymentMessage) String() string { func (*RequestPaymentMessage) ProtoMessage() {} func (x *RequestPaymentMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[71] + mi := &file_binary_proto_def_proto_msgTypes[72] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12654,7 +12893,7 @@ func (x *RequestPaymentMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use RequestPaymentMessage.ProtoReflect.Descriptor instead. func (*RequestPaymentMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{71} + return file_binary_proto_def_proto_rawDescGZIP(), []int{72} } func (x *RequestPaymentMessage) GetNoteMessage() *Message { @@ -12720,7 +12959,7 @@ type ReactionMessage struct { func (x *ReactionMessage) Reset() { *x = ReactionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[72] + mi := &file_binary_proto_def_proto_msgTypes[73] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12733,7 +12972,7 @@ func (x *ReactionMessage) String() string { func (*ReactionMessage) ProtoMessage() {} func (x *ReactionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[72] + mi := &file_binary_proto_def_proto_msgTypes[73] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12746,7 +12985,7 @@ func (x *ReactionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ReactionMessage.ProtoReflect.Descriptor instead. func (*ReactionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{72} + return file_binary_proto_def_proto_rawDescGZIP(), []int{73} } func (x *ReactionMessage) GetKey() *MessageKey { @@ -12804,7 +13043,7 @@ type ProtocolMessage struct { func (x *ProtocolMessage) Reset() { *x = ProtocolMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[73] + mi := &file_binary_proto_def_proto_msgTypes[74] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12817,7 +13056,7 @@ func (x *ProtocolMessage) String() string { func (*ProtocolMessage) ProtoMessage() {} func (x *ProtocolMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[73] + mi := &file_binary_proto_def_proto_msgTypes[74] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12830,7 +13069,7 @@ func (x *ProtocolMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ProtocolMessage.ProtoReflect.Descriptor instead. func (*ProtocolMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{73} + return file_binary_proto_def_proto_rawDescGZIP(), []int{74} } func (x *ProtocolMessage) GetKey() *MessageKey { @@ -12968,7 +13207,7 @@ type ProductMessage struct { func (x *ProductMessage) Reset() { *x = ProductMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[74] + mi := &file_binary_proto_def_proto_msgTypes[75] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -12981,7 +13220,7 @@ func (x *ProductMessage) String() string { func (*ProductMessage) ProtoMessage() {} func (x *ProductMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[74] + mi := &file_binary_proto_def_proto_msgTypes[75] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -12994,7 +13233,7 @@ func (x *ProductMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductMessage.ProtoReflect.Descriptor instead. func (*ProductMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{74} + return file_binary_proto_def_proto_rawDescGZIP(), []int{75} } func (x *ProductMessage) GetProduct() *ProductMessage_ProductSnapshot { @@ -13050,7 +13289,7 @@ type PollVoteMessage struct { func (x *PollVoteMessage) Reset() { *x = PollVoteMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[75] + mi := &file_binary_proto_def_proto_msgTypes[76] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13063,7 +13302,7 @@ func (x *PollVoteMessage) String() string { func (*PollVoteMessage) ProtoMessage() {} func (x *PollVoteMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[75] + mi := &file_binary_proto_def_proto_msgTypes[76] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13076,7 +13315,7 @@ func (x *PollVoteMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PollVoteMessage.ProtoReflect.Descriptor instead. func (*PollVoteMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{75} + return file_binary_proto_def_proto_rawDescGZIP(), []int{76} } func (x *PollVoteMessage) GetSelectedOptions() [][]byte { @@ -13100,7 +13339,7 @@ type PollUpdateMessage struct { func (x *PollUpdateMessage) Reset() { *x = PollUpdateMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[76] + mi := &file_binary_proto_def_proto_msgTypes[77] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13113,7 +13352,7 @@ func (x *PollUpdateMessage) String() string { func (*PollUpdateMessage) ProtoMessage() {} func (x *PollUpdateMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[76] + mi := &file_binary_proto_def_proto_msgTypes[77] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13126,7 +13365,7 @@ func (x *PollUpdateMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PollUpdateMessage.ProtoReflect.Descriptor instead. func (*PollUpdateMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{76} + return file_binary_proto_def_proto_rawDescGZIP(), []int{77} } func (x *PollUpdateMessage) GetPollCreationMessageKey() *MessageKey { @@ -13166,7 +13405,7 @@ type PollUpdateMessageMetadata struct { func (x *PollUpdateMessageMetadata) Reset() { *x = PollUpdateMessageMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[77] + mi := &file_binary_proto_def_proto_msgTypes[78] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13179,7 +13418,7 @@ func (x *PollUpdateMessageMetadata) String() string { func (*PollUpdateMessageMetadata) ProtoMessage() {} func (x *PollUpdateMessageMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[77] + mi := &file_binary_proto_def_proto_msgTypes[78] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13192,7 +13431,7 @@ func (x *PollUpdateMessageMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use PollUpdateMessageMetadata.ProtoReflect.Descriptor instead. func (*PollUpdateMessageMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{77} + return file_binary_proto_def_proto_rawDescGZIP(), []int{78} } type PollEncValue struct { @@ -13207,7 +13446,7 @@ type PollEncValue struct { func (x *PollEncValue) Reset() { *x = PollEncValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[78] + mi := &file_binary_proto_def_proto_msgTypes[79] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13220,7 +13459,7 @@ func (x *PollEncValue) String() string { func (*PollEncValue) ProtoMessage() {} func (x *PollEncValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[78] + mi := &file_binary_proto_def_proto_msgTypes[79] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13233,7 +13472,7 @@ func (x *PollEncValue) ProtoReflect() protoreflect.Message { // Deprecated: Use PollEncValue.ProtoReflect.Descriptor instead. func (*PollEncValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{78} + return file_binary_proto_def_proto_rawDescGZIP(), []int{79} } func (x *PollEncValue) GetEncPayload() []byte { @@ -13265,7 +13504,7 @@ type PollCreationMessage struct { func (x *PollCreationMessage) Reset() { *x = PollCreationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[79] + mi := &file_binary_proto_def_proto_msgTypes[80] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13278,7 +13517,7 @@ func (x *PollCreationMessage) String() string { func (*PollCreationMessage) ProtoMessage() {} func (x *PollCreationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[79] + mi := &file_binary_proto_def_proto_msgTypes[80] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13291,7 +13530,7 @@ func (x *PollCreationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PollCreationMessage.ProtoReflect.Descriptor instead. func (*PollCreationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{79} + return file_binary_proto_def_proto_rawDescGZIP(), []int{80} } func (x *PollCreationMessage) GetEncKey() []byte { @@ -13342,7 +13581,7 @@ type PinInChatMessage struct { func (x *PinInChatMessage) Reset() { *x = PinInChatMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[80] + mi := &file_binary_proto_def_proto_msgTypes[81] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13355,7 +13594,7 @@ func (x *PinInChatMessage) String() string { func (*PinInChatMessage) ProtoMessage() {} func (x *PinInChatMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[80] + mi := &file_binary_proto_def_proto_msgTypes[81] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13368,7 +13607,7 @@ func (x *PinInChatMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PinInChatMessage.ProtoReflect.Descriptor instead. func (*PinInChatMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{80} + return file_binary_proto_def_proto_rawDescGZIP(), []int{81} } func (x *PinInChatMessage) GetKey() *MessageKey { @@ -13405,7 +13644,7 @@ type PeerDataOperationRequestResponseMessage struct { func (x *PeerDataOperationRequestResponseMessage) Reset() { *x = PeerDataOperationRequestResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[81] + mi := &file_binary_proto_def_proto_msgTypes[82] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13418,7 +13657,7 @@ func (x *PeerDataOperationRequestResponseMessage) String() string { func (*PeerDataOperationRequestResponseMessage) ProtoMessage() {} func (x *PeerDataOperationRequestResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[81] + mi := &file_binary_proto_def_proto_msgTypes[82] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13431,7 +13670,7 @@ func (x *PeerDataOperationRequestResponseMessage) ProtoReflect() protoreflect.Me // Deprecated: Use PeerDataOperationRequestResponseMessage.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{81} + return file_binary_proto_def_proto_rawDescGZIP(), []int{82} } func (x *PeerDataOperationRequestResponseMessage) GetPeerDataOperationRequestType() PeerDataOperationRequestType { @@ -13470,7 +13709,7 @@ type PeerDataOperationRequestMessage struct { func (x *PeerDataOperationRequestMessage) Reset() { *x = PeerDataOperationRequestMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[82] + mi := &file_binary_proto_def_proto_msgTypes[83] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13483,7 +13722,7 @@ func (x *PeerDataOperationRequestMessage) String() string { func (*PeerDataOperationRequestMessage) ProtoMessage() {} func (x *PeerDataOperationRequestMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[82] + mi := &file_binary_proto_def_proto_msgTypes[83] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13496,7 +13735,7 @@ func (x *PeerDataOperationRequestMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PeerDataOperationRequestMessage.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{82} + return file_binary_proto_def_proto_rawDescGZIP(), []int{83} } func (x *PeerDataOperationRequestMessage) GetPeerDataOperationRequestType() PeerDataOperationRequestType { @@ -13546,7 +13785,7 @@ type PaymentInviteMessage struct { func (x *PaymentInviteMessage) Reset() { *x = PaymentInviteMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[83] + mi := &file_binary_proto_def_proto_msgTypes[84] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13559,7 +13798,7 @@ func (x *PaymentInviteMessage) String() string { func (*PaymentInviteMessage) ProtoMessage() {} func (x *PaymentInviteMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[83] + mi := &file_binary_proto_def_proto_msgTypes[84] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13572,7 +13811,7 @@ func (x *PaymentInviteMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentInviteMessage.ProtoReflect.Descriptor instead. func (*PaymentInviteMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{83} + return file_binary_proto_def_proto_rawDescGZIP(), []int{84} } func (x *PaymentInviteMessage) GetServiceType() PaymentInviteMessage_ServiceType { @@ -13613,7 +13852,7 @@ type OrderMessage struct { func (x *OrderMessage) Reset() { *x = OrderMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[84] + mi := &file_binary_proto_def_proto_msgTypes[85] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13626,7 +13865,7 @@ func (x *OrderMessage) String() string { func (*OrderMessage) ProtoMessage() {} func (x *OrderMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[84] + mi := &file_binary_proto_def_proto_msgTypes[85] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13639,7 +13878,7 @@ func (x *OrderMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use OrderMessage.ProtoReflect.Descriptor instead. func (*OrderMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{84} + return file_binary_proto_def_proto_rawDescGZIP(), []int{85} } func (x *OrderMessage) GetOrderId() string { @@ -13755,7 +13994,7 @@ type NewsletterAdminInviteMessage struct { func (x *NewsletterAdminInviteMessage) Reset() { *x = NewsletterAdminInviteMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[85] + mi := &file_binary_proto_def_proto_msgTypes[86] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13768,7 +14007,7 @@ func (x *NewsletterAdminInviteMessage) String() string { func (*NewsletterAdminInviteMessage) ProtoMessage() {} func (x *NewsletterAdminInviteMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[85] + mi := &file_binary_proto_def_proto_msgTypes[86] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13781,7 +14020,7 @@ func (x *NewsletterAdminInviteMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use NewsletterAdminInviteMessage.ProtoReflect.Descriptor instead. func (*NewsletterAdminInviteMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{85} + return file_binary_proto_def_proto_rawDescGZIP(), []int{86} } func (x *NewsletterAdminInviteMessage) GetNewsletterJid() string { @@ -13837,7 +14076,7 @@ type MessageHistoryBundle struct { func (x *MessageHistoryBundle) Reset() { *x = MessageHistoryBundle{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[86] + mi := &file_binary_proto_def_proto_msgTypes[87] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13850,7 +14089,7 @@ func (x *MessageHistoryBundle) String() string { func (*MessageHistoryBundle) ProtoMessage() {} func (x *MessageHistoryBundle) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[86] + mi := &file_binary_proto_def_proto_msgTypes[87] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13863,7 +14102,7 @@ func (x *MessageHistoryBundle) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageHistoryBundle.ProtoReflect.Descriptor instead. func (*MessageHistoryBundle) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{86} + return file_binary_proto_def_proto_rawDescGZIP(), []int{87} } func (x *MessageHistoryBundle) GetMimetype() string { @@ -13944,7 +14183,7 @@ type LocationMessage struct { func (x *LocationMessage) Reset() { *x = LocationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[87] + mi := &file_binary_proto_def_proto_msgTypes[88] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -13957,7 +14196,7 @@ func (x *LocationMessage) String() string { func (*LocationMessage) ProtoMessage() {} func (x *LocationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[87] + mi := &file_binary_proto_def_proto_msgTypes[88] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -13970,7 +14209,7 @@ func (x *LocationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use LocationMessage.ProtoReflect.Descriptor instead. func (*LocationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{87} + return file_binary_proto_def_proto_rawDescGZIP(), []int{88} } func (x *LocationMessage) GetDegreesLatitude() float64 { @@ -14077,7 +14316,7 @@ type LiveLocationMessage struct { func (x *LiveLocationMessage) Reset() { *x = LiveLocationMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[88] + mi := &file_binary_proto_def_proto_msgTypes[89] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14090,7 +14329,7 @@ func (x *LiveLocationMessage) String() string { func (*LiveLocationMessage) ProtoMessage() {} func (x *LiveLocationMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[88] + mi := &file_binary_proto_def_proto_msgTypes[89] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14103,7 +14342,7 @@ func (x *LiveLocationMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use LiveLocationMessage.ProtoReflect.Descriptor instead. func (*LiveLocationMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{88} + return file_binary_proto_def_proto_rawDescGZIP(), []int{89} } func (x *LiveLocationMessage) GetDegreesLatitude() float64 { @@ -14191,7 +14430,7 @@ type ListResponseMessage struct { func (x *ListResponseMessage) Reset() { *x = ListResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[89] + mi := &file_binary_proto_def_proto_msgTypes[90] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14204,7 +14443,7 @@ func (x *ListResponseMessage) String() string { func (*ListResponseMessage) ProtoMessage() {} func (x *ListResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[89] + mi := &file_binary_proto_def_proto_msgTypes[90] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14217,7 +14456,7 @@ func (x *ListResponseMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ListResponseMessage.ProtoReflect.Descriptor instead. func (*ListResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{89} + return file_binary_proto_def_proto_rawDescGZIP(), []int{90} } func (x *ListResponseMessage) GetTitle() string { @@ -14273,7 +14512,7 @@ type ListMessage struct { func (x *ListMessage) Reset() { *x = ListMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[90] + mi := &file_binary_proto_def_proto_msgTypes[91] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14286,7 +14525,7 @@ func (x *ListMessage) String() string { func (*ListMessage) ProtoMessage() {} func (x *ListMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[90] + mi := &file_binary_proto_def_proto_msgTypes[91] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14299,7 +14538,7 @@ func (x *ListMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage.ProtoReflect.Descriptor instead. func (*ListMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91} } func (x *ListMessage) GetTitle() string { @@ -14371,7 +14610,7 @@ type KeepInChatMessage struct { func (x *KeepInChatMessage) Reset() { *x = KeepInChatMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[91] + mi := &file_binary_proto_def_proto_msgTypes[92] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14384,7 +14623,7 @@ func (x *KeepInChatMessage) String() string { func (*KeepInChatMessage) ProtoMessage() {} func (x *KeepInChatMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[91] + mi := &file_binary_proto_def_proto_msgTypes[92] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14397,7 +14636,7 @@ func (x *KeepInChatMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use KeepInChatMessage.ProtoReflect.Descriptor instead. func (*KeepInChatMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{91} + return file_binary_proto_def_proto_rawDescGZIP(), []int{92} } func (x *KeepInChatMessage) GetKey() *MessageKey { @@ -14441,7 +14680,7 @@ type InvoiceMessage struct { func (x *InvoiceMessage) Reset() { *x = InvoiceMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[92] + mi := &file_binary_proto_def_proto_msgTypes[93] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14454,7 +14693,7 @@ func (x *InvoiceMessage) String() string { func (*InvoiceMessage) ProtoMessage() {} func (x *InvoiceMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[92] + mi := &file_binary_proto_def_proto_msgTypes[93] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14467,7 +14706,7 @@ func (x *InvoiceMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use InvoiceMessage.ProtoReflect.Descriptor instead. func (*InvoiceMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{92} + return file_binary_proto_def_proto_rawDescGZIP(), []int{93} } func (x *InvoiceMessage) GetNote() string { @@ -14556,7 +14795,7 @@ type InteractiveResponseMessage struct { func (x *InteractiveResponseMessage) Reset() { *x = InteractiveResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[93] + mi := &file_binary_proto_def_proto_msgTypes[94] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14569,7 +14808,7 @@ func (x *InteractiveResponseMessage) String() string { func (*InteractiveResponseMessage) ProtoMessage() {} func (x *InteractiveResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[93] + mi := &file_binary_proto_def_proto_msgTypes[94] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14582,7 +14821,7 @@ func (x *InteractiveResponseMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use InteractiveResponseMessage.ProtoReflect.Descriptor instead. func (*InteractiveResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{93} + return file_binary_proto_def_proto_rawDescGZIP(), []int{94} } func (x *InteractiveResponseMessage) GetBody() *InteractiveResponseMessage_Body { @@ -14636,7 +14875,7 @@ type EphemeralSetting struct { func (x *EphemeralSetting) Reset() { *x = EphemeralSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[94] + mi := &file_binary_proto_def_proto_msgTypes[95] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14649,7 +14888,7 @@ func (x *EphemeralSetting) String() string { func (*EphemeralSetting) ProtoMessage() {} func (x *EphemeralSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[94] + mi := &file_binary_proto_def_proto_msgTypes[95] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14662,7 +14901,7 @@ func (x *EphemeralSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use EphemeralSetting.ProtoReflect.Descriptor instead. func (*EphemeralSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{94} + return file_binary_proto_def_proto_rawDescGZIP(), []int{95} } func (x *EphemeralSetting) GetDuration() int32 { @@ -14691,7 +14930,7 @@ type WallpaperSettings struct { func (x *WallpaperSettings) Reset() { *x = WallpaperSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[95] + mi := &file_binary_proto_def_proto_msgTypes[96] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14704,7 +14943,7 @@ func (x *WallpaperSettings) String() string { func (*WallpaperSettings) ProtoMessage() {} func (x *WallpaperSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[95] + mi := &file_binary_proto_def_proto_msgTypes[96] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14717,7 +14956,7 @@ func (x *WallpaperSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use WallpaperSettings.ProtoReflect.Descriptor instead. func (*WallpaperSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{95} + return file_binary_proto_def_proto_rawDescGZIP(), []int{96} } func (x *WallpaperSettings) GetFilename() string { @@ -14755,7 +14994,7 @@ type StickerMetadata struct { func (x *StickerMetadata) Reset() { *x = StickerMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[96] + mi := &file_binary_proto_def_proto_msgTypes[97] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14768,7 +15007,7 @@ func (x *StickerMetadata) String() string { func (*StickerMetadata) ProtoMessage() {} func (x *StickerMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[96] + mi := &file_binary_proto_def_proto_msgTypes[97] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14781,7 +15020,7 @@ func (x *StickerMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerMetadata.ProtoReflect.Descriptor instead. func (*StickerMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{96} + return file_binary_proto_def_proto_rawDescGZIP(), []int{97} } func (x *StickerMetadata) GetUrl() string { @@ -14873,7 +15112,7 @@ type Pushname struct { func (x *Pushname) Reset() { *x = Pushname{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[97] + mi := &file_binary_proto_def_proto_msgTypes[98] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14886,7 +15125,7 @@ func (x *Pushname) String() string { func (*Pushname) ProtoMessage() {} func (x *Pushname) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[97] + mi := &file_binary_proto_def_proto_msgTypes[98] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14899,7 +15138,7 @@ func (x *Pushname) ProtoReflect() protoreflect.Message { // Deprecated: Use Pushname.ProtoReflect.Descriptor instead. func (*Pushname) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{97} + return file_binary_proto_def_proto_rawDescGZIP(), []int{98} } func (x *Pushname) GetId() string { @@ -14916,6 +15155,61 @@ func (x *Pushname) GetPushname() string { return "" } +type PhoneNumberToLIDMapping struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + PnJid *string `protobuf:"bytes,1,opt,name=pnJid" json:"pnJid,omitempty"` + LidJid *string `protobuf:"bytes,2,opt,name=lidJid" json:"lidJid,omitempty"` +} + +func (x *PhoneNumberToLIDMapping) Reset() { + *x = PhoneNumberToLIDMapping{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[99] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PhoneNumberToLIDMapping) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PhoneNumberToLIDMapping) ProtoMessage() {} + +func (x *PhoneNumberToLIDMapping) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[99] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PhoneNumberToLIDMapping.ProtoReflect.Descriptor instead. +func (*PhoneNumberToLIDMapping) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{99} +} + +func (x *PhoneNumberToLIDMapping) GetPnJid() string { + if x != nil && x.PnJid != nil { + return *x.PnJid + } + return "" +} + +func (x *PhoneNumberToLIDMapping) GetLidJid() string { + if x != nil && x.LidJid != nil { + return *x.LidJid + } + return "" +} + type PastParticipants struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -14928,7 +15222,7 @@ type PastParticipants struct { func (x *PastParticipants) Reset() { *x = PastParticipants{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[98] + mi := &file_binary_proto_def_proto_msgTypes[100] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14941,7 +15235,7 @@ func (x *PastParticipants) String() string { func (*PastParticipants) ProtoMessage() {} func (x *PastParticipants) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[98] + mi := &file_binary_proto_def_proto_msgTypes[100] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -14954,7 +15248,7 @@ func (x *PastParticipants) ProtoReflect() protoreflect.Message { // Deprecated: Use PastParticipants.ProtoReflect.Descriptor instead. func (*PastParticipants) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{98} + return file_binary_proto_def_proto_rawDescGZIP(), []int{100} } func (x *PastParticipants) GetGroupJid() string { @@ -14984,7 +15278,7 @@ type PastParticipant struct { func (x *PastParticipant) Reset() { *x = PastParticipant{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[99] + mi := &file_binary_proto_def_proto_msgTypes[101] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -14997,7 +15291,7 @@ func (x *PastParticipant) String() string { func (*PastParticipant) ProtoMessage() {} func (x *PastParticipant) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[99] + mi := &file_binary_proto_def_proto_msgTypes[101] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15010,7 +15304,7 @@ func (x *PastParticipant) ProtoReflect() protoreflect.Message { // Deprecated: Use PastParticipant.ProtoReflect.Descriptor instead. func (*PastParticipant) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{99} + return file_binary_proto_def_proto_rawDescGZIP(), []int{101} } func (x *PastParticipant) GetUserJid() string { @@ -15050,7 +15344,7 @@ type NotificationSettings struct { func (x *NotificationSettings) Reset() { *x = NotificationSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[100] + mi := &file_binary_proto_def_proto_msgTypes[102] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15063,7 +15357,7 @@ func (x *NotificationSettings) String() string { func (*NotificationSettings) ProtoMessage() {} func (x *NotificationSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[100] + mi := &file_binary_proto_def_proto_msgTypes[102] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15076,7 +15370,7 @@ func (x *NotificationSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use NotificationSettings.ProtoReflect.Descriptor instead. func (*NotificationSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{100} + return file_binary_proto_def_proto_rawDescGZIP(), []int{102} } func (x *NotificationSettings) GetMessageVibrate() string { @@ -15126,25 +15420,26 @@ type HistorySync struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - SyncType *HistorySync_HistorySyncType `protobuf:"varint,1,req,name=syncType,enum=proto.HistorySync_HistorySyncType" json:"syncType,omitempty"` - Conversations []*Conversation `protobuf:"bytes,2,rep,name=conversations" json:"conversations,omitempty"` - StatusV3Messages []*WebMessageInfo `protobuf:"bytes,3,rep,name=statusV3Messages" json:"statusV3Messages,omitempty"` - ChunkOrder *uint32 `protobuf:"varint,5,opt,name=chunkOrder" json:"chunkOrder,omitempty"` - Progress *uint32 `protobuf:"varint,6,opt,name=progress" json:"progress,omitempty"` - Pushnames []*Pushname `protobuf:"bytes,7,rep,name=pushnames" json:"pushnames,omitempty"` - GlobalSettings *GlobalSettings `protobuf:"bytes,8,opt,name=globalSettings" json:"globalSettings,omitempty"` - ThreadIdUserSecret []byte `protobuf:"bytes,9,opt,name=threadIdUserSecret" json:"threadIdUserSecret,omitempty"` - ThreadDsTimeframeOffset *uint32 `protobuf:"varint,10,opt,name=threadDsTimeframeOffset" json:"threadDsTimeframeOffset,omitempty"` - RecentStickers []*StickerMetadata `protobuf:"bytes,11,rep,name=recentStickers" json:"recentStickers,omitempty"` - PastParticipants []*PastParticipants `protobuf:"bytes,12,rep,name=pastParticipants" json:"pastParticipants,omitempty"` - CallLogRecords []*CallLogRecord `protobuf:"bytes,13,rep,name=callLogRecords" json:"callLogRecords,omitempty"` - AiWaitListState *HistorySync_BotAIWaitListState `protobuf:"varint,14,opt,name=aiWaitListState,enum=proto.HistorySync_BotAIWaitListState" json:"aiWaitListState,omitempty"` + SyncType *HistorySync_HistorySyncType `protobuf:"varint,1,req,name=syncType,enum=proto.HistorySync_HistorySyncType" json:"syncType,omitempty"` + Conversations []*Conversation `protobuf:"bytes,2,rep,name=conversations" json:"conversations,omitempty"` + StatusV3Messages []*WebMessageInfo `protobuf:"bytes,3,rep,name=statusV3Messages" json:"statusV3Messages,omitempty"` + ChunkOrder *uint32 `protobuf:"varint,5,opt,name=chunkOrder" json:"chunkOrder,omitempty"` + Progress *uint32 `protobuf:"varint,6,opt,name=progress" json:"progress,omitempty"` + Pushnames []*Pushname `protobuf:"bytes,7,rep,name=pushnames" json:"pushnames,omitempty"` + GlobalSettings *GlobalSettings `protobuf:"bytes,8,opt,name=globalSettings" json:"globalSettings,omitempty"` + ThreadIdUserSecret []byte `protobuf:"bytes,9,opt,name=threadIdUserSecret" json:"threadIdUserSecret,omitempty"` + ThreadDsTimeframeOffset *uint32 `protobuf:"varint,10,opt,name=threadDsTimeframeOffset" json:"threadDsTimeframeOffset,omitempty"` + RecentStickers []*StickerMetadata `protobuf:"bytes,11,rep,name=recentStickers" json:"recentStickers,omitempty"` + PastParticipants []*PastParticipants `protobuf:"bytes,12,rep,name=pastParticipants" json:"pastParticipants,omitempty"` + CallLogRecords []*CallLogRecord `protobuf:"bytes,13,rep,name=callLogRecords" json:"callLogRecords,omitempty"` + AiWaitListState *HistorySync_BotAIWaitListState `protobuf:"varint,14,opt,name=aiWaitListState,enum=proto.HistorySync_BotAIWaitListState" json:"aiWaitListState,omitempty"` + PhoneNumberToLidMappings []*PhoneNumberToLIDMapping `protobuf:"bytes,15,rep,name=phoneNumberToLidMappings" json:"phoneNumberToLidMappings,omitempty"` } func (x *HistorySync) Reset() { *x = HistorySync{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[101] + mi := &file_binary_proto_def_proto_msgTypes[103] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15157,7 +15452,7 @@ func (x *HistorySync) String() string { func (*HistorySync) ProtoMessage() {} func (x *HistorySync) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[101] + mi := &file_binary_proto_def_proto_msgTypes[103] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15170,7 +15465,7 @@ func (x *HistorySync) ProtoReflect() protoreflect.Message { // Deprecated: Use HistorySync.ProtoReflect.Descriptor instead. func (*HistorySync) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{101} + return file_binary_proto_def_proto_rawDescGZIP(), []int{103} } func (x *HistorySync) GetSyncType() HistorySync_HistorySyncType { @@ -15264,6 +15559,13 @@ func (x *HistorySync) GetAiWaitListState() HistorySync_BotAIWaitListState { return HistorySync_IN_WAITLIST } +func (x *HistorySync) GetPhoneNumberToLidMappings() []*PhoneNumberToLIDMapping { + if x != nil { + return x.PhoneNumberToLidMappings + } + return nil +} + type HistorySyncMsg struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -15276,7 +15578,7 @@ type HistorySyncMsg struct { func (x *HistorySyncMsg) Reset() { *x = HistorySyncMsg{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[102] + mi := &file_binary_proto_def_proto_msgTypes[104] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15289,7 +15591,7 @@ func (x *HistorySyncMsg) String() string { func (*HistorySyncMsg) ProtoMessage() {} func (x *HistorySyncMsg) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[102] + mi := &file_binary_proto_def_proto_msgTypes[104] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15302,7 +15604,7 @@ func (x *HistorySyncMsg) ProtoReflect() protoreflect.Message { // Deprecated: Use HistorySyncMsg.ProtoReflect.Descriptor instead. func (*HistorySyncMsg) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{102} + return file_binary_proto_def_proto_rawDescGZIP(), []int{104} } func (x *HistorySyncMsg) GetMessage() *WebMessageInfo { @@ -15331,7 +15633,7 @@ type GroupParticipant struct { func (x *GroupParticipant) Reset() { *x = GroupParticipant{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[103] + mi := &file_binary_proto_def_proto_msgTypes[105] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15344,7 +15646,7 @@ func (x *GroupParticipant) String() string { func (*GroupParticipant) ProtoMessage() {} func (x *GroupParticipant) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[103] + mi := &file_binary_proto_def_proto_msgTypes[105] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15357,7 +15659,7 @@ func (x *GroupParticipant) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupParticipant.ProtoReflect.Descriptor instead. func (*GroupParticipant) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{103} + return file_binary_proto_def_proto_rawDescGZIP(), []int{105} } func (x *GroupParticipant) GetUserJid() string { @@ -15402,7 +15704,7 @@ type GlobalSettings struct { func (x *GlobalSettings) Reset() { *x = GlobalSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[104] + mi := &file_binary_proto_def_proto_msgTypes[106] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15415,7 +15717,7 @@ func (x *GlobalSettings) String() string { func (*GlobalSettings) ProtoMessage() {} func (x *GlobalSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[104] + mi := &file_binary_proto_def_proto_msgTypes[106] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15428,7 +15730,7 @@ func (x *GlobalSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use GlobalSettings.ProtoReflect.Descriptor instead. func (*GlobalSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{104} + return file_binary_proto_def_proto_rawDescGZIP(), []int{106} } func (x *GlobalSettings) GetLightThemeWallpaper() *WallpaperSettings { @@ -15612,7 +15914,7 @@ type Conversation struct { func (x *Conversation) Reset() { *x = Conversation{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[105] + mi := &file_binary_proto_def_proto_msgTypes[107] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15625,7 +15927,7 @@ func (x *Conversation) String() string { func (*Conversation) ProtoMessage() {} func (x *Conversation) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[105] + mi := &file_binary_proto_def_proto_msgTypes[107] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15638,7 +15940,7 @@ func (x *Conversation) ProtoReflect() protoreflect.Message { // Deprecated: Use Conversation.ProtoReflect.Descriptor instead. func (*Conversation) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{105} + return file_binary_proto_def_proto_rawDescGZIP(), []int{107} } func (x *Conversation) GetId() string { @@ -15968,7 +16270,7 @@ type AvatarUserSettings struct { func (x *AvatarUserSettings) Reset() { *x = AvatarUserSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[106] + mi := &file_binary_proto_def_proto_msgTypes[108] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -15981,7 +16283,7 @@ func (x *AvatarUserSettings) String() string { func (*AvatarUserSettings) ProtoMessage() {} func (x *AvatarUserSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[106] + mi := &file_binary_proto_def_proto_msgTypes[108] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -15994,7 +16296,7 @@ func (x *AvatarUserSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use AvatarUserSettings.ProtoReflect.Descriptor instead. func (*AvatarUserSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{106} + return file_binary_proto_def_proto_rawDescGZIP(), []int{108} } func (x *AvatarUserSettings) GetFbid() string { @@ -16025,7 +16327,7 @@ type AutoDownloadSettings struct { func (x *AutoDownloadSettings) Reset() { *x = AutoDownloadSettings{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[107] + mi := &file_binary_proto_def_proto_msgTypes[109] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16038,7 +16340,7 @@ func (x *AutoDownloadSettings) String() string { func (*AutoDownloadSettings) ProtoMessage() {} func (x *AutoDownloadSettings) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[107] + mi := &file_binary_proto_def_proto_msgTypes[109] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16051,7 +16353,7 @@ func (x *AutoDownloadSettings) ProtoReflect() protoreflect.Message { // Deprecated: Use AutoDownloadSettings.ProtoReflect.Descriptor instead. func (*AutoDownloadSettings) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{107} + return file_binary_proto_def_proto_rawDescGZIP(), []int{109} } func (x *AutoDownloadSettings) GetDownloadImages() bool { @@ -16093,7 +16395,7 @@ type ServerErrorReceipt struct { func (x *ServerErrorReceipt) Reset() { *x = ServerErrorReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[108] + mi := &file_binary_proto_def_proto_msgTypes[110] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16106,7 +16408,7 @@ func (x *ServerErrorReceipt) String() string { func (*ServerErrorReceipt) ProtoMessage() {} func (x *ServerErrorReceipt) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[108] + mi := &file_binary_proto_def_proto_msgTypes[110] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16119,7 +16421,7 @@ func (x *ServerErrorReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use ServerErrorReceipt.ProtoReflect.Descriptor instead. func (*ServerErrorReceipt) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{108} + return file_binary_proto_def_proto_rawDescGZIP(), []int{110} } func (x *ServerErrorReceipt) GetStanzaId() string { @@ -16142,7 +16444,7 @@ type MediaRetryNotification struct { func (x *MediaRetryNotification) Reset() { *x = MediaRetryNotification{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[109] + mi := &file_binary_proto_def_proto_msgTypes[111] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16155,7 +16457,7 @@ func (x *MediaRetryNotification) String() string { func (*MediaRetryNotification) ProtoMessage() {} func (x *MediaRetryNotification) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[109] + mi := &file_binary_proto_def_proto_msgTypes[111] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16168,7 +16470,7 @@ func (x *MediaRetryNotification) ProtoReflect() protoreflect.Message { // Deprecated: Use MediaRetryNotification.ProtoReflect.Descriptor instead. func (*MediaRetryNotification) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{109} + return file_binary_proto_def_proto_rawDescGZIP(), []int{111} } func (x *MediaRetryNotification) GetStanzaId() string { @@ -16206,7 +16508,7 @@ type MessageKey struct { func (x *MessageKey) Reset() { *x = MessageKey{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[110] + mi := &file_binary_proto_def_proto_msgTypes[112] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16219,7 +16521,7 @@ func (x *MessageKey) String() string { func (*MessageKey) ProtoMessage() {} func (x *MessageKey) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[110] + mi := &file_binary_proto_def_proto_msgTypes[112] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16232,7 +16534,7 @@ func (x *MessageKey) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageKey.ProtoReflect.Descriptor instead. func (*MessageKey) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{110} + return file_binary_proto_def_proto_rawDescGZIP(), []int{112} } func (x *MessageKey) GetRemoteJid() string { @@ -16274,7 +16576,7 @@ type SyncdVersion struct { func (x *SyncdVersion) Reset() { *x = SyncdVersion{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[111] + mi := &file_binary_proto_def_proto_msgTypes[113] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16287,7 +16589,7 @@ func (x *SyncdVersion) String() string { func (*SyncdVersion) ProtoMessage() {} func (x *SyncdVersion) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[111] + mi := &file_binary_proto_def_proto_msgTypes[113] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16300,7 +16602,7 @@ func (x *SyncdVersion) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdVersion.ProtoReflect.Descriptor instead. func (*SyncdVersion) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{111} + return file_binary_proto_def_proto_rawDescGZIP(), []int{113} } func (x *SyncdVersion) GetVersion() uint64 { @@ -16321,7 +16623,7 @@ type SyncdValue struct { func (x *SyncdValue) Reset() { *x = SyncdValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[112] + mi := &file_binary_proto_def_proto_msgTypes[114] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16334,7 +16636,7 @@ func (x *SyncdValue) String() string { func (*SyncdValue) ProtoMessage() {} func (x *SyncdValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[112] + mi := &file_binary_proto_def_proto_msgTypes[114] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16347,7 +16649,7 @@ func (x *SyncdValue) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdValue.ProtoReflect.Descriptor instead. func (*SyncdValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{112} + return file_binary_proto_def_proto_rawDescGZIP(), []int{114} } func (x *SyncdValue) GetBlob() []byte { @@ -16371,7 +16673,7 @@ type SyncdSnapshot struct { func (x *SyncdSnapshot) Reset() { *x = SyncdSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[113] + mi := &file_binary_proto_def_proto_msgTypes[115] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16384,7 +16686,7 @@ func (x *SyncdSnapshot) String() string { func (*SyncdSnapshot) ProtoMessage() {} func (x *SyncdSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[113] + mi := &file_binary_proto_def_proto_msgTypes[115] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16397,7 +16699,7 @@ func (x *SyncdSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdSnapshot.ProtoReflect.Descriptor instead. func (*SyncdSnapshot) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{113} + return file_binary_proto_def_proto_rawDescGZIP(), []int{115} } func (x *SyncdSnapshot) GetVersion() *SyncdVersion { @@ -16441,7 +16743,7 @@ type SyncdRecord struct { func (x *SyncdRecord) Reset() { *x = SyncdRecord{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[114] + mi := &file_binary_proto_def_proto_msgTypes[116] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16454,7 +16756,7 @@ func (x *SyncdRecord) String() string { func (*SyncdRecord) ProtoMessage() {} func (x *SyncdRecord) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[114] + mi := &file_binary_proto_def_proto_msgTypes[116] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16467,7 +16769,7 @@ func (x *SyncdRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdRecord.ProtoReflect.Descriptor instead. func (*SyncdRecord) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{114} + return file_binary_proto_def_proto_rawDescGZIP(), []int{116} } func (x *SyncdRecord) GetIndex() *SyncdIndex { @@ -16504,12 +16806,13 @@ type SyncdPatch struct { KeyId *KeyId `protobuf:"bytes,6,opt,name=keyId" json:"keyId,omitempty"` ExitCode *ExitCode `protobuf:"bytes,7,opt,name=exitCode" json:"exitCode,omitempty"` DeviceIndex *uint32 `protobuf:"varint,8,opt,name=deviceIndex" json:"deviceIndex,omitempty"` + ClientDebugData []byte `protobuf:"bytes,9,opt,name=clientDebugData" json:"clientDebugData,omitempty"` } func (x *SyncdPatch) Reset() { *x = SyncdPatch{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[115] + mi := &file_binary_proto_def_proto_msgTypes[117] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16522,7 +16825,7 @@ func (x *SyncdPatch) String() string { func (*SyncdPatch) ProtoMessage() {} func (x *SyncdPatch) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[115] + mi := &file_binary_proto_def_proto_msgTypes[117] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16535,7 +16838,7 @@ func (x *SyncdPatch) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdPatch.ProtoReflect.Descriptor instead. func (*SyncdPatch) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{115} + return file_binary_proto_def_proto_rawDescGZIP(), []int{117} } func (x *SyncdPatch) GetVersion() *SyncdVersion { @@ -16594,6 +16897,13 @@ func (x *SyncdPatch) GetDeviceIndex() uint32 { return 0 } +func (x *SyncdPatch) GetClientDebugData() []byte { + if x != nil { + return x.ClientDebugData + } + return nil +} + type SyncdMutations struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -16605,7 +16915,7 @@ type SyncdMutations struct { func (x *SyncdMutations) Reset() { *x = SyncdMutations{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[116] + mi := &file_binary_proto_def_proto_msgTypes[118] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16618,7 +16928,7 @@ func (x *SyncdMutations) String() string { func (*SyncdMutations) ProtoMessage() {} func (x *SyncdMutations) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[116] + mi := &file_binary_proto_def_proto_msgTypes[118] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16631,7 +16941,7 @@ func (x *SyncdMutations) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdMutations.ProtoReflect.Descriptor instead. func (*SyncdMutations) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{116} + return file_binary_proto_def_proto_rawDescGZIP(), []int{118} } func (x *SyncdMutations) GetMutations() []*SyncdMutation { @@ -16653,7 +16963,7 @@ type SyncdMutation struct { func (x *SyncdMutation) Reset() { *x = SyncdMutation{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[117] + mi := &file_binary_proto_def_proto_msgTypes[119] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16666,7 +16976,7 @@ func (x *SyncdMutation) String() string { func (*SyncdMutation) ProtoMessage() {} func (x *SyncdMutation) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[117] + mi := &file_binary_proto_def_proto_msgTypes[119] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16679,7 +16989,7 @@ func (x *SyncdMutation) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdMutation.ProtoReflect.Descriptor instead. func (*SyncdMutation) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{117} + return file_binary_proto_def_proto_rawDescGZIP(), []int{119} } func (x *SyncdMutation) GetOperation() SyncdMutation_SyncdOperation { @@ -16707,7 +17017,7 @@ type SyncdIndex struct { func (x *SyncdIndex) Reset() { *x = SyncdIndex{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[118] + mi := &file_binary_proto_def_proto_msgTypes[120] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16720,7 +17030,7 @@ func (x *SyncdIndex) String() string { func (*SyncdIndex) ProtoMessage() {} func (x *SyncdIndex) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[118] + mi := &file_binary_proto_def_proto_msgTypes[120] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16733,7 +17043,7 @@ func (x *SyncdIndex) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncdIndex.ProtoReflect.Descriptor instead. func (*SyncdIndex) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{118} + return file_binary_proto_def_proto_rawDescGZIP(), []int{120} } func (x *SyncdIndex) GetBlob() []byte { @@ -16754,7 +17064,7 @@ type KeyId struct { func (x *KeyId) Reset() { *x = KeyId{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[119] + mi := &file_binary_proto_def_proto_msgTypes[121] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16767,7 +17077,7 @@ func (x *KeyId) String() string { func (*KeyId) ProtoMessage() {} func (x *KeyId) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[119] + mi := &file_binary_proto_def_proto_msgTypes[121] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16780,7 +17090,7 @@ func (x *KeyId) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyId.ProtoReflect.Descriptor instead. func (*KeyId) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{119} + return file_binary_proto_def_proto_rawDescGZIP(), []int{121} } func (x *KeyId) GetId() []byte { @@ -16806,7 +17116,7 @@ type ExternalBlobReference struct { func (x *ExternalBlobReference) Reset() { *x = ExternalBlobReference{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[120] + mi := &file_binary_proto_def_proto_msgTypes[122] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16819,7 +17129,7 @@ func (x *ExternalBlobReference) String() string { func (*ExternalBlobReference) ProtoMessage() {} func (x *ExternalBlobReference) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[120] + mi := &file_binary_proto_def_proto_msgTypes[122] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16832,7 +17142,7 @@ func (x *ExternalBlobReference) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalBlobReference.ProtoReflect.Descriptor instead. func (*ExternalBlobReference) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{120} + return file_binary_proto_def_proto_rawDescGZIP(), []int{122} } func (x *ExternalBlobReference) GetMediaKey() []byte { @@ -16889,7 +17199,7 @@ type ExitCode struct { func (x *ExitCode) Reset() { *x = ExitCode{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[121] + mi := &file_binary_proto_def_proto_msgTypes[123] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16902,7 +17212,7 @@ func (x *ExitCode) String() string { func (*ExitCode) ProtoMessage() {} func (x *ExitCode) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[121] + mi := &file_binary_proto_def_proto_msgTypes[123] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -16915,7 +17225,7 @@ func (x *ExitCode) ProtoReflect() protoreflect.Message { // Deprecated: Use ExitCode.ProtoReflect.Descriptor instead. func (*ExitCode) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{121} + return file_binary_proto_def_proto_rawDescGZIP(), []int{123} } func (x *ExitCode) GetCode() uint64 { @@ -16978,12 +17288,13 @@ type SyncActionValue struct { BotWelcomeRequestAction *BotWelcomeRequestAction `protobuf:"bytes,45,opt,name=botWelcomeRequestAction" json:"botWelcomeRequestAction,omitempty"` DeleteIndividualCallLog *DeleteIndividualCallLogAction `protobuf:"bytes,46,opt,name=deleteIndividualCallLog" json:"deleteIndividualCallLog,omitempty"` LabelReorderingAction *LabelReorderingAction `protobuf:"bytes,47,opt,name=labelReorderingAction" json:"labelReorderingAction,omitempty"` + PaymentInfoAction *PaymentInfoAction `protobuf:"bytes,48,opt,name=paymentInfoAction" json:"paymentInfoAction,omitempty"` } func (x *SyncActionValue) Reset() { *x = SyncActionValue{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[122] + mi := &file_binary_proto_def_proto_msgTypes[124] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -16996,7 +17307,7 @@ func (x *SyncActionValue) String() string { func (*SyncActionValue) ProtoMessage() {} func (x *SyncActionValue) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[122] + mi := &file_binary_proto_def_proto_msgTypes[124] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17009,7 +17320,7 @@ func (x *SyncActionValue) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionValue.ProtoReflect.Descriptor instead. func (*SyncActionValue) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{122} + return file_binary_proto_def_proto_rawDescGZIP(), []int{124} } func (x *SyncActionValue) GetTimestamp() int64 { @@ -17299,6 +17610,13 @@ func (x *SyncActionValue) GetLabelReorderingAction() *LabelReorderingAction { return nil } +func (x *SyncActionValue) GetPaymentInfoAction() *PaymentInfoAction { + if x != nil { + return x.PaymentInfoAction + } + return nil +} + type UserStatusMuteAction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -17310,7 +17628,7 @@ type UserStatusMuteAction struct { func (x *UserStatusMuteAction) Reset() { *x = UserStatusMuteAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[123] + mi := &file_binary_proto_def_proto_msgTypes[125] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17323,7 +17641,7 @@ func (x *UserStatusMuteAction) String() string { func (*UserStatusMuteAction) ProtoMessage() {} func (x *UserStatusMuteAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[123] + mi := &file_binary_proto_def_proto_msgTypes[125] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17336,7 +17654,7 @@ func (x *UserStatusMuteAction) ProtoReflect() protoreflect.Message { // Deprecated: Use UserStatusMuteAction.ProtoReflect.Descriptor instead. func (*UserStatusMuteAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{123} + return file_binary_proto_def_proto_rawDescGZIP(), []int{125} } func (x *UserStatusMuteAction) GetMuted() bool { @@ -17357,7 +17675,7 @@ type UnarchiveChatsSetting struct { func (x *UnarchiveChatsSetting) Reset() { *x = UnarchiveChatsSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[124] + mi := &file_binary_proto_def_proto_msgTypes[126] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17370,7 +17688,7 @@ func (x *UnarchiveChatsSetting) String() string { func (*UnarchiveChatsSetting) ProtoMessage() {} func (x *UnarchiveChatsSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[124] + mi := &file_binary_proto_def_proto_msgTypes[126] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17383,7 +17701,7 @@ func (x *UnarchiveChatsSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use UnarchiveChatsSetting.ProtoReflect.Descriptor instead. func (*UnarchiveChatsSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{124} + return file_binary_proto_def_proto_rawDescGZIP(), []int{126} } func (x *UnarchiveChatsSetting) GetUnarchiveChats() bool { @@ -17404,7 +17722,7 @@ type TimeFormatAction struct { func (x *TimeFormatAction) Reset() { *x = TimeFormatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[125] + mi := &file_binary_proto_def_proto_msgTypes[127] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17417,7 +17735,7 @@ func (x *TimeFormatAction) String() string { func (*TimeFormatAction) ProtoMessage() {} func (x *TimeFormatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[125] + mi := &file_binary_proto_def_proto_msgTypes[127] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17430,7 +17748,7 @@ func (x *TimeFormatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use TimeFormatAction.ProtoReflect.Descriptor instead. func (*TimeFormatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{125} + return file_binary_proto_def_proto_rawDescGZIP(), []int{127} } func (x *TimeFormatAction) GetIsTwentyFourHourFormatEnabled() bool { @@ -17452,7 +17770,7 @@ type SyncActionMessage struct { func (x *SyncActionMessage) Reset() { *x = SyncActionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[126] + mi := &file_binary_proto_def_proto_msgTypes[128] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17465,7 +17783,7 @@ func (x *SyncActionMessage) String() string { func (*SyncActionMessage) ProtoMessage() {} func (x *SyncActionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[126] + mi := &file_binary_proto_def_proto_msgTypes[128] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17478,7 +17796,7 @@ func (x *SyncActionMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionMessage.ProtoReflect.Descriptor instead. func (*SyncActionMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{126} + return file_binary_proto_def_proto_rawDescGZIP(), []int{128} } func (x *SyncActionMessage) GetKey() *MessageKey { @@ -17508,7 +17826,7 @@ type SyncActionMessageRange struct { func (x *SyncActionMessageRange) Reset() { *x = SyncActionMessageRange{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[127] + mi := &file_binary_proto_def_proto_msgTypes[129] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17521,7 +17839,7 @@ func (x *SyncActionMessageRange) String() string { func (*SyncActionMessageRange) ProtoMessage() {} func (x *SyncActionMessageRange) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[127] + mi := &file_binary_proto_def_proto_msgTypes[129] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17534,7 +17852,7 @@ func (x *SyncActionMessageRange) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionMessageRange.ProtoReflect.Descriptor instead. func (*SyncActionMessageRange) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{127} + return file_binary_proto_def_proto_rawDescGZIP(), []int{129} } func (x *SyncActionMessageRange) GetLastMessageTimestamp() int64 { @@ -17571,7 +17889,7 @@ type SubscriptionAction struct { func (x *SubscriptionAction) Reset() { *x = SubscriptionAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[128] + mi := &file_binary_proto_def_proto_msgTypes[130] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17584,7 +17902,7 @@ func (x *SubscriptionAction) String() string { func (*SubscriptionAction) ProtoMessage() {} func (x *SubscriptionAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[128] + mi := &file_binary_proto_def_proto_msgTypes[130] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17597,7 +17915,7 @@ func (x *SubscriptionAction) ProtoReflect() protoreflect.Message { // Deprecated: Use SubscriptionAction.ProtoReflect.Descriptor instead. func (*SubscriptionAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{128} + return file_binary_proto_def_proto_rawDescGZIP(), []int{130} } func (x *SubscriptionAction) GetIsDeactivated() bool { @@ -17641,7 +17959,7 @@ type StickerAction struct { func (x *StickerAction) Reset() { *x = StickerAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[129] + mi := &file_binary_proto_def_proto_msgTypes[131] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17654,7 +17972,7 @@ func (x *StickerAction) String() string { func (*StickerAction) ProtoMessage() {} func (x *StickerAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[129] + mi := &file_binary_proto_def_proto_msgTypes[131] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17667,7 +17985,7 @@ func (x *StickerAction) ProtoReflect() protoreflect.Message { // Deprecated: Use StickerAction.ProtoReflect.Descriptor instead. func (*StickerAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{129} + return file_binary_proto_def_proto_rawDescGZIP(), []int{131} } func (x *StickerAction) GetUrl() string { @@ -17752,7 +18070,7 @@ type StatusPrivacyAction struct { func (x *StatusPrivacyAction) Reset() { *x = StatusPrivacyAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[130] + mi := &file_binary_proto_def_proto_msgTypes[132] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17765,7 +18083,7 @@ func (x *StatusPrivacyAction) String() string { func (*StatusPrivacyAction) ProtoMessage() {} func (x *StatusPrivacyAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[130] + mi := &file_binary_proto_def_proto_msgTypes[132] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17778,7 +18096,7 @@ func (x *StatusPrivacyAction) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusPrivacyAction.ProtoReflect.Descriptor instead. func (*StatusPrivacyAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{130} + return file_binary_proto_def_proto_rawDescGZIP(), []int{132} } func (x *StatusPrivacyAction) GetMode() StatusPrivacyAction_StatusDistributionMode { @@ -17806,7 +18124,7 @@ type StarAction struct { func (x *StarAction) Reset() { *x = StarAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[131] + mi := &file_binary_proto_def_proto_msgTypes[133] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17819,7 +18137,7 @@ func (x *StarAction) String() string { func (*StarAction) ProtoMessage() {} func (x *StarAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[131] + mi := &file_binary_proto_def_proto_msgTypes[133] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17832,7 +18150,7 @@ func (x *StarAction) ProtoReflect() protoreflect.Message { // Deprecated: Use StarAction.ProtoReflect.Descriptor instead. func (*StarAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{131} + return file_binary_proto_def_proto_rawDescGZIP(), []int{133} } func (x *StarAction) GetStarred() bool { @@ -17853,7 +18171,7 @@ type SecurityNotificationSetting struct { func (x *SecurityNotificationSetting) Reset() { *x = SecurityNotificationSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[132] + mi := &file_binary_proto_def_proto_msgTypes[134] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17866,7 +18184,7 @@ func (x *SecurityNotificationSetting) String() string { func (*SecurityNotificationSetting) ProtoMessage() {} func (x *SecurityNotificationSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[132] + mi := &file_binary_proto_def_proto_msgTypes[134] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17879,7 +18197,7 @@ func (x *SecurityNotificationSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use SecurityNotificationSetting.ProtoReflect.Descriptor instead. func (*SecurityNotificationSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{132} + return file_binary_proto_def_proto_rawDescGZIP(), []int{134} } func (x *SecurityNotificationSetting) GetShowNotification() bool { @@ -17900,7 +18218,7 @@ type RemoveRecentStickerAction struct { func (x *RemoveRecentStickerAction) Reset() { *x = RemoveRecentStickerAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[133] + mi := &file_binary_proto_def_proto_msgTypes[135] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17913,7 +18231,7 @@ func (x *RemoveRecentStickerAction) String() string { func (*RemoveRecentStickerAction) ProtoMessage() {} func (x *RemoveRecentStickerAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[133] + mi := &file_binary_proto_def_proto_msgTypes[135] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17926,7 +18244,7 @@ func (x *RemoveRecentStickerAction) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveRecentStickerAction.ProtoReflect.Descriptor instead. func (*RemoveRecentStickerAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{133} + return file_binary_proto_def_proto_rawDescGZIP(), []int{135} } func (x *RemoveRecentStickerAction) GetLastStickerSentTs() int64 { @@ -17947,7 +18265,7 @@ type RecentEmojiWeightsAction struct { func (x *RecentEmojiWeightsAction) Reset() { *x = RecentEmojiWeightsAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[134] + mi := &file_binary_proto_def_proto_msgTypes[136] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -17960,7 +18278,7 @@ func (x *RecentEmojiWeightsAction) String() string { func (*RecentEmojiWeightsAction) ProtoMessage() {} func (x *RecentEmojiWeightsAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[134] + mi := &file_binary_proto_def_proto_msgTypes[136] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -17973,7 +18291,7 @@ func (x *RecentEmojiWeightsAction) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentEmojiWeightsAction.ProtoReflect.Descriptor instead. func (*RecentEmojiWeightsAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{134} + return file_binary_proto_def_proto_rawDescGZIP(), []int{136} } func (x *RecentEmojiWeightsAction) GetWeights() []*RecentEmojiWeight { @@ -17998,7 +18316,7 @@ type QuickReplyAction struct { func (x *QuickReplyAction) Reset() { *x = QuickReplyAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[135] + mi := &file_binary_proto_def_proto_msgTypes[137] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18011,7 +18329,7 @@ func (x *QuickReplyAction) String() string { func (*QuickReplyAction) ProtoMessage() {} func (x *QuickReplyAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[135] + mi := &file_binary_proto_def_proto_msgTypes[137] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18024,7 +18342,7 @@ func (x *QuickReplyAction) ProtoReflect() protoreflect.Message { // Deprecated: Use QuickReplyAction.ProtoReflect.Descriptor instead. func (*QuickReplyAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{135} + return file_binary_proto_def_proto_rawDescGZIP(), []int{137} } func (x *QuickReplyAction) GetShortcut() string { @@ -18073,7 +18391,7 @@ type PushNameSetting struct { func (x *PushNameSetting) Reset() { *x = PushNameSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[136] + mi := &file_binary_proto_def_proto_msgTypes[138] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18086,7 +18404,7 @@ func (x *PushNameSetting) String() string { func (*PushNameSetting) ProtoMessage() {} func (x *PushNameSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[136] + mi := &file_binary_proto_def_proto_msgTypes[138] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18099,7 +18417,7 @@ func (x *PushNameSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use PushNameSetting.ProtoReflect.Descriptor instead. func (*PushNameSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{136} + return file_binary_proto_def_proto_rawDescGZIP(), []int{138} } func (x *PushNameSetting) GetName() string { @@ -18120,7 +18438,7 @@ type PrivacySettingRelayAllCalls struct { func (x *PrivacySettingRelayAllCalls) Reset() { *x = PrivacySettingRelayAllCalls{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[137] + mi := &file_binary_proto_def_proto_msgTypes[139] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18133,7 +18451,7 @@ func (x *PrivacySettingRelayAllCalls) String() string { func (*PrivacySettingRelayAllCalls) ProtoMessage() {} func (x *PrivacySettingRelayAllCalls) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[137] + mi := &file_binary_proto_def_proto_msgTypes[139] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18146,7 +18464,7 @@ func (x *PrivacySettingRelayAllCalls) ProtoReflect() protoreflect.Message { // Deprecated: Use PrivacySettingRelayAllCalls.ProtoReflect.Descriptor instead. func (*PrivacySettingRelayAllCalls) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{137} + return file_binary_proto_def_proto_rawDescGZIP(), []int{139} } func (x *PrivacySettingRelayAllCalls) GetIsEnabled() bool { @@ -18167,7 +18485,7 @@ type PrimaryVersionAction struct { func (x *PrimaryVersionAction) Reset() { *x = PrimaryVersionAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[138] + mi := &file_binary_proto_def_proto_msgTypes[140] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18180,7 +18498,7 @@ func (x *PrimaryVersionAction) String() string { func (*PrimaryVersionAction) ProtoMessage() {} func (x *PrimaryVersionAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[138] + mi := &file_binary_proto_def_proto_msgTypes[140] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18193,7 +18511,7 @@ func (x *PrimaryVersionAction) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryVersionAction.ProtoReflect.Descriptor instead. func (*PrimaryVersionAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{138} + return file_binary_proto_def_proto_rawDescGZIP(), []int{140} } func (x *PrimaryVersionAction) GetVersion() string { @@ -18214,7 +18532,7 @@ type PrimaryFeature struct { func (x *PrimaryFeature) Reset() { *x = PrimaryFeature{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[139] + mi := &file_binary_proto_def_proto_msgTypes[141] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18227,7 +18545,7 @@ func (x *PrimaryFeature) String() string { func (*PrimaryFeature) ProtoMessage() {} func (x *PrimaryFeature) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[139] + mi := &file_binary_proto_def_proto_msgTypes[141] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18240,7 +18558,7 @@ func (x *PrimaryFeature) ProtoReflect() protoreflect.Message { // Deprecated: Use PrimaryFeature.ProtoReflect.Descriptor instead. func (*PrimaryFeature) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{139} + return file_binary_proto_def_proto_rawDescGZIP(), []int{141} } func (x *PrimaryFeature) GetFlags() []string { @@ -18261,7 +18579,7 @@ type PnForLidChatAction struct { func (x *PnForLidChatAction) Reset() { *x = PnForLidChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[140] + mi := &file_binary_proto_def_proto_msgTypes[142] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18274,7 +18592,7 @@ func (x *PnForLidChatAction) String() string { func (*PnForLidChatAction) ProtoMessage() {} func (x *PnForLidChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[140] + mi := &file_binary_proto_def_proto_msgTypes[142] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18287,7 +18605,7 @@ func (x *PnForLidChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use PnForLidChatAction.ProtoReflect.Descriptor instead. func (*PnForLidChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{140} + return file_binary_proto_def_proto_rawDescGZIP(), []int{142} } func (x *PnForLidChatAction) GetPnJid() string { @@ -18308,7 +18626,7 @@ type PinAction struct { func (x *PinAction) Reset() { *x = PinAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[141] + mi := &file_binary_proto_def_proto_msgTypes[143] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18321,7 +18639,7 @@ func (x *PinAction) String() string { func (*PinAction) ProtoMessage() {} func (x *PinAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[141] + mi := &file_binary_proto_def_proto_msgTypes[143] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18334,7 +18652,7 @@ func (x *PinAction) ProtoReflect() protoreflect.Message { // Deprecated: Use PinAction.ProtoReflect.Descriptor instead. func (*PinAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{141} + return file_binary_proto_def_proto_rawDescGZIP(), []int{143} } func (x *PinAction) GetPinned() bool { @@ -18344,6 +18662,53 @@ func (x *PinAction) GetPinned() bool { return false } +type PaymentInfoAction struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Cpi *string `protobuf:"bytes,1,opt,name=cpi" json:"cpi,omitempty"` +} + +func (x *PaymentInfoAction) Reset() { + *x = PaymentInfoAction{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[144] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PaymentInfoAction) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PaymentInfoAction) ProtoMessage() {} + +func (x *PaymentInfoAction) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[144] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use PaymentInfoAction.ProtoReflect.Descriptor instead. +func (*PaymentInfoAction) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{144} +} + +func (x *PaymentInfoAction) GetCpi() string { + if x != nil && x.Cpi != nil { + return *x.Cpi + } + return "" +} + type NuxAction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -18355,7 +18720,7 @@ type NuxAction struct { func (x *NuxAction) Reset() { *x = NuxAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[142] + mi := &file_binary_proto_def_proto_msgTypes[145] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18368,7 +18733,7 @@ func (x *NuxAction) String() string { func (*NuxAction) ProtoMessage() {} func (x *NuxAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[142] + mi := &file_binary_proto_def_proto_msgTypes[145] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18381,7 +18746,7 @@ func (x *NuxAction) ProtoReflect() protoreflect.Message { // Deprecated: Use NuxAction.ProtoReflect.Descriptor instead. func (*NuxAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{142} + return file_binary_proto_def_proto_rawDescGZIP(), []int{145} } func (x *NuxAction) GetAcknowledged() bool { @@ -18404,7 +18769,7 @@ type MuteAction struct { func (x *MuteAction) Reset() { *x = MuteAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[143] + mi := &file_binary_proto_def_proto_msgTypes[146] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18417,7 +18782,7 @@ func (x *MuteAction) String() string { func (*MuteAction) ProtoMessage() {} func (x *MuteAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[143] + mi := &file_binary_proto_def_proto_msgTypes[146] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18430,7 +18795,7 @@ func (x *MuteAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MuteAction.ProtoReflect.Descriptor instead. func (*MuteAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{143} + return file_binary_proto_def_proto_rawDescGZIP(), []int{146} } func (x *MuteAction) GetMuted() bool { @@ -18465,7 +18830,7 @@ type MarketingMessageBroadcastAction struct { func (x *MarketingMessageBroadcastAction) Reset() { *x = MarketingMessageBroadcastAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[144] + mi := &file_binary_proto_def_proto_msgTypes[147] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18478,7 +18843,7 @@ func (x *MarketingMessageBroadcastAction) String() string { func (*MarketingMessageBroadcastAction) ProtoMessage() {} func (x *MarketingMessageBroadcastAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[144] + mi := &file_binary_proto_def_proto_msgTypes[147] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18491,7 +18856,7 @@ func (x *MarketingMessageBroadcastAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MarketingMessageBroadcastAction.ProtoReflect.Descriptor instead. func (*MarketingMessageBroadcastAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{144} + return file_binary_proto_def_proto_rawDescGZIP(), []int{147} } func (x *MarketingMessageBroadcastAction) GetRepliedCount() int32 { @@ -18518,7 +18883,7 @@ type MarketingMessageAction struct { func (x *MarketingMessageAction) Reset() { *x = MarketingMessageAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[145] + mi := &file_binary_proto_def_proto_msgTypes[148] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18531,7 +18896,7 @@ func (x *MarketingMessageAction) String() string { func (*MarketingMessageAction) ProtoMessage() {} func (x *MarketingMessageAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[145] + mi := &file_binary_proto_def_proto_msgTypes[148] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18544,7 +18909,7 @@ func (x *MarketingMessageAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MarketingMessageAction.ProtoReflect.Descriptor instead. func (*MarketingMessageAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{145} + return file_binary_proto_def_proto_rawDescGZIP(), []int{148} } func (x *MarketingMessageAction) GetName() string { @@ -18608,7 +18973,7 @@ type MarkChatAsReadAction struct { func (x *MarkChatAsReadAction) Reset() { *x = MarkChatAsReadAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[146] + mi := &file_binary_proto_def_proto_msgTypes[149] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18621,7 +18986,7 @@ func (x *MarkChatAsReadAction) String() string { func (*MarkChatAsReadAction) ProtoMessage() {} func (x *MarkChatAsReadAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[146] + mi := &file_binary_proto_def_proto_msgTypes[149] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18634,7 +18999,7 @@ func (x *MarkChatAsReadAction) ProtoReflect() protoreflect.Message { // Deprecated: Use MarkChatAsReadAction.ProtoReflect.Descriptor instead. func (*MarkChatAsReadAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{146} + return file_binary_proto_def_proto_rawDescGZIP(), []int{149} } func (x *MarkChatAsReadAction) GetRead() bool { @@ -18662,7 +19027,7 @@ type LocaleSetting struct { func (x *LocaleSetting) Reset() { *x = LocaleSetting{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[147] + mi := &file_binary_proto_def_proto_msgTypes[150] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18675,7 +19040,7 @@ func (x *LocaleSetting) String() string { func (*LocaleSetting) ProtoMessage() {} func (x *LocaleSetting) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[147] + mi := &file_binary_proto_def_proto_msgTypes[150] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18688,7 +19053,7 @@ func (x *LocaleSetting) ProtoReflect() protoreflect.Message { // Deprecated: Use LocaleSetting.ProtoReflect.Descriptor instead. func (*LocaleSetting) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{147} + return file_binary_proto_def_proto_rawDescGZIP(), []int{150} } func (x *LocaleSetting) GetLocale() string { @@ -18703,13 +19068,13 @@ type LabelReorderingAction struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Data []int32 `protobuf:"varint,1,rep,name=data" json:"data,omitempty"` + SortedLabelIds []int32 `protobuf:"varint,1,rep,name=sortedLabelIds" json:"sortedLabelIds,omitempty"` } func (x *LabelReorderingAction) Reset() { *x = LabelReorderingAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[148] + mi := &file_binary_proto_def_proto_msgTypes[151] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18722,7 +19087,7 @@ func (x *LabelReorderingAction) String() string { func (*LabelReorderingAction) ProtoMessage() {} func (x *LabelReorderingAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[148] + mi := &file_binary_proto_def_proto_msgTypes[151] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18735,12 +19100,12 @@ func (x *LabelReorderingAction) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelReorderingAction.ProtoReflect.Descriptor instead. func (*LabelReorderingAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{148} + return file_binary_proto_def_proto_rawDescGZIP(), []int{151} } -func (x *LabelReorderingAction) GetData() []int32 { +func (x *LabelReorderingAction) GetSortedLabelIds() []int32 { if x != nil { - return x.Data + return x.SortedLabelIds } return nil } @@ -18754,12 +19119,13 @@ type LabelEditAction struct { Color *int32 `protobuf:"varint,2,opt,name=color" json:"color,omitempty"` PredefinedId *int32 `protobuf:"varint,3,opt,name=predefinedId" json:"predefinedId,omitempty"` Deleted *bool `protobuf:"varint,4,opt,name=deleted" json:"deleted,omitempty"` + OrderIndex *int32 `protobuf:"varint,5,opt,name=orderIndex" json:"orderIndex,omitempty"` } func (x *LabelEditAction) Reset() { *x = LabelEditAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[149] + mi := &file_binary_proto_def_proto_msgTypes[152] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18772,7 +19138,7 @@ func (x *LabelEditAction) String() string { func (*LabelEditAction) ProtoMessage() {} func (x *LabelEditAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[149] + mi := &file_binary_proto_def_proto_msgTypes[152] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18785,7 +19151,7 @@ func (x *LabelEditAction) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelEditAction.ProtoReflect.Descriptor instead. func (*LabelEditAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{149} + return file_binary_proto_def_proto_rawDescGZIP(), []int{152} } func (x *LabelEditAction) GetName() string { @@ -18816,6 +19182,13 @@ func (x *LabelEditAction) GetDeleted() bool { return false } +func (x *LabelEditAction) GetOrderIndex() int32 { + if x != nil && x.OrderIndex != nil { + return *x.OrderIndex + } + return 0 +} + type LabelAssociationAction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -18827,7 +19200,7 @@ type LabelAssociationAction struct { func (x *LabelAssociationAction) Reset() { *x = LabelAssociationAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[150] + mi := &file_binary_proto_def_proto_msgTypes[153] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18840,7 +19213,7 @@ func (x *LabelAssociationAction) String() string { func (*LabelAssociationAction) ProtoMessage() {} func (x *LabelAssociationAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[150] + mi := &file_binary_proto_def_proto_msgTypes[153] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18853,7 +19226,7 @@ func (x *LabelAssociationAction) ProtoReflect() protoreflect.Message { // Deprecated: Use LabelAssociationAction.ProtoReflect.Descriptor instead. func (*LabelAssociationAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{150} + return file_binary_proto_def_proto_rawDescGZIP(), []int{153} } func (x *LabelAssociationAction) GetLabeled() bool { @@ -18874,7 +19247,7 @@ type KeyExpiration struct { func (x *KeyExpiration) Reset() { *x = KeyExpiration{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[151] + mi := &file_binary_proto_def_proto_msgTypes[154] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18887,7 +19260,7 @@ func (x *KeyExpiration) String() string { func (*KeyExpiration) ProtoMessage() {} func (x *KeyExpiration) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[151] + mi := &file_binary_proto_def_proto_msgTypes[154] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18900,7 +19273,7 @@ func (x *KeyExpiration) ProtoReflect() protoreflect.Message { // Deprecated: Use KeyExpiration.ProtoReflect.Descriptor instead. func (*KeyExpiration) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{151} + return file_binary_proto_def_proto_rawDescGZIP(), []int{154} } func (x *KeyExpiration) GetExpiredKeyEpoch() int32 { @@ -18921,7 +19294,7 @@ type ExternalWebBetaAction struct { func (x *ExternalWebBetaAction) Reset() { *x = ExternalWebBetaAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[152] + mi := &file_binary_proto_def_proto_msgTypes[155] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18934,7 +19307,7 @@ func (x *ExternalWebBetaAction) String() string { func (*ExternalWebBetaAction) ProtoMessage() {} func (x *ExternalWebBetaAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[152] + mi := &file_binary_proto_def_proto_msgTypes[155] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18947,7 +19320,7 @@ func (x *ExternalWebBetaAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ExternalWebBetaAction.ProtoReflect.Descriptor instead. func (*ExternalWebBetaAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{152} + return file_binary_proto_def_proto_rawDescGZIP(), []int{155} } func (x *ExternalWebBetaAction) GetIsOptIn() bool { @@ -18969,7 +19342,7 @@ type DeleteMessageForMeAction struct { func (x *DeleteMessageForMeAction) Reset() { *x = DeleteMessageForMeAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[153] + mi := &file_binary_proto_def_proto_msgTypes[156] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -18982,7 +19355,7 @@ func (x *DeleteMessageForMeAction) String() string { func (*DeleteMessageForMeAction) ProtoMessage() {} func (x *DeleteMessageForMeAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[153] + mi := &file_binary_proto_def_proto_msgTypes[156] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -18995,7 +19368,7 @@ func (x *DeleteMessageForMeAction) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteMessageForMeAction.ProtoReflect.Descriptor instead. func (*DeleteMessageForMeAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{153} + return file_binary_proto_def_proto_rawDescGZIP(), []int{156} } func (x *DeleteMessageForMeAction) GetDeleteMedia() bool { @@ -19024,7 +19397,7 @@ type DeleteIndividualCallLogAction struct { func (x *DeleteIndividualCallLogAction) Reset() { *x = DeleteIndividualCallLogAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[154] + mi := &file_binary_proto_def_proto_msgTypes[157] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19037,7 +19410,7 @@ func (x *DeleteIndividualCallLogAction) String() string { func (*DeleteIndividualCallLogAction) ProtoMessage() {} func (x *DeleteIndividualCallLogAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[154] + mi := &file_binary_proto_def_proto_msgTypes[157] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19050,7 +19423,7 @@ func (x *DeleteIndividualCallLogAction) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteIndividualCallLogAction.ProtoReflect.Descriptor instead. func (*DeleteIndividualCallLogAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{154} + return file_binary_proto_def_proto_rawDescGZIP(), []int{157} } func (x *DeleteIndividualCallLogAction) GetPeerJid() string { @@ -19078,7 +19451,7 @@ type DeleteChatAction struct { func (x *DeleteChatAction) Reset() { *x = DeleteChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[155] + mi := &file_binary_proto_def_proto_msgTypes[158] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19091,7 +19464,7 @@ func (x *DeleteChatAction) String() string { func (*DeleteChatAction) ProtoMessage() {} func (x *DeleteChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[155] + mi := &file_binary_proto_def_proto_msgTypes[158] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19104,7 +19477,7 @@ func (x *DeleteChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteChatAction.ProtoReflect.Descriptor instead. func (*DeleteChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{155} + return file_binary_proto_def_proto_rawDescGZIP(), []int{158} } func (x *DeleteChatAction) GetMessageRange() *SyncActionMessageRange { @@ -19119,15 +19492,16 @@ type ContactAction struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - FullName *string `protobuf:"bytes,1,opt,name=fullName" json:"fullName,omitempty"` - FirstName *string `protobuf:"bytes,2,opt,name=firstName" json:"firstName,omitempty"` - LidJid *string `protobuf:"bytes,3,opt,name=lidJid" json:"lidJid,omitempty"` + FullName *string `protobuf:"bytes,1,opt,name=fullName" json:"fullName,omitempty"` + FirstName *string `protobuf:"bytes,2,opt,name=firstName" json:"firstName,omitempty"` + LidJid *string `protobuf:"bytes,3,opt,name=lidJid" json:"lidJid,omitempty"` + SaveOnPrimaryAddressbook *bool `protobuf:"varint,4,opt,name=saveOnPrimaryAddressbook" json:"saveOnPrimaryAddressbook,omitempty"` } func (x *ContactAction) Reset() { *x = ContactAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[156] + mi := &file_binary_proto_def_proto_msgTypes[159] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19140,7 +19514,7 @@ func (x *ContactAction) String() string { func (*ContactAction) ProtoMessage() {} func (x *ContactAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[156] + mi := &file_binary_proto_def_proto_msgTypes[159] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19153,7 +19527,7 @@ func (x *ContactAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ContactAction.ProtoReflect.Descriptor instead. func (*ContactAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{156} + return file_binary_proto_def_proto_rawDescGZIP(), []int{159} } func (x *ContactAction) GetFullName() string { @@ -19177,6 +19551,13 @@ func (x *ContactAction) GetLidJid() string { return "" } +func (x *ContactAction) GetSaveOnPrimaryAddressbook() bool { + if x != nil && x.SaveOnPrimaryAddressbook != nil { + return *x.SaveOnPrimaryAddressbook + } + return false +} + type ClearChatAction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -19188,7 +19569,7 @@ type ClearChatAction struct { func (x *ClearChatAction) Reset() { *x = ClearChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[157] + mi := &file_binary_proto_def_proto_msgTypes[160] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19201,7 +19582,7 @@ func (x *ClearChatAction) String() string { func (*ClearChatAction) ProtoMessage() {} func (x *ClearChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[157] + mi := &file_binary_proto_def_proto_msgTypes[160] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19214,7 +19595,7 @@ func (x *ClearChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ClearChatAction.ProtoReflect.Descriptor instead. func (*ClearChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{157} + return file_binary_proto_def_proto_rawDescGZIP(), []int{160} } func (x *ClearChatAction) GetMessageRange() *SyncActionMessageRange { @@ -19235,7 +19616,7 @@ type ChatAssignmentOpenedStatusAction struct { func (x *ChatAssignmentOpenedStatusAction) Reset() { *x = ChatAssignmentOpenedStatusAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[158] + mi := &file_binary_proto_def_proto_msgTypes[161] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19248,7 +19629,7 @@ func (x *ChatAssignmentOpenedStatusAction) String() string { func (*ChatAssignmentOpenedStatusAction) ProtoMessage() {} func (x *ChatAssignmentOpenedStatusAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[158] + mi := &file_binary_proto_def_proto_msgTypes[161] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19261,7 +19642,7 @@ func (x *ChatAssignmentOpenedStatusAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatAssignmentOpenedStatusAction.ProtoReflect.Descriptor instead. func (*ChatAssignmentOpenedStatusAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{158} + return file_binary_proto_def_proto_rawDescGZIP(), []int{161} } func (x *ChatAssignmentOpenedStatusAction) GetChatOpened() bool { @@ -19282,7 +19663,7 @@ type ChatAssignmentAction struct { func (x *ChatAssignmentAction) Reset() { *x = ChatAssignmentAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[159] + mi := &file_binary_proto_def_proto_msgTypes[162] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19295,7 +19676,7 @@ func (x *ChatAssignmentAction) String() string { func (*ChatAssignmentAction) ProtoMessage() {} func (x *ChatAssignmentAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[159] + mi := &file_binary_proto_def_proto_msgTypes[162] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19308,7 +19689,7 @@ func (x *ChatAssignmentAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ChatAssignmentAction.ProtoReflect.Descriptor instead. func (*ChatAssignmentAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{159} + return file_binary_proto_def_proto_rawDescGZIP(), []int{162} } func (x *ChatAssignmentAction) GetDeviceAgentID() string { @@ -19329,7 +19710,7 @@ type CallLogAction struct { func (x *CallLogAction) Reset() { *x = CallLogAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[160] + mi := &file_binary_proto_def_proto_msgTypes[163] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19342,7 +19723,7 @@ func (x *CallLogAction) String() string { func (*CallLogAction) ProtoMessage() {} func (x *CallLogAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[160] + mi := &file_binary_proto_def_proto_msgTypes[163] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19355,7 +19736,7 @@ func (x *CallLogAction) ProtoReflect() protoreflect.Message { // Deprecated: Use CallLogAction.ProtoReflect.Descriptor instead. func (*CallLogAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{160} + return file_binary_proto_def_proto_rawDescGZIP(), []int{163} } func (x *CallLogAction) GetCallLogRecord() *CallLogRecord { @@ -19376,7 +19757,7 @@ type BotWelcomeRequestAction struct { func (x *BotWelcomeRequestAction) Reset() { *x = BotWelcomeRequestAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[161] + mi := &file_binary_proto_def_proto_msgTypes[164] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19389,7 +19770,7 @@ func (x *BotWelcomeRequestAction) String() string { func (*BotWelcomeRequestAction) ProtoMessage() {} func (x *BotWelcomeRequestAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[161] + mi := &file_binary_proto_def_proto_msgTypes[164] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19402,7 +19783,7 @@ func (x *BotWelcomeRequestAction) ProtoReflect() protoreflect.Message { // Deprecated: Use BotWelcomeRequestAction.ProtoReflect.Descriptor instead. func (*BotWelcomeRequestAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{161} + return file_binary_proto_def_proto_rawDescGZIP(), []int{164} } func (x *BotWelcomeRequestAction) GetIsSent() bool { @@ -19424,7 +19805,7 @@ type ArchiveChatAction struct { func (x *ArchiveChatAction) Reset() { *x = ArchiveChatAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[162] + mi := &file_binary_proto_def_proto_msgTypes[165] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19437,7 +19818,7 @@ func (x *ArchiveChatAction) String() string { func (*ArchiveChatAction) ProtoMessage() {} func (x *ArchiveChatAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[162] + mi := &file_binary_proto_def_proto_msgTypes[165] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19450,7 +19831,7 @@ func (x *ArchiveChatAction) ProtoReflect() protoreflect.Message { // Deprecated: Use ArchiveChatAction.ProtoReflect.Descriptor instead. func (*ArchiveChatAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{162} + return file_binary_proto_def_proto_rawDescGZIP(), []int{165} } func (x *ArchiveChatAction) GetArchived() bool { @@ -19478,7 +19859,7 @@ type AndroidUnsupportedActions struct { func (x *AndroidUnsupportedActions) Reset() { *x = AndroidUnsupportedActions{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[163] + mi := &file_binary_proto_def_proto_msgTypes[166] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19491,7 +19872,7 @@ func (x *AndroidUnsupportedActions) String() string { func (*AndroidUnsupportedActions) ProtoMessage() {} func (x *AndroidUnsupportedActions) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[163] + mi := &file_binary_proto_def_proto_msgTypes[166] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19504,7 +19885,7 @@ func (x *AndroidUnsupportedActions) ProtoReflect() protoreflect.Message { // Deprecated: Use AndroidUnsupportedActions.ProtoReflect.Descriptor instead. func (*AndroidUnsupportedActions) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{163} + return file_binary_proto_def_proto_rawDescGZIP(), []int{166} } func (x *AndroidUnsupportedActions) GetAllowed() bool { @@ -19527,7 +19908,7 @@ type AgentAction struct { func (x *AgentAction) Reset() { *x = AgentAction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[164] + mi := &file_binary_proto_def_proto_msgTypes[167] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19540,7 +19921,7 @@ func (x *AgentAction) String() string { func (*AgentAction) ProtoMessage() {} func (x *AgentAction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[164] + mi := &file_binary_proto_def_proto_msgTypes[167] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19553,7 +19934,7 @@ func (x *AgentAction) ProtoReflect() protoreflect.Message { // Deprecated: Use AgentAction.ProtoReflect.Descriptor instead. func (*AgentAction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{164} + return file_binary_proto_def_proto_rawDescGZIP(), []int{167} } func (x *AgentAction) GetName() string { @@ -19591,7 +19972,7 @@ type SyncActionData struct { func (x *SyncActionData) Reset() { *x = SyncActionData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[165] + mi := &file_binary_proto_def_proto_msgTypes[168] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19604,7 +19985,7 @@ func (x *SyncActionData) String() string { func (*SyncActionData) ProtoMessage() {} func (x *SyncActionData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[165] + mi := &file_binary_proto_def_proto_msgTypes[168] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19617,7 +19998,7 @@ func (x *SyncActionData) ProtoReflect() protoreflect.Message { // Deprecated: Use SyncActionData.ProtoReflect.Descriptor instead. func (*SyncActionData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{165} + return file_binary_proto_def_proto_rawDescGZIP(), []int{168} } func (x *SyncActionData) GetIndex() []byte { @@ -19660,7 +20041,7 @@ type RecentEmojiWeight struct { func (x *RecentEmojiWeight) Reset() { *x = RecentEmojiWeight{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[166] + mi := &file_binary_proto_def_proto_msgTypes[169] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19673,7 +20054,7 @@ func (x *RecentEmojiWeight) String() string { func (*RecentEmojiWeight) ProtoMessage() {} func (x *RecentEmojiWeight) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[166] + mi := &file_binary_proto_def_proto_msgTypes[169] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19686,7 +20067,7 @@ func (x *RecentEmojiWeight) ProtoReflect() protoreflect.Message { // Deprecated: Use RecentEmojiWeight.ProtoReflect.Descriptor instead. func (*RecentEmojiWeight) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{166} + return file_binary_proto_def_proto_rawDescGZIP(), []int{169} } func (x *RecentEmojiWeight) GetEmoji() string { @@ -19708,17 +20089,23 @@ type PatchDebugData struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - CurrentLthash []byte `protobuf:"bytes,1,opt,name=currentLthash" json:"currentLthash,omitempty"` - NewLthash []byte `protobuf:"bytes,2,opt,name=newLthash" json:"newLthash,omitempty"` - PatchVersion *uint64 `protobuf:"varint,3,opt,name=patchVersion" json:"patchVersion,omitempty"` - CollectionName *string `protobuf:"bytes,4,opt,name=collectionName" json:"collectionName,omitempty"` - FirstTwoBytesFromAHashOfSnapshotMacKey []byte `protobuf:"bytes,5,opt,name=firstTwoBytesFromAHashOfSnapshotMacKey" json:"firstTwoBytesFromAHashOfSnapshotMacKey,omitempty"` + CurrentLthash []byte `protobuf:"bytes,1,opt,name=currentLthash" json:"currentLthash,omitempty"` + NewLthash []byte `protobuf:"bytes,2,opt,name=newLthash" json:"newLthash,omitempty"` + PatchVersion []byte `protobuf:"bytes,3,opt,name=patchVersion" json:"patchVersion,omitempty"` + CollectionName []byte `protobuf:"bytes,4,opt,name=collectionName" json:"collectionName,omitempty"` + FirstFourBytesFromAHashOfSnapshotMacKey []byte `protobuf:"bytes,5,opt,name=firstFourBytesFromAHashOfSnapshotMacKey" json:"firstFourBytesFromAHashOfSnapshotMacKey,omitempty"` + NewLthashSubtract []byte `protobuf:"bytes,6,opt,name=newLthashSubtract" json:"newLthashSubtract,omitempty"` + NumberAdd *int32 `protobuf:"varint,7,opt,name=numberAdd" json:"numberAdd,omitempty"` + NumberRemove *int32 `protobuf:"varint,8,opt,name=numberRemove" json:"numberRemove,omitempty"` + NumberOverride *int32 `protobuf:"varint,9,opt,name=numberOverride" json:"numberOverride,omitempty"` + SenderPlatform *PatchDebugData_Platform `protobuf:"varint,10,opt,name=senderPlatform,enum=proto.PatchDebugData_Platform" json:"senderPlatform,omitempty"` + IsSenderPrimary *bool `protobuf:"varint,11,opt,name=isSenderPrimary" json:"isSenderPrimary,omitempty"` } func (x *PatchDebugData) Reset() { *x = PatchDebugData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[167] + mi := &file_binary_proto_def_proto_msgTypes[170] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19731,7 +20118,7 @@ func (x *PatchDebugData) String() string { func (*PatchDebugData) ProtoMessage() {} func (x *PatchDebugData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[167] + mi := &file_binary_proto_def_proto_msgTypes[170] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19744,7 +20131,7 @@ func (x *PatchDebugData) ProtoReflect() protoreflect.Message { // Deprecated: Use PatchDebugData.ProtoReflect.Descriptor instead. func (*PatchDebugData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{167} + return file_binary_proto_def_proto_rawDescGZIP(), []int{170} } func (x *PatchDebugData) GetCurrentLthash() []byte { @@ -19761,25 +20148,67 @@ func (x *PatchDebugData) GetNewLthash() []byte { return nil } -func (x *PatchDebugData) GetPatchVersion() uint64 { - if x != nil && x.PatchVersion != nil { - return *x.PatchVersion +func (x *PatchDebugData) GetPatchVersion() []byte { + if x != nil { + return x.PatchVersion + } + return nil +} + +func (x *PatchDebugData) GetCollectionName() []byte { + if x != nil { + return x.CollectionName + } + return nil +} + +func (x *PatchDebugData) GetFirstFourBytesFromAHashOfSnapshotMacKey() []byte { + if x != nil { + return x.FirstFourBytesFromAHashOfSnapshotMacKey + } + return nil +} + +func (x *PatchDebugData) GetNewLthashSubtract() []byte { + if x != nil { + return x.NewLthashSubtract + } + return nil +} + +func (x *PatchDebugData) GetNumberAdd() int32 { + if x != nil && x.NumberAdd != nil { + return *x.NumberAdd } return 0 } -func (x *PatchDebugData) GetCollectionName() string { - if x != nil && x.CollectionName != nil { - return *x.CollectionName +func (x *PatchDebugData) GetNumberRemove() int32 { + if x != nil && x.NumberRemove != nil { + return *x.NumberRemove } - return "" + return 0 } -func (x *PatchDebugData) GetFirstTwoBytesFromAHashOfSnapshotMacKey() []byte { - if x != nil { - return x.FirstTwoBytesFromAHashOfSnapshotMacKey +func (x *PatchDebugData) GetNumberOverride() int32 { + if x != nil && x.NumberOverride != nil { + return *x.NumberOverride } - return nil + return 0 +} + +func (x *PatchDebugData) GetSenderPlatform() PatchDebugData_Platform { + if x != nil && x.SenderPlatform != nil { + return *x.SenderPlatform + } + return PatchDebugData_ANDROID +} + +func (x *PatchDebugData) GetIsSenderPrimary() bool { + if x != nil && x.IsSenderPrimary != nil { + return *x.IsSenderPrimary + } + return false } type CallLogRecord struct { @@ -19807,7 +20236,7 @@ type CallLogRecord struct { func (x *CallLogRecord) Reset() { *x = CallLogRecord{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[168] + mi := &file_binary_proto_def_proto_msgTypes[171] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19820,7 +20249,7 @@ func (x *CallLogRecord) String() string { func (*CallLogRecord) ProtoMessage() {} func (x *CallLogRecord) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[168] + mi := &file_binary_proto_def_proto_msgTypes[171] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19833,7 +20262,7 @@ func (x *CallLogRecord) ProtoReflect() protoreflect.Message { // Deprecated: Use CallLogRecord.ProtoReflect.Descriptor instead. func (*CallLogRecord) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171} } func (x *CallLogRecord) GetCallResult() CallLogRecord_CallResult { @@ -19954,7 +20383,7 @@ type VerifiedNameCertificate struct { func (x *VerifiedNameCertificate) Reset() { *x = VerifiedNameCertificate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[169] + mi := &file_binary_proto_def_proto_msgTypes[172] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -19967,7 +20396,7 @@ func (x *VerifiedNameCertificate) String() string { func (*VerifiedNameCertificate) ProtoMessage() {} func (x *VerifiedNameCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[169] + mi := &file_binary_proto_def_proto_msgTypes[172] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -19980,7 +20409,7 @@ func (x *VerifiedNameCertificate) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifiedNameCertificate.ProtoReflect.Descriptor instead. func (*VerifiedNameCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{169} + return file_binary_proto_def_proto_rawDescGZIP(), []int{172} } func (x *VerifiedNameCertificate) GetDetails() []byte { @@ -20017,7 +20446,7 @@ type LocalizedName struct { func (x *LocalizedName) Reset() { *x = LocalizedName{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[170] + mi := &file_binary_proto_def_proto_msgTypes[173] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20030,7 +20459,7 @@ func (x *LocalizedName) String() string { func (*LocalizedName) ProtoMessage() {} func (x *LocalizedName) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[170] + mi := &file_binary_proto_def_proto_msgTypes[173] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20043,7 +20472,7 @@ func (x *LocalizedName) ProtoReflect() protoreflect.Message { // Deprecated: Use LocalizedName.ProtoReflect.Descriptor instead. func (*LocalizedName) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{170} + return file_binary_proto_def_proto_rawDescGZIP(), []int{173} } func (x *LocalizedName) GetLg() string { @@ -20085,7 +20514,7 @@ type BizIdentityInfo struct { func (x *BizIdentityInfo) Reset() { *x = BizIdentityInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[171] + mi := &file_binary_proto_def_proto_msgTypes[174] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20098,7 +20527,7 @@ func (x *BizIdentityInfo) String() string { func (*BizIdentityInfo) ProtoMessage() {} func (x *BizIdentityInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[171] + mi := &file_binary_proto_def_proto_msgTypes[174] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20111,7 +20540,7 @@ func (x *BizIdentityInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BizIdentityInfo.ProtoReflect.Descriptor instead. func (*BizIdentityInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{171} + return file_binary_proto_def_proto_rawDescGZIP(), []int{174} } func (x *BizIdentityInfo) GetVlevel() BizIdentityInfo_VerifiedLevelValue { @@ -20182,7 +20611,7 @@ type BizAccountPayload struct { func (x *BizAccountPayload) Reset() { *x = BizAccountPayload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[172] + mi := &file_binary_proto_def_proto_msgTypes[175] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20195,7 +20624,7 @@ func (x *BizAccountPayload) String() string { func (*BizAccountPayload) ProtoMessage() {} func (x *BizAccountPayload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[172] + mi := &file_binary_proto_def_proto_msgTypes[175] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20208,7 +20637,7 @@ func (x *BizAccountPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use BizAccountPayload.ProtoReflect.Descriptor instead. func (*BizAccountPayload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{172} + return file_binary_proto_def_proto_rawDescGZIP(), []int{175} } func (x *BizAccountPayload) GetVnameCert() *VerifiedNameCertificate { @@ -20240,7 +20669,7 @@ type BizAccountLinkInfo struct { func (x *BizAccountLinkInfo) Reset() { *x = BizAccountLinkInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[173] + mi := &file_binary_proto_def_proto_msgTypes[176] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20253,7 +20682,7 @@ func (x *BizAccountLinkInfo) String() string { func (*BizAccountLinkInfo) ProtoMessage() {} func (x *BizAccountLinkInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[173] + mi := &file_binary_proto_def_proto_msgTypes[176] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20266,7 +20695,7 @@ func (x *BizAccountLinkInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use BizAccountLinkInfo.ProtoReflect.Descriptor instead. func (*BizAccountLinkInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{173} + return file_binary_proto_def_proto_rawDescGZIP(), []int{176} } func (x *BizAccountLinkInfo) GetWhatsappBizAcctFbid() uint64 { @@ -20317,7 +20746,7 @@ type HandshakeMessage struct { func (x *HandshakeMessage) Reset() { *x = HandshakeMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[174] + mi := &file_binary_proto_def_proto_msgTypes[177] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20330,7 +20759,7 @@ func (x *HandshakeMessage) String() string { func (*HandshakeMessage) ProtoMessage() {} func (x *HandshakeMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[174] + mi := &file_binary_proto_def_proto_msgTypes[177] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20343,7 +20772,7 @@ func (x *HandshakeMessage) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeMessage.ProtoReflect.Descriptor instead. func (*HandshakeMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{174} + return file_binary_proto_def_proto_rawDescGZIP(), []int{177} } func (x *HandshakeMessage) GetClientHello() *HandshakeClientHello { @@ -20380,7 +20809,7 @@ type HandshakeServerHello struct { func (x *HandshakeServerHello) Reset() { *x = HandshakeServerHello{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[175] + mi := &file_binary_proto_def_proto_msgTypes[178] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20393,7 +20822,7 @@ func (x *HandshakeServerHello) String() string { func (*HandshakeServerHello) ProtoMessage() {} func (x *HandshakeServerHello) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[175] + mi := &file_binary_proto_def_proto_msgTypes[178] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20406,7 +20835,7 @@ func (x *HandshakeServerHello) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeServerHello.ProtoReflect.Descriptor instead. func (*HandshakeServerHello) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{175} + return file_binary_proto_def_proto_rawDescGZIP(), []int{178} } func (x *HandshakeServerHello) GetEphemeral() []byte { @@ -20443,7 +20872,7 @@ type HandshakeClientHello struct { func (x *HandshakeClientHello) Reset() { *x = HandshakeClientHello{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[176] + mi := &file_binary_proto_def_proto_msgTypes[179] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20456,7 +20885,7 @@ func (x *HandshakeClientHello) String() string { func (*HandshakeClientHello) ProtoMessage() {} func (x *HandshakeClientHello) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[176] + mi := &file_binary_proto_def_proto_msgTypes[179] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20469,7 +20898,7 @@ func (x *HandshakeClientHello) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeClientHello.ProtoReflect.Descriptor instead. func (*HandshakeClientHello) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{176} + return file_binary_proto_def_proto_rawDescGZIP(), []int{179} } func (x *HandshakeClientHello) GetEphemeral() []byte { @@ -20505,7 +20934,7 @@ type HandshakeClientFinish struct { func (x *HandshakeClientFinish) Reset() { *x = HandshakeClientFinish{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[177] + mi := &file_binary_proto_def_proto_msgTypes[180] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20518,7 +20947,7 @@ func (x *HandshakeClientFinish) String() string { func (*HandshakeClientFinish) ProtoMessage() {} func (x *HandshakeClientFinish) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[177] + mi := &file_binary_proto_def_proto_msgTypes[180] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20531,7 +20960,7 @@ func (x *HandshakeClientFinish) ProtoReflect() protoreflect.Message { // Deprecated: Use HandshakeClientFinish.ProtoReflect.Descriptor instead. func (*HandshakeClientFinish) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{177} + return file_binary_proto_def_proto_rawDescGZIP(), []int{180} } func (x *HandshakeClientFinish) GetStatic() []byte { @@ -20585,7 +21014,7 @@ type ClientPayload struct { func (x *ClientPayload) Reset() { *x = ClientPayload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[178] + mi := &file_binary_proto_def_proto_msgTypes[181] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20598,7 +21027,7 @@ func (x *ClientPayload) String() string { func (*ClientPayload) ProtoMessage() {} func (x *ClientPayload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[178] + mi := &file_binary_proto_def_proto_msgTypes[181] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20611,7 +21040,7 @@ func (x *ClientPayload) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload.ProtoReflect.Descriptor instead. func (*ClientPayload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181} } func (x *ClientPayload) GetUsername() uint64 { @@ -20817,7 +21246,7 @@ type WebNotificationsInfo struct { func (x *WebNotificationsInfo) Reset() { *x = WebNotificationsInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[179] + mi := &file_binary_proto_def_proto_msgTypes[182] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20830,7 +21259,7 @@ func (x *WebNotificationsInfo) String() string { func (*WebNotificationsInfo) ProtoMessage() {} func (x *WebNotificationsInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[179] + mi := &file_binary_proto_def_proto_msgTypes[182] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20843,7 +21272,7 @@ func (x *WebNotificationsInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WebNotificationsInfo.ProtoReflect.Descriptor instead. func (*WebNotificationsInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{179} + return file_binary_proto_def_proto_rawDescGZIP(), []int{182} } func (x *WebNotificationsInfo) GetTimestamp() uint64 { @@ -20928,12 +21357,15 @@ type WebMessageInfo struct { IsGroupHistoryMessage *bool `protobuf:"varint,57,opt,name=isGroupHistoryMessage" json:"isGroupHistoryMessage,omitempty"` BotMessageInvokerJid *string `protobuf:"bytes,58,opt,name=botMessageInvokerJid" json:"botMessageInvokerJid,omitempty"` CommentMetadata *CommentMetadata `protobuf:"bytes,59,opt,name=commentMetadata" json:"commentMetadata,omitempty"` + EventResponses []*EventResponse `protobuf:"bytes,61,rep,name=eventResponses" json:"eventResponses,omitempty"` + ReportingTokenInfo *ReportingTokenInfo `protobuf:"bytes,62,opt,name=reportingTokenInfo" json:"reportingTokenInfo,omitempty"` + NewsletterServerId *uint64 `protobuf:"varint,63,opt,name=newsletterServerId" json:"newsletterServerId,omitempty"` } func (x *WebMessageInfo) Reset() { *x = WebMessageInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[180] + mi := &file_binary_proto_def_proto_msgTypes[183] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -20946,7 +21378,7 @@ func (x *WebMessageInfo) String() string { func (*WebMessageInfo) ProtoMessage() {} func (x *WebMessageInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[180] + mi := &file_binary_proto_def_proto_msgTypes[183] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -20959,7 +21391,7 @@ func (x *WebMessageInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use WebMessageInfo.ProtoReflect.Descriptor instead. func (*WebMessageInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{180} + return file_binary_proto_def_proto_rawDescGZIP(), []int{183} } func (x *WebMessageInfo) GetKey() *MessageKey { @@ -21305,6 +21737,27 @@ func (x *WebMessageInfo) GetCommentMetadata() *CommentMetadata { return nil } +func (x *WebMessageInfo) GetEventResponses() []*EventResponse { + if x != nil { + return x.EventResponses + } + return nil +} + +func (x *WebMessageInfo) GetReportingTokenInfo() *ReportingTokenInfo { + if x != nil { + return x.ReportingTokenInfo + } + return nil +} + +func (x *WebMessageInfo) GetNewsletterServerId() uint64 { + if x != nil && x.NewsletterServerId != nil { + return *x.NewsletterServerId + } + return 0 +} + type WebFeatures struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -21360,7 +21813,7 @@ type WebFeatures struct { func (x *WebFeatures) Reset() { *x = WebFeatures{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[181] + mi := &file_binary_proto_def_proto_msgTypes[184] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21373,7 +21826,7 @@ func (x *WebFeatures) String() string { func (*WebFeatures) ProtoMessage() {} func (x *WebFeatures) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[181] + mi := &file_binary_proto_def_proto_msgTypes[184] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21386,7 +21839,7 @@ func (x *WebFeatures) ProtoReflect() protoreflect.Message { // Deprecated: Use WebFeatures.ProtoReflect.Descriptor instead. func (*WebFeatures) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{181} + return file_binary_proto_def_proto_rawDescGZIP(), []int{184} } func (x *WebFeatures) GetLabelsDisplay() WebFeatures_Flag { @@ -21720,7 +22173,7 @@ type UserReceipt struct { func (x *UserReceipt) Reset() { *x = UserReceipt{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[182] + mi := &file_binary_proto_def_proto_msgTypes[185] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21733,7 +22186,7 @@ func (x *UserReceipt) String() string { func (*UserReceipt) ProtoMessage() {} func (x *UserReceipt) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[182] + mi := &file_binary_proto_def_proto_msgTypes[185] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21746,7 +22199,7 @@ func (x *UserReceipt) ProtoReflect() protoreflect.Message { // Deprecated: Use UserReceipt.ProtoReflect.Descriptor instead. func (*UserReceipt) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{182} + return file_binary_proto_def_proto_rawDescGZIP(), []int{185} } func (x *UserReceipt) GetUserJid() string { @@ -21803,7 +22256,7 @@ type StatusPSA struct { func (x *StatusPSA) Reset() { *x = StatusPSA{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[183] + mi := &file_binary_proto_def_proto_msgTypes[186] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21816,7 +22269,7 @@ func (x *StatusPSA) String() string { func (*StatusPSA) ProtoMessage() {} func (x *StatusPSA) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[183] + mi := &file_binary_proto_def_proto_msgTypes[186] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21829,7 +22282,7 @@ func (x *StatusPSA) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusPSA.ProtoReflect.Descriptor instead. func (*StatusPSA) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{183} + return file_binary_proto_def_proto_rawDescGZIP(), []int{186} } func (x *StatusPSA) GetCampaignId() uint64 { @@ -21846,6 +22299,53 @@ func (x *StatusPSA) GetCampaignExpirationTimestamp() uint64 { return 0 } +type ReportingTokenInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ReportingTag []byte `protobuf:"bytes,1,opt,name=reportingTag" json:"reportingTag,omitempty"` +} + +func (x *ReportingTokenInfo) Reset() { + *x = ReportingTokenInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[187] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ReportingTokenInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ReportingTokenInfo) ProtoMessage() {} + +func (x *ReportingTokenInfo) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[187] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ReportingTokenInfo.ProtoReflect.Descriptor instead. +func (*ReportingTokenInfo) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{187} +} + +func (x *ReportingTokenInfo) GetReportingTag() []byte { + if x != nil { + return x.ReportingTag + } + return nil +} + type Reaction struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -21861,7 +22361,7 @@ type Reaction struct { func (x *Reaction) Reset() { *x = Reaction{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[184] + mi := &file_binary_proto_def_proto_msgTypes[188] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21874,7 +22374,7 @@ func (x *Reaction) String() string { func (*Reaction) ProtoMessage() {} func (x *Reaction) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[184] + mi := &file_binary_proto_def_proto_msgTypes[188] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21887,7 +22387,7 @@ func (x *Reaction) ProtoReflect() protoreflect.Message { // Deprecated: Use Reaction.ProtoReflect.Descriptor instead. func (*Reaction) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{184} + return file_binary_proto_def_proto_rawDescGZIP(), []int{188} } func (x *Reaction) GetKey() *MessageKey { @@ -21936,7 +22436,7 @@ type PremiumMessageInfo struct { func (x *PremiumMessageInfo) Reset() { *x = PremiumMessageInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[185] + mi := &file_binary_proto_def_proto_msgTypes[189] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -21949,7 +22449,7 @@ func (x *PremiumMessageInfo) String() string { func (*PremiumMessageInfo) ProtoMessage() {} func (x *PremiumMessageInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[185] + mi := &file_binary_proto_def_proto_msgTypes[189] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -21962,7 +22462,7 @@ func (x *PremiumMessageInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PremiumMessageInfo.ProtoReflect.Descriptor instead. func (*PremiumMessageInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{185} + return file_binary_proto_def_proto_rawDescGZIP(), []int{189} } func (x *PremiumMessageInfo) GetServerCampaignId() string { @@ -21987,7 +22487,7 @@ type PollUpdate struct { func (x *PollUpdate) Reset() { *x = PollUpdate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[186] + mi := &file_binary_proto_def_proto_msgTypes[190] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22000,7 +22500,7 @@ func (x *PollUpdate) String() string { func (*PollUpdate) ProtoMessage() {} func (x *PollUpdate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[186] + mi := &file_binary_proto_def_proto_msgTypes[190] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22013,7 +22513,7 @@ func (x *PollUpdate) ProtoReflect() protoreflect.Message { // Deprecated: Use PollUpdate.ProtoReflect.Descriptor instead. func (*PollUpdate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{186} + return file_binary_proto_def_proto_rawDescGZIP(), []int{190} } func (x *PollUpdate) GetPollUpdateMessageKey() *MessageKey { @@ -22062,7 +22562,7 @@ type PollAdditionalMetadata struct { func (x *PollAdditionalMetadata) Reset() { *x = PollAdditionalMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[187] + mi := &file_binary_proto_def_proto_msgTypes[191] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22075,7 +22575,7 @@ func (x *PollAdditionalMetadata) String() string { func (*PollAdditionalMetadata) ProtoMessage() {} func (x *PollAdditionalMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[187] + mi := &file_binary_proto_def_proto_msgTypes[191] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22088,7 +22588,7 @@ func (x *PollAdditionalMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use PollAdditionalMetadata.ProtoReflect.Descriptor instead. func (*PollAdditionalMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{187} + return file_binary_proto_def_proto_rawDescGZIP(), []int{191} } func (x *PollAdditionalMetadata) GetPollInvalidated() bool { @@ -22113,7 +22613,7 @@ type PinInChat struct { func (x *PinInChat) Reset() { *x = PinInChat{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[188] + mi := &file_binary_proto_def_proto_msgTypes[192] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22126,7 +22626,7 @@ func (x *PinInChat) String() string { func (*PinInChat) ProtoMessage() {} func (x *PinInChat) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[188] + mi := &file_binary_proto_def_proto_msgTypes[192] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22139,7 +22639,7 @@ func (x *PinInChat) ProtoReflect() protoreflect.Message { // Deprecated: Use PinInChat.ProtoReflect.Descriptor instead. func (*PinInChat) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{188} + return file_binary_proto_def_proto_rawDescGZIP(), []int{192} } func (x *PinInChat) GetType() PinInChat_Type { @@ -22190,7 +22690,7 @@ type PhotoChange struct { func (x *PhotoChange) Reset() { *x = PhotoChange{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[189] + mi := &file_binary_proto_def_proto_msgTypes[193] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22203,7 +22703,7 @@ func (x *PhotoChange) String() string { func (*PhotoChange) ProtoMessage() {} func (x *PhotoChange) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[189] + mi := &file_binary_proto_def_proto_msgTypes[193] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22216,7 +22716,7 @@ func (x *PhotoChange) ProtoReflect() protoreflect.Message { // Deprecated: Use PhotoChange.ProtoReflect.Descriptor instead. func (*PhotoChange) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{189} + return file_binary_proto_def_proto_rawDescGZIP(), []int{193} } func (x *PhotoChange) GetOldPhoto() []byte { @@ -22263,7 +22763,7 @@ type PaymentInfo struct { func (x *PaymentInfo) Reset() { *x = PaymentInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[190] + mi := &file_binary_proto_def_proto_msgTypes[194] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22276,7 +22776,7 @@ func (x *PaymentInfo) String() string { func (*PaymentInfo) ProtoMessage() {} func (x *PaymentInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[190] + mi := &file_binary_proto_def_proto_msgTypes[194] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22289,7 +22789,7 @@ func (x *PaymentInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentInfo.ProtoReflect.Descriptor instead. func (*PaymentInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{190} + return file_binary_proto_def_proto_rawDescGZIP(), []int{194} } func (x *PaymentInfo) GetCurrencyDeprecated() PaymentInfo_Currency { @@ -22397,7 +22897,7 @@ type NotificationMessageInfo struct { func (x *NotificationMessageInfo) Reset() { *x = NotificationMessageInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[191] + mi := &file_binary_proto_def_proto_msgTypes[195] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22410,7 +22910,7 @@ func (x *NotificationMessageInfo) String() string { func (*NotificationMessageInfo) ProtoMessage() {} func (x *NotificationMessageInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[191] + mi := &file_binary_proto_def_proto_msgTypes[195] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22423,7 +22923,7 @@ func (x *NotificationMessageInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use NotificationMessageInfo.ProtoReflect.Descriptor instead. func (*NotificationMessageInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{191} + return file_binary_proto_def_proto_rawDescGZIP(), []int{195} } func (x *NotificationMessageInfo) GetKey() *MessageKey { @@ -22465,7 +22965,7 @@ type MessageAddOnContextInfo struct { func (x *MessageAddOnContextInfo) Reset() { *x = MessageAddOnContextInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[192] + mi := &file_binary_proto_def_proto_msgTypes[196] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22478,7 +22978,7 @@ func (x *MessageAddOnContextInfo) String() string { func (*MessageAddOnContextInfo) ProtoMessage() {} func (x *MessageAddOnContextInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[192] + mi := &file_binary_proto_def_proto_msgTypes[196] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22491,7 +22991,7 @@ func (x *MessageAddOnContextInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use MessageAddOnContextInfo.ProtoReflect.Descriptor instead. func (*MessageAddOnContextInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{192} + return file_binary_proto_def_proto_rawDescGZIP(), []int{196} } func (x *MessageAddOnContextInfo) GetMessageAddOnDurationInSecs() uint32 { @@ -22512,7 +23012,7 @@ type MediaData struct { func (x *MediaData) Reset() { *x = MediaData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[193] + mi := &file_binary_proto_def_proto_msgTypes[197] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22525,7 +23025,7 @@ func (x *MediaData) String() string { func (*MediaData) ProtoMessage() {} func (x *MediaData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[193] + mi := &file_binary_proto_def_proto_msgTypes[197] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22538,7 +23038,7 @@ func (x *MediaData) ProtoReflect() protoreflect.Message { // Deprecated: Use MediaData.ProtoReflect.Descriptor instead. func (*MediaData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{193} + return file_binary_proto_def_proto_rawDescGZIP(), []int{197} } func (x *MediaData) GetLocalPath() string { @@ -22564,7 +23064,7 @@ type KeepInChat struct { func (x *KeepInChat) Reset() { *x = KeepInChat{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[194] + mi := &file_binary_proto_def_proto_msgTypes[198] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22577,7 +23077,7 @@ func (x *KeepInChat) String() string { func (*KeepInChat) ProtoMessage() {} func (x *KeepInChat) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[194] + mi := &file_binary_proto_def_proto_msgTypes[198] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22590,7 +23090,7 @@ func (x *KeepInChat) ProtoReflect() protoreflect.Message { // Deprecated: Use KeepInChat.ProtoReflect.Descriptor instead. func (*KeepInChat) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{194} + return file_binary_proto_def_proto_rawDescGZIP(), []int{198} } func (x *KeepInChat) GetKeepType() KeepType { @@ -22635,6 +23135,77 @@ func (x *KeepInChat) GetServerTimestampMs() int64 { return 0 } +type EventResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + EventResponseMessageKey *MessageKey `protobuf:"bytes,1,opt,name=eventResponseMessageKey" json:"eventResponseMessageKey,omitempty"` + TimestampMs *int64 `protobuf:"varint,2,opt,name=timestampMs" json:"timestampMs,omitempty"` + EventResponseMessage *EventResponseMessage `protobuf:"bytes,3,opt,name=eventResponseMessage" json:"eventResponseMessage,omitempty"` + Unread *bool `protobuf:"varint,4,opt,name=unread" json:"unread,omitempty"` +} + +func (x *EventResponse) Reset() { + *x = EventResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[199] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *EventResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*EventResponse) ProtoMessage() {} + +func (x *EventResponse) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[199] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use EventResponse.ProtoReflect.Descriptor instead. +func (*EventResponse) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{199} +} + +func (x *EventResponse) GetEventResponseMessageKey() *MessageKey { + if x != nil { + return x.EventResponseMessageKey + } + return nil +} + +func (x *EventResponse) GetTimestampMs() int64 { + if x != nil && x.TimestampMs != nil { + return *x.TimestampMs + } + return 0 +} + +func (x *EventResponse) GetEventResponseMessage() *EventResponseMessage { + if x != nil { + return x.EventResponseMessage + } + return nil +} + +func (x *EventResponse) GetUnread() bool { + if x != nil && x.Unread != nil { + return *x.Unread + } + return false +} + type CommentMetadata struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -22647,7 +23218,7 @@ type CommentMetadata struct { func (x *CommentMetadata) Reset() { *x = CommentMetadata{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[195] + mi := &file_binary_proto_def_proto_msgTypes[200] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22660,7 +23231,7 @@ func (x *CommentMetadata) String() string { func (*CommentMetadata) ProtoMessage() {} func (x *CommentMetadata) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[195] + mi := &file_binary_proto_def_proto_msgTypes[200] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22673,7 +23244,7 @@ func (x *CommentMetadata) ProtoReflect() protoreflect.Message { // Deprecated: Use CommentMetadata.ProtoReflect.Descriptor instead. func (*CommentMetadata) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{195} + return file_binary_proto_def_proto_rawDescGZIP(), []int{200} } func (x *CommentMetadata) GetCommentParentKey() *MessageKey { @@ -22702,7 +23273,7 @@ type NoiseCertificate struct { func (x *NoiseCertificate) Reset() { *x = NoiseCertificate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[196] + mi := &file_binary_proto_def_proto_msgTypes[201] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22715,7 +23286,7 @@ func (x *NoiseCertificate) String() string { func (*NoiseCertificate) ProtoMessage() {} func (x *NoiseCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[196] + mi := &file_binary_proto_def_proto_msgTypes[201] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22728,7 +23299,7 @@ func (x *NoiseCertificate) ProtoReflect() protoreflect.Message { // Deprecated: Use NoiseCertificate.ProtoReflect.Descriptor instead. func (*NoiseCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{196} + return file_binary_proto_def_proto_rawDescGZIP(), []int{201} } func (x *NoiseCertificate) GetDetails() []byte { @@ -22757,7 +23328,7 @@ type CertChain struct { func (x *CertChain) Reset() { *x = CertChain{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[197] + mi := &file_binary_proto_def_proto_msgTypes[202] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22770,7 +23341,7 @@ func (x *CertChain) String() string { func (*CertChain) ProtoMessage() {} func (x *CertChain) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[197] + mi := &file_binary_proto_def_proto_msgTypes[202] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22783,7 +23354,7 @@ func (x *CertChain) ProtoReflect() protoreflect.Message { // Deprecated: Use CertChain.ProtoReflect.Descriptor instead. func (*CertChain) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{197} + return file_binary_proto_def_proto_rawDescGZIP(), []int{202} } func (x *CertChain) GetLeaf() *CertChain_NoiseCertificate { @@ -22809,7 +23380,7 @@ type QP struct { func (x *QP) Reset() { *x = QP{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[198] + mi := &file_binary_proto_def_proto_msgTypes[203] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22822,7 +23393,7 @@ func (x *QP) String() string { func (*QP) ProtoMessage() {} func (x *QP) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[198] + mi := &file_binary_proto_def_proto_msgTypes[203] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22835,7 +23406,7 @@ func (x *QP) ProtoReflect() protoreflect.Message { // Deprecated: Use QP.ProtoReflect.Descriptor instead. func (*QP) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{198} + return file_binary_proto_def_proto_rawDescGZIP(), []int{203} } type DeviceProps_HistorySyncConfig struct { @@ -22856,7 +23427,7 @@ type DeviceProps_HistorySyncConfig struct { func (x *DeviceProps_HistorySyncConfig) Reset() { *x = DeviceProps_HistorySyncConfig{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[199] + mi := &file_binary_proto_def_proto_msgTypes[204] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22869,7 +23440,7 @@ func (x *DeviceProps_HistorySyncConfig) String() string { func (*DeviceProps_HistorySyncConfig) ProtoMessage() {} func (x *DeviceProps_HistorySyncConfig) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[199] + mi := &file_binary_proto_def_proto_msgTypes[204] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -22956,7 +23527,7 @@ type DeviceProps_AppVersion struct { func (x *DeviceProps_AppVersion) Reset() { *x = DeviceProps_AppVersion{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[200] + mi := &file_binary_proto_def_proto_msgTypes[205] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -22969,7 +23540,7 @@ func (x *DeviceProps_AppVersion) String() string { func (*DeviceProps_AppVersion) ProtoMessage() {} func (x *DeviceProps_AppVersion) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[200] + mi := &file_binary_proto_def_proto_msgTypes[205] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23033,7 +23604,7 @@ type InteractiveMessage_ShopMessage struct { func (x *InteractiveMessage_ShopMessage) Reset() { *x = InteractiveMessage_ShopMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[201] + mi := &file_binary_proto_def_proto_msgTypes[206] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23046,7 +23617,7 @@ func (x *InteractiveMessage_ShopMessage) String() string { func (*InteractiveMessage_ShopMessage) ProtoMessage() {} func (x *InteractiveMessage_ShopMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[201] + mi := &file_binary_proto_def_proto_msgTypes[206] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23096,7 +23667,7 @@ type InteractiveMessage_NativeFlowMessage struct { func (x *InteractiveMessage_NativeFlowMessage) Reset() { *x = InteractiveMessage_NativeFlowMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[202] + mi := &file_binary_proto_def_proto_msgTypes[207] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23109,7 +23680,7 @@ func (x *InteractiveMessage_NativeFlowMessage) String() string { func (*InteractiveMessage_NativeFlowMessage) ProtoMessage() {} func (x *InteractiveMessage_NativeFlowMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[202] + mi := &file_binary_proto_def_proto_msgTypes[207] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23167,7 +23738,7 @@ type InteractiveMessage_Header struct { func (x *InteractiveMessage_Header) Reset() { *x = InteractiveMessage_Header{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[203] + mi := &file_binary_proto_def_proto_msgTypes[208] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23180,7 +23751,7 @@ func (x *InteractiveMessage_Header) String() string { func (*InteractiveMessage_Header) ProtoMessage() {} func (x *InteractiveMessage_Header) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[203] + mi := &file_binary_proto_def_proto_msgTypes[208] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23304,7 +23875,7 @@ type InteractiveMessage_Footer struct { func (x *InteractiveMessage_Footer) Reset() { *x = InteractiveMessage_Footer{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[204] + mi := &file_binary_proto_def_proto_msgTypes[209] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23317,7 +23888,7 @@ func (x *InteractiveMessage_Footer) String() string { func (*InteractiveMessage_Footer) ProtoMessage() {} func (x *InteractiveMessage_Footer) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[204] + mi := &file_binary_proto_def_proto_msgTypes[209] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23353,7 +23924,7 @@ type InteractiveMessage_CollectionMessage struct { func (x *InteractiveMessage_CollectionMessage) Reset() { *x = InteractiveMessage_CollectionMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[205] + mi := &file_binary_proto_def_proto_msgTypes[210] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23366,7 +23937,7 @@ func (x *InteractiveMessage_CollectionMessage) String() string { func (*InteractiveMessage_CollectionMessage) ProtoMessage() {} func (x *InteractiveMessage_CollectionMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[205] + mi := &file_binary_proto_def_proto_msgTypes[210] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23415,7 +23986,7 @@ type InteractiveMessage_CarouselMessage struct { func (x *InteractiveMessage_CarouselMessage) Reset() { *x = InteractiveMessage_CarouselMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[206] + mi := &file_binary_proto_def_proto_msgTypes[211] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23428,7 +23999,7 @@ func (x *InteractiveMessage_CarouselMessage) String() string { func (*InteractiveMessage_CarouselMessage) ProtoMessage() {} func (x *InteractiveMessage_CarouselMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[206] + mi := &file_binary_proto_def_proto_msgTypes[211] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23469,7 +24040,7 @@ type InteractiveMessage_Body struct { func (x *InteractiveMessage_Body) Reset() { *x = InteractiveMessage_Body{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[207] + mi := &file_binary_proto_def_proto_msgTypes[212] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23482,7 +24053,7 @@ func (x *InteractiveMessage_Body) String() string { func (*InteractiveMessage_Body) ProtoMessage() {} func (x *InteractiveMessage_Body) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[207] + mi := &file_binary_proto_def_proto_msgTypes[212] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23517,7 +24088,7 @@ type InteractiveMessage_NativeFlowMessage_NativeFlowButton struct { func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) Reset() { *x = InteractiveMessage_NativeFlowMessage_NativeFlowButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[208] + mi := &file_binary_proto_def_proto_msgTypes[213] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23530,7 +24101,7 @@ func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) String() string func (*InteractiveMessage_NativeFlowMessage_NativeFlowButton) ProtoMessage() {} func (x *InteractiveMessage_NativeFlowMessage_NativeFlowButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[208] + mi := &file_binary_proto_def_proto_msgTypes[213] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23576,7 +24147,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter struct { func (x *HighlyStructuredMessage_HSMLocalizableParameter) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[209] + mi := &file_binary_proto_def_proto_msgTypes[214] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23589,7 +24160,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter) String() string { func (*HighlyStructuredMessage_HSMLocalizableParameter) ProtoMessage() {} func (x *HighlyStructuredMessage_HSMLocalizableParameter) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[209] + mi := &file_binary_proto_def_proto_msgTypes[214] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23666,7 +24237,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime struct { func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[210] + mi := &file_binary_proto_def_proto_msgTypes[215] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23679,7 +24250,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) String() s func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) ProtoMessage() {} func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[210] + mi := &file_binary_proto_def_proto_msgTypes[215] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23746,7 +24317,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency struct { func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[211] + mi := &file_binary_proto_def_proto_msgTypes[216] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23759,7 +24330,7 @@ func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) String() s func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) ProtoMessage() {} func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[211] + mi := &file_binary_proto_def_proto_msgTypes[216] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23800,7 +24371,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnix func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[212] + mi := &file_binary_proto_def_proto_msgTypes[217] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23814,7 +24385,7 @@ func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUn } func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[212] + mi := &file_binary_proto_def_proto_msgTypes[217] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23854,7 +24425,7 @@ type HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComp func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent) Reset() { *x = HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[213] + mi := &file_binary_proto_def_proto_msgTypes[218] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23868,7 +24439,7 @@ func (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeCo } func (x *HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[213] + mi := &file_binary_proto_def_proto_msgTypes[218] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -23945,7 +24516,7 @@ type CallLogMessage_CallParticipant struct { func (x *CallLogMessage_CallParticipant) Reset() { *x = CallLogMessage_CallParticipant{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[214] + mi := &file_binary_proto_def_proto_msgTypes[219] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -23958,7 +24529,7 @@ func (x *CallLogMessage_CallParticipant) String() string { func (*CallLogMessage_CallParticipant) ProtoMessage() {} func (x *CallLogMessage_CallParticipant) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[214] + mi := &file_binary_proto_def_proto_msgTypes[219] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24002,7 +24573,7 @@ type ButtonsMessage_Button struct { func (x *ButtonsMessage_Button) Reset() { *x = ButtonsMessage_Button{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[215] + mi := &file_binary_proto_def_proto_msgTypes[220] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24015,7 +24586,7 @@ func (x *ButtonsMessage_Button) String() string { func (*ButtonsMessage_Button) ProtoMessage() {} func (x *ButtonsMessage_Button) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[215] + mi := &file_binary_proto_def_proto_msgTypes[220] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24071,7 +24642,7 @@ type ButtonsMessage_Button_NativeFlowInfo struct { func (x *ButtonsMessage_Button_NativeFlowInfo) Reset() { *x = ButtonsMessage_Button_NativeFlowInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[216] + mi := &file_binary_proto_def_proto_msgTypes[221] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24084,7 +24655,7 @@ func (x *ButtonsMessage_Button_NativeFlowInfo) String() string { func (*ButtonsMessage_Button_NativeFlowInfo) ProtoMessage() {} func (x *ButtonsMessage_Button_NativeFlowInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[216] + mi := &file_binary_proto_def_proto_msgTypes[221] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24125,7 +24696,7 @@ type ButtonsMessage_Button_ButtonText struct { func (x *ButtonsMessage_Button_ButtonText) Reset() { *x = ButtonsMessage_Button_ButtonText{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[217] + mi := &file_binary_proto_def_proto_msgTypes[222] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24138,7 +24709,7 @@ func (x *ButtonsMessage_Button_ButtonText) String() string { func (*ButtonsMessage_Button_ButtonText) ProtoMessage() {} func (x *ButtonsMessage_Button_ButtonText) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[217] + mi := &file_binary_proto_def_proto_msgTypes[222] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24175,7 +24746,7 @@ type HydratedTemplateButton_HydratedURLButton struct { func (x *HydratedTemplateButton_HydratedURLButton) Reset() { *x = HydratedTemplateButton_HydratedURLButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[218] + mi := &file_binary_proto_def_proto_msgTypes[223] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24188,7 +24759,7 @@ func (x *HydratedTemplateButton_HydratedURLButton) String() string { func (*HydratedTemplateButton_HydratedURLButton) ProtoMessage() {} func (x *HydratedTemplateButton_HydratedURLButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[218] + mi := &file_binary_proto_def_proto_msgTypes[223] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24244,7 +24815,7 @@ type HydratedTemplateButton_HydratedQuickReplyButton struct { func (x *HydratedTemplateButton_HydratedQuickReplyButton) Reset() { *x = HydratedTemplateButton_HydratedQuickReplyButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[219] + mi := &file_binary_proto_def_proto_msgTypes[224] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24257,7 +24828,7 @@ func (x *HydratedTemplateButton_HydratedQuickReplyButton) String() string { func (*HydratedTemplateButton_HydratedQuickReplyButton) ProtoMessage() {} func (x *HydratedTemplateButton_HydratedQuickReplyButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[219] + mi := &file_binary_proto_def_proto_msgTypes[224] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24299,7 +24870,7 @@ type HydratedTemplateButton_HydratedCallButton struct { func (x *HydratedTemplateButton_HydratedCallButton) Reset() { *x = HydratedTemplateButton_HydratedCallButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[220] + mi := &file_binary_proto_def_proto_msgTypes[225] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24312,7 +24883,7 @@ func (x *HydratedTemplateButton_HydratedCallButton) String() string { func (*HydratedTemplateButton_HydratedCallButton) ProtoMessage() {} func (x *HydratedTemplateButton_HydratedCallButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[220] + mi := &file_binary_proto_def_proto_msgTypes[225] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24354,7 +24925,7 @@ type ContextInfo_UTMInfo struct { func (x *ContextInfo_UTMInfo) Reset() { *x = ContextInfo_UTMInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[221] + mi := &file_binary_proto_def_proto_msgTypes[226] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24367,7 +24938,7 @@ func (x *ContextInfo_UTMInfo) String() string { func (*ContextInfo_UTMInfo) ProtoMessage() {} func (x *ContextInfo_UTMInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[221] + mi := &file_binary_proto_def_proto_msgTypes[226] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24421,7 +24992,7 @@ type ContextInfo_ExternalAdReplyInfo struct { func (x *ContextInfo_ExternalAdReplyInfo) Reset() { *x = ContextInfo_ExternalAdReplyInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[222] + mi := &file_binary_proto_def_proto_msgTypes[227] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24434,7 +25005,7 @@ func (x *ContextInfo_ExternalAdReplyInfo) String() string { func (*ContextInfo_ExternalAdReplyInfo) ProtoMessage() {} func (x *ContextInfo_ExternalAdReplyInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[222] + mi := &file_binary_proto_def_proto_msgTypes[227] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24559,7 +25130,7 @@ type ContextInfo_DataSharingContext struct { func (x *ContextInfo_DataSharingContext) Reset() { *x = ContextInfo_DataSharingContext{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[223] + mi := &file_binary_proto_def_proto_msgTypes[228] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24572,7 +25143,7 @@ func (x *ContextInfo_DataSharingContext) String() string { func (*ContextInfo_DataSharingContext) ProtoMessage() {} func (x *ContextInfo_DataSharingContext) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[223] + mi := &file_binary_proto_def_proto_msgTypes[228] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24606,7 +25177,7 @@ type ContextInfo_BusinessMessageForwardInfo struct { func (x *ContextInfo_BusinessMessageForwardInfo) Reset() { *x = ContextInfo_BusinessMessageForwardInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[224] + mi := &file_binary_proto_def_proto_msgTypes[229] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24619,7 +25190,7 @@ func (x *ContextInfo_BusinessMessageForwardInfo) String() string { func (*ContextInfo_BusinessMessageForwardInfo) ProtoMessage() {} func (x *ContextInfo_BusinessMessageForwardInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[224] + mi := &file_binary_proto_def_proto_msgTypes[229] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24656,7 +25227,7 @@ type ContextInfo_AdReplyInfo struct { func (x *ContextInfo_AdReplyInfo) Reset() { *x = ContextInfo_AdReplyInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[225] + mi := &file_binary_proto_def_proto_msgTypes[230] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24669,7 +25240,7 @@ func (x *ContextInfo_AdReplyInfo) String() string { func (*ContextInfo_AdReplyInfo) ProtoMessage() {} func (x *ContextInfo_AdReplyInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[225] + mi := &file_binary_proto_def_proto_msgTypes[230] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24725,7 +25296,7 @@ type TemplateButton_URLButton struct { func (x *TemplateButton_URLButton) Reset() { *x = TemplateButton_URLButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[226] + mi := &file_binary_proto_def_proto_msgTypes[231] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24738,7 +25309,7 @@ func (x *TemplateButton_URLButton) String() string { func (*TemplateButton_URLButton) ProtoMessage() {} func (x *TemplateButton_URLButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[226] + mi := &file_binary_proto_def_proto_msgTypes[231] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24751,7 +25322,7 @@ func (x *TemplateButton_URLButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton_URLButton.ProtoReflect.Descriptor instead. func (*TemplateButton_URLButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{53, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{54, 0} } func (x *TemplateButton_URLButton) GetDisplayText() *HighlyStructuredMessage { @@ -24780,7 +25351,7 @@ type TemplateButton_QuickReplyButton struct { func (x *TemplateButton_QuickReplyButton) Reset() { *x = TemplateButton_QuickReplyButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[227] + mi := &file_binary_proto_def_proto_msgTypes[232] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24793,7 +25364,7 @@ func (x *TemplateButton_QuickReplyButton) String() string { func (*TemplateButton_QuickReplyButton) ProtoMessage() {} func (x *TemplateButton_QuickReplyButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[227] + mi := &file_binary_proto_def_proto_msgTypes[232] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24806,7 +25377,7 @@ func (x *TemplateButton_QuickReplyButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton_QuickReplyButton.ProtoReflect.Descriptor instead. func (*TemplateButton_QuickReplyButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{53, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{54, 1} } func (x *TemplateButton_QuickReplyButton) GetDisplayText() *HighlyStructuredMessage { @@ -24835,7 +25406,7 @@ type TemplateButton_CallButton struct { func (x *TemplateButton_CallButton) Reset() { *x = TemplateButton_CallButton{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[228] + mi := &file_binary_proto_def_proto_msgTypes[233] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24848,7 +25419,7 @@ func (x *TemplateButton_CallButton) String() string { func (*TemplateButton_CallButton) ProtoMessage() {} func (x *TemplateButton_CallButton) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[228] + mi := &file_binary_proto_def_proto_msgTypes[233] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24861,7 +25432,7 @@ func (x *TemplateButton_CallButton) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateButton_CallButton.ProtoReflect.Descriptor instead. func (*TemplateButton_CallButton) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{53, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{54, 2} } func (x *TemplateButton_CallButton) GetDisplayText() *HighlyStructuredMessage { @@ -24893,7 +25464,7 @@ type PaymentBackground_MediaData struct { func (x *PaymentBackground_MediaData) Reset() { *x = PaymentBackground_MediaData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[229] + mi := &file_binary_proto_def_proto_msgTypes[234] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24906,7 +25477,7 @@ func (x *PaymentBackground_MediaData) String() string { func (*PaymentBackground_MediaData) ProtoMessage() {} func (x *PaymentBackground_MediaData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[229] + mi := &file_binary_proto_def_proto_msgTypes[234] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -24919,7 +25490,7 @@ func (x *PaymentBackground_MediaData) ProtoReflect() protoreflect.Message { // Deprecated: Use PaymentBackground_MediaData.ProtoReflect.Descriptor instead. func (*PaymentBackground_MediaData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{55, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{56, 0} } func (x *PaymentBackground_MediaData) GetMediaKey() []byte { @@ -24979,7 +25550,7 @@ type TemplateMessage_HydratedFourRowTemplate struct { func (x *TemplateMessage_HydratedFourRowTemplate) Reset() { *x = TemplateMessage_HydratedFourRowTemplate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[230] + mi := &file_binary_proto_def_proto_msgTypes[235] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -24992,7 +25563,7 @@ func (x *TemplateMessage_HydratedFourRowTemplate) String() string { func (*TemplateMessage_HydratedFourRowTemplate) ProtoMessage() {} func (x *TemplateMessage_HydratedFourRowTemplate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[230] + mi := &file_binary_proto_def_proto_msgTypes[235] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25005,7 +25576,7 @@ func (x *TemplateMessage_HydratedFourRowTemplate) ProtoReflect() protoreflect.Me // Deprecated: Use TemplateMessage_HydratedFourRowTemplate.ProtoReflect.Descriptor instead. func (*TemplateMessage_HydratedFourRowTemplate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{61, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{62, 0} } func (x *TemplateMessage_HydratedFourRowTemplate) GetHydratedContentText() string { @@ -25138,7 +25709,7 @@ type TemplateMessage_FourRowTemplate struct { func (x *TemplateMessage_FourRowTemplate) Reset() { *x = TemplateMessage_FourRowTemplate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[231] + mi := &file_binary_proto_def_proto_msgTypes[236] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25151,7 +25722,7 @@ func (x *TemplateMessage_FourRowTemplate) String() string { func (*TemplateMessage_FourRowTemplate) ProtoMessage() {} func (x *TemplateMessage_FourRowTemplate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[231] + mi := &file_binary_proto_def_proto_msgTypes[236] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25164,7 +25735,7 @@ func (x *TemplateMessage_FourRowTemplate) ProtoReflect() protoreflect.Message { // Deprecated: Use TemplateMessage_FourRowTemplate.ProtoReflect.Descriptor instead. func (*TemplateMessage_FourRowTemplate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{61, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{62, 1} } func (x *TemplateMessage_FourRowTemplate) GetContent() *HighlyStructuredMessage { @@ -25286,7 +25857,7 @@ type ProductMessage_ProductSnapshot struct { func (x *ProductMessage_ProductSnapshot) Reset() { *x = ProductMessage_ProductSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[232] + mi := &file_binary_proto_def_proto_msgTypes[237] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25299,7 +25870,7 @@ func (x *ProductMessage_ProductSnapshot) String() string { func (*ProductMessage_ProductSnapshot) ProtoMessage() {} func (x *ProductMessage_ProductSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[232] + mi := &file_binary_proto_def_proto_msgTypes[237] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25312,7 +25883,7 @@ func (x *ProductMessage_ProductSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductMessage_ProductSnapshot.ProtoReflect.Descriptor instead. func (*ProductMessage_ProductSnapshot) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{74, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{75, 0} } func (x *ProductMessage_ProductSnapshot) GetProductImage() *ImageMessage { @@ -25405,7 +25976,7 @@ type ProductMessage_CatalogSnapshot struct { func (x *ProductMessage_CatalogSnapshot) Reset() { *x = ProductMessage_CatalogSnapshot{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[233] + mi := &file_binary_proto_def_proto_msgTypes[238] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25418,7 +25989,7 @@ func (x *ProductMessage_CatalogSnapshot) String() string { func (*ProductMessage_CatalogSnapshot) ProtoMessage() {} func (x *ProductMessage_CatalogSnapshot) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[233] + mi := &file_binary_proto_def_proto_msgTypes[238] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25431,7 +26002,7 @@ func (x *ProductMessage_CatalogSnapshot) ProtoReflect() protoreflect.Message { // Deprecated: Use ProductMessage_CatalogSnapshot.ProtoReflect.Descriptor instead. func (*ProductMessage_CatalogSnapshot) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{74, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{75, 1} } func (x *ProductMessage_CatalogSnapshot) GetCatalogImage() *ImageMessage { @@ -25466,7 +26037,7 @@ type PollCreationMessage_Option struct { func (x *PollCreationMessage_Option) Reset() { *x = PollCreationMessage_Option{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[234] + mi := &file_binary_proto_def_proto_msgTypes[239] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25479,7 +26050,7 @@ func (x *PollCreationMessage_Option) String() string { func (*PollCreationMessage_Option) ProtoMessage() {} func (x *PollCreationMessage_Option) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[234] + mi := &file_binary_proto_def_proto_msgTypes[239] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25492,7 +26063,7 @@ func (x *PollCreationMessage_Option) ProtoReflect() protoreflect.Message { // Deprecated: Use PollCreationMessage_Option.ProtoReflect.Descriptor instead. func (*PollCreationMessage_Option) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{79, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{80, 0} } func (x *PollCreationMessage_Option) GetOptionName() string { @@ -25516,7 +26087,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult struct { func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[235] + mi := &file_binary_proto_def_proto_msgTypes[240] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25529,7 +26100,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) String func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult) ProtoMessage() {} func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[235] + mi := &file_binary_proto_def_proto_msgTypes[240] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25542,7 +26113,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) ProtoR // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{81, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 0} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult) GetMediaUploadResult() MediaRetryNotification_ResultType { @@ -25584,7 +26155,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult_Placeholder func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[236] + mi := &file_binary_proto_def_proto_msgTypes[241] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25598,7 +26169,7 @@ func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_Placehold } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[236] + mi := &file_binary_proto_def_proto_msgTypes[241] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25611,7 +26182,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_Placeho // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{81, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 0, 0} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse) GetWebMessageInfoBytes() []byte { @@ -25639,7 +26210,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreview func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[237] + mi := &file_binary_proto_def_proto_msgTypes[242] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25653,7 +26224,7 @@ func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPrevi } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[237] + mi := &file_binary_proto_def_proto_msgTypes[242] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25666,7 +26237,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPre // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{81, 0, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 0, 1} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse) GetUrl() string { @@ -25742,7 +26313,7 @@ type PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreview func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) Reset() { *x = PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[238] + mi := &file_binary_proto_def_proto_msgTypes[243] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25756,7 +26327,7 @@ func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPrevi } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[238] + mi := &file_binary_proto_def_proto_msgTypes[243] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25769,7 +26340,7 @@ func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPre // Deprecated: Use PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{81, 0, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 0, 1, 0} } func (x *PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail) GetDirectPath() string { @@ -25833,7 +26404,7 @@ type PeerDataOperationRequestMessage_RequestUrlPreview struct { func (x *PeerDataOperationRequestMessage_RequestUrlPreview) Reset() { *x = PeerDataOperationRequestMessage_RequestUrlPreview{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[239] + mi := &file_binary_proto_def_proto_msgTypes[244] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25846,7 +26417,7 @@ func (x *PeerDataOperationRequestMessage_RequestUrlPreview) String() string { func (*PeerDataOperationRequestMessage_RequestUrlPreview) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_RequestUrlPreview) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[239] + mi := &file_binary_proto_def_proto_msgTypes[244] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25859,7 +26430,7 @@ func (x *PeerDataOperationRequestMessage_RequestUrlPreview) ProtoReflect() proto // Deprecated: Use PeerDataOperationRequestMessage_RequestUrlPreview.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_RequestUrlPreview) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{83, 0} } func (x *PeerDataOperationRequestMessage_RequestUrlPreview) GetUrl() string { @@ -25887,7 +26458,7 @@ type PeerDataOperationRequestMessage_RequestStickerReupload struct { func (x *PeerDataOperationRequestMessage_RequestStickerReupload) Reset() { *x = PeerDataOperationRequestMessage_RequestStickerReupload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[240] + mi := &file_binary_proto_def_proto_msgTypes[245] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25900,7 +26471,7 @@ func (x *PeerDataOperationRequestMessage_RequestStickerReupload) String() string func (*PeerDataOperationRequestMessage_RequestStickerReupload) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_RequestStickerReupload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[240] + mi := &file_binary_proto_def_proto_msgTypes[245] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25913,7 +26484,7 @@ func (x *PeerDataOperationRequestMessage_RequestStickerReupload) ProtoReflect() // Deprecated: Use PeerDataOperationRequestMessage_RequestStickerReupload.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_RequestStickerReupload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{83, 1} } func (x *PeerDataOperationRequestMessage_RequestStickerReupload) GetFileSha256() string { @@ -25934,7 +26505,7 @@ type PeerDataOperationRequestMessage_PlaceholderMessageResendRequest struct { func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) Reset() { *x = PeerDataOperationRequestMessage_PlaceholderMessageResendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[241] + mi := &file_binary_proto_def_proto_msgTypes[246] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25947,7 +26518,7 @@ func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) String func (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[241] + mi := &file_binary_proto_def_proto_msgTypes[246] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -25960,7 +26531,7 @@ func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) ProtoR // Deprecated: Use PeerDataOperationRequestMessage_PlaceholderMessageResendRequest.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{83, 2} } func (x *PeerDataOperationRequestMessage_PlaceholderMessageResendRequest) GetMessageKey() *MessageKey { @@ -25985,7 +26556,7 @@ type PeerDataOperationRequestMessage_HistorySyncOnDemandRequest struct { func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) Reset() { *x = PeerDataOperationRequestMessage_HistorySyncOnDemandRequest{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[242] + mi := &file_binary_proto_def_proto_msgTypes[247] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -25998,7 +26569,7 @@ func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) String() st func (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) ProtoMessage() {} func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[242] + mi := &file_binary_proto_def_proto_msgTypes[247] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26011,7 +26582,7 @@ func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) ProtoReflec // Deprecated: Use PeerDataOperationRequestMessage_HistorySyncOnDemandRequest.ProtoReflect.Descriptor instead. func (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{82, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{83, 3} } func (x *PeerDataOperationRequestMessage_HistorySyncOnDemandRequest) GetChatJid() string { @@ -26060,7 +26631,7 @@ type ListResponseMessage_SingleSelectReply struct { func (x *ListResponseMessage_SingleSelectReply) Reset() { *x = ListResponseMessage_SingleSelectReply{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[243] + mi := &file_binary_proto_def_proto_msgTypes[248] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26073,7 +26644,7 @@ func (x *ListResponseMessage_SingleSelectReply) String() string { func (*ListResponseMessage_SingleSelectReply) ProtoMessage() {} func (x *ListResponseMessage_SingleSelectReply) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[243] + mi := &file_binary_proto_def_proto_msgTypes[248] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26086,7 +26657,7 @@ func (x *ListResponseMessage_SingleSelectReply) ProtoReflect() protoreflect.Mess // Deprecated: Use ListResponseMessage_SingleSelectReply.ProtoReflect.Descriptor instead. func (*ListResponseMessage_SingleSelectReply) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{89, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 0} } func (x *ListResponseMessage_SingleSelectReply) GetSelectedRowId() string { @@ -26108,7 +26679,7 @@ type ListMessage_Section struct { func (x *ListMessage_Section) Reset() { *x = ListMessage_Section{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[244] + mi := &file_binary_proto_def_proto_msgTypes[249] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26121,7 +26692,7 @@ func (x *ListMessage_Section) String() string { func (*ListMessage_Section) ProtoMessage() {} func (x *ListMessage_Section) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[244] + mi := &file_binary_proto_def_proto_msgTypes[249] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26134,7 +26705,7 @@ func (x *ListMessage_Section) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_Section.ProtoReflect.Descriptor instead. func (*ListMessage_Section) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 0} } func (x *ListMessage_Section) GetTitle() string { @@ -26164,7 +26735,7 @@ type ListMessage_Row struct { func (x *ListMessage_Row) Reset() { *x = ListMessage_Row{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[245] + mi := &file_binary_proto_def_proto_msgTypes[250] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26177,7 +26748,7 @@ func (x *ListMessage_Row) String() string { func (*ListMessage_Row) ProtoMessage() {} func (x *ListMessage_Row) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[245] + mi := &file_binary_proto_def_proto_msgTypes[250] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26190,7 +26761,7 @@ func (x *ListMessage_Row) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_Row.ProtoReflect.Descriptor instead. func (*ListMessage_Row) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 1} } func (x *ListMessage_Row) GetTitle() string { @@ -26225,7 +26796,7 @@ type ListMessage_Product struct { func (x *ListMessage_Product) Reset() { *x = ListMessage_Product{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[246] + mi := &file_binary_proto_def_proto_msgTypes[251] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26238,7 +26809,7 @@ func (x *ListMessage_Product) String() string { func (*ListMessage_Product) ProtoMessage() {} func (x *ListMessage_Product) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[246] + mi := &file_binary_proto_def_proto_msgTypes[251] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26251,7 +26822,7 @@ func (x *ListMessage_Product) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_Product.ProtoReflect.Descriptor instead. func (*ListMessage_Product) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 2} } func (x *ListMessage_Product) GetProductId() string { @@ -26273,7 +26844,7 @@ type ListMessage_ProductSection struct { func (x *ListMessage_ProductSection) Reset() { *x = ListMessage_ProductSection{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[247] + mi := &file_binary_proto_def_proto_msgTypes[252] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26286,7 +26857,7 @@ func (x *ListMessage_ProductSection) String() string { func (*ListMessage_ProductSection) ProtoMessage() {} func (x *ListMessage_ProductSection) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[247] + mi := &file_binary_proto_def_proto_msgTypes[252] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26299,7 +26870,7 @@ func (x *ListMessage_ProductSection) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_ProductSection.ProtoReflect.Descriptor instead. func (*ListMessage_ProductSection) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 3} } func (x *ListMessage_ProductSection) GetTitle() string { @@ -26329,7 +26900,7 @@ type ListMessage_ProductListInfo struct { func (x *ListMessage_ProductListInfo) Reset() { *x = ListMessage_ProductListInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[248] + mi := &file_binary_proto_def_proto_msgTypes[253] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26342,7 +26913,7 @@ func (x *ListMessage_ProductListInfo) String() string { func (*ListMessage_ProductListInfo) ProtoMessage() {} func (x *ListMessage_ProductListInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[248] + mi := &file_binary_proto_def_proto_msgTypes[253] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26355,7 +26926,7 @@ func (x *ListMessage_ProductListInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ListMessage_ProductListInfo.ProtoReflect.Descriptor instead. func (*ListMessage_ProductListInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 4} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 4} } func (x *ListMessage_ProductListInfo) GetProductSections() []*ListMessage_ProductSection { @@ -26391,7 +26962,7 @@ type ListMessage_ProductListHeaderImage struct { func (x *ListMessage_ProductListHeaderImage) Reset() { *x = ListMessage_ProductListHeaderImage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[249] + mi := &file_binary_proto_def_proto_msgTypes[254] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26404,7 +26975,7 @@ func (x *ListMessage_ProductListHeaderImage) String() string { func (*ListMessage_ProductListHeaderImage) ProtoMessage() {} func (x *ListMessage_ProductListHeaderImage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[249] + mi := &file_binary_proto_def_proto_msgTypes[254] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26417,7 +26988,7 @@ func (x *ListMessage_ProductListHeaderImage) ProtoReflect() protoreflect.Message // Deprecated: Use ListMessage_ProductListHeaderImage.ProtoReflect.Descriptor instead. func (*ListMessage_ProductListHeaderImage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{90, 5} + return file_binary_proto_def_proto_rawDescGZIP(), []int{91, 5} } func (x *ListMessage_ProductListHeaderImage) GetProductId() string { @@ -26434,61 +27005,6 @@ func (x *ListMessage_ProductListHeaderImage) GetJpegThumbnail() []byte { return nil } -type InteractiveResponseMessage_Body struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Text *string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` - Format *InteractiveResponseMessage_Body_Format `protobuf:"varint,2,opt,name=format,enum=proto.InteractiveResponseMessage_Body_Format" json:"format,omitempty"` -} - -func (x *InteractiveResponseMessage_Body) Reset() { - *x = InteractiveResponseMessage_Body{} - if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[250] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *InteractiveResponseMessage_Body) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*InteractiveResponseMessage_Body) ProtoMessage() {} - -func (x *InteractiveResponseMessage_Body) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[250] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use InteractiveResponseMessage_Body.ProtoReflect.Descriptor instead. -func (*InteractiveResponseMessage_Body) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{93, 0} -} - -func (x *InteractiveResponseMessage_Body) GetText() string { - if x != nil && x.Text != nil { - return *x.Text - } - return "" -} - -func (x *InteractiveResponseMessage_Body) GetFormat() InteractiveResponseMessage_Body_Format { - if x != nil && x.Format != nil { - return *x.Format - } - return InteractiveResponseMessage_Body_DEFAULT -} - type InteractiveResponseMessage_NativeFlowResponseMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -26502,7 +27018,7 @@ type InteractiveResponseMessage_NativeFlowResponseMessage struct { func (x *InteractiveResponseMessage_NativeFlowResponseMessage) Reset() { *x = InteractiveResponseMessage_NativeFlowResponseMessage{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[251] + mi := &file_binary_proto_def_proto_msgTypes[255] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26515,7 +27031,7 @@ func (x *InteractiveResponseMessage_NativeFlowResponseMessage) String() string { func (*InteractiveResponseMessage_NativeFlowResponseMessage) ProtoMessage() {} func (x *InteractiveResponseMessage_NativeFlowResponseMessage) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[251] + mi := &file_binary_proto_def_proto_msgTypes[255] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26528,7 +27044,7 @@ func (x *InteractiveResponseMessage_NativeFlowResponseMessage) ProtoReflect() pr // Deprecated: Use InteractiveResponseMessage_NativeFlowResponseMessage.ProtoReflect.Descriptor instead. func (*InteractiveResponseMessage_NativeFlowResponseMessage) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{93, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{94, 0} } func (x *InteractiveResponseMessage_NativeFlowResponseMessage) GetName() string { @@ -26552,6 +27068,61 @@ func (x *InteractiveResponseMessage_NativeFlowResponseMessage) GetVersion() int3 return 0 } +type InteractiveResponseMessage_Body struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Text *string `protobuf:"bytes,1,opt,name=text" json:"text,omitempty"` + Format *InteractiveResponseMessage_Body_Format `protobuf:"varint,2,opt,name=format,enum=proto.InteractiveResponseMessage_Body_Format" json:"format,omitempty"` +} + +func (x *InteractiveResponseMessage_Body) Reset() { + *x = InteractiveResponseMessage_Body{} + if protoimpl.UnsafeEnabled { + mi := &file_binary_proto_def_proto_msgTypes[256] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *InteractiveResponseMessage_Body) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*InteractiveResponseMessage_Body) ProtoMessage() {} + +func (x *InteractiveResponseMessage_Body) ProtoReflect() protoreflect.Message { + mi := &file_binary_proto_def_proto_msgTypes[256] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use InteractiveResponseMessage_Body.ProtoReflect.Descriptor instead. +func (*InteractiveResponseMessage_Body) Descriptor() ([]byte, []int) { + return file_binary_proto_def_proto_rawDescGZIP(), []int{94, 1} +} + +func (x *InteractiveResponseMessage_Body) GetText() string { + if x != nil && x.Text != nil { + return *x.Text + } + return "" +} + +func (x *InteractiveResponseMessage_Body) GetFormat() InteractiveResponseMessage_Body_Format { + if x != nil && x.Format != nil { + return *x.Format + } + return InteractiveResponseMessage_Body_DEFAULT +} + type CallLogRecord_ParticipantInfo struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -26564,7 +27135,7 @@ type CallLogRecord_ParticipantInfo struct { func (x *CallLogRecord_ParticipantInfo) Reset() { *x = CallLogRecord_ParticipantInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[252] + mi := &file_binary_proto_def_proto_msgTypes[257] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26577,7 +27148,7 @@ func (x *CallLogRecord_ParticipantInfo) String() string { func (*CallLogRecord_ParticipantInfo) ProtoMessage() {} func (x *CallLogRecord_ParticipantInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[252] + mi := &file_binary_proto_def_proto_msgTypes[257] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26590,7 +27161,7 @@ func (x *CallLogRecord_ParticipantInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use CallLogRecord_ParticipantInfo.ProtoReflect.Descriptor instead. func (*CallLogRecord_ParticipantInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{168, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{171, 0} } func (x *CallLogRecord_ParticipantInfo) GetUserJid() string { @@ -26622,7 +27193,7 @@ type VerifiedNameCertificate_Details struct { func (x *VerifiedNameCertificate_Details) Reset() { *x = VerifiedNameCertificate_Details{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[253] + mi := &file_binary_proto_def_proto_msgTypes[258] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26635,7 +27206,7 @@ func (x *VerifiedNameCertificate_Details) String() string { func (*VerifiedNameCertificate_Details) ProtoMessage() {} func (x *VerifiedNameCertificate_Details) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[253] + mi := &file_binary_proto_def_proto_msgTypes[258] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26648,7 +27219,7 @@ func (x *VerifiedNameCertificate_Details) ProtoReflect() protoreflect.Message { // Deprecated: Use VerifiedNameCertificate_Details.ProtoReflect.Descriptor instead. func (*VerifiedNameCertificate_Details) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{169, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{172, 0} } func (x *VerifiedNameCertificate_Details) GetSerial() uint64 { @@ -26700,7 +27271,7 @@ type ClientPayload_WebInfo struct { func (x *ClientPayload_WebInfo) Reset() { *x = ClientPayload_WebInfo{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[254] + mi := &file_binary_proto_def_proto_msgTypes[259] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26713,7 +27284,7 @@ func (x *ClientPayload_WebInfo) String() string { func (*ClientPayload_WebInfo) ProtoMessage() {} func (x *ClientPayload_WebInfo) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[254] + mi := &file_binary_proto_def_proto_msgTypes[259] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26726,7 +27297,7 @@ func (x *ClientPayload_WebInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_WebInfo.ProtoReflect.Descriptor instead. func (*ClientPayload_WebInfo) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 0} } func (x *ClientPayload_WebInfo) GetRefToken() string { @@ -26782,7 +27353,7 @@ type ClientPayload_UserAgent struct { func (x *ClientPayload_UserAgent) Reset() { *x = ClientPayload_UserAgent{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[255] + mi := &file_binary_proto_def_proto_msgTypes[260] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26795,7 +27366,7 @@ func (x *ClientPayload_UserAgent) String() string { func (*ClientPayload_UserAgent) ProtoMessage() {} func (x *ClientPayload_UserAgent) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[255] + mi := &file_binary_proto_def_proto_msgTypes[260] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26808,7 +27379,7 @@ func (x *ClientPayload_UserAgent) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_UserAgent.ProtoReflect.Descriptor instead. func (*ClientPayload_UserAgent) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 1} } func (x *ClientPayload_UserAgent) GetPlatform() ClientPayload_UserAgent_Platform { @@ -26928,7 +27499,7 @@ type ClientPayload_InteropData struct { func (x *ClientPayload_InteropData) Reset() { *x = ClientPayload_InteropData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[256] + mi := &file_binary_proto_def_proto_msgTypes[261] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -26941,7 +27512,7 @@ func (x *ClientPayload_InteropData) String() string { func (*ClientPayload_InteropData) ProtoMessage() {} func (x *ClientPayload_InteropData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[256] + mi := &file_binary_proto_def_proto_msgTypes[261] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -26954,7 +27525,7 @@ func (x *ClientPayload_InteropData) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_InteropData.ProtoReflect.Descriptor instead. func (*ClientPayload_InteropData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 2} } func (x *ClientPayload_InteropData) GetAccountId() uint64 { @@ -26989,7 +27560,7 @@ type ClientPayload_DevicePairingRegistrationData struct { func (x *ClientPayload_DevicePairingRegistrationData) Reset() { *x = ClientPayload_DevicePairingRegistrationData{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[257] + mi := &file_binary_proto_def_proto_msgTypes[262] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27002,7 +27573,7 @@ func (x *ClientPayload_DevicePairingRegistrationData) String() string { func (*ClientPayload_DevicePairingRegistrationData) ProtoMessage() {} func (x *ClientPayload_DevicePairingRegistrationData) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[257] + mi := &file_binary_proto_def_proto_msgTypes[262] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27015,7 +27586,7 @@ func (x *ClientPayload_DevicePairingRegistrationData) ProtoReflect() protoreflec // Deprecated: Use ClientPayload_DevicePairingRegistrationData.ProtoReflect.Descriptor instead. func (*ClientPayload_DevicePairingRegistrationData) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 3} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 3} } func (x *ClientPayload_DevicePairingRegistrationData) GetERegid() []byte { @@ -27086,7 +27657,7 @@ type ClientPayload_DNSSource struct { func (x *ClientPayload_DNSSource) Reset() { *x = ClientPayload_DNSSource{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[258] + mi := &file_binary_proto_def_proto_msgTypes[263] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27099,7 +27670,7 @@ func (x *ClientPayload_DNSSource) String() string { func (*ClientPayload_DNSSource) ProtoMessage() {} func (x *ClientPayload_DNSSource) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[258] + mi := &file_binary_proto_def_proto_msgTypes[263] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27112,7 +27683,7 @@ func (x *ClientPayload_DNSSource) ProtoReflect() protoreflect.Message { // Deprecated: Use ClientPayload_DNSSource.ProtoReflect.Descriptor instead. func (*ClientPayload_DNSSource) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 4} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 4} } func (x *ClientPayload_DNSSource) GetDnsMethod() ClientPayload_DNSSource_DNSResolutionMethod { @@ -27150,7 +27721,7 @@ type ClientPayload_WebInfo_WebdPayload struct { func (x *ClientPayload_WebInfo_WebdPayload) Reset() { *x = ClientPayload_WebInfo_WebdPayload{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[259] + mi := &file_binary_proto_def_proto_msgTypes[264] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27163,7 +27734,7 @@ func (x *ClientPayload_WebInfo_WebdPayload) String() string { func (*ClientPayload_WebInfo_WebdPayload) ProtoMessage() {} func (x *ClientPayload_WebInfo_WebdPayload) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[259] + mi := &file_binary_proto_def_proto_msgTypes[264] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27176,7 +27747,7 @@ func (x *ClientPayload_WebInfo_WebdPayload) ProtoReflect() protoreflect.Message // Deprecated: Use ClientPayload_WebInfo_WebdPayload.ProtoReflect.Descriptor instead. func (*ClientPayload_WebInfo_WebdPayload) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 0, 0} } func (x *ClientPayload_WebInfo_WebdPayload) GetUsesParticipantInKey() bool { @@ -27271,7 +27842,7 @@ type ClientPayload_UserAgent_AppVersion struct { func (x *ClientPayload_UserAgent_AppVersion) Reset() { *x = ClientPayload_UserAgent_AppVersion{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[260] + mi := &file_binary_proto_def_proto_msgTypes[265] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27284,7 +27855,7 @@ func (x *ClientPayload_UserAgent_AppVersion) String() string { func (*ClientPayload_UserAgent_AppVersion) ProtoMessage() {} func (x *ClientPayload_UserAgent_AppVersion) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[260] + mi := &file_binary_proto_def_proto_msgTypes[265] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27297,7 +27868,7 @@ func (x *ClientPayload_UserAgent_AppVersion) ProtoReflect() protoreflect.Message // Deprecated: Use ClientPayload_UserAgent_AppVersion.ProtoReflect.Descriptor instead. func (*ClientPayload_UserAgent_AppVersion) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{178, 1, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{181, 1, 0} } func (x *ClientPayload_UserAgent_AppVersion) GetPrimary() uint32 { @@ -27350,7 +27921,7 @@ type NoiseCertificate_Details struct { func (x *NoiseCertificate_Details) Reset() { *x = NoiseCertificate_Details{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[261] + mi := &file_binary_proto_def_proto_msgTypes[266] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27363,7 +27934,7 @@ func (x *NoiseCertificate_Details) String() string { func (*NoiseCertificate_Details) ProtoMessage() {} func (x *NoiseCertificate_Details) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[261] + mi := &file_binary_proto_def_proto_msgTypes[266] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27376,7 +27947,7 @@ func (x *NoiseCertificate_Details) ProtoReflect() protoreflect.Message { // Deprecated: Use NoiseCertificate_Details.ProtoReflect.Descriptor instead. func (*NoiseCertificate_Details) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{196, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{201, 0} } func (x *NoiseCertificate_Details) GetSerial() uint32 { @@ -27426,7 +27997,7 @@ type CertChain_NoiseCertificate struct { func (x *CertChain_NoiseCertificate) Reset() { *x = CertChain_NoiseCertificate{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[262] + mi := &file_binary_proto_def_proto_msgTypes[267] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27439,7 +28010,7 @@ func (x *CertChain_NoiseCertificate) String() string { func (*CertChain_NoiseCertificate) ProtoMessage() {} func (x *CertChain_NoiseCertificate) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[262] + mi := &file_binary_proto_def_proto_msgTypes[267] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27452,7 +28023,7 @@ func (x *CertChain_NoiseCertificate) ProtoReflect() protoreflect.Message { // Deprecated: Use CertChain_NoiseCertificate.ProtoReflect.Descriptor instead. func (*CertChain_NoiseCertificate) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{197, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{202, 0} } func (x *CertChain_NoiseCertificate) GetDetails() []byte { @@ -27484,7 +28055,7 @@ type CertChain_NoiseCertificate_Details struct { func (x *CertChain_NoiseCertificate_Details) Reset() { *x = CertChain_NoiseCertificate_Details{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[263] + mi := &file_binary_proto_def_proto_msgTypes[268] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27497,7 +28068,7 @@ func (x *CertChain_NoiseCertificate_Details) String() string { func (*CertChain_NoiseCertificate_Details) ProtoMessage() {} func (x *CertChain_NoiseCertificate_Details) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[263] + mi := &file_binary_proto_def_proto_msgTypes[268] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27510,7 +28081,7 @@ func (x *CertChain_NoiseCertificate_Details) ProtoReflect() protoreflect.Message // Deprecated: Use CertChain_NoiseCertificate_Details.ProtoReflect.Descriptor instead. func (*CertChain_NoiseCertificate_Details) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{197, 0, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{202, 0, 0} } func (x *CertChain_NoiseCertificate_Details) GetSerial() uint32 { @@ -27562,7 +28133,7 @@ type QP_Filter struct { func (x *QP_Filter) Reset() { *x = QP_Filter{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[264] + mi := &file_binary_proto_def_proto_msgTypes[269] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27575,7 +28146,7 @@ func (x *QP_Filter) String() string { func (*QP_Filter) ProtoMessage() {} func (x *QP_Filter) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[264] + mi := &file_binary_proto_def_proto_msgTypes[269] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27588,7 +28159,7 @@ func (x *QP_Filter) ProtoReflect() protoreflect.Message { // Deprecated: Use QP_Filter.ProtoReflect.Descriptor instead. func (*QP_Filter) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{198, 0} + return file_binary_proto_def_proto_rawDescGZIP(), []int{203, 0} } func (x *QP_Filter) GetFilterName() string { @@ -27631,7 +28202,7 @@ type QP_FilterParameters struct { func (x *QP_FilterParameters) Reset() { *x = QP_FilterParameters{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[265] + mi := &file_binary_proto_def_proto_msgTypes[270] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27644,7 +28215,7 @@ func (x *QP_FilterParameters) String() string { func (*QP_FilterParameters) ProtoMessage() {} func (x *QP_FilterParameters) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[265] + mi := &file_binary_proto_def_proto_msgTypes[270] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27657,7 +28228,7 @@ func (x *QP_FilterParameters) ProtoReflect() protoreflect.Message { // Deprecated: Use QP_FilterParameters.ProtoReflect.Descriptor instead. func (*QP_FilterParameters) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{198, 1} + return file_binary_proto_def_proto_rawDescGZIP(), []int{203, 1} } func (x *QP_FilterParameters) GetKey() string { @@ -27687,7 +28258,7 @@ type QP_FilterClause struct { func (x *QP_FilterClause) Reset() { *x = QP_FilterClause{} if protoimpl.UnsafeEnabled { - mi := &file_binary_proto_def_proto_msgTypes[266] + mi := &file_binary_proto_def_proto_msgTypes[271] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -27700,7 +28271,7 @@ func (x *QP_FilterClause) String() string { func (*QP_FilterClause) ProtoMessage() {} func (x *QP_FilterClause) ProtoReflect() protoreflect.Message { - mi := &file_binary_proto_def_proto_msgTypes[266] + mi := &file_binary_proto_def_proto_msgTypes[271] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -27713,7 +28284,7 @@ func (x *QP_FilterClause) ProtoReflect() protoreflect.Message { // Deprecated: Use QP_FilterClause.ProtoReflect.Descriptor instead. func (*QP_FilterClause) Descriptor() ([]byte, []int) { - return file_binary_proto_def_proto_rawDescGZIP(), []int{198, 2} + return file_binary_proto_def_proto_rawDescGZIP(), []int{203, 2} } func (x *QP_FilterClause) GetClauseType() QP_ClauseType { @@ -27754,8 +28325,8 @@ func file_binary_proto_def_proto_rawDescGZIP() []byte { return file_binary_proto_def_proto_rawDescData } -var file_binary_proto_def_proto_enumTypes = make([]protoimpl.EnumInfo, 81) -var file_binary_proto_def_proto_msgTypes = make([]protoimpl.MessageInfo, 267) +var file_binary_proto_def_proto_enumTypes = make([]protoimpl.EnumInfo, 83) +var file_binary_proto_def_proto_msgTypes = make([]protoimpl.MessageInfo, 272) var file_binary_proto_def_proto_goTypes = []interface{}{ (ADVEncryptionType)(0), // 0: proto.ADVEncryptionType (KeepType)(0), // 1: proto.KeepType @@ -27785,835 +28356,853 @@ var file_binary_proto_def_proto_goTypes = []interface{}{ (DisappearingMode_Initiator)(0), // 25: proto.DisappearingMode.Initiator (ContextInfo_ExternalAdReplyInfo_MediaType)(0), // 26: proto.ContextInfo.ExternalAdReplyInfo.MediaType (ContextInfo_AdReplyInfo_MediaType)(0), // 27: proto.ContextInfo.AdReplyInfo.MediaType - (BotPluginMetadata_SearchProvider)(0), // 28: proto.BotPluginMetadata.SearchProvider - (BotPluginMetadata_PluginType)(0), // 29: proto.BotPluginMetadata.PluginType - (PaymentBackground_Type)(0), // 30: proto.PaymentBackground.Type - (VideoMessage_Attribution)(0), // 31: proto.VideoMessage.Attribution - (ScheduledCallEditMessage_EditType)(0), // 32: proto.ScheduledCallEditMessage.EditType - (ScheduledCallCreationMessage_CallType)(0), // 33: proto.ScheduledCallCreationMessage.CallType - (RequestWelcomeMessageMetadata_LocalChatState)(0), // 34: proto.RequestWelcomeMessageMetadata.LocalChatState - (ProtocolMessage_Type)(0), // 35: proto.ProtocolMessage.Type - (PinInChatMessage_Type)(0), // 36: proto.PinInChatMessage.Type - (PaymentInviteMessage_ServiceType)(0), // 37: proto.PaymentInviteMessage.ServiceType - (OrderMessage_OrderSurface)(0), // 38: proto.OrderMessage.OrderSurface - (OrderMessage_OrderStatus)(0), // 39: proto.OrderMessage.OrderStatus - (ListResponseMessage_ListType)(0), // 40: proto.ListResponseMessage.ListType - (ListMessage_ListType)(0), // 41: proto.ListMessage.ListType - (InvoiceMessage_AttachmentType)(0), // 42: proto.InvoiceMessage.AttachmentType - (InteractiveResponseMessage_Body_Format)(0), // 43: proto.InteractiveResponseMessage.Body.Format - (PastParticipant_LeaveReason)(0), // 44: proto.PastParticipant.LeaveReason - (HistorySync_HistorySyncType)(0), // 45: proto.HistorySync.HistorySyncType - (HistorySync_BotAIWaitListState)(0), // 46: proto.HistorySync.BotAIWaitListState - (GroupParticipant_Rank)(0), // 47: proto.GroupParticipant.Rank - (Conversation_EndOfHistoryTransferType)(0), // 48: proto.Conversation.EndOfHistoryTransferType - (MediaRetryNotification_ResultType)(0), // 49: proto.MediaRetryNotification.ResultType - (SyncdMutation_SyncdOperation)(0), // 50: proto.SyncdMutation.SyncdOperation - (StatusPrivacyAction_StatusDistributionMode)(0), // 51: proto.StatusPrivacyAction.StatusDistributionMode - (MarketingMessageAction_MarketingMessagePrototypeType)(0), // 52: proto.MarketingMessageAction.MarketingMessagePrototypeType - (CallLogRecord_SilenceReason)(0), // 53: proto.CallLogRecord.SilenceReason - (CallLogRecord_CallType)(0), // 54: proto.CallLogRecord.CallType - (CallLogRecord_CallResult)(0), // 55: proto.CallLogRecord.CallResult - (BizIdentityInfo_VerifiedLevelValue)(0), // 56: proto.BizIdentityInfo.VerifiedLevelValue - (BizIdentityInfo_HostStorageType)(0), // 57: proto.BizIdentityInfo.HostStorageType - (BizIdentityInfo_ActualActorsType)(0), // 58: proto.BizIdentityInfo.ActualActorsType - (BizAccountLinkInfo_HostStorageType)(0), // 59: proto.BizAccountLinkInfo.HostStorageType - (BizAccountLinkInfo_AccountType)(0), // 60: proto.BizAccountLinkInfo.AccountType - (ClientPayload_Product)(0), // 61: proto.ClientPayload.Product - (ClientPayload_IOSAppExtension)(0), // 62: proto.ClientPayload.IOSAppExtension - (ClientPayload_ConnectType)(0), // 63: proto.ClientPayload.ConnectType - (ClientPayload_ConnectReason)(0), // 64: proto.ClientPayload.ConnectReason - (ClientPayload_WebInfo_WebSubPlatform)(0), // 65: proto.ClientPayload.WebInfo.WebSubPlatform - (ClientPayload_UserAgent_ReleaseChannel)(0), // 66: proto.ClientPayload.UserAgent.ReleaseChannel - (ClientPayload_UserAgent_Platform)(0), // 67: proto.ClientPayload.UserAgent.Platform - (ClientPayload_UserAgent_DeviceType)(0), // 68: proto.ClientPayload.UserAgent.DeviceType - (ClientPayload_DNSSource_DNSResolutionMethod)(0), // 69: proto.ClientPayload.DNSSource.DNSResolutionMethod - (WebMessageInfo_StubType)(0), // 70: proto.WebMessageInfo.StubType - (WebMessageInfo_Status)(0), // 71: proto.WebMessageInfo.Status - (WebMessageInfo_BizPrivacyStatus)(0), // 72: proto.WebMessageInfo.BizPrivacyStatus - (WebFeatures_Flag)(0), // 73: proto.WebFeatures.Flag - (PinInChat_Type)(0), // 74: proto.PinInChat.Type - (PaymentInfo_TxnStatus)(0), // 75: proto.PaymentInfo.TxnStatus - (PaymentInfo_Status)(0), // 76: proto.PaymentInfo.Status - (PaymentInfo_Currency)(0), // 77: proto.PaymentInfo.Currency - (QP_FilterResult)(0), // 78: proto.QP.FilterResult - (QP_FilterClientNotSupportedConfig)(0), // 79: proto.QP.FilterClientNotSupportedConfig - (QP_ClauseType)(0), // 80: proto.QP.ClauseType - (*ADVSignedKeyIndexList)(nil), // 81: proto.ADVSignedKeyIndexList - (*ADVSignedDeviceIdentity)(nil), // 82: proto.ADVSignedDeviceIdentity - (*ADVSignedDeviceIdentityHMAC)(nil), // 83: proto.ADVSignedDeviceIdentityHMAC - (*ADVKeyIndexList)(nil), // 84: proto.ADVKeyIndexList - (*ADVDeviceIdentity)(nil), // 85: proto.ADVDeviceIdentity - (*DeviceProps)(nil), // 86: proto.DeviceProps - (*InteractiveMessage)(nil), // 87: proto.InteractiveMessage - (*InitialSecurityNotificationSettingSync)(nil), // 88: proto.InitialSecurityNotificationSettingSync - (*ImageMessage)(nil), // 89: proto.ImageMessage - (*HistorySyncNotification)(nil), // 90: proto.HistorySyncNotification - (*HighlyStructuredMessage)(nil), // 91: proto.HighlyStructuredMessage - (*GroupInviteMessage)(nil), // 92: proto.GroupInviteMessage - (*FutureProofMessage)(nil), // 93: proto.FutureProofMessage - (*ExtendedTextMessage)(nil), // 94: proto.ExtendedTextMessage - (*EventResponseMessage)(nil), // 95: proto.EventResponseMessage - (*EventMessage)(nil), // 96: proto.EventMessage - (*EncReactionMessage)(nil), // 97: proto.EncReactionMessage - (*EncEventResponseMessage)(nil), // 98: proto.EncEventResponseMessage - (*EncCommentMessage)(nil), // 99: proto.EncCommentMessage - (*DocumentMessage)(nil), // 100: proto.DocumentMessage - (*DeviceSentMessage)(nil), // 101: proto.DeviceSentMessage - (*DeclinePaymentRequestMessage)(nil), // 102: proto.DeclinePaymentRequestMessage - (*ContactsArrayMessage)(nil), // 103: proto.ContactsArrayMessage - (*ContactMessage)(nil), // 104: proto.ContactMessage - (*CommentMessage)(nil), // 105: proto.CommentMessage - (*Chat)(nil), // 106: proto.Chat - (*CancelPaymentRequestMessage)(nil), // 107: proto.CancelPaymentRequestMessage - (*Call)(nil), // 108: proto.Call - (*CallLogMessage)(nil), // 109: proto.CallLogMessage - (*ButtonsResponseMessage)(nil), // 110: proto.ButtonsResponseMessage - (*ButtonsMessage)(nil), // 111: proto.ButtonsMessage - (*BotFeedbackMessage)(nil), // 112: proto.BotFeedbackMessage - (*BCallMessage)(nil), // 113: proto.BCallMessage - (*AudioMessage)(nil), // 114: proto.AudioMessage - (*AppStateSyncKey)(nil), // 115: proto.AppStateSyncKey - (*AppStateSyncKeyShare)(nil), // 116: proto.AppStateSyncKeyShare - (*AppStateSyncKeyRequest)(nil), // 117: proto.AppStateSyncKeyRequest - (*AppStateSyncKeyId)(nil), // 118: proto.AppStateSyncKeyId - (*AppStateSyncKeyFingerprint)(nil), // 119: proto.AppStateSyncKeyFingerprint - (*AppStateSyncKeyData)(nil), // 120: proto.AppStateSyncKeyData - (*AppStateFatalExceptionNotification)(nil), // 121: proto.AppStateFatalExceptionNotification - (*Location)(nil), // 122: proto.Location - (*InteractiveAnnotation)(nil), // 123: proto.InteractiveAnnotation - (*HydratedTemplateButton)(nil), // 124: proto.HydratedTemplateButton - (*GroupMention)(nil), // 125: proto.GroupMention - (*DisappearingMode)(nil), // 126: proto.DisappearingMode - (*DeviceListMetadata)(nil), // 127: proto.DeviceListMetadata - (*ContextInfo)(nil), // 128: proto.ContextInfo - (*ForwardedNewsletterMessageInfo)(nil), // 129: proto.ForwardedNewsletterMessageInfo - (*BotPluginMetadata)(nil), // 130: proto.BotPluginMetadata - (*BotMetadata)(nil), // 131: proto.BotMetadata - (*BotAvatarMetadata)(nil), // 132: proto.BotAvatarMetadata - (*ActionLink)(nil), // 133: proto.ActionLink - (*TemplateButton)(nil), // 134: proto.TemplateButton - (*Point)(nil), // 135: proto.Point - (*PaymentBackground)(nil), // 136: proto.PaymentBackground - (*Money)(nil), // 137: proto.Money - (*Message)(nil), // 138: proto.Message - (*MessageSecretMessage)(nil), // 139: proto.MessageSecretMessage - (*MessageContextInfo)(nil), // 140: proto.MessageContextInfo - (*VideoMessage)(nil), // 141: proto.VideoMessage - (*TemplateMessage)(nil), // 142: proto.TemplateMessage - (*TemplateButtonReplyMessage)(nil), // 143: proto.TemplateButtonReplyMessage - (*StickerSyncRMRMessage)(nil), // 144: proto.StickerSyncRMRMessage - (*StickerMessage)(nil), // 145: proto.StickerMessage - (*SenderKeyDistributionMessage)(nil), // 146: proto.SenderKeyDistributionMessage - (*SendPaymentMessage)(nil), // 147: proto.SendPaymentMessage - (*ScheduledCallEditMessage)(nil), // 148: proto.ScheduledCallEditMessage - (*ScheduledCallCreationMessage)(nil), // 149: proto.ScheduledCallCreationMessage - (*RequestWelcomeMessageMetadata)(nil), // 150: proto.RequestWelcomeMessageMetadata - (*RequestPhoneNumberMessage)(nil), // 151: proto.RequestPhoneNumberMessage - (*RequestPaymentMessage)(nil), // 152: proto.RequestPaymentMessage - (*ReactionMessage)(nil), // 153: proto.ReactionMessage - (*ProtocolMessage)(nil), // 154: proto.ProtocolMessage - (*ProductMessage)(nil), // 155: proto.ProductMessage - (*PollVoteMessage)(nil), // 156: proto.PollVoteMessage - (*PollUpdateMessage)(nil), // 157: proto.PollUpdateMessage - (*PollUpdateMessageMetadata)(nil), // 158: proto.PollUpdateMessageMetadata - (*PollEncValue)(nil), // 159: proto.PollEncValue - (*PollCreationMessage)(nil), // 160: proto.PollCreationMessage - (*PinInChatMessage)(nil), // 161: proto.PinInChatMessage - (*PeerDataOperationRequestResponseMessage)(nil), // 162: proto.PeerDataOperationRequestResponseMessage - (*PeerDataOperationRequestMessage)(nil), // 163: proto.PeerDataOperationRequestMessage - (*PaymentInviteMessage)(nil), // 164: proto.PaymentInviteMessage - (*OrderMessage)(nil), // 165: proto.OrderMessage - (*NewsletterAdminInviteMessage)(nil), // 166: proto.NewsletterAdminInviteMessage - (*MessageHistoryBundle)(nil), // 167: proto.MessageHistoryBundle - (*LocationMessage)(nil), // 168: proto.LocationMessage - (*LiveLocationMessage)(nil), // 169: proto.LiveLocationMessage - (*ListResponseMessage)(nil), // 170: proto.ListResponseMessage - (*ListMessage)(nil), // 171: proto.ListMessage - (*KeepInChatMessage)(nil), // 172: proto.KeepInChatMessage - (*InvoiceMessage)(nil), // 173: proto.InvoiceMessage - (*InteractiveResponseMessage)(nil), // 174: proto.InteractiveResponseMessage - (*EphemeralSetting)(nil), // 175: proto.EphemeralSetting - (*WallpaperSettings)(nil), // 176: proto.WallpaperSettings - (*StickerMetadata)(nil), // 177: proto.StickerMetadata - (*Pushname)(nil), // 178: proto.Pushname - (*PastParticipants)(nil), // 179: proto.PastParticipants - (*PastParticipant)(nil), // 180: proto.PastParticipant - (*NotificationSettings)(nil), // 181: proto.NotificationSettings - (*HistorySync)(nil), // 182: proto.HistorySync - (*HistorySyncMsg)(nil), // 183: proto.HistorySyncMsg - (*GroupParticipant)(nil), // 184: proto.GroupParticipant - (*GlobalSettings)(nil), // 185: proto.GlobalSettings - (*Conversation)(nil), // 186: proto.Conversation - (*AvatarUserSettings)(nil), // 187: proto.AvatarUserSettings - (*AutoDownloadSettings)(nil), // 188: proto.AutoDownloadSettings - (*ServerErrorReceipt)(nil), // 189: proto.ServerErrorReceipt - (*MediaRetryNotification)(nil), // 190: proto.MediaRetryNotification - (*MessageKey)(nil), // 191: proto.MessageKey - (*SyncdVersion)(nil), // 192: proto.SyncdVersion - (*SyncdValue)(nil), // 193: proto.SyncdValue - (*SyncdSnapshot)(nil), // 194: proto.SyncdSnapshot - (*SyncdRecord)(nil), // 195: proto.SyncdRecord - (*SyncdPatch)(nil), // 196: proto.SyncdPatch - (*SyncdMutations)(nil), // 197: proto.SyncdMutations - (*SyncdMutation)(nil), // 198: proto.SyncdMutation - (*SyncdIndex)(nil), // 199: proto.SyncdIndex - (*KeyId)(nil), // 200: proto.KeyId - (*ExternalBlobReference)(nil), // 201: proto.ExternalBlobReference - (*ExitCode)(nil), // 202: proto.ExitCode - (*SyncActionValue)(nil), // 203: proto.SyncActionValue - (*UserStatusMuteAction)(nil), // 204: proto.UserStatusMuteAction - (*UnarchiveChatsSetting)(nil), // 205: proto.UnarchiveChatsSetting - (*TimeFormatAction)(nil), // 206: proto.TimeFormatAction - (*SyncActionMessage)(nil), // 207: proto.SyncActionMessage - (*SyncActionMessageRange)(nil), // 208: proto.SyncActionMessageRange - (*SubscriptionAction)(nil), // 209: proto.SubscriptionAction - (*StickerAction)(nil), // 210: proto.StickerAction - (*StatusPrivacyAction)(nil), // 211: proto.StatusPrivacyAction - (*StarAction)(nil), // 212: proto.StarAction - (*SecurityNotificationSetting)(nil), // 213: proto.SecurityNotificationSetting - (*RemoveRecentStickerAction)(nil), // 214: proto.RemoveRecentStickerAction - (*RecentEmojiWeightsAction)(nil), // 215: proto.RecentEmojiWeightsAction - (*QuickReplyAction)(nil), // 216: proto.QuickReplyAction - (*PushNameSetting)(nil), // 217: proto.PushNameSetting - (*PrivacySettingRelayAllCalls)(nil), // 218: proto.PrivacySettingRelayAllCalls - (*PrimaryVersionAction)(nil), // 219: proto.PrimaryVersionAction - (*PrimaryFeature)(nil), // 220: proto.PrimaryFeature - (*PnForLidChatAction)(nil), // 221: proto.PnForLidChatAction - (*PinAction)(nil), // 222: proto.PinAction - (*NuxAction)(nil), // 223: proto.NuxAction - (*MuteAction)(nil), // 224: proto.MuteAction - (*MarketingMessageBroadcastAction)(nil), // 225: proto.MarketingMessageBroadcastAction - (*MarketingMessageAction)(nil), // 226: proto.MarketingMessageAction - (*MarkChatAsReadAction)(nil), // 227: proto.MarkChatAsReadAction - (*LocaleSetting)(nil), // 228: proto.LocaleSetting - (*LabelReorderingAction)(nil), // 229: proto.LabelReorderingAction - (*LabelEditAction)(nil), // 230: proto.LabelEditAction - (*LabelAssociationAction)(nil), // 231: proto.LabelAssociationAction - (*KeyExpiration)(nil), // 232: proto.KeyExpiration - (*ExternalWebBetaAction)(nil), // 233: proto.ExternalWebBetaAction - (*DeleteMessageForMeAction)(nil), // 234: proto.DeleteMessageForMeAction - (*DeleteIndividualCallLogAction)(nil), // 235: proto.DeleteIndividualCallLogAction - (*DeleteChatAction)(nil), // 236: proto.DeleteChatAction - (*ContactAction)(nil), // 237: proto.ContactAction - (*ClearChatAction)(nil), // 238: proto.ClearChatAction - (*ChatAssignmentOpenedStatusAction)(nil), // 239: proto.ChatAssignmentOpenedStatusAction - (*ChatAssignmentAction)(nil), // 240: proto.ChatAssignmentAction - (*CallLogAction)(nil), // 241: proto.CallLogAction - (*BotWelcomeRequestAction)(nil), // 242: proto.BotWelcomeRequestAction - (*ArchiveChatAction)(nil), // 243: proto.ArchiveChatAction - (*AndroidUnsupportedActions)(nil), // 244: proto.AndroidUnsupportedActions - (*AgentAction)(nil), // 245: proto.AgentAction - (*SyncActionData)(nil), // 246: proto.SyncActionData - (*RecentEmojiWeight)(nil), // 247: proto.RecentEmojiWeight - (*PatchDebugData)(nil), // 248: proto.PatchDebugData - (*CallLogRecord)(nil), // 249: proto.CallLogRecord - (*VerifiedNameCertificate)(nil), // 250: proto.VerifiedNameCertificate - (*LocalizedName)(nil), // 251: proto.LocalizedName - (*BizIdentityInfo)(nil), // 252: proto.BizIdentityInfo - (*BizAccountPayload)(nil), // 253: proto.BizAccountPayload - (*BizAccountLinkInfo)(nil), // 254: proto.BizAccountLinkInfo - (*HandshakeMessage)(nil), // 255: proto.HandshakeMessage - (*HandshakeServerHello)(nil), // 256: proto.HandshakeServerHello - (*HandshakeClientHello)(nil), // 257: proto.HandshakeClientHello - (*HandshakeClientFinish)(nil), // 258: proto.HandshakeClientFinish - (*ClientPayload)(nil), // 259: proto.ClientPayload - (*WebNotificationsInfo)(nil), // 260: proto.WebNotificationsInfo - (*WebMessageInfo)(nil), // 261: proto.WebMessageInfo - (*WebFeatures)(nil), // 262: proto.WebFeatures - (*UserReceipt)(nil), // 263: proto.UserReceipt - (*StatusPSA)(nil), // 264: proto.StatusPSA - (*Reaction)(nil), // 265: proto.Reaction - (*PremiumMessageInfo)(nil), // 266: proto.PremiumMessageInfo - (*PollUpdate)(nil), // 267: proto.PollUpdate - (*PollAdditionalMetadata)(nil), // 268: proto.PollAdditionalMetadata - (*PinInChat)(nil), // 269: proto.PinInChat - (*PhotoChange)(nil), // 270: proto.PhotoChange - (*PaymentInfo)(nil), // 271: proto.PaymentInfo - (*NotificationMessageInfo)(nil), // 272: proto.NotificationMessageInfo - (*MessageAddOnContextInfo)(nil), // 273: proto.MessageAddOnContextInfo - (*MediaData)(nil), // 274: proto.MediaData - (*KeepInChat)(nil), // 275: proto.KeepInChat - (*CommentMetadata)(nil), // 276: proto.CommentMetadata - (*NoiseCertificate)(nil), // 277: proto.NoiseCertificate - (*CertChain)(nil), // 278: proto.CertChain - (*QP)(nil), // 279: proto.QP - (*DeviceProps_HistorySyncConfig)(nil), // 280: proto.DeviceProps.HistorySyncConfig - (*DeviceProps_AppVersion)(nil), // 281: proto.DeviceProps.AppVersion - (*InteractiveMessage_ShopMessage)(nil), // 282: proto.InteractiveMessage.ShopMessage - (*InteractiveMessage_NativeFlowMessage)(nil), // 283: proto.InteractiveMessage.NativeFlowMessage - (*InteractiveMessage_Header)(nil), // 284: proto.InteractiveMessage.Header - (*InteractiveMessage_Footer)(nil), // 285: proto.InteractiveMessage.Footer - (*InteractiveMessage_CollectionMessage)(nil), // 286: proto.InteractiveMessage.CollectionMessage - (*InteractiveMessage_CarouselMessage)(nil), // 287: proto.InteractiveMessage.CarouselMessage - (*InteractiveMessage_Body)(nil), // 288: proto.InteractiveMessage.Body - (*InteractiveMessage_NativeFlowMessage_NativeFlowButton)(nil), // 289: proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton - (*HighlyStructuredMessage_HSMLocalizableParameter)(nil), // 290: proto.HighlyStructuredMessage.HSMLocalizableParameter - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime)(nil), // 291: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency)(nil), // 292: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch)(nil), // 293: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch - (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent)(nil), // 294: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent - (*CallLogMessage_CallParticipant)(nil), // 295: proto.CallLogMessage.CallParticipant - (*ButtonsMessage_Button)(nil), // 296: proto.ButtonsMessage.Button - (*ButtonsMessage_Button_NativeFlowInfo)(nil), // 297: proto.ButtonsMessage.Button.NativeFlowInfo - (*ButtonsMessage_Button_ButtonText)(nil), // 298: proto.ButtonsMessage.Button.ButtonText - (*HydratedTemplateButton_HydratedURLButton)(nil), // 299: proto.HydratedTemplateButton.HydratedURLButton - (*HydratedTemplateButton_HydratedQuickReplyButton)(nil), // 300: proto.HydratedTemplateButton.HydratedQuickReplyButton - (*HydratedTemplateButton_HydratedCallButton)(nil), // 301: proto.HydratedTemplateButton.HydratedCallButton - (*ContextInfo_UTMInfo)(nil), // 302: proto.ContextInfo.UTMInfo - (*ContextInfo_ExternalAdReplyInfo)(nil), // 303: proto.ContextInfo.ExternalAdReplyInfo - (*ContextInfo_DataSharingContext)(nil), // 304: proto.ContextInfo.DataSharingContext - (*ContextInfo_BusinessMessageForwardInfo)(nil), // 305: proto.ContextInfo.BusinessMessageForwardInfo - (*ContextInfo_AdReplyInfo)(nil), // 306: proto.ContextInfo.AdReplyInfo - (*TemplateButton_URLButton)(nil), // 307: proto.TemplateButton.URLButton - (*TemplateButton_QuickReplyButton)(nil), // 308: proto.TemplateButton.QuickReplyButton - (*TemplateButton_CallButton)(nil), // 309: proto.TemplateButton.CallButton - (*PaymentBackground_MediaData)(nil), // 310: proto.PaymentBackground.MediaData - (*TemplateMessage_HydratedFourRowTemplate)(nil), // 311: proto.TemplateMessage.HydratedFourRowTemplate - (*TemplateMessage_FourRowTemplate)(nil), // 312: proto.TemplateMessage.FourRowTemplate - (*ProductMessage_ProductSnapshot)(nil), // 313: proto.ProductMessage.ProductSnapshot - (*ProductMessage_CatalogSnapshot)(nil), // 314: proto.ProductMessage.CatalogSnapshot - (*PollCreationMessage_Option)(nil), // 315: proto.PollCreationMessage.Option - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult)(nil), // 316: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse)(nil), // 317: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse)(nil), // 318: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse - (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail)(nil), // 319: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail - (*PeerDataOperationRequestMessage_RequestUrlPreview)(nil), // 320: proto.PeerDataOperationRequestMessage.RequestUrlPreview - (*PeerDataOperationRequestMessage_RequestStickerReupload)(nil), // 321: proto.PeerDataOperationRequestMessage.RequestStickerReupload - (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest)(nil), // 322: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest - (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest)(nil), // 323: proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest - (*ListResponseMessage_SingleSelectReply)(nil), // 324: proto.ListResponseMessage.SingleSelectReply - (*ListMessage_Section)(nil), // 325: proto.ListMessage.Section - (*ListMessage_Row)(nil), // 326: proto.ListMessage.Row - (*ListMessage_Product)(nil), // 327: proto.ListMessage.Product - (*ListMessage_ProductSection)(nil), // 328: proto.ListMessage.ProductSection - (*ListMessage_ProductListInfo)(nil), // 329: proto.ListMessage.ProductListInfo - (*ListMessage_ProductListHeaderImage)(nil), // 330: proto.ListMessage.ProductListHeaderImage - (*InteractiveResponseMessage_Body)(nil), // 331: proto.InteractiveResponseMessage.Body - (*InteractiveResponseMessage_NativeFlowResponseMessage)(nil), // 332: proto.InteractiveResponseMessage.NativeFlowResponseMessage - (*CallLogRecord_ParticipantInfo)(nil), // 333: proto.CallLogRecord.ParticipantInfo - (*VerifiedNameCertificate_Details)(nil), // 334: proto.VerifiedNameCertificate.Details - (*ClientPayload_WebInfo)(nil), // 335: proto.ClientPayload.WebInfo - (*ClientPayload_UserAgent)(nil), // 336: proto.ClientPayload.UserAgent - (*ClientPayload_InteropData)(nil), // 337: proto.ClientPayload.InteropData - (*ClientPayload_DevicePairingRegistrationData)(nil), // 338: proto.ClientPayload.DevicePairingRegistrationData - (*ClientPayload_DNSSource)(nil), // 339: proto.ClientPayload.DNSSource - (*ClientPayload_WebInfo_WebdPayload)(nil), // 340: proto.ClientPayload.WebInfo.WebdPayload - (*ClientPayload_UserAgent_AppVersion)(nil), // 341: proto.ClientPayload.UserAgent.AppVersion - (*NoiseCertificate_Details)(nil), // 342: proto.NoiseCertificate.Details - (*CertChain_NoiseCertificate)(nil), // 343: proto.CertChain.NoiseCertificate - (*CertChain_NoiseCertificate_Details)(nil), // 344: proto.CertChain.NoiseCertificate.Details - (*QP_Filter)(nil), // 345: proto.QP.Filter - (*QP_FilterParameters)(nil), // 346: proto.QP.FilterParameters - (*QP_FilterClause)(nil), // 347: proto.QP.FilterClause + (ForwardedNewsletterMessageInfo_ContentType)(0), // 28: proto.ForwardedNewsletterMessageInfo.ContentType + (BotPluginMetadata_SearchProvider)(0), // 29: proto.BotPluginMetadata.SearchProvider + (BotPluginMetadata_PluginType)(0), // 30: proto.BotPluginMetadata.PluginType + (PaymentBackground_Type)(0), // 31: proto.PaymentBackground.Type + (VideoMessage_Attribution)(0), // 32: proto.VideoMessage.Attribution + (ScheduledCallEditMessage_EditType)(0), // 33: proto.ScheduledCallEditMessage.EditType + (ScheduledCallCreationMessage_CallType)(0), // 34: proto.ScheduledCallCreationMessage.CallType + (RequestWelcomeMessageMetadata_LocalChatState)(0), // 35: proto.RequestWelcomeMessageMetadata.LocalChatState + (ProtocolMessage_Type)(0), // 36: proto.ProtocolMessage.Type + (PinInChatMessage_Type)(0), // 37: proto.PinInChatMessage.Type + (PaymentInviteMessage_ServiceType)(0), // 38: proto.PaymentInviteMessage.ServiceType + (OrderMessage_OrderSurface)(0), // 39: proto.OrderMessage.OrderSurface + (OrderMessage_OrderStatus)(0), // 40: proto.OrderMessage.OrderStatus + (ListResponseMessage_ListType)(0), // 41: proto.ListResponseMessage.ListType + (ListMessage_ListType)(0), // 42: proto.ListMessage.ListType + (InvoiceMessage_AttachmentType)(0), // 43: proto.InvoiceMessage.AttachmentType + (InteractiveResponseMessage_Body_Format)(0), // 44: proto.InteractiveResponseMessage.Body.Format + (PastParticipant_LeaveReason)(0), // 45: proto.PastParticipant.LeaveReason + (HistorySync_HistorySyncType)(0), // 46: proto.HistorySync.HistorySyncType + (HistorySync_BotAIWaitListState)(0), // 47: proto.HistorySync.BotAIWaitListState + (GroupParticipant_Rank)(0), // 48: proto.GroupParticipant.Rank + (Conversation_EndOfHistoryTransferType)(0), // 49: proto.Conversation.EndOfHistoryTransferType + (MediaRetryNotification_ResultType)(0), // 50: proto.MediaRetryNotification.ResultType + (SyncdMutation_SyncdOperation)(0), // 51: proto.SyncdMutation.SyncdOperation + (StatusPrivacyAction_StatusDistributionMode)(0), // 52: proto.StatusPrivacyAction.StatusDistributionMode + (MarketingMessageAction_MarketingMessagePrototypeType)(0), // 53: proto.MarketingMessageAction.MarketingMessagePrototypeType + (PatchDebugData_Platform)(0), // 54: proto.PatchDebugData.Platform + (CallLogRecord_SilenceReason)(0), // 55: proto.CallLogRecord.SilenceReason + (CallLogRecord_CallType)(0), // 56: proto.CallLogRecord.CallType + (CallLogRecord_CallResult)(0), // 57: proto.CallLogRecord.CallResult + (BizIdentityInfo_VerifiedLevelValue)(0), // 58: proto.BizIdentityInfo.VerifiedLevelValue + (BizIdentityInfo_HostStorageType)(0), // 59: proto.BizIdentityInfo.HostStorageType + (BizIdentityInfo_ActualActorsType)(0), // 60: proto.BizIdentityInfo.ActualActorsType + (BizAccountLinkInfo_HostStorageType)(0), // 61: proto.BizAccountLinkInfo.HostStorageType + (BizAccountLinkInfo_AccountType)(0), // 62: proto.BizAccountLinkInfo.AccountType + (ClientPayload_Product)(0), // 63: proto.ClientPayload.Product + (ClientPayload_IOSAppExtension)(0), // 64: proto.ClientPayload.IOSAppExtension + (ClientPayload_ConnectType)(0), // 65: proto.ClientPayload.ConnectType + (ClientPayload_ConnectReason)(0), // 66: proto.ClientPayload.ConnectReason + (ClientPayload_WebInfo_WebSubPlatform)(0), // 67: proto.ClientPayload.WebInfo.WebSubPlatform + (ClientPayload_UserAgent_ReleaseChannel)(0), // 68: proto.ClientPayload.UserAgent.ReleaseChannel + (ClientPayload_UserAgent_Platform)(0), // 69: proto.ClientPayload.UserAgent.Platform + (ClientPayload_UserAgent_DeviceType)(0), // 70: proto.ClientPayload.UserAgent.DeviceType + (ClientPayload_DNSSource_DNSResolutionMethod)(0), // 71: proto.ClientPayload.DNSSource.DNSResolutionMethod + (WebMessageInfo_StubType)(0), // 72: proto.WebMessageInfo.StubType + (WebMessageInfo_Status)(0), // 73: proto.WebMessageInfo.Status + (WebMessageInfo_BizPrivacyStatus)(0), // 74: proto.WebMessageInfo.BizPrivacyStatus + (WebFeatures_Flag)(0), // 75: proto.WebFeatures.Flag + (PinInChat_Type)(0), // 76: proto.PinInChat.Type + (PaymentInfo_TxnStatus)(0), // 77: proto.PaymentInfo.TxnStatus + (PaymentInfo_Status)(0), // 78: proto.PaymentInfo.Status + (PaymentInfo_Currency)(0), // 79: proto.PaymentInfo.Currency + (QP_FilterResult)(0), // 80: proto.QP.FilterResult + (QP_FilterClientNotSupportedConfig)(0), // 81: proto.QP.FilterClientNotSupportedConfig + (QP_ClauseType)(0), // 82: proto.QP.ClauseType + (*ADVSignedKeyIndexList)(nil), // 83: proto.ADVSignedKeyIndexList + (*ADVSignedDeviceIdentity)(nil), // 84: proto.ADVSignedDeviceIdentity + (*ADVSignedDeviceIdentityHMAC)(nil), // 85: proto.ADVSignedDeviceIdentityHMAC + (*ADVKeyIndexList)(nil), // 86: proto.ADVKeyIndexList + (*ADVDeviceIdentity)(nil), // 87: proto.ADVDeviceIdentity + (*DeviceProps)(nil), // 88: proto.DeviceProps + (*InteractiveMessage)(nil), // 89: proto.InteractiveMessage + (*InitialSecurityNotificationSettingSync)(nil), // 90: proto.InitialSecurityNotificationSettingSync + (*ImageMessage)(nil), // 91: proto.ImageMessage + (*HistorySyncNotification)(nil), // 92: proto.HistorySyncNotification + (*HighlyStructuredMessage)(nil), // 93: proto.HighlyStructuredMessage + (*GroupInviteMessage)(nil), // 94: proto.GroupInviteMessage + (*FutureProofMessage)(nil), // 95: proto.FutureProofMessage + (*ExtendedTextMessage)(nil), // 96: proto.ExtendedTextMessage + (*EventResponseMessage)(nil), // 97: proto.EventResponseMessage + (*EventMessage)(nil), // 98: proto.EventMessage + (*EncReactionMessage)(nil), // 99: proto.EncReactionMessage + (*EncEventResponseMessage)(nil), // 100: proto.EncEventResponseMessage + (*EncCommentMessage)(nil), // 101: proto.EncCommentMessage + (*DocumentMessage)(nil), // 102: proto.DocumentMessage + (*DeviceSentMessage)(nil), // 103: proto.DeviceSentMessage + (*DeclinePaymentRequestMessage)(nil), // 104: proto.DeclinePaymentRequestMessage + (*ContactsArrayMessage)(nil), // 105: proto.ContactsArrayMessage + (*ContactMessage)(nil), // 106: proto.ContactMessage + (*CommentMessage)(nil), // 107: proto.CommentMessage + (*Chat)(nil), // 108: proto.Chat + (*CancelPaymentRequestMessage)(nil), // 109: proto.CancelPaymentRequestMessage + (*Call)(nil), // 110: proto.Call + (*CallLogMessage)(nil), // 111: proto.CallLogMessage + (*ButtonsResponseMessage)(nil), // 112: proto.ButtonsResponseMessage + (*ButtonsMessage)(nil), // 113: proto.ButtonsMessage + (*BotFeedbackMessage)(nil), // 114: proto.BotFeedbackMessage + (*BCallMessage)(nil), // 115: proto.BCallMessage + (*AudioMessage)(nil), // 116: proto.AudioMessage + (*AppStateSyncKey)(nil), // 117: proto.AppStateSyncKey + (*AppStateSyncKeyShare)(nil), // 118: proto.AppStateSyncKeyShare + (*AppStateSyncKeyRequest)(nil), // 119: proto.AppStateSyncKeyRequest + (*AppStateSyncKeyId)(nil), // 120: proto.AppStateSyncKeyId + (*AppStateSyncKeyFingerprint)(nil), // 121: proto.AppStateSyncKeyFingerprint + (*AppStateSyncKeyData)(nil), // 122: proto.AppStateSyncKeyData + (*AppStateFatalExceptionNotification)(nil), // 123: proto.AppStateFatalExceptionNotification + (*Location)(nil), // 124: proto.Location + (*InteractiveAnnotation)(nil), // 125: proto.InteractiveAnnotation + (*HydratedTemplateButton)(nil), // 126: proto.HydratedTemplateButton + (*GroupMention)(nil), // 127: proto.GroupMention + (*DisappearingMode)(nil), // 128: proto.DisappearingMode + (*DeviceListMetadata)(nil), // 129: proto.DeviceListMetadata + (*ContextInfo)(nil), // 130: proto.ContextInfo + (*ForwardedNewsletterMessageInfo)(nil), // 131: proto.ForwardedNewsletterMessageInfo + (*BotSuggestedPromptMetadata)(nil), // 132: proto.BotSuggestedPromptMetadata + (*BotPluginMetadata)(nil), // 133: proto.BotPluginMetadata + (*BotMetadata)(nil), // 134: proto.BotMetadata + (*BotAvatarMetadata)(nil), // 135: proto.BotAvatarMetadata + (*ActionLink)(nil), // 136: proto.ActionLink + (*TemplateButton)(nil), // 137: proto.TemplateButton + (*Point)(nil), // 138: proto.Point + (*PaymentBackground)(nil), // 139: proto.PaymentBackground + (*Money)(nil), // 140: proto.Money + (*Message)(nil), // 141: proto.Message + (*MessageSecretMessage)(nil), // 142: proto.MessageSecretMessage + (*MessageContextInfo)(nil), // 143: proto.MessageContextInfo + (*VideoMessage)(nil), // 144: proto.VideoMessage + (*TemplateMessage)(nil), // 145: proto.TemplateMessage + (*TemplateButtonReplyMessage)(nil), // 146: proto.TemplateButtonReplyMessage + (*StickerSyncRMRMessage)(nil), // 147: proto.StickerSyncRMRMessage + (*StickerMessage)(nil), // 148: proto.StickerMessage + (*SenderKeyDistributionMessage)(nil), // 149: proto.SenderKeyDistributionMessage + (*SendPaymentMessage)(nil), // 150: proto.SendPaymentMessage + (*ScheduledCallEditMessage)(nil), // 151: proto.ScheduledCallEditMessage + (*ScheduledCallCreationMessage)(nil), // 152: proto.ScheduledCallCreationMessage + (*RequestWelcomeMessageMetadata)(nil), // 153: proto.RequestWelcomeMessageMetadata + (*RequestPhoneNumberMessage)(nil), // 154: proto.RequestPhoneNumberMessage + (*RequestPaymentMessage)(nil), // 155: proto.RequestPaymentMessage + (*ReactionMessage)(nil), // 156: proto.ReactionMessage + (*ProtocolMessage)(nil), // 157: proto.ProtocolMessage + (*ProductMessage)(nil), // 158: proto.ProductMessage + (*PollVoteMessage)(nil), // 159: proto.PollVoteMessage + (*PollUpdateMessage)(nil), // 160: proto.PollUpdateMessage + (*PollUpdateMessageMetadata)(nil), // 161: proto.PollUpdateMessageMetadata + (*PollEncValue)(nil), // 162: proto.PollEncValue + (*PollCreationMessage)(nil), // 163: proto.PollCreationMessage + (*PinInChatMessage)(nil), // 164: proto.PinInChatMessage + (*PeerDataOperationRequestResponseMessage)(nil), // 165: proto.PeerDataOperationRequestResponseMessage + (*PeerDataOperationRequestMessage)(nil), // 166: proto.PeerDataOperationRequestMessage + (*PaymentInviteMessage)(nil), // 167: proto.PaymentInviteMessage + (*OrderMessage)(nil), // 168: proto.OrderMessage + (*NewsletterAdminInviteMessage)(nil), // 169: proto.NewsletterAdminInviteMessage + (*MessageHistoryBundle)(nil), // 170: proto.MessageHistoryBundle + (*LocationMessage)(nil), // 171: proto.LocationMessage + (*LiveLocationMessage)(nil), // 172: proto.LiveLocationMessage + (*ListResponseMessage)(nil), // 173: proto.ListResponseMessage + (*ListMessage)(nil), // 174: proto.ListMessage + (*KeepInChatMessage)(nil), // 175: proto.KeepInChatMessage + (*InvoiceMessage)(nil), // 176: proto.InvoiceMessage + (*InteractiveResponseMessage)(nil), // 177: proto.InteractiveResponseMessage + (*EphemeralSetting)(nil), // 178: proto.EphemeralSetting + (*WallpaperSettings)(nil), // 179: proto.WallpaperSettings + (*StickerMetadata)(nil), // 180: proto.StickerMetadata + (*Pushname)(nil), // 181: proto.Pushname + (*PhoneNumberToLIDMapping)(nil), // 182: proto.PhoneNumberToLIDMapping + (*PastParticipants)(nil), // 183: proto.PastParticipants + (*PastParticipant)(nil), // 184: proto.PastParticipant + (*NotificationSettings)(nil), // 185: proto.NotificationSettings + (*HistorySync)(nil), // 186: proto.HistorySync + (*HistorySyncMsg)(nil), // 187: proto.HistorySyncMsg + (*GroupParticipant)(nil), // 188: proto.GroupParticipant + (*GlobalSettings)(nil), // 189: proto.GlobalSettings + (*Conversation)(nil), // 190: proto.Conversation + (*AvatarUserSettings)(nil), // 191: proto.AvatarUserSettings + (*AutoDownloadSettings)(nil), // 192: proto.AutoDownloadSettings + (*ServerErrorReceipt)(nil), // 193: proto.ServerErrorReceipt + (*MediaRetryNotification)(nil), // 194: proto.MediaRetryNotification + (*MessageKey)(nil), // 195: proto.MessageKey + (*SyncdVersion)(nil), // 196: proto.SyncdVersion + (*SyncdValue)(nil), // 197: proto.SyncdValue + (*SyncdSnapshot)(nil), // 198: proto.SyncdSnapshot + (*SyncdRecord)(nil), // 199: proto.SyncdRecord + (*SyncdPatch)(nil), // 200: proto.SyncdPatch + (*SyncdMutations)(nil), // 201: proto.SyncdMutations + (*SyncdMutation)(nil), // 202: proto.SyncdMutation + (*SyncdIndex)(nil), // 203: proto.SyncdIndex + (*KeyId)(nil), // 204: proto.KeyId + (*ExternalBlobReference)(nil), // 205: proto.ExternalBlobReference + (*ExitCode)(nil), // 206: proto.ExitCode + (*SyncActionValue)(nil), // 207: proto.SyncActionValue + (*UserStatusMuteAction)(nil), // 208: proto.UserStatusMuteAction + (*UnarchiveChatsSetting)(nil), // 209: proto.UnarchiveChatsSetting + (*TimeFormatAction)(nil), // 210: proto.TimeFormatAction + (*SyncActionMessage)(nil), // 211: proto.SyncActionMessage + (*SyncActionMessageRange)(nil), // 212: proto.SyncActionMessageRange + (*SubscriptionAction)(nil), // 213: proto.SubscriptionAction + (*StickerAction)(nil), // 214: proto.StickerAction + (*StatusPrivacyAction)(nil), // 215: proto.StatusPrivacyAction + (*StarAction)(nil), // 216: proto.StarAction + (*SecurityNotificationSetting)(nil), // 217: proto.SecurityNotificationSetting + (*RemoveRecentStickerAction)(nil), // 218: proto.RemoveRecentStickerAction + (*RecentEmojiWeightsAction)(nil), // 219: proto.RecentEmojiWeightsAction + (*QuickReplyAction)(nil), // 220: proto.QuickReplyAction + (*PushNameSetting)(nil), // 221: proto.PushNameSetting + (*PrivacySettingRelayAllCalls)(nil), // 222: proto.PrivacySettingRelayAllCalls + (*PrimaryVersionAction)(nil), // 223: proto.PrimaryVersionAction + (*PrimaryFeature)(nil), // 224: proto.PrimaryFeature + (*PnForLidChatAction)(nil), // 225: proto.PnForLidChatAction + (*PinAction)(nil), // 226: proto.PinAction + (*PaymentInfoAction)(nil), // 227: proto.PaymentInfoAction + (*NuxAction)(nil), // 228: proto.NuxAction + (*MuteAction)(nil), // 229: proto.MuteAction + (*MarketingMessageBroadcastAction)(nil), // 230: proto.MarketingMessageBroadcastAction + (*MarketingMessageAction)(nil), // 231: proto.MarketingMessageAction + (*MarkChatAsReadAction)(nil), // 232: proto.MarkChatAsReadAction + (*LocaleSetting)(nil), // 233: proto.LocaleSetting + (*LabelReorderingAction)(nil), // 234: proto.LabelReorderingAction + (*LabelEditAction)(nil), // 235: proto.LabelEditAction + (*LabelAssociationAction)(nil), // 236: proto.LabelAssociationAction + (*KeyExpiration)(nil), // 237: proto.KeyExpiration + (*ExternalWebBetaAction)(nil), // 238: proto.ExternalWebBetaAction + (*DeleteMessageForMeAction)(nil), // 239: proto.DeleteMessageForMeAction + (*DeleteIndividualCallLogAction)(nil), // 240: proto.DeleteIndividualCallLogAction + (*DeleteChatAction)(nil), // 241: proto.DeleteChatAction + (*ContactAction)(nil), // 242: proto.ContactAction + (*ClearChatAction)(nil), // 243: proto.ClearChatAction + (*ChatAssignmentOpenedStatusAction)(nil), // 244: proto.ChatAssignmentOpenedStatusAction + (*ChatAssignmentAction)(nil), // 245: proto.ChatAssignmentAction + (*CallLogAction)(nil), // 246: proto.CallLogAction + (*BotWelcomeRequestAction)(nil), // 247: proto.BotWelcomeRequestAction + (*ArchiveChatAction)(nil), // 248: proto.ArchiveChatAction + (*AndroidUnsupportedActions)(nil), // 249: proto.AndroidUnsupportedActions + (*AgentAction)(nil), // 250: proto.AgentAction + (*SyncActionData)(nil), // 251: proto.SyncActionData + (*RecentEmojiWeight)(nil), // 252: proto.RecentEmojiWeight + (*PatchDebugData)(nil), // 253: proto.PatchDebugData + (*CallLogRecord)(nil), // 254: proto.CallLogRecord + (*VerifiedNameCertificate)(nil), // 255: proto.VerifiedNameCertificate + (*LocalizedName)(nil), // 256: proto.LocalizedName + (*BizIdentityInfo)(nil), // 257: proto.BizIdentityInfo + (*BizAccountPayload)(nil), // 258: proto.BizAccountPayload + (*BizAccountLinkInfo)(nil), // 259: proto.BizAccountLinkInfo + (*HandshakeMessage)(nil), // 260: proto.HandshakeMessage + (*HandshakeServerHello)(nil), // 261: proto.HandshakeServerHello + (*HandshakeClientHello)(nil), // 262: proto.HandshakeClientHello + (*HandshakeClientFinish)(nil), // 263: proto.HandshakeClientFinish + (*ClientPayload)(nil), // 264: proto.ClientPayload + (*WebNotificationsInfo)(nil), // 265: proto.WebNotificationsInfo + (*WebMessageInfo)(nil), // 266: proto.WebMessageInfo + (*WebFeatures)(nil), // 267: proto.WebFeatures + (*UserReceipt)(nil), // 268: proto.UserReceipt + (*StatusPSA)(nil), // 269: proto.StatusPSA + (*ReportingTokenInfo)(nil), // 270: proto.ReportingTokenInfo + (*Reaction)(nil), // 271: proto.Reaction + (*PremiumMessageInfo)(nil), // 272: proto.PremiumMessageInfo + (*PollUpdate)(nil), // 273: proto.PollUpdate + (*PollAdditionalMetadata)(nil), // 274: proto.PollAdditionalMetadata + (*PinInChat)(nil), // 275: proto.PinInChat + (*PhotoChange)(nil), // 276: proto.PhotoChange + (*PaymentInfo)(nil), // 277: proto.PaymentInfo + (*NotificationMessageInfo)(nil), // 278: proto.NotificationMessageInfo + (*MessageAddOnContextInfo)(nil), // 279: proto.MessageAddOnContextInfo + (*MediaData)(nil), // 280: proto.MediaData + (*KeepInChat)(nil), // 281: proto.KeepInChat + (*EventResponse)(nil), // 282: proto.EventResponse + (*CommentMetadata)(nil), // 283: proto.CommentMetadata + (*NoiseCertificate)(nil), // 284: proto.NoiseCertificate + (*CertChain)(nil), // 285: proto.CertChain + (*QP)(nil), // 286: proto.QP + (*DeviceProps_HistorySyncConfig)(nil), // 287: proto.DeviceProps.HistorySyncConfig + (*DeviceProps_AppVersion)(nil), // 288: proto.DeviceProps.AppVersion + (*InteractiveMessage_ShopMessage)(nil), // 289: proto.InteractiveMessage.ShopMessage + (*InteractiveMessage_NativeFlowMessage)(nil), // 290: proto.InteractiveMessage.NativeFlowMessage + (*InteractiveMessage_Header)(nil), // 291: proto.InteractiveMessage.Header + (*InteractiveMessage_Footer)(nil), // 292: proto.InteractiveMessage.Footer + (*InteractiveMessage_CollectionMessage)(nil), // 293: proto.InteractiveMessage.CollectionMessage + (*InteractiveMessage_CarouselMessage)(nil), // 294: proto.InteractiveMessage.CarouselMessage + (*InteractiveMessage_Body)(nil), // 295: proto.InteractiveMessage.Body + (*InteractiveMessage_NativeFlowMessage_NativeFlowButton)(nil), // 296: proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton + (*HighlyStructuredMessage_HSMLocalizableParameter)(nil), // 297: proto.HighlyStructuredMessage.HSMLocalizableParameter + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime)(nil), // 298: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency)(nil), // 299: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch)(nil), // 300: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch + (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent)(nil), // 301: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent + (*CallLogMessage_CallParticipant)(nil), // 302: proto.CallLogMessage.CallParticipant + (*ButtonsMessage_Button)(nil), // 303: proto.ButtonsMessage.Button + (*ButtonsMessage_Button_NativeFlowInfo)(nil), // 304: proto.ButtonsMessage.Button.NativeFlowInfo + (*ButtonsMessage_Button_ButtonText)(nil), // 305: proto.ButtonsMessage.Button.ButtonText + (*HydratedTemplateButton_HydratedURLButton)(nil), // 306: proto.HydratedTemplateButton.HydratedURLButton + (*HydratedTemplateButton_HydratedQuickReplyButton)(nil), // 307: proto.HydratedTemplateButton.HydratedQuickReplyButton + (*HydratedTemplateButton_HydratedCallButton)(nil), // 308: proto.HydratedTemplateButton.HydratedCallButton + (*ContextInfo_UTMInfo)(nil), // 309: proto.ContextInfo.UTMInfo + (*ContextInfo_ExternalAdReplyInfo)(nil), // 310: proto.ContextInfo.ExternalAdReplyInfo + (*ContextInfo_DataSharingContext)(nil), // 311: proto.ContextInfo.DataSharingContext + (*ContextInfo_BusinessMessageForwardInfo)(nil), // 312: proto.ContextInfo.BusinessMessageForwardInfo + (*ContextInfo_AdReplyInfo)(nil), // 313: proto.ContextInfo.AdReplyInfo + (*TemplateButton_URLButton)(nil), // 314: proto.TemplateButton.URLButton + (*TemplateButton_QuickReplyButton)(nil), // 315: proto.TemplateButton.QuickReplyButton + (*TemplateButton_CallButton)(nil), // 316: proto.TemplateButton.CallButton + (*PaymentBackground_MediaData)(nil), // 317: proto.PaymentBackground.MediaData + (*TemplateMessage_HydratedFourRowTemplate)(nil), // 318: proto.TemplateMessage.HydratedFourRowTemplate + (*TemplateMessage_FourRowTemplate)(nil), // 319: proto.TemplateMessage.FourRowTemplate + (*ProductMessage_ProductSnapshot)(nil), // 320: proto.ProductMessage.ProductSnapshot + (*ProductMessage_CatalogSnapshot)(nil), // 321: proto.ProductMessage.CatalogSnapshot + (*PollCreationMessage_Option)(nil), // 322: proto.PollCreationMessage.Option + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult)(nil), // 323: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse)(nil), // 324: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse)(nil), // 325: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse + (*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail)(nil), // 326: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail + (*PeerDataOperationRequestMessage_RequestUrlPreview)(nil), // 327: proto.PeerDataOperationRequestMessage.RequestUrlPreview + (*PeerDataOperationRequestMessage_RequestStickerReupload)(nil), // 328: proto.PeerDataOperationRequestMessage.RequestStickerReupload + (*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest)(nil), // 329: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest + (*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest)(nil), // 330: proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + (*ListResponseMessage_SingleSelectReply)(nil), // 331: proto.ListResponseMessage.SingleSelectReply + (*ListMessage_Section)(nil), // 332: proto.ListMessage.Section + (*ListMessage_Row)(nil), // 333: proto.ListMessage.Row + (*ListMessage_Product)(nil), // 334: proto.ListMessage.Product + (*ListMessage_ProductSection)(nil), // 335: proto.ListMessage.ProductSection + (*ListMessage_ProductListInfo)(nil), // 336: proto.ListMessage.ProductListInfo + (*ListMessage_ProductListHeaderImage)(nil), // 337: proto.ListMessage.ProductListHeaderImage + (*InteractiveResponseMessage_NativeFlowResponseMessage)(nil), // 338: proto.InteractiveResponseMessage.NativeFlowResponseMessage + (*InteractiveResponseMessage_Body)(nil), // 339: proto.InteractiveResponseMessage.Body + (*CallLogRecord_ParticipantInfo)(nil), // 340: proto.CallLogRecord.ParticipantInfo + (*VerifiedNameCertificate_Details)(nil), // 341: proto.VerifiedNameCertificate.Details + (*ClientPayload_WebInfo)(nil), // 342: proto.ClientPayload.WebInfo + (*ClientPayload_UserAgent)(nil), // 343: proto.ClientPayload.UserAgent + (*ClientPayload_InteropData)(nil), // 344: proto.ClientPayload.InteropData + (*ClientPayload_DevicePairingRegistrationData)(nil), // 345: proto.ClientPayload.DevicePairingRegistrationData + (*ClientPayload_DNSSource)(nil), // 346: proto.ClientPayload.DNSSource + (*ClientPayload_WebInfo_WebdPayload)(nil), // 347: proto.ClientPayload.WebInfo.WebdPayload + (*ClientPayload_UserAgent_AppVersion)(nil), // 348: proto.ClientPayload.UserAgent.AppVersion + (*NoiseCertificate_Details)(nil), // 349: proto.NoiseCertificate.Details + (*CertChain_NoiseCertificate)(nil), // 350: proto.CertChain.NoiseCertificate + (*CertChain_NoiseCertificate_Details)(nil), // 351: proto.CertChain.NoiseCertificate.Details + (*QP_Filter)(nil), // 352: proto.QP.Filter + (*QP_FilterParameters)(nil), // 353: proto.QP.FilterParameters + (*QP_FilterClause)(nil), // 354: proto.QP.FilterClause } var file_binary_proto_def_proto_depIdxs = []int32{ 0, // 0: proto.ADVSignedDeviceIdentityHMAC.accountType:type_name -> proto.ADVEncryptionType 0, // 1: proto.ADVKeyIndexList.accountType:type_name -> proto.ADVEncryptionType 0, // 2: proto.ADVDeviceIdentity.accountType:type_name -> proto.ADVEncryptionType 0, // 3: proto.ADVDeviceIdentity.deviceType:type_name -> proto.ADVEncryptionType - 281, // 4: proto.DeviceProps.version:type_name -> proto.DeviceProps.AppVersion + 288, // 4: proto.DeviceProps.version:type_name -> proto.DeviceProps.AppVersion 4, // 5: proto.DeviceProps.platformType:type_name -> proto.DeviceProps.PlatformType - 280, // 6: proto.DeviceProps.historySyncConfig:type_name -> proto.DeviceProps.HistorySyncConfig - 284, // 7: proto.InteractiveMessage.header:type_name -> proto.InteractiveMessage.Header - 288, // 8: proto.InteractiveMessage.body:type_name -> proto.InteractiveMessage.Body - 285, // 9: proto.InteractiveMessage.footer:type_name -> proto.InteractiveMessage.Footer - 128, // 10: proto.InteractiveMessage.contextInfo:type_name -> proto.ContextInfo - 282, // 11: proto.InteractiveMessage.shopStorefrontMessage:type_name -> proto.InteractiveMessage.ShopMessage - 286, // 12: proto.InteractiveMessage.collectionMessage:type_name -> proto.InteractiveMessage.CollectionMessage - 283, // 13: proto.InteractiveMessage.nativeFlowMessage:type_name -> proto.InteractiveMessage.NativeFlowMessage - 287, // 14: proto.InteractiveMessage.carouselMessage:type_name -> proto.InteractiveMessage.CarouselMessage - 123, // 15: proto.ImageMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation - 128, // 16: proto.ImageMessage.contextInfo:type_name -> proto.ContextInfo - 6, // 17: proto.HistorySyncNotification.syncType:type_name -> proto.HistorySyncNotification.HistorySyncType - 290, // 18: proto.HighlyStructuredMessage.localizableParams:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter - 142, // 19: proto.HighlyStructuredMessage.hydratedHsm:type_name -> proto.TemplateMessage - 128, // 20: proto.GroupInviteMessage.contextInfo:type_name -> proto.ContextInfo - 9, // 21: proto.GroupInviteMessage.groupType:type_name -> proto.GroupInviteMessage.GroupType - 138, // 22: proto.FutureProofMessage.message:type_name -> proto.Message - 12, // 23: proto.ExtendedTextMessage.font:type_name -> proto.ExtendedTextMessage.FontType - 10, // 24: proto.ExtendedTextMessage.previewType:type_name -> proto.ExtendedTextMessage.PreviewType - 128, // 25: proto.ExtendedTextMessage.contextInfo:type_name -> proto.ContextInfo - 11, // 26: proto.ExtendedTextMessage.inviteLinkGroupType:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType - 11, // 27: proto.ExtendedTextMessage.inviteLinkGroupTypeV2:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType - 13, // 28: proto.EventResponseMessage.response:type_name -> proto.EventResponseMessage.EventResponseType - 128, // 29: proto.EventMessage.contextInfo:type_name -> proto.ContextInfo - 168, // 30: proto.EventMessage.location:type_name -> proto.LocationMessage - 191, // 31: proto.EncReactionMessage.targetMessageKey:type_name -> proto.MessageKey - 191, // 32: proto.EncEventResponseMessage.eventCreationMessageKey:type_name -> proto.MessageKey - 191, // 33: proto.EncCommentMessage.targetMessageKey:type_name -> proto.MessageKey - 128, // 34: proto.DocumentMessage.contextInfo:type_name -> proto.ContextInfo - 138, // 35: proto.DeviceSentMessage.message:type_name -> proto.Message - 191, // 36: proto.DeclinePaymentRequestMessage.key:type_name -> proto.MessageKey - 104, // 37: proto.ContactsArrayMessage.contacts:type_name -> proto.ContactMessage - 128, // 38: proto.ContactsArrayMessage.contextInfo:type_name -> proto.ContextInfo - 128, // 39: proto.ContactMessage.contextInfo:type_name -> proto.ContextInfo - 138, // 40: proto.CommentMessage.message:type_name -> proto.Message - 191, // 41: proto.CommentMessage.targetMessageKey:type_name -> proto.MessageKey - 191, // 42: proto.CancelPaymentRequestMessage.key:type_name -> proto.MessageKey - 15, // 43: proto.CallLogMessage.callOutcome:type_name -> proto.CallLogMessage.CallOutcome - 14, // 44: proto.CallLogMessage.callType:type_name -> proto.CallLogMessage.CallType - 295, // 45: proto.CallLogMessage.participants:type_name -> proto.CallLogMessage.CallParticipant - 128, // 46: proto.ButtonsResponseMessage.contextInfo:type_name -> proto.ContextInfo - 16, // 47: proto.ButtonsResponseMessage.type:type_name -> proto.ButtonsResponseMessage.Type - 128, // 48: proto.ButtonsMessage.contextInfo:type_name -> proto.ContextInfo - 296, // 49: proto.ButtonsMessage.buttons:type_name -> proto.ButtonsMessage.Button - 17, // 50: proto.ButtonsMessage.headerType:type_name -> proto.ButtonsMessage.HeaderType - 100, // 51: proto.ButtonsMessage.documentMessage:type_name -> proto.DocumentMessage - 89, // 52: proto.ButtonsMessage.imageMessage:type_name -> proto.ImageMessage - 141, // 53: proto.ButtonsMessage.videoMessage:type_name -> proto.VideoMessage - 168, // 54: proto.ButtonsMessage.locationMessage:type_name -> proto.LocationMessage - 191, // 55: proto.BotFeedbackMessage.messageKey:type_name -> proto.MessageKey - 21, // 56: proto.BotFeedbackMessage.kind:type_name -> proto.BotFeedbackMessage.BotFeedbackKind - 22, // 57: proto.BCallMessage.mediaType:type_name -> proto.BCallMessage.MediaType - 128, // 58: proto.AudioMessage.contextInfo:type_name -> proto.ContextInfo - 118, // 59: proto.AppStateSyncKey.keyId:type_name -> proto.AppStateSyncKeyId - 120, // 60: proto.AppStateSyncKey.keyData:type_name -> proto.AppStateSyncKeyData - 115, // 61: proto.AppStateSyncKeyShare.keys:type_name -> proto.AppStateSyncKey - 118, // 62: proto.AppStateSyncKeyRequest.keyIds:type_name -> proto.AppStateSyncKeyId - 119, // 63: proto.AppStateSyncKeyData.fingerprint:type_name -> proto.AppStateSyncKeyFingerprint - 135, // 64: proto.InteractiveAnnotation.polygonVertices:type_name -> proto.Point - 122, // 65: proto.InteractiveAnnotation.location:type_name -> proto.Location - 129, // 66: proto.InteractiveAnnotation.newsletter:type_name -> proto.ForwardedNewsletterMessageInfo - 300, // 67: proto.HydratedTemplateButton.quickReplyButton:type_name -> proto.HydratedTemplateButton.HydratedQuickReplyButton - 299, // 68: proto.HydratedTemplateButton.urlButton:type_name -> proto.HydratedTemplateButton.HydratedURLButton - 301, // 69: proto.HydratedTemplateButton.callButton:type_name -> proto.HydratedTemplateButton.HydratedCallButton - 25, // 70: proto.DisappearingMode.initiator:type_name -> proto.DisappearingMode.Initiator - 24, // 71: proto.DisappearingMode.trigger:type_name -> proto.DisappearingMode.Trigger - 0, // 72: proto.DeviceListMetadata.senderAccountType:type_name -> proto.ADVEncryptionType - 0, // 73: proto.DeviceListMetadata.receiverAccountType:type_name -> proto.ADVEncryptionType - 138, // 74: proto.ContextInfo.quotedMessage:type_name -> proto.Message - 306, // 75: proto.ContextInfo.quotedAd:type_name -> proto.ContextInfo.AdReplyInfo - 191, // 76: proto.ContextInfo.placeholderKey:type_name -> proto.MessageKey - 303, // 77: proto.ContextInfo.externalAdReply:type_name -> proto.ContextInfo.ExternalAdReplyInfo - 126, // 78: proto.ContextInfo.disappearingMode:type_name -> proto.DisappearingMode - 133, // 79: proto.ContextInfo.actionLink:type_name -> proto.ActionLink - 125, // 80: proto.ContextInfo.groupMentions:type_name -> proto.GroupMention - 302, // 81: proto.ContextInfo.utm:type_name -> proto.ContextInfo.UTMInfo - 129, // 82: proto.ContextInfo.forwardedNewsletterMessageInfo:type_name -> proto.ForwardedNewsletterMessageInfo - 305, // 83: proto.ContextInfo.businessMessageForwardInfo:type_name -> proto.ContextInfo.BusinessMessageForwardInfo - 304, // 84: proto.ContextInfo.dataSharingContext:type_name -> proto.ContextInfo.DataSharingContext - 28, // 85: proto.BotPluginMetadata.provider:type_name -> proto.BotPluginMetadata.SearchProvider - 29, // 86: proto.BotPluginMetadata.pluginType:type_name -> proto.BotPluginMetadata.PluginType - 132, // 87: proto.BotMetadata.avatarMetadata:type_name -> proto.BotAvatarMetadata - 130, // 88: proto.BotMetadata.pluginMetadata:type_name -> proto.BotPluginMetadata - 308, // 89: proto.TemplateButton.quickReplyButton:type_name -> proto.TemplateButton.QuickReplyButton - 307, // 90: proto.TemplateButton.urlButton:type_name -> proto.TemplateButton.URLButton - 309, // 91: proto.TemplateButton.callButton:type_name -> proto.TemplateButton.CallButton - 310, // 92: proto.PaymentBackground.mediaData:type_name -> proto.PaymentBackground.MediaData - 30, // 93: proto.PaymentBackground.type:type_name -> proto.PaymentBackground.Type - 146, // 94: proto.Message.senderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage - 89, // 95: proto.Message.imageMessage:type_name -> proto.ImageMessage - 104, // 96: proto.Message.contactMessage:type_name -> proto.ContactMessage - 168, // 97: proto.Message.locationMessage:type_name -> proto.LocationMessage - 94, // 98: proto.Message.extendedTextMessage:type_name -> proto.ExtendedTextMessage - 100, // 99: proto.Message.documentMessage:type_name -> proto.DocumentMessage - 114, // 100: proto.Message.audioMessage:type_name -> proto.AudioMessage - 141, // 101: proto.Message.videoMessage:type_name -> proto.VideoMessage - 108, // 102: proto.Message.call:type_name -> proto.Call - 106, // 103: proto.Message.chat:type_name -> proto.Chat - 154, // 104: proto.Message.protocolMessage:type_name -> proto.ProtocolMessage - 103, // 105: proto.Message.contactsArrayMessage:type_name -> proto.ContactsArrayMessage - 91, // 106: proto.Message.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage - 146, // 107: proto.Message.fastRatchetKeySenderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage - 147, // 108: proto.Message.sendPaymentMessage:type_name -> proto.SendPaymentMessage - 169, // 109: proto.Message.liveLocationMessage:type_name -> proto.LiveLocationMessage - 152, // 110: proto.Message.requestPaymentMessage:type_name -> proto.RequestPaymentMessage - 102, // 111: proto.Message.declinePaymentRequestMessage:type_name -> proto.DeclinePaymentRequestMessage - 107, // 112: proto.Message.cancelPaymentRequestMessage:type_name -> proto.CancelPaymentRequestMessage - 142, // 113: proto.Message.templateMessage:type_name -> proto.TemplateMessage - 145, // 114: proto.Message.stickerMessage:type_name -> proto.StickerMessage - 92, // 115: proto.Message.groupInviteMessage:type_name -> proto.GroupInviteMessage - 143, // 116: proto.Message.templateButtonReplyMessage:type_name -> proto.TemplateButtonReplyMessage - 155, // 117: proto.Message.productMessage:type_name -> proto.ProductMessage - 101, // 118: proto.Message.deviceSentMessage:type_name -> proto.DeviceSentMessage - 140, // 119: proto.Message.messageContextInfo:type_name -> proto.MessageContextInfo - 171, // 120: proto.Message.listMessage:type_name -> proto.ListMessage - 93, // 121: proto.Message.viewOnceMessage:type_name -> proto.FutureProofMessage - 165, // 122: proto.Message.orderMessage:type_name -> proto.OrderMessage - 170, // 123: proto.Message.listResponseMessage:type_name -> proto.ListResponseMessage - 93, // 124: proto.Message.ephemeralMessage:type_name -> proto.FutureProofMessage - 173, // 125: proto.Message.invoiceMessage:type_name -> proto.InvoiceMessage - 111, // 126: proto.Message.buttonsMessage:type_name -> proto.ButtonsMessage - 110, // 127: proto.Message.buttonsResponseMessage:type_name -> proto.ButtonsResponseMessage - 164, // 128: proto.Message.paymentInviteMessage:type_name -> proto.PaymentInviteMessage - 87, // 129: proto.Message.interactiveMessage:type_name -> proto.InteractiveMessage - 153, // 130: proto.Message.reactionMessage:type_name -> proto.ReactionMessage - 144, // 131: proto.Message.stickerSyncRmrMessage:type_name -> proto.StickerSyncRMRMessage - 174, // 132: proto.Message.interactiveResponseMessage:type_name -> proto.InteractiveResponseMessage - 160, // 133: proto.Message.pollCreationMessage:type_name -> proto.PollCreationMessage - 157, // 134: proto.Message.pollUpdateMessage:type_name -> proto.PollUpdateMessage - 172, // 135: proto.Message.keepInChatMessage:type_name -> proto.KeepInChatMessage - 93, // 136: proto.Message.documentWithCaptionMessage:type_name -> proto.FutureProofMessage - 151, // 137: proto.Message.requestPhoneNumberMessage:type_name -> proto.RequestPhoneNumberMessage - 93, // 138: proto.Message.viewOnceMessageV2:type_name -> proto.FutureProofMessage - 97, // 139: proto.Message.encReactionMessage:type_name -> proto.EncReactionMessage - 93, // 140: proto.Message.editedMessage:type_name -> proto.FutureProofMessage - 93, // 141: proto.Message.viewOnceMessageV2Extension:type_name -> proto.FutureProofMessage - 160, // 142: proto.Message.pollCreationMessageV2:type_name -> proto.PollCreationMessage - 149, // 143: proto.Message.scheduledCallCreationMessage:type_name -> proto.ScheduledCallCreationMessage - 93, // 144: proto.Message.groupMentionedMessage:type_name -> proto.FutureProofMessage - 161, // 145: proto.Message.pinInChatMessage:type_name -> proto.PinInChatMessage - 160, // 146: proto.Message.pollCreationMessageV3:type_name -> proto.PollCreationMessage - 148, // 147: proto.Message.scheduledCallEditMessage:type_name -> proto.ScheduledCallEditMessage - 141, // 148: proto.Message.ptvMessage:type_name -> proto.VideoMessage - 93, // 149: proto.Message.botInvokeMessage:type_name -> proto.FutureProofMessage - 109, // 150: proto.Message.callLogMesssage:type_name -> proto.CallLogMessage - 167, // 151: proto.Message.messageHistoryBundle:type_name -> proto.MessageHistoryBundle - 99, // 152: proto.Message.encCommentMessage:type_name -> proto.EncCommentMessage - 113, // 153: proto.Message.bcallMessage:type_name -> proto.BCallMessage - 93, // 154: proto.Message.lottieStickerMessage:type_name -> proto.FutureProofMessage - 96, // 155: proto.Message.eventMessage:type_name -> proto.EventMessage - 98, // 156: proto.Message.encEventResponseMessage:type_name -> proto.EncEventResponseMessage - 105, // 157: proto.Message.commentMessage:type_name -> proto.CommentMessage - 166, // 158: proto.Message.newsletterAdminInviteMessage:type_name -> proto.NewsletterAdminInviteMessage - 127, // 159: proto.MessageContextInfo.deviceListMetadata:type_name -> proto.DeviceListMetadata - 131, // 160: proto.MessageContextInfo.botMetadata:type_name -> proto.BotMetadata - 123, // 161: proto.VideoMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation - 128, // 162: proto.VideoMessage.contextInfo:type_name -> proto.ContextInfo - 31, // 163: proto.VideoMessage.gifAttribution:type_name -> proto.VideoMessage.Attribution - 128, // 164: proto.TemplateMessage.contextInfo:type_name -> proto.ContextInfo - 311, // 165: proto.TemplateMessage.hydratedTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate - 312, // 166: proto.TemplateMessage.fourRowTemplate:type_name -> proto.TemplateMessage.FourRowTemplate - 311, // 167: proto.TemplateMessage.hydratedFourRowTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate - 87, // 168: proto.TemplateMessage.interactiveMessageTemplate:type_name -> proto.InteractiveMessage - 128, // 169: proto.TemplateButtonReplyMessage.contextInfo:type_name -> proto.ContextInfo - 128, // 170: proto.StickerMessage.contextInfo:type_name -> proto.ContextInfo - 138, // 171: proto.SendPaymentMessage.noteMessage:type_name -> proto.Message - 191, // 172: proto.SendPaymentMessage.requestMessageKey:type_name -> proto.MessageKey - 136, // 173: proto.SendPaymentMessage.background:type_name -> proto.PaymentBackground - 191, // 174: proto.ScheduledCallEditMessage.key:type_name -> proto.MessageKey - 32, // 175: proto.ScheduledCallEditMessage.editType:type_name -> proto.ScheduledCallEditMessage.EditType - 33, // 176: proto.ScheduledCallCreationMessage.callType:type_name -> proto.ScheduledCallCreationMessage.CallType - 34, // 177: proto.RequestWelcomeMessageMetadata.localChatState:type_name -> proto.RequestWelcomeMessageMetadata.LocalChatState - 128, // 178: proto.RequestPhoneNumberMessage.contextInfo:type_name -> proto.ContextInfo - 138, // 179: proto.RequestPaymentMessage.noteMessage:type_name -> proto.Message - 137, // 180: proto.RequestPaymentMessage.amount:type_name -> proto.Money - 136, // 181: proto.RequestPaymentMessage.background:type_name -> proto.PaymentBackground - 191, // 182: proto.ReactionMessage.key:type_name -> proto.MessageKey - 191, // 183: proto.ProtocolMessage.key:type_name -> proto.MessageKey - 35, // 184: proto.ProtocolMessage.type:type_name -> proto.ProtocolMessage.Type - 90, // 185: proto.ProtocolMessage.historySyncNotification:type_name -> proto.HistorySyncNotification - 116, // 186: proto.ProtocolMessage.appStateSyncKeyShare:type_name -> proto.AppStateSyncKeyShare - 117, // 187: proto.ProtocolMessage.appStateSyncKeyRequest:type_name -> proto.AppStateSyncKeyRequest - 88, // 188: proto.ProtocolMessage.initialSecurityNotificationSettingSync:type_name -> proto.InitialSecurityNotificationSettingSync - 121, // 189: proto.ProtocolMessage.appStateFatalExceptionNotification:type_name -> proto.AppStateFatalExceptionNotification - 126, // 190: proto.ProtocolMessage.disappearingMode:type_name -> proto.DisappearingMode - 138, // 191: proto.ProtocolMessage.editedMessage:type_name -> proto.Message - 163, // 192: proto.ProtocolMessage.peerDataOperationRequestMessage:type_name -> proto.PeerDataOperationRequestMessage - 162, // 193: proto.ProtocolMessage.peerDataOperationRequestResponseMessage:type_name -> proto.PeerDataOperationRequestResponseMessage - 112, // 194: proto.ProtocolMessage.botFeedbackMessage:type_name -> proto.BotFeedbackMessage - 150, // 195: proto.ProtocolMessage.requestWelcomeMessageMetadata:type_name -> proto.RequestWelcomeMessageMetadata - 313, // 196: proto.ProductMessage.product:type_name -> proto.ProductMessage.ProductSnapshot - 314, // 197: proto.ProductMessage.catalog:type_name -> proto.ProductMessage.CatalogSnapshot - 128, // 198: proto.ProductMessage.contextInfo:type_name -> proto.ContextInfo - 191, // 199: proto.PollUpdateMessage.pollCreationMessageKey:type_name -> proto.MessageKey - 159, // 200: proto.PollUpdateMessage.vote:type_name -> proto.PollEncValue - 158, // 201: proto.PollUpdateMessage.metadata:type_name -> proto.PollUpdateMessageMetadata - 315, // 202: proto.PollCreationMessage.options:type_name -> proto.PollCreationMessage.Option - 128, // 203: proto.PollCreationMessage.contextInfo:type_name -> proto.ContextInfo - 191, // 204: proto.PinInChatMessage.key:type_name -> proto.MessageKey - 36, // 205: proto.PinInChatMessage.type:type_name -> proto.PinInChatMessage.Type - 2, // 206: proto.PeerDataOperationRequestResponseMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType - 316, // 207: proto.PeerDataOperationRequestResponseMessage.peerDataOperationResult:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult - 2, // 208: proto.PeerDataOperationRequestMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType - 321, // 209: proto.PeerDataOperationRequestMessage.requestStickerReupload:type_name -> proto.PeerDataOperationRequestMessage.RequestStickerReupload - 320, // 210: proto.PeerDataOperationRequestMessage.requestUrlPreview:type_name -> proto.PeerDataOperationRequestMessage.RequestUrlPreview - 323, // 211: proto.PeerDataOperationRequestMessage.historySyncOnDemandRequest:type_name -> proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest - 322, // 212: proto.PeerDataOperationRequestMessage.placeholderMessageResendRequest:type_name -> proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest - 37, // 213: proto.PaymentInviteMessage.serviceType:type_name -> proto.PaymentInviteMessage.ServiceType - 39, // 214: proto.OrderMessage.status:type_name -> proto.OrderMessage.OrderStatus - 38, // 215: proto.OrderMessage.surface:type_name -> proto.OrderMessage.OrderSurface - 128, // 216: proto.OrderMessage.contextInfo:type_name -> proto.ContextInfo - 191, // 217: proto.OrderMessage.orderRequestMessageId:type_name -> proto.MessageKey - 128, // 218: proto.MessageHistoryBundle.contextInfo:type_name -> proto.ContextInfo - 128, // 219: proto.LocationMessage.contextInfo:type_name -> proto.ContextInfo - 128, // 220: proto.LiveLocationMessage.contextInfo:type_name -> proto.ContextInfo - 40, // 221: proto.ListResponseMessage.listType:type_name -> proto.ListResponseMessage.ListType - 324, // 222: proto.ListResponseMessage.singleSelectReply:type_name -> proto.ListResponseMessage.SingleSelectReply - 128, // 223: proto.ListResponseMessage.contextInfo:type_name -> proto.ContextInfo - 41, // 224: proto.ListMessage.listType:type_name -> proto.ListMessage.ListType - 325, // 225: proto.ListMessage.sections:type_name -> proto.ListMessage.Section - 329, // 226: proto.ListMessage.productListInfo:type_name -> proto.ListMessage.ProductListInfo - 128, // 227: proto.ListMessage.contextInfo:type_name -> proto.ContextInfo - 191, // 228: proto.KeepInChatMessage.key:type_name -> proto.MessageKey - 1, // 229: proto.KeepInChatMessage.keepType:type_name -> proto.KeepType - 42, // 230: proto.InvoiceMessage.attachmentType:type_name -> proto.InvoiceMessage.AttachmentType - 331, // 231: proto.InteractiveResponseMessage.body:type_name -> proto.InteractiveResponseMessage.Body - 128, // 232: proto.InteractiveResponseMessage.contextInfo:type_name -> proto.ContextInfo - 332, // 233: proto.InteractiveResponseMessage.nativeFlowResponseMessage:type_name -> proto.InteractiveResponseMessage.NativeFlowResponseMessage - 180, // 234: proto.PastParticipants.pastParticipants:type_name -> proto.PastParticipant - 44, // 235: proto.PastParticipant.leaveReason:type_name -> proto.PastParticipant.LeaveReason - 45, // 236: proto.HistorySync.syncType:type_name -> proto.HistorySync.HistorySyncType - 186, // 237: proto.HistorySync.conversations:type_name -> proto.Conversation - 261, // 238: proto.HistorySync.statusV3Messages:type_name -> proto.WebMessageInfo - 178, // 239: proto.HistorySync.pushnames:type_name -> proto.Pushname - 185, // 240: proto.HistorySync.globalSettings:type_name -> proto.GlobalSettings - 177, // 241: proto.HistorySync.recentStickers:type_name -> proto.StickerMetadata - 179, // 242: proto.HistorySync.pastParticipants:type_name -> proto.PastParticipants - 249, // 243: proto.HistorySync.callLogRecords:type_name -> proto.CallLogRecord - 46, // 244: proto.HistorySync.aiWaitListState:type_name -> proto.HistorySync.BotAIWaitListState - 261, // 245: proto.HistorySyncMsg.message:type_name -> proto.WebMessageInfo - 47, // 246: proto.GroupParticipant.rank:type_name -> proto.GroupParticipant.Rank - 176, // 247: proto.GlobalSettings.lightThemeWallpaper:type_name -> proto.WallpaperSettings - 3, // 248: proto.GlobalSettings.mediaVisibility:type_name -> proto.MediaVisibility - 176, // 249: proto.GlobalSettings.darkThemeWallpaper:type_name -> proto.WallpaperSettings - 188, // 250: proto.GlobalSettings.autoDownloadWiFi:type_name -> proto.AutoDownloadSettings - 188, // 251: proto.GlobalSettings.autoDownloadCellular:type_name -> proto.AutoDownloadSettings - 188, // 252: proto.GlobalSettings.autoDownloadRoaming:type_name -> proto.AutoDownloadSettings - 187, // 253: proto.GlobalSettings.avatarUserSettings:type_name -> proto.AvatarUserSettings - 181, // 254: proto.GlobalSettings.individualNotificationSettings:type_name -> proto.NotificationSettings - 181, // 255: proto.GlobalSettings.groupNotificationSettings:type_name -> proto.NotificationSettings - 183, // 256: proto.Conversation.messages:type_name -> proto.HistorySyncMsg - 48, // 257: proto.Conversation.endOfHistoryTransferType:type_name -> proto.Conversation.EndOfHistoryTransferType - 126, // 258: proto.Conversation.disappearingMode:type_name -> proto.DisappearingMode - 184, // 259: proto.Conversation.participant:type_name -> proto.GroupParticipant - 176, // 260: proto.Conversation.wallpaper:type_name -> proto.WallpaperSettings - 3, // 261: proto.Conversation.mediaVisibility:type_name -> proto.MediaVisibility - 49, // 262: proto.MediaRetryNotification.result:type_name -> proto.MediaRetryNotification.ResultType - 192, // 263: proto.SyncdSnapshot.version:type_name -> proto.SyncdVersion - 195, // 264: proto.SyncdSnapshot.records:type_name -> proto.SyncdRecord - 200, // 265: proto.SyncdSnapshot.keyId:type_name -> proto.KeyId - 199, // 266: proto.SyncdRecord.index:type_name -> proto.SyncdIndex - 193, // 267: proto.SyncdRecord.value:type_name -> proto.SyncdValue - 200, // 268: proto.SyncdRecord.keyId:type_name -> proto.KeyId - 192, // 269: proto.SyncdPatch.version:type_name -> proto.SyncdVersion - 198, // 270: proto.SyncdPatch.mutations:type_name -> proto.SyncdMutation - 201, // 271: proto.SyncdPatch.externalMutations:type_name -> proto.ExternalBlobReference - 200, // 272: proto.SyncdPatch.keyId:type_name -> proto.KeyId - 202, // 273: proto.SyncdPatch.exitCode:type_name -> proto.ExitCode - 198, // 274: proto.SyncdMutations.mutations:type_name -> proto.SyncdMutation - 50, // 275: proto.SyncdMutation.operation:type_name -> proto.SyncdMutation.SyncdOperation - 195, // 276: proto.SyncdMutation.record:type_name -> proto.SyncdRecord - 212, // 277: proto.SyncActionValue.starAction:type_name -> proto.StarAction - 237, // 278: proto.SyncActionValue.contactAction:type_name -> proto.ContactAction - 224, // 279: proto.SyncActionValue.muteAction:type_name -> proto.MuteAction - 222, // 280: proto.SyncActionValue.pinAction:type_name -> proto.PinAction - 213, // 281: proto.SyncActionValue.securityNotificationSetting:type_name -> proto.SecurityNotificationSetting - 217, // 282: proto.SyncActionValue.pushNameSetting:type_name -> proto.PushNameSetting - 216, // 283: proto.SyncActionValue.quickReplyAction:type_name -> proto.QuickReplyAction - 215, // 284: proto.SyncActionValue.recentEmojiWeightsAction:type_name -> proto.RecentEmojiWeightsAction - 230, // 285: proto.SyncActionValue.labelEditAction:type_name -> proto.LabelEditAction - 231, // 286: proto.SyncActionValue.labelAssociationAction:type_name -> proto.LabelAssociationAction - 228, // 287: proto.SyncActionValue.localeSetting:type_name -> proto.LocaleSetting - 243, // 288: proto.SyncActionValue.archiveChatAction:type_name -> proto.ArchiveChatAction - 234, // 289: proto.SyncActionValue.deleteMessageForMeAction:type_name -> proto.DeleteMessageForMeAction - 232, // 290: proto.SyncActionValue.keyExpiration:type_name -> proto.KeyExpiration - 227, // 291: proto.SyncActionValue.markChatAsReadAction:type_name -> proto.MarkChatAsReadAction - 238, // 292: proto.SyncActionValue.clearChatAction:type_name -> proto.ClearChatAction - 236, // 293: proto.SyncActionValue.deleteChatAction:type_name -> proto.DeleteChatAction - 205, // 294: proto.SyncActionValue.unarchiveChatsSetting:type_name -> proto.UnarchiveChatsSetting - 220, // 295: proto.SyncActionValue.primaryFeature:type_name -> proto.PrimaryFeature - 244, // 296: proto.SyncActionValue.androidUnsupportedActions:type_name -> proto.AndroidUnsupportedActions - 245, // 297: proto.SyncActionValue.agentAction:type_name -> proto.AgentAction - 209, // 298: proto.SyncActionValue.subscriptionAction:type_name -> proto.SubscriptionAction - 204, // 299: proto.SyncActionValue.userStatusMuteAction:type_name -> proto.UserStatusMuteAction - 206, // 300: proto.SyncActionValue.timeFormatAction:type_name -> proto.TimeFormatAction - 223, // 301: proto.SyncActionValue.nuxAction:type_name -> proto.NuxAction - 219, // 302: proto.SyncActionValue.primaryVersionAction:type_name -> proto.PrimaryVersionAction - 210, // 303: proto.SyncActionValue.stickerAction:type_name -> proto.StickerAction - 214, // 304: proto.SyncActionValue.removeRecentStickerAction:type_name -> proto.RemoveRecentStickerAction - 240, // 305: proto.SyncActionValue.chatAssignment:type_name -> proto.ChatAssignmentAction - 239, // 306: proto.SyncActionValue.chatAssignmentOpenedStatus:type_name -> proto.ChatAssignmentOpenedStatusAction - 221, // 307: proto.SyncActionValue.pnForLidChatAction:type_name -> proto.PnForLidChatAction - 226, // 308: proto.SyncActionValue.marketingMessageAction:type_name -> proto.MarketingMessageAction - 225, // 309: proto.SyncActionValue.marketingMessageBroadcastAction:type_name -> proto.MarketingMessageBroadcastAction - 233, // 310: proto.SyncActionValue.externalWebBetaAction:type_name -> proto.ExternalWebBetaAction - 218, // 311: proto.SyncActionValue.privacySettingRelayAllCalls:type_name -> proto.PrivacySettingRelayAllCalls - 241, // 312: proto.SyncActionValue.callLogAction:type_name -> proto.CallLogAction - 211, // 313: proto.SyncActionValue.statusPrivacy:type_name -> proto.StatusPrivacyAction - 242, // 314: proto.SyncActionValue.botWelcomeRequestAction:type_name -> proto.BotWelcomeRequestAction - 235, // 315: proto.SyncActionValue.deleteIndividualCallLog:type_name -> proto.DeleteIndividualCallLogAction - 229, // 316: proto.SyncActionValue.labelReorderingAction:type_name -> proto.LabelReorderingAction - 191, // 317: proto.SyncActionMessage.key:type_name -> proto.MessageKey - 207, // 318: proto.SyncActionMessageRange.messages:type_name -> proto.SyncActionMessage - 51, // 319: proto.StatusPrivacyAction.mode:type_name -> proto.StatusPrivacyAction.StatusDistributionMode - 247, // 320: proto.RecentEmojiWeightsAction.weights:type_name -> proto.RecentEmojiWeight - 52, // 321: proto.MarketingMessageAction.type:type_name -> proto.MarketingMessageAction.MarketingMessagePrototypeType - 208, // 322: proto.MarkChatAsReadAction.messageRange:type_name -> proto.SyncActionMessageRange - 208, // 323: proto.DeleteChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 208, // 324: proto.ClearChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 249, // 325: proto.CallLogAction.callLogRecord:type_name -> proto.CallLogRecord - 208, // 326: proto.ArchiveChatAction.messageRange:type_name -> proto.SyncActionMessageRange - 203, // 327: proto.SyncActionData.value:type_name -> proto.SyncActionValue - 55, // 328: proto.CallLogRecord.callResult:type_name -> proto.CallLogRecord.CallResult - 53, // 329: proto.CallLogRecord.silenceReason:type_name -> proto.CallLogRecord.SilenceReason - 333, // 330: proto.CallLogRecord.participants:type_name -> proto.CallLogRecord.ParticipantInfo - 54, // 331: proto.CallLogRecord.callType:type_name -> proto.CallLogRecord.CallType - 56, // 332: proto.BizIdentityInfo.vlevel:type_name -> proto.BizIdentityInfo.VerifiedLevelValue - 250, // 333: proto.BizIdentityInfo.vnameCert:type_name -> proto.VerifiedNameCertificate - 57, // 334: proto.BizIdentityInfo.hostStorage:type_name -> proto.BizIdentityInfo.HostStorageType - 58, // 335: proto.BizIdentityInfo.actualActors:type_name -> proto.BizIdentityInfo.ActualActorsType - 250, // 336: proto.BizAccountPayload.vnameCert:type_name -> proto.VerifiedNameCertificate - 59, // 337: proto.BizAccountLinkInfo.hostStorage:type_name -> proto.BizAccountLinkInfo.HostStorageType - 60, // 338: proto.BizAccountLinkInfo.accountType:type_name -> proto.BizAccountLinkInfo.AccountType - 257, // 339: proto.HandshakeMessage.clientHello:type_name -> proto.HandshakeClientHello - 256, // 340: proto.HandshakeMessage.serverHello:type_name -> proto.HandshakeServerHello - 258, // 341: proto.HandshakeMessage.clientFinish:type_name -> proto.HandshakeClientFinish - 336, // 342: proto.ClientPayload.userAgent:type_name -> proto.ClientPayload.UserAgent - 335, // 343: proto.ClientPayload.webInfo:type_name -> proto.ClientPayload.WebInfo - 63, // 344: proto.ClientPayload.connectType:type_name -> proto.ClientPayload.ConnectType - 64, // 345: proto.ClientPayload.connectReason:type_name -> proto.ClientPayload.ConnectReason - 339, // 346: proto.ClientPayload.dnsSource:type_name -> proto.ClientPayload.DNSSource - 338, // 347: proto.ClientPayload.devicePairingData:type_name -> proto.ClientPayload.DevicePairingRegistrationData - 61, // 348: proto.ClientPayload.product:type_name -> proto.ClientPayload.Product - 62, // 349: proto.ClientPayload.iosAppExtension:type_name -> proto.ClientPayload.IOSAppExtension - 337, // 350: proto.ClientPayload.interopData:type_name -> proto.ClientPayload.InteropData - 261, // 351: proto.WebNotificationsInfo.notifyMessages:type_name -> proto.WebMessageInfo - 191, // 352: proto.WebMessageInfo.key:type_name -> proto.MessageKey - 138, // 353: proto.WebMessageInfo.message:type_name -> proto.Message - 71, // 354: proto.WebMessageInfo.status:type_name -> proto.WebMessageInfo.Status - 70, // 355: proto.WebMessageInfo.messageStubType:type_name -> proto.WebMessageInfo.StubType - 271, // 356: proto.WebMessageInfo.paymentInfo:type_name -> proto.PaymentInfo - 169, // 357: proto.WebMessageInfo.finalLiveLocation:type_name -> proto.LiveLocationMessage - 271, // 358: proto.WebMessageInfo.quotedPaymentInfo:type_name -> proto.PaymentInfo - 72, // 359: proto.WebMessageInfo.bizPrivacyStatus:type_name -> proto.WebMessageInfo.BizPrivacyStatus - 274, // 360: proto.WebMessageInfo.mediaData:type_name -> proto.MediaData - 270, // 361: proto.WebMessageInfo.photoChange:type_name -> proto.PhotoChange - 263, // 362: proto.WebMessageInfo.userReceipt:type_name -> proto.UserReceipt - 265, // 363: proto.WebMessageInfo.reactions:type_name -> proto.Reaction - 274, // 364: proto.WebMessageInfo.quotedStickerData:type_name -> proto.MediaData - 264, // 365: proto.WebMessageInfo.statusPsa:type_name -> proto.StatusPSA - 267, // 366: proto.WebMessageInfo.pollUpdates:type_name -> proto.PollUpdate - 268, // 367: proto.WebMessageInfo.pollAdditionalMetadata:type_name -> proto.PollAdditionalMetadata - 275, // 368: proto.WebMessageInfo.keepInChat:type_name -> proto.KeepInChat - 269, // 369: proto.WebMessageInfo.pinInChat:type_name -> proto.PinInChat - 266, // 370: proto.WebMessageInfo.premiumMessageInfo:type_name -> proto.PremiumMessageInfo - 276, // 371: proto.WebMessageInfo.commentMetadata:type_name -> proto.CommentMetadata - 73, // 372: proto.WebFeatures.labelsDisplay:type_name -> proto.WebFeatures.Flag - 73, // 373: proto.WebFeatures.voipIndividualOutgoing:type_name -> proto.WebFeatures.Flag - 73, // 374: proto.WebFeatures.groupsV3:type_name -> proto.WebFeatures.Flag - 73, // 375: proto.WebFeatures.groupsV3Create:type_name -> proto.WebFeatures.Flag - 73, // 376: proto.WebFeatures.changeNumberV2:type_name -> proto.WebFeatures.Flag - 73, // 377: proto.WebFeatures.queryStatusV3Thumbnail:type_name -> proto.WebFeatures.Flag - 73, // 378: proto.WebFeatures.liveLocations:type_name -> proto.WebFeatures.Flag - 73, // 379: proto.WebFeatures.queryVname:type_name -> proto.WebFeatures.Flag - 73, // 380: proto.WebFeatures.voipIndividualIncoming:type_name -> proto.WebFeatures.Flag - 73, // 381: proto.WebFeatures.quickRepliesQuery:type_name -> proto.WebFeatures.Flag - 73, // 382: proto.WebFeatures.payments:type_name -> proto.WebFeatures.Flag - 73, // 383: proto.WebFeatures.stickerPackQuery:type_name -> proto.WebFeatures.Flag - 73, // 384: proto.WebFeatures.liveLocationsFinal:type_name -> proto.WebFeatures.Flag - 73, // 385: proto.WebFeatures.labelsEdit:type_name -> proto.WebFeatures.Flag - 73, // 386: proto.WebFeatures.mediaUpload:type_name -> proto.WebFeatures.Flag - 73, // 387: proto.WebFeatures.mediaUploadRichQuickReplies:type_name -> proto.WebFeatures.Flag - 73, // 388: proto.WebFeatures.vnameV2:type_name -> proto.WebFeatures.Flag - 73, // 389: proto.WebFeatures.videoPlaybackUrl:type_name -> proto.WebFeatures.Flag - 73, // 390: proto.WebFeatures.statusRanking:type_name -> proto.WebFeatures.Flag - 73, // 391: proto.WebFeatures.voipIndividualVideo:type_name -> proto.WebFeatures.Flag - 73, // 392: proto.WebFeatures.thirdPartyStickers:type_name -> proto.WebFeatures.Flag - 73, // 393: proto.WebFeatures.frequentlyForwardedSetting:type_name -> proto.WebFeatures.Flag - 73, // 394: proto.WebFeatures.groupsV4JoinPermission:type_name -> proto.WebFeatures.Flag - 73, // 395: proto.WebFeatures.recentStickers:type_name -> proto.WebFeatures.Flag - 73, // 396: proto.WebFeatures.catalog:type_name -> proto.WebFeatures.Flag - 73, // 397: proto.WebFeatures.starredStickers:type_name -> proto.WebFeatures.Flag - 73, // 398: proto.WebFeatures.voipGroupCall:type_name -> proto.WebFeatures.Flag - 73, // 399: proto.WebFeatures.templateMessage:type_name -> proto.WebFeatures.Flag - 73, // 400: proto.WebFeatures.templateMessageInteractivity:type_name -> proto.WebFeatures.Flag - 73, // 401: proto.WebFeatures.ephemeralMessages:type_name -> proto.WebFeatures.Flag - 73, // 402: proto.WebFeatures.e2ENotificationSync:type_name -> proto.WebFeatures.Flag - 73, // 403: proto.WebFeatures.recentStickersV2:type_name -> proto.WebFeatures.Flag - 73, // 404: proto.WebFeatures.recentStickersV3:type_name -> proto.WebFeatures.Flag - 73, // 405: proto.WebFeatures.userNotice:type_name -> proto.WebFeatures.Flag - 73, // 406: proto.WebFeatures.support:type_name -> proto.WebFeatures.Flag - 73, // 407: proto.WebFeatures.groupUiiCleanup:type_name -> proto.WebFeatures.Flag - 73, // 408: proto.WebFeatures.groupDogfoodingInternalOnly:type_name -> proto.WebFeatures.Flag - 73, // 409: proto.WebFeatures.settingsSync:type_name -> proto.WebFeatures.Flag - 73, // 410: proto.WebFeatures.archiveV2:type_name -> proto.WebFeatures.Flag - 73, // 411: proto.WebFeatures.ephemeralAllowGroupMembers:type_name -> proto.WebFeatures.Flag - 73, // 412: proto.WebFeatures.ephemeral24HDuration:type_name -> proto.WebFeatures.Flag - 73, // 413: proto.WebFeatures.mdForceUpgrade:type_name -> proto.WebFeatures.Flag - 73, // 414: proto.WebFeatures.disappearingMode:type_name -> proto.WebFeatures.Flag - 73, // 415: proto.WebFeatures.externalMdOptInAvailable:type_name -> proto.WebFeatures.Flag - 73, // 416: proto.WebFeatures.noDeleteMessageTimeLimit:type_name -> proto.WebFeatures.Flag - 191, // 417: proto.Reaction.key:type_name -> proto.MessageKey - 191, // 418: proto.PollUpdate.pollUpdateMessageKey:type_name -> proto.MessageKey - 156, // 419: proto.PollUpdate.vote:type_name -> proto.PollVoteMessage - 74, // 420: proto.PinInChat.type:type_name -> proto.PinInChat.Type - 191, // 421: proto.PinInChat.key:type_name -> proto.MessageKey - 273, // 422: proto.PinInChat.messageAddOnContextInfo:type_name -> proto.MessageAddOnContextInfo - 77, // 423: proto.PaymentInfo.currencyDeprecated:type_name -> proto.PaymentInfo.Currency - 76, // 424: proto.PaymentInfo.status:type_name -> proto.PaymentInfo.Status - 191, // 425: proto.PaymentInfo.requestMessageKey:type_name -> proto.MessageKey - 75, // 426: proto.PaymentInfo.txnStatus:type_name -> proto.PaymentInfo.TxnStatus - 137, // 427: proto.PaymentInfo.primaryAmount:type_name -> proto.Money - 137, // 428: proto.PaymentInfo.exchangeAmount:type_name -> proto.Money - 191, // 429: proto.NotificationMessageInfo.key:type_name -> proto.MessageKey - 138, // 430: proto.NotificationMessageInfo.message:type_name -> proto.Message - 1, // 431: proto.KeepInChat.keepType:type_name -> proto.KeepType - 191, // 432: proto.KeepInChat.key:type_name -> proto.MessageKey - 191, // 433: proto.CommentMetadata.commentParentKey:type_name -> proto.MessageKey - 343, // 434: proto.CertChain.leaf:type_name -> proto.CertChain.NoiseCertificate - 343, // 435: proto.CertChain.intermediate:type_name -> proto.CertChain.NoiseCertificate - 5, // 436: proto.InteractiveMessage.ShopMessage.surface:type_name -> proto.InteractiveMessage.ShopMessage.Surface - 289, // 437: proto.InteractiveMessage.NativeFlowMessage.buttons:type_name -> proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton - 100, // 438: proto.InteractiveMessage.Header.documentMessage:type_name -> proto.DocumentMessage - 89, // 439: proto.InteractiveMessage.Header.imageMessage:type_name -> proto.ImageMessage - 141, // 440: proto.InteractiveMessage.Header.videoMessage:type_name -> proto.VideoMessage - 168, // 441: proto.InteractiveMessage.Header.locationMessage:type_name -> proto.LocationMessage - 87, // 442: proto.InteractiveMessage.CarouselMessage.cards:type_name -> proto.InteractiveMessage - 292, // 443: proto.HighlyStructuredMessage.HSMLocalizableParameter.currency:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency - 291, // 444: proto.HighlyStructuredMessage.HSMLocalizableParameter.dateTime:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime - 294, // 445: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent - 293, // 446: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch - 7, // 447: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.dayOfWeek:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType - 8, // 448: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.calendar:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType - 15, // 449: proto.CallLogMessage.CallParticipant.callOutcome:type_name -> proto.CallLogMessage.CallOutcome - 298, // 450: proto.ButtonsMessage.Button.buttonText:type_name -> proto.ButtonsMessage.Button.ButtonText - 18, // 451: proto.ButtonsMessage.Button.type:type_name -> proto.ButtonsMessage.Button.Type - 297, // 452: proto.ButtonsMessage.Button.nativeFlowInfo:type_name -> proto.ButtonsMessage.Button.NativeFlowInfo - 23, // 453: proto.HydratedTemplateButton.HydratedURLButton.webviewPresentation:type_name -> proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType - 26, // 454: proto.ContextInfo.ExternalAdReplyInfo.mediaType:type_name -> proto.ContextInfo.ExternalAdReplyInfo.MediaType - 27, // 455: proto.ContextInfo.AdReplyInfo.mediaType:type_name -> proto.ContextInfo.AdReplyInfo.MediaType - 91, // 456: proto.TemplateButton.URLButton.displayText:type_name -> proto.HighlyStructuredMessage - 91, // 457: proto.TemplateButton.URLButton.url:type_name -> proto.HighlyStructuredMessage - 91, // 458: proto.TemplateButton.QuickReplyButton.displayText:type_name -> proto.HighlyStructuredMessage - 91, // 459: proto.TemplateButton.CallButton.displayText:type_name -> proto.HighlyStructuredMessage - 91, // 460: proto.TemplateButton.CallButton.phoneNumber:type_name -> proto.HighlyStructuredMessage - 124, // 461: proto.TemplateMessage.HydratedFourRowTemplate.hydratedButtons:type_name -> proto.HydratedTemplateButton - 100, // 462: proto.TemplateMessage.HydratedFourRowTemplate.documentMessage:type_name -> proto.DocumentMessage - 89, // 463: proto.TemplateMessage.HydratedFourRowTemplate.imageMessage:type_name -> proto.ImageMessage - 141, // 464: proto.TemplateMessage.HydratedFourRowTemplate.videoMessage:type_name -> proto.VideoMessage - 168, // 465: proto.TemplateMessage.HydratedFourRowTemplate.locationMessage:type_name -> proto.LocationMessage - 91, // 466: proto.TemplateMessage.FourRowTemplate.content:type_name -> proto.HighlyStructuredMessage - 91, // 467: proto.TemplateMessage.FourRowTemplate.footer:type_name -> proto.HighlyStructuredMessage - 134, // 468: proto.TemplateMessage.FourRowTemplate.buttons:type_name -> proto.TemplateButton - 100, // 469: proto.TemplateMessage.FourRowTemplate.documentMessage:type_name -> proto.DocumentMessage - 91, // 470: proto.TemplateMessage.FourRowTemplate.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage - 89, // 471: proto.TemplateMessage.FourRowTemplate.imageMessage:type_name -> proto.ImageMessage - 141, // 472: proto.TemplateMessage.FourRowTemplate.videoMessage:type_name -> proto.VideoMessage - 168, // 473: proto.TemplateMessage.FourRowTemplate.locationMessage:type_name -> proto.LocationMessage - 89, // 474: proto.ProductMessage.ProductSnapshot.productImage:type_name -> proto.ImageMessage - 89, // 475: proto.ProductMessage.CatalogSnapshot.catalogImage:type_name -> proto.ImageMessage - 49, // 476: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.mediaUploadResult:type_name -> proto.MediaRetryNotification.ResultType - 145, // 477: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage:type_name -> proto.StickerMessage - 318, // 478: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse - 317, // 479: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse - 319, // 480: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail - 191, // 481: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey:type_name -> proto.MessageKey - 326, // 482: proto.ListMessage.Section.rows:type_name -> proto.ListMessage.Row - 327, // 483: proto.ListMessage.ProductSection.products:type_name -> proto.ListMessage.Product - 328, // 484: proto.ListMessage.ProductListInfo.productSections:type_name -> proto.ListMessage.ProductSection - 330, // 485: proto.ListMessage.ProductListInfo.headerImage:type_name -> proto.ListMessage.ProductListHeaderImage - 43, // 486: proto.InteractiveResponseMessage.Body.format:type_name -> proto.InteractiveResponseMessage.Body.Format - 55, // 487: proto.CallLogRecord.ParticipantInfo.callResult:type_name -> proto.CallLogRecord.CallResult - 251, // 488: proto.VerifiedNameCertificate.Details.localizedNames:type_name -> proto.LocalizedName - 340, // 489: proto.ClientPayload.WebInfo.webdPayload:type_name -> proto.ClientPayload.WebInfo.WebdPayload - 65, // 490: proto.ClientPayload.WebInfo.webSubPlatform:type_name -> proto.ClientPayload.WebInfo.WebSubPlatform - 67, // 491: proto.ClientPayload.UserAgent.platform:type_name -> proto.ClientPayload.UserAgent.Platform - 341, // 492: proto.ClientPayload.UserAgent.appVersion:type_name -> proto.ClientPayload.UserAgent.AppVersion - 66, // 493: proto.ClientPayload.UserAgent.releaseChannel:type_name -> proto.ClientPayload.UserAgent.ReleaseChannel - 68, // 494: proto.ClientPayload.UserAgent.deviceType:type_name -> proto.ClientPayload.UserAgent.DeviceType - 69, // 495: proto.ClientPayload.DNSSource.dnsMethod:type_name -> proto.ClientPayload.DNSSource.DNSResolutionMethod - 346, // 496: proto.QP.Filter.parameters:type_name -> proto.QP.FilterParameters - 78, // 497: proto.QP.Filter.filterResult:type_name -> proto.QP.FilterResult - 79, // 498: proto.QP.Filter.clientNotSupportedConfig:type_name -> proto.QP.FilterClientNotSupportedConfig - 80, // 499: proto.QP.FilterClause.clauseType:type_name -> proto.QP.ClauseType - 347, // 500: proto.QP.FilterClause.clauses:type_name -> proto.QP.FilterClause - 345, // 501: proto.QP.FilterClause.filters:type_name -> proto.QP.Filter - 502, // [502:502] is the sub-list for method output_type - 502, // [502:502] is the sub-list for method input_type - 502, // [502:502] is the sub-list for extension type_name - 502, // [502:502] is the sub-list for extension extendee - 0, // [0:502] is the sub-list for field type_name + 287, // 6: proto.DeviceProps.historySyncConfig:type_name -> proto.DeviceProps.HistorySyncConfig + 291, // 7: proto.InteractiveMessage.header:type_name -> proto.InteractiveMessage.Header + 295, // 8: proto.InteractiveMessage.body:type_name -> proto.InteractiveMessage.Body + 292, // 9: proto.InteractiveMessage.footer:type_name -> proto.InteractiveMessage.Footer + 130, // 10: proto.InteractiveMessage.contextInfo:type_name -> proto.ContextInfo + 289, // 11: proto.InteractiveMessage.shopStorefrontMessage:type_name -> proto.InteractiveMessage.ShopMessage + 293, // 12: proto.InteractiveMessage.collectionMessage:type_name -> proto.InteractiveMessage.CollectionMessage + 290, // 13: proto.InteractiveMessage.nativeFlowMessage:type_name -> proto.InteractiveMessage.NativeFlowMessage + 294, // 14: proto.InteractiveMessage.carouselMessage:type_name -> proto.InteractiveMessage.CarouselMessage + 125, // 15: proto.ImageMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation + 130, // 16: proto.ImageMessage.contextInfo:type_name -> proto.ContextInfo + 125, // 17: proto.ImageMessage.annotations:type_name -> proto.InteractiveAnnotation + 6, // 18: proto.HistorySyncNotification.syncType:type_name -> proto.HistorySyncNotification.HistorySyncType + 297, // 19: proto.HighlyStructuredMessage.localizableParams:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter + 145, // 20: proto.HighlyStructuredMessage.hydratedHsm:type_name -> proto.TemplateMessage + 130, // 21: proto.GroupInviteMessage.contextInfo:type_name -> proto.ContextInfo + 9, // 22: proto.GroupInviteMessage.groupType:type_name -> proto.GroupInviteMessage.GroupType + 141, // 23: proto.FutureProofMessage.message:type_name -> proto.Message + 12, // 24: proto.ExtendedTextMessage.font:type_name -> proto.ExtendedTextMessage.FontType + 10, // 25: proto.ExtendedTextMessage.previewType:type_name -> proto.ExtendedTextMessage.PreviewType + 130, // 26: proto.ExtendedTextMessage.contextInfo:type_name -> proto.ContextInfo + 11, // 27: proto.ExtendedTextMessage.inviteLinkGroupType:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType + 11, // 28: proto.ExtendedTextMessage.inviteLinkGroupTypeV2:type_name -> proto.ExtendedTextMessage.InviteLinkGroupType + 13, // 29: proto.EventResponseMessage.response:type_name -> proto.EventResponseMessage.EventResponseType + 130, // 30: proto.EventMessage.contextInfo:type_name -> proto.ContextInfo + 171, // 31: proto.EventMessage.location:type_name -> proto.LocationMessage + 195, // 32: proto.EncReactionMessage.targetMessageKey:type_name -> proto.MessageKey + 195, // 33: proto.EncEventResponseMessage.eventCreationMessageKey:type_name -> proto.MessageKey + 195, // 34: proto.EncCommentMessage.targetMessageKey:type_name -> proto.MessageKey + 130, // 35: proto.DocumentMessage.contextInfo:type_name -> proto.ContextInfo + 141, // 36: proto.DeviceSentMessage.message:type_name -> proto.Message + 195, // 37: proto.DeclinePaymentRequestMessage.key:type_name -> proto.MessageKey + 106, // 38: proto.ContactsArrayMessage.contacts:type_name -> proto.ContactMessage + 130, // 39: proto.ContactsArrayMessage.contextInfo:type_name -> proto.ContextInfo + 130, // 40: proto.ContactMessage.contextInfo:type_name -> proto.ContextInfo + 141, // 41: proto.CommentMessage.message:type_name -> proto.Message + 195, // 42: proto.CommentMessage.targetMessageKey:type_name -> proto.MessageKey + 195, // 43: proto.CancelPaymentRequestMessage.key:type_name -> proto.MessageKey + 15, // 44: proto.CallLogMessage.callOutcome:type_name -> proto.CallLogMessage.CallOutcome + 14, // 45: proto.CallLogMessage.callType:type_name -> proto.CallLogMessage.CallType + 302, // 46: proto.CallLogMessage.participants:type_name -> proto.CallLogMessage.CallParticipant + 130, // 47: proto.ButtonsResponseMessage.contextInfo:type_name -> proto.ContextInfo + 16, // 48: proto.ButtonsResponseMessage.type:type_name -> proto.ButtonsResponseMessage.Type + 130, // 49: proto.ButtonsMessage.contextInfo:type_name -> proto.ContextInfo + 303, // 50: proto.ButtonsMessage.buttons:type_name -> proto.ButtonsMessage.Button + 17, // 51: proto.ButtonsMessage.headerType:type_name -> proto.ButtonsMessage.HeaderType + 102, // 52: proto.ButtonsMessage.documentMessage:type_name -> proto.DocumentMessage + 91, // 53: proto.ButtonsMessage.imageMessage:type_name -> proto.ImageMessage + 144, // 54: proto.ButtonsMessage.videoMessage:type_name -> proto.VideoMessage + 171, // 55: proto.ButtonsMessage.locationMessage:type_name -> proto.LocationMessage + 195, // 56: proto.BotFeedbackMessage.messageKey:type_name -> proto.MessageKey + 21, // 57: proto.BotFeedbackMessage.kind:type_name -> proto.BotFeedbackMessage.BotFeedbackKind + 22, // 58: proto.BCallMessage.mediaType:type_name -> proto.BCallMessage.MediaType + 130, // 59: proto.AudioMessage.contextInfo:type_name -> proto.ContextInfo + 120, // 60: proto.AppStateSyncKey.keyId:type_name -> proto.AppStateSyncKeyId + 122, // 61: proto.AppStateSyncKey.keyData:type_name -> proto.AppStateSyncKeyData + 117, // 62: proto.AppStateSyncKeyShare.keys:type_name -> proto.AppStateSyncKey + 120, // 63: proto.AppStateSyncKeyRequest.keyIds:type_name -> proto.AppStateSyncKeyId + 121, // 64: proto.AppStateSyncKeyData.fingerprint:type_name -> proto.AppStateSyncKeyFingerprint + 138, // 65: proto.InteractiveAnnotation.polygonVertices:type_name -> proto.Point + 124, // 66: proto.InteractiveAnnotation.location:type_name -> proto.Location + 131, // 67: proto.InteractiveAnnotation.newsletter:type_name -> proto.ForwardedNewsletterMessageInfo + 307, // 68: proto.HydratedTemplateButton.quickReplyButton:type_name -> proto.HydratedTemplateButton.HydratedQuickReplyButton + 306, // 69: proto.HydratedTemplateButton.urlButton:type_name -> proto.HydratedTemplateButton.HydratedURLButton + 308, // 70: proto.HydratedTemplateButton.callButton:type_name -> proto.HydratedTemplateButton.HydratedCallButton + 25, // 71: proto.DisappearingMode.initiator:type_name -> proto.DisappearingMode.Initiator + 24, // 72: proto.DisappearingMode.trigger:type_name -> proto.DisappearingMode.Trigger + 0, // 73: proto.DeviceListMetadata.senderAccountType:type_name -> proto.ADVEncryptionType + 0, // 74: proto.DeviceListMetadata.receiverAccountType:type_name -> proto.ADVEncryptionType + 141, // 75: proto.ContextInfo.quotedMessage:type_name -> proto.Message + 313, // 76: proto.ContextInfo.quotedAd:type_name -> proto.ContextInfo.AdReplyInfo + 195, // 77: proto.ContextInfo.placeholderKey:type_name -> proto.MessageKey + 310, // 78: proto.ContextInfo.externalAdReply:type_name -> proto.ContextInfo.ExternalAdReplyInfo + 128, // 79: proto.ContextInfo.disappearingMode:type_name -> proto.DisappearingMode + 136, // 80: proto.ContextInfo.actionLink:type_name -> proto.ActionLink + 127, // 81: proto.ContextInfo.groupMentions:type_name -> proto.GroupMention + 309, // 82: proto.ContextInfo.utm:type_name -> proto.ContextInfo.UTMInfo + 131, // 83: proto.ContextInfo.forwardedNewsletterMessageInfo:type_name -> proto.ForwardedNewsletterMessageInfo + 312, // 84: proto.ContextInfo.businessMessageForwardInfo:type_name -> proto.ContextInfo.BusinessMessageForwardInfo + 311, // 85: proto.ContextInfo.dataSharingContext:type_name -> proto.ContextInfo.DataSharingContext + 28, // 86: proto.ForwardedNewsletterMessageInfo.contentType:type_name -> proto.ForwardedNewsletterMessageInfo.ContentType + 29, // 87: proto.BotPluginMetadata.provider:type_name -> proto.BotPluginMetadata.SearchProvider + 30, // 88: proto.BotPluginMetadata.pluginType:type_name -> proto.BotPluginMetadata.PluginType + 135, // 89: proto.BotMetadata.avatarMetadata:type_name -> proto.BotAvatarMetadata + 133, // 90: proto.BotMetadata.pluginMetadata:type_name -> proto.BotPluginMetadata + 132, // 91: proto.BotMetadata.suggestedPromptMetadata:type_name -> proto.BotSuggestedPromptMetadata + 315, // 92: proto.TemplateButton.quickReplyButton:type_name -> proto.TemplateButton.QuickReplyButton + 314, // 93: proto.TemplateButton.urlButton:type_name -> proto.TemplateButton.URLButton + 316, // 94: proto.TemplateButton.callButton:type_name -> proto.TemplateButton.CallButton + 317, // 95: proto.PaymentBackground.mediaData:type_name -> proto.PaymentBackground.MediaData + 31, // 96: proto.PaymentBackground.type:type_name -> proto.PaymentBackground.Type + 149, // 97: proto.Message.senderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage + 91, // 98: proto.Message.imageMessage:type_name -> proto.ImageMessage + 106, // 99: proto.Message.contactMessage:type_name -> proto.ContactMessage + 171, // 100: proto.Message.locationMessage:type_name -> proto.LocationMessage + 96, // 101: proto.Message.extendedTextMessage:type_name -> proto.ExtendedTextMessage + 102, // 102: proto.Message.documentMessage:type_name -> proto.DocumentMessage + 116, // 103: proto.Message.audioMessage:type_name -> proto.AudioMessage + 144, // 104: proto.Message.videoMessage:type_name -> proto.VideoMessage + 110, // 105: proto.Message.call:type_name -> proto.Call + 108, // 106: proto.Message.chat:type_name -> proto.Chat + 157, // 107: proto.Message.protocolMessage:type_name -> proto.ProtocolMessage + 105, // 108: proto.Message.contactsArrayMessage:type_name -> proto.ContactsArrayMessage + 93, // 109: proto.Message.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage + 149, // 110: proto.Message.fastRatchetKeySenderKeyDistributionMessage:type_name -> proto.SenderKeyDistributionMessage + 150, // 111: proto.Message.sendPaymentMessage:type_name -> proto.SendPaymentMessage + 172, // 112: proto.Message.liveLocationMessage:type_name -> proto.LiveLocationMessage + 155, // 113: proto.Message.requestPaymentMessage:type_name -> proto.RequestPaymentMessage + 104, // 114: proto.Message.declinePaymentRequestMessage:type_name -> proto.DeclinePaymentRequestMessage + 109, // 115: proto.Message.cancelPaymentRequestMessage:type_name -> proto.CancelPaymentRequestMessage + 145, // 116: proto.Message.templateMessage:type_name -> proto.TemplateMessage + 148, // 117: proto.Message.stickerMessage:type_name -> proto.StickerMessage + 94, // 118: proto.Message.groupInviteMessage:type_name -> proto.GroupInviteMessage + 146, // 119: proto.Message.templateButtonReplyMessage:type_name -> proto.TemplateButtonReplyMessage + 158, // 120: proto.Message.productMessage:type_name -> proto.ProductMessage + 103, // 121: proto.Message.deviceSentMessage:type_name -> proto.DeviceSentMessage + 143, // 122: proto.Message.messageContextInfo:type_name -> proto.MessageContextInfo + 174, // 123: proto.Message.listMessage:type_name -> proto.ListMessage + 95, // 124: proto.Message.viewOnceMessage:type_name -> proto.FutureProofMessage + 168, // 125: proto.Message.orderMessage:type_name -> proto.OrderMessage + 173, // 126: proto.Message.listResponseMessage:type_name -> proto.ListResponseMessage + 95, // 127: proto.Message.ephemeralMessage:type_name -> proto.FutureProofMessage + 176, // 128: proto.Message.invoiceMessage:type_name -> proto.InvoiceMessage + 113, // 129: proto.Message.buttonsMessage:type_name -> proto.ButtonsMessage + 112, // 130: proto.Message.buttonsResponseMessage:type_name -> proto.ButtonsResponseMessage + 167, // 131: proto.Message.paymentInviteMessage:type_name -> proto.PaymentInviteMessage + 89, // 132: proto.Message.interactiveMessage:type_name -> proto.InteractiveMessage + 156, // 133: proto.Message.reactionMessage:type_name -> proto.ReactionMessage + 147, // 134: proto.Message.stickerSyncRmrMessage:type_name -> proto.StickerSyncRMRMessage + 177, // 135: proto.Message.interactiveResponseMessage:type_name -> proto.InteractiveResponseMessage + 163, // 136: proto.Message.pollCreationMessage:type_name -> proto.PollCreationMessage + 160, // 137: proto.Message.pollUpdateMessage:type_name -> proto.PollUpdateMessage + 175, // 138: proto.Message.keepInChatMessage:type_name -> proto.KeepInChatMessage + 95, // 139: proto.Message.documentWithCaptionMessage:type_name -> proto.FutureProofMessage + 154, // 140: proto.Message.requestPhoneNumberMessage:type_name -> proto.RequestPhoneNumberMessage + 95, // 141: proto.Message.viewOnceMessageV2:type_name -> proto.FutureProofMessage + 99, // 142: proto.Message.encReactionMessage:type_name -> proto.EncReactionMessage + 95, // 143: proto.Message.editedMessage:type_name -> proto.FutureProofMessage + 95, // 144: proto.Message.viewOnceMessageV2Extension:type_name -> proto.FutureProofMessage + 163, // 145: proto.Message.pollCreationMessageV2:type_name -> proto.PollCreationMessage + 152, // 146: proto.Message.scheduledCallCreationMessage:type_name -> proto.ScheduledCallCreationMessage + 95, // 147: proto.Message.groupMentionedMessage:type_name -> proto.FutureProofMessage + 164, // 148: proto.Message.pinInChatMessage:type_name -> proto.PinInChatMessage + 163, // 149: proto.Message.pollCreationMessageV3:type_name -> proto.PollCreationMessage + 151, // 150: proto.Message.scheduledCallEditMessage:type_name -> proto.ScheduledCallEditMessage + 144, // 151: proto.Message.ptvMessage:type_name -> proto.VideoMessage + 95, // 152: proto.Message.botInvokeMessage:type_name -> proto.FutureProofMessage + 111, // 153: proto.Message.callLogMesssage:type_name -> proto.CallLogMessage + 170, // 154: proto.Message.messageHistoryBundle:type_name -> proto.MessageHistoryBundle + 101, // 155: proto.Message.encCommentMessage:type_name -> proto.EncCommentMessage + 115, // 156: proto.Message.bcallMessage:type_name -> proto.BCallMessage + 95, // 157: proto.Message.lottieStickerMessage:type_name -> proto.FutureProofMessage + 98, // 158: proto.Message.eventMessage:type_name -> proto.EventMessage + 100, // 159: proto.Message.encEventResponseMessage:type_name -> proto.EncEventResponseMessage + 107, // 160: proto.Message.commentMessage:type_name -> proto.CommentMessage + 169, // 161: proto.Message.newsletterAdminInviteMessage:type_name -> proto.NewsletterAdminInviteMessage + 129, // 162: proto.MessageContextInfo.deviceListMetadata:type_name -> proto.DeviceListMetadata + 134, // 163: proto.MessageContextInfo.botMetadata:type_name -> proto.BotMetadata + 125, // 164: proto.VideoMessage.interactiveAnnotations:type_name -> proto.InteractiveAnnotation + 130, // 165: proto.VideoMessage.contextInfo:type_name -> proto.ContextInfo + 32, // 166: proto.VideoMessage.gifAttribution:type_name -> proto.VideoMessage.Attribution + 125, // 167: proto.VideoMessage.annotations:type_name -> proto.InteractiveAnnotation + 130, // 168: proto.TemplateMessage.contextInfo:type_name -> proto.ContextInfo + 318, // 169: proto.TemplateMessage.hydratedTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate + 319, // 170: proto.TemplateMessage.fourRowTemplate:type_name -> proto.TemplateMessage.FourRowTemplate + 318, // 171: proto.TemplateMessage.hydratedFourRowTemplate:type_name -> proto.TemplateMessage.HydratedFourRowTemplate + 89, // 172: proto.TemplateMessage.interactiveMessageTemplate:type_name -> proto.InteractiveMessage + 130, // 173: proto.TemplateButtonReplyMessage.contextInfo:type_name -> proto.ContextInfo + 130, // 174: proto.StickerMessage.contextInfo:type_name -> proto.ContextInfo + 141, // 175: proto.SendPaymentMessage.noteMessage:type_name -> proto.Message + 195, // 176: proto.SendPaymentMessage.requestMessageKey:type_name -> proto.MessageKey + 139, // 177: proto.SendPaymentMessage.background:type_name -> proto.PaymentBackground + 195, // 178: proto.ScheduledCallEditMessage.key:type_name -> proto.MessageKey + 33, // 179: proto.ScheduledCallEditMessage.editType:type_name -> proto.ScheduledCallEditMessage.EditType + 34, // 180: proto.ScheduledCallCreationMessage.callType:type_name -> proto.ScheduledCallCreationMessage.CallType + 35, // 181: proto.RequestWelcomeMessageMetadata.localChatState:type_name -> proto.RequestWelcomeMessageMetadata.LocalChatState + 130, // 182: proto.RequestPhoneNumberMessage.contextInfo:type_name -> proto.ContextInfo + 141, // 183: proto.RequestPaymentMessage.noteMessage:type_name -> proto.Message + 140, // 184: proto.RequestPaymentMessage.amount:type_name -> proto.Money + 139, // 185: proto.RequestPaymentMessage.background:type_name -> proto.PaymentBackground + 195, // 186: proto.ReactionMessage.key:type_name -> proto.MessageKey + 195, // 187: proto.ProtocolMessage.key:type_name -> proto.MessageKey + 36, // 188: proto.ProtocolMessage.type:type_name -> proto.ProtocolMessage.Type + 92, // 189: proto.ProtocolMessage.historySyncNotification:type_name -> proto.HistorySyncNotification + 118, // 190: proto.ProtocolMessage.appStateSyncKeyShare:type_name -> proto.AppStateSyncKeyShare + 119, // 191: proto.ProtocolMessage.appStateSyncKeyRequest:type_name -> proto.AppStateSyncKeyRequest + 90, // 192: proto.ProtocolMessage.initialSecurityNotificationSettingSync:type_name -> proto.InitialSecurityNotificationSettingSync + 123, // 193: proto.ProtocolMessage.appStateFatalExceptionNotification:type_name -> proto.AppStateFatalExceptionNotification + 128, // 194: proto.ProtocolMessage.disappearingMode:type_name -> proto.DisappearingMode + 141, // 195: proto.ProtocolMessage.editedMessage:type_name -> proto.Message + 166, // 196: proto.ProtocolMessage.peerDataOperationRequestMessage:type_name -> proto.PeerDataOperationRequestMessage + 165, // 197: proto.ProtocolMessage.peerDataOperationRequestResponseMessage:type_name -> proto.PeerDataOperationRequestResponseMessage + 114, // 198: proto.ProtocolMessage.botFeedbackMessage:type_name -> proto.BotFeedbackMessage + 153, // 199: proto.ProtocolMessage.requestWelcomeMessageMetadata:type_name -> proto.RequestWelcomeMessageMetadata + 320, // 200: proto.ProductMessage.product:type_name -> proto.ProductMessage.ProductSnapshot + 321, // 201: proto.ProductMessage.catalog:type_name -> proto.ProductMessage.CatalogSnapshot + 130, // 202: proto.ProductMessage.contextInfo:type_name -> proto.ContextInfo + 195, // 203: proto.PollUpdateMessage.pollCreationMessageKey:type_name -> proto.MessageKey + 162, // 204: proto.PollUpdateMessage.vote:type_name -> proto.PollEncValue + 161, // 205: proto.PollUpdateMessage.metadata:type_name -> proto.PollUpdateMessageMetadata + 322, // 206: proto.PollCreationMessage.options:type_name -> proto.PollCreationMessage.Option + 130, // 207: proto.PollCreationMessage.contextInfo:type_name -> proto.ContextInfo + 195, // 208: proto.PinInChatMessage.key:type_name -> proto.MessageKey + 37, // 209: proto.PinInChatMessage.type:type_name -> proto.PinInChatMessage.Type + 2, // 210: proto.PeerDataOperationRequestResponseMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType + 323, // 211: proto.PeerDataOperationRequestResponseMessage.peerDataOperationResult:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult + 2, // 212: proto.PeerDataOperationRequestMessage.peerDataOperationRequestType:type_name -> proto.PeerDataOperationRequestType + 328, // 213: proto.PeerDataOperationRequestMessage.requestStickerReupload:type_name -> proto.PeerDataOperationRequestMessage.RequestStickerReupload + 327, // 214: proto.PeerDataOperationRequestMessage.requestUrlPreview:type_name -> proto.PeerDataOperationRequestMessage.RequestUrlPreview + 330, // 215: proto.PeerDataOperationRequestMessage.historySyncOnDemandRequest:type_name -> proto.PeerDataOperationRequestMessage.HistorySyncOnDemandRequest + 329, // 216: proto.PeerDataOperationRequestMessage.placeholderMessageResendRequest:type_name -> proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest + 38, // 217: proto.PaymentInviteMessage.serviceType:type_name -> proto.PaymentInviteMessage.ServiceType + 40, // 218: proto.OrderMessage.status:type_name -> proto.OrderMessage.OrderStatus + 39, // 219: proto.OrderMessage.surface:type_name -> proto.OrderMessage.OrderSurface + 130, // 220: proto.OrderMessage.contextInfo:type_name -> proto.ContextInfo + 195, // 221: proto.OrderMessage.orderRequestMessageId:type_name -> proto.MessageKey + 130, // 222: proto.MessageHistoryBundle.contextInfo:type_name -> proto.ContextInfo + 130, // 223: proto.LocationMessage.contextInfo:type_name -> proto.ContextInfo + 130, // 224: proto.LiveLocationMessage.contextInfo:type_name -> proto.ContextInfo + 41, // 225: proto.ListResponseMessage.listType:type_name -> proto.ListResponseMessage.ListType + 331, // 226: proto.ListResponseMessage.singleSelectReply:type_name -> proto.ListResponseMessage.SingleSelectReply + 130, // 227: proto.ListResponseMessage.contextInfo:type_name -> proto.ContextInfo + 42, // 228: proto.ListMessage.listType:type_name -> proto.ListMessage.ListType + 332, // 229: proto.ListMessage.sections:type_name -> proto.ListMessage.Section + 336, // 230: proto.ListMessage.productListInfo:type_name -> proto.ListMessage.ProductListInfo + 130, // 231: proto.ListMessage.contextInfo:type_name -> proto.ContextInfo + 195, // 232: proto.KeepInChatMessage.key:type_name -> proto.MessageKey + 1, // 233: proto.KeepInChatMessage.keepType:type_name -> proto.KeepType + 43, // 234: proto.InvoiceMessage.attachmentType:type_name -> proto.InvoiceMessage.AttachmentType + 339, // 235: proto.InteractiveResponseMessage.body:type_name -> proto.InteractiveResponseMessage.Body + 130, // 236: proto.InteractiveResponseMessage.contextInfo:type_name -> proto.ContextInfo + 338, // 237: proto.InteractiveResponseMessage.nativeFlowResponseMessage:type_name -> proto.InteractiveResponseMessage.NativeFlowResponseMessage + 184, // 238: proto.PastParticipants.pastParticipants:type_name -> proto.PastParticipant + 45, // 239: proto.PastParticipant.leaveReason:type_name -> proto.PastParticipant.LeaveReason + 46, // 240: proto.HistorySync.syncType:type_name -> proto.HistorySync.HistorySyncType + 190, // 241: proto.HistorySync.conversations:type_name -> proto.Conversation + 266, // 242: proto.HistorySync.statusV3Messages:type_name -> proto.WebMessageInfo + 181, // 243: proto.HistorySync.pushnames:type_name -> proto.Pushname + 189, // 244: proto.HistorySync.globalSettings:type_name -> proto.GlobalSettings + 180, // 245: proto.HistorySync.recentStickers:type_name -> proto.StickerMetadata + 183, // 246: proto.HistorySync.pastParticipants:type_name -> proto.PastParticipants + 254, // 247: proto.HistorySync.callLogRecords:type_name -> proto.CallLogRecord + 47, // 248: proto.HistorySync.aiWaitListState:type_name -> proto.HistorySync.BotAIWaitListState + 182, // 249: proto.HistorySync.phoneNumberToLidMappings:type_name -> proto.PhoneNumberToLIDMapping + 266, // 250: proto.HistorySyncMsg.message:type_name -> proto.WebMessageInfo + 48, // 251: proto.GroupParticipant.rank:type_name -> proto.GroupParticipant.Rank + 179, // 252: proto.GlobalSettings.lightThemeWallpaper:type_name -> proto.WallpaperSettings + 3, // 253: proto.GlobalSettings.mediaVisibility:type_name -> proto.MediaVisibility + 179, // 254: proto.GlobalSettings.darkThemeWallpaper:type_name -> proto.WallpaperSettings + 192, // 255: proto.GlobalSettings.autoDownloadWiFi:type_name -> proto.AutoDownloadSettings + 192, // 256: proto.GlobalSettings.autoDownloadCellular:type_name -> proto.AutoDownloadSettings + 192, // 257: proto.GlobalSettings.autoDownloadRoaming:type_name -> proto.AutoDownloadSettings + 191, // 258: proto.GlobalSettings.avatarUserSettings:type_name -> proto.AvatarUserSettings + 185, // 259: proto.GlobalSettings.individualNotificationSettings:type_name -> proto.NotificationSettings + 185, // 260: proto.GlobalSettings.groupNotificationSettings:type_name -> proto.NotificationSettings + 187, // 261: proto.Conversation.messages:type_name -> proto.HistorySyncMsg + 49, // 262: proto.Conversation.endOfHistoryTransferType:type_name -> proto.Conversation.EndOfHistoryTransferType + 128, // 263: proto.Conversation.disappearingMode:type_name -> proto.DisappearingMode + 188, // 264: proto.Conversation.participant:type_name -> proto.GroupParticipant + 179, // 265: proto.Conversation.wallpaper:type_name -> proto.WallpaperSettings + 3, // 266: proto.Conversation.mediaVisibility:type_name -> proto.MediaVisibility + 50, // 267: proto.MediaRetryNotification.result:type_name -> proto.MediaRetryNotification.ResultType + 196, // 268: proto.SyncdSnapshot.version:type_name -> proto.SyncdVersion + 199, // 269: proto.SyncdSnapshot.records:type_name -> proto.SyncdRecord + 204, // 270: proto.SyncdSnapshot.keyId:type_name -> proto.KeyId + 203, // 271: proto.SyncdRecord.index:type_name -> proto.SyncdIndex + 197, // 272: proto.SyncdRecord.value:type_name -> proto.SyncdValue + 204, // 273: proto.SyncdRecord.keyId:type_name -> proto.KeyId + 196, // 274: proto.SyncdPatch.version:type_name -> proto.SyncdVersion + 202, // 275: proto.SyncdPatch.mutations:type_name -> proto.SyncdMutation + 205, // 276: proto.SyncdPatch.externalMutations:type_name -> proto.ExternalBlobReference + 204, // 277: proto.SyncdPatch.keyId:type_name -> proto.KeyId + 206, // 278: proto.SyncdPatch.exitCode:type_name -> proto.ExitCode + 202, // 279: proto.SyncdMutations.mutations:type_name -> proto.SyncdMutation + 51, // 280: proto.SyncdMutation.operation:type_name -> proto.SyncdMutation.SyncdOperation + 199, // 281: proto.SyncdMutation.record:type_name -> proto.SyncdRecord + 216, // 282: proto.SyncActionValue.starAction:type_name -> proto.StarAction + 242, // 283: proto.SyncActionValue.contactAction:type_name -> proto.ContactAction + 229, // 284: proto.SyncActionValue.muteAction:type_name -> proto.MuteAction + 226, // 285: proto.SyncActionValue.pinAction:type_name -> proto.PinAction + 217, // 286: proto.SyncActionValue.securityNotificationSetting:type_name -> proto.SecurityNotificationSetting + 221, // 287: proto.SyncActionValue.pushNameSetting:type_name -> proto.PushNameSetting + 220, // 288: proto.SyncActionValue.quickReplyAction:type_name -> proto.QuickReplyAction + 219, // 289: proto.SyncActionValue.recentEmojiWeightsAction:type_name -> proto.RecentEmojiWeightsAction + 235, // 290: proto.SyncActionValue.labelEditAction:type_name -> proto.LabelEditAction + 236, // 291: proto.SyncActionValue.labelAssociationAction:type_name -> proto.LabelAssociationAction + 233, // 292: proto.SyncActionValue.localeSetting:type_name -> proto.LocaleSetting + 248, // 293: proto.SyncActionValue.archiveChatAction:type_name -> proto.ArchiveChatAction + 239, // 294: proto.SyncActionValue.deleteMessageForMeAction:type_name -> proto.DeleteMessageForMeAction + 237, // 295: proto.SyncActionValue.keyExpiration:type_name -> proto.KeyExpiration + 232, // 296: proto.SyncActionValue.markChatAsReadAction:type_name -> proto.MarkChatAsReadAction + 243, // 297: proto.SyncActionValue.clearChatAction:type_name -> proto.ClearChatAction + 241, // 298: proto.SyncActionValue.deleteChatAction:type_name -> proto.DeleteChatAction + 209, // 299: proto.SyncActionValue.unarchiveChatsSetting:type_name -> proto.UnarchiveChatsSetting + 224, // 300: proto.SyncActionValue.primaryFeature:type_name -> proto.PrimaryFeature + 249, // 301: proto.SyncActionValue.androidUnsupportedActions:type_name -> proto.AndroidUnsupportedActions + 250, // 302: proto.SyncActionValue.agentAction:type_name -> proto.AgentAction + 213, // 303: proto.SyncActionValue.subscriptionAction:type_name -> proto.SubscriptionAction + 208, // 304: proto.SyncActionValue.userStatusMuteAction:type_name -> proto.UserStatusMuteAction + 210, // 305: proto.SyncActionValue.timeFormatAction:type_name -> proto.TimeFormatAction + 228, // 306: proto.SyncActionValue.nuxAction:type_name -> proto.NuxAction + 223, // 307: proto.SyncActionValue.primaryVersionAction:type_name -> proto.PrimaryVersionAction + 214, // 308: proto.SyncActionValue.stickerAction:type_name -> proto.StickerAction + 218, // 309: proto.SyncActionValue.removeRecentStickerAction:type_name -> proto.RemoveRecentStickerAction + 245, // 310: proto.SyncActionValue.chatAssignment:type_name -> proto.ChatAssignmentAction + 244, // 311: proto.SyncActionValue.chatAssignmentOpenedStatus:type_name -> proto.ChatAssignmentOpenedStatusAction + 225, // 312: proto.SyncActionValue.pnForLidChatAction:type_name -> proto.PnForLidChatAction + 231, // 313: proto.SyncActionValue.marketingMessageAction:type_name -> proto.MarketingMessageAction + 230, // 314: proto.SyncActionValue.marketingMessageBroadcastAction:type_name -> proto.MarketingMessageBroadcastAction + 238, // 315: proto.SyncActionValue.externalWebBetaAction:type_name -> proto.ExternalWebBetaAction + 222, // 316: proto.SyncActionValue.privacySettingRelayAllCalls:type_name -> proto.PrivacySettingRelayAllCalls + 246, // 317: proto.SyncActionValue.callLogAction:type_name -> proto.CallLogAction + 215, // 318: proto.SyncActionValue.statusPrivacy:type_name -> proto.StatusPrivacyAction + 247, // 319: proto.SyncActionValue.botWelcomeRequestAction:type_name -> proto.BotWelcomeRequestAction + 240, // 320: proto.SyncActionValue.deleteIndividualCallLog:type_name -> proto.DeleteIndividualCallLogAction + 234, // 321: proto.SyncActionValue.labelReorderingAction:type_name -> proto.LabelReorderingAction + 227, // 322: proto.SyncActionValue.paymentInfoAction:type_name -> proto.PaymentInfoAction + 195, // 323: proto.SyncActionMessage.key:type_name -> proto.MessageKey + 211, // 324: proto.SyncActionMessageRange.messages:type_name -> proto.SyncActionMessage + 52, // 325: proto.StatusPrivacyAction.mode:type_name -> proto.StatusPrivacyAction.StatusDistributionMode + 252, // 326: proto.RecentEmojiWeightsAction.weights:type_name -> proto.RecentEmojiWeight + 53, // 327: proto.MarketingMessageAction.type:type_name -> proto.MarketingMessageAction.MarketingMessagePrototypeType + 212, // 328: proto.MarkChatAsReadAction.messageRange:type_name -> proto.SyncActionMessageRange + 212, // 329: proto.DeleteChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 212, // 330: proto.ClearChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 254, // 331: proto.CallLogAction.callLogRecord:type_name -> proto.CallLogRecord + 212, // 332: proto.ArchiveChatAction.messageRange:type_name -> proto.SyncActionMessageRange + 207, // 333: proto.SyncActionData.value:type_name -> proto.SyncActionValue + 54, // 334: proto.PatchDebugData.senderPlatform:type_name -> proto.PatchDebugData.Platform + 57, // 335: proto.CallLogRecord.callResult:type_name -> proto.CallLogRecord.CallResult + 55, // 336: proto.CallLogRecord.silenceReason:type_name -> proto.CallLogRecord.SilenceReason + 340, // 337: proto.CallLogRecord.participants:type_name -> proto.CallLogRecord.ParticipantInfo + 56, // 338: proto.CallLogRecord.callType:type_name -> proto.CallLogRecord.CallType + 58, // 339: proto.BizIdentityInfo.vlevel:type_name -> proto.BizIdentityInfo.VerifiedLevelValue + 255, // 340: proto.BizIdentityInfo.vnameCert:type_name -> proto.VerifiedNameCertificate + 59, // 341: proto.BizIdentityInfo.hostStorage:type_name -> proto.BizIdentityInfo.HostStorageType + 60, // 342: proto.BizIdentityInfo.actualActors:type_name -> proto.BizIdentityInfo.ActualActorsType + 255, // 343: proto.BizAccountPayload.vnameCert:type_name -> proto.VerifiedNameCertificate + 61, // 344: proto.BizAccountLinkInfo.hostStorage:type_name -> proto.BizAccountLinkInfo.HostStorageType + 62, // 345: proto.BizAccountLinkInfo.accountType:type_name -> proto.BizAccountLinkInfo.AccountType + 262, // 346: proto.HandshakeMessage.clientHello:type_name -> proto.HandshakeClientHello + 261, // 347: proto.HandshakeMessage.serverHello:type_name -> proto.HandshakeServerHello + 263, // 348: proto.HandshakeMessage.clientFinish:type_name -> proto.HandshakeClientFinish + 343, // 349: proto.ClientPayload.userAgent:type_name -> proto.ClientPayload.UserAgent + 342, // 350: proto.ClientPayload.webInfo:type_name -> proto.ClientPayload.WebInfo + 65, // 351: proto.ClientPayload.connectType:type_name -> proto.ClientPayload.ConnectType + 66, // 352: proto.ClientPayload.connectReason:type_name -> proto.ClientPayload.ConnectReason + 346, // 353: proto.ClientPayload.dnsSource:type_name -> proto.ClientPayload.DNSSource + 345, // 354: proto.ClientPayload.devicePairingData:type_name -> proto.ClientPayload.DevicePairingRegistrationData + 63, // 355: proto.ClientPayload.product:type_name -> proto.ClientPayload.Product + 64, // 356: proto.ClientPayload.iosAppExtension:type_name -> proto.ClientPayload.IOSAppExtension + 344, // 357: proto.ClientPayload.interopData:type_name -> proto.ClientPayload.InteropData + 266, // 358: proto.WebNotificationsInfo.notifyMessages:type_name -> proto.WebMessageInfo + 195, // 359: proto.WebMessageInfo.key:type_name -> proto.MessageKey + 141, // 360: proto.WebMessageInfo.message:type_name -> proto.Message + 73, // 361: proto.WebMessageInfo.status:type_name -> proto.WebMessageInfo.Status + 72, // 362: proto.WebMessageInfo.messageStubType:type_name -> proto.WebMessageInfo.StubType + 277, // 363: proto.WebMessageInfo.paymentInfo:type_name -> proto.PaymentInfo + 172, // 364: proto.WebMessageInfo.finalLiveLocation:type_name -> proto.LiveLocationMessage + 277, // 365: proto.WebMessageInfo.quotedPaymentInfo:type_name -> proto.PaymentInfo + 74, // 366: proto.WebMessageInfo.bizPrivacyStatus:type_name -> proto.WebMessageInfo.BizPrivacyStatus + 280, // 367: proto.WebMessageInfo.mediaData:type_name -> proto.MediaData + 276, // 368: proto.WebMessageInfo.photoChange:type_name -> proto.PhotoChange + 268, // 369: proto.WebMessageInfo.userReceipt:type_name -> proto.UserReceipt + 271, // 370: proto.WebMessageInfo.reactions:type_name -> proto.Reaction + 280, // 371: proto.WebMessageInfo.quotedStickerData:type_name -> proto.MediaData + 269, // 372: proto.WebMessageInfo.statusPsa:type_name -> proto.StatusPSA + 273, // 373: proto.WebMessageInfo.pollUpdates:type_name -> proto.PollUpdate + 274, // 374: proto.WebMessageInfo.pollAdditionalMetadata:type_name -> proto.PollAdditionalMetadata + 281, // 375: proto.WebMessageInfo.keepInChat:type_name -> proto.KeepInChat + 275, // 376: proto.WebMessageInfo.pinInChat:type_name -> proto.PinInChat + 272, // 377: proto.WebMessageInfo.premiumMessageInfo:type_name -> proto.PremiumMessageInfo + 283, // 378: proto.WebMessageInfo.commentMetadata:type_name -> proto.CommentMetadata + 282, // 379: proto.WebMessageInfo.eventResponses:type_name -> proto.EventResponse + 270, // 380: proto.WebMessageInfo.reportingTokenInfo:type_name -> proto.ReportingTokenInfo + 75, // 381: proto.WebFeatures.labelsDisplay:type_name -> proto.WebFeatures.Flag + 75, // 382: proto.WebFeatures.voipIndividualOutgoing:type_name -> proto.WebFeatures.Flag + 75, // 383: proto.WebFeatures.groupsV3:type_name -> proto.WebFeatures.Flag + 75, // 384: proto.WebFeatures.groupsV3Create:type_name -> proto.WebFeatures.Flag + 75, // 385: proto.WebFeatures.changeNumberV2:type_name -> proto.WebFeatures.Flag + 75, // 386: proto.WebFeatures.queryStatusV3Thumbnail:type_name -> proto.WebFeatures.Flag + 75, // 387: proto.WebFeatures.liveLocations:type_name -> proto.WebFeatures.Flag + 75, // 388: proto.WebFeatures.queryVname:type_name -> proto.WebFeatures.Flag + 75, // 389: proto.WebFeatures.voipIndividualIncoming:type_name -> proto.WebFeatures.Flag + 75, // 390: proto.WebFeatures.quickRepliesQuery:type_name -> proto.WebFeatures.Flag + 75, // 391: proto.WebFeatures.payments:type_name -> proto.WebFeatures.Flag + 75, // 392: proto.WebFeatures.stickerPackQuery:type_name -> proto.WebFeatures.Flag + 75, // 393: proto.WebFeatures.liveLocationsFinal:type_name -> proto.WebFeatures.Flag + 75, // 394: proto.WebFeatures.labelsEdit:type_name -> proto.WebFeatures.Flag + 75, // 395: proto.WebFeatures.mediaUpload:type_name -> proto.WebFeatures.Flag + 75, // 396: proto.WebFeatures.mediaUploadRichQuickReplies:type_name -> proto.WebFeatures.Flag + 75, // 397: proto.WebFeatures.vnameV2:type_name -> proto.WebFeatures.Flag + 75, // 398: proto.WebFeatures.videoPlaybackUrl:type_name -> proto.WebFeatures.Flag + 75, // 399: proto.WebFeatures.statusRanking:type_name -> proto.WebFeatures.Flag + 75, // 400: proto.WebFeatures.voipIndividualVideo:type_name -> proto.WebFeatures.Flag + 75, // 401: proto.WebFeatures.thirdPartyStickers:type_name -> proto.WebFeatures.Flag + 75, // 402: proto.WebFeatures.frequentlyForwardedSetting:type_name -> proto.WebFeatures.Flag + 75, // 403: proto.WebFeatures.groupsV4JoinPermission:type_name -> proto.WebFeatures.Flag + 75, // 404: proto.WebFeatures.recentStickers:type_name -> proto.WebFeatures.Flag + 75, // 405: proto.WebFeatures.catalog:type_name -> proto.WebFeatures.Flag + 75, // 406: proto.WebFeatures.starredStickers:type_name -> proto.WebFeatures.Flag + 75, // 407: proto.WebFeatures.voipGroupCall:type_name -> proto.WebFeatures.Flag + 75, // 408: proto.WebFeatures.templateMessage:type_name -> proto.WebFeatures.Flag + 75, // 409: proto.WebFeatures.templateMessageInteractivity:type_name -> proto.WebFeatures.Flag + 75, // 410: proto.WebFeatures.ephemeralMessages:type_name -> proto.WebFeatures.Flag + 75, // 411: proto.WebFeatures.e2ENotificationSync:type_name -> proto.WebFeatures.Flag + 75, // 412: proto.WebFeatures.recentStickersV2:type_name -> proto.WebFeatures.Flag + 75, // 413: proto.WebFeatures.recentStickersV3:type_name -> proto.WebFeatures.Flag + 75, // 414: proto.WebFeatures.userNotice:type_name -> proto.WebFeatures.Flag + 75, // 415: proto.WebFeatures.support:type_name -> proto.WebFeatures.Flag + 75, // 416: proto.WebFeatures.groupUiiCleanup:type_name -> proto.WebFeatures.Flag + 75, // 417: proto.WebFeatures.groupDogfoodingInternalOnly:type_name -> proto.WebFeatures.Flag + 75, // 418: proto.WebFeatures.settingsSync:type_name -> proto.WebFeatures.Flag + 75, // 419: proto.WebFeatures.archiveV2:type_name -> proto.WebFeatures.Flag + 75, // 420: proto.WebFeatures.ephemeralAllowGroupMembers:type_name -> proto.WebFeatures.Flag + 75, // 421: proto.WebFeatures.ephemeral24HDuration:type_name -> proto.WebFeatures.Flag + 75, // 422: proto.WebFeatures.mdForceUpgrade:type_name -> proto.WebFeatures.Flag + 75, // 423: proto.WebFeatures.disappearingMode:type_name -> proto.WebFeatures.Flag + 75, // 424: proto.WebFeatures.externalMdOptInAvailable:type_name -> proto.WebFeatures.Flag + 75, // 425: proto.WebFeatures.noDeleteMessageTimeLimit:type_name -> proto.WebFeatures.Flag + 195, // 426: proto.Reaction.key:type_name -> proto.MessageKey + 195, // 427: proto.PollUpdate.pollUpdateMessageKey:type_name -> proto.MessageKey + 159, // 428: proto.PollUpdate.vote:type_name -> proto.PollVoteMessage + 76, // 429: proto.PinInChat.type:type_name -> proto.PinInChat.Type + 195, // 430: proto.PinInChat.key:type_name -> proto.MessageKey + 279, // 431: proto.PinInChat.messageAddOnContextInfo:type_name -> proto.MessageAddOnContextInfo + 79, // 432: proto.PaymentInfo.currencyDeprecated:type_name -> proto.PaymentInfo.Currency + 78, // 433: proto.PaymentInfo.status:type_name -> proto.PaymentInfo.Status + 195, // 434: proto.PaymentInfo.requestMessageKey:type_name -> proto.MessageKey + 77, // 435: proto.PaymentInfo.txnStatus:type_name -> proto.PaymentInfo.TxnStatus + 140, // 436: proto.PaymentInfo.primaryAmount:type_name -> proto.Money + 140, // 437: proto.PaymentInfo.exchangeAmount:type_name -> proto.Money + 195, // 438: proto.NotificationMessageInfo.key:type_name -> proto.MessageKey + 141, // 439: proto.NotificationMessageInfo.message:type_name -> proto.Message + 1, // 440: proto.KeepInChat.keepType:type_name -> proto.KeepType + 195, // 441: proto.KeepInChat.key:type_name -> proto.MessageKey + 195, // 442: proto.EventResponse.eventResponseMessageKey:type_name -> proto.MessageKey + 97, // 443: proto.EventResponse.eventResponseMessage:type_name -> proto.EventResponseMessage + 195, // 444: proto.CommentMetadata.commentParentKey:type_name -> proto.MessageKey + 350, // 445: proto.CertChain.leaf:type_name -> proto.CertChain.NoiseCertificate + 350, // 446: proto.CertChain.intermediate:type_name -> proto.CertChain.NoiseCertificate + 5, // 447: proto.InteractiveMessage.ShopMessage.surface:type_name -> proto.InteractiveMessage.ShopMessage.Surface + 296, // 448: proto.InteractiveMessage.NativeFlowMessage.buttons:type_name -> proto.InteractiveMessage.NativeFlowMessage.NativeFlowButton + 102, // 449: proto.InteractiveMessage.Header.documentMessage:type_name -> proto.DocumentMessage + 91, // 450: proto.InteractiveMessage.Header.imageMessage:type_name -> proto.ImageMessage + 144, // 451: proto.InteractiveMessage.Header.videoMessage:type_name -> proto.VideoMessage + 171, // 452: proto.InteractiveMessage.Header.locationMessage:type_name -> proto.LocationMessage + 89, // 453: proto.InteractiveMessage.CarouselMessage.cards:type_name -> proto.InteractiveMessage + 299, // 454: proto.HighlyStructuredMessage.HSMLocalizableParameter.currency:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMCurrency + 298, // 455: proto.HighlyStructuredMessage.HSMLocalizableParameter.dateTime:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime + 301, // 456: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.component:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent + 300, // 457: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.unixEpoch:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeUnixEpoch + 7, // 458: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.dayOfWeek:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.DayOfWeekType + 8, // 459: proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.calendar:type_name -> proto.HighlyStructuredMessage.HSMLocalizableParameter.HSMDateTime.HSMDateTimeComponent.CalendarType + 15, // 460: proto.CallLogMessage.CallParticipant.callOutcome:type_name -> proto.CallLogMessage.CallOutcome + 305, // 461: proto.ButtonsMessage.Button.buttonText:type_name -> proto.ButtonsMessage.Button.ButtonText + 18, // 462: proto.ButtonsMessage.Button.type:type_name -> proto.ButtonsMessage.Button.Type + 304, // 463: proto.ButtonsMessage.Button.nativeFlowInfo:type_name -> proto.ButtonsMessage.Button.NativeFlowInfo + 23, // 464: proto.HydratedTemplateButton.HydratedURLButton.webviewPresentation:type_name -> proto.HydratedTemplateButton.HydratedURLButton.WebviewPresentationType + 26, // 465: proto.ContextInfo.ExternalAdReplyInfo.mediaType:type_name -> proto.ContextInfo.ExternalAdReplyInfo.MediaType + 27, // 466: proto.ContextInfo.AdReplyInfo.mediaType:type_name -> proto.ContextInfo.AdReplyInfo.MediaType + 93, // 467: proto.TemplateButton.URLButton.displayText:type_name -> proto.HighlyStructuredMessage + 93, // 468: proto.TemplateButton.URLButton.url:type_name -> proto.HighlyStructuredMessage + 93, // 469: proto.TemplateButton.QuickReplyButton.displayText:type_name -> proto.HighlyStructuredMessage + 93, // 470: proto.TemplateButton.CallButton.displayText:type_name -> proto.HighlyStructuredMessage + 93, // 471: proto.TemplateButton.CallButton.phoneNumber:type_name -> proto.HighlyStructuredMessage + 126, // 472: proto.TemplateMessage.HydratedFourRowTemplate.hydratedButtons:type_name -> proto.HydratedTemplateButton + 102, // 473: proto.TemplateMessage.HydratedFourRowTemplate.documentMessage:type_name -> proto.DocumentMessage + 91, // 474: proto.TemplateMessage.HydratedFourRowTemplate.imageMessage:type_name -> proto.ImageMessage + 144, // 475: proto.TemplateMessage.HydratedFourRowTemplate.videoMessage:type_name -> proto.VideoMessage + 171, // 476: proto.TemplateMessage.HydratedFourRowTemplate.locationMessage:type_name -> proto.LocationMessage + 93, // 477: proto.TemplateMessage.FourRowTemplate.content:type_name -> proto.HighlyStructuredMessage + 93, // 478: proto.TemplateMessage.FourRowTemplate.footer:type_name -> proto.HighlyStructuredMessage + 137, // 479: proto.TemplateMessage.FourRowTemplate.buttons:type_name -> proto.TemplateButton + 102, // 480: proto.TemplateMessage.FourRowTemplate.documentMessage:type_name -> proto.DocumentMessage + 93, // 481: proto.TemplateMessage.FourRowTemplate.highlyStructuredMessage:type_name -> proto.HighlyStructuredMessage + 91, // 482: proto.TemplateMessage.FourRowTemplate.imageMessage:type_name -> proto.ImageMessage + 144, // 483: proto.TemplateMessage.FourRowTemplate.videoMessage:type_name -> proto.VideoMessage + 171, // 484: proto.TemplateMessage.FourRowTemplate.locationMessage:type_name -> proto.LocationMessage + 91, // 485: proto.ProductMessage.ProductSnapshot.productImage:type_name -> proto.ImageMessage + 91, // 486: proto.ProductMessage.CatalogSnapshot.catalogImage:type_name -> proto.ImageMessage + 50, // 487: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.mediaUploadResult:type_name -> proto.MediaRetryNotification.ResultType + 148, // 488: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.stickerMessage:type_name -> proto.StickerMessage + 325, // 489: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.linkPreviewResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse + 324, // 490: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.placeholderMessageResendResponse:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.PlaceholderMessageResendResponse + 326, // 491: proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.hqThumbnail:type_name -> proto.PeerDataOperationRequestResponseMessage.PeerDataOperationResult.LinkPreviewResponse.LinkPreviewHighQualityThumbnail + 195, // 492: proto.PeerDataOperationRequestMessage.PlaceholderMessageResendRequest.messageKey:type_name -> proto.MessageKey + 333, // 493: proto.ListMessage.Section.rows:type_name -> proto.ListMessage.Row + 334, // 494: proto.ListMessage.ProductSection.products:type_name -> proto.ListMessage.Product + 335, // 495: proto.ListMessage.ProductListInfo.productSections:type_name -> proto.ListMessage.ProductSection + 337, // 496: proto.ListMessage.ProductListInfo.headerImage:type_name -> proto.ListMessage.ProductListHeaderImage + 44, // 497: proto.InteractiveResponseMessage.Body.format:type_name -> proto.InteractiveResponseMessage.Body.Format + 57, // 498: proto.CallLogRecord.ParticipantInfo.callResult:type_name -> proto.CallLogRecord.CallResult + 256, // 499: proto.VerifiedNameCertificate.Details.localizedNames:type_name -> proto.LocalizedName + 347, // 500: proto.ClientPayload.WebInfo.webdPayload:type_name -> proto.ClientPayload.WebInfo.WebdPayload + 67, // 501: proto.ClientPayload.WebInfo.webSubPlatform:type_name -> proto.ClientPayload.WebInfo.WebSubPlatform + 69, // 502: proto.ClientPayload.UserAgent.platform:type_name -> proto.ClientPayload.UserAgent.Platform + 348, // 503: proto.ClientPayload.UserAgent.appVersion:type_name -> proto.ClientPayload.UserAgent.AppVersion + 68, // 504: proto.ClientPayload.UserAgent.releaseChannel:type_name -> proto.ClientPayload.UserAgent.ReleaseChannel + 70, // 505: proto.ClientPayload.UserAgent.deviceType:type_name -> proto.ClientPayload.UserAgent.DeviceType + 71, // 506: proto.ClientPayload.DNSSource.dnsMethod:type_name -> proto.ClientPayload.DNSSource.DNSResolutionMethod + 353, // 507: proto.QP.Filter.parameters:type_name -> proto.QP.FilterParameters + 80, // 508: proto.QP.Filter.filterResult:type_name -> proto.QP.FilterResult + 81, // 509: proto.QP.Filter.clientNotSupportedConfig:type_name -> proto.QP.FilterClientNotSupportedConfig + 82, // 510: proto.QP.FilterClause.clauseType:type_name -> proto.QP.ClauseType + 354, // 511: proto.QP.FilterClause.clauses:type_name -> proto.QP.FilterClause + 352, // 512: proto.QP.FilterClause.filters:type_name -> proto.QP.Filter + 513, // [513:513] is the sub-list for method output_type + 513, // [513:513] is the sub-list for method input_type + 513, // [513:513] is the sub-list for extension type_name + 513, // [513:513] is the sub-list for extension extendee + 0, // [0:513] is the sub-list for field type_name } func init() { file_binary_proto_def_proto_init() } @@ -29211,7 +29800,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BotPluginMetadata); i { + switch v := v.(*BotSuggestedPromptMetadata); i { case 0: return &v.state case 1: @@ -29223,7 +29812,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BotMetadata); i { + switch v := v.(*BotPluginMetadata); i { case 0: return &v.state case 1: @@ -29235,7 +29824,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BotAvatarMetadata); i { + switch v := v.(*BotMetadata); i { case 0: return &v.state case 1: @@ -29247,7 +29836,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ActionLink); i { + switch v := v.(*BotAvatarMetadata); i { case 0: return &v.state case 1: @@ -29259,7 +29848,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton); i { + switch v := v.(*ActionLink); i { case 0: return &v.state case 1: @@ -29271,7 +29860,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Point); i { + switch v := v.(*TemplateButton); i { case 0: return &v.state case 1: @@ -29283,7 +29872,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentBackground); i { + switch v := v.(*Point); i { case 0: return &v.state case 1: @@ -29295,7 +29884,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Money); i { + switch v := v.(*PaymentBackground); i { case 0: return &v.state case 1: @@ -29307,7 +29896,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Message); i { + switch v := v.(*Money); i { case 0: return &v.state case 1: @@ -29319,7 +29908,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageSecretMessage); i { + switch v := v.(*Message); i { case 0: return &v.state case 1: @@ -29331,7 +29920,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageContextInfo); i { + switch v := v.(*MessageSecretMessage); i { case 0: return &v.state case 1: @@ -29343,7 +29932,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VideoMessage); i { + switch v := v.(*MessageContextInfo); i { case 0: return &v.state case 1: @@ -29355,7 +29944,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateMessage); i { + switch v := v.(*VideoMessage); i { case 0: return &v.state case 1: @@ -29367,7 +29956,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButtonReplyMessage); i { + switch v := v.(*TemplateMessage); i { case 0: return &v.state case 1: @@ -29379,7 +29968,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerSyncRMRMessage); i { + switch v := v.(*TemplateButtonReplyMessage); i { case 0: return &v.state case 1: @@ -29391,7 +29980,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerMessage); i { + switch v := v.(*StickerSyncRMRMessage); i { case 0: return &v.state case 1: @@ -29403,7 +29992,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[65].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SenderKeyDistributionMessage); i { + switch v := v.(*StickerMessage); i { case 0: return &v.state case 1: @@ -29415,7 +30004,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[66].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SendPaymentMessage); i { + switch v := v.(*SenderKeyDistributionMessage); i { case 0: return &v.state case 1: @@ -29427,7 +30016,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[67].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScheduledCallEditMessage); i { + switch v := v.(*SendPaymentMessage); i { case 0: return &v.state case 1: @@ -29439,7 +30028,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[68].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ScheduledCallCreationMessage); i { + switch v := v.(*ScheduledCallEditMessage); i { case 0: return &v.state case 1: @@ -29451,7 +30040,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[69].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestWelcomeMessageMetadata); i { + switch v := v.(*ScheduledCallCreationMessage); i { case 0: return &v.state case 1: @@ -29463,7 +30052,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[70].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestPhoneNumberMessage); i { + switch v := v.(*RequestWelcomeMessageMetadata); i { case 0: return &v.state case 1: @@ -29475,7 +30064,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[71].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RequestPaymentMessage); i { + switch v := v.(*RequestPhoneNumberMessage); i { case 0: return &v.state case 1: @@ -29487,7 +30076,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[72].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ReactionMessage); i { + switch v := v.(*RequestPaymentMessage); i { case 0: return &v.state case 1: @@ -29499,7 +30088,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[73].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProtocolMessage); i { + switch v := v.(*ReactionMessage); i { case 0: return &v.state case 1: @@ -29511,7 +30100,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[74].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductMessage); i { + switch v := v.(*ProtocolMessage); i { case 0: return &v.state case 1: @@ -29523,7 +30112,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[75].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollVoteMessage); i { + switch v := v.(*ProductMessage); i { case 0: return &v.state case 1: @@ -29535,7 +30124,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[76].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollUpdateMessage); i { + switch v := v.(*PollVoteMessage); i { case 0: return &v.state case 1: @@ -29547,7 +30136,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[77].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollUpdateMessageMetadata); i { + switch v := v.(*PollUpdateMessage); i { case 0: return &v.state case 1: @@ -29559,7 +30148,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[78].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollEncValue); i { + switch v := v.(*PollUpdateMessageMetadata); i { case 0: return &v.state case 1: @@ -29571,7 +30160,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[79].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollCreationMessage); i { + switch v := v.(*PollEncValue); i { case 0: return &v.state case 1: @@ -29583,7 +30172,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[80].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PinInChatMessage); i { + switch v := v.(*PollCreationMessage); i { case 0: return &v.state case 1: @@ -29595,7 +30184,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[81].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage); i { + switch v := v.(*PinInChatMessage); i { case 0: return &v.state case 1: @@ -29607,7 +30196,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[82].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage); i { + switch v := v.(*PeerDataOperationRequestResponseMessage); i { case 0: return &v.state case 1: @@ -29619,7 +30208,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[83].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentInviteMessage); i { + switch v := v.(*PeerDataOperationRequestMessage); i { case 0: return &v.state case 1: @@ -29631,7 +30220,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[84].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OrderMessage); i { + switch v := v.(*PaymentInviteMessage); i { case 0: return &v.state case 1: @@ -29643,7 +30232,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[85].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NewsletterAdminInviteMessage); i { + switch v := v.(*OrderMessage); i { case 0: return &v.state case 1: @@ -29655,7 +30244,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[86].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageHistoryBundle); i { + switch v := v.(*NewsletterAdminInviteMessage); i { case 0: return &v.state case 1: @@ -29667,7 +30256,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[87].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocationMessage); i { + switch v := v.(*MessageHistoryBundle); i { case 0: return &v.state case 1: @@ -29679,7 +30268,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[88].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LiveLocationMessage); i { + switch v := v.(*LocationMessage); i { case 0: return &v.state case 1: @@ -29691,7 +30280,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[89].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponseMessage); i { + switch v := v.(*LiveLocationMessage); i { case 0: return &v.state case 1: @@ -29703,7 +30292,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[90].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage); i { + switch v := v.(*ListResponseMessage); i { case 0: return &v.state case 1: @@ -29715,7 +30304,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[91].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeepInChatMessage); i { + switch v := v.(*ListMessage); i { case 0: return &v.state case 1: @@ -29727,7 +30316,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[92].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InvoiceMessage); i { + switch v := v.(*KeepInChatMessage); i { case 0: return &v.state case 1: @@ -29739,7 +30328,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[93].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveResponseMessage); i { + switch v := v.(*InvoiceMessage); i { case 0: return &v.state case 1: @@ -29751,7 +30340,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[94].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EphemeralSetting); i { + switch v := v.(*InteractiveResponseMessage); i { case 0: return &v.state case 1: @@ -29763,7 +30352,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[95].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WallpaperSettings); i { + switch v := v.(*EphemeralSetting); i { case 0: return &v.state case 1: @@ -29775,7 +30364,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[96].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerMetadata); i { + switch v := v.(*WallpaperSettings); i { case 0: return &v.state case 1: @@ -29787,7 +30376,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[97].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Pushname); i { + switch v := v.(*StickerMetadata); i { case 0: return &v.state case 1: @@ -29799,7 +30388,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[98].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PastParticipants); i { + switch v := v.(*Pushname); i { case 0: return &v.state case 1: @@ -29811,7 +30400,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[99].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PastParticipant); i { + switch v := v.(*PhoneNumberToLIDMapping); i { case 0: return &v.state case 1: @@ -29823,7 +30412,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[100].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotificationSettings); i { + switch v := v.(*PastParticipants); i { case 0: return &v.state case 1: @@ -29835,7 +30424,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[101].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistorySync); i { + switch v := v.(*PastParticipant); i { case 0: return &v.state case 1: @@ -29847,7 +30436,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[102].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HistorySyncMsg); i { + switch v := v.(*NotificationSettings); i { case 0: return &v.state case 1: @@ -29859,7 +30448,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[103].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GroupParticipant); i { + switch v := v.(*HistorySync); i { case 0: return &v.state case 1: @@ -29871,7 +30460,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[104].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GlobalSettings); i { + switch v := v.(*HistorySyncMsg); i { case 0: return &v.state case 1: @@ -29883,7 +30472,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[105].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Conversation); i { + switch v := v.(*GroupParticipant); i { case 0: return &v.state case 1: @@ -29895,7 +30484,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[106].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AvatarUserSettings); i { + switch v := v.(*GlobalSettings); i { case 0: return &v.state case 1: @@ -29907,7 +30496,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[107].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AutoDownloadSettings); i { + switch v := v.(*Conversation); i { case 0: return &v.state case 1: @@ -29919,7 +30508,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[108].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerErrorReceipt); i { + switch v := v.(*AvatarUserSettings); i { case 0: return &v.state case 1: @@ -29931,7 +30520,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[109].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaRetryNotification); i { + switch v := v.(*AutoDownloadSettings); i { case 0: return &v.state case 1: @@ -29943,7 +30532,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[110].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageKey); i { + switch v := v.(*ServerErrorReceipt); i { case 0: return &v.state case 1: @@ -29955,7 +30544,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[111].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdVersion); i { + switch v := v.(*MediaRetryNotification); i { case 0: return &v.state case 1: @@ -29967,7 +30556,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[112].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdValue); i { + switch v := v.(*MessageKey); i { case 0: return &v.state case 1: @@ -29979,7 +30568,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[113].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdSnapshot); i { + switch v := v.(*SyncdVersion); i { case 0: return &v.state case 1: @@ -29991,7 +30580,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[114].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdRecord); i { + switch v := v.(*SyncdValue); i { case 0: return &v.state case 1: @@ -30003,7 +30592,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[115].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdPatch); i { + switch v := v.(*SyncdSnapshot); i { case 0: return &v.state case 1: @@ -30015,7 +30604,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[116].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdMutations); i { + switch v := v.(*SyncdRecord); i { case 0: return &v.state case 1: @@ -30027,7 +30616,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[117].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdMutation); i { + switch v := v.(*SyncdPatch); i { case 0: return &v.state case 1: @@ -30039,7 +30628,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[118].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncdIndex); i { + switch v := v.(*SyncdMutations); i { case 0: return &v.state case 1: @@ -30051,7 +30640,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[119].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyId); i { + switch v := v.(*SyncdMutation); i { case 0: return &v.state case 1: @@ -30063,7 +30652,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[120].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalBlobReference); i { + switch v := v.(*SyncdIndex); i { case 0: return &v.state case 1: @@ -30075,7 +30664,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[121].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExitCode); i { + switch v := v.(*KeyId); i { case 0: return &v.state case 1: @@ -30087,7 +30676,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[122].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionValue); i { + switch v := v.(*ExternalBlobReference); i { case 0: return &v.state case 1: @@ -30099,7 +30688,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[123].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserStatusMuteAction); i { + switch v := v.(*ExitCode); i { case 0: return &v.state case 1: @@ -30111,7 +30700,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[124].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UnarchiveChatsSetting); i { + switch v := v.(*SyncActionValue); i { case 0: return &v.state case 1: @@ -30123,7 +30712,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[125].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TimeFormatAction); i { + switch v := v.(*UserStatusMuteAction); i { case 0: return &v.state case 1: @@ -30135,7 +30724,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[126].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionMessage); i { + switch v := v.(*UnarchiveChatsSetting); i { case 0: return &v.state case 1: @@ -30147,7 +30736,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[127].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionMessageRange); i { + switch v := v.(*TimeFormatAction); i { case 0: return &v.state case 1: @@ -30159,7 +30748,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[128].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubscriptionAction); i { + switch v := v.(*SyncActionMessage); i { case 0: return &v.state case 1: @@ -30171,7 +30760,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[129].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StickerAction); i { + switch v := v.(*SyncActionMessageRange); i { case 0: return &v.state case 1: @@ -30183,7 +30772,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[130].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusPrivacyAction); i { + switch v := v.(*SubscriptionAction); i { case 0: return &v.state case 1: @@ -30195,7 +30784,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[131].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StarAction); i { + switch v := v.(*StickerAction); i { case 0: return &v.state case 1: @@ -30207,7 +30796,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[132].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SecurityNotificationSetting); i { + switch v := v.(*StatusPrivacyAction); i { case 0: return &v.state case 1: @@ -30219,7 +30808,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[133].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveRecentStickerAction); i { + switch v := v.(*StarAction); i { case 0: return &v.state case 1: @@ -30231,7 +30820,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[134].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentEmojiWeightsAction); i { + switch v := v.(*SecurityNotificationSetting); i { case 0: return &v.state case 1: @@ -30243,7 +30832,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[135].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QuickReplyAction); i { + switch v := v.(*RemoveRecentStickerAction); i { case 0: return &v.state case 1: @@ -30255,7 +30844,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[136].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PushNameSetting); i { + switch v := v.(*RecentEmojiWeightsAction); i { case 0: return &v.state case 1: @@ -30267,7 +30856,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[137].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrivacySettingRelayAllCalls); i { + switch v := v.(*QuickReplyAction); i { case 0: return &v.state case 1: @@ -30279,7 +30868,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[138].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryVersionAction); i { + switch v := v.(*PushNameSetting); i { case 0: return &v.state case 1: @@ -30291,7 +30880,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[139].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PrimaryFeature); i { + switch v := v.(*PrivacySettingRelayAllCalls); i { case 0: return &v.state case 1: @@ -30303,7 +30892,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[140].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PnForLidChatAction); i { + switch v := v.(*PrimaryVersionAction); i { case 0: return &v.state case 1: @@ -30315,7 +30904,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[141].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PinAction); i { + switch v := v.(*PrimaryFeature); i { case 0: return &v.state case 1: @@ -30327,7 +30916,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[142].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NuxAction); i { + switch v := v.(*PnForLidChatAction); i { case 0: return &v.state case 1: @@ -30339,7 +30928,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[143].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MuteAction); i { + switch v := v.(*PinAction); i { case 0: return &v.state case 1: @@ -30351,7 +30940,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[144].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketingMessageBroadcastAction); i { + switch v := v.(*PaymentInfoAction); i { case 0: return &v.state case 1: @@ -30363,7 +30952,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[145].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarketingMessageAction); i { + switch v := v.(*NuxAction); i { case 0: return &v.state case 1: @@ -30375,7 +30964,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[146].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MarkChatAsReadAction); i { + switch v := v.(*MuteAction); i { case 0: return &v.state case 1: @@ -30387,7 +30976,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[147].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocaleSetting); i { + switch v := v.(*MarketingMessageBroadcastAction); i { case 0: return &v.state case 1: @@ -30399,7 +30988,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[148].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelReorderingAction); i { + switch v := v.(*MarketingMessageAction); i { case 0: return &v.state case 1: @@ -30411,7 +31000,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[149].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelEditAction); i { + switch v := v.(*MarkChatAsReadAction); i { case 0: return &v.state case 1: @@ -30423,7 +31012,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[150].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LabelAssociationAction); i { + switch v := v.(*LocaleSetting); i { case 0: return &v.state case 1: @@ -30435,7 +31024,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[151].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeyExpiration); i { + switch v := v.(*LabelReorderingAction); i { case 0: return &v.state case 1: @@ -30447,7 +31036,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[152].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExternalWebBetaAction); i { + switch v := v.(*LabelEditAction); i { case 0: return &v.state case 1: @@ -30459,7 +31048,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[153].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteMessageForMeAction); i { + switch v := v.(*LabelAssociationAction); i { case 0: return &v.state case 1: @@ -30471,7 +31060,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[154].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteIndividualCallLogAction); i { + switch v := v.(*KeyExpiration); i { case 0: return &v.state case 1: @@ -30483,7 +31072,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[155].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteChatAction); i { + switch v := v.(*ExternalWebBetaAction); i { case 0: return &v.state case 1: @@ -30495,7 +31084,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[156].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContactAction); i { + switch v := v.(*DeleteMessageForMeAction); i { case 0: return &v.state case 1: @@ -30507,7 +31096,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[157].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClearChatAction); i { + switch v := v.(*DeleteIndividualCallLogAction); i { case 0: return &v.state case 1: @@ -30519,7 +31108,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[158].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChatAssignmentOpenedStatusAction); i { + switch v := v.(*DeleteChatAction); i { case 0: return &v.state case 1: @@ -30531,7 +31120,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[159].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ChatAssignmentAction); i { + switch v := v.(*ContactAction); i { case 0: return &v.state case 1: @@ -30543,7 +31132,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[160].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallLogAction); i { + switch v := v.(*ClearChatAction); i { case 0: return &v.state case 1: @@ -30555,7 +31144,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[161].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BotWelcomeRequestAction); i { + switch v := v.(*ChatAssignmentOpenedStatusAction); i { case 0: return &v.state case 1: @@ -30567,7 +31156,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[162].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ArchiveChatAction); i { + switch v := v.(*ChatAssignmentAction); i { case 0: return &v.state case 1: @@ -30579,7 +31168,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[163].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AndroidUnsupportedActions); i { + switch v := v.(*CallLogAction); i { case 0: return &v.state case 1: @@ -30591,7 +31180,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[164].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AgentAction); i { + switch v := v.(*BotWelcomeRequestAction); i { case 0: return &v.state case 1: @@ -30603,7 +31192,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[165].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SyncActionData); i { + switch v := v.(*ArchiveChatAction); i { case 0: return &v.state case 1: @@ -30615,7 +31204,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[166].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RecentEmojiWeight); i { + switch v := v.(*AndroidUnsupportedActions); i { case 0: return &v.state case 1: @@ -30627,7 +31216,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[167].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PatchDebugData); i { + switch v := v.(*AgentAction); i { case 0: return &v.state case 1: @@ -30639,7 +31228,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[168].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallLogRecord); i { + switch v := v.(*SyncActionData); i { case 0: return &v.state case 1: @@ -30651,7 +31240,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[169].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifiedNameCertificate); i { + switch v := v.(*RecentEmojiWeight); i { case 0: return &v.state case 1: @@ -30663,7 +31252,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[170].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*LocalizedName); i { + switch v := v.(*PatchDebugData); i { case 0: return &v.state case 1: @@ -30675,7 +31264,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[171].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizIdentityInfo); i { + switch v := v.(*CallLogRecord); i { case 0: return &v.state case 1: @@ -30687,7 +31276,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[172].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizAccountPayload); i { + switch v := v.(*VerifiedNameCertificate); i { case 0: return &v.state case 1: @@ -30699,7 +31288,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[173].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BizAccountLinkInfo); i { + switch v := v.(*LocalizedName); i { case 0: return &v.state case 1: @@ -30711,7 +31300,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[174].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeMessage); i { + switch v := v.(*BizIdentityInfo); i { case 0: return &v.state case 1: @@ -30723,7 +31312,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[175].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeServerHello); i { + switch v := v.(*BizAccountPayload); i { case 0: return &v.state case 1: @@ -30735,7 +31324,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[176].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeClientHello); i { + switch v := v.(*BizAccountLinkInfo); i { case 0: return &v.state case 1: @@ -30747,7 +31336,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[177].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HandshakeClientFinish); i { + switch v := v.(*HandshakeMessage); i { case 0: return &v.state case 1: @@ -30759,7 +31348,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[178].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload); i { + switch v := v.(*HandshakeServerHello); i { case 0: return &v.state case 1: @@ -30771,7 +31360,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[179].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebNotificationsInfo); i { + switch v := v.(*HandshakeClientHello); i { case 0: return &v.state case 1: @@ -30783,7 +31372,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[180].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebMessageInfo); i { + switch v := v.(*HandshakeClientFinish); i { case 0: return &v.state case 1: @@ -30795,7 +31384,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[181].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebFeatures); i { + switch v := v.(*ClientPayload); i { case 0: return &v.state case 1: @@ -30807,7 +31396,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[182].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserReceipt); i { + switch v := v.(*WebNotificationsInfo); i { case 0: return &v.state case 1: @@ -30819,7 +31408,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[183].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*StatusPSA); i { + switch v := v.(*WebMessageInfo); i { case 0: return &v.state case 1: @@ -30831,7 +31420,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[184].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Reaction); i { + switch v := v.(*WebFeatures); i { case 0: return &v.state case 1: @@ -30843,7 +31432,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[185].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PremiumMessageInfo); i { + switch v := v.(*UserReceipt); i { case 0: return &v.state case 1: @@ -30855,7 +31444,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[186].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollUpdate); i { + switch v := v.(*StatusPSA); i { case 0: return &v.state case 1: @@ -30867,7 +31456,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[187].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollAdditionalMetadata); i { + switch v := v.(*ReportingTokenInfo); i { case 0: return &v.state case 1: @@ -30879,7 +31468,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[188].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PinInChat); i { + switch v := v.(*Reaction); i { case 0: return &v.state case 1: @@ -30891,7 +31480,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[189].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PhotoChange); i { + switch v := v.(*PremiumMessageInfo); i { case 0: return &v.state case 1: @@ -30903,7 +31492,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[190].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentInfo); i { + switch v := v.(*PollUpdate); i { case 0: return &v.state case 1: @@ -30915,7 +31504,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[191].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NotificationMessageInfo); i { + switch v := v.(*PollAdditionalMetadata); i { case 0: return &v.state case 1: @@ -30927,7 +31516,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[192].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageAddOnContextInfo); i { + switch v := v.(*PinInChat); i { case 0: return &v.state case 1: @@ -30939,7 +31528,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[193].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MediaData); i { + switch v := v.(*PhotoChange); i { case 0: return &v.state case 1: @@ -30951,7 +31540,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[194].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*KeepInChat); i { + switch v := v.(*PaymentInfo); i { case 0: return &v.state case 1: @@ -30963,7 +31552,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[195].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommentMetadata); i { + switch v := v.(*NotificationMessageInfo); i { case 0: return &v.state case 1: @@ -30975,7 +31564,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[196].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoiseCertificate); i { + switch v := v.(*MessageAddOnContextInfo); i { case 0: return &v.state case 1: @@ -30987,7 +31576,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[197].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CertChain); i { + switch v := v.(*MediaData); i { case 0: return &v.state case 1: @@ -30999,7 +31588,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[198].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QP); i { + switch v := v.(*KeepInChat); i { case 0: return &v.state case 1: @@ -31011,7 +31600,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[199].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceProps_HistorySyncConfig); i { + switch v := v.(*EventResponse); i { case 0: return &v.state case 1: @@ -31023,7 +31612,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[200].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeviceProps_AppVersion); i { + switch v := v.(*CommentMetadata); i { case 0: return &v.state case 1: @@ -31035,7 +31624,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[201].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_ShopMessage); i { + switch v := v.(*NoiseCertificate); i { case 0: return &v.state case 1: @@ -31047,7 +31636,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[202].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_NativeFlowMessage); i { + switch v := v.(*CertChain); i { case 0: return &v.state case 1: @@ -31059,7 +31648,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[203].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_Header); i { + switch v := v.(*QP); i { case 0: return &v.state case 1: @@ -31071,7 +31660,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[204].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_Footer); i { + switch v := v.(*DeviceProps_HistorySyncConfig); i { case 0: return &v.state case 1: @@ -31083,7 +31672,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[205].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_CollectionMessage); i { + switch v := v.(*DeviceProps_AppVersion); i { case 0: return &v.state case 1: @@ -31095,7 +31684,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[206].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_CarouselMessage); i { + switch v := v.(*InteractiveMessage_ShopMessage); i { case 0: return &v.state case 1: @@ -31107,7 +31696,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[207].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_Body); i { + switch v := v.(*InteractiveMessage_NativeFlowMessage); i { case 0: return &v.state case 1: @@ -31119,7 +31708,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[208].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveMessage_NativeFlowMessage_NativeFlowButton); i { + switch v := v.(*InteractiveMessage_Header); i { case 0: return &v.state case 1: @@ -31131,7 +31720,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[209].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter); i { + switch v := v.(*InteractiveMessage_Footer); i { case 0: return &v.state case 1: @@ -31143,7 +31732,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[210].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime); i { + switch v := v.(*InteractiveMessage_CollectionMessage); i { case 0: return &v.state case 1: @@ -31155,7 +31744,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[211].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency); i { + switch v := v.(*InteractiveMessage_CarouselMessage); i { case 0: return &v.state case 1: @@ -31167,7 +31756,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[212].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch); i { + switch v := v.(*InteractiveMessage_Body); i { case 0: return &v.state case 1: @@ -31179,7 +31768,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[213].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent); i { + switch v := v.(*InteractiveMessage_NativeFlowMessage_NativeFlowButton); i { case 0: return &v.state case 1: @@ -31191,7 +31780,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[214].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallLogMessage_CallParticipant); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter); i { case 0: return &v.state case 1: @@ -31203,7 +31792,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[215].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ButtonsMessage_Button); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime); i { case 0: return &v.state case 1: @@ -31215,7 +31804,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[216].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ButtonsMessage_Button_NativeFlowInfo); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMCurrency); i { case 0: return &v.state case 1: @@ -31227,7 +31816,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[217].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ButtonsMessage_Button_ButtonText); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeUnixEpoch); i { case 0: return &v.state case 1: @@ -31239,7 +31828,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[218].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HydratedTemplateButton_HydratedURLButton); i { + switch v := v.(*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_HSMDateTimeComponent); i { case 0: return &v.state case 1: @@ -31251,7 +31840,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[219].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HydratedTemplateButton_HydratedQuickReplyButton); i { + switch v := v.(*CallLogMessage_CallParticipant); i { case 0: return &v.state case 1: @@ -31263,7 +31852,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[220].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*HydratedTemplateButton_HydratedCallButton); i { + switch v := v.(*ButtonsMessage_Button); i { case 0: return &v.state case 1: @@ -31275,7 +31864,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[221].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_UTMInfo); i { + switch v := v.(*ButtonsMessage_Button_NativeFlowInfo); i { case 0: return &v.state case 1: @@ -31287,7 +31876,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[222].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_ExternalAdReplyInfo); i { + switch v := v.(*ButtonsMessage_Button_ButtonText); i { case 0: return &v.state case 1: @@ -31299,7 +31888,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[223].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_DataSharingContext); i { + switch v := v.(*HydratedTemplateButton_HydratedURLButton); i { case 0: return &v.state case 1: @@ -31311,7 +31900,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[224].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_BusinessMessageForwardInfo); i { + switch v := v.(*HydratedTemplateButton_HydratedQuickReplyButton); i { case 0: return &v.state case 1: @@ -31323,7 +31912,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[225].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContextInfo_AdReplyInfo); i { + switch v := v.(*HydratedTemplateButton_HydratedCallButton); i { case 0: return &v.state case 1: @@ -31335,7 +31924,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[226].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton_URLButton); i { + switch v := v.(*ContextInfo_UTMInfo); i { case 0: return &v.state case 1: @@ -31347,7 +31936,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[227].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton_QuickReplyButton); i { + switch v := v.(*ContextInfo_ExternalAdReplyInfo); i { case 0: return &v.state case 1: @@ -31359,7 +31948,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[228].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateButton_CallButton); i { + switch v := v.(*ContextInfo_DataSharingContext); i { case 0: return &v.state case 1: @@ -31371,7 +31960,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[229].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PaymentBackground_MediaData); i { + switch v := v.(*ContextInfo_BusinessMessageForwardInfo); i { case 0: return &v.state case 1: @@ -31383,7 +31972,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[230].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateMessage_HydratedFourRowTemplate); i { + switch v := v.(*ContextInfo_AdReplyInfo); i { case 0: return &v.state case 1: @@ -31395,7 +31984,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[231].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TemplateMessage_FourRowTemplate); i { + switch v := v.(*TemplateButton_URLButton); i { case 0: return &v.state case 1: @@ -31407,7 +31996,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[232].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductMessage_ProductSnapshot); i { + switch v := v.(*TemplateButton_QuickReplyButton); i { case 0: return &v.state case 1: @@ -31419,7 +32008,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[233].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ProductMessage_CatalogSnapshot); i { + switch v := v.(*TemplateButton_CallButton); i { case 0: return &v.state case 1: @@ -31431,7 +32020,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[234].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PollCreationMessage_Option); i { + switch v := v.(*PaymentBackground_MediaData); i { case 0: return &v.state case 1: @@ -31443,7 +32032,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[235].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult); i { + switch v := v.(*TemplateMessage_HydratedFourRowTemplate); i { case 0: return &v.state case 1: @@ -31455,7 +32044,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[236].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse); i { + switch v := v.(*TemplateMessage_FourRowTemplate); i { case 0: return &v.state case 1: @@ -31467,7 +32056,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[237].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse); i { + switch v := v.(*ProductMessage_ProductSnapshot); i { case 0: return &v.state case 1: @@ -31479,7 +32068,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[238].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail); i { + switch v := v.(*ProductMessage_CatalogSnapshot); i { case 0: return &v.state case 1: @@ -31491,7 +32080,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[239].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_RequestUrlPreview); i { + switch v := v.(*PollCreationMessage_Option); i { case 0: return &v.state case 1: @@ -31503,7 +32092,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[240].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_RequestStickerReupload); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult); i { case 0: return &v.state case 1: @@ -31515,7 +32104,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[241].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_PlaceholderMessageResendResponse); i { case 0: return &v.state case 1: @@ -31527,7 +32116,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[242].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse); i { case 0: return &v.state case 1: @@ -31539,7 +32128,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[243].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListResponseMessage_SingleSelectReply); i { + switch v := v.(*PeerDataOperationRequestResponseMessage_PeerDataOperationResult_LinkPreviewResponse_LinkPreviewHighQualityThumbnail); i { case 0: return &v.state case 1: @@ -31551,7 +32140,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[244].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_Section); i { + switch v := v.(*PeerDataOperationRequestMessage_RequestUrlPreview); i { case 0: return &v.state case 1: @@ -31563,7 +32152,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[245].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_Row); i { + switch v := v.(*PeerDataOperationRequestMessage_RequestStickerReupload); i { case 0: return &v.state case 1: @@ -31575,7 +32164,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[246].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_Product); i { + switch v := v.(*PeerDataOperationRequestMessage_PlaceholderMessageResendRequest); i { case 0: return &v.state case 1: @@ -31587,7 +32176,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[247].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_ProductSection); i { + switch v := v.(*PeerDataOperationRequestMessage_HistorySyncOnDemandRequest); i { case 0: return &v.state case 1: @@ -31599,7 +32188,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[248].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_ProductListInfo); i { + switch v := v.(*ListResponseMessage_SingleSelectReply); i { case 0: return &v.state case 1: @@ -31611,7 +32200,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[249].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListMessage_ProductListHeaderImage); i { + switch v := v.(*ListMessage_Section); i { case 0: return &v.state case 1: @@ -31623,7 +32212,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[250].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveResponseMessage_Body); i { + switch v := v.(*ListMessage_Row); i { case 0: return &v.state case 1: @@ -31635,7 +32224,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[251].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*InteractiveResponseMessage_NativeFlowResponseMessage); i { + switch v := v.(*ListMessage_Product); i { case 0: return &v.state case 1: @@ -31647,7 +32236,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[252].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CallLogRecord_ParticipantInfo); i { + switch v := v.(*ListMessage_ProductSection); i { case 0: return &v.state case 1: @@ -31659,7 +32248,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[253].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VerifiedNameCertificate_Details); i { + switch v := v.(*ListMessage_ProductListInfo); i { case 0: return &v.state case 1: @@ -31671,7 +32260,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[254].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_WebInfo); i { + switch v := v.(*ListMessage_ProductListHeaderImage); i { case 0: return &v.state case 1: @@ -31683,7 +32272,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[255].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_UserAgent); i { + switch v := v.(*InteractiveResponseMessage_NativeFlowResponseMessage); i { case 0: return &v.state case 1: @@ -31695,7 +32284,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[256].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_InteropData); i { + switch v := v.(*InteractiveResponseMessage_Body); i { case 0: return &v.state case 1: @@ -31707,7 +32296,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[257].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_DevicePairingRegistrationData); i { + switch v := v.(*CallLogRecord_ParticipantInfo); i { case 0: return &v.state case 1: @@ -31719,7 +32308,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[258].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_DNSSource); i { + switch v := v.(*VerifiedNameCertificate_Details); i { case 0: return &v.state case 1: @@ -31731,7 +32320,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[259].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_WebInfo_WebdPayload); i { + switch v := v.(*ClientPayload_WebInfo); i { case 0: return &v.state case 1: @@ -31743,7 +32332,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[260].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ClientPayload_UserAgent_AppVersion); i { + switch v := v.(*ClientPayload_UserAgent); i { case 0: return &v.state case 1: @@ -31755,7 +32344,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[261].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoiseCertificate_Details); i { + switch v := v.(*ClientPayload_InteropData); i { case 0: return &v.state case 1: @@ -31767,7 +32356,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[262].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CertChain_NoiseCertificate); i { + switch v := v.(*ClientPayload_DevicePairingRegistrationData); i { case 0: return &v.state case 1: @@ -31779,7 +32368,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[263].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CertChain_NoiseCertificate_Details); i { + switch v := v.(*ClientPayload_DNSSource); i { case 0: return &v.state case 1: @@ -31791,7 +32380,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[264].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QP_Filter); i { + switch v := v.(*ClientPayload_WebInfo_WebdPayload); i { case 0: return &v.state case 1: @@ -31803,7 +32392,7 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[265].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*QP_FilterParameters); i { + switch v := v.(*ClientPayload_UserAgent_AppVersion); i { case 0: return &v.state case 1: @@ -31815,6 +32404,66 @@ func file_binary_proto_def_proto_init() { } } file_binary_proto_def_proto_msgTypes[266].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NoiseCertificate_Details); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[267].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertChain_NoiseCertificate); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[268].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CertChain_NoiseCertificate_Details); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[269].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QP_Filter); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[270].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QP_FilterParameters); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_binary_proto_def_proto_msgTypes[271].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*QP_FilterClause); i { case 0: return &v.state @@ -31852,42 +32501,42 @@ func file_binary_proto_def_proto_init() { (*HydratedTemplateButton_UrlButton)(nil), (*HydratedTemplateButton_CallButton)(nil), } - file_binary_proto_def_proto_msgTypes[53].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[54].OneofWrappers = []interface{}{ (*TemplateButton_QuickReplyButton_)(nil), (*TemplateButton_UrlButton)(nil), (*TemplateButton_CallButton_)(nil), } - file_binary_proto_def_proto_msgTypes[61].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[62].OneofWrappers = []interface{}{ (*TemplateMessage_FourRowTemplate_)(nil), (*TemplateMessage_HydratedFourRowTemplate_)(nil), (*TemplateMessage_InteractiveMessageTemplate)(nil), } - file_binary_proto_def_proto_msgTypes[93].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[94].OneofWrappers = []interface{}{ (*InteractiveResponseMessage_NativeFlowResponseMessage_)(nil), } - file_binary_proto_def_proto_msgTypes[203].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[208].OneofWrappers = []interface{}{ (*InteractiveMessage_Header_DocumentMessage)(nil), (*InteractiveMessage_Header_ImageMessage)(nil), (*InteractiveMessage_Header_JpegThumbnail)(nil), (*InteractiveMessage_Header_VideoMessage)(nil), (*InteractiveMessage_Header_LocationMessage)(nil), } - file_binary_proto_def_proto_msgTypes[209].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[214].OneofWrappers = []interface{}{ (*HighlyStructuredMessage_HSMLocalizableParameter_Currency)(nil), (*HighlyStructuredMessage_HSMLocalizableParameter_DateTime)(nil), } - file_binary_proto_def_proto_msgTypes[210].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[215].OneofWrappers = []interface{}{ (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_Component)(nil), (*HighlyStructuredMessage_HSMLocalizableParameter_HSMDateTime_UnixEpoch)(nil), } - file_binary_proto_def_proto_msgTypes[230].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[235].OneofWrappers = []interface{}{ (*TemplateMessage_HydratedFourRowTemplate_DocumentMessage)(nil), (*TemplateMessage_HydratedFourRowTemplate_HydratedTitleText)(nil), (*TemplateMessage_HydratedFourRowTemplate_ImageMessage)(nil), (*TemplateMessage_HydratedFourRowTemplate_VideoMessage)(nil), (*TemplateMessage_HydratedFourRowTemplate_LocationMessage)(nil), } - file_binary_proto_def_proto_msgTypes[231].OneofWrappers = []interface{}{ + file_binary_proto_def_proto_msgTypes[236].OneofWrappers = []interface{}{ (*TemplateMessage_FourRowTemplate_DocumentMessage)(nil), (*TemplateMessage_FourRowTemplate_HighlyStructuredMessage)(nil), (*TemplateMessage_FourRowTemplate_ImageMessage)(nil), @@ -31899,8 +32548,8 @@ func file_binary_proto_def_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_binary_proto_def_proto_rawDesc, - NumEnums: 81, - NumMessages: 267, + NumEnums: 83, + NumMessages: 272, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw b/vendor/go.mau.fi/whatsmeow/binary/proto/def.pb.raw index 12ab16ace71bda0295cb54eb0f026fb4c6d27c93..0ca7ef6fa61f743d8e97e3116155dae809f8d913 100644 GIT binary patch delta 2039 zcmZ`)-*4Mg6vlSaCO27{-lmP)jjGGmZJJ6piWn{Imz$)k*EWr=)0JPMa^l<6YGQk~ zQx+r^X>TANKo)2dVgm68bd?bmydWW@O#(E;14!%v326+}K1>1$?E%EKleYP>zTNwM z=Y040-0xgJ{Mh^Fn)lZIF8?<^5adf@0b8Pe%03*v&2+=FARsD=YKo?;Dh4}f`MVDV z8zFnM=i!L=EgJOl)+a{9`uqI&bEiO`v80Cdb}l3X?wreGHc)Ygj$4kg1h+z0$Ke0tj1R+C{S_68W3P)(s+ zC}6|HQbt!xnmLP2Q4&oN9tUBgnKD>vh#_UP;qWBrF>n#*cT{*q!dF^wb3q%`B@5PM1qLtY_63J~=CD znyeIH1b8*&qAZa%Ik#2Yz&_AXlqCmt+Tlm_ot^w_jHciB*;haRi+&Zp3|Os6R+j3r z2HQot9vB_0_h66H(VqGCHVnPs8T{Yly3OPRZzUNz^NxB*hpZz^~ z`>8)pF!Vi-_1dOP1+6=q!-GK-%Bw|ZG)TYFVhO_+!BO&<80Mr})-A9#+`JvEIuC$? zU!O6TMPpeg=S*G9n{0=BMePJU0Q`z;MN%i*>3-TS0AnCnV-YT?tC;n<0Zo|G&05Ud zD%SO?EMeCWq@4{gL5T%I1}1~8XNsb^r0OLW5V_EKHw2%CphxVktdJOOwFZJ=}3D zB6VY@8cEa=3wZ!_tPwvFgJ#tgtT+S0o+V!t811hsptbG(HAkd$o>{c0W=qxU(8WP1weVXQ))L?*Rq&H8l)Q zgDAER9__LIdG|@Wwq&Mp#X2+`^TIh0aY-M`xEUj8bSz5s(W~z^ Ke&wn6I{pWfdz1YD delta 330 zcmaF4p7p~5)(ubjIa@fmcsz3x(^DrGl$dQ+5jf7gSzF|T4%0=($+C_Co0mEo39-yz z>a*-b9jV+4C9*386|bho7F1xttTJY+`}T3$t5{i zZnNa%!p(l0eYSWoZN9tBoQY{C`)0A7pP44-iuG;&yyvDM(;KGE=g#FYZce#i!Nl0H zdF~}np3U#>$*^xWe0GpYPn%2BCow5CCnz<)C?&NhGcVmSxg;|`Pe_Q1B_**WQG!u{ zS%WnQ%vP$LZ2Gct^SPJ%85t8N_rFfutn)^nndt}PrIwaiR9q5LoK0~sf<0RTlnegFUf diff --git a/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto b/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto index 001f3c1f..7d51e919 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto +++ b/vendor/go.mau.fi/whatsmeow/binary/proto/def.proto @@ -191,6 +191,7 @@ message ImageMessage { optional bytes thumbnailSha256 = 27; optional bytes thumbnailEncSha256 = 28; optional string staticUrl = 29; + repeated InteractiveAnnotation annotations = 30; } message HistorySyncNotification { @@ -645,6 +646,7 @@ enum KeepType { } message InteractiveAnnotation { repeated Point polygonVertices = 1; + optional bool shouldSkipConfirmation = 4; oneof action { Location location = 2; ForwardedNewsletterMessageInfo newsletter = 3; @@ -800,9 +802,21 @@ message ContextInfo { } message ForwardedNewsletterMessageInfo { + enum ContentType { + UPDATE = 1; + UPDATE_CARD = 2; + LINK_CARD = 3; + } optional string newsletterJid = 1; optional int32 serverMessageId = 2; optional string newsletterName = 3; + optional ContentType contentType = 4; + optional string accessibilityText = 5; +} + +message BotSuggestedPromptMetadata { + repeated string suggestedPrompts = 1; + optional uint32 selectedPromptIndex = 2; } message BotPluginMetadata { @@ -826,6 +840,7 @@ message BotMetadata { optional BotAvatarMetadata avatarMetadata = 1; optional string personaId = 2; optional BotPluginMetadata pluginMetadata = 3; + optional BotSuggestedPromptMetadata suggestedPromptMetadata = 4; } message BotAvatarMetadata { @@ -1018,6 +1033,7 @@ message VideoMessage { optional bytes thumbnailSha256 = 22; optional bytes thumbnailEncSha256 = 23; optional string staticUrl = 24; + repeated InteractiveAnnotation annotations = 25; } message TemplateMessage { @@ -1506,6 +1522,12 @@ message InvoiceMessage { } message InteractiveResponseMessage { + message NativeFlowResponseMessage { + optional string name = 1; + optional string paramsJson = 2; + optional int32 version = 3; + } + message Body { enum Format { DEFAULT = 0; @@ -1515,12 +1537,6 @@ message InteractiveResponseMessage { optional Format format = 2; } - message NativeFlowResponseMessage { - optional string name = 1; - optional string paramsJson = 2; - optional int32 version = 3; - } - optional Body body = 1; optional ContextInfo contextInfo = 15; oneof interactiveResponseMessage { @@ -1557,6 +1573,11 @@ message Pushname { optional string pushname = 2; } +message PhoneNumberToLIDMapping { + optional string pnJid = 1; + optional string lidJid = 2; +} + message PastParticipants { optional string groupJid = 1; repeated PastParticipant pastParticipants = 2; @@ -1613,6 +1634,7 @@ message HistorySync { repeated PastParticipants pastParticipants = 12; repeated CallLogRecord callLogRecords = 13; optional BotAIWaitListState aiWaitListState = 14; + repeated PhoneNumberToLIDMapping phoneNumberToLidMappings = 15; } message HistorySyncMsg { @@ -1777,6 +1799,7 @@ message SyncdPatch { optional KeyId keyId = 6; optional ExitCode exitCode = 7; optional uint32 deviceIndex = 8; + optional bytes clientDebugData = 9; } message SyncdMutations { @@ -1856,6 +1879,7 @@ message SyncActionValue { optional BotWelcomeRequestAction botWelcomeRequestAction = 45; optional DeleteIndividualCallLogAction deleteIndividualCallLog = 46; optional LabelReorderingAction labelReorderingAction = 47; + optional PaymentInfoAction paymentInfoAction = 48; } message UserStatusMuteAction { @@ -1958,6 +1982,10 @@ message PinAction { optional bool pinned = 1; } +message PaymentInfoAction { + optional string cpi = 1; +} + message NuxAction { optional bool acknowledged = 1; } @@ -1995,7 +2023,7 @@ message LocaleSetting { } message LabelReorderingAction { - repeated int32 data = 1; + repeated int32 sortedLabelIds = 1; } message LabelEditAction { @@ -2003,6 +2031,7 @@ message LabelEditAction { optional int32 color = 2; optional int32 predefinedId = 3; optional bool deleted = 4; + optional int32 orderIndex = 5; } message LabelAssociationAction { @@ -2035,6 +2064,7 @@ message ContactAction { optional string fullName = 1; optional string firstName = 2; optional string lidJid = 3; + optional bool saveOnPrimaryAddressbook = 4; } message ClearChatAction { @@ -2085,11 +2115,26 @@ message RecentEmojiWeight { } message PatchDebugData { + enum Platform { + ANDROID = 0; + SMBA = 1; + IPHONE = 2; + SMBI = 3; + WEB = 4; + UWP = 5; + DARWIN = 6; + } optional bytes currentLthash = 1; optional bytes newLthash = 2; - optional uint64 patchVersion = 3; - optional string collectionName = 4; - optional bytes firstTwoBytesFromAHashOfSnapshotMacKey = 5; + optional bytes patchVersion = 3; + optional bytes collectionName = 4; + optional bytes firstFourBytesFromAHashOfSnapshotMacKey = 5; + optional bytes newLthashSubtract = 6; + optional int32 numberAdd = 7; + optional int32 numberRemove = 8; + optional int32 numberOverride = 9; + optional Platform senderPlatform = 10; + optional bool isSenderPrimary = 11; } message CallLogRecord { @@ -2633,6 +2678,8 @@ message WebMessageInfo { SUPPORT_AI_EDUCATION = 196; BIZ_BOT_3P_MESSAGING_ENABLED = 197; REMINDER_SETUP_MESSAGE = 198; + REMINDER_SENT_MESSAGE = 199; + REMINDER_CANCEL_MESSAGE = 200; } enum Status { ERROR = 0; @@ -2697,6 +2744,9 @@ message WebMessageInfo { optional bool isGroupHistoryMessage = 57; optional string botMessageInvokerJid = 58; optional CommentMetadata commentMetadata = 59; + repeated EventResponse eventResponses = 61; + optional ReportingTokenInfo reportingTokenInfo = 62; + optional uint64 newsletterServerId = 63; } message WebFeatures { @@ -2767,6 +2817,10 @@ message StatusPSA { optional uint64 campaignExpirationTimestamp = 45; } +message ReportingTokenInfo { + optional bytes reportingTag = 1; +} + message Reaction { optional MessageKey key = 1; optional string text = 2; @@ -2902,6 +2956,13 @@ message KeepInChat { optional int64 serverTimestampMs = 6; } +message EventResponse { + optional MessageKey eventResponseMessageKey = 1; + optional int64 timestampMs = 2; + optional EventResponseMessage eventResponseMessage = 3; + optional bool unread = 4; +} + message CommentMetadata { optional MessageKey commentParentKey = 1; optional uint32 replyCount = 2; diff --git a/vendor/go.mau.fi/whatsmeow/binary/token/token.go b/vendor/go.mau.fi/whatsmeow/binary/token/token.go index c398ab7e..361acd19 100644 --- a/vendor/go.mau.fi/whatsmeow/binary/token/token.go +++ b/vendor/go.mau.fi/whatsmeow/binary/token/token.go @@ -6,18 +6,18 @@ import "fmt" // All the currently known string tokens. var ( - SingleByteTokens = [...]string{"", "xmlstreamstart", "xmlstreamend", "s.whatsapp.net", "type", "participant", "from", "receipt", "id", "broadcast", "status", "message", "notification", "notify", "to", "jid", "user", "class", "offline", "g.us", "result", "mediatype", "enc", "skmsg", "off_cnt", "xmlns", "presence", "participants", "ack", "t", "iq", "device_hash", "read", "value", "media", "picture", "chatstate", "unavailable", "text", "urn:xmpp:whatsapp:push", "devices", "verified_name", "contact", "composing", "edge_routing", "routing_info", "item", "image", "verified_level", "get", "fallback_hostname", "2", "media_conn", "1", "v", "handshake", "fallback_class", "count", "config", "offline_preview", "download_buckets", "w:profile:picture", "set", "creation", "location", "fallback_ip4", "msg", "urn:xmpp:ping", "fallback_ip6", "call-creator", "relaylatency", "success", "subscribe", "video", "business_hours_config", "platform", "hostname", "version", "unknown", "0", "ping", "hash", "edit", "subject", "max_buckets", "download", "delivery", "props", "sticker", "name", "last", "contacts", "business", "primary", "preview", "w:p", "pkmsg", "call-id", "retry", "prop", "call", "auth_ttl", "available", "relay_id", "last_id", "day_of_week", "w", "host", "seen", "bits", "list", "atn", "upload", "is_new", "w:stats", "key", "paused", "specific_hours", "multicast", "stream:error", "mmg.whatsapp.net", "code", "deny", "played", "profile", "fna", "device-list", "close_time", "latency", "gcm", "pop", "audio", "26", "w:web", "open_time", "error", "auth", "ip4", "update", "profile_options", "config_value", "category", "catalog_not_created", "00", "config_code", "mode", "catalog_status", "ip6", "blocklist", "registration", "7", "web", "fail", "w:m", "cart_enabled", "ttl", "gif", "300", "device_orientation", "identity", "query", "401", "media-gig2-1.cdn.whatsapp.net", "in", "3", "te2", "add", "fallback", "categories", "ptt", "encrypt", "notice", "thumbnail-document", "item-not-found", "12", "thumbnail-image", "stage", "thumbnail-link", "usync", "out", "thumbnail-video", "8", "01", "context", "sidelist", "thumbnail-gif", "terminate", "not-authorized", "orientation", "dhash", "capability", "side_list", "md-app-state", "description", "serial", "readreceipts", "te", "business_hours", "md-msg-hist", "tag", "attribute_padding", "document", "open_24h", "delete", "expiration", "active", "prev_v_id", "true", "passive", "index", "4", "conflict", "remove", "w:gp2", "config_expo_key", "screen_height", "replaced", "02", "screen_width", "uploadfieldstat", "2:47DEQpj8", "media-bog1-1.cdn.whatsapp.net", "encopt", "url", "catalog_exists", "keygen", "rate", "offer", "opus", "media-mia3-1.cdn.whatsapp.net", "privacy", "media-mia3-2.cdn.whatsapp.net", "signature", "preaccept", "token_id", "media-eze1-1.cdn.whatsapp.net"} + SingleByteTokens = [...]string{"", "xmlstreamstart", "xmlstreamend", "s.whatsapp.net", "type", "participant", "from", "receipt", "id", "notification", "disappearing_mode", "status", "jid", "broadcast", "user", "devices", "device_hash", "to", "offline", "message", "result", "class", "xmlns", "duration", "notify", "iq", "t", "ack", "g.us", "enc", "urn:xmpp:whatsapp:push", "presence", "config_value", "picture", "verified_name", "config_code", "key-index-list", "contact", "mediatype", "routing_info", "edge_routing", "get", "read", "urn:xmpp:ping", "fallback_hostname", "0", "chatstate", "business_hours_config", "unavailable", "download_buckets", "skmsg", "verified_level", "composing", "handshake", "device-list", "media", "text", "fallback_ip4", "media_conn", "device", "creation", "location", "config", "item", "fallback_ip6", "count", "w:profile:picture", "image", "business", "2", "hostname", "call-creator", "display_name", "relaylatency", "platform", "abprops", "success", "msg", "offline_preview", "prop", "key-index", "v", "day_of_week", "pkmsg", "version", "1", "ping", "w:p", "download", "video", "set", "specific_hours", "props", "primary", "unknown", "hash", "commerce_experience", "last", "subscribe", "max_buckets", "call", "profile", "member_since_text", "close_time", "call-id", "sticker", "mode", "participants", "value", "query", "profile_options", "open_time", "code", "list", "host", "ts", "contacts", "upload", "lid", "preview", "update", "usync", "w:stats", "delivery", "auth_ttl", "context", "fail", "cart_enabled", "appdata", "category", "atn", "direct_connection", "decrypt-fail", "relay_id", "mmg-fallback.whatsapp.net", "target", "available", "name", "last_id", "mmg.whatsapp.net", "categories", "401", "is_new", "index", "tctoken", "ip4", "token_id", "latency", "recipient", "edit", "ip6", "add", "thumbnail-document", "26", "paused", "true", "identity", "stream:error", "key", "sidelist", "background", "audio", "3", "thumbnail-image", "biz-cover-photo", "cat", "gcm", "thumbnail-video", "error", "auth", "deny", "serial", "in", "registration", "thumbnail-link", "remove", "00", "gif", "thumbnail-gif", "tag", "capability", "multicast", "item-not-found", "description", "business_hours", "config_expo_key", "md-app-state", "expiration", "fallback", "ttl", "300", "md-msg-hist", "device_orientation", "out", "w:m", "open_24h", "side_list", "token", "inactive", "01", "document", "te2", "played", "encrypt", "msgr", "hide", "direct_path", "12", "state", "not-authorized", "url", "terminate", "signature", "status-revoke-delay", "02", "te", "linked_accounts", "trusted_contact", "timezone", "ptt", "kyc-id", "privacy_token", "readreceipts", "appointment_only", "address", "expected_ts", "privacy", "7", "android", "interactive", "device-identity", "enabled", "attribute_padding", "1080", "03", "screen_height"} DoubleByteTokens = [...][]string{ - {"media-for1-1.cdn.whatsapp.net", "relay", "media-gru2-2.cdn.whatsapp.net", "uncompressed", "medium", "voip_settings", "device", "reason", "media-lim1-1.cdn.whatsapp.net", "media-qro1-2.cdn.whatsapp.net", "media-gru1-2.cdn.whatsapp.net", "action", "features", "media-gru2-1.cdn.whatsapp.net", "media-gru1-1.cdn.whatsapp.net", "media-otp1-1.cdn.whatsapp.net", "kyc-id", "priority", "phash", "mute", "token", "100", "media-qro1-1.cdn.whatsapp.net", "none", "media-mrs2-2.cdn.whatsapp.net", "sign_credential", "03", "media-mrs2-1.cdn.whatsapp.net", "protocol", "timezone", "transport", "eph_setting", "1080", "original_dimensions", "media-frx5-1.cdn.whatsapp.net", "background", "disable", "original_image_url", "5", "transaction-id", "direct_path", "103", "appointment_only", "request_image_url", "peer_pid", "address", "105", "104", "102", "media-cdt1-1.cdn.whatsapp.net", "101", "109", "110", "106", "background_location", "v_id", "sync", "status-old", "111", "107", "ppic", "media-scl2-1.cdn.whatsapp.net", "business_profile", "108", "invite", "04", "audio_duration", "media-mct1-1.cdn.whatsapp.net", "media-cdg2-1.cdn.whatsapp.net", "media-los2-1.cdn.whatsapp.net", "invis", "net", "voip_payload_type", "status-revoke-delay", "404", "state", "use_correct_order_for_hmac_sha1", "ver", "media-mad1-1.cdn.whatsapp.net", "order", "540", "skey", "blinded_credential", "android", "contact_remove", "enable_downlink_relay_latency_only", "duration", "enable_vid_one_way_codec_nego", "6", "media-sof1-1.cdn.whatsapp.net", "accept", "all", "signed_credential", "media-atl3-1.cdn.whatsapp.net", "media-lhr8-1.cdn.whatsapp.net", "website", "05", "latitude", "media-dfw5-1.cdn.whatsapp.net", "forbidden", "enable_audio_piggyback_network_mtu_fix", "media-dfw5-2.cdn.whatsapp.net", "note.m4r", "media-atl3-2.cdn.whatsapp.net", "jb_nack_discard_count_fix", "longitude", "Opening.m4r", "media-arn2-1.cdn.whatsapp.net", "email", "timestamp", "admin", "media-pmo1-1.cdn.whatsapp.net", "America/Sao_Paulo", "contact_add", "media-sin6-1.cdn.whatsapp.net", "interactive", "8000", "acs_public_key", "sigquit_anr_detector_release_rollover_percent", "media.fmed1-2.fna.whatsapp.net", "groupadd", "enabled_for_video_upgrade", "latency_update_threshold", "media-frt3-2.cdn.whatsapp.net", "calls_row_constraint_layout", "media.fgbb2-1.fna.whatsapp.net", "mms4_media_retry_notification_encryption_enabled", "timeout", "media-sin6-3.cdn.whatsapp.net", "audio_nack_jitter_multiplier", "jb_discard_count_adjust_pct_rc", "audio_reserve_bps", "delta", "account_sync", "default", "media.fjed4-6.fna.whatsapp.net", "06", "lock_video_orientation", "media-frt3-1.cdn.whatsapp.net", "w:g2", "media-sin6-2.cdn.whatsapp.net", "audio_nack_algo_mask", "media.fgbb2-2.fna.whatsapp.net", "media.fmed1-1.fna.whatsapp.net", "cond_range_target_bitrate", "mms4_server_error_receipt_encryption_enabled", "vid_rc_dyn", "fri", "cart_v1_1_order_message_changes_enabled", "reg_push", "jb_hist_deposit_value", "privatestats", "media.fist7-2.fna.whatsapp.net", "thu", "jb_discard_count_adjust_pct", "mon", "group_call_video_maximization_enabled", "mms_cat_v1_forward_hot_override_enabled", "audio_nack_new_rtt", "media.fsub2-3.fna.whatsapp.net", "media_upload_aggressive_retry_exponential_backoff_enabled", "tue", "wed", "media.fruh4-2.fna.whatsapp.net", "audio_nack_max_seq_req", "max_rtp_audio_packet_resends", "jb_hist_max_cdf_value", "07", "audio_nack_max_jb_delay", "mms_forward_partially_downloaded_video", "media-lcy1-1.cdn.whatsapp.net", "resume", "jb_inband_fec_aware", "new_commerce_entry_point_enabled", "480", "payments_upi_generate_qr_amount_limit", "sigquit_anr_detector_rollover_percent", "media.fsdu2-1.fna.whatsapp.net", "fbns", "aud_pkt_reorder_pct", "dec", "stop_probing_before_accept_send", "media_upload_max_aggressive_retries", "edit_business_profile_new_mode_enabled", "media.fhex4-1.fna.whatsapp.net", "media.fjed4-3.fna.whatsapp.net", "sigquit_anr_detector_64bit_rollover_percent", "cond_range_ema_jb_last_delay", "watls_enable_early_data_http_get", "media.fsdu2-2.fna.whatsapp.net", "message_qr_disambiguation_enabled", "media-mxp1-1.cdn.whatsapp.net", "sat", "vertical", "media.fruh4-5.fna.whatsapp.net", "200", "media-sof1-2.cdn.whatsapp.net", "-1", "height", "product_catalog_hide_show_items_enabled", "deep_copy_frm_last", "tsoffline", "vp8/h.264", "media.fgye5-3.fna.whatsapp.net", "media.ftuc1-2.fna.whatsapp.net", "smb_upsell_chat_banner_enabled", "canonical", "08", "9", ".", "media.fgyd4-4.fna.whatsapp.net", "media.fsti4-1.fna.whatsapp.net", "mms_vcache_aggregation_enabled", "mms_hot_content_timespan_in_seconds", "nse_ver", "rte", "third_party_sticker_web_sync", "cond_range_target_total_bitrate", "media_upload_aggressive_retry_enabled", "instrument_spam_report_enabled", "disable_reconnect_tone", "move_media_folder_from_sister_app", "one_tap_calling_in_group_chat_size", "10", "storage_mgmt_banner_threshold_mb", "enable_backup_passive_mode", "sharechat_inline_player_enabled", "media.fcnq2-1.fna.whatsapp.net", "media.fhex4-2.fna.whatsapp.net", "media.fist6-3.fna.whatsapp.net", "ephemeral_drop_column_stage", "reconnecting_after_network_change_threshold_ms", "media-lhr8-2.cdn.whatsapp.net", "cond_jb_last_delay_ema_alpha", "entry_point_block_logging_enabled", "critical_event_upload_log_config", "respect_initial_bitrate_estimate", "smaller_image_thumbs_status_enabled", "media.fbtz1-4.fna.whatsapp.net", "media.fjed4-1.fna.whatsapp.net", "width", "720", "enable_frame_dropper", "enable_one_side_mode", "urn:xmpp:whatsapp:dirty", "new_sticker_animation_behavior_v2", "media.flim3-2.fna.whatsapp.net", "media.fuio6-2.fna.whatsapp.net", "skip_forced_signaling", "dleq_proof", "status_video_max_bitrate", "lazy_send_probing_req", "enhanced_storage_management", "android_privatestats_endpoint_dit_enabled", "media.fscl13-2.fna.whatsapp.net", "video_duration"}, - {"group_call_discoverability_enabled", "media.faep9-2.fna.whatsapp.net", "msgr", "bloks_loggedin_access_app_id", "db_status_migration_step", "watls_prefer_ip6", "jabber:iq:privacy", "68", "media.fsaw1-11.fna.whatsapp.net", "mms4_media_conn_persist_enabled", "animated_stickers_thread_clean_up", "media.fcgk3-2.fna.whatsapp.net", "media.fcgk4-6.fna.whatsapp.net", "media.fgye5-2.fna.whatsapp.net", "media.flpb1-1.fna.whatsapp.net", "media.fsub2-1.fna.whatsapp.net", "media.fuio6-3.fna.whatsapp.net", "not-allowed", "partial_pjpeg_bw_threshold", "cap_estimated_bitrate", "mms_chatd_resume_check_over_thrift", "smb_upsell_business_profile_enabled", "product_catalog_webclient", "groups", "sigquit_anr_detector_release_updated_rollout", "syncd_key_rotation_enabled", "media.fdmm2-1.fna.whatsapp.net", "media-hou1-1.cdn.whatsapp.net", "remove_old_chat_notifications", "smb_biztools_deeplink_enabled", "use_downloadable_filters_int", "group_qr_codes_enabled", "max_receipt_processing_time", "optimistic_image_processing_enabled", "smaller_video_thumbs_status_enabled", "watls_early_data", "reconnecting_before_relay_failover_threshold_ms", "cond_range_packet_loss_pct", "groups_privacy_blacklist", "status-revoke-drop", "stickers_animated_thumbnail_download", "dedupe_transcode_shared_images", "dedupe_transcode_shared_videos", "media.fcnq2-2.fna.whatsapp.net", "media.fgyd4-1.fna.whatsapp.net", "media.fist7-1.fna.whatsapp.net", "media.flim3-3.fna.whatsapp.net", "add_contact_by_qr_enabled", "https://faq.whatsapp.com/payments", "multicast_limit_global", "sticker_notification_preview", "smb_better_catalog_list_adapters_enabled", "bloks_use_minscript_android", "pen_smoothing_enabled", "media.fcgk4-5.fna.whatsapp.net", "media.fevn1-3.fna.whatsapp.net", "media.fpoj7-1.fna.whatsapp.net", "media-arn2-2.cdn.whatsapp.net", "reconnecting_before_network_change_threshold_ms", "android_media_use_fresco_for_gifs", "cond_in_congestion", "status_image_max_edge", "sticker_search_enabled", "starred_stickers_web_sync", "db_blank_me_jid_migration_step", "media.fist6-2.fna.whatsapp.net", "media.ftuc1-1.fna.whatsapp.net", "09", "anr_fast_logs_upload_rollout", "camera_core_integration_enabled", "11", "third_party_sticker_caching", "thread_dump_contact_support", "wam_privatestats_enabled", "vcard_as_document_size_kb", "maxfpp", "fbip", "ephemeral_allow_group_members", "media-bom1-2.cdn.whatsapp.net", "media-xsp1-1.cdn.whatsapp.net", "disable_prewarm", "frequently_forwarded_max", "media.fbtz1-5.fna.whatsapp.net", "media.fevn7-1.fna.whatsapp.net", "media.fgyd4-2.fna.whatsapp.net", "sticker_tray_animation_fully_visible_items", "green_alert_banner_duration", "reconnecting_after_p2p_failover_threshold_ms", "connected", "share_biz_vcard_enabled", "stickers_animation", "0a", "1200", "WhatsApp", "group_description_length", "p_v_id", "payments_upi_intent_transaction_limit", "frequently_forwarded_messages", "media-xsp1-2.cdn.whatsapp.net", "media.faep8-1.fna.whatsapp.net", "media.faep8-2.fna.whatsapp.net", "media.faep9-1.fna.whatsapp.net", "media.fdmm2-2.fna.whatsapp.net", "media.fgzt3-1.fna.whatsapp.net", "media.flim4-2.fna.whatsapp.net", "media.frao1-1.fna.whatsapp.net", "media.fscl9-2.fna.whatsapp.net", "media.fsub2-2.fna.whatsapp.net", "superadmin", "media.fbog10-1.fna.whatsapp.net", "media.fcgh28-1.fna.whatsapp.net", "media.fjdo10-1.fna.whatsapp.net", "third_party_animated_sticker_import", "delay_fec", "attachment_picker_refresh", "android_linked_devices_re_auth_enabled", "rc_dyn", "green_alert_block_jitter", "add_contact_logging_enabled", "biz_message_logging_enabled", "conversation_media_preview_v2", "media-jnb1-1.cdn.whatsapp.net", "ab_key", "media.fcgk4-2.fna.whatsapp.net", "media.fevn1-1.fna.whatsapp.net", "media.fist6-1.fna.whatsapp.net", "media.fruh4-4.fna.whatsapp.net", "media.fsti4-2.fna.whatsapp.net", "mms_vcard_autodownload_size_kb", "watls_enabled", "notif_ch_override_off", "media.fsaw1-14.fna.whatsapp.net", "media.fscl13-1.fna.whatsapp.net", "db_group_participant_migration_step", "1020", "cond_range_sterm_rtt", "invites_logging_enabled", "triggered_block_enabled", "group_call_max_participants", "media-iad3-1.cdn.whatsapp.net", "product_catalog_open_deeplink", "shops_required_tos_version", "image_max_kbytes", "cond_low_quality_vid_mode", "db_receipt_migration_step", "jb_early_prob_hist_shrink", "media.fdmm2-3.fna.whatsapp.net", "media.fdmm2-4.fna.whatsapp.net", "media.fruh4-1.fna.whatsapp.net", "media.fsaw2-2.fna.whatsapp.net", "remove_geolocation_videos", "new_animation_behavior", "fieldstats_beacon_chance", "403", "authkey_reset_on_ban", "continuous_ptt_playback", "reconnecting_after_relay_failover_threshold_ms", "false", "group", "sun", "conversation_swipe_to_reply", "ephemeral_messages_setting", "smaller_video_thumbs_enabled", "md_device_sync_enabled", "bloks_shops_pdp_url_regex", "lasso_integration_enabled", "media-bom1-1.cdn.whatsapp.net", "new_backup_format_enabled", "256", "media.faep6-1.fna.whatsapp.net", "media.fasr1-1.fna.whatsapp.net", "media.fbtz1-7.fna.whatsapp.net", "media.fesb4-1.fna.whatsapp.net", "media.fjdo1-2.fna.whatsapp.net", "media.frba2-1.fna.whatsapp.net", "watls_no_dns", "600", "db_broadcast_me_jid_migration_step", "new_wam_runtime_enabled", "group_update", "enhanced_block_enabled", "sync_wifi_threshold_kb", "mms_download_nc_cat", "bloks_minification_enabled", "ephemeral_messages_enabled", "reject", "voip_outgoing_xml_signaling", "creator", "dl_bw", "payments_request_messages", "target_bitrate", "bloks_rendercore_enabled", "media-hbe1-1.cdn.whatsapp.net", "media-hel3-1.cdn.whatsapp.net", "media-kut2-2.cdn.whatsapp.net", "media-lax3-1.cdn.whatsapp.net", "media-lax3-2.cdn.whatsapp.net", "sticker_pack_deeplink_enabled", "hq_image_bw_threshold", "status_info", "voip", "dedupe_transcode_videos", "grp_uii_cleanup", "linked_device_max_count", "media.flim1-1.fna.whatsapp.net", "media.fsaw2-1.fna.whatsapp.net", "reconnecting_after_call_active_threshold_ms", "1140", "catalog_pdp_new_design", "media.fbtz1-10.fna.whatsapp.net", "media.fsaw1-15.fna.whatsapp.net", "0b", "consumer_rc_provider", "mms_async_fast_forward_ttl", "jb_eff_size_fix", "voip_incoming_xml_signaling", "media_provider_share_by_uuid", "suspicious_links", "dedupe_transcode_images", "green_alert_modal_start", "media-cgk1-1.cdn.whatsapp.net", "media-lga3-1.cdn.whatsapp.net", "template_doc_mime_types", "important_messages", "user_add", "vcard_max_size_kb", "media.fada2-1.fna.whatsapp.net", "media.fbog2-5.fna.whatsapp.net", "media.fbtz1-3.fna.whatsapp.net", "media.fcgk3-1.fna.whatsapp.net", "media.fcgk7-1.fna.whatsapp.net", "media.flim1-3.fna.whatsapp.net", "media.fscl9-1.fna.whatsapp.net", "ctwa_context_enterprise_enabled", "media.fsaw1-13.fna.whatsapp.net", "media.fuio11-2.fna.whatsapp.net", "status_collapse_muted", "db_migration_level_force", "recent_stickers_web_sync", "bloks_session_state", "bloks_shops_enabled", "green_alert_setting_deep_links_enabled", "restrict_groups", "battery", "green_alert_block_start", "refresh", "ctwa_context_enabled", "md_messaging_enabled", "status_image_quality", "md_blocklist_v2_server", "media-del1-1.cdn.whatsapp.net", "13", "userrate", "a_v_id", "cond_rtt_ema_alpha", "invalid"}, - {"media.fada1-1.fna.whatsapp.net", "media.fadb3-2.fna.whatsapp.net", "media.fbhz2-1.fna.whatsapp.net", "media.fcor2-1.fna.whatsapp.net", "media.fjed4-2.fna.whatsapp.net", "media.flhe4-1.fna.whatsapp.net", "media.frak1-2.fna.whatsapp.net", "media.fsub6-3.fna.whatsapp.net", "media.fsub6-7.fna.whatsapp.net", "media.fvvi1-1.fna.whatsapp.net", "search_v5_eligible", "wam_real_time_enabled", "report_disk_event", "max_tx_rott_based_bitrate", "product", "media.fjdo10-2.fna.whatsapp.net", "video_frame_crc_sample_interval", "media_max_autodownload", "15", "h.264", "wam_privatestats_buffer_count", "md_phash_v2_enabled", "account_transfer_enabled", "business_product_catalog", "enable_non_dyn_codec_param_fix", "is_user_under_epd_jurisdiction", "media.fbog2-4.fna.whatsapp.net", "media.fbtz1-2.fna.whatsapp.net", "media.fcfc1-1.fna.whatsapp.net", "media.fjed4-5.fna.whatsapp.net", "media.flhe4-2.fna.whatsapp.net", "media.flim1-2.fna.whatsapp.net", "media.flos5-1.fna.whatsapp.net", "android_key_store_auth_ver", "010", "anr_process_monitor", "delete_old_auth_key", "media.fcor10-3.fna.whatsapp.net", "storage_usage_enabled", "android_camera2_support_level", "dirty", "consumer_content_provider", "status_video_max_duration", "0c", "bloks_cache_enabled", "media.fadb2-2.fna.whatsapp.net", "media.fbko1-1.fna.whatsapp.net", "media.fbtz1-9.fna.whatsapp.net", "media.fcgk4-4.fna.whatsapp.net", "media.fesb4-2.fna.whatsapp.net", "media.fevn1-2.fna.whatsapp.net", "media.fist2-4.fna.whatsapp.net", "media.fjdo1-1.fna.whatsapp.net", "media.fruh4-6.fna.whatsapp.net", "media.fsrg5-1.fna.whatsapp.net", "media.fsub6-6.fna.whatsapp.net", "minfpp", "5000", "locales", "video_max_bitrate", "use_new_auth_key", "bloks_http_enabled", "heartbeat_interval", "media.fbog11-1.fna.whatsapp.net", "ephemeral_group_query_ts", "fec_nack", "search_in_storage_usage", "c", "media-amt2-1.cdn.whatsapp.net", "linked_devices_ui_enabled", "14", "async_data_load_on_startup", "voip_incoming_xml_ack", "16", "db_migration_step", "init_bwe", "max_participants", "wam_buffer_count", "media.fada2-2.fna.whatsapp.net", "media.fadb3-1.fna.whatsapp.net", "media.fcor2-2.fna.whatsapp.net", "media.fdiy1-2.fna.whatsapp.net", "media.frba3-2.fna.whatsapp.net", "media.fsaw2-3.fna.whatsapp.net", "1280", "status_grid_enabled", "w:biz", "product_catalog_deeplink", "media.fgye10-2.fna.whatsapp.net", "media.fuio11-1.fna.whatsapp.net", "optimistic_upload", "work_manager_init", "lc", "catalog_message", "cond_net_medium", "enable_periodical_aud_rr_processing", "cond_range_ema_rtt", "media-tir2-1.cdn.whatsapp.net", "frame_ms", "group_invite_sending", "payments_web_enabled", "wallpapers_v2", "0d", "browser", "hq_image_max_edge", "image_edit_zoom", "linked_devices_re_auth_enabled", "media.faly3-2.fna.whatsapp.net", "media.fdoh5-3.fna.whatsapp.net", "media.fesb3-1.fna.whatsapp.net", "media.fknu1-1.fna.whatsapp.net", "media.fmex3-1.fna.whatsapp.net", "media.fruh4-3.fna.whatsapp.net", "255", "web_upgrade_to_md_modal", "audio_piggyback_timeout_msec", "enable_audio_oob_fec_feature", "from_ip", "image_max_edge", "message_qr_enabled", "powersave", "receipt_pre_acking", "video_max_edge", "full", "011", "012", "enable_audio_oob_fec_for_sender", "md_voip_enabled", "enable_privatestats", "max_fec_ratio", "payments_cs_faq_url", "media-xsp1-3.cdn.whatsapp.net", "hq_image_quality", "media.fasr1-2.fna.whatsapp.net", "media.fbog3-1.fna.whatsapp.net", "media.ffjr1-6.fna.whatsapp.net", "media.fist2-3.fna.whatsapp.net", "media.flim4-3.fna.whatsapp.net", "media.fpbc2-4.fna.whatsapp.net", "media.fpku1-1.fna.whatsapp.net", "media.frba1-1.fna.whatsapp.net", "media.fudi1-1.fna.whatsapp.net", "media.fvvi1-2.fna.whatsapp.net", "gcm_fg_service", "enable_dec_ltr_size_check", "clear", "lg", "media.fgru11-1.fna.whatsapp.net", "18", "media-lga3-2.cdn.whatsapp.net", "pkey", "0e", "max_subject", "cond_range_lterm_rtt", "announcement_groups", "biz_profile_options", "s_t", "media.fabv2-1.fna.whatsapp.net", "media.fcai3-1.fna.whatsapp.net", "media.fcgh1-1.fna.whatsapp.net", "media.fctg1-4.fna.whatsapp.net", "media.fdiy1-1.fna.whatsapp.net", "media.fisb4-1.fna.whatsapp.net", "media.fpku1-2.fna.whatsapp.net", "media.fros9-1.fna.whatsapp.net", "status_v3_text", "usync_sidelist", "17", "announcement", "...", "md_group_notification", "0f", "animated_pack_in_store", "013", "America/Mexico_City", "1260", "media-ams4-1.cdn.whatsapp.net", "media-cgk1-2.cdn.whatsapp.net", "media-cpt1-1.cdn.whatsapp.net", "media-maa2-1.cdn.whatsapp.net", "media.fgye10-1.fna.whatsapp.net", "e", "catalog_cart", "hfm_string_changes", "init_bitrate", "packless_hsm", "group_info", "America/Belem", "50", "960", "cond_range_bwe", "decode", "encode", "media.fada1-8.fna.whatsapp.net", "media.fadb1-2.fna.whatsapp.net", "media.fasu6-1.fna.whatsapp.net", "media.fbog4-1.fna.whatsapp.net", "media.fcgk9-2.fna.whatsapp.net", "media.fdoh5-2.fna.whatsapp.net", "media.ffjr1-2.fna.whatsapp.net", "media.fgua1-1.fna.whatsapp.net", "media.fgye1-1.fna.whatsapp.net", "media.fist1-4.fna.whatsapp.net", "media.fpbc2-2.fna.whatsapp.net", "media.fres2-1.fna.whatsapp.net", "media.fsdq1-2.fna.whatsapp.net", "media.fsub6-5.fna.whatsapp.net", "profilo_enabled", "template_hsm", "use_disorder_prefetching_timer", "video_codec_priority", "vpx_max_qp", "ptt_reduce_recording_delay", "25", "iphone", "Windows", "s_o", "Africa/Lagos", "abt", "media-kut2-1.cdn.whatsapp.net", "media-mba1-1.cdn.whatsapp.net", "media-mxp1-2.cdn.whatsapp.net", "md_blocklist_v2", "url_text", "enable_short_offset", "group_join_permissions", "enable_audio_piggyback_feature", "image_quality", "media.fcgk7-2.fna.whatsapp.net", "media.fcgk8-2.fna.whatsapp.net", "media.fclo7-1.fna.whatsapp.net", "media.fcmn1-1.fna.whatsapp.net", "media.feoh1-1.fna.whatsapp.net", "media.fgyd4-3.fna.whatsapp.net", "media.fjed4-4.fna.whatsapp.net", "media.flim1-4.fna.whatsapp.net", "media.flim2-4.fna.whatsapp.net", "media.fplu6-1.fna.whatsapp.net", "media.frak1-1.fna.whatsapp.net", "media.fsdq1-1.fna.whatsapp.net", "to_ip", "015", "vp8", "19", "21", "1320", "auth_key_ver", "message_processing_dedup", "server-error", "wap4_enabled", "420", "014", "cond_range_rtt", "ptt_fast_lock_enabled", "media-ort2-1.cdn.whatsapp.net", "fwd_ui_start_ts"}, - {"contact_blacklist", "Asia/Jakarta", "media.fepa10-1.fna.whatsapp.net", "media.fmex10-3.fna.whatsapp.net", "disorder_prefetching_start_when_empty", "America/Bogota", "use_local_probing_rx_bitrate", "America/Argentina/Buenos_Aires", "cross_post", "media.fabb1-1.fna.whatsapp.net", "media.fbog4-2.fna.whatsapp.net", "media.fcgk9-1.fna.whatsapp.net", "media.fcmn2-1.fna.whatsapp.net", "media.fdel3-1.fna.whatsapp.net", "media.ffjr1-1.fna.whatsapp.net", "media.fgdl5-1.fna.whatsapp.net", "media.flpb1-2.fna.whatsapp.net", "media.fmex2-1.fna.whatsapp.net", "media.frba2-2.fna.whatsapp.net", "media.fros2-2.fna.whatsapp.net", "media.fruh2-1.fna.whatsapp.net", "media.fybz2-2.fna.whatsapp.net", "options", "20", "a", "017", "018", "mute_always", "user_notice", "Asia/Kolkata", "gif_provider", "locked", "media-gua1-1.cdn.whatsapp.net", "piggyback_exclude_force_flush", "24", "media.frec39-1.fna.whatsapp.net", "user_remove", "file_max_size", "cond_packet_loss_pct_ema_alpha", "media.facc1-1.fna.whatsapp.net", "media.fadb2-1.fna.whatsapp.net", "media.faly3-1.fna.whatsapp.net", "media.fbdo6-2.fna.whatsapp.net", "media.fcmn2-2.fna.whatsapp.net", "media.fctg1-3.fna.whatsapp.net", "media.ffez1-2.fna.whatsapp.net", "media.fist1-3.fna.whatsapp.net", "media.fist2-2.fna.whatsapp.net", "media.flim2-2.fna.whatsapp.net", "media.fmct2-3.fna.whatsapp.net", "media.fpei3-1.fna.whatsapp.net", "media.frba3-1.fna.whatsapp.net", "media.fsdu8-2.fna.whatsapp.net", "media.fstu2-1.fna.whatsapp.net", "media_type", "receipt_agg", "016", "enable_pli_for_crc_mismatch", "live", "enc_rekey", "frskmsg", "d", "media.fdel11-2.fna.whatsapp.net", "proto", "2250", "audio_piggyback_enable_cache", "skip_nack_if_ltrp_sent", "mark_dtx_jb_frames", "web_service_delay", "7282", "catalog_send_all", "outgoing", "360", "30", "LIMITED", "019", "audio_picker", "bpv2_phase", "media.fada1-7.fna.whatsapp.net", "media.faep7-1.fna.whatsapp.net", "media.fbko1-2.fna.whatsapp.net", "media.fbni1-2.fna.whatsapp.net", "media.fbtz1-1.fna.whatsapp.net", "media.fbtz1-8.fna.whatsapp.net", "media.fcjs3-1.fna.whatsapp.net", "media.fesb3-2.fna.whatsapp.net", "media.fgdl5-4.fna.whatsapp.net", "media.fist2-1.fna.whatsapp.net", "media.flhe2-2.fna.whatsapp.net", "media.flim2-1.fna.whatsapp.net", "media.fmex1-1.fna.whatsapp.net", "media.fpat3-2.fna.whatsapp.net", "media.fpat3-3.fna.whatsapp.net", "media.fros2-1.fna.whatsapp.net", "media.fsdu8-1.fna.whatsapp.net", "media.fsub3-2.fna.whatsapp.net", "payments_chat_plugin", "cond_congestion_no_rtcp_thr", "green_alert", "not-a-biz", "..", "shops_pdp_urls_config", "source", "media-dus1-1.cdn.whatsapp.net", "mute_video", "01b", "currency", "max_keys", "resume_check", "contact_array", "qr_scanning", "23", "b", "media.fbfh15-1.fna.whatsapp.net", "media.flim22-1.fna.whatsapp.net", "media.fsdu11-1.fna.whatsapp.net", "media.fsdu15-1.fna.whatsapp.net", "Chrome", "fts_version", "60", "media.fada1-6.fna.whatsapp.net", "media.faep4-2.fna.whatsapp.net", "media.fbaq5-1.fna.whatsapp.net", "media.fbni1-1.fna.whatsapp.net", "media.fcai3-2.fna.whatsapp.net", "media.fdel3-2.fna.whatsapp.net", "media.fdmm3-2.fna.whatsapp.net", "media.fhex3-1.fna.whatsapp.net", "media.fisb4-2.fna.whatsapp.net", "media.fkhi5-2.fna.whatsapp.net", "media.flos2-1.fna.whatsapp.net", "media.fmct2-1.fna.whatsapp.net", "media.fntr7-1.fna.whatsapp.net", "media.frak3-1.fna.whatsapp.net", "media.fruh5-2.fna.whatsapp.net", "media.fsub6-1.fna.whatsapp.net", "media.fuab1-2.fna.whatsapp.net", "media.fuio1-1.fna.whatsapp.net", "media.fver1-1.fna.whatsapp.net", "media.fymy1-1.fna.whatsapp.net", "product_catalog", "1380", "audio_oob_fec_max_pkts", "22", "254", "media-ort2-2.cdn.whatsapp.net", "media-sjc3-1.cdn.whatsapp.net", "1600", "01a", "01c", "405", "key_frame_interval", "body", "media.fcgh20-1.fna.whatsapp.net", "media.fesb10-2.fna.whatsapp.net", "125", "2000", "media.fbsb1-1.fna.whatsapp.net", "media.fcmn3-2.fna.whatsapp.net", "media.fcpq1-1.fna.whatsapp.net", "media.fdel1-2.fna.whatsapp.net", "media.ffor2-1.fna.whatsapp.net", "media.fgdl1-4.fna.whatsapp.net", "media.fhex2-1.fna.whatsapp.net", "media.fist1-2.fna.whatsapp.net", "media.fjed5-2.fna.whatsapp.net", "media.flim6-4.fna.whatsapp.net", "media.flos2-2.fna.whatsapp.net", "media.fntr6-2.fna.whatsapp.net", "media.fpku3-2.fna.whatsapp.net", "media.fros8-1.fna.whatsapp.net", "media.fymy1-2.fna.whatsapp.net", "ul_bw", "ltrp_qp_offset", "request", "nack", "dtx_delay_state_reset", "timeoffline", "28", "01f", "32", "enable_ltr_pool", "wa_msys_crypto", "01d", "58", "dtx_freeze_hg_update", "nack_if_rpsi_throttled", "253", "840", "media.famd15-1.fna.whatsapp.net", "media.fbog17-2.fna.whatsapp.net", "media.fcai19-2.fna.whatsapp.net", "media.fcai21-4.fna.whatsapp.net", "media.fesb10-4.fna.whatsapp.net", "media.fesb10-5.fna.whatsapp.net", "media.fmaa12-1.fna.whatsapp.net", "media.fmex11-3.fna.whatsapp.net", "media.fpoa33-1.fna.whatsapp.net", "1050", "021", "clean", "cond_range_ema_packet_loss_pct", "media.fadb6-5.fna.whatsapp.net", "media.faqp4-1.fna.whatsapp.net", "media.fbaq3-1.fna.whatsapp.net", "media.fbel2-1.fna.whatsapp.net", "media.fblr4-2.fna.whatsapp.net", "media.fclo8-1.fna.whatsapp.net", "media.fcoo1-2.fna.whatsapp.net", "media.ffjr1-4.fna.whatsapp.net", "media.ffor9-1.fna.whatsapp.net", "media.fisb3-1.fna.whatsapp.net", "media.fkhi2-2.fna.whatsapp.net", "media.fkhi4-1.fna.whatsapp.net", "media.fpbc1-2.fna.whatsapp.net", "media.fruh2-2.fna.whatsapp.net", "media.fruh5-1.fna.whatsapp.net", "media.fsub3-1.fna.whatsapp.net", "payments_transaction_limit", "252", "27", "29", "tintagel", "01e", "237", "780", "callee_updated_payload", "020", "257", "price", "025", "239", "payments_cs_phone_number", "mediaretry", "w:auth:backup:token", "Glass.caf", "max_bitrate", "240", "251", "660", "media.fbog16-1.fna.whatsapp.net", "media.fcgh21-1.fna.whatsapp.net", "media.fkul19-2.fna.whatsapp.net", "media.flim21-2.fna.whatsapp.net", "media.fmex10-4.fna.whatsapp.net", "64", "33", "34", "35", "interruption", "media.fabv3-1.fna.whatsapp.net", "media.fadb6-1.fna.whatsapp.net", "media.fagr1-1.fna.whatsapp.net", "media.famd1-1.fna.whatsapp.net", "media.famm6-1.fna.whatsapp.net", "media.faqp2-3.fna.whatsapp.net"}, + {"read-self", "active", "fbns", "protocol", "reaction", "screen_width", "heartbeat", "deviceid", "2:47DEQpj8", "uploadfieldstat", "voip_settings", "retry", "priority", "longitude", "conflict", "false", "ig_professional", "replaced", "preaccept", "cover_photo", "uncompressed", "encopt", "ppic", "04", "passive", "status-revoke-drop", "keygen", "540", "offer", "rate", "opus", "latitude", "w:gp2", "ver", "4", "business_profile", "medium", "sender", "prev_v_id", "email", "website", "invited", "sign_credential", "05", "transport", "skey", "reason", "peer_abtest_bucket", "America/Sao_Paulo", "appid", "refresh", "100", "06", "404", "101", "104", "107", "102", "109", "103", "member_add_mode", "105", "transaction-id", "110", "106", "outgoing", "108", "111", "tokens", "followers", "ig_handle", "self_pid", "tue", "dec", "thu", "joinable", "peer_pid", "mon", "features", "wed", "peer_device_presence", "pn", "delete", "07", "fri", "audio_duration", "admin", "connected", "delta", "rcat", "disable", "collection", "08", "480", "sat", "phash", "all", "invite", "accept", "critical_unblock_low", "group_update", "signed_credential", "blinded_credential", "eph_setting", "net", "09", "background_location", "refresh_id", "Asia/Kolkata", "privacy_mode_ts", "account_sync", "voip_payload_type", "service_areas", "acs_public_key", "v_id", "0a", "fallback_class", "relay", "actual_actors", "metadata", "w:biz", "5", "connected-limit", "notice", "0b", "host_storage", "fb_page", "subject", "privatestats", "invis", "groupadd", "010", "note.m4r", "uuid", "0c", "8000", "sun", "372", "1020", "stage", "1200", "720", "canonical", "fb", "011", "video_duration", "0d", "1140", "superadmin", "012", "Opening.m4r", "keystore_attestation", "dleq_proof", "013", "timestamp", "ab_key", "w:sync:app:state", "0e", "vertical", "600", "p_v_id", "6", "likes", "014", "500", "1260", "creator", "0f", "rte", "destination", "group", "group_info", "syncd_anti_tampering_fatal_exception_enabled", "015", "dl_bw", "Asia/Jakarta", "vp8/h.264", "online", "1320", "fb:multiway", "10", "timeout", "016", "nse_retry", "urn:xmpp:whatsapp:dirty", "017", "a_v_id", "web_shops_chat_header_button_enabled", "nse_call", "inactive-upgrade", "none", "web", "groups", "2250", "mms_hot_content_timespan_in_seconds", "contact_blacklist", "nse_read", "suspended_group_deletion_notification", "binary_version", "018", "https://www.whatsapp.com/otp/copy/", "reg_push", "shops_hide_catalog_attachment_entrypoint", "server_sync", ".", "ephemeral_messages_allowed_values", "019", "mms_vcache_aggregation_enabled", "iphone", "America/Argentina/Buenos_Aires", "01a", "mms_vcard_autodownload_size_kb", "nse_ver", "shops_header_dropdown_menu_item", "dhash", "catalog_status", "communities_mvp_new_iqs_serverprop", "blocklist", "default", "11", "ephemeral_messages_enabled", "01b", "original_dimensions", "8", "mms4_media_retry_notification_encryption_enabled", "mms4_server_error_receipt_encryption_enabled", "original_image_url", "sync", "multiway", "420", "companion_enc_static", "shops_profile_drawer_entrypoint", "01c", "vcard_as_document_size_kb", "status_video_max_duration", "request_image_url", "01d", "regular_high", "s_t", "abt", "share_ext_min_preliminary_image_quality", "01e", "32", "syncd_key_rotation_enabled", "data_namespace", "md_downgrade_read_receipts2", "patch", "polltype", "ephemeral_messages_setting", "userrate", "15", "partial_pjpeg_bw_threshold", "played-self", "catalog_exists", "01f", "mute_v2"}, + {"reject", "dirty", "announcement", "020", "13", "9", "status_video_max_bitrate", "fb:thrift_iq", "offline_batch", "022", "full", "ctwa_first_business_reply_logging", "h.264", "smax_id", "group_description_length", "https://www.whatsapp.com/otp/code", "status_image_max_edge", "smb_upsell_business_profile_enabled", "021", "web_upgrade_to_md_modal", "14", "023", "s_o", "smaller_video_thumbs_status_enabled", "media_max_autodownload", "960", "blocking_status", "peer_msg", "joinable_group_call_client_version", "group_call_video_maximization_enabled", "return_snapshot", "high", "America/Mexico_City", "entry_point_block_logging_enabled", "pop", "024", "1050", "16", "1380", "one_tap_calling_in_group_chat_size", "regular_low", "inline_joinable_education_enabled", "hq_image_max_edge", "locked", "America/Bogota", "smb_biztools_deeplink_enabled", "status_image_quality", "1088", "025", "payments_upi_intent_transaction_limit", "voip", "w:g2", "027", "md_pin_chat_enabled", "026", "multi_scan_pjpeg_download_enabled", "shops_product_grid", "transaction_id", "ctwa_context_enabled", "20", "fna", "hq_image_quality", "alt_jpeg_doc_detection_quality", "group_call_max_participants", "pkey", "America/Belem", "image_max_kbytes", "web_cart_v1_1_order_message_changes_enabled", "ctwa_context_enterprise_enabled", "urn:xmpp:whatsapp:account", "840", "Asia/Kuala_Lumpur", "max_participants", "video_remux_after_repair_enabled", "stella_addressbook_restriction_type", "660", "900", "780", "context_menu_ios13_enabled", "mute-state", "ref", "payments_request_messages", "029", "frskmsg", "vcard_max_size_kb", "sample_buffer_gif_player_enabled", "match_last_seen", "510", "4983", "video_max_bitrate", "028", "w:comms:chat", "17", "frequently_forwarded_max", "groups_privacy_blacklist", "Asia/Karachi", "02a", "web_download_document_thumb_mms_enabled", "02b", "hist_sync", "biz_block_reasons_version", "1024", "18", "web_is_direct_connection_for_plm_transparent", "view_once_write", "file_max_size", "paid_convo_id", "online_privacy_setting", "video_max_edge", "view_once_read", "enhanced_storage_management", "multi_scan_pjpeg_encoding_enabled", "ctwa_context_forward_enabled", "video_transcode_downgrade_enable", "template_doc_mime_types", "hq_image_bw_threshold", "30", "body", "u_aud_limit_sil_restarts_ctrl", "other", "participating", "w:biz:directory", "1110", "vp8", "4018", "meta", "doc_detection_image_max_edge", "image_quality", "1170", "02c", "smb_upsell_chat_banner_enabled", "key_expiry_time_second", "pid", "stella_interop_enabled", "19", "linked_device_max_count", "md_device_sync_enabled", "02d", "02e", "360", "enhanced_block_enabled", "ephemeral_icon_in_forwarding", "paid_convo_status", "gif_provider", "project_name", "server-error", "canonical_url_validation_enabled", "wallpapers_v2", "syncd_clear_chat_delete_chat_enabled", "medianotify", "02f", "shops_required_tos_version", "vote", "reset_skey_on_id_change", "030", "image_max_edge", "multicast_limit_global", "ul_bw", "21", "25", "5000", "poll", "570", "22", "031", "1280", "WhatsApp", "032", "bloks_shops_enabled", "50", "upload_host_switching_enabled", "web_ctwa_context_compose_enabled", "ptt_forwarded_features_enabled", "unblocked", "partial_pjpeg_enabled", "fbid:devices", "height", "ephemeral_group_query_ts", "group_join_permissions", "order", "033", "alt_jpeg_status_quality", "migrate", "popular-bank", "win_uwp_deprecation_killswitch_enabled", "web_download_status_thumb_mms_enabled", "blocking", "url_text", "035", "web_forwarding_limit_to_groups", "1600", "val", "1000", "syncd_msg_date_enabled", "bank-ref-id", "max_subject", "payments_web_enabled", "web_upload_document_thumb_mms_enabled", "size", "request", "ephemeral", "24", "receipt_agg", "ptt_remember_play_position", "sampling_weight", "enc_rekey", "mute_always", "037", "034", "23", "036", "action", "click_to_chat_qr_enabled", "width", "disabled", "038", "md_blocklist_v2", "played_self_enabled", "web_buttons_message_enabled", "flow_id", "clear", "450", "fbid:thread", "bloks_session_state", "America/Lima", "attachment_picker_refresh", "download_host_switching_enabled", "1792", "u_aud_limit_sil_restarts_test2", "custom_urls", "device_fanout", "optimistic_upload", "2000", "key_cipher_suite", "web_smb_upsell_in_biz_profile_enabled", "e", "039", "siri_post_status_shortcut", "pair-device", "lg", "lc", "stream_attribution_url", "model", "mspjpeg_phash_gen", "catalog_send_all", "new_multi_vcards_ui", "share_biz_vcard_enabled", "-", "clean", "200", "md_blocklist_v2_server", "03b", "03a", "web_md_migration_experience", "ptt_conversation_waveform", "u_aud_limit_sil_restarts_test1"}, + {"64", "ptt_playback_speed_enabled", "web_product_list_message_enabled", "paid_convo_ts", "27", "manufacturer", "psp-routing", "grp_uii_cleanup", "ptt_draft_enabled", "03c", "business_initiated", "web_catalog_products_onoff", "web_upload_link_thumb_mms_enabled", "03e", "mediaretry", "35", "hfm_string_changes", "28", "America/Fortaleza", "max_keys", "md_mhfs_days", "streaming_upload_chunk_size", "5541", "040", "03d", "2675", "03f", "...", "512", "mute", "48", "041", "alt_jpeg_quality", "60", "042", "md_smb_quick_reply", "5183", "c", "1343", "40", "1230", "043", "044", "mms_cat_v1_forward_hot_override_enabled", "user_notice", "ptt_waveform_send", "047", "Asia/Calcutta", "250", "md_privacy_v2", "31", "29", "128", "md_messaging_enabled", "046", "crypto", "690", "045", "enc_iv", "75", "failure", "ptt_oot_playback", "AIzaSyDR5yfaG7OG8sMTUj8kfQEb8T9pN8BM6Lk", "w", "048", "2201", "web_large_files_ui", "Asia/Makassar", "812", "status_collapse_muted", "1334", "257", "2HP4dm", "049", "patches", "1290", "43cY6T", "America/Caracas", "web_sticker_maker", "campaign", "ptt_pausable_enabled", "33", "42", "attestation", "biz", "04b", "query_linked", "s", "125", "04a", "810", "availability", "1411", "responsiveness_v2_m1", "catalog_not_created", "34", "America/Santiago", "1465", "enc_p", "04d", "status_info", "04f", "key_version", "..", "04c", "04e", "md_group_notification", "1598", "1215", "web_cart_enabled", "37", "630", "1920", "2394", "-1", "vcard", "38", "elapsed", "36", "828", "peer", "pricing_category", "1245", "invalid", "stella_ios_enabled", "2687", "45", "1528", "39", "u_is_redial_audio_1104_ctrl", "1025", "1455", "58", "2524", "2603", "054", "bsp_system_message_enabled", "web_pip_redesign", "051", "verify_apps", "1974", "1272", "1322", "1755", "052", "70", "050", "1063", "1135", "1361", "80", "1096", "1828", "1851", "1251", "1921", "key_config_id", "1254", "1566", "1252", "2525", "critical_block", "1669", "max_available", "w:auth:backup:token", "product", "2530", "870", "1022", "participant_uuid", "web_cart_on_off", "1255", "1432", "1867", "41", "1415", "1440", "240", "1204", "1608", "1690", "1846", "1483", "1687", "1749", "69", "url_number", "053", "1325", "1040", "365", "59", "Asia/Riyadh", "1177", "test_recommended", "057", "1612", "43", "1061", "1518", "1635", "055", "1034", "1375", "750", "1430", "event_code", "1682", "503", "55", "865", "78", "1309", "1365", "44", "America/Guayaquil", "535", "LIMITED", "1377", "1613", "1420", "1599", "1822", "05a", "1681", "password", "1111", "1214", "1376", "1478", "47", "1082", "4282", "Europe/Istanbul", "1307", "46", "058", "1124", "256", "rate-overlimit", "retail", "u_a_socket_err_fix_succ_test", "1292", "1370", "1388", "520", "861", "psa", "regular", "1181", "1766", "05b", "1183", "1213", "1304", "1537"}, + {"1724", "profile_picture", "1071", "1314", "1605", "407", "990", "1710", "746", "pricing_model", "056", "059", "061", "1119", "6027", "65", "877", "1607", "05d", "917", "seen", "1516", "49", "470", "973", "1037", "1350", "1394", "1480", "1796", "keys", "794", "1536", "1594", "2378", "1333", "1524", "1825", "116", "309", "52", "808", "827", "909", "495", "1660", "361", "957", "google", "1357", "1565", "1967", "996", "1775", "586", "736", "1052", "1670", "bank", "177", "1416", "2194", "2222", "1454", "1839", "1275", "53", "997", "1629", "6028", "smba", "1378", "1410", "05c", "1849", "727", "create", "1559", "536", "1106", "1310", "1944", "670", "1297", "1316", "1762", "en", "1148", "1295", "1551", "1853", "1890", "1208", "1784", "7200", "05f", "178", "1283", "1332", "381", "643", "1056", "1238", "2024", "2387", "179", "981", "1547", "1705", "05e", "290", "903", "1069", "1285", "2436", "062", "251", "560", "582", "719", "56", "1700", "2321", "325", "448", "613", "777", "791", "51", "488", "902", "Asia/Almaty", "is_hidden", "1398", "1527", "1893", "1999", "2367", "2642", "237", "busy", "065", "067", "233", "590", "993", "1511", "54", "723", "860", "363", "487", "522", "605", "995", "1321", "1691", "1865", "2447", "2462", "NON_TRANSACTIONAL", "433", "871", "432", "1004", "1207", "2032", "2050", "2379", "2446", "279", "636", "703", "904", "248", "370", "691", "700", "1068", "1655", "2334", "060", "063", "364", "533", "534", "567", "1191", "1210", "1473", "1827", "069", "701", "2531", "514", "prev_dhash", "064", "496", "790", "1046", "1139", "1505", "1521", "1108", "207", "544", "637", "final", "1173", "1293", "1694", "1939", "1951", "1993", "2353", "2515", "504", "601", "857", "modify", "spam_request", "p_121_aa_1101_test4", "866", "1427", "1502", "1638", "1744", "2153", "068", "382", "725", "1704", "1864", "1990", "2003", "Asia/Dubai", "508", "531", "1387", "1474", "1632", "2307", "2386", "819", "2014", "066", "387", "1468", "1706", "2186", "2261", "471", "728", "1147", "1372", "1961"}, } ) // DictVersion is the version number of the token lists above. // It's sent when connecting to the websocket so the server knows which tokens are supported. -const DictVersion = 2 +const DictVersion = 3 type doubleByteTokenIndex struct { dictionary byte diff --git a/vendor/go.mau.fi/whatsmeow/call.go b/vendor/go.mau.fi/whatsmeow/call.go index f4de9bd8..7a6ffcb2 100644 --- a/vendor/go.mau.fi/whatsmeow/call.go +++ b/vendor/go.mau.fi/whatsmeow/call.go @@ -59,6 +59,24 @@ func (cli *Client) handleCallEvent(node *waBinary.Node) { }, Data: &child, }) + case "preaccept": + cli.dispatchEvent(&events.CallPreAccept{ + BasicCallMeta: basicMeta, + CallRemoteMeta: types.CallRemoteMeta{ + RemotePlatform: ag.String("platform"), + RemoteVersion: ag.String("version"), + }, + Data: &child, + }) + case "transport": + cli.dispatchEvent(&events.CallTransport{ + BasicCallMeta: basicMeta, + CallRemoteMeta: types.CallRemoteMeta{ + RemotePlatform: ag.String("platform"), + RemoteVersion: ag.String("version"), + }, + Data: &child, + }) case "terminate": cli.dispatchEvent(&events.CallTerminate{ BasicCallMeta: basicMeta, diff --git a/vendor/go.mau.fi/whatsmeow/client.go b/vendor/go.mau.fi/whatsmeow/client.go index 82ca04e8..e36c4430 100644 --- a/vendor/go.mau.fi/whatsmeow/client.go +++ b/vendor/go.mau.fi/whatsmeow/client.go @@ -59,6 +59,9 @@ type Client struct { EnableAutoReconnect bool LastSuccessfulConnect time.Time AutoReconnectErrors int + // AutoReconnectHook is called when auto-reconnection fails. If the function returns false, + // the client will not attempt to reconnect. The number of retries can be read from AutoReconnectErrors. + AutoReconnectHook func(error) bool sendActiveReceipts uint32 @@ -380,6 +383,10 @@ func (cli *Client) autoReconnect() { return } else if err != nil { cli.Log.Errorf("Error reconnecting after autoreconnect sleep: %v", err) + if cli.AutoReconnectHook != nil && !cli.AutoReconnectHook(err) { + cli.Log.Debugf("AutoReconnectHook returned false, not reconnecting") + return + } } else { return } diff --git a/vendor/go.mau.fi/whatsmeow/download.go b/vendor/go.mau.fi/whatsmeow/download.go index 95f0144d..7a031336 100644 --- a/vendor/go.mau.fi/whatsmeow/download.go +++ b/vendor/go.mau.fi/whatsmeow/download.go @@ -308,7 +308,9 @@ func (cli *Client) downloadMedia(url string) ([]byte, error) { func (cli *Client) downloadEncryptedMedia(url string, checksum []byte) (file, mac []byte, err error) { data, err := cli.downloadMedia(url) - if len(data) <= 10 { + if err != nil { + return + } else if len(data) <= 10 { err = ErrTooShortFile return } diff --git a/vendor/go.mau.fi/whatsmeow/group.go b/vendor/go.mau.fi/whatsmeow/group.go index 94a82f6e..199493c8 100644 --- a/vendor/go.mau.fi/whatsmeow/group.go +++ b/vendor/go.mau.fi/whatsmeow/group.go @@ -148,30 +148,93 @@ const ( ) // UpdateGroupParticipants can be used to add, remove, promote and demote members in a WhatsApp group. -func (cli *Client) UpdateGroupParticipants(jid types.JID, participantChanges map[types.JID]ParticipantChange) (*waBinary.Node, error) { +func (cli *Client) UpdateGroupParticipants(jid types.JID, participantChanges []types.JID, action ParticipantChange) ([]types.GroupParticipant, error) { content := make([]waBinary.Node, len(participantChanges)) - i := 0 - for participantJID, change := range participantChanges { + for i, participantJID := range participantChanges { content[i] = waBinary.Node{ - Tag: string(change), - Content: []waBinary.Node{{ - Tag: "participant", - Attrs: waBinary.Attrs{"jid": participantJID}, - }}, + Tag: "participant", + Attrs: waBinary.Attrs{"jid": participantJID}, } - i++ } - resp, err := cli.sendIQ(infoQuery{ - Namespace: "w:g2", - Type: iqSet, - To: jid, - Content: content, + resp, err := cli.sendGroupIQ(context.TODO(), iqSet, jid, waBinary.Node{ + Tag: string(action), + Content: content, }) if err != nil { return nil, err } - // TODO proper return value? - return resp, nil + requestAction, ok := resp.GetOptionalChildByTag(string(action)) + if !ok { + return nil, &ElementMissingError{Tag: string(action), In: "response to group participants update"} + } + requestParticipants := requestAction.GetChildrenByTag("participant") + participants := make([]types.GroupParticipant, len(requestParticipants)) + for i, child := range requestParticipants { + participants[i] = parseParticipant(child.AttrGetter(), &child) + } + return participants, nil +} + +// GetGroupRequestParticipants gets the list of participants that have requested to join the group. +func (cli *Client) GetGroupRequestParticipants(jid types.JID) ([]types.JID, error) { + resp, err := cli.sendGroupIQ(context.TODO(), iqGet, jid, waBinary.Node{ + Tag: "membership_approval_requests", + }) + if err != nil { + return nil, err + } + request, ok := resp.GetOptionalChildByTag("membership_approval_requests") + if !ok { + return nil, &ElementMissingError{Tag: "membership_approval_requests", In: "response to group request participants query"} + } + requestParticipants := request.GetChildrenByTag("membership_approval_request") + participants := make([]types.JID, len(requestParticipants)) + for i, req := range requestParticipants { + participants[i] = req.AttrGetter().JID("jid") + } + return participants, nil +} + +type ParticipantRequestChange string + +const ( + ParticipantChangeApprove ParticipantRequestChange = "approve" + ParticipantChangeReject ParticipantRequestChange = "reject" +) + +// UpdateGroupRequestParticipants can be used to approve or reject requests to join the group. +func (cli *Client) UpdateGroupRequestParticipants(jid types.JID, participantChanges []types.JID, action ParticipantRequestChange) ([]types.GroupParticipant, error) { + content := make([]waBinary.Node, len(participantChanges)) + for i, participantJID := range participantChanges { + content[i] = waBinary.Node{ + Tag: "participant", + Attrs: waBinary.Attrs{"jid": participantJID}, + } + } + resp, err := cli.sendGroupIQ(context.TODO(), iqSet, jid, waBinary.Node{ + Tag: "membership_requests_action", + Content: []waBinary.Node{{ + Tag: string(action), + Content: content, + }}, + }) + if err != nil { + return nil, err + } + request, ok := resp.GetOptionalChildByTag("membership_requests_action") + if !ok { + return nil, &ElementMissingError{Tag: "membership_requests_action", In: "response to group request participants update"} + } + requestAction, ok := request.GetOptionalChildByTag(string(action)) + if !ok { + return nil, &ElementMissingError{Tag: string(action), In: "response to group request participants update"} + } + requestParticipants := requestAction.GetChildrenByTag("participant") + participants := make([]types.GroupParticipant, len(requestParticipants)) + for i, child := range requestParticipants { + participants[i] = parseParticipant(child.AttrGetter(), &child) + } + return participants, nil } // SetGroupPhoto updates the group picture/icon of the given group on WhatsApp. @@ -501,6 +564,33 @@ func (cli *Client) getGroupMembers(ctx context.Context, jid types.JID) ([]types. return cli.groupParticipantsCache[jid], nil } +func parseParticipant(childAG *waBinary.AttrUtility, child *waBinary.Node) types.GroupParticipant { + pcpType := childAG.OptionalString("type") + participant := types.GroupParticipant{ + IsAdmin: pcpType == "admin" || pcpType == "superadmin", + IsSuperAdmin: pcpType == "superadmin", + JID: childAG.JID("jid"), + LID: childAG.OptionalJIDOrEmpty("lid"), + DisplayName: childAG.OptionalString("display_name"), + } + if participant.JID.Server == types.HiddenUserServer && participant.LID.IsEmpty() { + participant.LID = participant.JID + //participant.JID = types.EmptyJID + } + if errorCode := childAG.OptionalInt("error"); errorCode != 0 { + participant.Error = errorCode + addRequest, ok := child.GetOptionalChildByTag("add_request") + if ok { + addAG := addRequest.AttrGetter() + participant.AddRequest = &types.GroupParticipantAddRequest{ + Code: addAG.String("code"), + Expiration: addAG.UnixTime("expiration"), + } + } + } + return participant +} + func (cli *Client) parseGroupNode(groupNode *waBinary.Node) (*types.GroupInfo, error) { var group types.GroupInfo ag := groupNode.AttrGetter() @@ -521,30 +611,7 @@ func (cli *Client) parseGroupNode(groupNode *waBinary.Node) (*types.GroupInfo, e childAG := child.AttrGetter() switch child.Tag { case "participant": - pcpType := childAG.OptionalString("type") - participant := types.GroupParticipant{ - IsAdmin: pcpType == "admin" || pcpType == "superadmin", - IsSuperAdmin: pcpType == "superadmin", - JID: childAG.JID("jid"), - LID: childAG.OptionalJIDOrEmpty("lid"), - DisplayName: childAG.OptionalString("display_name"), - } - if participant.JID.Server == types.HiddenUserServer && participant.LID.IsEmpty() { - participant.LID = participant.JID - //participant.JID = types.EmptyJID - } - if errorCode := childAG.OptionalInt("error"); errorCode != 0 { - participant.Error = errorCode - addRequest, ok := child.GetOptionalChildByTag("add_request") - if ok { - addAG := addRequest.AttrGetter() - participant.AddRequest = &types.GroupParticipantAddRequest{ - Code: addAG.String("code"), - Expiration: addAG.UnixTime("expiration"), - } - } - } - group.Participants = append(group.Participants, participant) + group.Participants = append(group.Participants, parseParticipant(childAG, &child)) case "description": body, bodyOK := child.GetOptionalChildByTag("body") if bodyOK { diff --git a/vendor/go.mau.fi/whatsmeow/internals.go b/vendor/go.mau.fi/whatsmeow/internals.go index 8227b0ce..126eb938 100644 --- a/vendor/go.mau.fi/whatsmeow/internals.go +++ b/vendor/go.mau.fi/whatsmeow/internals.go @@ -9,6 +9,8 @@ package whatsmeow import ( "context" + "go.mau.fi/libsignal/keys/prekey" + waBinary "go.mau.fi/whatsmeow/binary" "go.mau.fi/whatsmeow/types" ) @@ -66,3 +68,19 @@ func (int *DangerousInternalClient) RequestAppStateKeys(ctx context.Context, key func (int *DangerousInternalClient) SendRetryReceipt(node *waBinary.Node, info *types.MessageInfo, forceIncludeIdentity bool) { int.c.sendRetryReceipt(node, info, forceIncludeIdentity) } + +func (int *DangerousInternalClient) EncryptMessageForDevice(plaintext []byte, to types.JID, bundle *prekey.Bundle, extraAttrs waBinary.Attrs) (*waBinary.Node, bool, error) { + return int.c.encryptMessageForDevice(plaintext, to, bundle, extraAttrs) +} + +func (int *DangerousInternalClient) GetOwnID() types.JID { + return int.c.getOwnID() +} + +func (int *DangerousInternalClient) DecryptDM(child *waBinary.Node, from types.JID, isPreKey bool) ([]byte, error) { + return int.c.decryptDM(child, from, isPreKey) +} + +func (int *DangerousInternalClient) MakeDeviceIdentityNode() waBinary.Node { + return int.c.makeDeviceIdentityNode() +} diff --git a/vendor/go.mau.fi/whatsmeow/message.go b/vendor/go.mau.fi/whatsmeow/message.go index 286826a7..c41654a7 100644 --- a/vendor/go.mau.fi/whatsmeow/message.go +++ b/vendor/go.mau.fi/whatsmeow/message.go @@ -438,7 +438,7 @@ func (cli *Client) handleProtocolMessage(info *types.MessageInfo, msg *waProto.M if atomic.CompareAndSwapUint32(&cli.historySyncHandlerStarted, 0, 1) { go cli.handleHistorySyncNotificationLoop() } - go cli.sendProtocolMessageReceipt(info.ID, "hist_sync") + go cli.sendProtocolMessageReceipt(info.ID, types.ReceiptTypeHistorySync) } if protoMsg.GetPeerDataOperationRequestResponseMessage().GetPeerDataOperationRequestType() == waProto.PeerDataOperationRequestType_PLACEHOLDER_MESSAGE_RESEND { @@ -450,7 +450,7 @@ func (cli *Client) handleProtocolMessage(info *types.MessageInfo, msg *waProto.M } if info.Category == "peer" { - go cli.sendProtocolMessageReceipt(info.ID, "peer_msg") + go cli.sendProtocolMessageReceipt(info.ID, types.ReceiptTypePeerMsg) } } @@ -559,7 +559,7 @@ func (cli *Client) handleDecryptedMessage(info *types.MessageInfo, msg *waProto. cli.dispatchEvent(evt.UnwrapRaw()) } -func (cli *Client) sendProtocolMessageReceipt(id, msgType string) { +func (cli *Client) sendProtocolMessageReceipt(id types.MessageID, msgType types.ReceiptType) { clientID := cli.Store.ID if len(id) == 0 || clientID == nil { return @@ -567,8 +567,8 @@ func (cli *Client) sendProtocolMessageReceipt(id, msgType string) { err := cli.sendNode(waBinary.Node{ Tag: "receipt", Attrs: waBinary.Attrs{ - "id": id, - "type": msgType, + "id": string(id), + "type": string(msgType), "to": types.NewJID(clientID.User, types.LegacyUserServer), }, Content: nil, diff --git a/vendor/go.mau.fi/whatsmeow/newsletter.go b/vendor/go.mau.fi/whatsmeow/newsletter.go index 8a699bfe..00ba7b1f 100644 --- a/vendor/go.mau.fi/whatsmeow/newsletter.go +++ b/vendor/go.mau.fi/whatsmeow/newsletter.go @@ -105,6 +105,9 @@ func (cli *Client) NewsletterSendReaction(jid types.JID, serverID types.MessageS const ( queryFetchNewsletter = "6563316087068696" queryFetchNewsletterDehydrated = "7272540469429201" + queryRecommendedNewsletters = "7263823273662354" //variables -> input -> {limit: 20, country_codes: [string]}, output: xwa2_newsletters_recommended + queryNewslettersDirectory = "6190824427689257" // variables -> input -> {view: "RECOMMENDED", limit: 50, start_cursor: base64, filters: {country_codes: [string]}} + querySubscribedNewsletters = "6388546374527196" // variables -> empty, output: xwa2_newsletter_subscribed queryNewsletterSubscribers = "9800646650009898" //variables -> input -> {newsletter_id, count}, output: xwa2_newsletter_subscribers -> subscribers -> edges mutationMuteNewsletter = "6274038279359549" //variables -> {newsletter_id, updates->{description, settings}}, output: xwa2_newsletter_update -> NewsletterMetadata without viewer meta mutationUnmuteNewsletter = "6068417879924485" @@ -196,6 +199,23 @@ func (cli *Client) GetNewsletterInfoWithInvite(key string) (*types.NewsletterMet }, false) } +type respGetSubscribedNewsletters struct { + Newsletters []*types.NewsletterMetadata `json:"xwa2_newsletter_subscribed"` +} + +// GetSubscribedNewsletters gets the info of all newsletters that you're joined to. +func (cli *Client) GetSubscribedNewsletters() ([]*types.NewsletterMetadata, error) { + data, err := cli.sendMexIQ(context.TODO(), querySubscribedNewsletters, map[string]any{}) + var respData respGetSubscribedNewsletters + if data != nil { + jsonErr := json.Unmarshal(data, &respData) + if err == nil && jsonErr != nil { + err = jsonErr + } + } + return respData.Newsletters, err +} + type CreateNewsletterParams struct { Name string `json:"name"` Description string `json:"description,omitempty"` diff --git a/vendor/go.mau.fi/whatsmeow/privacysettings.go b/vendor/go.mau.fi/whatsmeow/privacysettings.go index 3aca72dd..a988c850 100644 --- a/vendor/go.mau.fi/whatsmeow/privacysettings.go +++ b/vendor/go.mau.fi/whatsmeow/privacysettings.go @@ -7,6 +7,9 @@ package whatsmeow import ( + "strconv" + "time" + waBinary "go.mau.fi/whatsmeow/binary" "go.mau.fi/whatsmeow/types" "go.mau.fi/whatsmeow/types/events" @@ -48,6 +51,69 @@ func (cli *Client) GetPrivacySettings() (settings types.PrivacySettings) { return } +// SetPrivacySetting will set the given privacy setting to the given value. +// The privacy settings will be fetched from the server after the change and the new settings will be returned. +// If an error occurs while fetching the new settings, will return an empty struct. +func (cli *Client) SetPrivacySetting(name types.PrivacySettingType, value types.PrivacySetting) (settings types.PrivacySettings, err error) { + settingsPtr, err := cli.TryFetchPrivacySettings(false) + if err != nil { + return settings, err + } + _, err = cli.sendIQ(infoQuery{ + Namespace: "privacy", + Type: iqSet, + To: types.ServerJID, + Content: []waBinary.Node{{ + Tag: "privacy", + Content: []waBinary.Node{{ + Tag: "category", + Attrs: waBinary.Attrs{ + "name": string(name), + "value": string(value), + }, + }}, + }}, + }) + if err != nil { + return settings, err + } + settings = *settingsPtr + switch name { + case types.PrivacySettingTypeGroupAdd: + settings.GroupAdd = value + case types.PrivacySettingTypeLastSeen: + settings.LastSeen = value + case types.PrivacySettingTypeStatus: + settings.Status = value + case types.PrivacySettingTypeProfile: + settings.Profile = value + case types.PrivacySettingTypeReadReceipts: + settings.ReadReceipts = value + case types.PrivacySettingTypeOnline: + settings.Online = value + case types.PrivacySettingTypeCallAdd: + settings.CallAdd = value + } + cli.privacySettingsCache.Store(&settings) + return +} + +// SetDefaultDisappearingTimer will set the default disappearing message timer. +func (cli *Client) SetDefaultDisappearingTimer(timer time.Duration) (err error) { + _, err = cli.sendIQ(infoQuery{ + Namespace: "disappearing_mode", + Type: iqSet, + To: types.ServerJID, + Content: []waBinary.Node{{ + Tag: "disappearing_mode", + Attrs: waBinary.Attrs{ + "duration": strconv.Itoa(int(timer.Seconds())), + }, + }}, + }) + return +} + func (cli *Client) parsePrivacySettings(privacyNode *waBinary.Node, settings *types.PrivacySettings) *events.PrivacySettings { var evt events.PrivacySettings for _, child := range privacyNode.GetChildren() { @@ -55,24 +121,30 @@ func (cli *Client) parsePrivacySettings(privacyNode *waBinary.Node, settings *ty continue } ag := child.AttrGetter() - name := ag.String("name") + name := types.PrivacySettingType(ag.String("name")) value := types.PrivacySetting(ag.String("value")) switch name { - case "groupadd": + case types.PrivacySettingTypeGroupAdd: settings.GroupAdd = value evt.GroupAddChanged = true - case "last": + case types.PrivacySettingTypeLastSeen: settings.LastSeen = value evt.LastSeenChanged = true - case "status": + case types.PrivacySettingTypeStatus: settings.Status = value evt.StatusChanged = true - case "profile": + case types.PrivacySettingTypeProfile: settings.Profile = value evt.ProfileChanged = true - case "readreceipts": + case types.PrivacySettingTypeReadReceipts: settings.ReadReceipts = value evt.ReadReceiptsChanged = true + case types.PrivacySettingTypeOnline: + settings.Online = value + evt.OnlineChanged = true + case types.PrivacySettingTypeCallAdd: + settings.CallAdd = value + evt.CallAddChanged = true } } return &evt diff --git a/vendor/go.mau.fi/whatsmeow/receipt.go b/vendor/go.mau.fi/whatsmeow/receipt.go index d9cf125b..a6fdf0e2 100644 --- a/vendor/go.mau.fi/whatsmeow/receipt.go +++ b/vendor/go.mau.fi/whatsmeow/receipt.go @@ -21,7 +21,7 @@ func (cli *Client) handleReceipt(node *waBinary.Node) { if err != nil { cli.Log.Warnf("Failed to parse receipt: %v", err) } else if receipt != nil { - if receipt.Type == events.ReceiptTypeRetry { + if receipt.Type == types.ReceiptTypeRetry { go func() { err := cli.handleRetryReceipt(receipt, node) if err != nil { @@ -63,7 +63,7 @@ func (cli *Client) parseReceipt(node *waBinary.Node) (*events.Receipt, error) { receipt := events.Receipt{ MessageSource: source, Timestamp: ag.UnixTime("t"), - Type: events.ReceiptType(ag.OptionalString("type")), + Type: types.ReceiptType(ag.OptionalString("type")), } if source.IsGroup && source.Sender.IsEmpty() { participantTags := node.GetChildrenByTag("participants") @@ -127,18 +127,34 @@ func (cli *Client) sendAck(node *waBinary.Node) { // // You can mark multiple messages as read at the same time, but only if the messages were sent by the same user. // To mark messages by different users as read, you must call MarkRead multiple times (once for each user). -func (cli *Client) MarkRead(ids []types.MessageID, timestamp time.Time, chat, sender types.JID) error { +// +// To mark a voice message as played, specify types.ReceiptTypePlayed as the last parameter. +// Providing more than one receipt type will panic: the parameter is only a vararg for backwards compatibility. +func (cli *Client) MarkRead(ids []types.MessageID, timestamp time.Time, chat, sender types.JID, receiptTypeExtra ...types.ReceiptType) error { + if len(ids) == 0 { + return fmt.Errorf("no message IDs specified") + } + receiptType := types.ReceiptTypeRead + if len(receiptTypeExtra) == 1 { + receiptType = receiptTypeExtra[0] + } else if len(receiptTypeExtra) > 1 { + panic(fmt.Errorf("too many receipt types specified")) + } node := waBinary.Node{ Tag: "receipt", Attrs: waBinary.Attrs{ "id": ids[0], - "type": "read", + "type": string(receiptType), "to": chat, "t": timestamp.Unix(), }, } if chat.Server == types.NewsletterServer || cli.GetPrivacySettings().ReadReceipts == types.PrivacySettingNone { - node.Attrs["type"] = "read-self" + switch receiptType { + case types.ReceiptTypeRead: + node.Attrs["type"] = string(types.ReceiptTypeReadSelf) + // TODO change played to played-self? + } } if !sender.IsEmpty() && chat.Server != types.DefaultUserServer { node.Attrs["participant"] = sender.ToNonAD() @@ -185,9 +201,9 @@ func (cli *Client) sendMessageReceipt(info *types.MessageInfo) { "id": info.ID, } if info.IsFromMe { - attrs["type"] = "sender" + attrs["type"] = string(types.ReceiptTypeSender) } else if atomic.LoadUint32(&cli.sendActiveReceipts) == 0 { - attrs["type"] = "inactive" + attrs["type"] = string(types.ReceiptTypeInactive) } attrs["to"] = info.Chat if info.IsGroup { diff --git a/vendor/go.mau.fi/whatsmeow/request.go b/vendor/go.mau.fi/whatsmeow/request.go index 6945fd7b..9a679e24 100644 --- a/vendor/go.mau.fi/whatsmeow/request.go +++ b/vendor/go.mau.fi/whatsmeow/request.go @@ -139,13 +139,15 @@ func (cli *Client) sendIQAsync(query infoQuery) (<-chan *waBinary.Node, error) { return ch, err } +const defaultRequestTimeout = 75 * time.Second + func (cli *Client) sendIQ(query infoQuery) (*waBinary.Node, error) { resChan, data, err := cli.sendIQAsyncAndGetData(&query) if err != nil { return nil, err } if query.Timeout == 0 { - query.Timeout = 75 * time.Second + query.Timeout = defaultRequestTimeout } if query.Context == nil { query.Context = context.Background() diff --git a/vendor/go.mau.fi/whatsmeow/send.go b/vendor/go.mau.fi/whatsmeow/send.go index 3bbb777d..e5337e57 100644 --- a/vendor/go.mau.fi/whatsmeow/send.go +++ b/vendor/go.mau.fi/whatsmeow/send.go @@ -104,6 +104,12 @@ type SendRequestExtra struct { ID types.MessageID // Should the message be sent as a peer message (protocol messages to your own devices, e.g. app state key requests) Peer bool + // A timeout for the send request. Unlike timeouts using the context parameter, this only applies + // to the actual response waiting and not preparing/encrypting the message. + // Defaults to 75 seconds. The timeout can be disabled by using a negative value. + Timeout time.Duration + // When sending media to newsletters, the Handle field returned by the file upload. + MediaHandle string } // SendMessage sends the given message. @@ -148,6 +154,9 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waPro return } + if req.Timeout == 0 { + req.Timeout = defaultRequestTimeout + } if len(req.ID) == 0 { req.ID = cli.GenerateMessageID() } @@ -192,7 +201,7 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waPro data, err = cli.sendDM(ctx, to, ownID, req.ID, message, &resp.DebugTimings) } case types.NewsletterServer: - data, err = cli.sendNewsletter(to, req.ID, message, &resp.DebugTimings) + data, err = cli.sendNewsletter(to, req.ID, message, req.MediaHandle, &resp.DebugTimings) default: err = fmt.Errorf("%w %s", ErrUnknownServer, to.Server) } @@ -202,9 +211,20 @@ func (cli *Client) SendMessage(ctx context.Context, to types.JID, message *waPro return } var respNode *waBinary.Node + var timeoutChan <-chan time.Time + if req.Timeout > 0 { + timeoutChan = time.After(req.Timeout) + } else { + timeoutChan = make(<-chan time.Time) + } select { case respNode = <-respChan: + case <-timeoutChan: + cli.cancelResponse(req.ID, respChan) + err = ErrMessageTimedOut + return case <-ctx.Done(): + cli.cancelResponse(req.ID, respChan) err = ctx.Err() return } @@ -440,12 +460,15 @@ func participantListHashV2(participants []types.JID) string { return fmt.Sprintf("2:%s", base64.RawStdEncoding.EncodeToString(hash[:6])) } -func (cli *Client) sendNewsletter(to types.JID, id types.MessageID, message *waProto.Message, timings *MessageDebugTimings) ([]byte, error) { +func (cli *Client) sendNewsletter(to types.JID, id types.MessageID, message *waProto.Message, mediaID string, timings *MessageDebugTimings) ([]byte, error) { attrs := waBinary.Attrs{ "to": to, "id": id, "type": getTypeFromMessage(message), } + if mediaID != "" { + attrs["media_id"] = mediaID + } if message.EditedMessage != nil { attrs["edit"] = string(types.EditAttributeAdminEdit) message = message.GetEditedMessage().GetMessage().GetProtocolMessage().GetEditedMessage() @@ -459,13 +482,18 @@ func (cli *Client) sendNewsletter(to types.JID, id types.MessageID, message *waP if err != nil { return nil, err } + plaintextNode := waBinary.Node{ + Tag: "plaintext", + Content: plaintext, + Attrs: waBinary.Attrs{}, + } + if mediaType := getMediaTypeFromMessage(message); mediaType != "" { + plaintextNode.Attrs["mediatype"] = mediaType + } node := waBinary.Node{ - Tag: "message", - Attrs: attrs, - Content: []waBinary.Node{{ - Tag: "plaintext", - Content: plaintext, - }}, + Tag: "message", + Attrs: attrs, + Content: []waBinary.Node{plaintextNode}, } start = time.Now() data, err := cli.sendNodeAndGetData(node) @@ -817,7 +845,7 @@ func (cli *Client) prepareMessageNode(ctx context.Context, to, ownID types.JID, attrs["edit"] = string(editAttr) encAttrs["decrypt-fail"] = string(events.DecryptFailHide) } - if msgType == "reaction" { + if msgType == "reaction" || message.GetPollUpdateMessage() != nil { encAttrs["decrypt-fail"] = string(events.DecryptFailHide) } diff --git a/vendor/go.mau.fi/whatsmeow/store/clientpayload.go b/vendor/go.mau.fi/whatsmeow/store/clientpayload.go index 905be2ff..62dcf529 100644 --- a/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +++ b/vendor/go.mau.fi/whatsmeow/store/clientpayload.go @@ -74,7 +74,7 @@ func (vc WAVersionContainer) ProtoAppVersion() *waProto.ClientPayload_UserAgent_ } // waVersion is the WhatsApp web client version -var waVersion = WAVersionContainer{2, 2350, 1} +var waVersion = WAVersionContainer{2, 2353, 59} // waVersionHash is the md5 hash of a dot-separated waVersion var waVersionHash [16]byte diff --git a/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go b/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go index a2875dd3..082f9063 100644 --- a/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +++ b/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go @@ -220,6 +220,14 @@ func (c *Container) NewDevice() *store.Device { // ErrDeviceIDMustBeSet is the error returned by PutDevice if you try to save a device before knowing its JID. var ErrDeviceIDMustBeSet = errors.New("device JID must be known before accessing database") +// Close will close the container's database +func (c *Container) Close() error { + if c != nil && c.db != nil { + return c.db.Close() + } + return nil +} + // PutDevice stores the given device in this database. This should be called through Device.Save() // (which usually doesn't need to be called manually, as the library does that automatically when relevant). func (c *Container) PutDevice(device *store.Device) error { diff --git a/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go b/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go index df45917b..14582877 100644 --- a/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go +++ b/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrade.go @@ -44,6 +44,16 @@ func (c *Container) setVersion(tx *sql.Tx, version int) error { // Upgrade upgrades the database from the current to the latest version available. func (c *Container) Upgrade() error { + if c.dialect == "sqlite" { + var foreignKeysEnabled bool + err := c.db.QueryRow("PRAGMA foreign_keys").Scan(&foreignKeysEnabled) + if err != nil { + return fmt.Errorf("failed to check if foreign keys are enabled: %w", err) + } else if !foreignKeysEnabled { + return fmt.Errorf("foreign keys are not enabled") + } + } + version, err := c.getVersion() if err != nil { return err @@ -274,15 +284,6 @@ func upgradeV4(tx *sql.Tx, container *Container) error { } func upgradeV5(tx *sql.Tx, container *Container) error { - if container.dialect == "sqlite" { - var foreignKeysEnabled bool - err := tx.QueryRow("PRAGMA foreign_keys").Scan(&foreignKeysEnabled) - if err != nil { - return fmt.Errorf("failed to check if foreign keys are enabled: %w", err) - } else if !foreignKeysEnabled { - return fmt.Errorf("foreign keys are not enabled") - } - } _, err := tx.Exec("UPDATE whatsmeow_device SET jid=REPLACE(jid, '.0', '')") return err } diff --git a/vendor/go.mau.fi/whatsmeow/types/events/appstate.go b/vendor/go.mau.fi/whatsmeow/types/events/appstate.go index 285e546b..9cf59460 100644 --- a/vendor/go.mau.fi/whatsmeow/types/events/appstate.go +++ b/vendor/go.mau.fi/whatsmeow/types/events/appstate.go @@ -142,6 +142,36 @@ type UserStatusMute struct { FromFullSync bool // Whether the action is emitted because of a fullSync } +// LabelEdit is emitted when a label is edited from any device. +type LabelEdit struct { + Timestamp time.Time // The time when the label was edited. + LabelID string // The label id which was edited. + + Action *waProto.LabelEditAction // The new label info. + FromFullSync bool // Whether the action is emitted because of a fullSync +} + +// LabelAssociationChat is emitted when a chat is labeled or unlabeled from any device. +type LabelAssociationChat struct { + JID types.JID // The chat which was labeled or unlabeled. + Timestamp time.Time // The time when the (un)labeling happened. + LabelID string // The label id which was added or removed. + + Action *waProto.LabelAssociationAction // The current label status of the chat. + FromFullSync bool // Whether the action is emitted because of a fullSync +} + +// LabelAssociationMessage is emitted when a message is labeled or unlabeled from any device. +type LabelAssociationMessage struct { + JID types.JID // The chat which was labeled or unlabeled. + Timestamp time.Time // The time when the (un)labeling happened. + LabelID string // The label id which was added or removed. + MessageID string // The message id which was labeled or unlabeled. + + Action *waProto.LabelAssociationAction // The current label status of the message. + FromFullSync bool // Whether the action is emitted because of a fullSync +} + // AppState is emitted directly for new data received from app state syncing. // You should generally use the higher-level events like events.Contact and events.Mute. type AppState struct { diff --git a/vendor/go.mau.fi/whatsmeow/types/events/call.go b/vendor/go.mau.fi/whatsmeow/types/events/call.go index 3622cb53..8ced457c 100644 --- a/vendor/go.mau.fi/whatsmeow/types/events/call.go +++ b/vendor/go.mau.fi/whatsmeow/types/events/call.go @@ -27,6 +27,20 @@ type CallAccept struct { Data *waBinary.Node } +type CallPreAccept struct { + types.BasicCallMeta + types.CallRemoteMeta + + Data *waBinary.Node +} + +type CallTransport struct { + types.BasicCallMeta + types.CallRemoteMeta + + Data *waBinary.Node +} + // CallOfferNotice is emitted when the user receives a notice of a call on WhatsApp. // This seems to be primarily for group calls (whereas CallOffer is for 1:1 calls). type CallOfferNotice struct { diff --git a/vendor/go.mau.fi/whatsmeow/types/events/events.go b/vendor/go.mau.fi/whatsmeow/types/events/events.go index 8ee4e7b0..7f0cc256 100644 --- a/vendor/go.mau.fi/whatsmeow/types/events/events.go +++ b/vendor/go.mau.fi/whatsmeow/types/events/events.go @@ -288,44 +288,19 @@ func (evt *Message) UnwrapRaw() *Message { return evt } -// ReceiptType represents the type of a Receipt event. -type ReceiptType string +// Deprecated: use types.ReceiptType directly +type ReceiptType = types.ReceiptType +// Deprecated: use types.ReceiptType* constants directly const ( - // ReceiptTypeDelivered means the message was delivered to the device (but the user might not have noticed). - ReceiptTypeDelivered ReceiptType = "" - // ReceiptTypeSender is sent by your other devices when a message you sent is delivered to them. - ReceiptTypeSender ReceiptType = "sender" - // ReceiptTypeRetry means the message was delivered to the device, but decrypting the message failed. - ReceiptTypeRetry ReceiptType = "retry" - // ReceiptTypeRead means the user opened the chat and saw the message. - ReceiptTypeRead ReceiptType = "read" - // ReceiptTypeReadSelf means the current user read a message from a different device, and has read receipts disabled in privacy settings. - ReceiptTypeReadSelf ReceiptType = "read-self" - // ReceiptTypePlayed means the user opened a view-once media message. - // - // This is dispatched for both incoming and outgoing messages when played. If the current user opened the media, - // it means the media should be removed from all devices. If a recipient opened the media, it's just a notification - // for the sender that the media was viewed. - ReceiptTypePlayed ReceiptType = "played" + ReceiptTypeDelivered = types.ReceiptTypeDelivered + ReceiptTypeSender = types.ReceiptTypeSender + ReceiptTypeRetry = types.ReceiptTypeRetry + ReceiptTypeRead = types.ReceiptTypeRead + ReceiptTypeReadSelf = types.ReceiptTypeReadSelf + ReceiptTypePlayed = types.ReceiptTypePlayed ) -// GoString returns the name of the Go constant for the ReceiptType value. -func (rt ReceiptType) GoString() string { - switch rt { - case ReceiptTypeRead: - return "events.ReceiptTypeRead" - case ReceiptTypeReadSelf: - return "events.ReceiptTypeReadSelf" - case ReceiptTypeDelivered: - return "events.ReceiptTypeDelivered" - case ReceiptTypePlayed: - return "events.ReceiptTypePlayed" - default: - return fmt.Sprintf("events.ReceiptType(%#v)", string(rt)) - } -} - // Receipt is emitted when an outgoing message is delivered to or read by another user, or when another device reads an incoming message. // // N.B. WhatsApp on Android sends message IDs from newest message to oldest, but WhatsApp on iOS sends them in the opposite order (oldest first). @@ -333,7 +308,7 @@ type Receipt struct { types.MessageSource MessageIDs []types.MessageID Timestamp time.Time - Type ReceiptType + Type types.ReceiptType } // ChatPresence is emitted when a chat state update (also known as typing notification) is received. @@ -432,6 +407,8 @@ type PrivacySettings struct { StatusChanged bool ProfileChanged bool ReadReceiptsChanged bool + OnlineChanged bool + CallAddChanged bool } // OfflineSyncPreview is emitted right after connecting if the server is going to send events that the client missed during downtime. diff --git a/vendor/go.mau.fi/whatsmeow/types/presence.go b/vendor/go.mau.fi/whatsmeow/types/presence.go index a59f7426..f87da1f8 100644 --- a/vendor/go.mau.fi/whatsmeow/types/presence.go +++ b/vendor/go.mau.fi/whatsmeow/types/presence.go @@ -6,6 +6,10 @@ package types +import ( + "fmt" +) + type Presence string const ( @@ -26,3 +30,49 @@ const ( ChatPresenceMediaText ChatPresenceMedia = "" ChatPresenceMediaAudio ChatPresenceMedia = "audio" ) + +// ReceiptType represents the type of a Receipt event. +type ReceiptType string + +const ( + // ReceiptTypeDelivered means the message was delivered to the device (but the user might not have noticed). + ReceiptTypeDelivered ReceiptType = "" + // ReceiptTypeSender is sent by your other devices when a message you sent is delivered to them. + ReceiptTypeSender ReceiptType = "sender" + // ReceiptTypeRetry means the message was delivered to the device, but decrypting the message failed. + ReceiptTypeRetry ReceiptType = "retry" + // ReceiptTypeRead means the user opened the chat and saw the message. + ReceiptTypeRead ReceiptType = "read" + // ReceiptTypeReadSelf means the current user read a message from a different device, and has read receipts disabled in privacy settings. + ReceiptTypeReadSelf ReceiptType = "read-self" + // ReceiptTypePlayed means the user opened a view-once media message. + // + // This is dispatched for both incoming and outgoing messages when played. If the current user opened the media, + // it means the media should be removed from all devices. If a recipient opened the media, it's just a notification + // for the sender that the media was viewed. + ReceiptTypePlayed ReceiptType = "played" + // ReceiptTypePlayedSelf probably means the current user opened a view-once media message from a different device, + // and has read receipts disabled in privacy settings. + ReceiptTypePlayedSelf ReceiptType = "played-self" + + ReceiptTypeServerError ReceiptType = "server-error" + ReceiptTypeInactive ReceiptType = "inactive" + ReceiptTypePeerMsg ReceiptType = "peer_msg" + ReceiptTypeHistorySync ReceiptType = "hist_sync" +) + +// GoString returns the name of the Go constant for the ReceiptType value. +func (rt ReceiptType) GoString() string { + switch rt { + case ReceiptTypeRead: + return "types.ReceiptTypeRead" + case ReceiptTypeReadSelf: + return "types.ReceiptTypeReadSelf" + case ReceiptTypeDelivered: + return "types.ReceiptTypeDelivered" + case ReceiptTypePlayed: + return "types.ReceiptTypePlayed" + default: + return fmt.Sprintf("types.ReceiptType(%#v)", string(rt)) + } +} diff --git a/vendor/go.mau.fi/whatsmeow/types/user.go b/vendor/go.mau.fi/whatsmeow/types/user.go index 3b6f37d5..518dab03 100644 --- a/vendor/go.mau.fi/whatsmeow/types/user.go +++ b/vendor/go.mau.fi/whatsmeow/types/user.go @@ -87,19 +87,37 @@ type PrivacySetting string // Possible privacy setting values. const ( - PrivacySettingUndefined PrivacySetting = "" - PrivacySettingAll PrivacySetting = "all" - PrivacySettingContacts PrivacySetting = "contacts" - PrivacySettingNone PrivacySetting = "none" + PrivacySettingUndefined PrivacySetting = "" + PrivacySettingAll PrivacySetting = "all" + PrivacySettingContacts PrivacySetting = "contacts" + PrivacySettingContactBlacklist PrivacySetting = "contact_blacklist" + PrivacySettingMatchLastSeen PrivacySetting = "match_last_seen" + PrivacySettingKnown PrivacySetting = "known" + PrivacySettingNone PrivacySetting = "none" +) + +// PrivacySettingType is the type of privacy setting. +type PrivacySettingType string + +const ( + PrivacySettingTypeGroupAdd PrivacySettingType = "groupadd" // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + PrivacySettingTypeLastSeen PrivacySettingType = "last" // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + PrivacySettingTypeStatus PrivacySettingType = "status" // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + PrivacySettingTypeProfile PrivacySettingType = "profile" // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + PrivacySettingTypeReadReceipts PrivacySettingType = "readreceipts" // Valid values: PrivacySettingAll, PrivacySettingNone + PrivacySettingTypeOnline PrivacySettingType = "online" // Valid values: PrivacySettingAll, PrivacySettingMatchLastSeen + PrivacySettingTypeCallAdd PrivacySettingType = "calladd" // Valid values: PrivacySettingAll, PrivacySettingKnown ) // PrivacySettings contains the user's privacy settings. type PrivacySettings struct { - GroupAdd PrivacySetting - LastSeen PrivacySetting - Status PrivacySetting - Profile PrivacySetting - ReadReceipts PrivacySetting + GroupAdd PrivacySetting // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + LastSeen PrivacySetting // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + Status PrivacySetting // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + Profile PrivacySetting // Valid values: PrivacySettingAll, PrivacySettingContacts, PrivacySettingContactBlacklist, PrivacySettingNone + ReadReceipts PrivacySetting // Valid values: PrivacySettingAll, PrivacySettingNone + CallAdd PrivacySetting // Valid values: PrivacySettingAll, PrivacySettingKnown + Online PrivacySetting // Valid values: PrivacySettingAll, PrivacySettingMatchLastSeen } // StatusPrivacyType is the type of list in StatusPrivacy. diff --git a/vendor/go.mau.fi/whatsmeow/upload.go b/vendor/go.mau.fi/whatsmeow/upload.go index d3539c0f..2f6c7cec 100644 --- a/vendor/go.mau.fi/whatsmeow/upload.go +++ b/vendor/go.mau.fi/whatsmeow/upload.go @@ -27,6 +27,7 @@ import ( type UploadResponse struct { URL string `json:"url"` DirectPath string `json:"direct_path"` + Handle string `json:"handle"` MediaKey []byte `json:"-"` FileEncSHA256 []byte `json:"-"` @@ -82,41 +83,85 @@ func (cli *Client) Upload(ctx context.Context, plaintext []byte, appInfo MediaTy h.Write(ciphertext) dataToUpload := append(ciphertext, h.Sum(nil)[:10]...) - fileEncSHA256 := sha256.Sum256(dataToUpload) - resp.FileEncSHA256 = fileEncSHA256[:] + dataHash := sha256.Sum256(dataToUpload) + resp.FileEncSHA256 = dataHash[:] - var mediaConn *MediaConn - mediaConn, err = cli.refreshMediaConn(false) + err = cli.rawUpload(ctx, dataToUpload, resp.FileEncSHA256, appInfo, false, &resp) + return +} + +// UploadNewsletter uploads the given attachment to WhatsApp servers without encrypting it first. +// +// Newsletter media works mostly the same way as normal media, with a few differences: +// * Since it's unencrypted, there's no MediaKey or FileEncSha256 fields. +// * There's a "media handle" that needs to be passed in SendRequestExtra. +// +// Example: +// +// resp, err := cli.UploadNewsletter(context.Background(), yourImageBytes, whatsmeow.MediaImage) +// // handle error +// +// imageMsg := &waProto.ImageMessage{ +// // Caption, mime type and other such fields work like normal +// Caption: proto.String("Hello, world!"), +// Mimetype: proto.String("image/png"), +// +// // URL and direct path are also there like normal media +// Url: &resp.URL, +// DirectPath: &resp.DirectPath, +// FileSha256: resp.FileSha256, +// FileLength: &resp.FileLength, +// // Newsletter media isn't encrypted, so the media key and file enc sha fields are not applicable +// } +// _, err = cli.SendMessage(context.Background(), newsletterJID, &waProto.Message{ +// ImageMessage: imageMsg, +// }, whatsmeow.SendRequestExtra{ +// // Unlike normal media, newsletters also include a "media handle" in the send request. +// MediaHandle: resp.Handle, +// }) +// // handle error again + +func (cli *Client) UploadNewsletter(ctx context.Context, data []byte, appInfo MediaType) (resp UploadResponse, err error) { + resp.FileLength = uint64(len(data)) + hash := sha256.Sum256(data) + resp.FileSHA256 = hash[:] + err = cli.rawUpload(ctx, data, resp.FileSHA256, appInfo, true, &resp) + return +} + +func (cli *Client) rawUpload(ctx context.Context, dataToUpload, fileHash []byte, appInfo MediaType, newsletter bool, resp *UploadResponse) error { + mediaConn, err := cli.refreshMediaConn(false) if err != nil { - err = fmt.Errorf("failed to refresh media connections: %w", err) - return + return fmt.Errorf("failed to refresh media connections: %w", err) } - token := base64.URLEncoding.EncodeToString(resp.FileEncSHA256) + token := base64.URLEncoding.EncodeToString(fileHash) q := url.Values{ "auth": []string{mediaConn.Auth}, "token": []string{token}, } mmsType := mediaTypeToMMSType[appInfo] + uploadPrefix := "mms" + if newsletter { + mmsType = fmt.Sprintf("newsletter-%s", mmsType) + uploadPrefix = "newsletter" + } uploadURL := url.URL{ Scheme: "https", Host: mediaConn.Hosts[0].Hostname, - Path: fmt.Sprintf("/mms/%s/%s", mmsType, token), + Path: fmt.Sprintf("/%s/%s/%s", uploadPrefix, mmsType, token), RawQuery: q.Encode(), } - var req *http.Request - req, err = http.NewRequestWithContext(ctx, http.MethodPost, uploadURL.String(), bytes.NewReader(dataToUpload)) + req, err := http.NewRequestWithContext(ctx, http.MethodPost, uploadURL.String(), bytes.NewReader(dataToUpload)) if err != nil { - err = fmt.Errorf("failed to prepare request: %w", err) - return + return fmt.Errorf("failed to prepare request: %w", err) } req.Header.Set("Origin", socket.Origin) req.Header.Set("Referer", socket.Origin+"/") - var httpResp *http.Response - httpResp, err = cli.http.Do(req) + httpResp, err := cli.http.Do(req) if err != nil { err = fmt.Errorf("failed to execute request: %w", err) } else if httpResp.StatusCode != http.StatusOK { @@ -127,5 +172,5 @@ func (cli *Client) Upload(ctx context.Context, plaintext []byte, appInfo MediaTy if httpResp != nil { _ = httpResp.Body.Close() } - return + return err } diff --git a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s index f3b653a1..6713acca 100644 --- a/vendor/golang.org/x/crypto/argon2/blamka_amd64.s +++ b/vendor/golang.org/x/crypto/argon2/blamka_amd64.s @@ -199,8 +199,8 @@ TEXT ·mixBlocksSSE2(SB), 4, $0-32 MOVQ out+0(FP), DX MOVQ a+8(FP), AX MOVQ b+16(FP), BX - MOVQ a+24(FP), CX - MOVQ $128, BP + MOVQ c+24(FP), CX + MOVQ $128, DI loop: MOVOU 0(AX), X0 @@ -213,7 +213,7 @@ loop: ADDQ $16, BX ADDQ $16, CX ADDQ $16, DX - SUBQ $2, BP + SUBQ $2, DI JA loop RET @@ -222,8 +222,8 @@ TEXT ·xorBlocksSSE2(SB), 4, $0-32 MOVQ out+0(FP), DX MOVQ a+8(FP), AX MOVQ b+16(FP), BX - MOVQ a+24(FP), CX - MOVQ $128, BP + MOVQ c+24(FP), CX + MOVQ $128, DI loop: MOVOU 0(AX), X0 @@ -238,6 +238,6 @@ loop: ADDQ $16, BX ADDQ $16, CX ADDQ $16, DX - SUBQ $2, BP + SUBQ $2, DI JA loop RET diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go index 4f506f87..199c21d2 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.7 && amd64 && gc && !purego +//go:build amd64 && gc && !purego package blake2b diff --git a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s index 353bb7ca..9ae8206c 100644 --- a/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s +++ b/vendor/golang.org/x/crypto/blake2b/blake2bAVX2_amd64.s @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.7 && amd64 && gc && !purego +//go:build amd64 && gc && !purego #include "textflag.h" diff --git a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go b/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go deleted file mode 100644 index 1d0770ab..00000000 --- a/vendor/golang.org/x/crypto/blake2b/blake2b_amd64.go +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build !go1.7 && amd64 && gc && !purego - -package blake2b - -import "golang.org/x/sys/cpu" - -func init() { - useSSE4 = cpu.X86.HasSSE41 -} - -//go:noescape -func hashBlocksSSE4(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) - -func hashBlocks(h *[8]uint64, c *[2]uint64, flag uint64, blocks []byte) { - if useSSE4 { - hashBlocksSSE4(h, c, flag, blocks) - } else { - hashBlocksGeneric(h, c, flag, blocks) - } -} diff --git a/vendor/golang.org/x/crypto/blake2b/register.go b/vendor/golang.org/x/crypto/blake2b/register.go index d9fcac3a..54e446e1 100644 --- a/vendor/golang.org/x/crypto/blake2b/register.go +++ b/vendor/golang.org/x/crypto/blake2b/register.go @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build go1.9 - package blake2b import ( diff --git a/vendor/golang.org/x/sys/unix/fcntl.go b/vendor/golang.org/x/sys/unix/fcntl.go index 58c6bfc7..6200876f 100644 --- a/vendor/golang.org/x/sys/unix/fcntl.go +++ b/vendor/golang.org/x/sys/unix/fcntl.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build dragonfly || freebsd || linux || netbsd || openbsd +//go:build dragonfly || freebsd || linux || netbsd package unix diff --git a/vendor/golang.org/x/sys/unix/ioctl_linux.go b/vendor/golang.org/x/sys/unix/ioctl_linux.go index 0d12c085..dbe680ea 100644 --- a/vendor/golang.org/x/sys/unix/ioctl_linux.go +++ b/vendor/golang.org/x/sys/unix/ioctl_linux.go @@ -231,3 +231,8 @@ func IoctlLoopGetStatus64(fd int) (*LoopInfo64, error) { func IoctlLoopSetStatus64(fd int, value *LoopInfo64) error { return ioctlPtr(fd, LOOP_SET_STATUS64, unsafe.Pointer(value)) } + +// IoctlLoopConfigure configures all loop device parameters in a single step +func IoctlLoopConfigure(fd int, value *LoopConfig) error { + return ioctlPtr(fd, LOOP_CONFIGURE, unsafe.Pointer(value)) +} diff --git a/vendor/golang.org/x/sys/unix/mkerrors.sh b/vendor/golang.org/x/sys/unix/mkerrors.sh index cbe24150..6202638b 100644 --- a/vendor/golang.org/x/sys/unix/mkerrors.sh +++ b/vendor/golang.org/x/sys/unix/mkerrors.sh @@ -519,6 +519,7 @@ ccflags="$@" $2 ~ /^LOCK_(SH|EX|NB|UN)$/ || $2 ~ /^LO_(KEY|NAME)_SIZE$/ || $2 ~ /^LOOP_(CLR|CTL|GET|SET)_/ || + $2 == "LOOP_CONFIGURE" || $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|TCP|MCAST|EVFILT|NOTE|SHUT|PROT|MAP|MREMAP|MFD|T?PACKET|MSG|SCM|MCL|DT|MADV|PR|LOCAL|TCPOPT|UDP)_/ || $2 ~ /^NFC_(GENL|PROTO|COMM|RF|SE|DIRECTION|LLCP|SOCKPROTO)_/ || $2 ~ /^NFC_.*_(MAX)?SIZE$/ || @@ -560,7 +561,7 @@ ccflags="$@" $2 ~ /^RLIMIT_(AS|CORE|CPU|DATA|FSIZE|LOCKS|MEMLOCK|MSGQUEUE|NICE|NOFILE|NPROC|RSS|RTPRIO|RTTIME|SIGPENDING|STACK)|RLIM_INFINITY/ || $2 ~ /^PRIO_(PROCESS|PGRP|USER)/ || $2 ~ /^CLONE_[A-Z_]+/ || - $2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+)$/ && + $2 !~ /^(BPF_TIMEVAL|BPF_FIB_LOOKUP_[A-Z]+|BPF_F_LINK)$/ && $2 ~ /^(BPF|DLT)_/ || $2 ~ /^AUDIT_/ || $2 ~ /^(CLOCK|TIMER)_/ || diff --git a/vendor/golang.org/x/sys/unix/syscall_bsd.go b/vendor/golang.org/x/sys/unix/syscall_bsd.go index 6f328e3a..a00c3e54 100644 --- a/vendor/golang.org/x/sys/unix/syscall_bsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_bsd.go @@ -316,7 +316,7 @@ func GetsockoptString(fd, level, opt int) (string, error) { if err != nil { return "", err } - return string(buf[:vallen-1]), nil + return ByteSliceToString(buf[:vallen]), nil } //sys recvfrom(fd int, p []byte, flags int, from *RawSockaddrAny, fromlen *_Socklen) (n int, err error) diff --git a/vendor/golang.org/x/sys/unix/syscall_linux.go b/vendor/golang.org/x/sys/unix/syscall_linux.go index a5e1c10e..0f85e29e 100644 --- a/vendor/golang.org/x/sys/unix/syscall_linux.go +++ b/vendor/golang.org/x/sys/unix/syscall_linux.go @@ -61,15 +61,23 @@ func FanotifyMark(fd int, flags uint, mask uint64, dirFd int, pathname string) ( } //sys fchmodat(dirfd int, path string, mode uint32) (err error) +//sys fchmodat2(dirfd int, path string, mode uint32, flags int) (err error) -func Fchmodat(dirfd int, path string, mode uint32, flags int) (err error) { - // Linux fchmodat doesn't support the flags parameter. Mimick glibc's behavior - // and check the flags. Otherwise the mode would be applied to the symlink - // destination which is not what the user expects. - if flags&^AT_SYMLINK_NOFOLLOW != 0 { - return EINVAL - } else if flags&AT_SYMLINK_NOFOLLOW != 0 { - return EOPNOTSUPP +func Fchmodat(dirfd int, path string, mode uint32, flags int) error { + // Linux fchmodat doesn't support the flags parameter, but fchmodat2 does. + // Try fchmodat2 if flags are specified. + if flags != 0 { + err := fchmodat2(dirfd, path, mode, flags) + if err == ENOSYS { + // fchmodat2 isn't available. If the flags are known to be valid, + // return EOPNOTSUPP to indicate that fchmodat doesn't support them. + if flags&^(AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) != 0 { + return EINVAL + } else if flags&(AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) != 0 { + return EOPNOTSUPP + } + } + return err } return fchmodat(dirfd, path, mode) } @@ -1302,7 +1310,7 @@ func GetsockoptString(fd, level, opt int) (string, error) { return "", err } } - return string(buf[:vallen-1]), nil + return ByteSliceToString(buf[:vallen]), nil } func GetsockoptTpacketStats(fd, level, opt int) (*TpacketStats, error) { diff --git a/vendor/golang.org/x/sys/unix/syscall_openbsd.go b/vendor/golang.org/x/sys/unix/syscall_openbsd.go index d2882ee0..b25343c7 100644 --- a/vendor/golang.org/x/sys/unix/syscall_openbsd.go +++ b/vendor/golang.org/x/sys/unix/syscall_openbsd.go @@ -166,6 +166,20 @@ func Getresgid() (rgid, egid, sgid int) { //sys sysctl(mib []_C_int, old *byte, oldlen *uintptr, new *byte, newlen uintptr) (err error) = SYS___SYSCTL +//sys fcntl(fd int, cmd int, arg int) (n int, err error) +//sys fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) = SYS_FCNTL + +// FcntlInt performs a fcntl syscall on fd with the provided command and argument. +func FcntlInt(fd uintptr, cmd, arg int) (int, error) { + return fcntl(int(fd), cmd, arg) +} + +// FcntlFlock performs a fcntl syscall for the F_GETLK, F_SETLK or F_SETLKW command. +func FcntlFlock(fd uintptr, cmd int, lk *Flock_t) error { + _, err := fcntlPtr(int(fd), cmd, unsafe.Pointer(lk)) + return err +} + //sys ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) func Ppoll(fds []PollFd, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { diff --git a/vendor/golang.org/x/sys/unix/syscall_solaris.go b/vendor/golang.org/x/sys/unix/syscall_solaris.go index 60c8142d..21974af0 100644 --- a/vendor/golang.org/x/sys/unix/syscall_solaris.go +++ b/vendor/golang.org/x/sys/unix/syscall_solaris.go @@ -158,7 +158,7 @@ func GetsockoptString(fd, level, opt int) (string, error) { if err != nil { return "", err } - return string(buf[:vallen-1]), nil + return ByteSliceToString(buf[:vallen]), nil } const ImplementsGetwd = true diff --git a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go index d99d05f1..b473038c 100644 --- a/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go +++ b/vendor/golang.org/x/sys/unix/syscall_zos_s390x.go @@ -1104,7 +1104,7 @@ func GetsockoptString(fd, level, opt int) (string, error) { return "", err } - return string(buf[:vallen-1]), nil + return ByteSliceToString(buf[:vallen]), nil } func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from Sockaddr, err error) { diff --git a/vendor/golang.org/x/sys/unix/zerrors_linux.go b/vendor/golang.org/x/sys/unix/zerrors_linux.go index 9c00cbf5..c73cfe2f 100644 --- a/vendor/golang.org/x/sys/unix/zerrors_linux.go +++ b/vendor/golang.org/x/sys/unix/zerrors_linux.go @@ -486,7 +486,6 @@ const ( BPF_F_ANY_ALIGNMENT = 0x2 BPF_F_BEFORE = 0x8 BPF_F_ID = 0x20 - BPF_F_LINK = 0x2000 BPF_F_NETFILTER_IP_DEFRAG = 0x1 BPF_F_QUERY_EFFECTIVE = 0x1 BPF_F_REPLACE = 0x4 @@ -1802,6 +1801,7 @@ const ( LOCK_SH = 0x1 LOCK_UN = 0x8 LOOP_CLR_FD = 0x4c01 + LOOP_CONFIGURE = 0x4c0a LOOP_CTL_ADD = 0x4c80 LOOP_CTL_GET_FREE = 0x4c82 LOOP_CTL_REMOVE = 0x4c81 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_linux.go b/vendor/golang.org/x/sys/unix/zsyscall_linux.go index faca7a55..1488d271 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_linux.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_linux.go @@ -37,6 +37,21 @@ func fchmodat(dirfd int, path string, mode uint32) (err error) { // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fchmodat2(dirfd int, path string, mode uint32, flags int) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := Syscall6(SYS_FCHMODAT2, uintptr(dirfd), uintptr(unsafe.Pointer(_p0)), uintptr(mode), uintptr(flags), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ioctl(fd int, req uint, arg uintptr) (err error) { _, _, e1 := Syscall(SYS_IOCTL, uintptr(fd), uintptr(req), uintptr(arg)) if e1 != 0 { diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go index 88bfc288..a1d06159 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.go @@ -584,6 +584,32 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_fcntl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fcntl fcntl "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s index 4cbeff17..41b56173 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s @@ -178,6 +178,11 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) +TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $4 +DATA ·libc_fcntl_trampoline_addr(SB)/4, $libc_fcntl_trampoline<>(SB) + TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go index b8a67b99..5b2a7409 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.go @@ -584,6 +584,32 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_fcntl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fcntl fcntl "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s index 1123f275..4019a656 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s @@ -178,6 +178,11 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) + TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go index af50a65c..f6eda134 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.go @@ -584,6 +584,32 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_fcntl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fcntl fcntl "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s index 82badae3..ac4af24f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s @@ -178,6 +178,11 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $4 DATA ·libc_sysctl_trampoline_addr(SB)/4, $libc_sysctl_trampoline<>(SB) +TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $4 +DATA ·libc_fcntl_trampoline_addr(SB)/4, $libc_fcntl_trampoline<>(SB) + TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $4 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go index 8fb4ff36..55df20ae 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.go @@ -584,6 +584,32 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_fcntl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fcntl fcntl "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s index 24d7eecb..f77d5321 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s @@ -178,6 +178,11 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) + TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go index f469a83e..8c1155cb 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.go @@ -584,6 +584,32 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_fcntl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fcntl fcntl "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s index 9a498a06..fae140b6 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_mips64.s @@ -178,6 +178,11 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) + TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go index c26ca2e1..7cc80c58 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.go @@ -584,6 +584,32 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_fcntl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fcntl fcntl "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s index 1f224aa4..9d1e0ff0 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_ppc64.s @@ -213,6 +213,12 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 + CALL libc_fcntl(SB) + RET +GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) + TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 CALL libc_ppoll(SB) RET diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go index bcc920dd..0688737f 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.go @@ -584,6 +584,32 @@ var libc_sysctl_trampoline_addr uintptr // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func fcntl(fd int, cmd int, arg int) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_fcntl_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_fcntl fcntl "libc.so" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func fcntlPtr(fd int, cmd int, arg unsafe.Pointer) (n int, err error) { + r0, _, e1 := syscall_syscall(libc_fcntl_trampoline_addr, uintptr(fd), uintptr(cmd), uintptr(arg)) + n = int(r0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func ppoll(fds *PollFd, nfds int, timeout *Timespec, sigmask *Sigset_t) (n int, err error) { r0, _, e1 := syscall_syscall6(libc_ppoll_trampoline_addr, uintptr(unsafe.Pointer(fds)), uintptr(nfds), uintptr(unsafe.Pointer(timeout)), uintptr(unsafe.Pointer(sigmask)), 0, 0) n = int(r0) diff --git a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s index 87a79c70..da115f9a 100644 --- a/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s +++ b/vendor/golang.org/x/sys/unix/zsyscall_openbsd_riscv64.s @@ -178,6 +178,11 @@ TEXT libc_sysctl_trampoline<>(SB),NOSPLIT,$0-0 GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_fcntl_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_fcntl(SB) +GLOBL ·libc_fcntl_trampoline_addr(SB), RODATA, $8 +DATA ·libc_fcntl_trampoline_addr(SB)/8, $libc_fcntl_trampoline<>(SB) + TEXT libc_ppoll_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_ppoll(SB) GLOBL ·libc_ppoll_trampoline_addr(SB), RODATA, $8 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index 997bcd55..bbf8399f 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -2671,6 +2671,7 @@ const ( BPF_PROG_TYPE_LSM = 0x1d BPF_PROG_TYPE_SK_LOOKUP = 0x1e BPF_PROG_TYPE_SYSCALL = 0x1f + BPF_PROG_TYPE_NETFILTER = 0x20 BPF_CGROUP_INET_INGRESS = 0x0 BPF_CGROUP_INET_EGRESS = 0x1 BPF_CGROUP_INET_SOCK_CREATE = 0x2 @@ -2715,6 +2716,11 @@ const ( BPF_PERF_EVENT = 0x29 BPF_TRACE_KPROBE_MULTI = 0x2a BPF_LSM_CGROUP = 0x2b + BPF_STRUCT_OPS = 0x2c + BPF_NETFILTER = 0x2d + BPF_TCX_INGRESS = 0x2e + BPF_TCX_EGRESS = 0x2f + BPF_TRACE_UPROBE_MULTI = 0x30 BPF_LINK_TYPE_UNSPEC = 0x0 BPF_LINK_TYPE_RAW_TRACEPOINT = 0x1 BPF_LINK_TYPE_TRACING = 0x2 @@ -2725,6 +2731,18 @@ const ( BPF_LINK_TYPE_PERF_EVENT = 0x7 BPF_LINK_TYPE_KPROBE_MULTI = 0x8 BPF_LINK_TYPE_STRUCT_OPS = 0x9 + BPF_LINK_TYPE_NETFILTER = 0xa + BPF_LINK_TYPE_TCX = 0xb + BPF_LINK_TYPE_UPROBE_MULTI = 0xc + BPF_PERF_EVENT_UNSPEC = 0x0 + BPF_PERF_EVENT_UPROBE = 0x1 + BPF_PERF_EVENT_URETPROBE = 0x2 + BPF_PERF_EVENT_KPROBE = 0x3 + BPF_PERF_EVENT_KRETPROBE = 0x4 + BPF_PERF_EVENT_TRACEPOINT = 0x5 + BPF_PERF_EVENT_EVENT = 0x6 + BPF_F_KPROBE_MULTI_RETURN = 0x1 + BPF_F_UPROBE_MULTI_RETURN = 0x1 BPF_ANY = 0x0 BPF_NOEXIST = 0x1 BPF_EXIST = 0x2 @@ -2742,6 +2760,8 @@ const ( BPF_F_MMAPABLE = 0x400 BPF_F_PRESERVE_ELEMS = 0x800 BPF_F_INNER_MAP = 0x1000 + BPF_F_LINK = 0x2000 + BPF_F_PATH_FD = 0x4000 BPF_STATS_RUN_TIME = 0x0 BPF_STACK_BUILD_ID_EMPTY = 0x0 BPF_STACK_BUILD_ID_VALID = 0x1 @@ -2762,6 +2782,7 @@ const ( BPF_F_ZERO_CSUM_TX = 0x2 BPF_F_DONT_FRAGMENT = 0x4 BPF_F_SEQ_NUMBER = 0x8 + BPF_F_NO_TUNNEL_KEY = 0x10 BPF_F_TUNINFO_FLAGS = 0x10 BPF_F_INDEX_MASK = 0xffffffff BPF_F_CURRENT_CPU = 0xffffffff @@ -2778,6 +2799,8 @@ const ( BPF_F_ADJ_ROOM_ENCAP_L4_UDP = 0x10 BPF_F_ADJ_ROOM_NO_CSUM_RESET = 0x20 BPF_F_ADJ_ROOM_ENCAP_L2_ETH = 0x40 + BPF_F_ADJ_ROOM_DECAP_L3_IPV4 = 0x80 + BPF_F_ADJ_ROOM_DECAP_L3_IPV6 = 0x100 BPF_ADJ_ROOM_ENCAP_L2_MASK = 0xff BPF_ADJ_ROOM_ENCAP_L2_SHIFT = 0x38 BPF_F_SYSCTL_BASE_NAME = 0x1 @@ -2866,6 +2889,8 @@ const ( BPF_DEVCG_DEV_CHAR = 0x2 BPF_FIB_LOOKUP_DIRECT = 0x1 BPF_FIB_LOOKUP_OUTPUT = 0x2 + BPF_FIB_LOOKUP_SKIP_NEIGH = 0x4 + BPF_FIB_LOOKUP_TBID = 0x8 BPF_FIB_LKUP_RET_SUCCESS = 0x0 BPF_FIB_LKUP_RET_BLACKHOLE = 0x1 BPF_FIB_LKUP_RET_UNREACHABLE = 0x2 @@ -2901,6 +2926,7 @@ const ( BPF_CORE_ENUMVAL_EXISTS = 0xa BPF_CORE_ENUMVAL_VALUE = 0xb BPF_CORE_TYPE_MATCHES = 0xc + BPF_F_TIMER_ABS = 0x1 ) const ( @@ -2979,6 +3005,12 @@ type LoopInfo64 struct { Encrypt_key [32]uint8 Init [2]uint64 } +type LoopConfig struct { + Fd uint32 + Size uint32 + Info LoopInfo64 + _ [8]uint64 +} type TIPCSocketAddr struct { Ref uint32 diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index fb6cfd04..47dc5796 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -155,6 +155,8 @@ func NewCallbackCDecl(fn interface{}) uintptr { //sys GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error) = kernel32.GetModuleFileNameW //sys GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error) = kernel32.GetModuleHandleExW //sys SetDefaultDllDirectories(directoryFlags uint32) (err error) +//sys AddDllDirectory(path *uint16) (cookie uintptr, err error) = kernel32.AddDllDirectory +//sys RemoveDllDirectory(cookie uintptr) (err error) = kernel32.RemoveDllDirectory //sys SetDllDirectory(path string) (err error) = kernel32.SetDllDirectoryW //sys GetVersion() (ver uint32, err error) //sys FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error) = FormatMessageW diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go index db6282e0..146a1f01 100644 --- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go +++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go @@ -184,6 +184,7 @@ var ( procGetAdaptersInfo = modiphlpapi.NewProc("GetAdaptersInfo") procGetBestInterfaceEx = modiphlpapi.NewProc("GetBestInterfaceEx") procGetIfEntry = modiphlpapi.NewProc("GetIfEntry") + procAddDllDirectory = modkernel32.NewProc("AddDllDirectory") procAssignProcessToJobObject = modkernel32.NewProc("AssignProcessToJobObject") procCancelIo = modkernel32.NewProc("CancelIo") procCancelIoEx = modkernel32.NewProc("CancelIoEx") @@ -330,6 +331,7 @@ var ( procReadProcessMemory = modkernel32.NewProc("ReadProcessMemory") procReleaseMutex = modkernel32.NewProc("ReleaseMutex") procRemoveDirectoryW = modkernel32.NewProc("RemoveDirectoryW") + procRemoveDllDirectory = modkernel32.NewProc("RemoveDllDirectory") procResetEvent = modkernel32.NewProc("ResetEvent") procResizePseudoConsole = modkernel32.NewProc("ResizePseudoConsole") procResumeThread = modkernel32.NewProc("ResumeThread") @@ -1605,6 +1607,15 @@ func GetIfEntry(pIfRow *MibIfRow) (errcode error) { return } +func AddDllDirectory(path *uint16) (cookie uintptr, err error) { + r0, _, e1 := syscall.Syscall(procAddDllDirectory.Addr(), 1, uintptr(unsafe.Pointer(path)), 0, 0) + cookie = uintptr(r0) + if cookie == 0 { + err = errnoErr(e1) + } + return +} + func AssignProcessToJobObject(job Handle, process Handle) (err error) { r1, _, e1 := syscall.Syscall(procAssignProcessToJobObject.Addr(), 2, uintptr(job), uintptr(process), 0) if r1 == 0 { @@ -2879,6 +2890,14 @@ func RemoveDirectory(path *uint16) (err error) { return } +func RemoveDllDirectory(cookie uintptr) (err error) { + r1, _, e1 := syscall.Syscall(procRemoveDllDirectory.Addr(), 1, uintptr(cookie), 0, 0) + if r1 == 0 { + err = errnoErr(e1) + } + return +} + func ResetEvent(event Handle) (err error) { r1, _, e1 := syscall.Syscall(procResetEvent.Addr(), 1, uintptr(event), 0, 0) if r1 == 0 { diff --git a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go b/vendor/google.golang.org/grpc/balancer_wrapper.go similarity index 57% rename from vendor/google.golang.org/grpc/balancer_conn_wrappers.go rename to vendor/google.golang.org/grpc/balancer_wrapper.go index a4411c22..b5e30cff 100644 --- a/vendor/google.golang.org/grpc/balancer_conn_wrappers.go +++ b/vendor/google.golang.org/grpc/balancer_wrapper.go @@ -32,21 +32,13 @@ import ( "google.golang.org/grpc/resolver" ) -type ccbMode int - -const ( - ccbModeActive = iota - ccbModeIdle - ccbModeClosed - ccbModeExitingIdle -) - // ccBalancerWrapper sits between the ClientConn and the Balancer. // // ccBalancerWrapper implements methods corresponding to the ones on the // balancer.Balancer interface. The ClientConn is free to call these methods // concurrently and the ccBalancerWrapper ensures that calls from the ClientConn -// to the Balancer happen synchronously and in order. +// to the Balancer happen in order by performing them in the serializer, without +// any mutexes held. // // ccBalancerWrapper also implements the balancer.ClientConn interface and is // passed to the Balancer implementations. It invokes unexported methods on the @@ -57,87 +49,75 @@ const ( type ccBalancerWrapper struct { // The following fields are initialized when the wrapper is created and are // read-only afterwards, and therefore can be accessed without a mutex. - cc *ClientConn - opts balancer.BuildOptions + cc *ClientConn + opts balancer.BuildOptions + serializer *grpcsync.CallbackSerializer + serializerCancel context.CancelFunc - // Outgoing (gRPC --> balancer) calls are guaranteed to execute in a - // mutually exclusive manner as they are scheduled in the serializer. Fields - // accessed *only* in these serializer callbacks, can therefore be accessed - // without a mutex. - balancer *gracefulswitch.Balancer + // The following fields are only accessed within the serializer or during + // initialization. curBalancerName string + balancer *gracefulswitch.Balancer - // mu guards access to the below fields. Access to the serializer and its - // cancel function needs to be mutex protected because they are overwritten - // when the wrapper exits idle mode. - mu sync.Mutex - serializer *grpcsync.CallbackSerializer // To serialize all outoing calls. - serializerCancel context.CancelFunc // To close the seralizer at close/enterIdle time. - mode ccbMode // Tracks the current mode of the wrapper. + // The following field is protected by mu. Caller must take cc.mu before + // taking mu. + mu sync.Mutex + closed bool } -// newCCBalancerWrapper creates a new balancer wrapper. The underlying balancer -// is not created until the switchTo() method is invoked. -func newCCBalancerWrapper(cc *ClientConn, bopts balancer.BuildOptions) *ccBalancerWrapper { - ctx, cancel := context.WithCancel(context.Background()) +// newCCBalancerWrapper creates a new balancer wrapper in idle state. The +// underlying balancer is not created until the switchTo() method is invoked. +func newCCBalancerWrapper(cc *ClientConn) *ccBalancerWrapper { + ctx, cancel := context.WithCancel(cc.ctx) ccb := &ccBalancerWrapper{ - cc: cc, - opts: bopts, + cc: cc, + opts: balancer.BuildOptions{ + DialCreds: cc.dopts.copts.TransportCredentials, + CredsBundle: cc.dopts.copts.CredsBundle, + Dialer: cc.dopts.copts.Dialer, + Authority: cc.authority, + CustomUserAgent: cc.dopts.copts.UserAgent, + ChannelzParentID: cc.channelzID, + Target: cc.parsedTarget, + }, serializer: grpcsync.NewCallbackSerializer(ctx), serializerCancel: cancel, } - ccb.balancer = gracefulswitch.NewBalancer(ccb, bopts) + ccb.balancer = gracefulswitch.NewBalancer(ccb, ccb.opts) return ccb } // updateClientConnState is invoked by grpc to push a ClientConnState update to -// the underlying balancer. +// the underlying balancer. This is always executed from the serializer, so +// it is safe to call into the balancer here. func (ccb *ccBalancerWrapper) updateClientConnState(ccs *balancer.ClientConnState) error { - ccb.mu.Lock() - errCh := make(chan error, 1) - // Here and everywhere else where Schedule() is called, it is done with the - // lock held. But the lock guards only the scheduling part. The actual - // callback is called asynchronously without the lock being held. - ok := ccb.serializer.Schedule(func(_ context.Context) { - errCh <- ccb.balancer.UpdateClientConnState(*ccs) + errCh := make(chan error) + ok := ccb.serializer.Schedule(func(ctx context.Context) { + defer close(errCh) + if ctx.Err() != nil || ccb.balancer == nil { + return + } + err := ccb.balancer.UpdateClientConnState(*ccs) + if logger.V(2) && err != nil { + logger.Infof("error from balancer.UpdateClientConnState: %v", err) + } + errCh <- err }) if !ok { - // If we are unable to schedule a function with the serializer, it - // indicates that it has been closed. A serializer is only closed when - // the wrapper is closed or is in idle. - ccb.mu.Unlock() - return fmt.Errorf("grpc: cannot send state update to a closed or idle balancer") + return nil } - ccb.mu.Unlock() - - // We get here only if the above call to Schedule succeeds, in which case it - // is guaranteed that the scheduled function will run. Therefore it is safe - // to block on this channel. - err := <-errCh - if logger.V(2) && err != nil { - logger.Infof("error from balancer.UpdateClientConnState: %v", err) - } - return err -} - -// updateSubConnState is invoked by grpc to push a subConn state update to the -// underlying balancer. -func (ccb *ccBalancerWrapper) updateSubConnState(sc balancer.SubConn, s connectivity.State, err error) { - ccb.mu.Lock() - ccb.serializer.Schedule(func(_ context.Context) { - // Even though it is optional for balancers, gracefulswitch ensures - // opts.StateListener is set, so this cannot ever be nil. - sc.(*acBalancerWrapper).stateListener(balancer.SubConnState{ConnectivityState: s, ConnectionError: err}) - }) - ccb.mu.Unlock() + return <-errCh } +// resolverError is invoked by grpc to push a resolver error to the underlying +// balancer. The call to the balancer is executed from the serializer. func (ccb *ccBalancerWrapper) resolverError(err error) { - ccb.mu.Lock() - ccb.serializer.Schedule(func(_ context.Context) { + ccb.serializer.Schedule(func(ctx context.Context) { + if ctx.Err() != nil || ccb.balancer == nil { + return + } ccb.balancer.ResolverError(err) }) - ccb.mu.Unlock() } // switchTo is invoked by grpc to instruct the balancer wrapper to switch to the @@ -151,8 +131,10 @@ func (ccb *ccBalancerWrapper) resolverError(err error) { // the ccBalancerWrapper keeps track of the current LB policy name, and skips // the graceful balancer switching process if the name does not change. func (ccb *ccBalancerWrapper) switchTo(name string) { - ccb.mu.Lock() - ccb.serializer.Schedule(func(_ context.Context) { + ccb.serializer.Schedule(func(ctx context.Context) { + if ctx.Err() != nil || ccb.balancer == nil { + return + } // TODO: Other languages use case-sensitive balancer registries. We should // switch as well. See: https://github.com/grpc/grpc-go/issues/5288. if strings.EqualFold(ccb.curBalancerName, name) { @@ -160,7 +142,6 @@ func (ccb *ccBalancerWrapper) switchTo(name string) { } ccb.buildLoadBalancingPolicy(name) }) - ccb.mu.Unlock() } // buildLoadBalancingPolicy performs the following: @@ -187,115 +168,49 @@ func (ccb *ccBalancerWrapper) buildLoadBalancingPolicy(name string) { ccb.curBalancerName = builder.Name() } +// close initiates async shutdown of the wrapper. cc.mu must be held when +// calling this function. To determine the wrapper has finished shutting down, +// the channel should block on ccb.serializer.Done() without cc.mu held. func (ccb *ccBalancerWrapper) close() { - channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: closing") - ccb.closeBalancer(ccbModeClosed) -} - -// enterIdleMode is invoked by grpc when the channel enters idle mode upon -// expiry of idle_timeout. This call blocks until the balancer is closed. -func (ccb *ccBalancerWrapper) enterIdleMode() { - channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: entering idle mode") - ccb.closeBalancer(ccbModeIdle) -} - -// closeBalancer is invoked when the channel is being closed or when it enters -// idle mode upon expiry of idle_timeout. -func (ccb *ccBalancerWrapper) closeBalancer(m ccbMode) { ccb.mu.Lock() - if ccb.mode == ccbModeClosed || ccb.mode == ccbModeIdle { - ccb.mu.Unlock() - return - } - - ccb.mode = m - done := ccb.serializer.Done() - b := ccb.balancer - ok := ccb.serializer.Schedule(func(_ context.Context) { - // Close the serializer to ensure that no more calls from gRPC are sent - // to the balancer. - ccb.serializerCancel() - // Empty the current balancer name because we don't have a balancer - // anymore and also so that we act on the next call to switchTo by - // creating a new balancer specified by the new resolver. - ccb.curBalancerName = "" - }) - if !ok { - ccb.mu.Unlock() - return - } + ccb.closed = true ccb.mu.Unlock() - - // Give enqueued callbacks a chance to finish before closing the balancer. - <-done - b.Close() -} - -// exitIdleMode is invoked by grpc when the channel exits idle mode either -// because of an RPC or because of an invocation of the Connect() API. This -// recreates the balancer that was closed previously when entering idle mode. -// -// If the channel is not in idle mode, we know for a fact that we are here as a -// result of the user calling the Connect() method on the ClientConn. In this -// case, we can simply forward the call to the underlying balancer, instructing -// it to reconnect to the backends. -func (ccb *ccBalancerWrapper) exitIdleMode() { - ccb.mu.Lock() - if ccb.mode == ccbModeClosed { - // Request to exit idle is a no-op when wrapper is already closed. - ccb.mu.Unlock() - return - } - - if ccb.mode == ccbModeIdle { - // Recreate the serializer which was closed when we entered idle. - ctx, cancel := context.WithCancel(context.Background()) - ccb.serializer = grpcsync.NewCallbackSerializer(ctx) - ccb.serializerCancel = cancel - } - - // The ClientConn guarantees that mutual exclusion between close() and - // exitIdleMode(), and since we just created a new serializer, we can be - // sure that the below function will be scheduled. - done := make(chan struct{}) - ccb.serializer.Schedule(func(_ context.Context) { - defer close(done) - - ccb.mu.Lock() - defer ccb.mu.Unlock() - - if ccb.mode != ccbModeIdle { - ccb.balancer.ExitIdle() + channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: closing") + ccb.serializer.Schedule(func(context.Context) { + if ccb.balancer == nil { return } - - // Gracefulswitch balancer does not support a switchTo operation after - // being closed. Hence we need to create a new one here. - ccb.balancer = gracefulswitch.NewBalancer(ccb, ccb.opts) - ccb.mode = ccbModeActive - channelz.Info(logger, ccb.cc.channelzID, "ccBalancerWrapper: exiting idle mode") - + ccb.balancer.Close() + ccb.balancer = nil }) - ccb.mu.Unlock() - - <-done + ccb.serializerCancel() } -func (ccb *ccBalancerWrapper) isIdleOrClosed() bool { - ccb.mu.Lock() - defer ccb.mu.Unlock() - return ccb.mode == ccbModeIdle || ccb.mode == ccbModeClosed +// exitIdle invokes the balancer's exitIdle method in the serializer. +func (ccb *ccBalancerWrapper) exitIdle() { + ccb.serializer.Schedule(func(ctx context.Context) { + if ctx.Err() != nil || ccb.balancer == nil { + return + } + ccb.balancer.ExitIdle() + }) } func (ccb *ccBalancerWrapper) NewSubConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (balancer.SubConn, error) { - if ccb.isIdleOrClosed() { - return nil, fmt.Errorf("grpc: cannot create SubConn when balancer is closed or idle") + ccb.cc.mu.Lock() + defer ccb.cc.mu.Unlock() + + ccb.mu.Lock() + if ccb.closed { + ccb.mu.Unlock() + return nil, fmt.Errorf("balancer is being closed; no new SubConns allowed") } + ccb.mu.Unlock() if len(addrs) == 0 { return nil, fmt.Errorf("grpc: cannot create SubConn with empty address list") } - ac, err := ccb.cc.newAddrConn(addrs, opts) + ac, err := ccb.cc.newAddrConnLocked(addrs, opts) if err != nil { channelz.Warningf(logger, ccb.cc.channelzID, "acBalancerWrapper: NewSubConn: failed to newAddrConn: %v", err) return nil, err @@ -316,10 +231,6 @@ func (ccb *ccBalancerWrapper) RemoveSubConn(sc balancer.SubConn) { } func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resolver.Address) { - if ccb.isIdleOrClosed() { - return - } - acbw, ok := sc.(*acBalancerWrapper) if !ok { return @@ -328,25 +239,39 @@ func (ccb *ccBalancerWrapper) UpdateAddresses(sc balancer.SubConn, addrs []resol } func (ccb *ccBalancerWrapper) UpdateState(s balancer.State) { - if ccb.isIdleOrClosed() { + ccb.cc.mu.Lock() + defer ccb.cc.mu.Unlock() + + ccb.mu.Lock() + if ccb.closed { + ccb.mu.Unlock() return } - + ccb.mu.Unlock() // Update picker before updating state. Even though the ordering here does // not matter, it can lead to multiple calls of Pick in the common start-up // case where we wait for ready and then perform an RPC. If the picker is // updated later, we could call the "connecting" picker when the state is // updated, and then call the "ready" picker after the picker gets updated. - ccb.cc.blockingpicker.updatePicker(s.Picker) + + // Note that there is no need to check if the balancer wrapper was closed, + // as we know the graceful switch LB policy will not call cc if it has been + // closed. + ccb.cc.pickerWrapper.updatePicker(s.Picker) ccb.cc.csMgr.updateState(s.ConnectivityState) } func (ccb *ccBalancerWrapper) ResolveNow(o resolver.ResolveNowOptions) { - if ccb.isIdleOrClosed() { + ccb.cc.mu.RLock() + defer ccb.cc.mu.RUnlock() + + ccb.mu.Lock() + if ccb.closed { + ccb.mu.Unlock() return } - - ccb.cc.resolveNow(o) + ccb.mu.Unlock() + ccb.cc.resolveNowLocked(o) } func (ccb *ccBalancerWrapper) Target() string { @@ -364,6 +289,20 @@ type acBalancerWrapper struct { producers map[balancer.ProducerBuilder]*refCountedProducer } +// updateState is invoked by grpc to push a subConn state update to the +// underlying balancer. +func (acbw *acBalancerWrapper) updateState(s connectivity.State, err error) { + acbw.ccb.serializer.Schedule(func(ctx context.Context) { + if ctx.Err() != nil || acbw.ccb.balancer == nil { + return + } + // Even though it is optional for balancers, gracefulswitch ensures + // opts.StateListener is set, so this cannot ever be nil. + // TODO: delete this comment when UpdateSubConnState is removed. + acbw.stateListener(balancer.SubConnState{ConnectivityState: s, ConnectionError: err}) + }) +} + func (acbw *acBalancerWrapper) String() string { return fmt.Sprintf("SubConn(id:%d)", acbw.ac.channelzID.Int()) } @@ -377,20 +316,7 @@ func (acbw *acBalancerWrapper) Connect() { } func (acbw *acBalancerWrapper) Shutdown() { - ccb := acbw.ccb - if ccb.isIdleOrClosed() { - // It it safe to ignore this call when the balancer is closed or in idle - // because the ClientConn takes care of closing the connections. - // - // Not returning early from here when the balancer is closed or in idle - // leads to a deadlock though, because of the following sequence of - // calls when holding cc.mu: - // cc.exitIdleMode --> ccb.enterIdleMode --> gsw.Close --> - // ccb.RemoveAddrConn --> cc.removeAddrConn - return - } - - ccb.cc.removeAddrConn(acbw.ac, errConnDrain) + acbw.ccb.cc.removeAddrConn(acbw.ac, errConnDrain) } // NewStream begins a streaming RPC on the addrConn. If the addrConn is not diff --git a/vendor/google.golang.org/grpc/clientconn.go b/vendor/google.golang.org/grpc/clientconn.go index 429c389e..e6f2625b 100644 --- a/vendor/google.golang.org/grpc/clientconn.go +++ b/vendor/google.golang.org/grpc/clientconn.go @@ -33,9 +33,7 @@ import ( "google.golang.org/grpc/balancer/base" "google.golang.org/grpc/codes" "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/credentials" "google.golang.org/grpc/internal" - "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/internal/grpcsync" "google.golang.org/grpc/internal/idle" @@ -48,9 +46,9 @@ import ( "google.golang.org/grpc/status" _ "google.golang.org/grpc/balancer/roundrobin" // To register roundrobin. - _ "google.golang.org/grpc/internal/resolver/dns" // To register dns resolver. _ "google.golang.org/grpc/internal/resolver/passthrough" // To register passthrough resolver. _ "google.golang.org/grpc/internal/resolver/unix" // To register unix resolver. + _ "google.golang.org/grpc/resolver/dns" // To register dns resolver. ) const ( @@ -119,23 +117,8 @@ func (dcs *defaultConfigSelector) SelectConfig(rpcInfo iresolver.RPCInfo) (*ires }, nil } -// DialContext creates a client connection to the given target. By default, it's -// a non-blocking dial (the function won't wait for connections to be -// established, and connecting happens in the background). To make it a blocking -// dial, use WithBlock() dial option. -// -// In the non-blocking case, the ctx does not act against the connection. It -// only controls the setup steps. -// -// In the blocking case, ctx can be used to cancel or expire the pending -// connection. Once this function returns, the cancellation and expiration of -// ctx will be noop. Users should call ClientConn.Close to terminate all the -// pending operations after this function returns. -// -// The target name syntax is defined in -// https://github.com/grpc/grpc/blob/master/doc/naming.md. -// e.g. to use dns resolver, a "dns:///" prefix should be applied to the target. -func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) { +// newClient returns a new client in idle mode. +func newClient(target string, opts ...DialOption) (conn *ClientConn, err error) { cc := &ClientConn{ target: target, conns: make(map[*addrConn]struct{}), @@ -143,23 +126,11 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * czData: new(channelzData), } - // We start the channel off in idle mode, but kick it out of idle at the end - // of this method, instead of waiting for the first RPC. Other gRPC - // implementations do wait for the first RPC to kick the channel out of - // idle. But doing so would be a major behavior change for our users who are - // used to seeing the channel active after Dial. - // - // Taking this approach of kicking it out of idle at the end of this method - // allows us to share the code between channel creation and exiting idle - // mode. This will also make it easy for us to switch to starting the - // channel off in idle, if at all we ever get to do that. - cc.idlenessState = ccIdlenessStateIdle - cc.retryThrottler.Store((*retryThrottler)(nil)) cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil}) cc.ctx, cc.cancel = context.WithCancel(context.Background()) - cc.exitIdleCond = sync.NewCond(&cc.mu) + // Apply dial options. disableGlobalOpts := false for _, opt := range opts { if _, ok := opt.(*disableGlobalDialOptions); ok { @@ -177,21 +148,9 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * for _, opt := range opts { opt.apply(&cc.dopts) } - chainUnaryClientInterceptors(cc) chainStreamClientInterceptors(cc) - defer func() { - if err != nil { - cc.Close() - } - }() - - // Register ClientConn with channelz. - cc.channelzRegistration(target) - - cc.csMgr = newConnectivityStateManager(cc.ctx, cc.channelzID) - if err := cc.validateTransportCredentials(); err != nil { return nil, err } @@ -205,10 +164,80 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } cc.mkp = cc.dopts.copts.KeepaliveParams - if cc.dopts.copts.UserAgent != "" { - cc.dopts.copts.UserAgent += " " + grpcUA - } else { - cc.dopts.copts.UserAgent = grpcUA + // Register ClientConn with channelz. + cc.channelzRegistration(target) + + // TODO: Ideally it should be impossible to error from this function after + // channelz registration. This will require removing some channelz logs + // from the following functions that can error. Errors can be returned to + // the user, and successful logs can be emitted here, after the checks have + // passed and channelz is subsequently registered. + + // Determine the resolver to use. + if err := cc.parseTargetAndFindResolver(); err != nil { + channelz.RemoveEntry(cc.channelzID) + return nil, err + } + if err = cc.determineAuthority(); err != nil { + channelz.RemoveEntry(cc.channelzID) + return nil, err + } + + cc.csMgr = newConnectivityStateManager(cc.ctx, cc.channelzID) + cc.pickerWrapper = newPickerWrapper(cc.dopts.copts.StatsHandlers) + + cc.initIdleStateLocked() // Safe to call without the lock, since nothing else has a reference to cc. + cc.idlenessMgr = idle.NewManager((*idler)(cc), cc.dopts.idleTimeout) + return cc, nil +} + +// DialContext creates a client connection to the given target. By default, it's +// a non-blocking dial (the function won't wait for connections to be +// established, and connecting happens in the background). To make it a blocking +// dial, use WithBlock() dial option. +// +// In the non-blocking case, the ctx does not act against the connection. It +// only controls the setup steps. +// +// In the blocking case, ctx can be used to cancel or expire the pending +// connection. Once this function returns, the cancellation and expiration of +// ctx will be noop. Users should call ClientConn.Close to terminate all the +// pending operations after this function returns. +// +// The target name syntax is defined in +// https://github.com/grpc/grpc/blob/master/doc/naming.md. +// e.g. to use dns resolver, a "dns:///" prefix should be applied to the target. +func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *ClientConn, err error) { + cc, err := newClient(target, opts...) + if err != nil { + return nil, err + } + + // We start the channel off in idle mode, but kick it out of idle now, + // instead of waiting for the first RPC. Other gRPC implementations do wait + // for the first RPC to kick the channel out of idle. But doing so would be + // a major behavior change for our users who are used to seeing the channel + // active after Dial. + // + // Taking this approach of kicking it out of idle at the end of this method + // allows us to share the code between channel creation and exiting idle + // mode. This will also make it easy for us to switch to starting the + // channel off in idle, i.e. by making newClient exported. + + defer func() { + if err != nil { + cc.Close() + } + }() + + // This creates the name resolver, load balancer, etc. + if err := cc.idlenessMgr.ExitIdleMode(); err != nil { + return nil, err + } + + // Return now for non-blocking dials. + if !cc.dopts.block { + return cc, nil } if cc.dopts.timeout > 0 { @@ -231,49 +260,6 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn * } }() - if cc.dopts.bs == nil { - cc.dopts.bs = backoff.DefaultExponential - } - - // Determine the resolver to use. - if err := cc.parseTargetAndFindResolver(); err != nil { - return nil, err - } - if err = cc.determineAuthority(); err != nil { - return nil, err - } - - if cc.dopts.scChan != nil { - // Blocking wait for the initial service config. - select { - case sc, ok := <-cc.dopts.scChan: - if ok { - cc.sc = &sc - cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{&sc}) - } - case <-ctx.Done(): - return nil, ctx.Err() - } - } - if cc.dopts.scChan != nil { - go cc.scWatcher() - } - - // This creates the name resolver, load balancer, blocking picker etc. - if err := cc.exitIdleMode(); err != nil { - return nil, err - } - - // Configure idleness support with configured idle timeout or default idle - // timeout duration. Idleness can be explicitly disabled by the user, by - // setting the dial option to 0. - cc.idlenessMgr = idle.NewManager(idle.ManagerOptions{Enforcer: (*idler)(cc), Timeout: cc.dopts.idleTimeout, Logger: logger}) - - // Return early for non-blocking dials. - if !cc.dopts.block { - return cc, nil - } - // A blocking dial blocks until the clientConn is ready. for { s := cc.GetState() @@ -320,8 +306,8 @@ func (cc *ClientConn) addTraceEvent(msg string) { type idler ClientConn -func (i *idler) EnterIdleMode() error { - return (*ClientConn)(i).enterIdleMode() +func (i *idler) EnterIdleMode() { + (*ClientConn)(i).enterIdleMode() } func (i *idler) ExitIdleMode() error { @@ -329,117 +315,71 @@ func (i *idler) ExitIdleMode() error { } // exitIdleMode moves the channel out of idle mode by recreating the name -// resolver and load balancer. -func (cc *ClientConn) exitIdleMode() error { +// resolver and load balancer. This should never be called directly; use +// cc.idlenessMgr.ExitIdleMode instead. +func (cc *ClientConn) exitIdleMode() (err error) { cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() return errConnClosing } - if cc.idlenessState != ccIdlenessStateIdle { - channelz.Infof(logger, cc.channelzID, "ClientConn asked to exit idle mode, current mode is %v", cc.idlenessState) - cc.mu.Unlock() - return nil - } - - defer func() { - // When Close() and exitIdleMode() race against each other, one of the - // following two can happen: - // - Close() wins the race and runs first. exitIdleMode() runs after, and - // sees that the ClientConn is already closed and hence returns early. - // - exitIdleMode() wins the race and runs first and recreates the balancer - // and releases the lock before recreating the resolver. If Close() runs - // in this window, it will wait for exitIdleMode to complete. - // - // We achieve this synchronization using the below condition variable. - cc.mu.Lock() - cc.idlenessState = ccIdlenessStateActive - cc.exitIdleCond.Signal() - cc.mu.Unlock() - }() - - cc.idlenessState = ccIdlenessStateExitingIdle - exitedIdle := false - if cc.blockingpicker == nil { - cc.blockingpicker = newPickerWrapper(cc.dopts.copts.StatsHandlers) - } else { - cc.blockingpicker.exitIdleMode() - exitedIdle = true - } - - var credsClone credentials.TransportCredentials - if creds := cc.dopts.copts.TransportCredentials; creds != nil { - credsClone = creds.Clone() - } - if cc.balancerWrapper == nil { - cc.balancerWrapper = newCCBalancerWrapper(cc, balancer.BuildOptions{ - DialCreds: credsClone, - CredsBundle: cc.dopts.copts.CredsBundle, - Dialer: cc.dopts.copts.Dialer, - Authority: cc.authority, - CustomUserAgent: cc.dopts.copts.UserAgent, - ChannelzParentID: cc.channelzID, - Target: cc.parsedTarget, - }) - } else { - cc.balancerWrapper.exitIdleMode() - } - cc.firstResolveEvent = grpcsync.NewEvent() cc.mu.Unlock() // This needs to be called without cc.mu because this builds a new resolver - // which might update state or report error inline which needs to be handled - // by cc.updateResolverState() which also grabs cc.mu. - if err := cc.initResolverWrapper(credsClone); err != nil { + // which might update state or report error inline, which would then need to + // acquire cc.mu. + if err := cc.resolverWrapper.start(); err != nil { return err } - if exitedIdle { - cc.addTraceEvent("exiting idle mode") - } + cc.addTraceEvent("exiting idle mode") return nil } -// enterIdleMode puts the channel in idle mode, and as part of it shuts down the -// name resolver, load balancer and any subchannels. -func (cc *ClientConn) enterIdleMode() error { - cc.mu.Lock() - defer cc.mu.Unlock() - - if cc.conns == nil { - return ErrClientConnClosing - } - if cc.idlenessState != ccIdlenessStateActive { - channelz.Warningf(logger, cc.channelzID, "ClientConn asked to enter idle mode, current mode is %v", cc.idlenessState) - return nil - } - +// initIdleStateLocked initializes common state to how it should be while idle. +func (cc *ClientConn) initIdleStateLocked() { + cc.resolverWrapper = newCCResolverWrapper(cc) + cc.balancerWrapper = newCCBalancerWrapper(cc) + cc.firstResolveEvent = grpcsync.NewEvent() // cc.conns == nil is a proxy for the ClientConn being closed. So, instead // of setting it to nil here, we recreate the map. This also means that we // don't have to do this when exiting idle mode. - conns := cc.conns cc.conns = make(map[*addrConn]struct{}) +} - // TODO: Currently, we close the resolver wrapper upon entering idle mode - // and create a new one upon exiting idle mode. This means that the - // `cc.resolverWrapper` field would be overwritten everytime we exit idle - // mode. While this means that we need to hold `cc.mu` when accessing - // `cc.resolverWrapper`, it makes the code simpler in the wrapper. We should - // try to do the same for the balancer and picker wrappers too. - cc.resolverWrapper.close() - cc.blockingpicker.enterIdleMode() - cc.balancerWrapper.enterIdleMode() +// enterIdleMode puts the channel in idle mode, and as part of it shuts down the +// name resolver, load balancer, and any subchannels. This should never be +// called directly; use cc.idlenessMgr.EnterIdleMode instead. +func (cc *ClientConn) enterIdleMode() { + cc.mu.Lock() + + if cc.conns == nil { + cc.mu.Unlock() + return + } + + conns := cc.conns + + rWrapper := cc.resolverWrapper + rWrapper.close() + cc.pickerWrapper.reset() + bWrapper := cc.balancerWrapper + bWrapper.close() cc.csMgr.updateState(connectivity.Idle) - cc.idlenessState = ccIdlenessStateIdle cc.addTraceEvent("entering idle mode") - go func() { - for ac := range conns { - ac.tearDown(errConnIdling) - } - }() + cc.initIdleStateLocked() - return nil + cc.mu.Unlock() + + // Block until the name resolver and LB policy are closed. + <-rWrapper.serializer.Done() + <-bWrapper.serializer.Done() + + // Close all subchannels after the LB policy is closed. + for ac := range conns { + ac.tearDown(errConnIdling) + } } // validateTransportCredentials performs a series of checks on the configured @@ -649,66 +589,35 @@ type ClientConn struct { dopts dialOptions // Default and user specified dial options. channelzID *channelz.Identifier // Channelz identifier for the channel. resolverBuilder resolver.Builder // See parseTargetAndFindResolver(). - balancerWrapper *ccBalancerWrapper // Uses gracefulswitch.balancer underneath. - idlenessMgr idle.Manager + idlenessMgr *idle.Manager // The following provide their own synchronization, and therefore don't // require cc.mu to be held to access them. csMgr *connectivityStateManager - blockingpicker *pickerWrapper + pickerWrapper *pickerWrapper safeConfigSelector iresolver.SafeConfigSelector czData *channelzData retryThrottler atomic.Value // Updated from service config. - // firstResolveEvent is used to track whether the name resolver sent us at - // least one update. RPCs block on this event. - firstResolveEvent *grpcsync.Event - // mu protects the following fields. // TODO: split mu so the same mutex isn't used for everything. mu sync.RWMutex - resolverWrapper *ccResolverWrapper // Initialized in Dial; cleared in Close. + resolverWrapper *ccResolverWrapper // Always recreated whenever entering idle to simplify Close. + balancerWrapper *ccBalancerWrapper // Always recreated whenever entering idle to simplify Close. sc *ServiceConfig // Latest service config received from the resolver. conns map[*addrConn]struct{} // Set to nil on close. mkp keepalive.ClientParameters // May be updated upon receipt of a GoAway. - idlenessState ccIdlenessState // Tracks idleness state of the channel. - exitIdleCond *sync.Cond // Signalled when channel exits idle. + // firstResolveEvent is used to track whether the name resolver sent us at + // least one update. RPCs block on this event. May be accessed without mu + // if we know we cannot be asked to enter idle mode while accessing it (e.g. + // when the idle manager has already been closed, or if we are already + // entering idle mode). + firstResolveEvent *grpcsync.Event lceMu sync.Mutex // protects lastConnectionError lastConnectionError error } -// ccIdlenessState tracks the idleness state of the channel. -// -// Channels start off in `active` and move to `idle` after a period of -// inactivity. When moving back to `active` upon an incoming RPC, they -// transition through `exiting_idle`. This state is useful for synchronization -// with Close(). -// -// This state tracking is mostly for self-protection. The idlenessManager is -// expected to keep track of the state as well, and is expected not to call into -// the ClientConn unnecessarily. -type ccIdlenessState int8 - -const ( - ccIdlenessStateActive ccIdlenessState = iota - ccIdlenessStateIdle - ccIdlenessStateExitingIdle -) - -func (s ccIdlenessState) String() string { - switch s { - case ccIdlenessStateActive: - return "active" - case ccIdlenessStateIdle: - return "idle" - case ccIdlenessStateExitingIdle: - return "exitingIdle" - default: - return "unknown" - } -} - // WaitForStateChange waits until the connectivity.State of ClientConn changes from sourceState or // ctx expires. A true value is returned in former case and false in latter. // @@ -748,29 +657,15 @@ func (cc *ClientConn) GetState() connectivity.State { // Notice: This API is EXPERIMENTAL and may be changed or removed in a later // release. func (cc *ClientConn) Connect() { - cc.exitIdleMode() + if err := cc.idlenessMgr.ExitIdleMode(); err != nil { + cc.addTraceEvent(err.Error()) + return + } // If the ClientConn was not in idle mode, we need to call ExitIdle on the // LB policy so that connections can be created. - cc.balancerWrapper.exitIdleMode() -} - -func (cc *ClientConn) scWatcher() { - for { - select { - case sc, ok := <-cc.dopts.scChan: - if !ok { - return - } - cc.mu.Lock() - // TODO: load balance policy runtime change is ignored. - // We may revisit this decision in the future. - cc.sc = &sc - cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{&sc}) - cc.mu.Unlock() - case <-cc.ctx.Done(): - return - } - } + cc.mu.Lock() + cc.balancerWrapper.exitIdle() + cc.mu.Unlock() } // waitForResolvedAddrs blocks until the resolver has provided addresses or the @@ -804,11 +699,11 @@ func init() { internal.SubscribeToConnectivityStateChanges = func(cc *ClientConn, s grpcsync.Subscriber) func() { return cc.csMgr.pubSub.Subscribe(s) } - internal.EnterIdleModeForTesting = func(cc *ClientConn) error { - return cc.enterIdleMode() + internal.EnterIdleModeForTesting = func(cc *ClientConn) { + cc.idlenessMgr.EnterIdleModeForTesting() } internal.ExitIdleModeForTesting = func(cc *ClientConn) error { - return cc.exitIdleMode() + return cc.idlenessMgr.ExitIdleMode() } } @@ -824,9 +719,8 @@ func (cc *ClientConn) maybeApplyDefaultServiceConfig(addrs []resolver.Address) { } } -func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { +func (cc *ClientConn) updateResolverStateAndUnlock(s resolver.State, err error) error { defer cc.firstResolveEvent.Fire() - cc.mu.Lock() // Check if the ClientConn is already closed. Some fields (e.g. // balancerWrapper) are set to nil when closing the ClientConn, and could // cause nil pointer panic if we don't have this check. @@ -872,7 +766,7 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { if cc.sc == nil { // Apply the failing LB only if we haven't received valid service config // from the name resolver in the past. - cc.applyFailingLB(s.ServiceConfig) + cc.applyFailingLBLocked(s.ServiceConfig) cc.mu.Unlock() return ret } @@ -894,15 +788,13 @@ func (cc *ClientConn) updateResolverState(s resolver.State, err error) error { return ret } -// applyFailingLB is akin to configuring an LB policy on the channel which +// applyFailingLBLocked is akin to configuring an LB policy on the channel which // always fails RPCs. Here, an actual LB policy is not configured, but an always // erroring picker is configured, which returns errors with information about // what was invalid in the received service config. A config selector with no // service config is configured, and the connectivity state of the channel is // set to TransientFailure. -// -// Caller must hold cc.mu. -func (cc *ClientConn) applyFailingLB(sc *serviceconfig.ParseResult) { +func (cc *ClientConn) applyFailingLBLocked(sc *serviceconfig.ParseResult) { var err error if sc.Err != nil { err = status.Errorf(codes.Unavailable, "error parsing service config: %v", sc.Err) @@ -910,14 +802,10 @@ func (cc *ClientConn) applyFailingLB(sc *serviceconfig.ParseResult) { err = status.Errorf(codes.Unavailable, "illegal service config type: %T", sc.Config) } cc.safeConfigSelector.UpdateConfigSelector(&defaultConfigSelector{nil}) - cc.blockingpicker.updatePicker(base.NewErrPicker(err)) + cc.pickerWrapper.updatePicker(base.NewErrPicker(err)) cc.csMgr.updateState(connectivity.TransientFailure) } -func (cc *ClientConn) handleSubConnStateChange(sc balancer.SubConn, s connectivity.State, err error) { - cc.balancerWrapper.updateSubConnState(sc, s, err) -} - // Makes a copy of the input addresses slice and clears out the balancer // attributes field. Addresses are passed during subconn creation and address // update operations. In both cases, we will clear the balancer attributes by @@ -932,10 +820,14 @@ func copyAddressesWithoutBalancerAttributes(in []resolver.Address) []resolver.Ad return out } -// newAddrConn creates an addrConn for addrs and adds it to cc.conns. +// newAddrConnLocked creates an addrConn for addrs and adds it to cc.conns. // // Caller needs to make sure len(addrs) > 0. -func (cc *ClientConn) newAddrConn(addrs []resolver.Address, opts balancer.NewSubConnOptions) (*addrConn, error) { +func (cc *ClientConn) newAddrConnLocked(addrs []resolver.Address, opts balancer.NewSubConnOptions) (*addrConn, error) { + if cc.conns == nil { + return nil, ErrClientConnClosing + } + ac := &addrConn{ state: connectivity.Idle, cc: cc, @@ -947,12 +839,6 @@ func (cc *ClientConn) newAddrConn(addrs []resolver.Address, opts balancer.NewSub stateChan: make(chan struct{}), } ac.ctx, ac.cancel = context.WithCancel(cc.ctx) - // Track ac in cc. This needs to be done before any getTransport(...) is called. - cc.mu.Lock() - defer cc.mu.Unlock() - if cc.conns == nil { - return nil, ErrClientConnClosing - } var err error ac.channelzID, err = channelz.RegisterSubChannel(ac, cc.channelzID, "") @@ -968,6 +854,7 @@ func (cc *ClientConn) newAddrConn(addrs []resolver.Address, opts balancer.NewSub }, }) + // Track ac in cc. This needs to be done before any getTransport(...) is called. cc.conns[ac] = struct{}{} return ac, nil } @@ -1174,7 +1061,7 @@ func (cc *ClientConn) healthCheckConfig() *healthCheckConfig { } func (cc *ClientConn) getTransport(ctx context.Context, failfast bool, method string) (transport.ClientTransport, balancer.PickResult, error) { - return cc.blockingpicker.pick(ctx, failfast, balancer.PickInfo{ + return cc.pickerWrapper.pick(ctx, failfast, balancer.PickInfo{ Ctx: ctx, FullMethodName: method, }) @@ -1216,12 +1103,12 @@ func (cc *ClientConn) applyServiceConfigAndBalancer(sc *ServiceConfig, configSel func (cc *ClientConn) resolveNow(o resolver.ResolveNowOptions) { cc.mu.RLock() - r := cc.resolverWrapper + cc.resolverWrapper.resolveNow(o) cc.mu.RUnlock() - if r == nil { - return - } - go r.resolveNow(o) +} + +func (cc *ClientConn) resolveNowLocked(o resolver.ResolveNowOptions) { + cc.resolverWrapper.resolveNow(o) } // ResetConnectBackoff wakes up all subchannels in transient failure and causes @@ -1253,40 +1140,32 @@ func (cc *ClientConn) Close() error { <-cc.csMgr.pubSub.Done() }() + // Prevent calls to enter/exit idle immediately, and ensure we are not + // currently entering/exiting idle mode. + cc.idlenessMgr.Close() + cc.mu.Lock() if cc.conns == nil { cc.mu.Unlock() return ErrClientConnClosing } - for cc.idlenessState == ccIdlenessStateExitingIdle { - cc.exitIdleCond.Wait() - } - conns := cc.conns cc.conns = nil cc.csMgr.updateState(connectivity.Shutdown) - pWrapper := cc.blockingpicker - rWrapper := cc.resolverWrapper - bWrapper := cc.balancerWrapper - idlenessMgr := cc.idlenessMgr + // We can safely unlock and continue to access all fields now as + // cc.conns==nil, preventing any further operations on cc. cc.mu.Unlock() + cc.resolverWrapper.close() // The order of closing matters here since the balancer wrapper assumes the // picker is closed before it is closed. - if pWrapper != nil { - pWrapper.close() - } - if bWrapper != nil { - bWrapper.close() - } - if rWrapper != nil { - rWrapper.close() - } - if idlenessMgr != nil { - idlenessMgr.Close() - } + cc.pickerWrapper.close() + cc.balancerWrapper.close() + + <-cc.resolverWrapper.serializer.Done() + <-cc.balancerWrapper.serializer.Done() for ac := range conns { ac.tearDown(ErrClientConnClosing) @@ -1307,7 +1186,7 @@ type addrConn struct { cc *ClientConn dopts dialOptions - acbw balancer.SubConn + acbw *acBalancerWrapper scopts balancer.NewSubConnOptions // transport is set when there's a viable transport (note: ac state may not be READY as LB channel @@ -1345,7 +1224,7 @@ func (ac *addrConn) updateConnectivityState(s connectivity.State, lastErr error) } else { channelz.Infof(logger, ac.channelzID, "Subchannel Connectivity change to %v, last error: %s", s, lastErr) } - ac.cc.handleSubConnStateChange(ac.acbw, s, lastErr) + ac.acbw.updateState(s, lastErr) } // adjustParams updates parameters used to create transports upon @@ -1849,7 +1728,7 @@ func (cc *ClientConn) parseTargetAndFindResolver() error { if err != nil { channelz.Infof(logger, cc.channelzID, "dial target %q parse failed: %v", cc.target, err) } else { - channelz.Infof(logger, cc.channelzID, "parsed dial target is: %+v", parsedTarget) + channelz.Infof(logger, cc.channelzID, "parsed dial target is: %#v", parsedTarget) rb = cc.getResolver(parsedTarget.URL.Scheme) if rb != nil { cc.parsedTarget = parsedTarget @@ -2007,32 +1886,3 @@ func (cc *ClientConn) determineAuthority() error { channelz.Infof(logger, cc.channelzID, "Channel authority set to %q", cc.authority) return nil } - -// initResolverWrapper creates a ccResolverWrapper, which builds the name -// resolver. This method grabs the lock to assign the newly built resolver -// wrapper to the cc.resolverWrapper field. -func (cc *ClientConn) initResolverWrapper(creds credentials.TransportCredentials) error { - rw, err := newCCResolverWrapper(cc, ccResolverWrapperOpts{ - target: cc.parsedTarget, - builder: cc.resolverBuilder, - bOpts: resolver.BuildOptions{ - DisableServiceConfig: cc.dopts.disableServiceConfig, - DialCreds: creds, - CredsBundle: cc.dopts.copts.CredsBundle, - Dialer: cc.dopts.copts.Dialer, - }, - channelzID: cc.channelzID, - }) - if err != nil { - return fmt.Errorf("failed to build resolver: %v", err) - } - // Resolver implementations may report state update or error inline when - // built (or right after), and this is handled in cc.updateResolverState. - // Also, an error from the resolver might lead to a re-resolution request - // from the balancer, which is handled in resolveNow() where - // `cc.resolverWrapper` is accessed. Hence, we need to hold the lock here. - cc.mu.Lock() - cc.resolverWrapper = rw - cc.mu.Unlock() - return nil -} diff --git a/vendor/google.golang.org/grpc/codes/codes.go b/vendor/google.golang.org/grpc/codes/codes.go index 11b10618..08476ad1 100644 --- a/vendor/google.golang.org/grpc/codes/codes.go +++ b/vendor/google.golang.org/grpc/codes/codes.go @@ -25,7 +25,13 @@ import ( "strconv" ) -// A Code is an unsigned 32-bit error code as defined in the gRPC spec. +// A Code is a status code defined according to the [gRPC documentation]. +// +// Only the codes defined as consts in this package are valid codes. Do not use +// other code values. Behavior of other codes is implementation-specific and +// interoperability between implementations is not guaranteed. +// +// [gRPC documentation]: https://github.com/grpc/grpc/blob/master/doc/statuscodes.md type Code uint32 const ( diff --git a/vendor/google.golang.org/grpc/credentials/tls.go b/vendor/google.golang.org/grpc/credentials/tls.go index 877b7cd2..5dafd34e 100644 --- a/vendor/google.golang.org/grpc/credentials/tls.go +++ b/vendor/google.golang.org/grpc/credentials/tls.go @@ -44,10 +44,25 @@ func (t TLSInfo) AuthType() string { return "tls" } +// cipherSuiteLookup returns the string version of a TLS cipher suite ID. +func cipherSuiteLookup(cipherSuiteID uint16) string { + for _, s := range tls.CipherSuites() { + if s.ID == cipherSuiteID { + return s.Name + } + } + for _, s := range tls.InsecureCipherSuites() { + if s.ID == cipherSuiteID { + return s.Name + } + } + return fmt.Sprintf("unknown ID: %v", cipherSuiteID) +} + // GetSecurityValue returns security info requested by channelz. func (t TLSInfo) GetSecurityValue() ChannelzSecurityValue { v := &TLSChannelzSecurityValue{ - StandardName: cipherSuiteLookup[t.State.CipherSuite], + StandardName: cipherSuiteLookup(t.State.CipherSuite), } // Currently there's no way to get LocalCertificate info from tls package. if len(t.State.PeerCertificates) > 0 { @@ -138,10 +153,39 @@ func (c *tlsCreds) OverrideServerName(serverNameOverride string) error { return nil } +// The following cipher suites are forbidden for use with HTTP/2 by +// https://datatracker.ietf.org/doc/html/rfc7540#appendix-A +var tls12ForbiddenCipherSuites = map[uint16]struct{}{ + tls.TLS_RSA_WITH_AES_128_CBC_SHA: {}, + tls.TLS_RSA_WITH_AES_256_CBC_SHA: {}, + tls.TLS_RSA_WITH_AES_128_GCM_SHA256: {}, + tls.TLS_RSA_WITH_AES_256_GCM_SHA384: {}, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: {}, + tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: {}, + tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: {}, + tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: {}, +} + // NewTLS uses c to construct a TransportCredentials based on TLS. func NewTLS(c *tls.Config) TransportCredentials { tc := &tlsCreds{credinternal.CloneTLSConfig(c)} tc.config.NextProtos = credinternal.AppendH2ToNextProtos(tc.config.NextProtos) + // If the user did not configure a MinVersion and did not configure a + // MaxVersion < 1.2, use MinVersion=1.2, which is required by + // https://datatracker.ietf.org/doc/html/rfc7540#section-9.2 + if tc.config.MinVersion == 0 && (tc.config.MaxVersion == 0 || tc.config.MaxVersion >= tls.VersionTLS12) { + tc.config.MinVersion = tls.VersionTLS12 + } + // If the user did not configure CipherSuites, use all "secure" cipher + // suites reported by the TLS package, but remove some explicitly forbidden + // by https://datatracker.ietf.org/doc/html/rfc7540#appendix-A + if tc.config.CipherSuites == nil { + for _, cs := range tls.CipherSuites() { + if _, ok := tls12ForbiddenCipherSuites[cs.ID]; !ok { + tc.config.CipherSuites = append(tc.config.CipherSuites, cs.ID) + } + } + } return tc } @@ -205,32 +249,3 @@ type TLSChannelzSecurityValue struct { LocalCertificate []byte RemoteCertificate []byte } - -var cipherSuiteLookup = map[uint16]string{ - tls.TLS_RSA_WITH_RC4_128_SHA: "TLS_RSA_WITH_RC4_128_SHA", - tls.TLS_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_RSA_WITH_3DES_EDE_CBC_SHA", - tls.TLS_RSA_WITH_AES_128_CBC_SHA: "TLS_RSA_WITH_AES_128_CBC_SHA", - tls.TLS_RSA_WITH_AES_256_CBC_SHA: "TLS_RSA_WITH_AES_256_CBC_SHA", - tls.TLS_RSA_WITH_AES_128_GCM_SHA256: "TLS_RSA_WITH_AES_128_GCM_SHA256", - tls.TLS_RSA_WITH_AES_256_GCM_SHA384: "TLS_RSA_WITH_AES_256_GCM_SHA384", - tls.TLS_ECDHE_ECDSA_WITH_RC4_128_SHA: "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", - tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", - tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_RC4_128_SHA: "TLS_ECDHE_RSA_WITH_RC4_128_SHA", - tls.TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA: "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA: "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384: "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", - tls.TLS_FALLBACK_SCSV: "TLS_FALLBACK_SCSV", - tls.TLS_RSA_WITH_AES_128_CBC_SHA256: "TLS_RSA_WITH_AES_128_CBC_SHA256", - tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", - tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256: "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305", - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305: "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305", - tls.TLS_AES_128_GCM_SHA256: "TLS_AES_128_GCM_SHA256", - tls.TLS_AES_256_GCM_SHA384: "TLS_AES_256_GCM_SHA384", - tls.TLS_CHACHA20_POLY1305_SHA256: "TLS_CHACHA20_POLY1305_SHA256", -} diff --git a/vendor/google.golang.org/grpc/dialoptions.go b/vendor/google.golang.org/grpc/dialoptions.go index cfc9fd85..ba242618 100644 --- a/vendor/google.golang.org/grpc/dialoptions.go +++ b/vendor/google.golang.org/grpc/dialoptions.go @@ -46,6 +46,7 @@ func init() { internal.WithBinaryLogger = withBinaryLogger internal.JoinDialOptions = newJoinDialOption internal.DisableGlobalDialOptions = newDisableGlobalDialOptions + internal.WithRecvBufferPool = withRecvBufferPool } // dialOptions configure a Dial call. dialOptions are set by the DialOption @@ -63,7 +64,6 @@ type dialOptions struct { block bool returnLastError bool timeout time.Duration - scChan <-chan ServiceConfig authority string binaryLogger binarylog.Logger copts transport.ConnectOptions @@ -250,19 +250,6 @@ func WithDecompressor(dc Decompressor) DialOption { }) } -// WithServiceConfig returns a DialOption which has a channel to read the -// service configuration. -// -// Deprecated: service config should be received through name resolver or via -// WithDefaultServiceConfig, as specified at -// https://github.com/grpc/grpc/blob/master/doc/service_config.md. Will be -// removed in a future 1.x release. -func WithServiceConfig(c <-chan ServiceConfig) DialOption { - return newFuncDialOption(func(o *dialOptions) { - o.scChan = c - }) -} - // WithConnectParams configures the ClientConn to use the provided ConnectParams // for creating and maintaining connections to servers. // @@ -413,6 +400,17 @@ func WithTimeout(d time.Duration) DialOption { // connections. If FailOnNonTempDialError() is set to true, and an error is // returned by f, gRPC checks the error's Temporary() method to decide if it // should try to reconnect to the network address. +// +// Note: All supported releases of Go (as of December 2023) override the OS +// defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive +// with OS defaults for keepalive time and interval, use a net.Dialer that sets +// the KeepAlive field to a negative value, and sets the SO_KEEPALIVE socket +// option to true from the Control field. For a concrete example of how to do +// this, see internal.NetDialerWithTCPKeepalive(). +// +// For more information, please see [issue 23459] in the Go github repo. +// +// [issue 23459]: https://github.com/golang/go/issues/23459 func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOption { return newFuncDialOption(func(o *dialOptions) { o.copts.Dialer = f @@ -487,7 +485,7 @@ func FailOnNonTempDialError(f bool) DialOption { // the RPCs. func WithUserAgent(s string) DialOption { return newFuncDialOption(func(o *dialOptions) { - o.copts.UserAgent = s + o.copts.UserAgent = s + " " + grpcUA }) } @@ -637,14 +635,16 @@ func withHealthCheckFunc(f internal.HealthChecker) DialOption { func defaultDialOptions() dialOptions { return dialOptions{ - healthCheckFunc: internal.HealthCheckFunc, copts: transport.ConnectOptions{ - WriteBufferSize: defaultWriteBufSize, ReadBufferSize: defaultReadBufSize, + WriteBufferSize: defaultWriteBufSize, UseProxy: true, + UserAgent: grpcUA, }, - recvBufferPool: nopBufferPool{}, - idleTimeout: 30 * time.Minute, + bs: internalbackoff.DefaultExponential, + healthCheckFunc: internal.HealthCheckFunc, + idleTimeout: 30 * time.Minute, + recvBufferPool: nopBufferPool{}, } } @@ -705,11 +705,13 @@ func WithIdleTimeout(d time.Duration) DialOption { // options are used: WithStatsHandler, EnableTracing, or binary logging. In such // cases, the shared buffer pool will be ignored. // -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. +// Deprecated: use experimental.WithRecvBufferPool instead. Will be deleted in +// v1.60.0 or later. func WithRecvBufferPool(bufferPool SharedBufferPool) DialOption { + return withRecvBufferPool(bufferPool) +} + +func withRecvBufferPool(bufferPool SharedBufferPool) DialOption { return newFuncDialOption(func(o *dialOptions) { o.recvBufferPool = bufferPool }) diff --git a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go index 4399c3df..11f91668 100644 --- a/vendor/google.golang.org/grpc/internal/buffer/unbounded.go +++ b/vendor/google.golang.org/grpc/internal/buffer/unbounded.go @@ -18,7 +18,10 @@ // Package buffer provides an implementation of an unbounded buffer. package buffer -import "sync" +import ( + "errors" + "sync" +) // Unbounded is an implementation of an unbounded buffer which does not use // extra goroutines. This is typically used for passing updates from one entity @@ -36,6 +39,7 @@ import "sync" type Unbounded struct { c chan any closed bool + closing bool mu sync.Mutex backlog []any } @@ -45,32 +49,32 @@ func NewUnbounded() *Unbounded { return &Unbounded{c: make(chan any, 1)} } +var errBufferClosed = errors.New("Put called on closed buffer.Unbounded") + // Put adds t to the unbounded buffer. -func (b *Unbounded) Put(t any) { +func (b *Unbounded) Put(t any) error { b.mu.Lock() defer b.mu.Unlock() - if b.closed { - return + if b.closing { + return errBufferClosed } if len(b.backlog) == 0 { select { case b.c <- t: - return + return nil default: } } b.backlog = append(b.backlog, t) + return nil } -// Load sends the earliest buffered data, if any, onto the read channel -// returned by Get(). Users are expected to call this every time they read a +// Load sends the earliest buffered data, if any, onto the read channel returned +// by Get(). Users are expected to call this every time they successfully read a // value from the read channel. func (b *Unbounded) Load() { b.mu.Lock() defer b.mu.Unlock() - if b.closed { - return - } if len(b.backlog) > 0 { select { case b.c <- b.backlog[0]: @@ -78,6 +82,8 @@ func (b *Unbounded) Load() { b.backlog = b.backlog[1:] default: } + } else if b.closing && !b.closed { + close(b.c) } } @@ -88,18 +94,23 @@ func (b *Unbounded) Load() { // send the next buffered value onto the channel if there is any. // // If the unbounded buffer is closed, the read channel returned by this method -// is closed. +// is closed after all data is drained. func (b *Unbounded) Get() <-chan any { return b.c } -// Close closes the unbounded buffer. +// Close closes the unbounded buffer. No subsequent data may be Put(), and the +// channel returned from Get() will be closed after all the data is read and +// Load() is called for the final time. func (b *Unbounded) Close() { b.mu.Lock() defer b.mu.Unlock() - if b.closed { + if b.closing { return } - b.closed = true - close(b.c) + b.closing = true + if len(b.backlog) == 0 { + b.closed = true + close(b.c) + } } diff --git a/vendor/google.golang.org/grpc/internal/channelz/funcs.go b/vendor/google.golang.org/grpc/internal/channelz/funcs.go index 5395e775..fc094f34 100644 --- a/vendor/google.golang.org/grpc/internal/channelz/funcs.go +++ b/vendor/google.golang.org/grpc/internal/channelz/funcs.go @@ -31,6 +31,7 @@ import ( "time" "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/internal" ) const ( @@ -58,6 +59,12 @@ func TurnOn() { } } +func init() { + internal.ChannelzTurnOffForTesting = func() { + atomic.StoreInt32(&curState, 0) + } +} + // IsOn returns whether channelz data collection is on. func IsOn() bool { return atomic.LoadInt32(&curState) == 1 diff --git a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go index 3cf10ddf..685a3cb4 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/envconfig.go @@ -36,9 +36,6 @@ var ( // "GRPC_RING_HASH_CAP". This does not override the default bounds // checking which NACKs configs specifying ring sizes > 8*1024*1024 (~8M). RingHashCap = uint64FromEnv("GRPC_RING_HASH_CAP", 4096, 1, 8*1024*1024) - // PickFirstLBConfig is set if we should support configuration of the - // pick_first LB policy. - PickFirstLBConfig = boolFromEnv("GRPC_EXPERIMENTAL_PICKFIRST_LB_CONFIG", true) // LeastRequestLB is set if we should support the least_request_experimental // LB policy, which can be enabled by setting the environment variable // "GRPC_EXPERIMENTAL_ENABLE_LEAST_REQUEST" to "true". diff --git a/vendor/google.golang.org/grpc/internal/envconfig/xds.go b/vendor/google.golang.org/grpc/internal/envconfig/xds.go index 02b4b6a1..29f234ac 100644 --- a/vendor/google.golang.org/grpc/internal/envconfig/xds.go +++ b/vendor/google.golang.org/grpc/internal/envconfig/xds.go @@ -50,46 +50,7 @@ var ( // // When both bootstrap FileName and FileContent are set, FileName is used. XDSBootstrapFileContent = os.Getenv(XDSBootstrapFileContentEnv) - // XDSRingHash indicates whether ring hash support is enabled, which can be - // disabled by setting the environment variable - // "GRPC_XDS_EXPERIMENTAL_ENABLE_RING_HASH" to "false". - XDSRingHash = boolFromEnv("GRPC_XDS_EXPERIMENTAL_ENABLE_RING_HASH", true) - // XDSClientSideSecurity is used to control processing of security - // configuration on the client-side. - // - // Note that there is no env var protection for the server-side because we - // have a brand new API on the server-side and users explicitly need to use - // the new API to get security integration on the server. - XDSClientSideSecurity = boolFromEnv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT", true) - // XDSAggregateAndDNS indicates whether processing of aggregated cluster and - // DNS cluster is enabled, which can be disabled by setting the environment - // variable "GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER" - // to "false". - XDSAggregateAndDNS = boolFromEnv("GRPC_XDS_EXPERIMENTAL_ENABLE_AGGREGATE_AND_LOGICAL_DNS_CLUSTER", true) - - // XDSRBAC indicates whether xDS configured RBAC HTTP Filter is enabled, - // which can be disabled by setting the environment variable - // "GRPC_XDS_EXPERIMENTAL_RBAC" to "false". - XDSRBAC = boolFromEnv("GRPC_XDS_EXPERIMENTAL_RBAC", true) - // XDSOutlierDetection indicates whether outlier detection support is - // enabled, which can be disabled by setting the environment variable - // "GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION" to "false". - XDSOutlierDetection = boolFromEnv("GRPC_EXPERIMENTAL_ENABLE_OUTLIER_DETECTION", true) - // XDSFederation indicates whether federation support is enabled, which can - // be enabled by setting the environment variable - // "GRPC_EXPERIMENTAL_XDS_FEDERATION" to "true". - XDSFederation = boolFromEnv("GRPC_EXPERIMENTAL_XDS_FEDERATION", true) - - // XDSRLS indicates whether processing of Cluster Specifier plugins and - // support for the RLS CLuster Specifier is enabled, which can be disabled by - // setting the environment variable "GRPC_EXPERIMENTAL_XDS_RLS_LB" to - // "false". - XDSRLS = boolFromEnv("GRPC_EXPERIMENTAL_XDS_RLS_LB", true) // C2PResolverTestOnlyTrafficDirectorURI is the TD URI for testing. C2PResolverTestOnlyTrafficDirectorURI = os.Getenv("GRPC_TEST_ONLY_GOOGLE_C2P_RESOLVER_TRAFFIC_DIRECTOR_URI") - // XDSCustomLBPolicy indicates whether Custom LB Policies are enabled, which - // can be disabled by setting the environment variable - // "GRPC_EXPERIMENTAL_XDS_CUSTOM_LB_CONFIG" to "false". - XDSCustomLBPolicy = boolFromEnv("GRPC_EXPERIMENTAL_XDS_CUSTOM_LB_CONFIG", true) ) diff --git a/vendor/google.golang.org/grpc/internal/experimental.go b/vendor/google.golang.org/grpc/internal/experimental.go new file mode 100644 index 00000000..7f7044e1 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/experimental.go @@ -0,0 +1,28 @@ +/* + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package internal + +var ( + // WithRecvBufferPool is implemented by the grpc package and returns a dial + // option to configure a shared buffer pool for a grpc.ClientConn. + WithRecvBufferPool any // func (grpc.SharedBufferPool) grpc.DialOption + + // RecvBufferPool is implemented by the grpc package and returns a server + // option to configure a shared buffer pool for a grpc.Server. + RecvBufferPool any // func (grpc.SharedBufferPool) grpc.ServerOption +) diff --git a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go index 900917db..f7f40a16 100644 --- a/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go +++ b/vendor/google.golang.org/grpc/internal/grpcsync/callback_serializer.go @@ -20,7 +20,6 @@ package grpcsync import ( "context" - "sync" "google.golang.org/grpc/internal/buffer" ) @@ -38,8 +37,6 @@ type CallbackSerializer struct { done chan struct{} callbacks *buffer.Unbounded - closedMu sync.Mutex - closed bool } // NewCallbackSerializer returns a new CallbackSerializer instance. The provided @@ -65,56 +62,34 @@ func NewCallbackSerializer(ctx context.Context) *CallbackSerializer { // callbacks to be executed by the serializer. It is not possible to add // callbacks once the context passed to NewCallbackSerializer is cancelled. func (cs *CallbackSerializer) Schedule(f func(ctx context.Context)) bool { - cs.closedMu.Lock() - defer cs.closedMu.Unlock() - - if cs.closed { - return false - } - cs.callbacks.Put(f) - return true + return cs.callbacks.Put(f) == nil } func (cs *CallbackSerializer) run(ctx context.Context) { - var backlog []func(context.Context) - defer close(cs.done) + + // TODO: when Go 1.21 is the oldest supported version, this loop and Close + // can be replaced with: + // + // context.AfterFunc(ctx, cs.callbacks.Close) for ctx.Err() == nil { select { case <-ctx.Done(): // Do nothing here. Next iteration of the for loop will not happen, // since ctx.Err() would be non-nil. - case callback, ok := <-cs.callbacks.Get(): - if !ok { - return - } + case cb := <-cs.callbacks.Get(): cs.callbacks.Load() - callback.(func(ctx context.Context))(ctx) + cb.(func(context.Context))(ctx) } } - // Fetch pending callbacks if any, and execute them before returning from - // this method and closing cs.done. - cs.closedMu.Lock() - cs.closed = true - backlog = cs.fetchPendingCallbacks() + // Close the buffer to prevent new callbacks from being added. cs.callbacks.Close() - cs.closedMu.Unlock() - for _, b := range backlog { - b(ctx) - } -} -func (cs *CallbackSerializer) fetchPendingCallbacks() []func(context.Context) { - var backlog []func(context.Context) - for { - select { - case b := <-cs.callbacks.Get(): - backlog = append(backlog, b.(func(context.Context))) - cs.callbacks.Load() - default: - return backlog - } + // Run all pending callbacks. + for cb := range cs.callbacks.Get() { + cs.callbacks.Load() + cb.(func(context.Context))(ctx) } } diff --git a/vendor/google.golang.org/grpc/internal/idle/idle.go b/vendor/google.golang.org/grpc/internal/idle/idle.go index 6c272476..fe49cb74 100644 --- a/vendor/google.golang.org/grpc/internal/idle/idle.go +++ b/vendor/google.golang.org/grpc/internal/idle/idle.go @@ -26,8 +26,6 @@ import ( "sync" "sync/atomic" "time" - - "google.golang.org/grpc/grpclog" ) // For overriding in unit tests. @@ -39,27 +37,12 @@ var timeAfterFunc = func(d time.Duration, f func()) *time.Timer { // and exit from idle mode. type Enforcer interface { ExitIdleMode() error - EnterIdleMode() error + EnterIdleMode() } -// Manager defines the functionality required to track RPC activity on a -// channel. -type Manager interface { - OnCallBegin() error - OnCallEnd() - Close() -} - -type noopManager struct{} - -func (noopManager) OnCallBegin() error { return nil } -func (noopManager) OnCallEnd() {} -func (noopManager) Close() {} - -// manager implements the Manager interface. It uses atomic operations to -// synchronize access to shared state and a mutex to guarantee mutual exclusion -// in a critical section. -type manager struct { +// Manager implements idleness detection and calls the configured Enforcer to +// enter/exit idle mode when appropriate. Must be created by NewManager. +type Manager struct { // State accessed atomically. lastCallEndTime int64 // Unix timestamp in nanos; time when the most recent RPC completed. activeCallsCount int32 // Count of active RPCs; -math.MaxInt32 means channel is idle or is trying to get there. @@ -69,8 +52,7 @@ type manager struct { // Can be accessed without atomics or mutex since these are set at creation // time and read-only after that. enforcer Enforcer // Functionality provided by grpc.ClientConn. - timeout int64 // Idle timeout duration nanos stored as an int64. - logger grpclog.LoggerV2 + timeout time.Duration // idleMu is used to guarantee mutual exclusion in two scenarios: // - Opposing intentions: @@ -88,57 +70,48 @@ type manager struct { timer *time.Timer } -// ManagerOptions is a collection of options used by -// NewManager. -type ManagerOptions struct { - Enforcer Enforcer - Timeout time.Duration - Logger grpclog.LoggerV2 -} - // NewManager creates a new idleness manager implementation for the -// given idle timeout. -func NewManager(opts ManagerOptions) Manager { - if opts.Timeout == 0 { - return noopManager{} +// given idle timeout. It begins in idle mode. +func NewManager(enforcer Enforcer, timeout time.Duration) *Manager { + return &Manager{ + enforcer: enforcer, + timeout: timeout, + actuallyIdle: true, + activeCallsCount: -math.MaxInt32, } - - m := &manager{ - enforcer: opts.Enforcer, - timeout: int64(opts.Timeout), - logger: opts.Logger, - } - m.timer = timeAfterFunc(opts.Timeout, m.handleIdleTimeout) - return m } -// resetIdleTimer resets the idle timer to the given duration. This method -// should only be called from the timer callback. -func (m *manager) resetIdleTimer(d time.Duration) { - m.idleMu.Lock() - defer m.idleMu.Unlock() - - if m.timer == nil { - // Only close sets timer to nil. We are done. +// resetIdleTimerLocked resets the idle timer to the given duration. Called +// when exiting idle mode or when the timer fires and we need to reset it. +func (m *Manager) resetIdleTimerLocked(d time.Duration) { + if m.isClosed() || m.timeout == 0 || m.actuallyIdle { return } // It is safe to ignore the return value from Reset() because this method is - // only ever called from the timer callback, which means the timer has - // already fired. - m.timer.Reset(d) + // only ever called from the timer callback or when exiting idle mode. + if m.timer != nil { + m.timer.Stop() + } + m.timer = timeAfterFunc(d, m.handleIdleTimeout) +} + +func (m *Manager) resetIdleTimer(d time.Duration) { + m.idleMu.Lock() + defer m.idleMu.Unlock() + m.resetIdleTimerLocked(d) } // handleIdleTimeout is the timer callback that is invoked upon expiry of the // configured idle timeout. The channel is considered inactive if there are no // ongoing calls and no RPC activity since the last time the timer fired. -func (m *manager) handleIdleTimeout() { +func (m *Manager) handleIdleTimeout() { if m.isClosed() { return } if atomic.LoadInt32(&m.activeCallsCount) > 0 { - m.resetIdleTimer(time.Duration(m.timeout)) + m.resetIdleTimer(m.timeout) return } @@ -148,24 +121,12 @@ func (m *manager) handleIdleTimeout() { // Set the timer to fire after a duration of idle timeout, calculated // from the time the most recent RPC completed. atomic.StoreInt32(&m.activeSinceLastTimerCheck, 0) - m.resetIdleTimer(time.Duration(atomic.LoadInt64(&m.lastCallEndTime) + m.timeout - time.Now().UnixNano())) + m.resetIdleTimer(time.Duration(atomic.LoadInt64(&m.lastCallEndTime)-time.Now().UnixNano()) + m.timeout) return } - // This CAS operation is extremely likely to succeed given that there has - // been no activity since the last time we were here. Setting the - // activeCallsCount to -math.MaxInt32 indicates to OnCallBegin() that the - // channel is either in idle mode or is trying to get there. - if !atomic.CompareAndSwapInt32(&m.activeCallsCount, 0, -math.MaxInt32) { - // This CAS operation can fail if an RPC started after we checked for - // activity at the top of this method, or one was ongoing from before - // the last time we were here. In both case, reset the timer and return. - m.resetIdleTimer(time.Duration(m.timeout)) - return - } - - // Now that we've set the active calls count to -math.MaxInt32, it's time to - // actually move to idle mode. + // Now that we've checked that there has been no activity, attempt to enter + // idle mode, which is very likely to succeed. if m.tryEnterIdleMode() { // Successfully entered idle mode. No timer needed until we exit idle. return @@ -174,8 +135,7 @@ func (m *manager) handleIdleTimeout() { // Failed to enter idle mode due to a concurrent RPC that kept the channel // active, or because of an error from the channel. Undo the attempt to // enter idle, and reset the timer to try again later. - atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) - m.resetIdleTimer(time.Duration(m.timeout)) + m.resetIdleTimer(m.timeout) } // tryEnterIdleMode instructs the channel to enter idle mode. But before @@ -185,36 +145,49 @@ func (m *manager) handleIdleTimeout() { // Return value indicates whether or not the channel moved to idle mode. // // Holds idleMu which ensures mutual exclusion with exitIdleMode. -func (m *manager) tryEnterIdleMode() bool { +func (m *Manager) tryEnterIdleMode() bool { + // Setting the activeCallsCount to -math.MaxInt32 indicates to OnCallBegin() + // that the channel is either in idle mode or is trying to get there. + if !atomic.CompareAndSwapInt32(&m.activeCallsCount, 0, -math.MaxInt32) { + // This CAS operation can fail if an RPC started after we checked for + // activity in the timer handler, or one was ongoing from before the + // last time the timer fired, or if a test is attempting to enter idle + // mode without checking. In all cases, abort going into idle mode. + return false + } + // N.B. if we fail to enter idle mode after this, we must re-add + // math.MaxInt32 to m.activeCallsCount. + m.idleMu.Lock() defer m.idleMu.Unlock() if atomic.LoadInt32(&m.activeCallsCount) != -math.MaxInt32 { // We raced and lost to a new RPC. Very rare, but stop entering idle. + atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) return false } if atomic.LoadInt32(&m.activeSinceLastTimerCheck) == 1 { - // An very short RPC could have come in (and also finished) after we + // A very short RPC could have come in (and also finished) after we // checked for calls count and activity in handleIdleTimeout(), but // before the CAS operation. So, we need to check for activity again. + atomic.AddInt32(&m.activeCallsCount, math.MaxInt32) return false } - // No new RPCs have come in since we last set the active calls count value - // -math.MaxInt32 in the timer callback. And since we have the lock, it is - // safe to enter idle mode now. - if err := m.enforcer.EnterIdleMode(); err != nil { - m.logger.Errorf("Failed to enter idle mode: %v", err) - return false - } - - // Successfully entered idle mode. + // No new RPCs have come in since we set the active calls count value to + // -math.MaxInt32. And since we have the lock, it is safe to enter idle mode + // unconditionally now. + m.enforcer.EnterIdleMode() m.actuallyIdle = true return true } +func (m *Manager) EnterIdleModeForTesting() { + m.tryEnterIdleMode() +} + // OnCallBegin is invoked at the start of every RPC. -func (m *manager) OnCallBegin() error { +func (m *Manager) OnCallBegin() error { if m.isClosed() { return nil } @@ -227,7 +200,7 @@ func (m *manager) OnCallBegin() error { // Channel is either in idle mode or is in the process of moving to idle // mode. Attempt to exit idle mode to allow this RPC. - if err := m.exitIdleMode(); err != nil { + if err := m.ExitIdleMode(); err != nil { // Undo the increment to calls count, and return an error causing the // RPC to fail. atomic.AddInt32(&m.activeCallsCount, -1) @@ -238,28 +211,30 @@ func (m *manager) OnCallBegin() error { return nil } -// exitIdleMode instructs the channel to exit idle mode. -// -// Holds idleMu which ensures mutual exclusion with tryEnterIdleMode. -func (m *manager) exitIdleMode() error { +// ExitIdleMode instructs m to call the enforcer's ExitIdleMode and update m's +// internal state. +func (m *Manager) ExitIdleMode() error { + // Holds idleMu which ensures mutual exclusion with tryEnterIdleMode. m.idleMu.Lock() defer m.idleMu.Unlock() - if !m.actuallyIdle { - // This can happen in two scenarios: + if m.isClosed() || !m.actuallyIdle { + // This can happen in three scenarios: // - handleIdleTimeout() set the calls count to -math.MaxInt32 and called // tryEnterIdleMode(). But before the latter could grab the lock, an RPC // came in and OnCallBegin() noticed that the calls count is negative. // - Channel is in idle mode, and multiple new RPCs come in at the same // time, all of them notice a negative calls count in OnCallBegin and get // here. The first one to get the lock would got the channel to exit idle. + // - Channel is not in idle mode, and the user calls Connect which calls + // m.ExitIdleMode. // - // Either way, nothing to do here. + // In any case, there is nothing to do here. return nil } if err := m.enforcer.ExitIdleMode(); err != nil { - return fmt.Errorf("channel failed to exit idle mode: %v", err) + return fmt.Errorf("failed to exit idle mode: %w", err) } // Undo the idle entry process. This also respects any new RPC attempts. @@ -267,12 +242,12 @@ func (m *manager) exitIdleMode() error { m.actuallyIdle = false // Start a new timer to fire after the configured idle timeout. - m.timer = timeAfterFunc(time.Duration(m.timeout), m.handleIdleTimeout) + m.resetIdleTimerLocked(m.timeout) return nil } // OnCallEnd is invoked at the end of every RPC. -func (m *manager) OnCallEnd() { +func (m *Manager) OnCallEnd() { if m.isClosed() { return } @@ -287,15 +262,17 @@ func (m *manager) OnCallEnd() { atomic.AddInt32(&m.activeCallsCount, -1) } -func (m *manager) isClosed() bool { +func (m *Manager) isClosed() bool { return atomic.LoadInt32(&m.closed) == 1 } -func (m *manager) Close() { +func (m *Manager) Close() { atomic.StoreInt32(&m.closed, 1) m.idleMu.Lock() - m.timer.Stop() - m.timer = nil + if m.timer != nil { + m.timer.Stop() + m.timer = nil + } m.idleMu.Unlock() } diff --git a/vendor/google.golang.org/grpc/internal/internal.go b/vendor/google.golang.org/grpc/internal/internal.go index 0d94c63e..2549fe8e 100644 --- a/vendor/google.golang.org/grpc/internal/internal.go +++ b/vendor/google.golang.org/grpc/internal/internal.go @@ -73,6 +73,11 @@ var ( // xDS-enabled server invokes this method on a grpc.Server when a particular // listener moves to "not-serving" mode. DrainServerTransports any // func(*grpc.Server, string) + // IsRegisteredMethod returns whether the passed in method is registered as + // a method on the server. + IsRegisteredMethod any // func(*grpc.Server, string) bool + // ServerFromContext returns the server from the context. + ServerFromContext any // func(context.Context) *grpc.Server // AddGlobalServerOptions adds an array of ServerOption that will be // effective globally for newly created servers. The priority will be: 1. // user-provided; 2. this method; 3. default values. @@ -177,10 +182,12 @@ var ( GRPCResolverSchemeExtraMetadata string = "xds" // EnterIdleModeForTesting gets the ClientConn to enter IDLE mode. - EnterIdleModeForTesting any // func(*grpc.ClientConn) error + EnterIdleModeForTesting any // func(*grpc.ClientConn) // ExitIdleModeForTesting gets the ClientConn to exit IDLE mode. ExitIdleModeForTesting any // func(*grpc.ClientConn) error + + ChannelzTurnOffForTesting func() ) // HealthChecker defines the signature of the client-side LB channel health checking function. diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go index 99e1e5b3..b66dcb21 100644 --- a/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/dns_resolver.go @@ -23,7 +23,6 @@ package dns import ( "context" "encoding/json" - "errors" "fmt" "net" "os" @@ -37,6 +36,7 @@ import ( "google.golang.org/grpc/internal/backoff" "google.golang.org/grpc/internal/envconfig" "google.golang.org/grpc/internal/grpcrand" + "google.golang.org/grpc/internal/resolver/dns/internal" "google.golang.org/grpc/resolver" "google.golang.org/grpc/serviceconfig" ) @@ -47,15 +47,11 @@ var EnableSRVLookups = false var logger = grpclog.Component("dns") -// Globals to stub out in tests. TODO: Perhaps these two can be combined into a -// single variable for testing the resolver? -var ( - newTimer = time.NewTimer - newTimerDNSResRate = time.NewTimer -) - func init() { resolver.Register(NewBuilder()) + internal.TimeAfterFunc = time.After + internal.NewNetResolver = newNetResolver + internal.AddressDialer = addressDialer } const ( @@ -70,23 +66,6 @@ const ( txtAttribute = "grpc_config=" ) -var ( - errMissingAddr = errors.New("dns resolver: missing address") - - // Addresses ending with a colon that is supposed to be the separator - // between host and port is not allowed. E.g. "::" is a valid address as - // it is an IPv6 address (host only) and "[::]:" is invalid as it ends with - // a colon as the host and port separator - errEndsWithColon = errors.New("dns resolver: missing port after port-separator colon") -) - -var ( - defaultResolver netResolver = net.DefaultResolver - // To prevent excessive re-resolution, we enforce a rate limit on DNS - // resolution requests. - minDNSResRate = 30 * time.Second -) - var addressDialer = func(address string) func(context.Context, string, string) (net.Conn, error) { return func(ctx context.Context, network, _ string) (net.Conn, error) { var dialer net.Dialer @@ -94,7 +73,11 @@ var addressDialer = func(address string) func(context.Context, string, string) ( } } -var newNetResolver = func(authority string) (netResolver, error) { +var newNetResolver = func(authority string) (internal.NetResolver, error) { + if authority == "" { + return net.DefaultResolver, nil + } + host, port, err := parseTarget(authority, defaultDNSSvrPort) if err != nil { return nil, err @@ -104,7 +87,7 @@ var newNetResolver = func(authority string) (netResolver, error) { return &net.Resolver{ PreferGo: true, - Dial: addressDialer(authorityWithPort), + Dial: internal.AddressDialer(authorityWithPort), }, nil } @@ -142,13 +125,9 @@ func (b *dnsBuilder) Build(target resolver.Target, cc resolver.ClientConn, opts disableServiceConfig: opts.DisableServiceConfig, } - if target.URL.Host == "" { - d.resolver = defaultResolver - } else { - d.resolver, err = newNetResolver(target.URL.Host) - if err != nil { - return nil, err - } + d.resolver, err = internal.NewNetResolver(target.URL.Host) + if err != nil { + return nil, err } d.wg.Add(1) @@ -161,12 +140,6 @@ func (b *dnsBuilder) Scheme() string { return "dns" } -type netResolver interface { - LookupHost(ctx context.Context, host string) (addrs []string, err error) - LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error) - LookupTXT(ctx context.Context, name string) (txts []string, err error) -} - // deadResolver is a resolver that does nothing. type deadResolver struct{} @@ -178,7 +151,7 @@ func (deadResolver) Close() {} type dnsResolver struct { host string port string - resolver netResolver + resolver internal.NetResolver ctx context.Context cancel context.CancelFunc cc resolver.ClientConn @@ -223,29 +196,27 @@ func (d *dnsResolver) watcher() { err = d.cc.UpdateState(*state) } - var timer *time.Timer + var waitTime time.Duration if err == nil { // Success resolving, wait for the next ResolveNow. However, also wait 30 // seconds at the very least to prevent constantly re-resolving. backoffIndex = 1 - timer = newTimerDNSResRate(minDNSResRate) + waitTime = internal.MinResolutionRate select { case <-d.ctx.Done(): - timer.Stop() return case <-d.rn: } } else { // Poll on an error found in DNS Resolver or an error received from // ClientConn. - timer = newTimer(backoff.DefaultExponential.Backoff(backoffIndex)) + waitTime = backoff.DefaultExponential.Backoff(backoffIndex) backoffIndex++ } select { case <-d.ctx.Done(): - timer.Stop() return - case <-timer.C: + case <-internal.TimeAfterFunc(waitTime): } } } @@ -387,7 +358,7 @@ func formatIP(addr string) (addrIP string, ok bool) { // target: ":80" defaultPort: "443" returns host: "localhost", port: "80" func parseTarget(target, defaultPort string) (host, port string, err error) { if target == "" { - return "", "", errMissingAddr + return "", "", internal.ErrMissingAddr } if ip := net.ParseIP(target); ip != nil { // target is an IPv4 or IPv6(without brackets) address @@ -397,7 +368,7 @@ func parseTarget(target, defaultPort string) (host, port string, err error) { if port == "" { // If the port field is empty (target ends with colon), e.g. "[::1]:", // this is an error. - return "", "", errEndsWithColon + return "", "", internal.ErrEndsWithColon } // target has port, i.e ipv4-host:port, [ipv6-host]:port, host-name:port if host == "" { diff --git a/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go b/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go new file mode 100644 index 00000000..c7fc557d --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/resolver/dns/internal/internal.go @@ -0,0 +1,70 @@ +/* + * + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package internal contains functionality internal to the dns resolver package. +package internal + +import ( + "context" + "errors" + "net" + "time" +) + +// NetResolver groups the methods on net.Resolver that are used by the DNS +// resolver implementation. This allows the default net.Resolver instance to be +// overidden from tests. +type NetResolver interface { + LookupHost(ctx context.Context, host string) (addrs []string, err error) + LookupSRV(ctx context.Context, service, proto, name string) (cname string, addrs []*net.SRV, err error) + LookupTXT(ctx context.Context, name string) (txts []string, err error) +} + +var ( + // ErrMissingAddr is the error returned when building a DNS resolver when + // the provided target name is empty. + ErrMissingAddr = errors.New("dns resolver: missing address") + + // ErrEndsWithColon is the error returned when building a DNS resolver when + // the provided target name ends with a colon that is supposed to be the + // separator between host and port. E.g. "::" is a valid address as it is + // an IPv6 address (host only) and "[::]:" is invalid as it ends with a + // colon as the host and port separator + ErrEndsWithColon = errors.New("dns resolver: missing port after port-separator colon") +) + +// The following vars are overridden from tests. +var ( + // MinResolutionRate is the minimum rate at which re-resolutions are + // allowed. This helps to prevent excessive re-resolution. + MinResolutionRate = 30 * time.Second + + // TimeAfterFunc is used by the DNS resolver to wait for the given duration + // to elapse. In non-test code, this is implemented by time.After. In test + // code, this can be used to control the amount of time the resolver is + // blocked waiting for the duration to elapse. + TimeAfterFunc func(time.Duration) <-chan time.Time + + // NewNetResolver returns the net.Resolver instance for the given target. + NewNetResolver func(string) (NetResolver, error) + + // AddressDialer is the dialer used to dial the DNS server. It accepts the + // Host portion of the URL corresponding to the user's dial target and + // returns a dial function. + AddressDialer func(address string) func(context.Context, string, string) (net.Conn, error) +) diff --git a/vendor/google.golang.org/grpc/internal/tcp_keepalive_nonunix.go b/vendor/google.golang.org/grpc/internal/tcp_keepalive_nonunix.go new file mode 100644 index 00000000..aeffd3e1 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/tcp_keepalive_nonunix.go @@ -0,0 +1,29 @@ +//go:build !unix + +/* + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package internal + +import ( + "net" +) + +// NetDialerWithTCPKeepalive returns a vanilla net.Dialer on non-unix platforms. +func NetDialerWithTCPKeepalive() *net.Dialer { + return &net.Dialer{} +} diff --git a/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go b/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go new file mode 100644 index 00000000..078137b7 --- /dev/null +++ b/vendor/google.golang.org/grpc/internal/tcp_keepalive_unix.go @@ -0,0 +1,54 @@ +//go:build unix + +/* + * Copyright 2023 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package internal + +import ( + "net" + "syscall" + "time" + + "golang.org/x/sys/unix" +) + +// NetDialerWithTCPKeepalive returns a net.Dialer that enables TCP keepalives on +// the underlying connection with OS default values for keepalive parameters. +// +// TODO: Once https://github.com/golang/go/issues/62254 lands, and the +// appropriate Go version becomes less than our least supported Go version, we +// should look into using the new API to make things more straightforward. +func NetDialerWithTCPKeepalive() *net.Dialer { + return &net.Dialer{ + // Setting a negative value here prevents the Go stdlib from overriding + // the values of TCP keepalive time and interval. It also prevents the + // Go stdlib from enabling TCP keepalives by default. + KeepAlive: time.Duration(-1), + // This method is called after the underlying network socket is created, + // but before dialing the socket (or calling its connect() method). The + // combination of unconditionally enabling TCP keepalives here, and + // disabling the overriding of TCP keepalive parameters by setting the + // KeepAlive field to a negative value above, results in OS defaults for + // the TCP keealive interval and time parameters. + Control: func(_, _ string, c syscall.RawConn) error { + return c.Control(func(fd uintptr) { + unix.SetsockoptInt(int(fd), unix.SOL_SOCKET, unix.SO_KEEPALIVE, 1) + }) + }, + } +} diff --git a/vendor/google.golang.org/grpc/internal/transport/handler_server.go b/vendor/google.golang.org/grpc/internal/transport/handler_server.go index 17f7a21b..a9d70e2a 100644 --- a/vendor/google.golang.org/grpc/internal/transport/handler_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/handler_server.go @@ -75,11 +75,25 @@ func NewServerHandlerTransport(w http.ResponseWriter, r *http.Request, stats []s return nil, errors.New(msg) } + var localAddr net.Addr + if la := r.Context().Value(http.LocalAddrContextKey); la != nil { + localAddr, _ = la.(net.Addr) + } + var authInfo credentials.AuthInfo + if r.TLS != nil { + authInfo = credentials.TLSInfo{State: *r.TLS, CommonAuthInfo: credentials.CommonAuthInfo{SecurityLevel: credentials.PrivacyAndIntegrity}} + } + p := peer.Peer{ + Addr: strAddr(r.RemoteAddr), + LocalAddr: localAddr, + AuthInfo: authInfo, + } st := &serverHandlerTransport{ rw: w, req: r, closedCh: make(chan struct{}), writes: make(chan func()), + peer: p, contentType: contentType, contentSubtype: contentSubtype, stats: stats, @@ -134,6 +148,8 @@ type serverHandlerTransport struct { headerMD metadata.MD + peer peer.Peer + closeOnce sync.Once closedCh chan struct{} // closed on Close @@ -165,7 +181,13 @@ func (ht *serverHandlerTransport) Close(err error) { }) } -func (ht *serverHandlerTransport) RemoteAddr() net.Addr { return strAddr(ht.req.RemoteAddr) } +func (ht *serverHandlerTransport) Peer() *peer.Peer { + return &peer.Peer{ + Addr: ht.peer.Addr, + LocalAddr: ht.peer.LocalAddr, + AuthInfo: ht.peer.AuthInfo, + } +} // strAddr is a net.Addr backed by either a TCP "ip:port" string, or // the empty string if unknown. @@ -347,10 +369,8 @@ func (ht *serverHandlerTransport) WriteHeader(s *Stream, md metadata.MD) error { return err } -func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream)) { +func (ht *serverHandlerTransport) HandleStreams(ctx context.Context, startStream func(*Stream)) { // With this transport type there will be exactly 1 stream: this HTTP request. - - ctx := ht.req.Context() var cancel context.CancelFunc if ht.timeoutSet { ctx, cancel = context.WithTimeout(ctx, ht.timeout) @@ -370,34 +390,19 @@ func (ht *serverHandlerTransport) HandleStreams(startStream func(*Stream)) { ht.Close(errors.New("request is done processing")) }() - req := ht.req - - s := &Stream{ - id: 0, // irrelevant - requestRead: func(int) {}, - cancel: cancel, - buf: newRecvBuffer(), - st: ht, - method: req.URL.Path, - recvCompress: req.Header.Get("grpc-encoding"), - contentSubtype: ht.contentSubtype, - } - pr := &peer.Peer{ - Addr: ht.RemoteAddr(), - } - if req.TLS != nil { - pr.AuthInfo = credentials.TLSInfo{State: *req.TLS, CommonAuthInfo: credentials.CommonAuthInfo{SecurityLevel: credentials.PrivacyAndIntegrity}} - } ctx = metadata.NewIncomingContext(ctx, ht.headerMD) - s.ctx = peer.NewContext(ctx, pr) - for _, sh := range ht.stats { - s.ctx = sh.TagRPC(s.ctx, &stats.RPCTagInfo{FullMethodName: s.method}) - inHeader := &stats.InHeader{ - FullMethod: s.method, - RemoteAddr: ht.RemoteAddr(), - Compression: s.recvCompress, - } - sh.HandleRPC(s.ctx, inHeader) + req := ht.req + s := &Stream{ + id: 0, // irrelevant + ctx: ctx, + requestRead: func(int) {}, + cancel: cancel, + buf: newRecvBuffer(), + st: ht, + method: req.URL.Path, + recvCompress: req.Header.Get("grpc-encoding"), + contentSubtype: ht.contentSubtype, + headerWireLength: 0, // won't have access to header wire length until golang/go#18997. } s.trReader = &transportReader{ reader: &recvBufferReader{ctx: s.ctx, ctxDone: s.ctx.Done(), recv: s.buf, freeBuffer: func(*bytes.Buffer) {}}, diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_client.go b/vendor/google.golang.org/grpc/internal/transport/http2_client.go index d6f5c493..59f67655 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_client.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_client.go @@ -36,6 +36,7 @@ import ( "golang.org/x/net/http2/hpack" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" + "google.golang.org/grpc/internal" "google.golang.org/grpc/internal/channelz" icredentials "google.golang.org/grpc/internal/credentials" "google.golang.org/grpc/internal/grpclog" @@ -43,7 +44,7 @@ import ( "google.golang.org/grpc/internal/grpcutil" imetadata "google.golang.org/grpc/internal/metadata" istatus "google.golang.org/grpc/internal/status" - "google.golang.org/grpc/internal/syscall" + isyscall "google.golang.org/grpc/internal/syscall" "google.golang.org/grpc/internal/transport/networktype" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" @@ -176,7 +177,7 @@ func dial(ctx context.Context, fn func(context.Context, string) (net.Conn, error if networkType == "tcp" && useProxy { return proxyDial(ctx, address, grpcUA) } - return (&net.Dialer{}).DialContext(ctx, networkType, address) + return internal.NetDialerWithTCPKeepalive().DialContext(ctx, networkType, address) } func isTemporary(err error) bool { @@ -262,7 +263,7 @@ func newHTTP2Client(connectCtx, ctx context.Context, addr resolver.Address, opts } keepaliveEnabled := false if kp.Time != infinity { - if err = syscall.SetTCPUserTimeout(conn, kp.Timeout); err != nil { + if err = isyscall.SetTCPUserTimeout(conn, kp.Timeout); err != nil { return nil, connectionErrorf(false, err, "transport: failed to set TCP_USER_TIMEOUT: %v", err) } keepaliveEnabled = true @@ -493,8 +494,9 @@ func (t *http2Client) newStream(ctx context.Context, callHdr *CallHdr) *Stream { func (t *http2Client) getPeer() *peer.Peer { return &peer.Peer{ - Addr: t.remoteAddr, - AuthInfo: t.authInfo, // Can be nil + Addr: t.remoteAddr, + AuthInfo: t.authInfo, // Can be nil + LocalAddr: t.localAddr, } } diff --git a/vendor/google.golang.org/grpc/internal/transport/http2_server.go b/vendor/google.golang.org/grpc/internal/transport/http2_server.go index 6fa1eb41..680c9eba 100644 --- a/vendor/google.golang.org/grpc/internal/transport/http2_server.go +++ b/vendor/google.golang.org/grpc/internal/transport/http2_server.go @@ -68,18 +68,15 @@ var serverConnectionCounter uint64 // http2Server implements the ServerTransport interface with HTTP2. type http2Server struct { - lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. - ctx context.Context - done chan struct{} - conn net.Conn - loopy *loopyWriter - readerDone chan struct{} // sync point to enable testing. - writerDone chan struct{} // sync point to enable testing. - remoteAddr net.Addr - localAddr net.Addr - authInfo credentials.AuthInfo // auth info about the connection - inTapHandle tap.ServerInHandle - framer *framer + lastRead int64 // Keep this field 64-bit aligned. Accessed atomically. + done chan struct{} + conn net.Conn + loopy *loopyWriter + readerDone chan struct{} // sync point to enable testing. + loopyWriterDone chan struct{} + peer peer.Peer + inTapHandle tap.ServerInHandle + framer *framer // The max number of concurrent streams. maxStreams uint32 // controlBuf delivers all the control related tasks (e.g., window @@ -243,16 +240,18 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, } done := make(chan struct{}) + peer := peer.Peer{ + Addr: conn.RemoteAddr(), + LocalAddr: conn.LocalAddr(), + AuthInfo: authInfo, + } t := &http2Server{ - ctx: setConnection(context.Background(), rawConn), done: done, conn: conn, - remoteAddr: conn.RemoteAddr(), - localAddr: conn.LocalAddr(), - authInfo: authInfo, + peer: peer, framer: framer, readerDone: make(chan struct{}), - writerDone: make(chan struct{}), + loopyWriterDone: make(chan struct{}), maxStreams: config.MaxStreams, inTapHandle: config.InTapHandle, fc: &trInFlow{limit: uint32(icwz)}, @@ -267,8 +266,6 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, bufferPool: newBufferPool(), } t.logger = prefixLoggerForServerTransport(t) - // Add peer information to the http2server context. - t.ctx = peer.NewContext(t.ctx, t.getPeer()) t.controlBuf = newControlBuffer(t.done) if dynamicWindow { @@ -277,15 +274,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, updateFlowControl: t.updateFlowControl, } } - for _, sh := range t.stats { - t.ctx = sh.TagConn(t.ctx, &stats.ConnTagInfo{ - RemoteAddr: t.remoteAddr, - LocalAddr: t.localAddr, - }) - connBegin := &stats.ConnBegin{} - sh.HandleConn(t.ctx, connBegin) - } - t.channelzID, err = channelz.RegisterNormalSocket(t, config.ChannelzParentID, fmt.Sprintf("%s -> %s", t.remoteAddr, t.localAddr)) + t.channelzID, err = channelz.RegisterNormalSocket(t, config.ChannelzParentID, fmt.Sprintf("%s -> %s", t.peer.Addr, t.peer.LocalAddr)) if err != nil { return nil, err } @@ -334,7 +323,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, t.loopy = newLoopyWriter(serverSide, t.framer, t.controlBuf, t.bdpEst, t.conn, t.logger) t.loopy.ssGoAwayHandler = t.outgoingGoAwayHandler t.loopy.run() - close(t.writerDone) + close(t.loopyWriterDone) }() go t.keepalive() return t, nil @@ -342,7 +331,7 @@ func NewServerTransport(conn net.Conn, config *ServerConfig) (_ ServerTransport, // operateHeaders takes action on the decoded headers. Returns an error if fatal // error encountered and transport needs to close, otherwise returns nil. -func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func(*Stream)) error { +func (t *http2Server) operateHeaders(ctx context.Context, frame *http2.MetaHeadersFrame, handle func(*Stream)) error { // Acquire max stream ID lock for entire duration t.maxStreamMu.Lock() defer t.maxStreamMu.Unlock() @@ -369,10 +358,11 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( buf := newRecvBuffer() s := &Stream{ - id: streamID, - st: t, - buf: buf, - fc: &inFlow{limit: uint32(t.initialWindowSize)}, + id: streamID, + st: t, + buf: buf, + fc: &inFlow{limit: uint32(t.initialWindowSize)}, + headerWireLength: int(frame.Header().Length), } var ( // if false, content-type was missing or invalid @@ -511,9 +501,9 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( s.state = streamReadDone } if timeoutSet { - s.ctx, s.cancel = context.WithTimeout(t.ctx, timeout) + s.ctx, s.cancel = context.WithTimeout(ctx, timeout) } else { - s.ctx, s.cancel = context.WithCancel(t.ctx) + s.ctx, s.cancel = context.WithCancel(ctx) } // Attach the received metadata to the context. @@ -592,18 +582,6 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( s.requestRead = func(n int) { t.adjustWindow(s, uint32(n)) } - for _, sh := range t.stats { - s.ctx = sh.TagRPC(s.ctx, &stats.RPCTagInfo{FullMethodName: s.method}) - inHeader := &stats.InHeader{ - FullMethod: s.method, - RemoteAddr: t.remoteAddr, - LocalAddr: t.localAddr, - Compression: s.recvCompress, - WireLength: int(frame.Header().Length), - Header: mdata.Copy(), - } - sh.HandleRPC(s.ctx, inHeader) - } s.ctxDone = s.ctx.Done() s.wq = newWriteQuota(defaultWriteQuota, s.ctxDone) s.trReader = &transportReader{ @@ -629,8 +607,11 @@ func (t *http2Server) operateHeaders(frame *http2.MetaHeadersFrame, handle func( // HandleStreams receives incoming streams using the given handler. This is // typically run in a separate goroutine. // traceCtx attaches trace to ctx and returns the new context. -func (t *http2Server) HandleStreams(handle func(*Stream)) { - defer close(t.readerDone) +func (t *http2Server) HandleStreams(ctx context.Context, handle func(*Stream)) { + defer func() { + <-t.loopyWriterDone + close(t.readerDone) + }() for { t.controlBuf.throttle() frame, err := t.framer.fr.ReadFrame() @@ -664,7 +645,7 @@ func (t *http2Server) HandleStreams(handle func(*Stream)) { } switch frame := frame.(type) { case *http2.MetaHeadersFrame: - if err := t.operateHeaders(frame, handle); err != nil { + if err := t.operateHeaders(ctx, frame, handle); err != nil { t.Close(err) break } @@ -1242,10 +1223,6 @@ func (t *http2Server) Close(err error) { for _, s := range streams { s.cancel() } - for _, sh := range t.stats { - connEnd := &stats.ConnEnd{} - sh.HandleConn(t.ctx, connEnd) - } } // deleteStream deletes the stream s from transport's active streams. @@ -1311,10 +1288,6 @@ func (t *http2Server) closeStream(s *Stream, rst bool, rstCode http2.ErrCode, eo }) } -func (t *http2Server) RemoteAddr() net.Addr { - return t.remoteAddr -} - func (t *http2Server) Drain(debugData string) { t.mu.Lock() defer t.mu.Unlock() @@ -1397,11 +1370,11 @@ func (t *http2Server) ChannelzMetric() *channelz.SocketInternalMetric { LastMessageReceivedTimestamp: time.Unix(0, atomic.LoadInt64(&t.czData.lastMsgRecvTime)), LocalFlowControlWindow: int64(t.fc.getSize()), SocketOptions: channelz.GetSocketOption(t.conn), - LocalAddr: t.localAddr, - RemoteAddr: t.remoteAddr, + LocalAddr: t.peer.LocalAddr, + RemoteAddr: t.peer.Addr, // RemoteName : } - if au, ok := t.authInfo.(credentials.ChannelzSecurityInfo); ok { + if au, ok := t.peer.AuthInfo.(credentials.ChannelzSecurityInfo); ok { s.Security = au.GetSecurityValue() } s.RemoteFlowControlWindow = t.getOutFlowWindow() @@ -1433,10 +1406,12 @@ func (t *http2Server) getOutFlowWindow() int64 { } } -func (t *http2Server) getPeer() *peer.Peer { +// Peer returns the peer of the transport. +func (t *http2Server) Peer() *peer.Peer { return &peer.Peer{ - Addr: t.remoteAddr, - AuthInfo: t.authInfo, // Can be nil + Addr: t.peer.Addr, + LocalAddr: t.peer.LocalAddr, + AuthInfo: t.peer.AuthInfo, // Can be nil } } @@ -1461,6 +1436,6 @@ func GetConnection(ctx context.Context) net.Conn { // SetConnection adds the connection to the context to be able to get // information about the destination ip and port for an incoming RPC. This also // allows any unary or streaming interceptors to see the connection. -func setConnection(ctx context.Context, conn net.Conn) context.Context { +func SetConnection(ctx context.Context, conn net.Conn) context.Context { return context.WithValue(ctx, connectionKey{}, conn) } diff --git a/vendor/google.golang.org/grpc/internal/transport/proxy.go b/vendor/google.golang.org/grpc/internal/transport/proxy.go index 41596198..24fa1032 100644 --- a/vendor/google.golang.org/grpc/internal/transport/proxy.go +++ b/vendor/google.golang.org/grpc/internal/transport/proxy.go @@ -28,6 +28,8 @@ import ( "net/http" "net/http/httputil" "net/url" + + "google.golang.org/grpc/internal" ) const proxyAuthHeaderKey = "Proxy-Authorization" @@ -112,7 +114,7 @@ func doHTTPConnectHandshake(ctx context.Context, conn net.Conn, backendAddr stri // proxyDial dials, connecting to a proxy first if necessary. Checks if a proxy // is necessary, dials, does the HTTP CONNECT handshake, and returns the // connection. -func proxyDial(ctx context.Context, addr string, grpcUA string) (conn net.Conn, err error) { +func proxyDial(ctx context.Context, addr string, grpcUA string) (net.Conn, error) { newAddr := addr proxyURL, err := mapAddress(addr) if err != nil { @@ -122,15 +124,15 @@ func proxyDial(ctx context.Context, addr string, grpcUA string) (conn net.Conn, newAddr = proxyURL.Host } - conn, err = (&net.Dialer{}).DialContext(ctx, "tcp", newAddr) + conn, err := internal.NetDialerWithTCPKeepalive().DialContext(ctx, "tcp", newAddr) if err != nil { - return + return nil, err } - if proxyURL != nil { + if proxyURL == nil { // proxy is disabled if proxyURL is nil. - conn, err = doHTTPConnectHandshake(ctx, conn, addr, proxyURL, grpcUA) + return conn, err } - return + return doHTTPConnectHandshake(ctx, conn, addr, proxyURL, grpcUA) } func sendHTTPRequest(ctx context.Context, req *http.Request, conn net.Conn) error { diff --git a/vendor/google.golang.org/grpc/internal/transport/transport.go b/vendor/google.golang.org/grpc/internal/transport/transport.go index aac056e7..b7b8fec1 100644 --- a/vendor/google.golang.org/grpc/internal/transport/transport.go +++ b/vendor/google.golang.org/grpc/internal/transport/transport.go @@ -37,6 +37,7 @@ import ( "google.golang.org/grpc/internal/channelz" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/metadata" + "google.golang.org/grpc/peer" "google.golang.org/grpc/resolver" "google.golang.org/grpc/stats" "google.golang.org/grpc/status" @@ -265,7 +266,8 @@ type Stream struct { // headerValid indicates whether a valid header was received. Only // meaningful after headerChan is closed (always call waitOnHeader() before // reading its value). Not valid on server side. - headerValid bool + headerValid bool + headerWireLength int // Only set on server side. // hdrMu protects header and trailer metadata on the server-side. hdrMu sync.Mutex @@ -425,6 +427,12 @@ func (s *Stream) Context() context.Context { return s.ctx } +// SetContext sets the context of the stream. This will be deleted once the +// stats handler callouts all move to gRPC layer. +func (s *Stream) SetContext(ctx context.Context) { + s.ctx = ctx +} + // Method returns the method for the stream. func (s *Stream) Method() string { return s.method @@ -437,6 +445,12 @@ func (s *Stream) Status() *status.Status { return s.status } +// HeaderWireLength returns the size of the headers of the stream as received +// from the wire. Valid only on the server. +func (s *Stream) HeaderWireLength() int { + return s.headerWireLength +} + // SetHeader sets the header metadata. This can be called multiple times. // Server side only. // This should not be called in parallel to other data writes. @@ -698,7 +712,7 @@ type ClientTransport interface { // Write methods for a given Stream will be called serially. type ServerTransport interface { // HandleStreams receives incoming streams using the given handler. - HandleStreams(func(*Stream)) + HandleStreams(context.Context, func(*Stream)) // WriteHeader sends the header metadata for the given stream. // WriteHeader may not be called on all streams. @@ -717,8 +731,8 @@ type ServerTransport interface { // handlers will be terminated asynchronously. Close(err error) - // RemoteAddr returns the remote network address. - RemoteAddr() net.Addr + // Peer returns the peer of the server transport. + Peer() *peer.Peer // Drain notifies the client this ServerTransport stops accepting new RPCs. Drain(debugData string) diff --git a/vendor/google.golang.org/grpc/metadata/metadata.go b/vendor/google.golang.org/grpc/metadata/metadata.go index a2cdcaf1..49446825 100644 --- a/vendor/google.golang.org/grpc/metadata/metadata.go +++ b/vendor/google.golang.org/grpc/metadata/metadata.go @@ -153,14 +153,16 @@ func Join(mds ...MD) MD { type mdIncomingKey struct{} type mdOutgoingKey struct{} -// NewIncomingContext creates a new context with incoming md attached. +// NewIncomingContext creates a new context with incoming md attached. md must +// not be modified after calling this function. func NewIncomingContext(ctx context.Context, md MD) context.Context { return context.WithValue(ctx, mdIncomingKey{}, md) } // NewOutgoingContext creates a new context with outgoing md attached. If used // in conjunction with AppendToOutgoingContext, NewOutgoingContext will -// overwrite any previously-appended metadata. +// overwrite any previously-appended metadata. md must not be modified after +// calling this function. func NewOutgoingContext(ctx context.Context, md MD) context.Context { return context.WithValue(ctx, mdOutgoingKey{}, rawMD{md: md}) } @@ -203,7 +205,8 @@ func FromIncomingContext(ctx context.Context) (MD, bool) { } // ValueFromIncomingContext returns the metadata value corresponding to the metadata -// key from the incoming metadata if it exists. Key must be lower-case. +// key from the incoming metadata if it exists. Keys are matched in a case insensitive +// manner. // // # Experimental // @@ -219,17 +222,16 @@ func ValueFromIncomingContext(ctx context.Context, key string) []string { return copyOf(v) } for k, v := range md { - // We need to manually convert all keys to lower case, because MD is a - // map, and there's no guarantee that the MD attached to the context is - // created using our helper functions. - if strings.ToLower(k) == key { + // Case insenitive comparison: MD is a map, and there's no guarantee + // that the MD attached to the context is created using our helper + // functions. + if strings.EqualFold(k, key) { return copyOf(v) } } return nil } -// the returned slice must not be modified in place func copyOf(v []string) []string { vals := make([]string, len(v)) copy(vals, v) diff --git a/vendor/google.golang.org/grpc/peer/peer.go b/vendor/google.golang.org/grpc/peer/peer.go index e01d219f..a821ff9b 100644 --- a/vendor/google.golang.org/grpc/peer/peer.go +++ b/vendor/google.golang.org/grpc/peer/peer.go @@ -32,6 +32,8 @@ import ( type Peer struct { // Addr is the peer address. Addr net.Addr + // LocalAddr is the local address. + LocalAddr net.Addr // AuthInfo is the authentication information of the transport. // It is nil if there is no transport security being used. AuthInfo credentials.AuthInfo diff --git a/vendor/google.golang.org/grpc/picker_wrapper.go b/vendor/google.golang.org/grpc/picker_wrapper.go index 236837f4..bf56faa7 100644 --- a/vendor/google.golang.org/grpc/picker_wrapper.go +++ b/vendor/google.golang.org/grpc/picker_wrapper.go @@ -37,7 +37,6 @@ import ( type pickerWrapper struct { mu sync.Mutex done bool - idle bool blockingCh chan struct{} picker balancer.Picker statsHandlers []stats.Handler // to record blocking picker calls @@ -53,11 +52,7 @@ func newPickerWrapper(statsHandlers []stats.Handler) *pickerWrapper { // updatePicker is called by UpdateBalancerState. It unblocks all blocked pick. func (pw *pickerWrapper) updatePicker(p balancer.Picker) { pw.mu.Lock() - if pw.done || pw.idle { - // There is a small window where a picker update from the LB policy can - // race with the channel going to idle mode. If the picker is idle here, - // it is because the channel asked it to do so, and therefore it is sage - // to ignore the update from the LB policy. + if pw.done { pw.mu.Unlock() return } @@ -210,23 +205,15 @@ func (pw *pickerWrapper) close() { close(pw.blockingCh) } -func (pw *pickerWrapper) enterIdleMode() { - pw.mu.Lock() - defer pw.mu.Unlock() - if pw.done { - return - } - pw.idle = true -} - -func (pw *pickerWrapper) exitIdleMode() { +// reset clears the pickerWrapper and prepares it for being used again when idle +// mode is exited. +func (pw *pickerWrapper) reset() { pw.mu.Lock() defer pw.mu.Unlock() if pw.done { return } pw.blockingCh = make(chan struct{}) - pw.idle = false } // dropError is a wrapper error that indicates the LB policy wishes to drop the diff --git a/vendor/google.golang.org/grpc/pickfirst.go b/vendor/google.golang.org/grpc/pickfirst.go index 2e9cf66b..5128f936 100644 --- a/vendor/google.golang.org/grpc/pickfirst.go +++ b/vendor/google.golang.org/grpc/pickfirst.go @@ -25,7 +25,6 @@ import ( "google.golang.org/grpc/balancer" "google.golang.org/grpc/connectivity" - "google.golang.org/grpc/internal/envconfig" internalgrpclog "google.golang.org/grpc/internal/grpclog" "google.golang.org/grpc/internal/grpcrand" "google.golang.org/grpc/internal/pretty" @@ -65,19 +64,6 @@ type pfConfig struct { } func (*pickfirstBuilder) ParseConfig(js json.RawMessage) (serviceconfig.LoadBalancingConfig, error) { - if !envconfig.PickFirstLBConfig { - // Prior to supporting loadbalancing configuration, the pick_first LB - // policy did not implement the balancer.ConfigParser interface. This - // meant that if a non-empty configuration was passed to it, the service - // config unmarshaling code would throw a warning log, but would - // continue using the pick_first LB policy. The code below ensures the - // same behavior is retained if the env var is not set. - if string(js) != "{}" { - logger.Warningf("Ignoring non-empty balancer configuration %q for the pick_first LB policy", string(js)) - } - return nil, nil - } - var cfg pfConfig if err := json.Unmarshal(js, &cfg); err != nil { return nil, fmt.Errorf("pickfirst: unable to unmarshal LB policy config: %s, error: %v", string(js), err) diff --git a/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go new file mode 100644 index 00000000..14aa6f20 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver/dns/dns_resolver.go @@ -0,0 +1,36 @@ +/* + * + * Copyright 2018 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package dns implements a dns resolver to be installed as the default resolver +// in grpc. +// +// Deprecated: this package is imported by grpc and should not need to be +// imported directly by users. +package dns + +import ( + "google.golang.org/grpc/internal/resolver/dns" + "google.golang.org/grpc/resolver" +) + +// NewBuilder creates a dnsBuilder which is used to factory DNS resolvers. +// +// Deprecated: import grpc and use resolver.Get("dns") instead. +func NewBuilder() resolver.Builder { + return dns.NewBuilder() +} diff --git a/vendor/google.golang.org/grpc/resolver/map.go b/vendor/google.golang.org/grpc/resolver/map.go index 804be887..ada5b9bb 100644 --- a/vendor/google.golang.org/grpc/resolver/map.go +++ b/vendor/google.golang.org/grpc/resolver/map.go @@ -136,3 +136,116 @@ func (a *AddressMap) Values() []any { } return ret } + +type endpointNode struct { + addrs map[string]struct{} +} + +// Equal returns whether the unordered set of addrs are the same between the +// endpoint nodes. +func (en *endpointNode) Equal(en2 *endpointNode) bool { + if len(en.addrs) != len(en2.addrs) { + return false + } + for addr := range en.addrs { + if _, ok := en2.addrs[addr]; !ok { + return false + } + } + return true +} + +func toEndpointNode(endpoint Endpoint) endpointNode { + en := make(map[string]struct{}) + for _, addr := range endpoint.Addresses { + en[addr.Addr] = struct{}{} + } + return endpointNode{ + addrs: en, + } +} + +// EndpointMap is a map of endpoints to arbitrary values keyed on only the +// unordered set of address strings within an endpoint. This map is not thread +// safe, thus it is unsafe to access concurrently. Must be created via +// NewEndpointMap; do not construct directly. +type EndpointMap struct { + endpoints map[*endpointNode]any +} + +// NewEndpointMap creates a new EndpointMap. +func NewEndpointMap() *EndpointMap { + return &EndpointMap{ + endpoints: make(map[*endpointNode]any), + } +} + +// Get returns the value for the address in the map, if present. +func (em *EndpointMap) Get(e Endpoint) (value any, ok bool) { + en := toEndpointNode(e) + if endpoint := em.find(en); endpoint != nil { + return em.endpoints[endpoint], true + } + return nil, false +} + +// Set updates or adds the value to the address in the map. +func (em *EndpointMap) Set(e Endpoint, value any) { + en := toEndpointNode(e) + if endpoint := em.find(en); endpoint != nil { + em.endpoints[endpoint] = value + return + } + em.endpoints[&en] = value +} + +// Len returns the number of entries in the map. +func (em *EndpointMap) Len() int { + return len(em.endpoints) +} + +// Keys returns a slice of all current map keys, as endpoints specifying the +// addresses present in the endpoint keys, in which uniqueness is determined by +// the unordered set of addresses. Thus, endpoint information returned is not +// the full endpoint data (drops duplicated addresses and attributes) but can be +// used for EndpointMap accesses. +func (em *EndpointMap) Keys() []Endpoint { + ret := make([]Endpoint, 0, len(em.endpoints)) + for en := range em.endpoints { + var endpoint Endpoint + for addr := range en.addrs { + endpoint.Addresses = append(endpoint.Addresses, Address{Addr: addr}) + } + ret = append(ret, endpoint) + } + return ret +} + +// Values returns a slice of all current map values. +func (em *EndpointMap) Values() []any { + ret := make([]any, 0, len(em.endpoints)) + for _, val := range em.endpoints { + ret = append(ret, val) + } + return ret +} + +// find returns a pointer to the endpoint node in em if the endpoint node is +// already present. If not found, nil is returned. The comparisons are done on +// the unordered set of addresses within an endpoint. +func (em EndpointMap) find(e endpointNode) *endpointNode { + for endpoint := range em.endpoints { + if e.Equal(endpoint) { + return endpoint + } + } + return nil +} + +// Delete removes the specified endpoint from the map. +func (em *EndpointMap) Delete(e Endpoint) { + en := toEndpointNode(e) + if entry := em.find(en); entry != nil { + delete(em.endpoints, entry) + } +} diff --git a/vendor/google.golang.org/grpc/resolver/resolver.go b/vendor/google.golang.org/grpc/resolver/resolver.go index 11384e22..bd1c7d01 100644 --- a/vendor/google.golang.org/grpc/resolver/resolver.go +++ b/vendor/google.golang.org/grpc/resolver/resolver.go @@ -240,11 +240,6 @@ type ClientConn interface { // // Deprecated: Use UpdateState instead. NewAddress(addresses []Address) - // NewServiceConfig is called by resolver to notify ClientConn a new - // service config. The service config should be provided as a json string. - // - // Deprecated: Use UpdateState instead. - NewServiceConfig(serviceConfig string) // ParseServiceConfig parses the provided service config and returns an // object that provides the parsed config. ParseServiceConfig(serviceConfigJSON string) *serviceconfig.ParseResult @@ -286,6 +281,11 @@ func (t Target) Endpoint() string { return strings.TrimPrefix(endpoint, "/") } +// String returns a string representation of Target. +func (t Target) String() string { + return t.URL.String() +} + // Builder creates a resolver that will be used to watch name resolution updates. type Builder interface { // Build creates a new resolver for the given target. diff --git a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go b/vendor/google.golang.org/grpc/resolver_conn_wrapper.go deleted file mode 100644 index d6833056..00000000 --- a/vendor/google.golang.org/grpc/resolver_conn_wrapper.go +++ /dev/null @@ -1,247 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package grpc - -import ( - "context" - "strings" - "sync" - - "google.golang.org/grpc/balancer" - "google.golang.org/grpc/internal/channelz" - "google.golang.org/grpc/internal/grpcsync" - "google.golang.org/grpc/internal/pretty" - "google.golang.org/grpc/resolver" - "google.golang.org/grpc/serviceconfig" -) - -// resolverStateUpdater wraps the single method used by ccResolverWrapper to -// report a state update from the actual resolver implementation. -type resolverStateUpdater interface { - updateResolverState(s resolver.State, err error) error -} - -// ccResolverWrapper is a wrapper on top of cc for resolvers. -// It implements resolver.ClientConn interface. -type ccResolverWrapper struct { - // The following fields are initialized when the wrapper is created and are - // read-only afterwards, and therefore can be accessed without a mutex. - cc resolverStateUpdater - channelzID *channelz.Identifier - ignoreServiceConfig bool - opts ccResolverWrapperOpts - serializer *grpcsync.CallbackSerializer // To serialize all incoming calls. - serializerCancel context.CancelFunc // To close the serializer, accessed only from close(). - - // All incoming (resolver --> gRPC) calls are guaranteed to execute in a - // mutually exclusive manner as they are scheduled on the serializer. - // Fields accessed *only* in these serializer callbacks, can therefore be - // accessed without a mutex. - curState resolver.State - - // mu guards access to the below fields. - mu sync.Mutex - closed bool - resolver resolver.Resolver // Accessed only from outgoing calls. -} - -// ccResolverWrapperOpts wraps the arguments to be passed when creating a new -// ccResolverWrapper. -type ccResolverWrapperOpts struct { - target resolver.Target // User specified dial target to resolve. - builder resolver.Builder // Resolver builder to use. - bOpts resolver.BuildOptions // Resolver build options to use. - channelzID *channelz.Identifier // Channelz identifier for the channel. -} - -// newCCResolverWrapper uses the resolver.Builder to build a Resolver and -// returns a ccResolverWrapper object which wraps the newly built resolver. -func newCCResolverWrapper(cc resolverStateUpdater, opts ccResolverWrapperOpts) (*ccResolverWrapper, error) { - ctx, cancel := context.WithCancel(context.Background()) - ccr := &ccResolverWrapper{ - cc: cc, - channelzID: opts.channelzID, - ignoreServiceConfig: opts.bOpts.DisableServiceConfig, - opts: opts, - serializer: grpcsync.NewCallbackSerializer(ctx), - serializerCancel: cancel, - } - - // Cannot hold the lock at build time because the resolver can send an - // update or error inline and these incoming calls grab the lock to schedule - // a callback in the serializer. - r, err := opts.builder.Build(opts.target, ccr, opts.bOpts) - if err != nil { - cancel() - return nil, err - } - - // Any error reported by the resolver at build time that leads to a - // re-resolution request from the balancer is dropped by grpc until we - // return from this function. So, we don't have to handle pending resolveNow - // requests here. - ccr.mu.Lock() - ccr.resolver = r - ccr.mu.Unlock() - - return ccr, nil -} - -func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { - ccr.mu.Lock() - defer ccr.mu.Unlock() - - // ccr.resolver field is set only after the call to Build() returns. But in - // the process of building, the resolver may send an error update which when - // propagated to the balancer may result in a re-resolution request. - if ccr.closed || ccr.resolver == nil { - return - } - ccr.resolver.ResolveNow(o) -} - -func (ccr *ccResolverWrapper) close() { - ccr.mu.Lock() - if ccr.closed { - ccr.mu.Unlock() - return - } - - channelz.Info(logger, ccr.channelzID, "Closing the name resolver") - - // Close the serializer to ensure that no more calls from the resolver are - // handled, before actually closing the resolver. - ccr.serializerCancel() - ccr.closed = true - r := ccr.resolver - ccr.mu.Unlock() - - // Give enqueued callbacks a chance to finish. - <-ccr.serializer.Done() - - // Spawn a goroutine to close the resolver (since it may block trying to - // cleanup all allocated resources) and return early. - go r.Close() -} - -// serializerScheduleLocked is a convenience method to schedule a function to be -// run on the serializer while holding ccr.mu. -func (ccr *ccResolverWrapper) serializerScheduleLocked(f func(context.Context)) { - ccr.mu.Lock() - ccr.serializer.Schedule(f) - ccr.mu.Unlock() -} - -// UpdateState is called by resolver implementations to report new state to gRPC -// which includes addresses and service config. -func (ccr *ccResolverWrapper) UpdateState(s resolver.State) error { - errCh := make(chan error, 1) - if s.Endpoints == nil { - s.Endpoints = make([]resolver.Endpoint, 0, len(s.Addresses)) - for _, a := range s.Addresses { - ep := resolver.Endpoint{Addresses: []resolver.Address{a}, Attributes: a.BalancerAttributes} - ep.Addresses[0].BalancerAttributes = nil - s.Endpoints = append(s.Endpoints, ep) - } - } - ok := ccr.serializer.Schedule(func(context.Context) { - ccr.addChannelzTraceEvent(s) - ccr.curState = s - if err := ccr.cc.updateResolverState(ccr.curState, nil); err == balancer.ErrBadResolverState { - errCh <- balancer.ErrBadResolverState - return - } - errCh <- nil - }) - if !ok { - // The only time when Schedule() fail to add the callback to the - // serializer is when the serializer is closed, and this happens only - // when the resolver wrapper is closed. - return nil - } - return <-errCh -} - -// ReportError is called by resolver implementations to report errors -// encountered during name resolution to gRPC. -func (ccr *ccResolverWrapper) ReportError(err error) { - ccr.serializerScheduleLocked(func(_ context.Context) { - channelz.Warningf(logger, ccr.channelzID, "ccResolverWrapper: reporting error to cc: %v", err) - ccr.cc.updateResolverState(resolver.State{}, err) - }) -} - -// NewAddress is called by the resolver implementation to send addresses to -// gRPC. -func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { - ccr.serializerScheduleLocked(func(_ context.Context) { - ccr.addChannelzTraceEvent(resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig}) - ccr.curState.Addresses = addrs - ccr.cc.updateResolverState(ccr.curState, nil) - }) -} - -// NewServiceConfig is called by the resolver implementation to send service -// configs to gRPC. -func (ccr *ccResolverWrapper) NewServiceConfig(sc string) { - ccr.serializerScheduleLocked(func(_ context.Context) { - channelz.Infof(logger, ccr.channelzID, "ccResolverWrapper: got new service config: %s", sc) - if ccr.ignoreServiceConfig { - channelz.Info(logger, ccr.channelzID, "Service config lookups disabled; ignoring config") - return - } - scpr := parseServiceConfig(sc) - if scpr.Err != nil { - channelz.Warningf(logger, ccr.channelzID, "ccResolverWrapper: error parsing service config: %v", scpr.Err) - return - } - ccr.addChannelzTraceEvent(resolver.State{Addresses: ccr.curState.Addresses, ServiceConfig: scpr}) - ccr.curState.ServiceConfig = scpr - ccr.cc.updateResolverState(ccr.curState, nil) - }) -} - -// ParseServiceConfig is called by resolver implementations to parse a JSON -// representation of the service config. -func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult { - return parseServiceConfig(scJSON) -} - -// addChannelzTraceEvent adds a channelz trace event containing the new -// state received from resolver implementations. -func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { - var updates []string - var oldSC, newSC *ServiceConfig - var oldOK, newOK bool - if ccr.curState.ServiceConfig != nil { - oldSC, oldOK = ccr.curState.ServiceConfig.Config.(*ServiceConfig) - } - if s.ServiceConfig != nil { - newSC, newOK = s.ServiceConfig.Config.(*ServiceConfig) - } - if oldOK != newOK || (oldOK && newOK && oldSC.rawJSONString != newSC.rawJSONString) { - updates = append(updates, "service config updated") - } - if len(ccr.curState.Addresses) > 0 && len(s.Addresses) == 0 { - updates = append(updates, "resolver returned an empty address list") - } else if len(ccr.curState.Addresses) == 0 && len(s.Addresses) > 0 { - updates = append(updates, "resolver returned new addresses") - } - channelz.Infof(logger, ccr.channelzID, "Resolver state updated: %s (%v)", pretty.ToJSON(s), strings.Join(updates, "; ")) -} diff --git a/vendor/google.golang.org/grpc/resolver_wrapper.go b/vendor/google.golang.org/grpc/resolver_wrapper.go new file mode 100644 index 00000000..c79bab12 --- /dev/null +++ b/vendor/google.golang.org/grpc/resolver_wrapper.go @@ -0,0 +1,197 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package grpc + +import ( + "context" + "strings" + "sync" + + "google.golang.org/grpc/internal/channelz" + "google.golang.org/grpc/internal/grpcsync" + "google.golang.org/grpc/internal/pretty" + "google.golang.org/grpc/resolver" + "google.golang.org/grpc/serviceconfig" +) + +// ccResolverWrapper is a wrapper on top of cc for resolvers. +// It implements resolver.ClientConn interface. +type ccResolverWrapper struct { + // The following fields are initialized when the wrapper is created and are + // read-only afterwards, and therefore can be accessed without a mutex. + cc *ClientConn + ignoreServiceConfig bool + serializer *grpcsync.CallbackSerializer + serializerCancel context.CancelFunc + + resolver resolver.Resolver // only accessed within the serializer + + // The following fields are protected by mu. Caller must take cc.mu before + // taking mu. + mu sync.Mutex + curState resolver.State + closed bool +} + +// newCCResolverWrapper initializes the ccResolverWrapper. It can only be used +// after calling start, which builds the resolver. +func newCCResolverWrapper(cc *ClientConn) *ccResolverWrapper { + ctx, cancel := context.WithCancel(cc.ctx) + return &ccResolverWrapper{ + cc: cc, + ignoreServiceConfig: cc.dopts.disableServiceConfig, + serializer: grpcsync.NewCallbackSerializer(ctx), + serializerCancel: cancel, + } +} + +// start builds the name resolver using the resolver.Builder in cc and returns +// any error encountered. It must always be the first operation performed on +// any newly created ccResolverWrapper, except that close may be called instead. +func (ccr *ccResolverWrapper) start() error { + errCh := make(chan error) + ccr.serializer.Schedule(func(ctx context.Context) { + if ctx.Err() != nil { + return + } + opts := resolver.BuildOptions{ + DisableServiceConfig: ccr.cc.dopts.disableServiceConfig, + DialCreds: ccr.cc.dopts.copts.TransportCredentials, + CredsBundle: ccr.cc.dopts.copts.CredsBundle, + Dialer: ccr.cc.dopts.copts.Dialer, + } + var err error + ccr.resolver, err = ccr.cc.resolverBuilder.Build(ccr.cc.parsedTarget, ccr, opts) + errCh <- err + }) + return <-errCh +} + +func (ccr *ccResolverWrapper) resolveNow(o resolver.ResolveNowOptions) { + ccr.serializer.Schedule(func(ctx context.Context) { + if ctx.Err() != nil || ccr.resolver == nil { + return + } + ccr.resolver.ResolveNow(o) + }) +} + +// close initiates async shutdown of the wrapper. To determine the wrapper has +// finished shutting down, the channel should block on ccr.serializer.Done() +// without cc.mu held. +func (ccr *ccResolverWrapper) close() { + channelz.Info(logger, ccr.cc.channelzID, "Closing the name resolver") + ccr.mu.Lock() + ccr.closed = true + ccr.mu.Unlock() + + ccr.serializer.Schedule(func(context.Context) { + if ccr.resolver == nil { + return + } + ccr.resolver.Close() + ccr.resolver = nil + }) + ccr.serializerCancel() +} + +// UpdateState is called by resolver implementations to report new state to gRPC +// which includes addresses and service config. +func (ccr *ccResolverWrapper) UpdateState(s resolver.State) error { + ccr.cc.mu.Lock() + ccr.mu.Lock() + if ccr.closed { + ccr.mu.Unlock() + ccr.cc.mu.Unlock() + return nil + } + if s.Endpoints == nil { + s.Endpoints = make([]resolver.Endpoint, 0, len(s.Addresses)) + for _, a := range s.Addresses { + ep := resolver.Endpoint{Addresses: []resolver.Address{a}, Attributes: a.BalancerAttributes} + ep.Addresses[0].BalancerAttributes = nil + s.Endpoints = append(s.Endpoints, ep) + } + } + ccr.addChannelzTraceEvent(s) + ccr.curState = s + ccr.mu.Unlock() + return ccr.cc.updateResolverStateAndUnlock(s, nil) +} + +// ReportError is called by resolver implementations to report errors +// encountered during name resolution to gRPC. +func (ccr *ccResolverWrapper) ReportError(err error) { + ccr.cc.mu.Lock() + ccr.mu.Lock() + if ccr.closed { + ccr.mu.Unlock() + ccr.cc.mu.Unlock() + return + } + ccr.mu.Unlock() + channelz.Warningf(logger, ccr.cc.channelzID, "ccResolverWrapper: reporting error to cc: %v", err) + ccr.cc.updateResolverStateAndUnlock(resolver.State{}, err) +} + +// NewAddress is called by the resolver implementation to send addresses to +// gRPC. +func (ccr *ccResolverWrapper) NewAddress(addrs []resolver.Address) { + ccr.cc.mu.Lock() + ccr.mu.Lock() + if ccr.closed { + ccr.mu.Unlock() + ccr.cc.mu.Unlock() + return + } + s := resolver.State{Addresses: addrs, ServiceConfig: ccr.curState.ServiceConfig} + ccr.addChannelzTraceEvent(s) + ccr.curState = s + ccr.mu.Unlock() + ccr.cc.updateResolverStateAndUnlock(s, nil) +} + +// ParseServiceConfig is called by resolver implementations to parse a JSON +// representation of the service config. +func (ccr *ccResolverWrapper) ParseServiceConfig(scJSON string) *serviceconfig.ParseResult { + return parseServiceConfig(scJSON) +} + +// addChannelzTraceEvent adds a channelz trace event containing the new +// state received from resolver implementations. +func (ccr *ccResolverWrapper) addChannelzTraceEvent(s resolver.State) { + var updates []string + var oldSC, newSC *ServiceConfig + var oldOK, newOK bool + if ccr.curState.ServiceConfig != nil { + oldSC, oldOK = ccr.curState.ServiceConfig.Config.(*ServiceConfig) + } + if s.ServiceConfig != nil { + newSC, newOK = s.ServiceConfig.Config.(*ServiceConfig) + } + if oldOK != newOK || (oldOK && newOK && oldSC.rawJSONString != newSC.rawJSONString) { + updates = append(updates, "service config updated") + } + if len(ccr.curState.Addresses) > 0 && len(s.Addresses) == 0 { + updates = append(updates, "resolver returned an empty address list") + } else if len(ccr.curState.Addresses) == 0 && len(s.Addresses) > 0 { + updates = append(updates, "resolver returned new addresses") + } + channelz.Infof(logger, ccr.cc.channelzID, "Resolver state updated: %s (%v)", pretty.ToJSON(s), strings.Join(updates, "; ")) +} diff --git a/vendor/google.golang.org/grpc/server.go b/vendor/google.golang.org/grpc/server.go index 8f60d421..682fa183 100644 --- a/vendor/google.golang.org/grpc/server.go +++ b/vendor/google.golang.org/grpc/server.go @@ -70,6 +70,10 @@ func init() { internal.GetServerCredentials = func(srv *Server) credentials.TransportCredentials { return srv.opts.creds } + internal.IsRegisteredMethod = func(srv *Server, method string) bool { + return srv.isRegisteredMethod(method) + } + internal.ServerFromContext = serverFromContext internal.DrainServerTransports = func(srv *Server, addr string) { srv.drainServerTransports(addr) } @@ -81,6 +85,7 @@ func init() { } internal.BinaryLogger = binaryLogger internal.JoinServerOptions = newJoinServerOption + internal.RecvBufferPool = recvBufferPool } var statusOK = status.New(codes.OK, "") @@ -139,7 +144,8 @@ type Server struct { channelzID *channelz.Identifier czData *channelzData - serverWorkerChannel chan func() + serverWorkerChannel chan func() + serverWorkerChannelClose func() } type serverOptions struct { @@ -578,11 +584,13 @@ func NumStreamWorkers(numServerWorkers uint32) ServerOption { // options are used: StatsHandler, EnableTracing, or binary logging. In such // cases, the shared buffer pool will be ignored. // -// # Experimental -// -// Notice: This API is EXPERIMENTAL and may be changed or removed in a -// later release. +// Deprecated: use experimental.WithRecvBufferPool instead. Will be deleted in +// v1.60.0 or later. func RecvBufferPool(bufferPool SharedBufferPool) ServerOption { + return recvBufferPool(bufferPool) +} + +func recvBufferPool(bufferPool SharedBufferPool) ServerOption { return newFuncServerOption(func(o *serverOptions) { o.recvBufferPool = bufferPool }) @@ -616,15 +624,14 @@ func (s *Server) serverWorker() { // connections to reduce the time spent overall on runtime.morestack. func (s *Server) initServerWorkers() { s.serverWorkerChannel = make(chan func()) + s.serverWorkerChannelClose = grpcsync.OnceFunc(func() { + close(s.serverWorkerChannel) + }) for i := uint32(0); i < s.opts.numServerWorkers; i++ { go s.serverWorker() } } -func (s *Server) stopServerWorkers() { - close(s.serverWorkerChannel) -} - // NewServer creates a gRPC server which has no service registered and has not // started to accept requests yet. func NewServer(opt ...ServerOption) *Server { @@ -806,6 +813,18 @@ func (l *listenSocket) Close() error { // Serve returns when lis.Accept fails with fatal errors. lis will be closed when // this method returns. // Serve will return a non-nil error unless Stop or GracefulStop is called. +// +// Note: All supported releases of Go (as of December 2023) override the OS +// defaults for TCP keepalive time and interval to 15s. To enable TCP keepalive +// with OS defaults for keepalive time and interval, callers need to do the +// following two things: +// - pass a net.Listener created by calling the Listen method on a +// net.ListenConfig with the `KeepAlive` field set to a negative value. This +// will result in the Go standard library not overriding OS defaults for TCP +// keepalive interval and time. But this will also result in the Go standard +// library not enabling TCP keepalives by default. +// - override the Accept method on the passed in net.Listener and set the +// SO_KEEPALIVE socket option to enable TCP keepalives, with OS defaults. func (s *Server) Serve(lis net.Listener) error { s.mu.Lock() s.printf("serving") @@ -917,7 +936,7 @@ func (s *Server) handleRawConn(lisAddr string, rawConn net.Conn) { return } go func() { - s.serveStreams(st) + s.serveStreams(context.Background(), st, rawConn) s.removeConn(lisAddr, st) }() } @@ -971,18 +990,29 @@ func (s *Server) newHTTP2Transport(c net.Conn) transport.ServerTransport { return st } -func (s *Server) serveStreams(st transport.ServerTransport) { - defer st.Close(errors.New("finished serving streams for the server transport")) - var wg sync.WaitGroup +func (s *Server) serveStreams(ctx context.Context, st transport.ServerTransport, rawConn net.Conn) { + ctx = transport.SetConnection(ctx, rawConn) + ctx = peer.NewContext(ctx, st.Peer()) + for _, sh := range s.opts.statsHandlers { + ctx = sh.TagConn(ctx, &stats.ConnTagInfo{ + RemoteAddr: st.Peer().Addr, + LocalAddr: st.Peer().LocalAddr, + }) + sh.HandleConn(ctx, &stats.ConnBegin{}) + } + + defer func() { + st.Close(errors.New("finished serving streams for the server transport")) + for _, sh := range s.opts.statsHandlers { + sh.HandleConn(ctx, &stats.ConnEnd{}) + } + }() streamQuota := newHandlerQuota(s.opts.maxConcurrentStreams) - st.HandleStreams(func(stream *transport.Stream) { - wg.Add(1) - + st.HandleStreams(ctx, func(stream *transport.Stream) { streamQuota.acquire() f := func() { defer streamQuota.release() - defer wg.Done() s.handleStream(st, stream) } @@ -996,7 +1026,6 @@ func (s *Server) serveStreams(st transport.ServerTransport) { } go f() }) - wg.Wait() } var _ http.Handler = (*Server)(nil) @@ -1040,7 +1069,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { return } defer s.removeConn(listenerAddressForServeHTTP, st) - s.serveStreams(st) + s.serveStreams(r.Context(), st, nil) } func (s *Server) addConn(addr string, st transport.ServerTransport) bool { @@ -1689,6 +1718,7 @@ func (s *Server) processStreamingRPC(ctx context.Context, t transport.ServerTran func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Stream) { ctx := stream.Context() + ctx = contextWithServer(ctx, s) var ti *traceInfo if EnableTracing { tr := trace.New("grpc.Recv."+methodFamily(stream.Method()), stream.Method()) @@ -1697,7 +1727,7 @@ func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Str tr: tr, firstLine: firstLine{ client: false, - remoteAddr: t.RemoteAddr(), + remoteAddr: t.Peer().Addr, }, } if dl, ok := ctx.Deadline(); ok { @@ -1731,6 +1761,22 @@ func (s *Server) handleStream(t transport.ServerTransport, stream *transport.Str service := sm[:pos] method := sm[pos+1:] + md, _ := metadata.FromIncomingContext(ctx) + for _, sh := range s.opts.statsHandlers { + ctx = sh.TagRPC(ctx, &stats.RPCTagInfo{FullMethodName: stream.Method()}) + sh.HandleRPC(ctx, &stats.InHeader{ + FullMethod: stream.Method(), + RemoteAddr: t.Peer().Addr, + LocalAddr: t.Peer().LocalAddr, + Compression: stream.RecvCompress(), + WireLength: stream.HeaderWireLength(), + Header: md, + }) + } + // To have calls in stream callouts work. Will delete once all stats handler + // calls come from the gRPC layer. + stream.SetContext(ctx) + srv, knownService := s.services[service] if knownService { if md, ok := srv.methods[method]; ok { @@ -1820,62 +1866,68 @@ func ServerTransportStreamFromContext(ctx context.Context) ServerTransportStream // pending RPCs on the client side will get notified by connection // errors. func (s *Server) Stop() { - s.quit.Fire() - - defer func() { - s.serveWG.Wait() - s.done.Fire() - }() - - s.channelzRemoveOnce.Do(func() { channelz.RemoveEntry(s.channelzID) }) - - s.mu.Lock() - listeners := s.lis - s.lis = nil - conns := s.conns - s.conns = nil - // interrupt GracefulStop if Stop and GracefulStop are called concurrently. - s.cv.Broadcast() - s.mu.Unlock() - - for lis := range listeners { - lis.Close() - } - for _, cs := range conns { - for st := range cs { - st.Close(errors.New("Server.Stop called")) - } - } - if s.opts.numServerWorkers > 0 { - s.stopServerWorkers() - } - - s.mu.Lock() - if s.events != nil { - s.events.Finish() - s.events = nil - } - s.mu.Unlock() + s.stop(false) } // GracefulStop stops the gRPC server gracefully. It stops the server from // accepting new connections and RPCs and blocks until all the pending RPCs are // finished. func (s *Server) GracefulStop() { + s.stop(true) +} + +func (s *Server) stop(graceful bool) { s.quit.Fire() defer s.done.Fire() s.channelzRemoveOnce.Do(func() { channelz.RemoveEntry(s.channelzID) }) + s.mu.Lock() - if s.conns == nil { - s.mu.Unlock() - return + s.closeListenersLocked() + // Wait for serving threads to be ready to exit. Only then can we be sure no + // new conns will be created. + s.mu.Unlock() + s.serveWG.Wait() + + s.mu.Lock() + defer s.mu.Unlock() + + if graceful { + s.drainAllServerTransportsLocked() + } else { + s.closeServerTransportsLocked() } - for lis := range s.lis { - lis.Close() + for len(s.conns) != 0 { + s.cv.Wait() } - s.lis = nil + s.conns = nil + + if s.opts.numServerWorkers > 0 { + // Closing the channel (only once, via grpcsync.OnceFunc) after all the + // connections have been closed above ensures that there are no + // goroutines executing the callback passed to st.HandleStreams (where + // the channel is written to). + s.serverWorkerChannelClose() + } + + if s.events != nil { + s.events.Finish() + s.events = nil + } +} + +// s.mu must be held by the caller. +func (s *Server) closeServerTransportsLocked() { + for _, conns := range s.conns { + for st := range conns { + st.Close(errors.New("Server.Stop called")) + } + } +} + +// s.mu must be held by the caller. +func (s *Server) drainAllServerTransportsLocked() { if !s.drain { for _, conns := range s.conns { for st := range conns { @@ -1884,22 +1936,14 @@ func (s *Server) GracefulStop() { } s.drain = true } +} - // Wait for serving threads to be ready to exit. Only then can we be sure no - // new conns will be created. - s.mu.Unlock() - s.serveWG.Wait() - s.mu.Lock() - - for len(s.conns) != 0 { - s.cv.Wait() +// s.mu must be held by the caller. +func (s *Server) closeListenersLocked() { + for lis := range s.lis { + lis.Close() } - s.conns = nil - if s.events != nil { - s.events.Finish() - s.events = nil - } - s.mu.Unlock() + s.lis = nil } // contentSubtype must be lowercase @@ -1913,11 +1957,50 @@ func (s *Server) getCodec(contentSubtype string) baseCodec { } codec := encoding.GetCodec(contentSubtype) if codec == nil { + logger.Warningf("Unsupported codec %q. Defaulting to %q for now. This will start to fail in future releases.", contentSubtype, proto.Name) return encoding.GetCodec(proto.Name) } return codec } +type serverKey struct{} + +// serverFromContext gets the Server from the context. +func serverFromContext(ctx context.Context) *Server { + s, _ := ctx.Value(serverKey{}).(*Server) + return s +} + +// contextWithServer sets the Server in the context. +func contextWithServer(ctx context.Context, server *Server) context.Context { + return context.WithValue(ctx, serverKey{}, server) +} + +// isRegisteredMethod returns whether the passed in method is registered as a +// method on the server. /service/method and service/method will match if the +// service and method are registered on the server. +func (s *Server) isRegisteredMethod(serviceMethod string) bool { + if serviceMethod != "" && serviceMethod[0] == '/' { + serviceMethod = serviceMethod[1:] + } + pos := strings.LastIndex(serviceMethod, "/") + if pos == -1 { // Invalid method name syntax. + return false + } + service := serviceMethod[:pos] + method := serviceMethod[pos+1:] + srv, knownService := s.services[service] + if knownService { + if _, ok := srv.methods[method]; ok { + return true + } + if _, ok := srv.streams[method]; ok { + return true + } + } + return false +} + // SetHeader sets the header metadata to be sent from the server to the client. // The context provided must be the context passed to the server's handler. // diff --git a/vendor/google.golang.org/grpc/version.go b/vendor/google.golang.org/grpc/version.go index 6d2cadd7..dc2cea59 100644 --- a/vendor/google.golang.org/grpc/version.go +++ b/vendor/google.golang.org/grpc/version.go @@ -19,4 +19,4 @@ package grpc // Version is the current grpc version. -const Version = "1.59.0" +const Version = "1.60.1" diff --git a/vendor/google.golang.org/grpc/vet.sh b/vendor/google.golang.org/grpc/vet.sh index bb480f1f..896dc38f 100644 --- a/vendor/google.golang.org/grpc/vet.sh +++ b/vendor/google.golang.org/grpc/vet.sh @@ -35,7 +35,6 @@ if [[ "$1" = "-install" ]]; then # Install the pinned versions as defined in module tools. pushd ./test/tools go install \ - golang.org/x/lint/golint \ golang.org/x/tools/cmd/goimports \ honnef.co/go/tools/cmd/staticcheck \ github.com/client9/misspell/cmd/misspell @@ -77,12 +76,16 @@ fi not grep 'func Test[^(]' *_test.go not grep 'func Test[^(]' test/*.go +# - Check for typos in test function names +git grep 'func (s) ' -- "*_test.go" | not grep -v 'func (s) Test' +git grep 'func [A-Z]' -- "*_test.go" | not grep -v 'func Test\|Benchmark\|Example' + # - Do not import x/net/context. not git grep -l 'x/net/context' -- "*.go" # - Do not import math/rand for real library code. Use internal/grpcrand for # thread safety. -git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^stress\|grpcrand\|^benchmark\|wrr_test' +git grep -l '"math/rand"' -- "*.go" 2>&1 | not grep -v '^examples\|^interop/stress\|grpcrand\|^benchmark\|wrr_test' # - Do not use "interface{}"; use "any" instead. git grep -l 'interface{}' -- "*.go" 2>&1 | not grep -v '\.pb\.go\|protoc-gen-go-grpc' @@ -94,15 +97,14 @@ git grep -l -e 'grpclog.I' --or -e 'grpclog.W' --or -e 'grpclog.E' --or -e 'grpc not git grep "\(import \|^\s*\)\"github.com/golang/protobuf/ptypes/" -- "*.go" # - Ensure all usages of grpc_testing package are renamed when importing. -not git grep "\(import \|^\s*\)\"google.golang.org/grpc/interop/grpc_testing" -- "*.go" +not git grep "\(import \|^\s*\)\"google.golang.org/grpc/interop/grpc_testing" -- "*.go" # - Ensure all xds proto imports are renamed to *pb or *grpc. git grep '"github.com/envoyproxy/go-control-plane/envoy' -- '*.go' ':(exclude)*.pb.go' | not grep -v 'pb "\|grpc "' misspell -error . -# - gofmt, goimports, golint (with exceptions for generated code), go vet, -# go mod tidy. +# - gofmt, goimports, go vet, go mod tidy. # Perform these checks on each module inside gRPC. for MOD_FILE in $(find . -name 'go.mod'); do MOD_DIR=$(dirname ${MOD_FILE}) @@ -110,7 +112,6 @@ for MOD_FILE in $(find . -name 'go.mod'); do go vet -all ./... | fail_on_output gofmt -s -d -l . 2>&1 | fail_on_output goimports -l . 2>&1 | not grep -vE "\.pb\.go" - golint ./... 2>&1 | not grep -vE "/grpc_testing_not_regenerate/.*\.pb\.go:" go mod tidy -compat=1.19 git status --porcelain 2>&1 | fail_on_output || \ @@ -119,94 +120,73 @@ for MOD_FILE in $(find . -name 'go.mod'); do done # - Collection of static analysis checks -# -# TODO(dfawley): don't use deprecated functions in examples or first-party -# plugins. -# TODO(dfawley): enable ST1019 (duplicate imports) but allow for protobufs. SC_OUT="$(mktemp)" -staticcheck -go 1.19 -checks 'inherit,-ST1015,-ST1019,-SA1019' ./... > "${SC_OUT}" || true -# Error if anything other than deprecation warnings are printed. -not grep -v "is deprecated:.*SA1019" "${SC_OUT}" -# Only ignore the following deprecated types/fields/functions. -not grep -Fv '.CredsBundle -.HeaderMap -.Metadata is deprecated: use Attributes -.NewAddress -.NewServiceConfig -.Type is deprecated: use Attributes -BuildVersion is deprecated -balancer.ErrTransientFailure -balancer.Picker -extDesc.Filename is deprecated -github.com/golang/protobuf/jsonpb is deprecated -grpc.CallCustomCodec -grpc.Code -grpc.Compressor -grpc.CustomCodec -grpc.Decompressor -grpc.MaxMsgSize -grpc.MethodConfig -grpc.NewGZIPCompressor -grpc.NewGZIPDecompressor -grpc.RPCCompressor -grpc.RPCDecompressor -grpc.ServiceConfig -grpc.WithCompressor -grpc.WithDecompressor -grpc.WithDialer -grpc.WithMaxMsgSize -grpc.WithServiceConfig -grpc.WithTimeout -http.CloseNotifier -info.SecurityVersion -proto is deprecated -proto.InternalMessageInfo is deprecated -proto.EnumName is deprecated -proto.ErrInternalBadWireType is deprecated -proto.FileDescriptor is deprecated -proto.Marshaler is deprecated -proto.MessageType is deprecated -proto.RegisterEnum is deprecated -proto.RegisterFile is deprecated -proto.RegisterType is deprecated -proto.RegisterExtension is deprecated -proto.RegisteredExtension is deprecated -proto.RegisteredExtensions is deprecated -proto.RegisterMapType is deprecated -proto.Unmarshaler is deprecated +staticcheck -go 1.19 -checks 'all' ./... > "${SC_OUT}" || true + +# Error for anything other than checks that need exclusions. +grep -v "(ST1000)" "${SC_OUT}" | grep -v "(SA1019)" | grep -v "(ST1003)" | not grep -v "(ST1019)\|\(other import of\)" + +# Exclude underscore checks for generated code. +grep "(ST1003)" "${SC_OUT}" | not grep -v '\(.pb.go:\)\|\(code_string_test.go:\)' + +# Error for duplicate imports not including grpc protos. +grep "(ST1019)\|\(other import of\)" "${SC_OUT}" | not grep -Fv 'XXXXX PleaseIgnoreUnused +channelz/grpc_channelz_v1" +go-control-plane/envoy +grpclb/grpc_lb_v1" +health/grpc_health_v1" +interop/grpc_testing" +orca/v3" +proto/grpc_gcp" +proto/grpc_lookup_v1" +reflection/grpc_reflection_v1" +reflection/grpc_reflection_v1alpha" +XXXXX PleaseIgnoreUnused' + +# Error for any package comments not in generated code. +grep "(ST1000)" "${SC_OUT}" | not grep -v "\.pb\.go:" + +# Only ignore the following deprecated types/fields/functions and exclude +# generated code. +grep "(SA1019)" "${SC_OUT}" | not grep -Fv 'XXXXX PleaseIgnoreUnused +XXXXX Protobuf related deprecation errors: +"github.com/golang/protobuf +.pb.go: +: ptypes. +proto.RegisterType +XXXXX gRPC internal usage deprecation errors: +"google.golang.org/grpc +: grpc. +: v1alpha. +: v1alphareflectionpb. +BalancerAttributes is deprecated: +CredsBundle is deprecated: +Metadata is deprecated: use Attributes instead. +NewSubConn is deprecated: +OverrideServerName is deprecated: +RemoveSubConn is deprecated: +SecurityVersion is deprecated: Target is deprecated: Use the Target field in the BuildOptions instead. -xxx_messageInfo_ -' "${SC_OUT}" - -# - special golint on package comments. -lint_package_comment_per_package() { - # Number of files in this go package. - fileCount=$(go list -f '{{len .GoFiles}}' $1) - if [ ${fileCount} -eq 0 ]; then - return 0 - fi - # Number of package errors generated by golint. - lintPackageCommentErrorsCount=$(golint --min_confidence 0 $1 | grep -c "should have a package comment") - # golint complains about every file that's missing the package comment. If the - # number of files for this package is greater than the number of errors, there's - # at least one file with package comment, good. Otherwise, fail. - if [ ${fileCount} -le ${lintPackageCommentErrorsCount} ]; then - echo "Package $1 (with ${fileCount} files) is missing package comment" - return 1 - fi -} -lint_package_comment() { - set +ex - - count=0 - for i in $(go list ./...); do - lint_package_comment_per_package "$i" - ((count += $?)) - done - - set -ex - return $count -} -lint_package_comment +UpdateAddresses is deprecated: +UpdateSubConnState is deprecated: +balancer.ErrTransientFailure is deprecated: +grpc/reflection/v1alpha/reflection.proto +XXXXX xDS deprecated fields we support +.ExactMatch +.PrefixMatch +.SafeRegexMatch +.SuffixMatch +GetContainsMatch +GetExactMatch +GetMatchSubjectAltNames +GetPrefixMatch +GetSafeRegexMatch +GetSuffixMatch +GetTlsCertificateCertificateProviderInstance +GetValidationContextCertificateProviderInstance +XXXXX TODO: Remove the below deprecation usages: +CloseNotifier +Roots.Subjects +XXXXX PleaseIgnoreUnused' echo SUCCESS diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go index 5f28148d..f4790237 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/decode.go @@ -11,6 +11,7 @@ import ( "strconv" "strings" + "google.golang.org/protobuf/encoding/protowire" "google.golang.org/protobuf/internal/encoding/json" "google.golang.org/protobuf/internal/encoding/messageset" "google.golang.org/protobuf/internal/errors" @@ -23,7 +24,7 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" ) -// Unmarshal reads the given []byte into the given proto.Message. +// Unmarshal reads the given []byte into the given [proto.Message]. // The provided message must be mutable (e.g., a non-nil pointer to a message). func Unmarshal(b []byte, m proto.Message) error { return UnmarshalOptions{}.Unmarshal(b, m) @@ -37,7 +38,7 @@ type UnmarshalOptions struct { // required fields will not return an error. AllowPartial bool - // If DiscardUnknown is set, unknown fields are ignored. + // If DiscardUnknown is set, unknown fields and enum name values are ignored. DiscardUnknown bool // Resolver is used for looking up types when unmarshaling @@ -47,9 +48,13 @@ type UnmarshalOptions struct { protoregistry.MessageTypeResolver protoregistry.ExtensionTypeResolver } + + // RecursionLimit limits how deeply messages may be nested. + // If zero, a default limit is applied. + RecursionLimit int } -// Unmarshal reads the given []byte and populates the given proto.Message +// Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // It will clear the message first before setting the fields. // If it returns an error, the given message may be partially set. @@ -67,6 +72,9 @@ func (o UnmarshalOptions) unmarshal(b []byte, m proto.Message) error { if o.Resolver == nil { o.Resolver = protoregistry.GlobalTypes } + if o.RecursionLimit == 0 { + o.RecursionLimit = protowire.DefaultRecursionLimit + } dec := decoder{json.NewDecoder(b), o} if err := dec.unmarshalMessage(m.ProtoReflect(), false); err != nil { @@ -114,6 +122,10 @@ func (d decoder) syntaxError(pos int, f string, x ...interface{}) error { // unmarshalMessage unmarshals a message into the given protoreflect.Message. func (d decoder) unmarshalMessage(m protoreflect.Message, skipTypeURL bool) error { + d.opts.RecursionLimit-- + if d.opts.RecursionLimit < 0 { + return errors.New("exceeded max recursion depth") + } if unmarshal := wellKnownTypeUnmarshaler(m.Descriptor().FullName()); unmarshal != nil { return unmarshal(d, m) } @@ -266,7 +278,9 @@ func (d decoder) unmarshalSingular(m protoreflect.Message, fd protoreflect.Field if err != nil { return err } - m.Set(fd, val) + if val.IsValid() { + m.Set(fd, val) + } return nil } @@ -329,7 +343,7 @@ func (d decoder) unmarshalScalar(fd protoreflect.FieldDescriptor) (protoreflect. } case protoreflect.EnumKind: - if v, ok := unmarshalEnum(tok, fd); ok { + if v, ok := unmarshalEnum(tok, fd, d.opts.DiscardUnknown); ok { return v, nil } @@ -474,7 +488,7 @@ func unmarshalBytes(tok json.Token) (protoreflect.Value, bool) { return protoreflect.ValueOfBytes(b), true } -func unmarshalEnum(tok json.Token, fd protoreflect.FieldDescriptor) (protoreflect.Value, bool) { +func unmarshalEnum(tok json.Token, fd protoreflect.FieldDescriptor, discardUnknown bool) (protoreflect.Value, bool) { switch tok.Kind() { case json.String: // Lookup EnumNumber based on name. @@ -482,6 +496,9 @@ func unmarshalEnum(tok json.Token, fd protoreflect.FieldDescriptor) (protoreflec if enumVal := fd.Enum().Values().ByName(protoreflect.Name(s)); enumVal != nil { return protoreflect.ValueOfEnum(enumVal.Number()), true } + if discardUnknown { + return protoreflect.Value{}, true + } case json.Number: if n, ok := tok.Int(32); ok { @@ -542,7 +559,9 @@ func (d decoder) unmarshalList(list protoreflect.List, fd protoreflect.FieldDesc if err != nil { return err } - list.Append(val) + if val.IsValid() { + list.Append(val) + } } } @@ -609,8 +628,9 @@ Loop: if err != nil { return err } - - mmap.Set(pkey, pval) + if pval.IsValid() { + mmap.Set(pkey, pval) + } } return nil diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/doc.go b/vendor/google.golang.org/protobuf/encoding/protojson/doc.go index 21d5d2cb..ae71007c 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/doc.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/doc.go @@ -6,6 +6,6 @@ // format. It follows the guide at // https://protobuf.dev/programming-guides/proto3#json. // -// This package produces a different output than the standard "encoding/json" +// This package produces a different output than the standard [encoding/json] // package, which does not operate correctly on protocol buffer messages. package protojson diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go index 66b95870..3f75098b 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/encode.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/encode.go @@ -31,7 +31,7 @@ func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } -// Marshal writes the given proto.Message in JSON format using default options. +// Marshal writes the given [proto.Message] in JSON format using default options. // Do not depend on the output being stable. It may change over time across // different versions of the program. func Marshal(m proto.Message) ([]byte, error) { @@ -81,6 +81,25 @@ type MarshalOptions struct { // ╚═══════╧════════════════════════════╝ EmitUnpopulated bool + // EmitDefaultValues specifies whether to emit default-valued primitive fields, + // empty lists, and empty maps. The fields affected are as follows: + // ╔═══════╤════════════════════════════════════════╗ + // ║ JSON │ Protobuf field ║ + // ╠═══════╪════════════════════════════════════════╣ + // ║ false │ non-optional scalar boolean fields ║ + // ║ 0 │ non-optional scalar numeric fields ║ + // ║ "" │ non-optional scalar string/byte fields ║ + // ║ [] │ empty repeated fields ║ + // ║ {} │ empty map fields ║ + // ╚═══════╧════════════════════════════════════════╝ + // + // Behaves similarly to EmitUnpopulated, but does not emit "null"-value fields, + // i.e. presence-sensing fields that are omitted will remain omitted to preserve + // presence-sensing. + // EmitUnpopulated takes precedence over EmitDefaultValues since the former generates + // a strict superset of the latter. + EmitDefaultValues bool + // Resolver is used for looking up types when expanding google.protobuf.Any // messages. If nil, this defaults to using protoregistry.GlobalTypes. Resolver interface { @@ -102,7 +121,7 @@ func (o MarshalOptions) Format(m proto.Message) string { return string(b) } -// Marshal marshals the given proto.Message in the JSON format using options in +// Marshal marshals the given [proto.Message] in the JSON format using options in // MarshalOptions. Do not depend on the output being stable. It may change over // time across different versions of the program. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { @@ -178,7 +197,11 @@ func (m typeURLFieldRanger) Range(f func(protoreflect.FieldDescriptor, protorefl // unpopulatedFieldRanger wraps a protoreflect.Message and modifies its Range // method to additionally iterate over unpopulated fields. -type unpopulatedFieldRanger struct{ protoreflect.Message } +type unpopulatedFieldRanger struct { + protoreflect.Message + + skipNull bool +} func (m unpopulatedFieldRanger) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { fds := m.Descriptor().Fields() @@ -192,6 +215,9 @@ func (m unpopulatedFieldRanger) Range(f func(protoreflect.FieldDescriptor, proto isProto2Scalar := fd.Syntax() == protoreflect.Proto2 && fd.Default().IsValid() isSingularMessage := fd.Cardinality() != protoreflect.Repeated && fd.Message() != nil if isProto2Scalar || isSingularMessage { + if m.skipNull { + continue + } v = protoreflect.Value{} // use invalid value to emit null } if !f(fd, v) { @@ -217,8 +243,11 @@ func (e encoder) marshalMessage(m protoreflect.Message, typeURL string) error { defer e.EndObject() var fields order.FieldRanger = m - if e.opts.EmitUnpopulated { - fields = unpopulatedFieldRanger{m} + switch { + case e.opts.EmitUnpopulated: + fields = unpopulatedFieldRanger{Message: m, skipNull: false} + case e.opts.EmitDefaultValues: + fields = unpopulatedFieldRanger{Message: m, skipNull: true} } if typeURL != "" { fields = typeURLFieldRanger{fields, typeURL} diff --git a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go index 6c37d417..25329b76 100644 --- a/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go +++ b/vendor/google.golang.org/protobuf/encoding/protojson/well_known_types.go @@ -176,7 +176,7 @@ func (d decoder) unmarshalAny(m protoreflect.Message) error { // Use another decoder to parse the unread bytes for @type field. This // avoids advancing a read from current decoder because the current JSON // object may contain the fields of the embedded type. - dec := decoder{d.Clone(), UnmarshalOptions{}} + dec := decoder{d.Clone(), UnmarshalOptions{RecursionLimit: d.opts.RecursionLimit}} tok, err := findTypeURL(dec) switch err { case errEmptyObject: @@ -308,48 +308,25 @@ Loop: // array) in order to advance the read to the next JSON value. It relies on // the decoder returning an error if the types are not in valid sequence. func (d decoder) skipJSONValue() error { - tok, err := d.Read() - if err != nil { - return err - } - // Only need to continue reading for objects and arrays. - switch tok.Kind() { - case json.ObjectOpen: - for { - tok, err := d.Read() - if err != nil { - return err - } - switch tok.Kind() { - case json.ObjectClose: - return nil - case json.Name: - // Skip object field value. - if err := d.skipJSONValue(); err != nil { - return err - } + var open int + for { + tok, err := d.Read() + if err != nil { + return err + } + switch tok.Kind() { + case json.ObjectClose, json.ArrayClose: + open-- + case json.ObjectOpen, json.ArrayOpen: + open++ + if open > d.opts.RecursionLimit { + return errors.New("exceeded max recursion depth") } } - - case json.ArrayOpen: - for { - tok, err := d.Peek() - if err != nil { - return err - } - switch tok.Kind() { - case json.ArrayClose: - d.Read() - return nil - default: - // Skip array item. - if err := d.skipJSONValue(); err != nil { - return err - } - } + if open == 0 { + return nil } } - return nil } // unmarshalAnyValue unmarshals the given custom-type message from the JSON diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go index 4921b2d4..a45f112b 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/decode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/decode.go @@ -21,7 +21,7 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" ) -// Unmarshal reads the given []byte into the given proto.Message. +// Unmarshal reads the given []byte into the given [proto.Message]. // The provided message must be mutable (e.g., a non-nil pointer to a message). func Unmarshal(b []byte, m proto.Message) error { return UnmarshalOptions{}.Unmarshal(b, m) @@ -51,7 +51,7 @@ type UnmarshalOptions struct { } } -// Unmarshal reads the given []byte and populates the given proto.Message +// Unmarshal reads the given []byte and populates the given [proto.Message] // using options in the UnmarshalOptions object. // The provided message must be mutable (e.g., a non-nil pointer to a message). func (o UnmarshalOptions) Unmarshal(b []byte, m proto.Message) error { @@ -739,7 +739,9 @@ func (d decoder) skipValue() error { case text.ListClose: return nil case text.MessageOpen: - return d.skipMessageValue() + if err := d.skipMessageValue(); err != nil { + return err + } default: // Skip items. This will not validate whether skipped values are // of the same type or not, same behavior as C++ diff --git a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go index 722a7b41..95967e81 100644 --- a/vendor/google.golang.org/protobuf/encoding/prototext/encode.go +++ b/vendor/google.golang.org/protobuf/encoding/prototext/encode.go @@ -33,7 +33,7 @@ func Format(m proto.Message) string { return MarshalOptions{Multiline: true}.Format(m) } -// Marshal writes the given proto.Message in textproto format using default +// Marshal writes the given [proto.Message] in textproto format using default // options. Do not depend on the output being stable. It may change over time // across different versions of the program. func Marshal(m proto.Message) ([]byte, error) { @@ -97,7 +97,7 @@ func (o MarshalOptions) Format(m proto.Message) string { return string(b) } -// Marshal writes the given proto.Message in textproto format using options in +// Marshal writes the given [proto.Message] in textproto format using options in // MarshalOptions object. Do not depend on the output being stable. It may // change over time across different versions of the program. func (o MarshalOptions) Marshal(m proto.Message) ([]byte, error) { diff --git a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go index f4b4686c..e942bc98 100644 --- a/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +++ b/vendor/google.golang.org/protobuf/encoding/protowire/wire.go @@ -6,7 +6,7 @@ // See https://protobuf.dev/programming-guides/encoding. // // For marshaling and unmarshaling entire protobuf messages, -// use the "google.golang.org/protobuf/proto" package instead. +// use the [google.golang.org/protobuf/proto] package instead. package protowire import ( @@ -87,7 +87,7 @@ func ParseError(n int) error { // ConsumeField parses an entire field record (both tag and value) and returns // the field number, the wire type, and the total length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). // // The total length includes the tag header and the end group marker (if the // field is a group). @@ -104,8 +104,8 @@ func ConsumeField(b []byte) (Number, Type, int) { } // ConsumeFieldValue parses a field value and returns its length. -// This assumes that the field Number and wire Type have already been parsed. -// This returns a negative length upon an error (see ParseError). +// This assumes that the field [Number] and wire [Type] have already been parsed. +// This returns a negative length upon an error (see [ParseError]). // // When parsing a group, the length includes the end group marker and // the end group is verified to match the starting field number. @@ -164,7 +164,7 @@ func AppendTag(b []byte, num Number, typ Type) []byte { } // ConsumeTag parses b as a varint-encoded tag, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeTag(b []byte) (Number, Type, int) { v, n := ConsumeVarint(b) if n < 0 { @@ -263,7 +263,7 @@ func AppendVarint(b []byte, v uint64) []byte { } // ConsumeVarint parses b as a varint-encoded uint64, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeVarint(b []byte) (v uint64, n int) { var y uint64 if len(b) <= 0 { @@ -384,7 +384,7 @@ func AppendFixed32(b []byte, v uint32) []byte { } // ConsumeFixed32 parses b as a little-endian uint32, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeFixed32(b []byte) (v uint32, n int) { if len(b) < 4 { return 0, errCodeTruncated @@ -412,7 +412,7 @@ func AppendFixed64(b []byte, v uint64) []byte { } // ConsumeFixed64 parses b as a little-endian uint64, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeFixed64(b []byte) (v uint64, n int) { if len(b) < 8 { return 0, errCodeTruncated @@ -432,7 +432,7 @@ func AppendBytes(b []byte, v []byte) []byte { } // ConsumeBytes parses b as a length-prefixed bytes value, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeBytes(b []byte) (v []byte, n int) { m, n := ConsumeVarint(b) if n < 0 { @@ -456,7 +456,7 @@ func AppendString(b []byte, v string) []byte { } // ConsumeString parses b as a length-prefixed bytes value, reporting its length. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeString(b []byte) (v string, n int) { bb, n := ConsumeBytes(b) return string(bb), n @@ -471,7 +471,7 @@ func AppendGroup(b []byte, num Number, v []byte) []byte { // ConsumeGroup parses b as a group value until the trailing end group marker, // and verifies that the end marker matches the provided num. The value v // does not contain the end marker, while the length does contain the end marker. -// This returns a negative length upon an error (see ParseError). +// This returns a negative length upon an error (see [ParseError]). func ConsumeGroup(num Number, b []byte) (v []byte, n int) { n = ConsumeFieldValue(num, StartGroupType, b) if n < 0 { @@ -495,8 +495,8 @@ func SizeGroup(num Number, n int) int { return n + SizeTag(num) } -// DecodeTag decodes the field Number and wire Type from its unified form. -// The Number is -1 if the decoded field number overflows int32. +// DecodeTag decodes the field [Number] and wire [Type] from its unified form. +// The [Number] is -1 if the decoded field number overflows int32. // Other than overflow, this does not check for field number validity. func DecodeTag(x uint64) (Number, Type) { // NOTE: MessageSet allows for larger field numbers than normal. @@ -506,7 +506,7 @@ func DecodeTag(x uint64) (Number, Type) { return Number(x >> 3), Type(x & 7) } -// EncodeTag encodes the field Number and wire Type into its unified form. +// EncodeTag encodes the field [Number] and wire [Type] into its unified form. func EncodeTag(num Number, typ Type) uint64 { return uint64(num)<<3 | uint64(typ&7) } diff --git a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go index db5248e1..a45625c8 100644 --- a/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go +++ b/vendor/google.golang.org/protobuf/internal/descfmt/stringer.go @@ -83,7 +83,13 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { case protoreflect.FileImports: for i := 0; i < vs.Len(); i++ { var rs records - rs.Append(reflect.ValueOf(vs.Get(i)), "Path", "Package", "IsPublic", "IsWeak") + rv := reflect.ValueOf(vs.Get(i)) + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Path"), "Path"}, + {rv.MethodByName("Package"), "Package"}, + {rv.MethodByName("IsPublic"), "IsPublic"}, + {rv.MethodByName("IsWeak"), "IsWeak"}, + }...) ss = append(ss, "{"+rs.Join()+"}") } return start + joinStrings(ss, allowMulti) + end @@ -92,34 +98,26 @@ func formatListOpt(vs list, isRoot, allowMulti bool) string { for i := 0; i < vs.Len(); i++ { m := reflect.ValueOf(vs).MethodByName("Get") v := m.Call([]reflect.Value{reflect.ValueOf(i)})[0].Interface() - ss = append(ss, formatDescOpt(v.(protoreflect.Descriptor), false, allowMulti && !isEnumValue)) + ss = append(ss, formatDescOpt(v.(protoreflect.Descriptor), false, allowMulti && !isEnumValue, nil)) } return start + joinStrings(ss, allowMulti && isEnumValue) + end } } -// descriptorAccessors is a list of accessors to print for each descriptor. -// -// Do not print all accessors since some contain redundant information, -// while others are pointers that we do not want to follow since the descriptor -// is actually a cyclic graph. -// -// Using a list allows us to print the accessors in a sensible order. -var descriptorAccessors = map[reflect.Type][]string{ - reflect.TypeOf((*protoreflect.FileDescriptor)(nil)).Elem(): {"Path", "Package", "Imports", "Messages", "Enums", "Extensions", "Services"}, - reflect.TypeOf((*protoreflect.MessageDescriptor)(nil)).Elem(): {"IsMapEntry", "Fields", "Oneofs", "ReservedNames", "ReservedRanges", "RequiredNumbers", "ExtensionRanges", "Messages", "Enums", "Extensions"}, - reflect.TypeOf((*protoreflect.FieldDescriptor)(nil)).Elem(): {"Number", "Cardinality", "Kind", "HasJSONName", "JSONName", "HasPresence", "IsExtension", "IsPacked", "IsWeak", "IsList", "IsMap", "MapKey", "MapValue", "HasDefault", "Default", "ContainingOneof", "ContainingMessage", "Message", "Enum"}, - reflect.TypeOf((*protoreflect.OneofDescriptor)(nil)).Elem(): {"Fields"}, // not directly used; must keep in sync with formatDescOpt - reflect.TypeOf((*protoreflect.EnumDescriptor)(nil)).Elem(): {"Values", "ReservedNames", "ReservedRanges"}, - reflect.TypeOf((*protoreflect.EnumValueDescriptor)(nil)).Elem(): {"Number"}, - reflect.TypeOf((*protoreflect.ServiceDescriptor)(nil)).Elem(): {"Methods"}, - reflect.TypeOf((*protoreflect.MethodDescriptor)(nil)).Elem(): {"Input", "Output", "IsStreamingClient", "IsStreamingServer"}, +type methodAndName struct { + method reflect.Value + name string } func FormatDesc(s fmt.State, r rune, t protoreflect.Descriptor) { - io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')))) + io.WriteString(s, formatDescOpt(t, true, r == 'v' && (s.Flag('+') || s.Flag('#')), nil)) } -func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { + +func InternalFormatDescOptForTesting(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string { + return formatDescOpt(t, isRoot, allowMulti, record) +} + +func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool, record func(string)) string { rv := reflect.ValueOf(t) rt := rv.MethodByName("ProtoType").Type().In(0) @@ -129,26 +127,60 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { } _, isFile := t.(protoreflect.FileDescriptor) - rs := records{allowMulti: allowMulti} + rs := records{ + allowMulti: allowMulti, + record: record, + } if t.IsPlaceholder() { if isFile { - rs.Append(rv, "Path", "Package", "IsPlaceholder") + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Path"), "Path"}, + {rv.MethodByName("Package"), "Package"}, + {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + }...) } else { - rs.Append(rv, "FullName", "IsPlaceholder") + rs.Append(rv, []methodAndName{ + {rv.MethodByName("FullName"), "FullName"}, + {rv.MethodByName("IsPlaceholder"), "IsPlaceholder"}, + }...) } } else { switch { case isFile: - rs.Append(rv, "Syntax") + rs.Append(rv, methodAndName{rv.MethodByName("Syntax"), "Syntax"}) case isRoot: - rs.Append(rv, "Syntax", "FullName") + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Syntax"), "Syntax"}, + {rv.MethodByName("FullName"), "FullName"}, + }...) default: - rs.Append(rv, "Name") + rs.Append(rv, methodAndName{rv.MethodByName("Name"), "Name"}) } switch t := t.(type) { case protoreflect.FieldDescriptor: - for _, s := range descriptorAccessors[rt] { - switch s { + accessors := []methodAndName{ + {rv.MethodByName("Number"), "Number"}, + {rv.MethodByName("Cardinality"), "Cardinality"}, + {rv.MethodByName("Kind"), "Kind"}, + {rv.MethodByName("HasJSONName"), "HasJSONName"}, + {rv.MethodByName("JSONName"), "JSONName"}, + {rv.MethodByName("HasPresence"), "HasPresence"}, + {rv.MethodByName("IsExtension"), "IsExtension"}, + {rv.MethodByName("IsPacked"), "IsPacked"}, + {rv.MethodByName("IsWeak"), "IsWeak"}, + {rv.MethodByName("IsList"), "IsList"}, + {rv.MethodByName("IsMap"), "IsMap"}, + {rv.MethodByName("MapKey"), "MapKey"}, + {rv.MethodByName("MapValue"), "MapValue"}, + {rv.MethodByName("HasDefault"), "HasDefault"}, + {rv.MethodByName("Default"), "Default"}, + {rv.MethodByName("ContainingOneof"), "ContainingOneof"}, + {rv.MethodByName("ContainingMessage"), "ContainingMessage"}, + {rv.MethodByName("Message"), "Message"}, + {rv.MethodByName("Enum"), "Enum"}, + } + for _, s := range accessors { + switch s.name { case "MapKey": if k := t.MapKey(); k != nil { rs.recs = append(rs.recs, [2]string{"MapKey", k.Kind().String()}) @@ -157,20 +189,20 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { if v := t.MapValue(); v != nil { switch v.Kind() { case protoreflect.EnumKind: - rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Enum().FullName())}) + rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Enum().FullName())}) case protoreflect.MessageKind, protoreflect.GroupKind: - rs.recs = append(rs.recs, [2]string{"MapValue", string(v.Message().FullName())}) + rs.AppendRecs("MapValue", [2]string{"MapValue", string(v.Message().FullName())}) default: - rs.recs = append(rs.recs, [2]string{"MapValue", v.Kind().String()}) + rs.AppendRecs("MapValue", [2]string{"MapValue", v.Kind().String()}) } } case "ContainingOneof": if od := t.ContainingOneof(); od != nil { - rs.recs = append(rs.recs, [2]string{"Oneof", string(od.Name())}) + rs.AppendRecs("ContainingOneof", [2]string{"Oneof", string(od.Name())}) } case "ContainingMessage": if t.IsExtension() { - rs.recs = append(rs.recs, [2]string{"Extendee", string(t.ContainingMessage().FullName())}) + rs.AppendRecs("ContainingMessage", [2]string{"Extendee", string(t.ContainingMessage().FullName())}) } case "Message": if !t.IsMap() { @@ -187,13 +219,61 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { ss = append(ss, string(fs.Get(i).Name())) } if len(ss) > 0 { - rs.recs = append(rs.recs, [2]string{"Fields", "[" + joinStrings(ss, false) + "]"}) + rs.AppendRecs("Fields", [2]string{"Fields", "[" + joinStrings(ss, false) + "]"}) } - default: - rs.Append(rv, descriptorAccessors[rt]...) + + case protoreflect.FileDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Path"), "Path"}, + {rv.MethodByName("Package"), "Package"}, + {rv.MethodByName("Imports"), "Imports"}, + {rv.MethodByName("Messages"), "Messages"}, + {rv.MethodByName("Enums"), "Enums"}, + {rv.MethodByName("Extensions"), "Extensions"}, + {rv.MethodByName("Services"), "Services"}, + }...) + + case protoreflect.MessageDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("IsMapEntry"), "IsMapEntry"}, + {rv.MethodByName("Fields"), "Fields"}, + {rv.MethodByName("Oneofs"), "Oneofs"}, + {rv.MethodByName("ReservedNames"), "ReservedNames"}, + {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, + {rv.MethodByName("RequiredNumbers"), "RequiredNumbers"}, + {rv.MethodByName("ExtensionRanges"), "ExtensionRanges"}, + {rv.MethodByName("Messages"), "Messages"}, + {rv.MethodByName("Enums"), "Enums"}, + {rv.MethodByName("Extensions"), "Extensions"}, + }...) + + case protoreflect.EnumDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Values"), "Values"}, + {rv.MethodByName("ReservedNames"), "ReservedNames"}, + {rv.MethodByName("ReservedRanges"), "ReservedRanges"}, + }...) + + case protoreflect.EnumValueDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Number"), "Number"}, + }...) + + case protoreflect.ServiceDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Methods"), "Methods"}, + }...) + + case protoreflect.MethodDescriptor: + rs.Append(rv, []methodAndName{ + {rv.MethodByName("Input"), "Input"}, + {rv.MethodByName("Output"), "Output"}, + {rv.MethodByName("IsStreamingClient"), "IsStreamingClient"}, + {rv.MethodByName("IsStreamingServer"), "IsStreamingServer"}, + }...) } - if rv.MethodByName("GoType").IsValid() { - rs.Append(rv, "GoType") + if m := rv.MethodByName("GoType"); m.IsValid() { + rs.Append(rv, methodAndName{m, "GoType"}) } } return start + rs.Join() + end @@ -202,19 +282,34 @@ func formatDescOpt(t protoreflect.Descriptor, isRoot, allowMulti bool) string { type records struct { recs [][2]string allowMulti bool + + // record is a function that will be called for every Append() or + // AppendRecs() call, to be used for testing with the + // InternalFormatDescOptForTesting function. + record func(string) } -func (rs *records) Append(v reflect.Value, accessors ...string) { +func (rs *records) AppendRecs(fieldName string, newRecs [2]string) { + if rs.record != nil { + rs.record(fieldName) + } + rs.recs = append(rs.recs, newRecs) +} + +func (rs *records) Append(v reflect.Value, accessors ...methodAndName) { for _, a := range accessors { + if rs.record != nil { + rs.record(a.name) + } var rv reflect.Value - if m := v.MethodByName(a); m.IsValid() { - rv = m.Call(nil)[0] + if a.method.IsValid() { + rv = a.method.Call(nil)[0] } if v.Kind() == reflect.Struct && !rv.IsValid() { - rv = v.FieldByName(a) + rv = v.FieldByName(a.name) } if !rv.IsValid() { - panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a)) + panic(fmt.Sprintf("unknown accessor: %v.%s", v.Type(), a.name)) } if _, ok := rv.Interface().(protoreflect.Value); ok { rv = rv.MethodByName("Interface").Call(nil)[0] @@ -261,7 +356,7 @@ func (rs *records) Append(v reflect.Value, accessors ...string) { default: s = fmt.Sprint(v) } - rs.recs = append(rs.recs, [2]string{a, s}) + rs.recs = append(rs.recs, [2]string{a.name, s}) } } diff --git a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go index 7c3689ba..193c68e8 100644 --- a/vendor/google.golang.org/protobuf/internal/filedesc/desc.go +++ b/vendor/google.golang.org/protobuf/internal/filedesc/desc.go @@ -21,11 +21,26 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" ) +// Edition is an Enum for proto2.Edition +type Edition int32 + +// These values align with the value of Enum in descriptor.proto which allows +// direct conversion between the proto enum and this enum. +const ( + EditionUnknown Edition = 0 + EditionProto2 Edition = 998 + EditionProto3 Edition = 999 + Edition2023 Edition = 1000 + EditionUnsupported Edition = 100000 +) + // The types in this file may have a suffix: // • L0: Contains fields common to all descriptors (except File) and // must be initialized up front. // • L1: Contains fields specific to a descriptor and -// must be initialized up front. +// must be initialized up front. If the associated proto uses Editions, the +// Editions features must always be resolved. If not explicitly set, the +// appropriate default must be resolved and set. // • L2: Contains fields that are lazily initialized when constructing // from the raw file descriptor. When constructing as a literal, the L2 // fields must be initialized up front. @@ -44,6 +59,7 @@ type ( } FileL1 struct { Syntax protoreflect.Syntax + Edition Edition // Only used if Syntax == Editions Path string Package protoreflect.FullName @@ -51,12 +67,35 @@ type ( Messages Messages Extensions Extensions Services Services + + EditionFeatures FileEditionFeatures } FileL2 struct { Options func() protoreflect.ProtoMessage Imports FileImports Locations SourceLocations } + + FileEditionFeatures struct { + // IsFieldPresence is true if field_presence is EXPLICIT + // https://protobuf.dev/editions/features/#field_presence + IsFieldPresence bool + // IsOpenEnum is true if enum_type is OPEN + // https://protobuf.dev/editions/features/#enum_type + IsOpenEnum bool + // IsPacked is true if repeated_field_encoding is PACKED + // https://protobuf.dev/editions/features/#repeated_field_encoding + IsPacked bool + // IsUTF8Validated is true if utf_validation is VERIFY + // https://protobuf.dev/editions/features/#utf8_validation + IsUTF8Validated bool + // IsDelimitedEncoded is true if message_encoding is DELIMITED + // https://protobuf.dev/editions/features/#message_encoding + IsDelimitedEncoded bool + // IsJSONCompliant is true if json_format is ALLOW + // https://protobuf.dev/editions/features/#json_format + IsJSONCompliant bool + } ) func (fd *File) ParentFile() protoreflect.FileDescriptor { return fd } @@ -210,6 +249,9 @@ type ( ContainingOneof protoreflect.OneofDescriptor // must be consistent with Message.Oneofs.Fields Enum protoreflect.EnumDescriptor Message protoreflect.MessageDescriptor + + // Edition features. + Presence bool } Oneof struct { @@ -273,6 +315,9 @@ func (fd *Field) HasJSONName() bool { return fd.L1.StringNam func (fd *Field) JSONName() string { return fd.L1.StringName.getJSON(fd) } func (fd *Field) TextName() string { return fd.L1.StringName.getText(fd) } func (fd *Field) HasPresence() bool { + if fd.L0.ParentFile.L1.Syntax == protoreflect.Editions { + return fd.L1.Presence || fd.L1.Message != nil || fd.L1.ContainingOneof != nil + } return fd.L1.Cardinality != protoreflect.Repeated && (fd.L0.ParentFile.L1.Syntax == protoreflect.Proto2 || fd.L1.Message != nil || fd.L1.ContainingOneof != nil) } func (fd *Field) HasOptionalKeyword() bool { diff --git a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go index 136f1b21..8f94230e 100644 --- a/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +++ b/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go @@ -12,6 +12,12 @@ import ( const File_google_protobuf_descriptor_proto = "google/protobuf/descriptor.proto" +// Full and short names for google.protobuf.Edition. +const ( + Edition_enum_fullname = "google.protobuf.Edition" + Edition_enum_name = "Edition" +) + // Names for google.protobuf.FileDescriptorSet. const ( FileDescriptorSet_message_name protoreflect.Name = "FileDescriptorSet" @@ -81,7 +87,7 @@ const ( FileDescriptorProto_Options_field_number protoreflect.FieldNumber = 8 FileDescriptorProto_SourceCodeInfo_field_number protoreflect.FieldNumber = 9 FileDescriptorProto_Syntax_field_number protoreflect.FieldNumber = 12 - FileDescriptorProto_Edition_field_number protoreflect.FieldNumber = 13 + FileDescriptorProto_Edition_field_number protoreflect.FieldNumber = 14 ) // Names for google.protobuf.DescriptorProto. @@ -184,10 +190,12 @@ const ( const ( ExtensionRangeOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" ExtensionRangeOptions_Declaration_field_name protoreflect.Name = "declaration" + ExtensionRangeOptions_Features_field_name protoreflect.Name = "features" ExtensionRangeOptions_Verification_field_name protoreflect.Name = "verification" ExtensionRangeOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.uninterpreted_option" ExtensionRangeOptions_Declaration_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.declaration" + ExtensionRangeOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.features" ExtensionRangeOptions_Verification_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.verification" ) @@ -195,6 +203,7 @@ const ( const ( ExtensionRangeOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ExtensionRangeOptions_Declaration_field_number protoreflect.FieldNumber = 2 + ExtensionRangeOptions_Features_field_number protoreflect.FieldNumber = 50 ExtensionRangeOptions_Verification_field_number protoreflect.FieldNumber = 3 ) @@ -212,29 +221,26 @@ const ( // Field names for google.protobuf.ExtensionRangeOptions.Declaration. const ( - ExtensionRangeOptions_Declaration_Number_field_name protoreflect.Name = "number" - ExtensionRangeOptions_Declaration_FullName_field_name protoreflect.Name = "full_name" - ExtensionRangeOptions_Declaration_Type_field_name protoreflect.Name = "type" - ExtensionRangeOptions_Declaration_IsRepeated_field_name protoreflect.Name = "is_repeated" - ExtensionRangeOptions_Declaration_Reserved_field_name protoreflect.Name = "reserved" - ExtensionRangeOptions_Declaration_Repeated_field_name protoreflect.Name = "repeated" + ExtensionRangeOptions_Declaration_Number_field_name protoreflect.Name = "number" + ExtensionRangeOptions_Declaration_FullName_field_name protoreflect.Name = "full_name" + ExtensionRangeOptions_Declaration_Type_field_name protoreflect.Name = "type" + ExtensionRangeOptions_Declaration_Reserved_field_name protoreflect.Name = "reserved" + ExtensionRangeOptions_Declaration_Repeated_field_name protoreflect.Name = "repeated" - ExtensionRangeOptions_Declaration_Number_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.number" - ExtensionRangeOptions_Declaration_FullName_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.full_name" - ExtensionRangeOptions_Declaration_Type_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.type" - ExtensionRangeOptions_Declaration_IsRepeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.is_repeated" - ExtensionRangeOptions_Declaration_Reserved_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.reserved" - ExtensionRangeOptions_Declaration_Repeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.repeated" + ExtensionRangeOptions_Declaration_Number_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.number" + ExtensionRangeOptions_Declaration_FullName_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.full_name" + ExtensionRangeOptions_Declaration_Type_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.type" + ExtensionRangeOptions_Declaration_Reserved_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.reserved" + ExtensionRangeOptions_Declaration_Repeated_field_fullname protoreflect.FullName = "google.protobuf.ExtensionRangeOptions.Declaration.repeated" ) // Field numbers for google.protobuf.ExtensionRangeOptions.Declaration. const ( - ExtensionRangeOptions_Declaration_Number_field_number protoreflect.FieldNumber = 1 - ExtensionRangeOptions_Declaration_FullName_field_number protoreflect.FieldNumber = 2 - ExtensionRangeOptions_Declaration_Type_field_number protoreflect.FieldNumber = 3 - ExtensionRangeOptions_Declaration_IsRepeated_field_number protoreflect.FieldNumber = 4 - ExtensionRangeOptions_Declaration_Reserved_field_number protoreflect.FieldNumber = 5 - ExtensionRangeOptions_Declaration_Repeated_field_number protoreflect.FieldNumber = 6 + ExtensionRangeOptions_Declaration_Number_field_number protoreflect.FieldNumber = 1 + ExtensionRangeOptions_Declaration_FullName_field_number protoreflect.FieldNumber = 2 + ExtensionRangeOptions_Declaration_Type_field_number protoreflect.FieldNumber = 3 + ExtensionRangeOptions_Declaration_Reserved_field_number protoreflect.FieldNumber = 5 + ExtensionRangeOptions_Declaration_Repeated_field_number protoreflect.FieldNumber = 6 ) // Names for google.protobuf.FieldDescriptorProto. @@ -478,6 +484,7 @@ const ( FileOptions_PhpNamespace_field_name protoreflect.Name = "php_namespace" FileOptions_PhpMetadataNamespace_field_name protoreflect.Name = "php_metadata_namespace" FileOptions_RubyPackage_field_name protoreflect.Name = "ruby_package" + FileOptions_Features_field_name protoreflect.Name = "features" FileOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FileOptions_JavaPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.java_package" @@ -500,6 +507,7 @@ const ( FileOptions_PhpNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_namespace" FileOptions_PhpMetadataNamespace_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.php_metadata_namespace" FileOptions_RubyPackage_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.ruby_package" + FileOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.features" FileOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FileOptions.uninterpreted_option" ) @@ -525,6 +533,7 @@ const ( FileOptions_PhpNamespace_field_number protoreflect.FieldNumber = 41 FileOptions_PhpMetadataNamespace_field_number protoreflect.FieldNumber = 44 FileOptions_RubyPackage_field_number protoreflect.FieldNumber = 45 + FileOptions_Features_field_number protoreflect.FieldNumber = 50 FileOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -547,6 +556,7 @@ const ( MessageOptions_Deprecated_field_name protoreflect.Name = "deprecated" MessageOptions_MapEntry_field_name protoreflect.Name = "map_entry" MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts" + MessageOptions_Features_field_name protoreflect.Name = "features" MessageOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" MessageOptions_MessageSetWireFormat_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.message_set_wire_format" @@ -554,6 +564,7 @@ const ( MessageOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated" MessageOptions_MapEntry_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.map_entry" MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.deprecated_legacy_json_field_conflicts" + MessageOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.features" MessageOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MessageOptions.uninterpreted_option" ) @@ -564,6 +575,7 @@ const ( MessageOptions_Deprecated_field_number protoreflect.FieldNumber = 3 MessageOptions_MapEntry_field_number protoreflect.FieldNumber = 7 MessageOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 11 + MessageOptions_Features_field_number protoreflect.FieldNumber = 12 MessageOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -584,8 +596,9 @@ const ( FieldOptions_Weak_field_name protoreflect.Name = "weak" FieldOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" FieldOptions_Retention_field_name protoreflect.Name = "retention" - FieldOptions_Target_field_name protoreflect.Name = "target" FieldOptions_Targets_field_name protoreflect.Name = "targets" + FieldOptions_EditionDefaults_field_name protoreflect.Name = "edition_defaults" + FieldOptions_Features_field_name protoreflect.Name = "features" FieldOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" FieldOptions_Ctype_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.ctype" @@ -597,8 +610,9 @@ const ( FieldOptions_Weak_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.weak" FieldOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.debug_redact" FieldOptions_Retention_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.retention" - FieldOptions_Target_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.target" FieldOptions_Targets_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.targets" + FieldOptions_EditionDefaults_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.edition_defaults" + FieldOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.features" FieldOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.uninterpreted_option" ) @@ -613,8 +627,9 @@ const ( FieldOptions_Weak_field_number protoreflect.FieldNumber = 10 FieldOptions_DebugRedact_field_number protoreflect.FieldNumber = 16 FieldOptions_Retention_field_number protoreflect.FieldNumber = 17 - FieldOptions_Target_field_number protoreflect.FieldNumber = 18 FieldOptions_Targets_field_number protoreflect.FieldNumber = 19 + FieldOptions_EditionDefaults_field_number protoreflect.FieldNumber = 20 + FieldOptions_Features_field_number protoreflect.FieldNumber = 21 FieldOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -642,6 +657,27 @@ const ( FieldOptions_OptionTargetType_enum_name = "OptionTargetType" ) +// Names for google.protobuf.FieldOptions.EditionDefault. +const ( + FieldOptions_EditionDefault_message_name protoreflect.Name = "EditionDefault" + FieldOptions_EditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault" +) + +// Field names for google.protobuf.FieldOptions.EditionDefault. +const ( + FieldOptions_EditionDefault_Edition_field_name protoreflect.Name = "edition" + FieldOptions_EditionDefault_Value_field_name protoreflect.Name = "value" + + FieldOptions_EditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.edition" + FieldOptions_EditionDefault_Value_field_fullname protoreflect.FullName = "google.protobuf.FieldOptions.EditionDefault.value" +) + +// Field numbers for google.protobuf.FieldOptions.EditionDefault. +const ( + FieldOptions_EditionDefault_Edition_field_number protoreflect.FieldNumber = 3 + FieldOptions_EditionDefault_Value_field_number protoreflect.FieldNumber = 2 +) + // Names for google.protobuf.OneofOptions. const ( OneofOptions_message_name protoreflect.Name = "OneofOptions" @@ -650,13 +686,16 @@ const ( // Field names for google.protobuf.OneofOptions. const ( + OneofOptions_Features_field_name protoreflect.Name = "features" OneofOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" + OneofOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.features" OneofOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.OneofOptions.uninterpreted_option" ) // Field numbers for google.protobuf.OneofOptions. const ( + OneofOptions_Features_field_number protoreflect.FieldNumber = 1 OneofOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -671,11 +710,13 @@ const ( EnumOptions_AllowAlias_field_name protoreflect.Name = "allow_alias" EnumOptions_Deprecated_field_name protoreflect.Name = "deprecated" EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_name protoreflect.Name = "deprecated_legacy_json_field_conflicts" + EnumOptions_Features_field_name protoreflect.Name = "features" EnumOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumOptions_AllowAlias_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.allow_alias" EnumOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated" EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.deprecated_legacy_json_field_conflicts" + EnumOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.features" EnumOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumOptions.uninterpreted_option" ) @@ -684,6 +725,7 @@ const ( EnumOptions_AllowAlias_field_number protoreflect.FieldNumber = 2 EnumOptions_Deprecated_field_number protoreflect.FieldNumber = 3 EnumOptions_DeprecatedLegacyJsonFieldConflicts_field_number protoreflect.FieldNumber = 6 + EnumOptions_Features_field_number protoreflect.FieldNumber = 7 EnumOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -696,15 +738,21 @@ const ( // Field names for google.protobuf.EnumValueOptions. const ( EnumValueOptions_Deprecated_field_name protoreflect.Name = "deprecated" + EnumValueOptions_Features_field_name protoreflect.Name = "features" + EnumValueOptions_DebugRedact_field_name protoreflect.Name = "debug_redact" EnumValueOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" EnumValueOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.deprecated" + EnumValueOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.features" + EnumValueOptions_DebugRedact_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.debug_redact" EnumValueOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.EnumValueOptions.uninterpreted_option" ) // Field numbers for google.protobuf.EnumValueOptions. const ( EnumValueOptions_Deprecated_field_number protoreflect.FieldNumber = 1 + EnumValueOptions_Features_field_number protoreflect.FieldNumber = 2 + EnumValueOptions_DebugRedact_field_number protoreflect.FieldNumber = 3 EnumValueOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -716,15 +764,18 @@ const ( // Field names for google.protobuf.ServiceOptions. const ( + ServiceOptions_Features_field_name protoreflect.Name = "features" ServiceOptions_Deprecated_field_name protoreflect.Name = "deprecated" ServiceOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" + ServiceOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.features" ServiceOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.deprecated" ServiceOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.ServiceOptions.uninterpreted_option" ) // Field numbers for google.protobuf.ServiceOptions. const ( + ServiceOptions_Features_field_number protoreflect.FieldNumber = 34 ServiceOptions_Deprecated_field_number protoreflect.FieldNumber = 33 ServiceOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -739,10 +790,12 @@ const ( const ( MethodOptions_Deprecated_field_name protoreflect.Name = "deprecated" MethodOptions_IdempotencyLevel_field_name protoreflect.Name = "idempotency_level" + MethodOptions_Features_field_name protoreflect.Name = "features" MethodOptions_UninterpretedOption_field_name protoreflect.Name = "uninterpreted_option" MethodOptions_Deprecated_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.deprecated" MethodOptions_IdempotencyLevel_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.idempotency_level" + MethodOptions_Features_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.features" MethodOptions_UninterpretedOption_field_fullname protoreflect.FullName = "google.protobuf.MethodOptions.uninterpreted_option" ) @@ -750,6 +803,7 @@ const ( const ( MethodOptions_Deprecated_field_number protoreflect.FieldNumber = 33 MethodOptions_IdempotencyLevel_field_number protoreflect.FieldNumber = 34 + MethodOptions_Features_field_number protoreflect.FieldNumber = 35 MethodOptions_UninterpretedOption_field_number protoreflect.FieldNumber = 999 ) @@ -816,6 +870,120 @@ const ( UninterpretedOption_NamePart_IsExtension_field_number protoreflect.FieldNumber = 2 ) +// Names for google.protobuf.FeatureSet. +const ( + FeatureSet_message_name protoreflect.Name = "FeatureSet" + FeatureSet_message_fullname protoreflect.FullName = "google.protobuf.FeatureSet" +) + +// Field names for google.protobuf.FeatureSet. +const ( + FeatureSet_FieldPresence_field_name protoreflect.Name = "field_presence" + FeatureSet_EnumType_field_name protoreflect.Name = "enum_type" + FeatureSet_RepeatedFieldEncoding_field_name protoreflect.Name = "repeated_field_encoding" + FeatureSet_Utf8Validation_field_name protoreflect.Name = "utf8_validation" + FeatureSet_MessageEncoding_field_name protoreflect.Name = "message_encoding" + FeatureSet_JsonFormat_field_name protoreflect.Name = "json_format" + + FeatureSet_FieldPresence_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.field_presence" + FeatureSet_EnumType_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.enum_type" + FeatureSet_RepeatedFieldEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.repeated_field_encoding" + FeatureSet_Utf8Validation_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.utf8_validation" + FeatureSet_MessageEncoding_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.message_encoding" + FeatureSet_JsonFormat_field_fullname protoreflect.FullName = "google.protobuf.FeatureSet.json_format" +) + +// Field numbers for google.protobuf.FeatureSet. +const ( + FeatureSet_FieldPresence_field_number protoreflect.FieldNumber = 1 + FeatureSet_EnumType_field_number protoreflect.FieldNumber = 2 + FeatureSet_RepeatedFieldEncoding_field_number protoreflect.FieldNumber = 3 + FeatureSet_Utf8Validation_field_number protoreflect.FieldNumber = 4 + FeatureSet_MessageEncoding_field_number protoreflect.FieldNumber = 5 + FeatureSet_JsonFormat_field_number protoreflect.FieldNumber = 6 +) + +// Full and short names for google.protobuf.FeatureSet.FieldPresence. +const ( + FeatureSet_FieldPresence_enum_fullname = "google.protobuf.FeatureSet.FieldPresence" + FeatureSet_FieldPresence_enum_name = "FieldPresence" +) + +// Full and short names for google.protobuf.FeatureSet.EnumType. +const ( + FeatureSet_EnumType_enum_fullname = "google.protobuf.FeatureSet.EnumType" + FeatureSet_EnumType_enum_name = "EnumType" +) + +// Full and short names for google.protobuf.FeatureSet.RepeatedFieldEncoding. +const ( + FeatureSet_RepeatedFieldEncoding_enum_fullname = "google.protobuf.FeatureSet.RepeatedFieldEncoding" + FeatureSet_RepeatedFieldEncoding_enum_name = "RepeatedFieldEncoding" +) + +// Full and short names for google.protobuf.FeatureSet.Utf8Validation. +const ( + FeatureSet_Utf8Validation_enum_fullname = "google.protobuf.FeatureSet.Utf8Validation" + FeatureSet_Utf8Validation_enum_name = "Utf8Validation" +) + +// Full and short names for google.protobuf.FeatureSet.MessageEncoding. +const ( + FeatureSet_MessageEncoding_enum_fullname = "google.protobuf.FeatureSet.MessageEncoding" + FeatureSet_MessageEncoding_enum_name = "MessageEncoding" +) + +// Full and short names for google.protobuf.FeatureSet.JsonFormat. +const ( + FeatureSet_JsonFormat_enum_fullname = "google.protobuf.FeatureSet.JsonFormat" + FeatureSet_JsonFormat_enum_name = "JsonFormat" +) + +// Names for google.protobuf.FeatureSetDefaults. +const ( + FeatureSetDefaults_message_name protoreflect.Name = "FeatureSetDefaults" + FeatureSetDefaults_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults" +) + +// Field names for google.protobuf.FeatureSetDefaults. +const ( + FeatureSetDefaults_Defaults_field_name protoreflect.Name = "defaults" + FeatureSetDefaults_MinimumEdition_field_name protoreflect.Name = "minimum_edition" + FeatureSetDefaults_MaximumEdition_field_name protoreflect.Name = "maximum_edition" + + FeatureSetDefaults_Defaults_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.defaults" + FeatureSetDefaults_MinimumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.minimum_edition" + FeatureSetDefaults_MaximumEdition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.maximum_edition" +) + +// Field numbers for google.protobuf.FeatureSetDefaults. +const ( + FeatureSetDefaults_Defaults_field_number protoreflect.FieldNumber = 1 + FeatureSetDefaults_MinimumEdition_field_number protoreflect.FieldNumber = 4 + FeatureSetDefaults_MaximumEdition_field_number protoreflect.FieldNumber = 5 +) + +// Names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. +const ( + FeatureSetDefaults_FeatureSetEditionDefault_message_name protoreflect.Name = "FeatureSetEditionDefault" + FeatureSetDefaults_FeatureSetEditionDefault_message_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault" +) + +// Field names for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. +const ( + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_name protoreflect.Name = "edition" + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_name protoreflect.Name = "features" + + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition" + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_fullname protoreflect.FullName = "google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features" +) + +// Field numbers for google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault. +const ( + FeatureSetDefaults_FeatureSetEditionDefault_Edition_field_number protoreflect.FieldNumber = 3 + FeatureSetDefaults_FeatureSetEditionDefault_Features_field_number protoreflect.FieldNumber = 2 +) + // Names for google.protobuf.SourceCodeInfo. const ( SourceCodeInfo_message_name protoreflect.Name = "SourceCodeInfo" diff --git a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go index 1a509b63..f55dc01e 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go +++ b/vendor/google.golang.org/protobuf/internal/impl/codec_gen.go @@ -162,11 +162,20 @@ func appendBoolSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptions func consumeBoolSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.BoolSlice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growBoolSlice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -732,11 +741,20 @@ func appendInt32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption func consumeInt32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt32Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -1138,11 +1156,20 @@ func appendSint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeSint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt32Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -1544,11 +1571,20 @@ func appendUint32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeUint32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growUint32Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -1950,11 +1986,20 @@ func appendInt64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption func consumeInt64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt64Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -2356,11 +2401,20 @@ func appendSint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeSint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growInt64Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -2762,11 +2816,20 @@ func appendUint64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeUint64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := 0 + for _, v := range b { + if v < 0x80 { + count++ + } + } + if count > 0 { + p.growUint64Slice(count) + } + s := *sp for len(b) > 0 { var v uint64 var n int @@ -3145,11 +3208,15 @@ func appendSfixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpt func consumeSfixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed32() + if count > 0 { + p.growInt32Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { @@ -3461,11 +3528,15 @@ func appendFixed32Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpti func consumeFixed32Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed32() + if count > 0 { + p.growUint32Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { @@ -3777,11 +3848,15 @@ func appendFloatSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOption func consumeFloatSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Float32Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed32() + if count > 0 { + p.growFloat32Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed32(b) if n < 0 { @@ -4093,11 +4168,15 @@ func appendSfixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpt func consumeSfixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Int64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed64() + if count > 0 { + p.growInt64Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { @@ -4409,11 +4488,15 @@ func appendFixed64Slice(b []byte, p pointer, f *coderFieldInfo, opts marshalOpti func consumeFixed64Slice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Uint64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed64() + if count > 0 { + p.growUint64Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { @@ -4725,11 +4808,15 @@ func appendDoubleSlice(b []byte, p pointer, f *coderFieldInfo, opts marshalOptio func consumeDoubleSlice(b []byte, p pointer, wtyp protowire.Type, f *coderFieldInfo, opts unmarshalOptions) (out unmarshalOutput, err error) { sp := p.Float64Slice() if wtyp == protowire.BytesType { - s := *sp b, n := protowire.ConsumeBytes(b) if n < 0 { return out, errDecode } + count := len(b) / protowire.SizeFixed64() + if count > 0 { + p.growFloat64Slice(count) + } + s := *sp for len(b) > 0 { v, n := protowire.ConsumeFixed64(b) if n < 0 { diff --git a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go index 61c483fa..2ab2c629 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/legacy_message.go @@ -206,13 +206,18 @@ func aberrantLoadMessageDescReentrant(t reflect.Type, name protoreflect.FullName // Obtain a list of oneof wrapper types. var oneofWrappers []reflect.Type - for _, method := range []string{"XXX_OneofFuncs", "XXX_OneofWrappers"} { - if fn, ok := t.MethodByName(method); ok { - for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]interface{}); ok { - for _, v := range vs { - oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) - } + methods := make([]reflect.Method, 0, 2) + if m, ok := t.MethodByName("XXX_OneofFuncs"); ok { + methods = append(methods, m) + } + if m, ok := t.MethodByName("XXX_OneofWrappers"); ok { + methods = append(methods, m) + } + for _, fn := range methods { + for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { + if vs, ok := v.Interface().([]interface{}); ok { + for _, v := range vs { + oneofWrappers = append(oneofWrappers, reflect.TypeOf(v)) } } } diff --git a/vendor/google.golang.org/protobuf/internal/impl/message.go b/vendor/google.golang.org/protobuf/internal/impl/message.go index 4f5fb67a..629bacdc 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/message.go +++ b/vendor/google.golang.org/protobuf/internal/impl/message.go @@ -192,12 +192,17 @@ fieldLoop: // Derive a mapping of oneof wrappers to fields. oneofWrappers := mi.OneofWrappers - for _, method := range []string{"XXX_OneofFuncs", "XXX_OneofWrappers"} { - if fn, ok := reflect.PtrTo(t).MethodByName(method); ok { - for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { - if vs, ok := v.Interface().([]interface{}); ok { - oneofWrappers = vs - } + methods := make([]reflect.Method, 0, 2) + if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofFuncs"); ok { + methods = append(methods, m) + } + if m, ok := reflect.PtrTo(t).MethodByName("XXX_OneofWrappers"); ok { + methods = append(methods, m) + } + for _, fn := range methods { + for _, v := range fn.Func.Call([]reflect.Value{reflect.Zero(fn.Type.In(0))}) { + if vs, ok := v.Interface().([]interface{}); ok { + oneofWrappers = vs } } } diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go index 4c491bdf..517e9443 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_reflect.go @@ -159,6 +159,42 @@ func (p pointer) SetPointer(v pointer) { p.v.Elem().Set(v.v) } +func growSlice(p pointer, addCap int) { + // TODO: Once we only support Go 1.20 and newer, use reflect.Grow. + in := p.v.Elem() + out := reflect.MakeSlice(in.Type(), in.Len(), in.Len()+addCap) + reflect.Copy(out, in) + p.v.Elem().Set(out) +} + +func (p pointer) growBoolSlice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growInt32Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growUint32Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growInt64Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growUint64Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growFloat64Slice(addCap int) { + growSlice(p, addCap) +} + +func (p pointer) growFloat32Slice(addCap int) { + growSlice(p, addCap) +} + func (Export) MessageStateOf(p Pointer) *messageState { panic("not supported") } func (ms *messageState) pointer() pointer { panic("not supported") } func (ms *messageState) messageInfo() *MessageInfo { panic("not supported") } diff --git a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go index ee0e0573..4b020e31 100644 --- a/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/impl/pointer_unsafe.go @@ -138,6 +138,46 @@ func (p pointer) SetPointer(v pointer) { *(*unsafe.Pointer)(p.p) = (unsafe.Pointer)(v.p) } +func (p pointer) growBoolSlice(addCap int) { + sp := p.BoolSlice() + s := make([]bool, 0, addCap+len(*sp)) + s = s[:len(*sp)] + copy(s, *sp) + *sp = s +} + +func (p pointer) growInt32Slice(addCap int) { + sp := p.Int32Slice() + s := make([]int32, 0, addCap+len(*sp)) + s = s[:len(*sp)] + copy(s, *sp) + *sp = s +} + +func (p pointer) growUint32Slice(addCap int) { + p.growInt32Slice(addCap) +} + +func (p pointer) growFloat32Slice(addCap int) { + p.growInt32Slice(addCap) +} + +func (p pointer) growInt64Slice(addCap int) { + sp := p.Int64Slice() + s := make([]int64, 0, addCap+len(*sp)) + s = s[:len(*sp)] + copy(s, *sp) + *sp = s +} + +func (p pointer) growUint64Slice(addCap int) { + p.growInt64Slice(addCap) +} + +func (p pointer) growFloat64Slice(addCap int) { + p.growInt64Slice(addCap) +} + // Static check that MessageState does not exceed the size of a pointer. const _ = uint(unsafe.Sizeof(unsafe.Pointer(nil)) - unsafe.Sizeof(MessageState{})) diff --git a/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go b/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go similarity index 96% rename from vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go rename to vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go index 61a84d34..a008acd0 100644 --- a/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe.go +++ b/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go120.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine -// +build !purego,!appengine +//go:build !purego && !appengine && !go1.21 +// +build !purego,!appengine,!go1.21 package strs diff --git a/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go b/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go new file mode 100644 index 00000000..60166f2b --- /dev/null +++ b/vendor/google.golang.org/protobuf/internal/strs/strings_unsafe_go121.go @@ -0,0 +1,74 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !purego && !appengine && go1.21 +// +build !purego,!appengine,go1.21 + +package strs + +import ( + "unsafe" + + "google.golang.org/protobuf/reflect/protoreflect" +) + +// UnsafeString returns an unsafe string reference of b. +// The caller must treat the input slice as immutable. +// +// WARNING: Use carefully. The returned result must not leak to the end user +// unless the input slice is provably immutable. +func UnsafeString(b []byte) string { + return unsafe.String(unsafe.SliceData(b), len(b)) +} + +// UnsafeBytes returns an unsafe bytes slice reference of s. +// The caller must treat returned slice as immutable. +// +// WARNING: Use carefully. The returned result must not leak to the end user. +func UnsafeBytes(s string) []byte { + return unsafe.Slice(unsafe.StringData(s), len(s)) +} + +// Builder builds a set of strings with shared lifetime. +// This differs from strings.Builder, which is for building a single string. +type Builder struct { + buf []byte +} + +// AppendFullName is equivalent to protoreflect.FullName.Append, +// but optimized for large batches where each name has a shared lifetime. +func (sb *Builder) AppendFullName(prefix protoreflect.FullName, name protoreflect.Name) protoreflect.FullName { + n := len(prefix) + len(".") + len(name) + if len(prefix) == 0 { + n -= len(".") + } + sb.grow(n) + sb.buf = append(sb.buf, prefix...) + sb.buf = append(sb.buf, '.') + sb.buf = append(sb.buf, name...) + return protoreflect.FullName(sb.last(n)) +} + +// MakeString is equivalent to string(b), but optimized for large batches +// with a shared lifetime. +func (sb *Builder) MakeString(b []byte) string { + sb.grow(len(b)) + sb.buf = append(sb.buf, b...) + return sb.last(len(b)) +} + +func (sb *Builder) grow(n int) { + if cap(sb.buf)-len(sb.buf) >= n { + return + } + + // Unlike strings.Builder, we do not need to copy over the contents + // of the old buffer since our builder provides no API for + // retrieving previously created strings. + sb.buf = make([]byte, 0, 2*(cap(sb.buf)+n)) +} + +func (sb *Builder) last(n int) string { + return UnsafeString(sb.buf[len(sb.buf)-n:]) +} diff --git a/vendor/google.golang.org/protobuf/internal/version/version.go b/vendor/google.golang.org/protobuf/internal/version/version.go index 0999f29d..d8f48faf 100644 --- a/vendor/google.golang.org/protobuf/internal/version/version.go +++ b/vendor/google.golang.org/protobuf/internal/version/version.go @@ -51,7 +51,7 @@ import ( // 10. Send out the CL for review and submit it. const ( Major = 1 - Minor = 31 + Minor = 32 Patch = 0 PreRelease = "" ) diff --git a/vendor/google.golang.org/protobuf/proto/decode.go b/vendor/google.golang.org/protobuf/proto/decode.go index 48d47946..e5b03b56 100644 --- a/vendor/google.golang.org/protobuf/proto/decode.go +++ b/vendor/google.golang.org/protobuf/proto/decode.go @@ -69,7 +69,7 @@ func (o UnmarshalOptions) Unmarshal(b []byte, m Message) error { // UnmarshalState parses a wire-format message and places the result in m. // // This method permits fine-grained control over the unmarshaler. -// Most users should use Unmarshal instead. +// Most users should use [Unmarshal] instead. func (o UnmarshalOptions) UnmarshalState(in protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { if o.RecursionLimit == 0 { o.RecursionLimit = protowire.DefaultRecursionLimit diff --git a/vendor/google.golang.org/protobuf/proto/doc.go b/vendor/google.golang.org/protobuf/proto/doc.go index ec71e717..80ed16a0 100644 --- a/vendor/google.golang.org/protobuf/proto/doc.go +++ b/vendor/google.golang.org/protobuf/proto/doc.go @@ -18,27 +18,27 @@ // This package contains functions to convert to and from the wire format, // an efficient binary serialization of protocol buffers. // -// • Size reports the size of a message in the wire format. +// - [Size] reports the size of a message in the wire format. // -// • Marshal converts a message to the wire format. -// The MarshalOptions type provides more control over wire marshaling. +// - [Marshal] converts a message to the wire format. +// The [MarshalOptions] type provides more control over wire marshaling. // -// • Unmarshal converts a message from the wire format. -// The UnmarshalOptions type provides more control over wire unmarshaling. +// - [Unmarshal] converts a message from the wire format. +// The [UnmarshalOptions] type provides more control over wire unmarshaling. // // # Basic message operations // -// • Clone makes a deep copy of a message. +// - [Clone] makes a deep copy of a message. // -// • Merge merges the content of a message into another. +// - [Merge] merges the content of a message into another. // -// • Equal compares two messages. For more control over comparisons -// and detailed reporting of differences, see package -// "google.golang.org/protobuf/testing/protocmp". +// - [Equal] compares two messages. For more control over comparisons +// and detailed reporting of differences, see package +// [google.golang.org/protobuf/testing/protocmp]. // -// • Reset clears the content of a message. +// - [Reset] clears the content of a message. // -// • CheckInitialized reports whether all required fields in a message are set. +// - [CheckInitialized] reports whether all required fields in a message are set. // // # Optional scalar constructors // @@ -46,9 +46,9 @@ // as pointers to a value. For example, an optional string field has the // Go type *string. // -// • Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, and String -// take a value and return a pointer to a new instance of it, -// to simplify construction of optional field values. +// - [Bool], [Int32], [Int64], [Uint32], [Uint64], [Float32], [Float64], and [String] +// take a value and return a pointer to a new instance of it, +// to simplify construction of optional field values. // // Generated enum types usually have an Enum method which performs the // same operation. @@ -57,29 +57,29 @@ // // # Extension accessors // -// • HasExtension, GetExtension, SetExtension, and ClearExtension -// access extension field values in a protocol buffer message. +// - [HasExtension], [GetExtension], [SetExtension], and [ClearExtension] +// access extension field values in a protocol buffer message. // // Extension fields are only supported in proto2. // // # Related packages // -// • Package "google.golang.org/protobuf/encoding/protojson" converts messages to -// and from JSON. +// - Package [google.golang.org/protobuf/encoding/protojson] converts messages to +// and from JSON. // -// • Package "google.golang.org/protobuf/encoding/prototext" converts messages to -// and from the text format. +// - Package [google.golang.org/protobuf/encoding/prototext] converts messages to +// and from the text format. // -// • Package "google.golang.org/protobuf/reflect/protoreflect" provides a -// reflection interface for protocol buffer data types. +// - Package [google.golang.org/protobuf/reflect/protoreflect] provides a +// reflection interface for protocol buffer data types. // -// • Package "google.golang.org/protobuf/testing/protocmp" provides features -// to compare protocol buffer messages with the "github.com/google/go-cmp/cmp" -// package. +// - Package [google.golang.org/protobuf/testing/protocmp] provides features +// to compare protocol buffer messages with the [github.com/google/go-cmp/cmp] +// package. // -// • Package "google.golang.org/protobuf/types/dynamicpb" provides a dynamic -// message type, suitable for working with messages where the protocol buffer -// type is only known at runtime. +// - Package [google.golang.org/protobuf/types/dynamicpb] provides a dynamic +// message type, suitable for working with messages where the protocol buffer +// type is only known at runtime. // // This module contains additional packages for more specialized use cases. // Consult the individual package documentation for details. diff --git a/vendor/google.golang.org/protobuf/proto/encode.go b/vendor/google.golang.org/protobuf/proto/encode.go index bf7f816d..4fed202f 100644 --- a/vendor/google.golang.org/protobuf/proto/encode.go +++ b/vendor/google.golang.org/protobuf/proto/encode.go @@ -129,7 +129,7 @@ func (o MarshalOptions) MarshalAppend(b []byte, m Message) ([]byte, error) { // MarshalState returns the wire-format encoding of a message. // // This method permits fine-grained control over the marshaler. -// Most users should use Marshal instead. +// Most users should use [Marshal] instead. func (o MarshalOptions) MarshalState(in protoiface.MarshalInput) (protoiface.MarshalOutput, error) { return o.marshal(in.Buf, in.Message) } diff --git a/vendor/google.golang.org/protobuf/proto/extension.go b/vendor/google.golang.org/protobuf/proto/extension.go index 5f293cda..17899a3a 100644 --- a/vendor/google.golang.org/protobuf/proto/extension.go +++ b/vendor/google.golang.org/protobuf/proto/extension.go @@ -26,7 +26,7 @@ func HasExtension(m Message, xt protoreflect.ExtensionType) bool { } // ClearExtension clears an extension field such that subsequent -// HasExtension calls return false. +// [HasExtension] calls return false. // It panics if m is invalid or if xt does not extend m. func ClearExtension(m Message, xt protoreflect.ExtensionType) { m.ProtoReflect().Clear(xt.TypeDescriptor()) diff --git a/vendor/google.golang.org/protobuf/proto/merge.go b/vendor/google.golang.org/protobuf/proto/merge.go index d761ab33..3c6fe578 100644 --- a/vendor/google.golang.org/protobuf/proto/merge.go +++ b/vendor/google.golang.org/protobuf/proto/merge.go @@ -21,7 +21,7 @@ import ( // The unknown fields of src are appended to the unknown fields of dst. // // It is semantically equivalent to unmarshaling the encoded form of src -// into dst with the UnmarshalOptions.Merge option specified. +// into dst with the [UnmarshalOptions.Merge] option specified. func Merge(dst, src Message) { // TODO: Should nil src be treated as semantically equivalent to a // untyped, read-only, empty message? What about a nil dst? diff --git a/vendor/google.golang.org/protobuf/proto/proto.go b/vendor/google.golang.org/protobuf/proto/proto.go index 1f0d183b..7543ee6b 100644 --- a/vendor/google.golang.org/protobuf/proto/proto.go +++ b/vendor/google.golang.org/protobuf/proto/proto.go @@ -15,18 +15,20 @@ import ( // protobuf module that accept a Message, except where otherwise specified. // // This is the v2 interface definition for protobuf messages. -// The v1 interface definition is "github.com/golang/protobuf/proto".Message. +// The v1 interface definition is [github.com/golang/protobuf/proto.Message]. // -// To convert a v1 message to a v2 message, -// use "github.com/golang/protobuf/proto".MessageV2. -// To convert a v2 message to a v1 message, -// use "github.com/golang/protobuf/proto".MessageV1. +// - To convert a v1 message to a v2 message, +// use [google.golang.org/protobuf/protoadapt.MessageV2Of]. +// - To convert a v2 message to a v1 message, +// use [google.golang.org/protobuf/protoadapt.MessageV1Of]. type Message = protoreflect.ProtoMessage -// Error matches all errors produced by packages in the protobuf module. +// Error matches all errors produced by packages in the protobuf module +// according to [errors.Is]. // -// That is, errors.Is(err, Error) reports whether an error is produced -// by this module. +// Example usage: +// +// if errors.Is(err, proto.Error) { ... } var Error error func init() { diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go index e4dfb120..baa0cc62 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc.go @@ -3,11 +3,11 @@ // license that can be found in the LICENSE file. // Package protodesc provides functionality for converting -// FileDescriptorProto messages to/from protoreflect.FileDescriptor values. +// FileDescriptorProto messages to/from [protoreflect.FileDescriptor] values. // // The google.protobuf.FileDescriptorProto is a protobuf message that describes // the type information for a .proto file in a form that is easily serializable. -// The protoreflect.FileDescriptor is a more structured representation of +// The [protoreflect.FileDescriptor] is a more structured representation of // the FileDescriptorProto message where references and remote dependencies // can be directly followed. package protodesc @@ -24,11 +24,11 @@ import ( "google.golang.org/protobuf/types/descriptorpb" ) -// Resolver is the resolver used by NewFile to resolve dependencies. +// Resolver is the resolver used by [NewFile] to resolve dependencies. // The enums and messages provided must belong to some parent file, // which is also registered. // -// It is implemented by protoregistry.Files. +// It is implemented by [protoregistry.Files]. type Resolver interface { FindFileByPath(string) (protoreflect.FileDescriptor, error) FindDescriptorByName(protoreflect.FullName) (protoreflect.Descriptor, error) @@ -61,19 +61,19 @@ type FileOptions struct { AllowUnresolvable bool } -// NewFile creates a new protoreflect.FileDescriptor from the provided -// file descriptor message. See FileOptions.New for more information. +// NewFile creates a new [protoreflect.FileDescriptor] from the provided +// file descriptor message. See [FileOptions.New] for more information. func NewFile(fd *descriptorpb.FileDescriptorProto, r Resolver) (protoreflect.FileDescriptor, error) { return FileOptions{}.New(fd, r) } -// NewFiles creates a new protoregistry.Files from the provided -// FileDescriptorSet message. See FileOptions.NewFiles for more information. +// NewFiles creates a new [protoregistry.Files] from the provided +// FileDescriptorSet message. See [FileOptions.NewFiles] for more information. func NewFiles(fd *descriptorpb.FileDescriptorSet) (*protoregistry.Files, error) { return FileOptions{}.NewFiles(fd) } -// New creates a new protoreflect.FileDescriptor from the provided +// New creates a new [protoreflect.FileDescriptor] from the provided // file descriptor message. The file must represent a valid proto file according // to protobuf semantics. The returned descriptor is a deep copy of the input. // @@ -93,9 +93,15 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot f.L1.Syntax = protoreflect.Proto2 case "proto3": f.L1.Syntax = protoreflect.Proto3 + case "editions": + f.L1.Syntax = protoreflect.Editions + f.L1.Edition = fromEditionProto(fd.GetEdition()) default: return nil, errors.New("invalid syntax: %q", fd.GetSyntax()) } + if f.L1.Syntax == protoreflect.Editions && (fd.GetEdition() < SupportedEditionsMinimum || fd.GetEdition() > SupportedEditionsMaximum) { + return nil, errors.New("use of edition %v not yet supported by the Go Protobuf runtime", fd.GetEdition()) + } f.L1.Path = fd.GetName() if f.L1.Path == "" { return nil, errors.New("file path must be populated") @@ -108,6 +114,9 @@ func (o FileOptions) New(fd *descriptorpb.FileDescriptorProto, r Resolver) (prot opts = proto.Clone(opts).(*descriptorpb.FileOptions) f.L2.Options = func() protoreflect.ProtoMessage { return opts } } + if f.L1.Syntax == protoreflect.Editions { + initFileDescFromFeatureSet(f, fd.GetOptions().GetFeatures()) + } f.L2.Imports = make(filedesc.FileImports, len(fd.GetDependency())) for _, i := range fd.GetPublicDependency() { @@ -231,7 +240,7 @@ func (is importSet) importPublic(imps protoreflect.FileImports) { } } -// NewFiles creates a new protoregistry.Files from the provided +// NewFiles creates a new [protoregistry.Files] from the provided // FileDescriptorSet message. The descriptor set must include only // valid files according to protobuf semantics. The returned descriptors // are a deep copy of the input. diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go index 37efda1a..aff6fd49 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/desc_init.go @@ -137,6 +137,30 @@ func (r descsByName) initFieldsFromDescriptorProto(fds []*descriptorpb.FieldDesc if fd.JsonName != nil { f.L1.StringName.InitJSON(fd.GetJsonName()) } + + if f.Base.L0.ParentFile.Syntax() == protoreflect.Editions { + f.L1.Presence = resolveFeatureHasFieldPresence(f.Base.L0.ParentFile, fd) + // We reuse the existing field because the old option `[packed = + // true]` is mutually exclusive with the editions feature. + if fd.GetLabel() == descriptorpb.FieldDescriptorProto_LABEL_REPEATED { + f.L1.HasPacked = true + f.L1.IsPacked = resolveFeatureRepeatedFieldEncodingPacked(f.Base.L0.ParentFile, fd) + } + + // We pretend this option is always explicitly set because the only + // use of HasEnforceUTF8 is to determine whether to use EnforceUTF8 + // or to return the appropriate default. + // When using editions we either parse the option or resolve the + // appropriate default here (instead of later when this option is + // requested from the descriptor). + // In proto2/proto3 syntax HasEnforceUTF8 might be false. + f.L1.HasEnforceUTF8 = true + f.L1.EnforceUTF8 = resolveFeatureEnforceUTF8(f.Base.L0.ParentFile, fd) + + if f.L1.Kind == protoreflect.MessageKind && resolveFeatureDelimitedEncoding(f.Base.L0.ParentFile, fd) { + f.L1.Kind = protoreflect.GroupKind + } + } } return fs, nil } diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go new file mode 100644 index 00000000..7352926c --- /dev/null +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/editions.go @@ -0,0 +1,177 @@ +// Copyright 2019 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package protodesc + +import ( + _ "embed" + "fmt" + "os" + "sync" + + "google.golang.org/protobuf/internal/filedesc" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/descriptorpb" +) + +const ( + SupportedEditionsMinimum = descriptorpb.Edition_EDITION_PROTO2 + SupportedEditionsMaximum = descriptorpb.Edition_EDITION_2023 +) + +//go:embed editions_defaults.binpb +var binaryEditionDefaults []byte +var defaults = &descriptorpb.FeatureSetDefaults{} +var defaultsCacheMu sync.Mutex +var defaultsCache = make(map[filedesc.Edition]*descriptorpb.FeatureSet) + +func init() { + err := proto.Unmarshal(binaryEditionDefaults, defaults) + if err != nil { + fmt.Fprintf(os.Stderr, "unmarshal editions defaults: %v\n", err) + os.Exit(1) + } +} + +func fromEditionProto(epb descriptorpb.Edition) filedesc.Edition { + return filedesc.Edition(epb) +} + +func toEditionProto(ed filedesc.Edition) descriptorpb.Edition { + switch ed { + case filedesc.EditionUnknown: + return descriptorpb.Edition_EDITION_UNKNOWN + case filedesc.EditionProto2: + return descriptorpb.Edition_EDITION_PROTO2 + case filedesc.EditionProto3: + return descriptorpb.Edition_EDITION_PROTO3 + case filedesc.Edition2023: + return descriptorpb.Edition_EDITION_2023 + default: + panic(fmt.Sprintf("unknown value for edition: %v", ed)) + } +} + +func getFeatureSetFor(ed filedesc.Edition) *descriptorpb.FeatureSet { + defaultsCacheMu.Lock() + defer defaultsCacheMu.Unlock() + if def, ok := defaultsCache[ed]; ok { + return def + } + edpb := toEditionProto(ed) + if defaults.GetMinimumEdition() > edpb || defaults.GetMaximumEdition() < edpb { + // This should never happen protodesc.(FileOptions).New would fail when + // initializing the file descriptor. + // This most likely means the embedded defaults were not updated. + fmt.Fprintf(os.Stderr, "internal error: unsupported edition %v (did you forget to update the embedded defaults (i.e. the bootstrap descriptor proto)?)\n", edpb) + os.Exit(1) + } + fs := defaults.GetDefaults()[0].GetFeatures() + // Using a linear search for now. + // Editions are guaranteed to be sorted and thus we could use a binary search. + // Given that there are only a handful of editions (with one more per year) + // there is not much reason to use a binary search. + for _, def := range defaults.GetDefaults() { + if def.GetEdition() <= edpb { + fs = def.GetFeatures() + } else { + break + } + } + defaultsCache[ed] = fs + return fs +} + +func resolveFeatureHasFieldPresence(fileDesc *filedesc.File, fieldDesc *descriptorpb.FieldDescriptorProto) bool { + fs := fieldDesc.GetOptions().GetFeatures() + if fs == nil || fs.FieldPresence == nil { + return fileDesc.L1.EditionFeatures.IsFieldPresence + } + return fs.GetFieldPresence() == descriptorpb.FeatureSet_LEGACY_REQUIRED || + fs.GetFieldPresence() == descriptorpb.FeatureSet_EXPLICIT +} + +func resolveFeatureRepeatedFieldEncodingPacked(fileDesc *filedesc.File, fieldDesc *descriptorpb.FieldDescriptorProto) bool { + fs := fieldDesc.GetOptions().GetFeatures() + if fs == nil || fs.RepeatedFieldEncoding == nil { + return fileDesc.L1.EditionFeatures.IsPacked + } + return fs.GetRepeatedFieldEncoding() == descriptorpb.FeatureSet_PACKED +} + +func resolveFeatureEnforceUTF8(fileDesc *filedesc.File, fieldDesc *descriptorpb.FieldDescriptorProto) bool { + fs := fieldDesc.GetOptions().GetFeatures() + if fs == nil || fs.Utf8Validation == nil { + return fileDesc.L1.EditionFeatures.IsUTF8Validated + } + return fs.GetUtf8Validation() == descriptorpb.FeatureSet_VERIFY +} + +func resolveFeatureDelimitedEncoding(fileDesc *filedesc.File, fieldDesc *descriptorpb.FieldDescriptorProto) bool { + fs := fieldDesc.GetOptions().GetFeatures() + if fs == nil || fs.MessageEncoding == nil { + return fileDesc.L1.EditionFeatures.IsDelimitedEncoded + } + return fs.GetMessageEncoding() == descriptorpb.FeatureSet_DELIMITED +} + +// initFileDescFromFeatureSet initializes editions related fields in fd based +// on fs. If fs is nil it is assumed to be an empty featureset and all fields +// will be initialized with the appropriate default. fd.L1.Edition must be set +// before calling this function. +func initFileDescFromFeatureSet(fd *filedesc.File, fs *descriptorpb.FeatureSet) { + dfs := getFeatureSetFor(fd.L1.Edition) + if fs == nil { + fs = &descriptorpb.FeatureSet{} + } + + var fieldPresence descriptorpb.FeatureSet_FieldPresence + if fp := fs.FieldPresence; fp != nil { + fieldPresence = *fp + } else { + fieldPresence = *dfs.FieldPresence + } + fd.L1.EditionFeatures.IsFieldPresence = fieldPresence == descriptorpb.FeatureSet_LEGACY_REQUIRED || + fieldPresence == descriptorpb.FeatureSet_EXPLICIT + + var enumType descriptorpb.FeatureSet_EnumType + if et := fs.EnumType; et != nil { + enumType = *et + } else { + enumType = *dfs.EnumType + } + fd.L1.EditionFeatures.IsOpenEnum = enumType == descriptorpb.FeatureSet_OPEN + + var respeatedFieldEncoding descriptorpb.FeatureSet_RepeatedFieldEncoding + if rfe := fs.RepeatedFieldEncoding; rfe != nil { + respeatedFieldEncoding = *rfe + } else { + respeatedFieldEncoding = *dfs.RepeatedFieldEncoding + } + fd.L1.EditionFeatures.IsPacked = respeatedFieldEncoding == descriptorpb.FeatureSet_PACKED + + var isUTF8Validated descriptorpb.FeatureSet_Utf8Validation + if utf8val := fs.Utf8Validation; utf8val != nil { + isUTF8Validated = *utf8val + } else { + isUTF8Validated = *dfs.Utf8Validation + } + fd.L1.EditionFeatures.IsUTF8Validated = isUTF8Validated == descriptorpb.FeatureSet_VERIFY + + var messageEncoding descriptorpb.FeatureSet_MessageEncoding + if me := fs.MessageEncoding; me != nil { + messageEncoding = *me + } else { + messageEncoding = *dfs.MessageEncoding + } + fd.L1.EditionFeatures.IsDelimitedEncoded = messageEncoding == descriptorpb.FeatureSet_DELIMITED + + var jsonFormat descriptorpb.FeatureSet_JsonFormat + if jf := fs.JsonFormat; jf != nil { + jsonFormat = *jf + } else { + jsonFormat = *dfs.JsonFormat + } + fd.L1.EditionFeatures.IsJSONCompliant = jsonFormat == descriptorpb.FeatureSet_ALLOW +} diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/editions_defaults.binpb b/vendor/google.golang.org/protobuf/reflect/protodesc/editions_defaults.binpb new file mode 100644 index 00000000..1a8610a8 --- /dev/null +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/editions_defaults.binpb @@ -0,0 +1,4 @@ + +  (0 +  (0 +  (0 ( \ No newline at end of file diff --git a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go index a7c5ceff..9d6e0542 100644 --- a/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go +++ b/vendor/google.golang.org/protobuf/reflect/protodesc/proto.go @@ -16,7 +16,7 @@ import ( "google.golang.org/protobuf/types/descriptorpb" ) -// ToFileDescriptorProto copies a protoreflect.FileDescriptor into a +// ToFileDescriptorProto copies a [protoreflect.FileDescriptor] into a // google.protobuf.FileDescriptorProto message. func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileDescriptorProto { p := &descriptorpb.FileDescriptorProto{ @@ -70,13 +70,13 @@ func ToFileDescriptorProto(file protoreflect.FileDescriptor) *descriptorpb.FileD for i, exts := 0, file.Extensions(); i < exts.Len(); i++ { p.Extension = append(p.Extension, ToFieldDescriptorProto(exts.Get(i))) } - if syntax := file.Syntax(); syntax != protoreflect.Proto2 { + if syntax := file.Syntax(); syntax != protoreflect.Proto2 && syntax.IsValid() { p.Syntax = proto.String(file.Syntax().String()) } return p } -// ToDescriptorProto copies a protoreflect.MessageDescriptor into a +// ToDescriptorProto copies a [protoreflect.MessageDescriptor] into a // google.protobuf.DescriptorProto message. func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.DescriptorProto { p := &descriptorpb.DescriptorProto{ @@ -119,7 +119,7 @@ func ToDescriptorProto(message protoreflect.MessageDescriptor) *descriptorpb.Des return p } -// ToFieldDescriptorProto copies a protoreflect.FieldDescriptor into a +// ToFieldDescriptorProto copies a [protoreflect.FieldDescriptor] into a // google.protobuf.FieldDescriptorProto message. func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.FieldDescriptorProto { p := &descriptorpb.FieldDescriptorProto{ @@ -168,7 +168,7 @@ func ToFieldDescriptorProto(field protoreflect.FieldDescriptor) *descriptorpb.Fi return p } -// ToOneofDescriptorProto copies a protoreflect.OneofDescriptor into a +// ToOneofDescriptorProto copies a [protoreflect.OneofDescriptor] into a // google.protobuf.OneofDescriptorProto message. func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.OneofDescriptorProto { return &descriptorpb.OneofDescriptorProto{ @@ -177,7 +177,7 @@ func ToOneofDescriptorProto(oneof protoreflect.OneofDescriptor) *descriptorpb.On } } -// ToEnumDescriptorProto copies a protoreflect.EnumDescriptor into a +// ToEnumDescriptorProto copies a [protoreflect.EnumDescriptor] into a // google.protobuf.EnumDescriptorProto message. func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumDescriptorProto { p := &descriptorpb.EnumDescriptorProto{ @@ -200,7 +200,7 @@ func ToEnumDescriptorProto(enum protoreflect.EnumDescriptor) *descriptorpb.EnumD return p } -// ToEnumValueDescriptorProto copies a protoreflect.EnumValueDescriptor into a +// ToEnumValueDescriptorProto copies a [protoreflect.EnumValueDescriptor] into a // google.protobuf.EnumValueDescriptorProto message. func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descriptorpb.EnumValueDescriptorProto { return &descriptorpb.EnumValueDescriptorProto{ @@ -210,7 +210,7 @@ func ToEnumValueDescriptorProto(value protoreflect.EnumValueDescriptor) *descrip } } -// ToServiceDescriptorProto copies a protoreflect.ServiceDescriptor into a +// ToServiceDescriptorProto copies a [protoreflect.ServiceDescriptor] into a // google.protobuf.ServiceDescriptorProto message. func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descriptorpb.ServiceDescriptorProto { p := &descriptorpb.ServiceDescriptorProto{ @@ -223,7 +223,7 @@ func ToServiceDescriptorProto(service protoreflect.ServiceDescriptor) *descripto return p } -// ToMethodDescriptorProto copies a protoreflect.MethodDescriptor into a +// ToMethodDescriptorProto copies a [protoreflect.MethodDescriptor] into a // google.protobuf.MethodDescriptorProto message. func ToMethodDescriptorProto(method protoreflect.MethodDescriptor) *descriptorpb.MethodDescriptorProto { p := &descriptorpb.MethodDescriptorProto{ diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go index 55aa1492..ec6572df 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/proto.go @@ -10,46 +10,46 @@ // // # Protocol Buffer Descriptors // -// Protobuf descriptors (e.g., EnumDescriptor or MessageDescriptor) +// Protobuf descriptors (e.g., [EnumDescriptor] or [MessageDescriptor]) // are immutable objects that represent protobuf type information. // They are wrappers around the messages declared in descriptor.proto. // Protobuf descriptors alone lack any information regarding Go types. // -// Enums and messages generated by this module implement Enum and ProtoMessage, +// Enums and messages generated by this module implement [Enum] and [ProtoMessage], // where the Descriptor and ProtoReflect.Descriptor accessors respectively // return the protobuf descriptor for the values. // // The protobuf descriptor interfaces are not meant to be implemented by // user code since they might need to be extended in the future to support // additions to the protobuf language. -// The "google.golang.org/protobuf/reflect/protodesc" package converts between +// The [google.golang.org/protobuf/reflect/protodesc] package converts between // google.protobuf.DescriptorProto messages and protobuf descriptors. // // # Go Type Descriptors // -// A type descriptor (e.g., EnumType or MessageType) is a constructor for +// A type descriptor (e.g., [EnumType] or [MessageType]) is a constructor for // a concrete Go type that represents the associated protobuf descriptor. // There is commonly a one-to-one relationship between protobuf descriptors and // Go type descriptors, but it can potentially be a one-to-many relationship. // -// Enums and messages generated by this module implement Enum and ProtoMessage, +// Enums and messages generated by this module implement [Enum] and [ProtoMessage], // where the Type and ProtoReflect.Type accessors respectively // return the protobuf descriptor for the values. // -// The "google.golang.org/protobuf/types/dynamicpb" package can be used to +// The [google.golang.org/protobuf/types/dynamicpb] package can be used to // create Go type descriptors from protobuf descriptors. // // # Value Interfaces // -// The Enum and Message interfaces provide a reflective view over an +// The [Enum] and [Message] interfaces provide a reflective view over an // enum or message instance. For enums, it provides the ability to retrieve // the enum value number for any concrete enum type. For messages, it provides // the ability to access or manipulate fields of the message. // -// To convert a proto.Message to a protoreflect.Message, use the +// To convert a [google.golang.org/protobuf/proto.Message] to a [protoreflect.Message], use the // former's ProtoReflect method. Since the ProtoReflect method is new to the // v2 message interface, it may not be present on older message implementations. -// The "github.com/golang/protobuf/proto".MessageReflect function can be used +// The [github.com/golang/protobuf/proto.MessageReflect] function can be used // to obtain a reflective view on older messages. // // # Relationships @@ -71,12 +71,12 @@ // │ │ // └────────────────── Type() ───────┘ // -// • An EnumType describes a concrete Go enum type. +// • An [EnumType] describes a concrete Go enum type. // It has an EnumDescriptor and can construct an Enum instance. // -// • An EnumDescriptor describes an abstract protobuf enum type. +// • An [EnumDescriptor] describes an abstract protobuf enum type. // -// • An Enum is a concrete enum instance. Generated enums implement Enum. +// • An [Enum] is a concrete enum instance. Generated enums implement Enum. // // ┌──────────────── New() ─────────────────┐ // │ │ @@ -90,24 +90,26 @@ // │ │ // └─────────────────── Type() ─────────┘ // -// • A MessageType describes a concrete Go message type. -// It has a MessageDescriptor and can construct a Message instance. -// Just as how Go's reflect.Type is a reflective description of a Go type, -// a MessageType is a reflective description of a Go type for a protobuf message. +// • A [MessageType] describes a concrete Go message type. +// It has a [MessageDescriptor] and can construct a [Message] instance. +// Just as how Go's [reflect.Type] is a reflective description of a Go type, +// a [MessageType] is a reflective description of a Go type for a protobuf message. // -// • A MessageDescriptor describes an abstract protobuf message type. -// It has no understanding of Go types. In order to construct a MessageType -// from just a MessageDescriptor, you can consider looking up the message type -// in the global registry using protoregistry.GlobalTypes.FindMessageByName -// or constructing a dynamic MessageType using dynamicpb.NewMessageType. +// • A [MessageDescriptor] describes an abstract protobuf message type. +// It has no understanding of Go types. In order to construct a [MessageType] +// from just a [MessageDescriptor], you can consider looking up the message type +// in the global registry using the FindMessageByName method on +// [google.golang.org/protobuf/reflect/protoregistry.GlobalTypes] +// or constructing a dynamic [MessageType] using +// [google.golang.org/protobuf/types/dynamicpb.NewMessageType]. // -// • A Message is a reflective view over a concrete message instance. -// Generated messages implement ProtoMessage, which can convert to a Message. -// Just as how Go's reflect.Value is a reflective view over a Go value, -// a Message is a reflective view over a concrete protobuf message instance. -// Using Go reflection as an analogy, the ProtoReflect method is similar to -// calling reflect.ValueOf, and the Message.Interface method is similar to -// calling reflect.Value.Interface. +// • A [Message] is a reflective view over a concrete message instance. +// Generated messages implement [ProtoMessage], which can convert to a [Message]. +// Just as how Go's [reflect.Value] is a reflective view over a Go value, +// a [Message] is a reflective view over a concrete protobuf message instance. +// Using Go reflection as an analogy, the [ProtoMessage.ProtoReflect] method is similar to +// calling [reflect.ValueOf], and the [Message.Interface] method is similar to +// calling [reflect.Value.Interface]. // // ┌── TypeDescriptor() ──┐ ┌───── Descriptor() ─────┐ // │ V │ V @@ -119,15 +121,15 @@ // │ │ // └────── implements ────────┘ // -// • An ExtensionType describes a concrete Go implementation of an extension. -// It has an ExtensionTypeDescriptor and can convert to/from -// abstract Values and Go values. +// • An [ExtensionType] describes a concrete Go implementation of an extension. +// It has an [ExtensionTypeDescriptor] and can convert to/from +// an abstract [Value] and a Go value. // -// • An ExtensionTypeDescriptor is an ExtensionDescriptor -// which also has an ExtensionType. +// • An [ExtensionTypeDescriptor] is an [ExtensionDescriptor] +// which also has an [ExtensionType]. // -// • An ExtensionDescriptor describes an abstract protobuf extension field and -// may not always be an ExtensionTypeDescriptor. +// • An [ExtensionDescriptor] describes an abstract protobuf extension field and +// may not always be an [ExtensionTypeDescriptor]. package protoreflect import ( @@ -142,7 +144,7 @@ type doNotImplement pragma.DoNotImplement // ProtoMessage is the top-level interface that all proto messages implement. // This is declared in the protoreflect package to avoid a cyclic dependency; -// use the proto.Message type instead, which aliases this type. +// use the [google.golang.org/protobuf/proto.Message] type instead, which aliases this type. type ProtoMessage interface{ ProtoReflect() Message } // Syntax is the language version of the proto file. @@ -151,8 +153,9 @@ type Syntax syntax type syntax int8 // keep exact type opaque as the int type may change const ( - Proto2 Syntax = 2 - Proto3 Syntax = 3 + Proto2 Syntax = 2 + Proto3 Syntax = 3 + Editions Syntax = 4 ) // IsValid reports whether the syntax is valid. @@ -436,7 +439,7 @@ type Names interface { // FullName is a qualified name that uniquely identifies a proto declaration. // A qualified name is the concatenation of the proto package along with the // fully-declared name (i.e., name of parent preceding the name of the child), -// with a '.' delimiter placed between each Name. +// with a '.' delimiter placed between each [Name]. // // This should not have any leading or trailing dots. type FullName string // e.g., "google.protobuf.Field.Kind" @@ -480,7 +483,7 @@ func isLetterDigit(c byte) bool { } // Name returns the short name, which is the last identifier segment. -// A single segment FullName is the Name itself. +// A single segment FullName is the [Name] itself. func (n FullName) Name() Name { if i := strings.LastIndexByte(string(n), '.'); i >= 0 { return Name(n[i+1:]) diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go index 717b106f..0c045db6 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go @@ -35,7 +35,7 @@ func (p *SourcePath) appendFileDescriptorProto(b []byte) []byte { b = p.appendSingularField(b, "source_code_info", (*SourcePath).appendSourceCodeInfo) case 12: b = p.appendSingularField(b, "syntax", nil) - case 13: + case 14: b = p.appendSingularField(b, "edition", nil) } return b @@ -180,6 +180,8 @@ func (p *SourcePath) appendFileOptions(b []byte) []byte { b = p.appendSingularField(b, "php_metadata_namespace", nil) case 45: b = p.appendSingularField(b, "ruby_package", nil) + case 50: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -240,6 +242,8 @@ func (p *SourcePath) appendMessageOptions(b []byte) []byte { b = p.appendSingularField(b, "map_entry", nil) case 11: b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil) + case 12: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -285,6 +289,8 @@ func (p *SourcePath) appendEnumOptions(b []byte) []byte { b = p.appendSingularField(b, "deprecated", nil) case 6: b = p.appendSingularField(b, "deprecated_legacy_json_field_conflicts", nil) + case 7: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -330,6 +336,8 @@ func (p *SourcePath) appendServiceOptions(b []byte) []byte { return b } switch (*p)[0] { + case 34: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 33: b = p.appendSingularField(b, "deprecated", nil) case 999: @@ -361,16 +369,39 @@ func (p *SourcePath) appendFieldOptions(b []byte) []byte { b = p.appendSingularField(b, "debug_redact", nil) case 17: b = p.appendSingularField(b, "retention", nil) - case 18: - b = p.appendSingularField(b, "target", nil) case 19: b = p.appendRepeatedField(b, "targets", nil) + case 20: + b = p.appendRepeatedField(b, "edition_defaults", (*SourcePath).appendFieldOptions_EditionDefault) + case 21: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } +func (p *SourcePath) appendFeatureSet(b []byte) []byte { + if len(*p) == 0 { + return b + } + switch (*p)[0] { + case 1: + b = p.appendSingularField(b, "field_presence", nil) + case 2: + b = p.appendSingularField(b, "enum_type", nil) + case 3: + b = p.appendSingularField(b, "repeated_field_encoding", nil) + case 4: + b = p.appendSingularField(b, "utf8_validation", nil) + case 5: + b = p.appendSingularField(b, "message_encoding", nil) + case 6: + b = p.appendSingularField(b, "json_format", nil) + } + return b +} + func (p *SourcePath) appendUninterpretedOption(b []byte) []byte { if len(*p) == 0 { return b @@ -422,6 +453,8 @@ func (p *SourcePath) appendExtensionRangeOptions(b []byte) []byte { b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) case 2: b = p.appendRepeatedField(b, "declaration", (*SourcePath).appendExtensionRangeOptions_Declaration) + case 50: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 3: b = p.appendSingularField(b, "verification", nil) } @@ -433,6 +466,8 @@ func (p *SourcePath) appendOneofOptions(b []byte) []byte { return b } switch (*p)[0] { + case 1: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -446,6 +481,10 @@ func (p *SourcePath) appendEnumValueOptions(b []byte) []byte { switch (*p)[0] { case 1: b = p.appendSingularField(b, "deprecated", nil) + case 2: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) + case 3: + b = p.appendSingularField(b, "debug_redact", nil) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } @@ -461,12 +500,27 @@ func (p *SourcePath) appendMethodOptions(b []byte) []byte { b = p.appendSingularField(b, "deprecated", nil) case 34: b = p.appendSingularField(b, "idempotency_level", nil) + case 35: + b = p.appendSingularField(b, "features", (*SourcePath).appendFeatureSet) case 999: b = p.appendRepeatedField(b, "uninterpreted_option", (*SourcePath).appendUninterpretedOption) } return b } +func (p *SourcePath) appendFieldOptions_EditionDefault(b []byte) []byte { + if len(*p) == 0 { + return b + } + switch (*p)[0] { + case 3: + b = p.appendSingularField(b, "edition", nil) + case 2: + b = p.appendSingularField(b, "value", nil) + } + return b +} + func (p *SourcePath) appendUninterpretedOption_NamePart(b []byte) []byte { if len(*p) == 0 { return b @@ -491,8 +545,6 @@ func (p *SourcePath) appendExtensionRangeOptions_Declaration(b []byte) []byte { b = p.appendSingularField(b, "full_name", nil) case 3: b = p.appendSingularField(b, "type", nil) - case 4: - b = p.appendSingularField(b, "is_repeated", nil) case 5: b = p.appendSingularField(b, "reserved", nil) case 6: diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go index 3867470d..60ff62b4 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/type.go @@ -12,7 +12,7 @@ package protoreflect // exactly identical. However, it is possible for the same semantically // identical proto type to be represented by multiple type descriptors. // -// For example, suppose we have t1 and t2 which are both MessageDescriptors. +// For example, suppose we have t1 and t2 which are both an [MessageDescriptor]. // If t1 == t2, then the types are definitely equal and all accessors return // the same information. However, if t1 != t2, then it is still possible that // they still represent the same proto type (e.g., t1.FullName == t2.FullName). @@ -115,7 +115,7 @@ type Descriptor interface { // corresponds with the google.protobuf.FileDescriptorProto message. // // Top-level declarations: -// EnumDescriptor, MessageDescriptor, FieldDescriptor, and/or ServiceDescriptor. +// [EnumDescriptor], [MessageDescriptor], [FieldDescriptor], and/or [ServiceDescriptor]. type FileDescriptor interface { Descriptor // Descriptor.FullName is identical to Package @@ -180,8 +180,8 @@ type FileImport struct { // corresponds with the google.protobuf.DescriptorProto message. // // Nested declarations: -// FieldDescriptor, OneofDescriptor, FieldDescriptor, EnumDescriptor, -// and/or MessageDescriptor. +// [FieldDescriptor], [OneofDescriptor], [FieldDescriptor], [EnumDescriptor], +// and/or [MessageDescriptor]. type MessageDescriptor interface { Descriptor @@ -214,7 +214,7 @@ type MessageDescriptor interface { ExtensionRanges() FieldRanges // ExtensionRangeOptions returns the ith extension range options. // - // To avoid a dependency cycle, this method returns a proto.Message value, + // To avoid a dependency cycle, this method returns a proto.Message] value, // which always contains a google.protobuf.ExtensionRangeOptions message. // This method returns a typed nil-pointer if no options are present. // The caller must import the descriptorpb package to use this. @@ -231,9 +231,9 @@ type MessageDescriptor interface { } type isMessageDescriptor interface{ ProtoType(MessageDescriptor) } -// MessageType encapsulates a MessageDescriptor with a concrete Go implementation. +// MessageType encapsulates a [MessageDescriptor] with a concrete Go implementation. // It is recommended that implementations of this interface also implement the -// MessageFieldTypes interface. +// [MessageFieldTypes] interface. type MessageType interface { // New returns a newly allocated empty message. // It may return nil for synthetic messages representing a map entry. @@ -249,19 +249,19 @@ type MessageType interface { Descriptor() MessageDescriptor } -// MessageFieldTypes extends a MessageType by providing type information +// MessageFieldTypes extends a [MessageType] by providing type information // regarding enums and messages referenced by the message fields. type MessageFieldTypes interface { MessageType - // Enum returns the EnumType for the ith field in Descriptor.Fields. + // Enum returns the EnumType for the ith field in MessageDescriptor.Fields. // It returns nil if the ith field is not an enum kind. // It panics if out of bounds. // // Invariant: mt.Enum(i).Descriptor() == mt.Descriptor().Fields(i).Enum() Enum(i int) EnumType - // Message returns the MessageType for the ith field in Descriptor.Fields. + // Message returns the MessageType for the ith field in MessageDescriptor.Fields. // It returns nil if the ith field is not a message or group kind. // It panics if out of bounds. // @@ -286,8 +286,8 @@ type MessageDescriptors interface { // corresponds with the google.protobuf.FieldDescriptorProto message. // // It is used for both normal fields defined within the parent message -// (e.g., MessageDescriptor.Fields) and fields that extend some remote message -// (e.g., FileDescriptor.Extensions or MessageDescriptor.Extensions). +// (e.g., [MessageDescriptor.Fields]) and fields that extend some remote message +// (e.g., [FileDescriptor.Extensions] or [MessageDescriptor.Extensions]). type FieldDescriptor interface { Descriptor @@ -344,7 +344,7 @@ type FieldDescriptor interface { // IsMap reports whether this field represents a map, // where the value type for the associated field is a Map. // It is equivalent to checking whether Cardinality is Repeated, - // that the Kind is MessageKind, and that Message.IsMapEntry reports true. + // that the Kind is MessageKind, and that MessageDescriptor.IsMapEntry reports true. IsMap() bool // MapKey returns the field descriptor for the key in the map entry. @@ -419,7 +419,7 @@ type OneofDescriptor interface { // IsSynthetic reports whether this is a synthetic oneof created to support // proto3 optional semantics. If true, Fields contains exactly one field - // with HasOptionalKeyword specified. + // with FieldDescriptor.HasOptionalKeyword specified. IsSynthetic() bool // Fields is a list of fields belonging to this oneof. @@ -442,10 +442,10 @@ type OneofDescriptors interface { doNotImplement } -// ExtensionDescriptor is an alias of FieldDescriptor for documentation. +// ExtensionDescriptor is an alias of [FieldDescriptor] for documentation. type ExtensionDescriptor = FieldDescriptor -// ExtensionTypeDescriptor is an ExtensionDescriptor with an associated ExtensionType. +// ExtensionTypeDescriptor is an [ExtensionDescriptor] with an associated [ExtensionType]. type ExtensionTypeDescriptor interface { ExtensionDescriptor @@ -470,12 +470,12 @@ type ExtensionDescriptors interface { doNotImplement } -// ExtensionType encapsulates an ExtensionDescriptor with a concrete +// ExtensionType encapsulates an [ExtensionDescriptor] with a concrete // Go implementation. The nested field descriptor must be for a extension field. // // While a normal field is a member of the parent message that it is declared -// within (see Descriptor.Parent), an extension field is a member of some other -// target message (see ExtensionDescriptor.Extendee) and may have no +// within (see [Descriptor.Parent]), an extension field is a member of some other +// target message (see [FieldDescriptor.ContainingMessage]) and may have no // relationship with the parent. However, the full name of an extension field is // relative to the parent that it is declared within. // @@ -532,7 +532,7 @@ type ExtensionType interface { // corresponds with the google.protobuf.EnumDescriptorProto message. // // Nested declarations: -// EnumValueDescriptor. +// [EnumValueDescriptor]. type EnumDescriptor interface { Descriptor @@ -548,7 +548,7 @@ type EnumDescriptor interface { } type isEnumDescriptor interface{ ProtoType(EnumDescriptor) } -// EnumType encapsulates an EnumDescriptor with a concrete Go implementation. +// EnumType encapsulates an [EnumDescriptor] with a concrete Go implementation. type EnumType interface { // New returns an instance of this enum type with its value set to n. New(n EnumNumber) Enum @@ -610,7 +610,7 @@ type EnumValueDescriptors interface { // ServiceDescriptor describes a service and // corresponds with the google.protobuf.ServiceDescriptorProto message. // -// Nested declarations: MethodDescriptor. +// Nested declarations: [MethodDescriptor]. type ServiceDescriptor interface { Descriptor diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go index 37601b78..a7b0d06f 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value.go @@ -27,16 +27,16 @@ type Enum interface { // Message is a reflective interface for a concrete message value, // encapsulating both type and value information for the message. // -// Accessor/mutators for individual fields are keyed by FieldDescriptor. +// Accessor/mutators for individual fields are keyed by [FieldDescriptor]. // For non-extension fields, the descriptor must exactly match the // field known by the parent message. -// For extension fields, the descriptor must implement ExtensionTypeDescriptor, -// extend the parent message (i.e., have the same message FullName), and +// For extension fields, the descriptor must implement [ExtensionTypeDescriptor], +// extend the parent message (i.e., have the same message [FullName]), and // be within the parent's extension range. // -// Each field Value can be a scalar or a composite type (Message, List, or Map). -// See Value for the Go types associated with a FieldDescriptor. -// Providing a Value that is invalid or of an incorrect type panics. +// Each field [Value] can be a scalar or a composite type ([Message], [List], or [Map]). +// See [Value] for the Go types associated with a [FieldDescriptor]. +// Providing a [Value] that is invalid or of an incorrect type panics. type Message interface { // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. @@ -152,7 +152,7 @@ type Message interface { // This method may return nil. // // The returned methods type is identical to - // "google.golang.org/protobuf/runtime/protoiface".Methods. + // google.golang.org/protobuf/runtime/protoiface.Methods. // Consult the protoiface package documentation for details. ProtoMethods() *methods } @@ -175,8 +175,8 @@ func (b RawFields) IsValid() bool { } // List is a zero-indexed, ordered list. -// The element Value type is determined by FieldDescriptor.Kind. -// Providing a Value that is invalid or of an incorrect type panics. +// The element [Value] type is determined by [FieldDescriptor.Kind]. +// Providing a [Value] that is invalid or of an incorrect type panics. type List interface { // Len reports the number of entries in the List. // Get, Set, and Truncate panic with out of bound indexes. @@ -226,9 +226,9 @@ type List interface { } // Map is an unordered, associative map. -// The entry MapKey type is determined by FieldDescriptor.MapKey.Kind. -// The entry Value type is determined by FieldDescriptor.MapValue.Kind. -// Providing a MapKey or Value that is invalid or of an incorrect type panics. +// The entry [MapKey] type is determined by [FieldDescriptor.MapKey].Kind. +// The entry [Value] type is determined by [FieldDescriptor.MapValue].Kind. +// Providing a [MapKey] or [Value] that is invalid or of an incorrect type panics. type Map interface { // Len reports the number of elements in the map. Len() int diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go index 59165254..654599d4 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_equal.go @@ -24,19 +24,19 @@ import ( // Unlike the == operator, a NaN is equal to another NaN. // // - Enums are equal if they contain the same number. -// Since Value does not contain an enum descriptor, +// Since [Value] does not contain an enum descriptor, // enum values do not consider the type of the enum. // // - Other scalar values are equal if they contain the same value. // -// - Message values are equal if they belong to the same message descriptor, +// - [Message] values are equal if they belong to the same message descriptor, // have the same set of populated known and extension field values, // and the same set of unknown fields values. // -// - Lists are equal if they are the same length and +// - [List] values are equal if they are the same length and // each corresponding element is equal. // -// - Maps are equal if they have the same set of keys and +// - [Map] values are equal if they have the same set of keys and // the corresponding value for each key is equal. func (v1 Value) Equal(v2 Value) bool { return equalValue(v1, v2) diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go index 08e5ef73..16030973 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_union.go @@ -11,7 +11,7 @@ import ( // Value is a union where only one Go type may be set at a time. // The Value is used to represent all possible values a field may take. -// The following shows which Go type is used to represent each proto Kind: +// The following shows which Go type is used to represent each proto [Kind]: // // ╔════════════╤═════════════════════════════════════╗ // ║ Go type │ Protobuf kind ║ @@ -31,22 +31,22 @@ import ( // // Multiple protobuf Kinds may be represented by a single Go type if the type // can losslessly represent the information for the proto kind. For example, -// Int64Kind, Sint64Kind, and Sfixed64Kind are all represented by int64, +// [Int64Kind], [Sint64Kind], and [Sfixed64Kind] are all represented by int64, // but use different integer encoding methods. // -// The List or Map types are used if the field cardinality is repeated. -// A field is a List if FieldDescriptor.IsList reports true. -// A field is a Map if FieldDescriptor.IsMap reports true. +// The [List] or [Map] types are used if the field cardinality is repeated. +// A field is a [List] if [FieldDescriptor.IsList] reports true. +// A field is a [Map] if [FieldDescriptor.IsMap] reports true. // // Converting to/from a Value and a concrete Go value panics on type mismatch. -// For example, ValueOf("hello").Int() panics because this attempts to +// For example, [ValueOf]("hello").Int() panics because this attempts to // retrieve an int64 from a string. // -// List, Map, and Message Values are called "composite" values. +// [List], [Map], and [Message] Values are called "composite" values. // // A composite Value may alias (reference) memory at some location, // such that changes to the Value updates the that location. -// A composite value acquired with a Mutable method, such as Message.Mutable, +// A composite value acquired with a Mutable method, such as [Message.Mutable], // always references the source object. // // For example: @@ -65,7 +65,7 @@ import ( // // appending to the List here may or may not modify the message. // list.Append(protoreflect.ValueOfInt32(0)) // -// Some operations, such as Message.Get, may return an "empty, read-only" +// Some operations, such as [Message.Get], may return an "empty, read-only" // composite Value. Modifying an empty, read-only value panics. type Value value @@ -306,7 +306,7 @@ func (v Value) Float() float64 { } } -// String returns v as a string. Since this method implements fmt.Stringer, +// String returns v as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (v Value) String() string { switch v.typ { @@ -327,7 +327,7 @@ func (v Value) Bytes() []byte { } } -// Enum returns v as a EnumNumber and panics if the type is not a EnumNumber. +// Enum returns v as a [EnumNumber] and panics if the type is not a [EnumNumber]. func (v Value) Enum() EnumNumber { switch v.typ { case enumType: @@ -337,7 +337,7 @@ func (v Value) Enum() EnumNumber { } } -// Message returns v as a Message and panics if the type is not a Message. +// Message returns v as a [Message] and panics if the type is not a [Message]. func (v Value) Message() Message { switch vi := v.getIface().(type) { case Message: @@ -347,7 +347,7 @@ func (v Value) Message() Message { } } -// List returns v as a List and panics if the type is not a List. +// List returns v as a [List] and panics if the type is not a [List]. func (v Value) List() List { switch vi := v.getIface().(type) { case List: @@ -357,7 +357,7 @@ func (v Value) List() List { } } -// Map returns v as a Map and panics if the type is not a Map. +// Map returns v as a [Map] and panics if the type is not a [Map]. func (v Value) Map() Map { switch vi := v.getIface().(type) { case Map: @@ -367,7 +367,7 @@ func (v Value) Map() Map { } } -// MapKey returns v as a MapKey and panics for invalid MapKey types. +// MapKey returns v as a [MapKey] and panics for invalid [MapKey] types. func (v Value) MapKey() MapKey { switch v.typ { case boolType, int32Type, int64Type, uint32Type, uint64Type, stringType: @@ -378,8 +378,8 @@ func (v Value) MapKey() MapKey { } // MapKey is used to index maps, where the Go type of the MapKey must match -// the specified key Kind (see MessageDescriptor.IsMapEntry). -// The following shows what Go type is used to represent each proto Kind: +// the specified key [Kind] (see [MessageDescriptor.IsMapEntry]). +// The following shows what Go type is used to represent each proto [Kind]: // // ╔═════════╤═════════════════════════════════════╗ // ║ Go type │ Protobuf kind ║ @@ -392,13 +392,13 @@ func (v Value) MapKey() MapKey { // ║ string │ StringKind ║ // ╚═════════╧═════════════════════════════════════╝ // -// A MapKey is constructed and accessed through a Value: +// A MapKey is constructed and accessed through a [Value]: // // k := ValueOf("hash").MapKey() // convert string to MapKey // s := k.String() // convert MapKey to string // -// The MapKey is a strict subset of valid types used in Value; -// converting a Value to a MapKey with an invalid type panics. +// The MapKey is a strict subset of valid types used in [Value]; +// converting a [Value] to a MapKey with an invalid type panics. type MapKey value // IsValid reports whether k is populated with a value. @@ -426,13 +426,13 @@ func (k MapKey) Uint() uint64 { return Value(k).Uint() } -// String returns k as a string. Since this method implements fmt.Stringer, +// String returns k as a string. Since this method implements [fmt.Stringer], // this returns the formatted string value for any non-string type. func (k MapKey) String() string { return Value(k).String() } -// Value returns k as a Value. +// Value returns k as a [Value]. func (k MapKey) Value() Value { return Value(k) } diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go similarity index 97% rename from vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go rename to vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go index 702ddf22..b1fdbe3e 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe.go +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go120.go @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !purego && !appengine -// +build !purego,!appengine +//go:build !purego && !appengine && !go1.21 +// +build !purego,!appengine,!go1.21 package protoreflect diff --git a/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go new file mode 100644 index 00000000..43547011 --- /dev/null +++ b/vendor/google.golang.org/protobuf/reflect/protoreflect/value_unsafe_go121.go @@ -0,0 +1,87 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build !purego && !appengine && go1.21 +// +build !purego,!appengine,go1.21 + +package protoreflect + +import ( + "unsafe" + + "google.golang.org/protobuf/internal/pragma" +) + +type ( + ifaceHeader struct { + _ [0]interface{} // if interfaces have greater alignment than unsafe.Pointer, this will enforce it. + Type unsafe.Pointer + Data unsafe.Pointer + } +) + +var ( + nilType = typeOf(nil) + boolType = typeOf(*new(bool)) + int32Type = typeOf(*new(int32)) + int64Type = typeOf(*new(int64)) + uint32Type = typeOf(*new(uint32)) + uint64Type = typeOf(*new(uint64)) + float32Type = typeOf(*new(float32)) + float64Type = typeOf(*new(float64)) + stringType = typeOf(*new(string)) + bytesType = typeOf(*new([]byte)) + enumType = typeOf(*new(EnumNumber)) +) + +// typeOf returns a pointer to the Go type information. +// The pointer is comparable and equal if and only if the types are identical. +func typeOf(t interface{}) unsafe.Pointer { + return (*ifaceHeader)(unsafe.Pointer(&t)).Type +} + +// value is a union where only one type can be represented at a time. +// The struct is 24B large on 64-bit systems and requires the minimum storage +// necessary to represent each possible type. +// +// The Go GC needs to be able to scan variables containing pointers. +// As such, pointers and non-pointers cannot be intermixed. +type value struct { + pragma.DoNotCompare // 0B + + // typ stores the type of the value as a pointer to the Go type. + typ unsafe.Pointer // 8B + + // ptr stores the data pointer for a String, Bytes, or interface value. + ptr unsafe.Pointer // 8B + + // num stores a Bool, Int32, Int64, Uint32, Uint64, Float32, Float64, or + // Enum value as a raw uint64. + // + // It is also used to store the length of a String or Bytes value; + // the capacity is ignored. + num uint64 // 8B +} + +func valueOfString(v string) Value { + return Value{typ: stringType, ptr: unsafe.Pointer(unsafe.StringData(v)), num: uint64(len(v))} +} +func valueOfBytes(v []byte) Value { + return Value{typ: bytesType, ptr: unsafe.Pointer(unsafe.SliceData(v)), num: uint64(len(v))} +} +func valueOfIface(v interface{}) Value { + p := (*ifaceHeader)(unsafe.Pointer(&v)) + return Value{typ: p.Type, ptr: p.Data} +} + +func (v Value) getString() string { + return unsafe.String((*byte)(v.ptr), v.num) +} +func (v Value) getBytes() []byte { + return unsafe.Slice((*byte)(v.ptr), v.num) +} +func (v Value) getIface() (x interface{}) { + *(*ifaceHeader)(unsafe.Pointer(&x)) = ifaceHeader{Type: v.typ, Data: v.ptr} + return x +} diff --git a/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go b/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go index aeb55977..6267dc52 100644 --- a/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go +++ b/vendor/google.golang.org/protobuf/reflect/protoregistry/registry.go @@ -5,12 +5,12 @@ // Package protoregistry provides data structures to register and lookup // protobuf descriptor types. // -// The Files registry contains file descriptors and provides the ability +// The [Files] registry contains file descriptors and provides the ability // to iterate over the files or lookup a specific descriptor within the files. -// Files only contains protobuf descriptors and has no understanding of Go +// [Files] only contains protobuf descriptors and has no understanding of Go // type information that may be associated with each descriptor. // -// The Types registry contains descriptor types for which there is a known +// The [Types] registry contains descriptor types for which there is a known // Go type associated with that descriptor. It provides the ability to iterate // over the registered types or lookup a type by name. package protoregistry @@ -218,7 +218,7 @@ func (r *Files) checkGenProtoConflict(path string) { // FindDescriptorByName looks up a descriptor by the full name. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Files) FindDescriptorByName(name protoreflect.FullName) (protoreflect.Descriptor, error) { if r == nil { return nil, NotFound @@ -310,7 +310,7 @@ func (s *nameSuffix) Pop() (name protoreflect.Name) { // FindFileByPath looks up a file by the path. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. // This returns an error if multiple files have the same path. func (r *Files) FindFileByPath(path string) (protoreflect.FileDescriptor, error) { if r == nil { @@ -431,7 +431,7 @@ func rangeTopLevelDescriptors(fd protoreflect.FileDescriptor, f func(protoreflec // A compliant implementation must deterministically return the same type // if no error is encountered. // -// The Types type implements this interface. +// The [Types] type implements this interface. type MessageTypeResolver interface { // FindMessageByName looks up a message by its full name. // E.g., "google.protobuf.Any" @@ -451,7 +451,7 @@ type MessageTypeResolver interface { // A compliant implementation must deterministically return the same type // if no error is encountered. // -// The Types type implements this interface. +// The [Types] type implements this interface. type ExtensionTypeResolver interface { // FindExtensionByName looks up a extension field by the field's full name. // Note that this is the full name of the field as determined by @@ -590,7 +590,7 @@ func (r *Types) register(kind string, desc protoreflect.Descriptor, typ interfac // FindEnumByName looks up an enum by its full name. // E.g., "google.protobuf.Field.Kind". // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumType, error) { if r == nil { return nil, NotFound @@ -611,7 +611,7 @@ func (r *Types) FindEnumByName(enum protoreflect.FullName) (protoreflect.EnumTyp // FindMessageByName looks up a message by its full name, // e.g. "google.protobuf.Any". // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindMessageByName(message protoreflect.FullName) (protoreflect.MessageType, error) { if r == nil { return nil, NotFound @@ -632,7 +632,7 @@ func (r *Types) FindMessageByName(message protoreflect.FullName) (protoreflect.M // FindMessageByURL looks up a message by a URL identifier. // See documentation on google.protobuf.Any.type_url for the URL format. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { // This function is similar to FindMessageByName but // truncates anything before and including '/' in the URL. @@ -662,7 +662,7 @@ func (r *Types) FindMessageByURL(url string) (protoreflect.MessageType, error) { // where the extension is declared and is unrelated to the full name of the // message being extended. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindExtensionByName(field protoreflect.FullName) (protoreflect.ExtensionType, error) { if r == nil { return nil, NotFound @@ -703,7 +703,7 @@ func (r *Types) FindExtensionByName(field protoreflect.FullName) (protoreflect.E // FindExtensionByNumber looks up a extension field by the field number // within some parent message, identified by full name. // -// This returns (nil, NotFound) if not found. +// This returns (nil, [NotFound]) if not found. func (r *Types) FindExtensionByNumber(message protoreflect.FullName, field protoreflect.FieldNumber) (protoreflect.ExtensionType, error) { if r == nil { return nil, NotFound diff --git a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go index 04c00f73..38daa858 100644 --- a/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go +++ b/vendor/google.golang.org/protobuf/types/descriptorpb/descriptor.pb.go @@ -48,6 +48,94 @@ import ( sync "sync" ) +// The full set of known editions. +type Edition int32 + +const ( + // A placeholder for an unknown edition value. + Edition_EDITION_UNKNOWN Edition = 0 + // Legacy syntax "editions". These pre-date editions, but behave much like + // distinct editions. These can't be used to specify the edition of proto + // files, but feature definitions must supply proto2/proto3 defaults for + // backwards compatibility. + Edition_EDITION_PROTO2 Edition = 998 + Edition_EDITION_PROTO3 Edition = 999 + // Editions that have been released. The specific values are arbitrary and + // should not be depended on, but they will always be time-ordered for easy + // comparison. + Edition_EDITION_2023 Edition = 1000 + // Placeholder editions for testing feature resolution. These should not be + // used or relyed on outside of tests. + Edition_EDITION_1_TEST_ONLY Edition = 1 + Edition_EDITION_2_TEST_ONLY Edition = 2 + Edition_EDITION_99997_TEST_ONLY Edition = 99997 + Edition_EDITION_99998_TEST_ONLY Edition = 99998 + Edition_EDITION_99999_TEST_ONLY Edition = 99999 +) + +// Enum value maps for Edition. +var ( + Edition_name = map[int32]string{ + 0: "EDITION_UNKNOWN", + 998: "EDITION_PROTO2", + 999: "EDITION_PROTO3", + 1000: "EDITION_2023", + 1: "EDITION_1_TEST_ONLY", + 2: "EDITION_2_TEST_ONLY", + 99997: "EDITION_99997_TEST_ONLY", + 99998: "EDITION_99998_TEST_ONLY", + 99999: "EDITION_99999_TEST_ONLY", + } + Edition_value = map[string]int32{ + "EDITION_UNKNOWN": 0, + "EDITION_PROTO2": 998, + "EDITION_PROTO3": 999, + "EDITION_2023": 1000, + "EDITION_1_TEST_ONLY": 1, + "EDITION_2_TEST_ONLY": 2, + "EDITION_99997_TEST_ONLY": 99997, + "EDITION_99998_TEST_ONLY": 99998, + "EDITION_99999_TEST_ONLY": 99999, + } +) + +func (x Edition) Enum() *Edition { + p := new(Edition) + *p = x + return p +} + +func (x Edition) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Edition) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[0].Descriptor() +} + +func (Edition) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[0] +} + +func (x Edition) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *Edition) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = Edition(num) + return nil +} + +// Deprecated: Use Edition.Descriptor instead. +func (Edition) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{0} +} + // The verification state of the extension range. type ExtensionRangeOptions_VerificationState int32 @@ -80,11 +168,11 @@ func (x ExtensionRangeOptions_VerificationState) String() string { } func (ExtensionRangeOptions_VerificationState) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[0].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor() } func (ExtensionRangeOptions_VerificationState) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[0] + return &file_google_protobuf_descriptor_proto_enumTypes[1] } func (x ExtensionRangeOptions_VerificationState) Number() protoreflect.EnumNumber { @@ -125,9 +213,10 @@ const ( FieldDescriptorProto_TYPE_BOOL FieldDescriptorProto_Type = 8 FieldDescriptorProto_TYPE_STRING FieldDescriptorProto_Type = 9 // Tag-delimited aggregate. - // Group type is deprecated and not supported in proto3. However, Proto3 + // Group type is deprecated and not supported after google.protobuf. However, Proto3 // implementations should still be able to parse the group wire format and - // treat group fields as unknown fields. + // treat group fields as unknown fields. In Editions, the group wire format + // can be enabled via the `message_encoding` feature. FieldDescriptorProto_TYPE_GROUP FieldDescriptorProto_Type = 10 FieldDescriptorProto_TYPE_MESSAGE FieldDescriptorProto_Type = 11 // Length-delimited aggregate. // New in version 2. @@ -195,11 +284,11 @@ func (x FieldDescriptorProto_Type) String() string { } func (FieldDescriptorProto_Type) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[1].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor() } func (FieldDescriptorProto_Type) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[1] + return &file_google_protobuf_descriptor_proto_enumTypes[2] } func (x FieldDescriptorProto_Type) Number() protoreflect.EnumNumber { @@ -226,21 +315,24 @@ type FieldDescriptorProto_Label int32 const ( // 0 is reserved for errors FieldDescriptorProto_LABEL_OPTIONAL FieldDescriptorProto_Label = 1 - FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 FieldDescriptorProto_LABEL_REPEATED FieldDescriptorProto_Label = 3 + // The required label is only allowed in google.protobuf. In proto3 and Editions + // it's explicitly prohibited. In Editions, the `field_presence` feature + // can be used to get this behavior. + FieldDescriptorProto_LABEL_REQUIRED FieldDescriptorProto_Label = 2 ) // Enum value maps for FieldDescriptorProto_Label. var ( FieldDescriptorProto_Label_name = map[int32]string{ 1: "LABEL_OPTIONAL", - 2: "LABEL_REQUIRED", 3: "LABEL_REPEATED", + 2: "LABEL_REQUIRED", } FieldDescriptorProto_Label_value = map[string]int32{ "LABEL_OPTIONAL": 1, - "LABEL_REQUIRED": 2, "LABEL_REPEATED": 3, + "LABEL_REQUIRED": 2, } ) @@ -255,11 +347,11 @@ func (x FieldDescriptorProto_Label) String() string { } func (FieldDescriptorProto_Label) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[2].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor() } func (FieldDescriptorProto_Label) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[2] + return &file_google_protobuf_descriptor_proto_enumTypes[3] } func (x FieldDescriptorProto_Label) Number() protoreflect.EnumNumber { @@ -316,11 +408,11 @@ func (x FileOptions_OptimizeMode) String() string { } func (FileOptions_OptimizeMode) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[3].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor() } func (FileOptions_OptimizeMode) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[3] + return &file_google_protobuf_descriptor_proto_enumTypes[4] } func (x FileOptions_OptimizeMode) Number() protoreflect.EnumNumber { @@ -382,11 +474,11 @@ func (x FieldOptions_CType) String() string { } func (FieldOptions_CType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[4].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor() } func (FieldOptions_CType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[4] + return &file_google_protobuf_descriptor_proto_enumTypes[5] } func (x FieldOptions_CType) Number() protoreflect.EnumNumber { @@ -444,11 +536,11 @@ func (x FieldOptions_JSType) String() string { } func (FieldOptions_JSType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[5].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[6].Descriptor() } func (FieldOptions_JSType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[5] + return &file_google_protobuf_descriptor_proto_enumTypes[6] } func (x FieldOptions_JSType) Number() protoreflect.EnumNumber { @@ -506,11 +598,11 @@ func (x FieldOptions_OptionRetention) String() string { } func (FieldOptions_OptionRetention) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[6].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[7].Descriptor() } func (FieldOptions_OptionRetention) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[6] + return &file_google_protobuf_descriptor_proto_enumTypes[7] } func (x FieldOptions_OptionRetention) Number() protoreflect.EnumNumber { @@ -590,11 +682,11 @@ func (x FieldOptions_OptionTargetType) String() string { } func (FieldOptions_OptionTargetType) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[7].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[8].Descriptor() } func (FieldOptions_OptionTargetType) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[7] + return &file_google_protobuf_descriptor_proto_enumTypes[8] } func (x FieldOptions_OptionTargetType) Number() protoreflect.EnumNumber { @@ -652,11 +744,11 @@ func (x MethodOptions_IdempotencyLevel) String() string { } func (MethodOptions_IdempotencyLevel) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[8].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[9].Descriptor() } func (MethodOptions_IdempotencyLevel) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[8] + return &file_google_protobuf_descriptor_proto_enumTypes[9] } func (x MethodOptions_IdempotencyLevel) Number() protoreflect.EnumNumber { @@ -678,6 +770,363 @@ func (MethodOptions_IdempotencyLevel) EnumDescriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{17, 0} } +type FeatureSet_FieldPresence int32 + +const ( + FeatureSet_FIELD_PRESENCE_UNKNOWN FeatureSet_FieldPresence = 0 + FeatureSet_EXPLICIT FeatureSet_FieldPresence = 1 + FeatureSet_IMPLICIT FeatureSet_FieldPresence = 2 + FeatureSet_LEGACY_REQUIRED FeatureSet_FieldPresence = 3 +) + +// Enum value maps for FeatureSet_FieldPresence. +var ( + FeatureSet_FieldPresence_name = map[int32]string{ + 0: "FIELD_PRESENCE_UNKNOWN", + 1: "EXPLICIT", + 2: "IMPLICIT", + 3: "LEGACY_REQUIRED", + } + FeatureSet_FieldPresence_value = map[string]int32{ + "FIELD_PRESENCE_UNKNOWN": 0, + "EXPLICIT": 1, + "IMPLICIT": 2, + "LEGACY_REQUIRED": 3, + } +) + +func (x FeatureSet_FieldPresence) Enum() *FeatureSet_FieldPresence { + p := new(FeatureSet_FieldPresence) + *p = x + return p +} + +func (x FeatureSet_FieldPresence) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_FieldPresence) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[10].Descriptor() +} + +func (FeatureSet_FieldPresence) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[10] +} + +func (x FeatureSet_FieldPresence) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_FieldPresence) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_FieldPresence(num) + return nil +} + +// Deprecated: Use FeatureSet_FieldPresence.Descriptor instead. +func (FeatureSet_FieldPresence) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0} +} + +type FeatureSet_EnumType int32 + +const ( + FeatureSet_ENUM_TYPE_UNKNOWN FeatureSet_EnumType = 0 + FeatureSet_OPEN FeatureSet_EnumType = 1 + FeatureSet_CLOSED FeatureSet_EnumType = 2 +) + +// Enum value maps for FeatureSet_EnumType. +var ( + FeatureSet_EnumType_name = map[int32]string{ + 0: "ENUM_TYPE_UNKNOWN", + 1: "OPEN", + 2: "CLOSED", + } + FeatureSet_EnumType_value = map[string]int32{ + "ENUM_TYPE_UNKNOWN": 0, + "OPEN": 1, + "CLOSED": 2, + } +) + +func (x FeatureSet_EnumType) Enum() *FeatureSet_EnumType { + p := new(FeatureSet_EnumType) + *p = x + return p +} + +func (x FeatureSet_EnumType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_EnumType) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[11].Descriptor() +} + +func (FeatureSet_EnumType) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[11] +} + +func (x FeatureSet_EnumType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_EnumType) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_EnumType(num) + return nil +} + +// Deprecated: Use FeatureSet_EnumType.Descriptor instead. +func (FeatureSet_EnumType) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 1} +} + +type FeatureSet_RepeatedFieldEncoding int32 + +const ( + FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN FeatureSet_RepeatedFieldEncoding = 0 + FeatureSet_PACKED FeatureSet_RepeatedFieldEncoding = 1 + FeatureSet_EXPANDED FeatureSet_RepeatedFieldEncoding = 2 +) + +// Enum value maps for FeatureSet_RepeatedFieldEncoding. +var ( + FeatureSet_RepeatedFieldEncoding_name = map[int32]string{ + 0: "REPEATED_FIELD_ENCODING_UNKNOWN", + 1: "PACKED", + 2: "EXPANDED", + } + FeatureSet_RepeatedFieldEncoding_value = map[string]int32{ + "REPEATED_FIELD_ENCODING_UNKNOWN": 0, + "PACKED": 1, + "EXPANDED": 2, + } +) + +func (x FeatureSet_RepeatedFieldEncoding) Enum() *FeatureSet_RepeatedFieldEncoding { + p := new(FeatureSet_RepeatedFieldEncoding) + *p = x + return p +} + +func (x FeatureSet_RepeatedFieldEncoding) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_RepeatedFieldEncoding) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[12].Descriptor() +} + +func (FeatureSet_RepeatedFieldEncoding) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[12] +} + +func (x FeatureSet_RepeatedFieldEncoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_RepeatedFieldEncoding) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_RepeatedFieldEncoding(num) + return nil +} + +// Deprecated: Use FeatureSet_RepeatedFieldEncoding.Descriptor instead. +func (FeatureSet_RepeatedFieldEncoding) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 2} +} + +type FeatureSet_Utf8Validation int32 + +const ( + FeatureSet_UTF8_VALIDATION_UNKNOWN FeatureSet_Utf8Validation = 0 + FeatureSet_NONE FeatureSet_Utf8Validation = 1 + FeatureSet_VERIFY FeatureSet_Utf8Validation = 2 +) + +// Enum value maps for FeatureSet_Utf8Validation. +var ( + FeatureSet_Utf8Validation_name = map[int32]string{ + 0: "UTF8_VALIDATION_UNKNOWN", + 1: "NONE", + 2: "VERIFY", + } + FeatureSet_Utf8Validation_value = map[string]int32{ + "UTF8_VALIDATION_UNKNOWN": 0, + "NONE": 1, + "VERIFY": 2, + } +) + +func (x FeatureSet_Utf8Validation) Enum() *FeatureSet_Utf8Validation { + p := new(FeatureSet_Utf8Validation) + *p = x + return p +} + +func (x FeatureSet_Utf8Validation) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_Utf8Validation) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[13].Descriptor() +} + +func (FeatureSet_Utf8Validation) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[13] +} + +func (x FeatureSet_Utf8Validation) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_Utf8Validation) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_Utf8Validation(num) + return nil +} + +// Deprecated: Use FeatureSet_Utf8Validation.Descriptor instead. +func (FeatureSet_Utf8Validation) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 3} +} + +type FeatureSet_MessageEncoding int32 + +const ( + FeatureSet_MESSAGE_ENCODING_UNKNOWN FeatureSet_MessageEncoding = 0 + FeatureSet_LENGTH_PREFIXED FeatureSet_MessageEncoding = 1 + FeatureSet_DELIMITED FeatureSet_MessageEncoding = 2 +) + +// Enum value maps for FeatureSet_MessageEncoding. +var ( + FeatureSet_MessageEncoding_name = map[int32]string{ + 0: "MESSAGE_ENCODING_UNKNOWN", + 1: "LENGTH_PREFIXED", + 2: "DELIMITED", + } + FeatureSet_MessageEncoding_value = map[string]int32{ + "MESSAGE_ENCODING_UNKNOWN": 0, + "LENGTH_PREFIXED": 1, + "DELIMITED": 2, + } +) + +func (x FeatureSet_MessageEncoding) Enum() *FeatureSet_MessageEncoding { + p := new(FeatureSet_MessageEncoding) + *p = x + return p +} + +func (x FeatureSet_MessageEncoding) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_MessageEncoding) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[14].Descriptor() +} + +func (FeatureSet_MessageEncoding) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[14] +} + +func (x FeatureSet_MessageEncoding) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_MessageEncoding) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_MessageEncoding(num) + return nil +} + +// Deprecated: Use FeatureSet_MessageEncoding.Descriptor instead. +func (FeatureSet_MessageEncoding) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 4} +} + +type FeatureSet_JsonFormat int32 + +const ( + FeatureSet_JSON_FORMAT_UNKNOWN FeatureSet_JsonFormat = 0 + FeatureSet_ALLOW FeatureSet_JsonFormat = 1 + FeatureSet_LEGACY_BEST_EFFORT FeatureSet_JsonFormat = 2 +) + +// Enum value maps for FeatureSet_JsonFormat. +var ( + FeatureSet_JsonFormat_name = map[int32]string{ + 0: "JSON_FORMAT_UNKNOWN", + 1: "ALLOW", + 2: "LEGACY_BEST_EFFORT", + } + FeatureSet_JsonFormat_value = map[string]int32{ + "JSON_FORMAT_UNKNOWN": 0, + "ALLOW": 1, + "LEGACY_BEST_EFFORT": 2, + } +) + +func (x FeatureSet_JsonFormat) Enum() *FeatureSet_JsonFormat { + p := new(FeatureSet_JsonFormat) + *p = x + return p +} + +func (x FeatureSet_JsonFormat) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FeatureSet_JsonFormat) Descriptor() protoreflect.EnumDescriptor { + return file_google_protobuf_descriptor_proto_enumTypes[15].Descriptor() +} + +func (FeatureSet_JsonFormat) Type() protoreflect.EnumType { + return &file_google_protobuf_descriptor_proto_enumTypes[15] +} + +func (x FeatureSet_JsonFormat) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Do not use. +func (x *FeatureSet_JsonFormat) UnmarshalJSON(b []byte) error { + num, err := protoimpl.X.UnmarshalJSONEnum(x.Descriptor(), b) + if err != nil { + return err + } + *x = FeatureSet_JsonFormat(num) + return nil +} + +// Deprecated: Use FeatureSet_JsonFormat.Descriptor instead. +func (FeatureSet_JsonFormat) EnumDescriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 5} +} + // Represents the identified object's effect on the element in the original // .proto file. type GeneratedCodeInfo_Annotation_Semantic int32 @@ -716,11 +1165,11 @@ func (x GeneratedCodeInfo_Annotation_Semantic) String() string { } func (GeneratedCodeInfo_Annotation_Semantic) Descriptor() protoreflect.EnumDescriptor { - return file_google_protobuf_descriptor_proto_enumTypes[9].Descriptor() + return file_google_protobuf_descriptor_proto_enumTypes[16].Descriptor() } func (GeneratedCodeInfo_Annotation_Semantic) Type() protoreflect.EnumType { - return &file_google_protobuf_descriptor_proto_enumTypes[9] + return &file_google_protobuf_descriptor_proto_enumTypes[16] } func (x GeneratedCodeInfo_Annotation_Semantic) Number() protoreflect.EnumNumber { @@ -739,7 +1188,7 @@ func (x *GeneratedCodeInfo_Annotation_Semantic) UnmarshalJSON(b []byte) error { // Deprecated: Use GeneratedCodeInfo_Annotation_Semantic.Descriptor instead. func (GeneratedCodeInfo_Annotation_Semantic) EnumDescriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20, 0, 0} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22, 0, 0} } // The protocol compiler can output a FileDescriptorSet containing the .proto @@ -822,8 +1271,8 @@ type FileDescriptorProto struct { // // If `edition` is present, this value must be "editions". Syntax *string `protobuf:"bytes,12,opt,name=syntax" json:"syntax,omitempty"` - // The edition of the proto file, which is an opaque string. - Edition *string `protobuf:"bytes,13,opt,name=edition" json:"edition,omitempty"` + // The edition of the proto file. + Edition *Edition `protobuf:"varint,14,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` } func (x *FileDescriptorProto) Reset() { @@ -942,11 +1391,11 @@ func (x *FileDescriptorProto) GetSyntax() string { return "" } -func (x *FileDescriptorProto) GetEdition() string { +func (x *FileDescriptorProto) GetEdition() Edition { if x != nil && x.Edition != nil { return *x.Edition } - return "" + return Edition_EDITION_UNKNOWN } // Describes a message type. @@ -1079,13 +1528,14 @@ type ExtensionRangeOptions struct { // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` - // go/protobuf-stripping-extension-declarations - // Like Metadata, but we use a repeated field to hold all extension - // declarations. This should avoid the size increases of transforming a large - // extension range into small ranges in generated binaries. + // For external users: DO NOT USE. We are in the process of open sourcing + // extension declaration and executing internal cleanups before it can be + // used externally. Declaration []*ExtensionRangeOptions_Declaration `protobuf:"bytes,2,rep,name=declaration" json:"declaration,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"` // The verification state of the range. - // TODO(b/278783756): flip the default to DECLARATION once all empty ranges + // TODO: flip the default to DECLARATION once all empty ranges // are marked as UNVERIFIED. Verification *ExtensionRangeOptions_VerificationState `protobuf:"varint,3,opt,name=verification,enum=google.protobuf.ExtensionRangeOptions_VerificationState,def=1" json:"verification,omitempty"` } @@ -1141,6 +1591,13 @@ func (x *ExtensionRangeOptions) GetDeclaration() []*ExtensionRangeOptions_Declar return nil } +func (x *ExtensionRangeOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *ExtensionRangeOptions) GetVerification() ExtensionRangeOptions_VerificationState { if x != nil && x.Verification != nil { return *x.Verification @@ -1772,6 +2229,8 @@ type FileOptions struct { // is empty. When this option is not set, the package name will be used for // determining the ruby package. RubyPackage *string `protobuf:"bytes,45,opt,name=ruby_package,json=rubyPackage" json:"ruby_package,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,50,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. // See the documentation for the "Options" section above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` @@ -1963,6 +2422,13 @@ func (x *FileOptions) GetRubyPackage() string { return "" } +func (x *FileOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *FileOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2039,11 +2505,13 @@ type MessageOptions struct { // This should only be used as a temporary measure against broken builds due // to the change in behavior for JSON field name conflicts. // - // TODO(b/261750190) This is legacy behavior we plan to remove once downstream + // TODO This is legacy behavior we plan to remove once downstream // teams have had time to migrate. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,11,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,12,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2123,6 +2591,13 @@ func (x *MessageOptions) GetDeprecatedLegacyJsonFieldConflicts() bool { return false } +func (x *MessageOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *MessageOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2147,7 +2622,9 @@ type FieldOptions struct { // a more efficient representation on the wire. Rather than repeatedly // writing the tag and type for each element, the entire array is encoded as // a single length-delimited blob. In proto3, only explicit setting it to - // false will avoid using packed encoding. + // false will avoid using packed encoding. This option is prohibited in + // Editions, but the `repeated_field_encoding` feature can be used to control + // the behavior. Packed *bool `protobuf:"varint,2,opt,name=packed" json:"packed,omitempty"` // The jstype option determines the JavaScript type used for values of the // field. The option is permitted only for 64 bit integral and fixed types @@ -2205,11 +2682,12 @@ type FieldOptions struct { Weak *bool `protobuf:"varint,10,opt,name=weak,def=0" json:"weak,omitempty"` // Indicate that the field value should not be printed out when using debug // formats, e.g. when the field contains sensitive credentials. - DebugRedact *bool `protobuf:"varint,16,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` - Retention *FieldOptions_OptionRetention `protobuf:"varint,17,opt,name=retention,enum=google.protobuf.FieldOptions_OptionRetention" json:"retention,omitempty"` - // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. - Target *FieldOptions_OptionTargetType `protobuf:"varint,18,opt,name=target,enum=google.protobuf.FieldOptions_OptionTargetType" json:"target,omitempty"` - Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions_OptionTargetType" json:"targets,omitempty"` + DebugRedact *bool `protobuf:"varint,16,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` + Retention *FieldOptions_OptionRetention `protobuf:"varint,17,opt,name=retention,enum=google.protobuf.FieldOptions_OptionRetention" json:"retention,omitempty"` + Targets []FieldOptions_OptionTargetType `protobuf:"varint,19,rep,name=targets,enum=google.protobuf.FieldOptions_OptionTargetType" json:"targets,omitempty"` + EditionDefaults []*FieldOptions_EditionDefault `protobuf:"bytes,20,rep,name=edition_defaults,json=editionDefaults" json:"edition_defaults,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,21,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2320,14 +2798,6 @@ func (x *FieldOptions) GetRetention() FieldOptions_OptionRetention { return FieldOptions_RETENTION_UNKNOWN } -// Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. -func (x *FieldOptions) GetTarget() FieldOptions_OptionTargetType { - if x != nil && x.Target != nil { - return *x.Target - } - return FieldOptions_TARGET_TYPE_UNKNOWN -} - func (x *FieldOptions) GetTargets() []FieldOptions_OptionTargetType { if x != nil { return x.Targets @@ -2335,6 +2805,20 @@ func (x *FieldOptions) GetTargets() []FieldOptions_OptionTargetType { return nil } +func (x *FieldOptions) GetEditionDefaults() []*FieldOptions_EditionDefault { + if x != nil { + return x.EditionDefaults + } + return nil +} + +func (x *FieldOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *FieldOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2348,6 +2832,8 @@ type OneofOptions struct { unknownFields protoimpl.UnknownFields extensionFields protoimpl.ExtensionFields + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,1,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2384,6 +2870,13 @@ func (*OneofOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{13} } +func (x *OneofOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *OneofOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2409,11 +2902,13 @@ type EnumOptions struct { // and strips underscored from the fields before comparison in proto3 only. // The new behavior takes `json_name` into account and applies to proto2 as // well. - // TODO(b/261750190) Remove this legacy behavior once downstream teams have + // TODO Remove this legacy behavior once downstream teams have // had time to migrate. // // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. DeprecatedLegacyJsonFieldConflicts *bool `protobuf:"varint,6,opt,name=deprecated_legacy_json_field_conflicts,json=deprecatedLegacyJsonFieldConflicts" json:"deprecated_legacy_json_field_conflicts,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,7,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2477,6 +2972,13 @@ func (x *EnumOptions) GetDeprecatedLegacyJsonFieldConflicts() bool { return false } +func (x *EnumOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *EnumOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2495,13 +2997,20 @@ type EnumValueOptions struct { // for the enum value, or it will be completely ignored; in the very least, // this is a formalization for deprecating enum values. Deprecated *bool `protobuf:"varint,1,opt,name=deprecated,def=0" json:"deprecated,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` + // Indicate that fields annotated with this enum value should not be printed + // out when using debug formats, e.g. when the field contains sensitive + // credentials. + DebugRedact *bool `protobuf:"varint,3,opt,name=debug_redact,json=debugRedact,def=0" json:"debug_redact,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } // Default values for EnumValueOptions fields. const ( - Default_EnumValueOptions_Deprecated = bool(false) + Default_EnumValueOptions_Deprecated = bool(false) + Default_EnumValueOptions_DebugRedact = bool(false) ) func (x *EnumValueOptions) Reset() { @@ -2543,6 +3052,20 @@ func (x *EnumValueOptions) GetDeprecated() bool { return Default_EnumValueOptions_Deprecated } +func (x *EnumValueOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + +func (x *EnumValueOptions) GetDebugRedact() bool { + if x != nil && x.DebugRedact != nil { + return *x.DebugRedact + } + return Default_EnumValueOptions_DebugRedact +} + func (x *EnumValueOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2556,6 +3079,8 @@ type ServiceOptions struct { unknownFields protoimpl.UnknownFields extensionFields protoimpl.ExtensionFields + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,34,opt,name=features" json:"features,omitempty"` // Is this service deprecated? // Depending on the target platform, this can emit Deprecated annotations // for the service, or it will be completely ignored; in the very least, @@ -2602,6 +3127,13 @@ func (*ServiceOptions) Descriptor() ([]byte, []int) { return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{16} } +func (x *ServiceOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *ServiceOptions) GetDeprecated() bool { if x != nil && x.Deprecated != nil { return *x.Deprecated @@ -2628,6 +3160,8 @@ type MethodOptions struct { // this is a formalization for deprecating methods. Deprecated *bool `protobuf:"varint,33,opt,name=deprecated,def=0" json:"deprecated,omitempty"` IdempotencyLevel *MethodOptions_IdempotencyLevel `protobuf:"varint,34,opt,name=idempotency_level,json=idempotencyLevel,enum=google.protobuf.MethodOptions_IdempotencyLevel,def=0" json:"idempotency_level,omitempty"` + // Any features defined in the specific edition. + Features *FeatureSet `protobuf:"bytes,35,opt,name=features" json:"features,omitempty"` // The parser stores options it doesn't recognize here. See above. UninterpretedOption []*UninterpretedOption `protobuf:"bytes,999,rep,name=uninterpreted_option,json=uninterpretedOption" json:"uninterpreted_option,omitempty"` } @@ -2684,6 +3218,13 @@ func (x *MethodOptions) GetIdempotencyLevel() MethodOptions_IdempotencyLevel { return Default_MethodOptions_IdempotencyLevel } +func (x *MethodOptions) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + func (x *MethodOptions) GetUninterpretedOption() []*UninterpretedOption { if x != nil { return x.UninterpretedOption @@ -2794,6 +3335,171 @@ func (x *UninterpretedOption) GetAggregateValue() string { return "" } +// TODO Enums in C++ gencode (and potentially other languages) are +// not well scoped. This means that each of the feature enums below can clash +// with each other. The short names we've chosen maximize call-site +// readability, but leave us very open to this scenario. A future feature will +// be designed and implemented to handle this, hopefully before we ever hit a +// conflict here. +type FeatureSet struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + extensionFields protoimpl.ExtensionFields + + FieldPresence *FeatureSet_FieldPresence `protobuf:"varint,1,opt,name=field_presence,json=fieldPresence,enum=google.protobuf.FeatureSet_FieldPresence" json:"field_presence,omitempty"` + EnumType *FeatureSet_EnumType `protobuf:"varint,2,opt,name=enum_type,json=enumType,enum=google.protobuf.FeatureSet_EnumType" json:"enum_type,omitempty"` + RepeatedFieldEncoding *FeatureSet_RepeatedFieldEncoding `protobuf:"varint,3,opt,name=repeated_field_encoding,json=repeatedFieldEncoding,enum=google.protobuf.FeatureSet_RepeatedFieldEncoding" json:"repeated_field_encoding,omitempty"` + Utf8Validation *FeatureSet_Utf8Validation `protobuf:"varint,4,opt,name=utf8_validation,json=utf8Validation,enum=google.protobuf.FeatureSet_Utf8Validation" json:"utf8_validation,omitempty"` + MessageEncoding *FeatureSet_MessageEncoding `protobuf:"varint,5,opt,name=message_encoding,json=messageEncoding,enum=google.protobuf.FeatureSet_MessageEncoding" json:"message_encoding,omitempty"` + JsonFormat *FeatureSet_JsonFormat `protobuf:"varint,6,opt,name=json_format,json=jsonFormat,enum=google.protobuf.FeatureSet_JsonFormat" json:"json_format,omitempty"` +} + +func (x *FeatureSet) Reset() { + *x = FeatureSet{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureSet) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSet) ProtoMessage() {} + +func (x *FeatureSet) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSet.ProtoReflect.Descriptor instead. +func (*FeatureSet) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19} +} + +func (x *FeatureSet) GetFieldPresence() FeatureSet_FieldPresence { + if x != nil && x.FieldPresence != nil { + return *x.FieldPresence + } + return FeatureSet_FIELD_PRESENCE_UNKNOWN +} + +func (x *FeatureSet) GetEnumType() FeatureSet_EnumType { + if x != nil && x.EnumType != nil { + return *x.EnumType + } + return FeatureSet_ENUM_TYPE_UNKNOWN +} + +func (x *FeatureSet) GetRepeatedFieldEncoding() FeatureSet_RepeatedFieldEncoding { + if x != nil && x.RepeatedFieldEncoding != nil { + return *x.RepeatedFieldEncoding + } + return FeatureSet_REPEATED_FIELD_ENCODING_UNKNOWN +} + +func (x *FeatureSet) GetUtf8Validation() FeatureSet_Utf8Validation { + if x != nil && x.Utf8Validation != nil { + return *x.Utf8Validation + } + return FeatureSet_UTF8_VALIDATION_UNKNOWN +} + +func (x *FeatureSet) GetMessageEncoding() FeatureSet_MessageEncoding { + if x != nil && x.MessageEncoding != nil { + return *x.MessageEncoding + } + return FeatureSet_MESSAGE_ENCODING_UNKNOWN +} + +func (x *FeatureSet) GetJsonFormat() FeatureSet_JsonFormat { + if x != nil && x.JsonFormat != nil { + return *x.JsonFormat + } + return FeatureSet_JSON_FORMAT_UNKNOWN +} + +// A compiled specification for the defaults of a set of features. These +// messages are generated from FeatureSet extensions and can be used to seed +// feature resolution. The resolution with this object becomes a simple search +// for the closest matching edition, followed by proto merges. +type FeatureSetDefaults struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Defaults []*FeatureSetDefaults_FeatureSetEditionDefault `protobuf:"bytes,1,rep,name=defaults" json:"defaults,omitempty"` + // The minimum supported edition (inclusive) when this was constructed. + // Editions before this will not have defaults. + MinimumEdition *Edition `protobuf:"varint,4,opt,name=minimum_edition,json=minimumEdition,enum=google.protobuf.Edition" json:"minimum_edition,omitempty"` + // The maximum known edition (inclusive) when this was constructed. Editions + // after this will not have reliable defaults. + MaximumEdition *Edition `protobuf:"varint,5,opt,name=maximum_edition,json=maximumEdition,enum=google.protobuf.Edition" json:"maximum_edition,omitempty"` +} + +func (x *FeatureSetDefaults) Reset() { + *x = FeatureSetDefaults{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureSetDefaults) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSetDefaults) ProtoMessage() {} + +func (x *FeatureSetDefaults) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSetDefaults.ProtoReflect.Descriptor instead. +func (*FeatureSetDefaults) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20} +} + +func (x *FeatureSetDefaults) GetDefaults() []*FeatureSetDefaults_FeatureSetEditionDefault { + if x != nil { + return x.Defaults + } + return nil +} + +func (x *FeatureSetDefaults) GetMinimumEdition() Edition { + if x != nil && x.MinimumEdition != nil { + return *x.MinimumEdition + } + return Edition_EDITION_UNKNOWN +} + +func (x *FeatureSetDefaults) GetMaximumEdition() Edition { + if x != nil && x.MaximumEdition != nil { + return *x.MaximumEdition + } + return Edition_EDITION_UNKNOWN +} + // Encapsulates information about the original source file from which a // FileDescriptorProto was generated. type SourceCodeInfo struct { @@ -2855,7 +3561,7 @@ type SourceCodeInfo struct { func (x *SourceCodeInfo) Reset() { *x = SourceCodeInfo{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + mi := &file_google_protobuf_descriptor_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2868,7 +3574,7 @@ func (x *SourceCodeInfo) String() string { func (*SourceCodeInfo) ProtoMessage() {} func (x *SourceCodeInfo) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[19] + mi := &file_google_protobuf_descriptor_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2881,7 +3587,7 @@ func (x *SourceCodeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SourceCodeInfo.ProtoReflect.Descriptor instead. func (*SourceCodeInfo) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{21} } func (x *SourceCodeInfo) GetLocation() []*SourceCodeInfo_Location { @@ -2907,7 +3613,7 @@ type GeneratedCodeInfo struct { func (x *GeneratedCodeInfo) Reset() { *x = GeneratedCodeInfo{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + mi := &file_google_protobuf_descriptor_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2920,7 +3626,7 @@ func (x *GeneratedCodeInfo) String() string { func (*GeneratedCodeInfo) ProtoMessage() {} func (x *GeneratedCodeInfo) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[20] + mi := &file_google_protobuf_descriptor_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2933,7 +3639,7 @@ func (x *GeneratedCodeInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use GeneratedCodeInfo.ProtoReflect.Descriptor instead. func (*GeneratedCodeInfo) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22} } func (x *GeneratedCodeInfo) GetAnnotation() []*GeneratedCodeInfo_Annotation { @@ -2956,7 +3662,7 @@ type DescriptorProto_ExtensionRange struct { func (x *DescriptorProto_ExtensionRange) Reset() { *x = DescriptorProto_ExtensionRange{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[21] + mi := &file_google_protobuf_descriptor_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2969,7 +3675,7 @@ func (x *DescriptorProto_ExtensionRange) String() string { func (*DescriptorProto_ExtensionRange) ProtoMessage() {} func (x *DescriptorProto_ExtensionRange) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[21] + mi := &file_google_protobuf_descriptor_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3021,7 +3727,7 @@ type DescriptorProto_ReservedRange struct { func (x *DescriptorProto_ReservedRange) Reset() { *x = DescriptorProto_ReservedRange{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[22] + mi := &file_google_protobuf_descriptor_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3034,7 +3740,7 @@ func (x *DescriptorProto_ReservedRange) String() string { func (*DescriptorProto_ReservedRange) ProtoMessage() {} func (x *DescriptorProto_ReservedRange) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[22] + mi := &file_google_protobuf_descriptor_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3078,10 +3784,6 @@ type ExtensionRangeOptions_Declaration struct { // Metadata.type, Declaration.type must have a leading dot for messages // and enums. Type *string `protobuf:"bytes,3,opt,name=type" json:"type,omitempty"` - // Deprecated. Please use "repeated". - // - // Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. - IsRepeated *bool `protobuf:"varint,4,opt,name=is_repeated,json=isRepeated" json:"is_repeated,omitempty"` // If true, indicates that the number is reserved in the extension range, // and any extension field with the number will fail to compile. Set this // when a declared extension field is deleted. @@ -3094,7 +3796,7 @@ type ExtensionRangeOptions_Declaration struct { func (x *ExtensionRangeOptions_Declaration) Reset() { *x = ExtensionRangeOptions_Declaration{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[23] + mi := &file_google_protobuf_descriptor_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3107,7 +3809,7 @@ func (x *ExtensionRangeOptions_Declaration) String() string { func (*ExtensionRangeOptions_Declaration) ProtoMessage() {} func (x *ExtensionRangeOptions_Declaration) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[23] + mi := &file_google_protobuf_descriptor_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3144,14 +3846,6 @@ func (x *ExtensionRangeOptions_Declaration) GetType() string { return "" } -// Deprecated: Marked as deprecated in google/protobuf/descriptor.proto. -func (x *ExtensionRangeOptions_Declaration) GetIsRepeated() bool { - if x != nil && x.IsRepeated != nil { - return *x.IsRepeated - } - return false -} - func (x *ExtensionRangeOptions_Declaration) GetReserved() bool { if x != nil && x.Reserved != nil { return *x.Reserved @@ -3184,7 +3878,7 @@ type EnumDescriptorProto_EnumReservedRange struct { func (x *EnumDescriptorProto_EnumReservedRange) Reset() { *x = EnumDescriptorProto_EnumReservedRange{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[24] + mi := &file_google_protobuf_descriptor_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3197,7 +3891,7 @@ func (x *EnumDescriptorProto_EnumReservedRange) String() string { func (*EnumDescriptorProto_EnumReservedRange) ProtoMessage() {} func (x *EnumDescriptorProto_EnumReservedRange) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[24] + mi := &file_google_protobuf_descriptor_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3227,6 +3921,61 @@ func (x *EnumDescriptorProto_EnumReservedRange) GetEnd() int32 { return 0 } +type FieldOptions_EditionDefault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` + Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` // Textproto value. +} + +func (x *FieldOptions_EditionDefault) Reset() { + *x = FieldOptions_EditionDefault{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FieldOptions_EditionDefault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FieldOptions_EditionDefault) ProtoMessage() {} + +func (x *FieldOptions_EditionDefault) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FieldOptions_EditionDefault.ProtoReflect.Descriptor instead. +func (*FieldOptions_EditionDefault) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{12, 0} +} + +func (x *FieldOptions_EditionDefault) GetEdition() Edition { + if x != nil && x.Edition != nil { + return *x.Edition + } + return Edition_EDITION_UNKNOWN +} + +func (x *FieldOptions_EditionDefault) GetValue() string { + if x != nil && x.Value != nil { + return *x.Value + } + return "" +} + // The name of the uninterpreted option. Each string represents a segment in // a dot-separated name. is_extension is true iff a segment represents an // extension (denoted with parentheses in options specs in .proto files). @@ -3244,7 +3993,7 @@ type UninterpretedOption_NamePart struct { func (x *UninterpretedOption_NamePart) Reset() { *x = UninterpretedOption_NamePart{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[25] + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3257,7 +4006,7 @@ func (x *UninterpretedOption_NamePart) String() string { func (*UninterpretedOption_NamePart) ProtoMessage() {} func (x *UninterpretedOption_NamePart) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[25] + mi := &file_google_protobuf_descriptor_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3287,6 +4036,65 @@ func (x *UninterpretedOption_NamePart) GetIsExtension() bool { return false } +// A map from every known edition with a unique set of defaults to its +// defaults. Not all editions may be contained here. For a given edition, +// the defaults at the closest matching edition ordered at or before it should +// be used. This field must be in strict ascending order by edition. +type FeatureSetDefaults_FeatureSetEditionDefault struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Edition *Edition `protobuf:"varint,3,opt,name=edition,enum=google.protobuf.Edition" json:"edition,omitempty"` + Features *FeatureSet `protobuf:"bytes,2,opt,name=features" json:"features,omitempty"` +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) Reset() { + *x = FeatureSetDefaults_FeatureSetEditionDefault{} + if protoimpl.UnsafeEnabled { + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FeatureSetDefaults_FeatureSetEditionDefault) ProtoMessage() {} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) ProtoReflect() protoreflect.Message { + mi := &file_google_protobuf_descriptor_proto_msgTypes[29] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FeatureSetDefaults_FeatureSetEditionDefault.ProtoReflect.Descriptor instead. +func (*FeatureSetDefaults_FeatureSetEditionDefault) Descriptor() ([]byte, []int) { + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20, 0} +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetEdition() Edition { + if x != nil && x.Edition != nil { + return *x.Edition + } + return Edition_EDITION_UNKNOWN +} + +func (x *FeatureSetDefaults_FeatureSetEditionDefault) GetFeatures() *FeatureSet { + if x != nil { + return x.Features + } + return nil +} + type SourceCodeInfo_Location struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3388,7 +4196,7 @@ type SourceCodeInfo_Location struct { func (x *SourceCodeInfo_Location) Reset() { *x = SourceCodeInfo_Location{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[26] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3401,7 +4209,7 @@ func (x *SourceCodeInfo_Location) String() string { func (*SourceCodeInfo_Location) ProtoMessage() {} func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[26] + mi := &file_google_protobuf_descriptor_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3414,7 +4222,7 @@ func (x *SourceCodeInfo_Location) ProtoReflect() protoreflect.Message { // Deprecated: Use SourceCodeInfo_Location.ProtoReflect.Descriptor instead. func (*SourceCodeInfo_Location) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{19, 0} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{21, 0} } func (x *SourceCodeInfo_Location) GetPath() []int32 { @@ -3475,7 +4283,7 @@ type GeneratedCodeInfo_Annotation struct { func (x *GeneratedCodeInfo_Annotation) Reset() { *x = GeneratedCodeInfo_Annotation{} if protoimpl.UnsafeEnabled { - mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3488,7 +4296,7 @@ func (x *GeneratedCodeInfo_Annotation) String() string { func (*GeneratedCodeInfo_Annotation) ProtoMessage() {} func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { - mi := &file_google_protobuf_descriptor_proto_msgTypes[27] + mi := &file_google_protobuf_descriptor_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3501,7 +4309,7 @@ func (x *GeneratedCodeInfo_Annotation) ProtoReflect() protoreflect.Message { // Deprecated: Use GeneratedCodeInfo_Annotation.ProtoReflect.Descriptor instead. func (*GeneratedCodeInfo_Annotation) Descriptor() ([]byte, []int) { - return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{20, 0} + return file_google_protobuf_descriptor_proto_rawDescGZIP(), []int{22, 0} } func (x *GeneratedCodeInfo_Annotation) GetPath() []int32 { @@ -3550,7 +4358,7 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x04, 0x66, 0x69, - 0x6c, 0x65, 0x22, 0xfe, 0x04, 0x0a, 0x13, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, + 0x6c, 0x65, 0x22, 0x98, 0x05, 0x0a, 0x13, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, @@ -3588,527 +4396,687 @@ var file_google_protobuf_descriptor_proto_rawDesc = []byte{ 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x18, 0x0c, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x64, 0x69, - 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, - 0x69, 0x6f, 0x6e, 0x22, 0xb9, 0x06, 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x52, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, - 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x0a, 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x41, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, - 0x79, 0x70, 0x65, 0x12, 0x58, 0x0a, 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0e, 0x65, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x44, 0x0a, - 0x0a, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x44, - 0x65, 0x63, 0x6c, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x55, - 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, - 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x7a, 0x0a, 0x0e, 0x45, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, - 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, - 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x03, 0x65, 0x6e, 0x64, 0x12, 0x40, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x37, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, - 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, - 0xad, 0x04, 0x0a, 0x15, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, - 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, 0x0b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0x88, 0x01, - 0x02, 0x52, 0x0b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x68, - 0x0a, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, - 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x56, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x0a, - 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xb3, 0x01, 0x0a, 0x0b, 0x44, 0x65, 0x63, - 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, - 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x23, 0x0a, 0x0b, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, - 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x22, 0x34, - 0x0a, 0x11, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, - 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x45, 0x43, 0x4c, 0x41, 0x52, 0x41, 0x54, 0x49, - 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x01, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, - 0xc1, 0x06, 0x0a, 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x61, 0x62, 0x65, 0x6c, - 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x09, 0x52, 0x06, 0x73, 0x79, 0x6e, 0x74, 0x61, 0x78, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0xb9, 0x06, + 0x0a, 0x0f, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x05, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x05, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x12, 0x43, 0x0a, 0x09, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, + 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x54, 0x79, 0x70, - 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, 0x79, 0x70, 0x65, 0x5f, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, - 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x64, 0x65, 0x65, - 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x5f, 0x69, - 0x6e, 0x64, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x6f, 0x6e, 0x65, 0x6f, - 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, 0x73, 0x6f, 0x6e, 0x4e, - 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x27, 0x0a, 0x0f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x18, - 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0xb6, 0x02, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0f, - 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, 0x45, 0x10, 0x01, 0x12, - 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, 0x54, 0x10, 0x02, 0x12, - 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x03, 0x12, - 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x04, - 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x05, - 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, - 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, 0x45, 0x44, - 0x33, 0x32, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x4f, 0x4f, - 0x4c, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x52, 0x49, - 0x4e, 0x47, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x47, 0x52, 0x4f, - 0x55, 0x50, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, - 0x53, 0x41, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, - 0x59, 0x54, 0x45, 0x53, 0x10, 0x0c, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, - 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, - 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x0f, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x10, 0x12, 0x0f, 0x0a, 0x0b, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x11, 0x12, 0x0f, 0x0a, - 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x36, 0x34, 0x10, 0x12, 0x22, 0x43, - 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, - 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x4c, - 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x12, - 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, - 0x44, 0x10, 0x03, 0x22, 0x63, 0x0a, 0x14, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, - 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xe3, 0x02, 0x0a, 0x13, 0x45, 0x6e, 0x75, - 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x05, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5d, 0x0a, - 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, - 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x6e, 0x75, 0x6d, - 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0d, 0x72, - 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, - 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x4e, 0x61, 0x6d, - 0x65, 0x1a, 0x3b, 0x0a, 0x11, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x09, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0b, 0x6e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x0a, + 0x6e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x41, 0x0a, 0x09, 0x65, 0x6e, + 0x75, 0x6d, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x58, 0x0a, + 0x0f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, + 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x0e, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, + 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x44, 0x0a, 0x0a, 0x6f, 0x6e, 0x65, 0x6f, 0x66, + 0x5f, 0x64, 0x65, 0x63, 0x6c, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, + 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x52, 0x09, 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x63, 0x6c, 0x12, 0x39, 0x0a, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x55, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, + 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, + 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x0a, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, + 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x7a, 0x0a, 0x0e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, + 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, - 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0x83, - 0x01, 0x0a, 0x18, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x40, + 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x1a, 0x37, 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x22, 0xc7, 0x04, 0x0a, 0x15, 0x45, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, + 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x59, 0x0a, + 0x0b, 0x64, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x61, + 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x6c, 0x61, + 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x03, 0x88, 0x01, 0x02, 0x52, 0x0b, 0x64, 0x65, 0x63, + 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x18, 0x32, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, + 0x73, 0x12, 0x68, 0x0a, 0x0c, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x38, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, + 0x65, 0x3a, 0x0a, 0x55, 0x4e, 0x56, 0x45, 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x52, 0x0c, 0x76, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0x94, 0x01, 0x0a, 0x0b, + 0x44, 0x65, 0x63, 0x6c, 0x61, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x6e, + 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x66, 0x75, 0x6c, 0x6c, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x75, 0x6c, 0x6c, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x4a, 0x04, 0x08, 0x04, + 0x10, 0x05, 0x22, 0x34, 0x0a, 0x11, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x44, 0x45, 0x43, 0x4c, 0x41, + 0x52, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x4e, 0x56, 0x45, + 0x52, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x01, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, + 0x80, 0x80, 0x02, 0x22, 0xc1, 0x06, 0x0a, 0x14, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x05, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x44, + 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, + 0x61, 0x62, 0x65, 0x6c, 0x52, 0x05, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x3e, 0x0a, 0x04, 0x74, + 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, + 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, + 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x74, + 0x79, 0x70, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x74, 0x79, 0x70, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x78, 0x74, 0x65, + 0x6e, 0x64, 0x65, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x64, 0x65, 0x66, + 0x61, 0x75, 0x6c, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x6e, 0x65, + 0x6f, 0x66, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x6f, 0x6e, 0x65, 0x6f, 0x66, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x1b, 0x0a, 0x09, 0x6a, 0x73, + 0x6f, 0x6e, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6a, + 0x73, 0x6f, 0x6e, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x12, 0x27, 0x0a, 0x0f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x61, 0x6c, 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x22, 0xb6, 0x02, 0x0a, 0x04, 0x54, 0x79, + 0x70, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x44, 0x4f, 0x55, 0x42, 0x4c, + 0x45, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x4c, 0x4f, 0x41, + 0x54, 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, 0x36, + 0x34, 0x10, 0x03, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, + 0x36, 0x34, 0x10, 0x04, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x54, + 0x33, 0x32, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x58, + 0x45, 0x44, 0x36, 0x34, 0x10, 0x06, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, + 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x07, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x42, 0x4f, 0x4f, 0x4c, 0x10, 0x08, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x09, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x47, 0x52, 0x4f, 0x55, 0x50, 0x10, 0x0a, 0x12, 0x10, 0x0a, 0x0c, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x0b, 0x12, 0x0e, 0x0a, 0x0a, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x53, 0x10, 0x0c, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, 0x0d, 0x12, 0x0d, 0x0a, 0x09, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x0e, 0x12, 0x11, 0x0a, 0x0d, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x33, 0x32, 0x10, 0x0f, 0x12, 0x11, 0x0a, + 0x0d, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x46, 0x49, 0x58, 0x45, 0x44, 0x36, 0x34, 0x10, 0x10, + 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x33, 0x32, 0x10, + 0x11, 0x12, 0x0f, 0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x49, 0x4e, 0x54, 0x36, 0x34, + 0x10, 0x12, 0x22, 0x43, 0x0a, 0x05, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x0e, 0x4c, + 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x41, 0x4c, 0x10, 0x01, 0x12, + 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, 0x45, + 0x44, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x4c, 0x41, 0x42, 0x45, 0x4c, 0x5f, 0x52, 0x45, 0x51, + 0x55, 0x49, 0x52, 0x45, 0x44, 0x10, 0x02, 0x22, 0x63, 0x0a, 0x14, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x06, 0x6d, 0x65, 0x74, - 0x68, 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x89, - 0x02, 0x0a, 0x15, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x38, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, + 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xe3, 0x02, 0x0a, + 0x13, 0x45, 0x6e, 0x75, 0x6d, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3f, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, + 0x74, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, + 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x5d, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x72, 0x61, + 0x6e, 0x67, 0x65, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x2e, + 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, + 0x65, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, + 0x12, 0x23, 0x0a, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x64, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, + 0x64, 0x4e, 0x61, 0x6d, 0x65, 0x1a, 0x3b, 0x0a, 0x11, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x65, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x64, 0x52, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x74, + 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x73, 0x74, 0x61, 0x72, 0x74, + 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, + 0x6e, 0x64, 0x22, 0x83, 0x01, 0x0a, 0x18, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, + 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, + 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa7, 0x01, 0x0a, 0x16, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, + 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x52, + 0x06, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x39, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, + 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x22, 0x89, 0x02, 0x0a, 0x15, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1f, 0x0a, 0x0b, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x38, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x1e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x10, 0x63, 0x6c, + 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x0a, 0x10, + 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x73, + 0x65, 0x72, 0x76, 0x65, 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x22, 0xca, + 0x09, 0x0a, 0x0b, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, + 0x0a, 0x0c, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6a, 0x61, 0x76, 0x61, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, + 0x65, 0x12, 0x30, 0x0a, 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, + 0x63, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x12, 0x6a, 0x61, 0x76, 0x61, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x6e, + 0x61, 0x6d, 0x65, 0x12, 0x35, 0x0a, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, + 0x69, 0x70, 0x6c, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x11, 0x6a, 0x61, 0x76, 0x61, 0x4d, 0x75, 0x6c, + 0x74, 0x69, 0x70, 0x6c, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x6a, 0x61, + 0x76, 0x61, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, + 0x6c, 0x73, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x14, 0x20, 0x01, 0x28, + 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x19, 0x6a, 0x61, 0x76, 0x61, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x61, 0x74, 0x65, 0x45, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, + 0x12, 0x3a, 0x0a, 0x16, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, + 0x63, 0x68, 0x65, 0x63, 0x6b, 0x5f, 0x75, 0x74, 0x66, 0x38, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x55, 0x74, 0x66, 0x38, 0x12, 0x53, 0x0a, 0x0c, + 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x3a, 0x05, 0x53, + 0x50, 0x45, 0x45, 0x44, 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, + 0x72, 0x12, 0x1d, 0x0a, 0x0a, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, + 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x67, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, + 0x12, 0x35, 0x0a, 0x13, 0x63, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, + 0x61, 0x6c, 0x73, 0x65, 0x52, 0x11, 0x63, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x15, 0x6a, 0x61, 0x76, 0x61, 0x5f, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, + 0x18, 0x11, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, + 0x61, 0x76, 0x61, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x35, 0x0a, 0x13, 0x70, 0x79, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, + 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x3a, + 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x11, 0x70, 0x79, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x14, 0x70, 0x68, 0x70, + 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x73, 0x18, 0x2a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x12, + 0x70, 0x68, 0x70, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, + 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x17, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x63, 0x5f, + 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x18, 0x1f, 0x20, + 0x01, 0x28, 0x08, 0x3a, 0x04, 0x74, 0x72, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x63, 0x45, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x41, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x62, 0x6a, + 0x63, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x24, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x63, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x50, + 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x0f, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, + 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, + 0x18, 0x27, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x77, 0x69, 0x66, 0x74, 0x50, 0x72, 0x65, + 0x66, 0x69, 0x78, 0x12, 0x28, 0x0a, 0x10, 0x70, 0x68, 0x70, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, + 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x28, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, + 0x68, 0x70, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x23, 0x0a, + 0x0d, 0x70, 0x68, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x29, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x68, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, + 0x63, 0x65, 0x12, 0x34, 0x0a, 0x16, 0x70, 0x68, 0x70, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x2c, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x14, 0x70, 0x68, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4e, + 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x62, 0x79, + 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x72, 0x75, 0x62, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x37, 0x0a, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x32, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x30, 0x0a, 0x10, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, - 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, - 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x12, 0x30, 0x0a, 0x10, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x5f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x69, 0x6e, 0x67, 0x22, 0x91, 0x09, 0x0a, 0x0b, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x6a, 0x61, - 0x76, 0x61, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x6a, 0x61, 0x76, 0x61, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, - 0x14, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6f, 0x75, 0x74, 0x65, 0x72, 0x5f, 0x63, 0x6c, 0x61, 0x73, - 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x6a, 0x61, 0x76, - 0x61, 0x4f, 0x75, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x35, 0x0a, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, - 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x52, 0x11, 0x6a, 0x61, 0x76, 0x61, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, - 0x65, 0x46, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x44, 0x0a, 0x1d, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x73, 0x5f, 0x61, - 0x6e, 0x64, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x14, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, - 0x01, 0x52, 0x19, 0x6a, 0x61, 0x76, 0x61, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x45, - 0x71, 0x75, 0x61, 0x6c, 0x73, 0x41, 0x6e, 0x64, 0x48, 0x61, 0x73, 0x68, 0x12, 0x3a, 0x0a, 0x16, - 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x68, 0x65, 0x63, - 0x6b, 0x5f, 0x75, 0x74, 0x66, 0x38, 0x18, 0x1b, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x43, - 0x68, 0x65, 0x63, 0x6b, 0x55, 0x74, 0x66, 0x38, 0x12, 0x53, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x69, 0x7a, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x29, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, - 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x3a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44, - 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x46, 0x6f, 0x72, 0x12, 0x1d, 0x0a, - 0x0a, 0x67, 0x6f, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x09, 0x67, 0x6f, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x35, 0x0a, 0x13, - 0x63, 0x63, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, - 0x52, 0x11, 0x63, 0x63, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x15, 0x6a, 0x61, 0x76, 0x61, 0x5f, 0x67, 0x65, 0x6e, 0x65, - 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x13, 0x6a, 0x61, 0x76, 0x61, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x35, - 0x0a, 0x13, 0x70, 0x79, 0x5f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x12, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, - 0x73, 0x65, 0x52, 0x11, 0x70, 0x79, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x37, 0x0a, 0x14, 0x70, 0x68, 0x70, 0x5f, 0x67, 0x65, 0x6e, - 0x65, 0x72, 0x69, 0x63, 0x5f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x18, 0x2a, 0x20, - 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x12, 0x70, 0x68, 0x70, 0x47, - 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x73, 0x12, 0x25, - 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x17, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, - 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x63, 0x5f, 0x65, 0x6e, 0x61, 0x62, - 0x6c, 0x65, 0x5f, 0x61, 0x72, 0x65, 0x6e, 0x61, 0x73, 0x18, 0x1f, 0x20, 0x01, 0x28, 0x08, 0x3a, - 0x04, 0x74, 0x72, 0x75, 0x65, 0x52, 0x0e, 0x63, 0x63, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x41, - 0x72, 0x65, 0x6e, 0x61, 0x73, 0x12, 0x2a, 0x0a, 0x11, 0x6f, 0x62, 0x6a, 0x63, 0x5f, 0x63, 0x6c, - 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x24, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0f, 0x6f, 0x62, 0x6a, 0x63, 0x43, 0x6c, 0x61, 0x73, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, - 0x78, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x73, 0x68, 0x61, 0x72, 0x70, 0x5f, 0x6e, 0x61, 0x6d, 0x65, - 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x25, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x63, 0x73, 0x68, - 0x61, 0x72, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x77, 0x69, 0x66, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x18, 0x27, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0b, 0x73, 0x77, 0x69, 0x66, 0x74, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, - 0x28, 0x0a, 0x10, 0x70, 0x68, 0x70, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x18, 0x28, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x70, 0x68, 0x70, 0x43, 0x6c, - 0x61, 0x73, 0x73, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x12, 0x23, 0x0a, 0x0d, 0x70, 0x68, 0x70, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x29, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x70, 0x68, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x12, 0x34, - 0x0a, 0x16, 0x70, 0x68, 0x70, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x18, 0x2c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, - 0x70, 0x68, 0x70, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x4e, 0x61, 0x6d, 0x65, 0x73, - 0x70, 0x61, 0x63, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x72, 0x75, 0x62, 0x79, 0x5f, 0x70, 0x61, 0x63, - 0x6b, 0x61, 0x67, 0x65, 0x18, 0x2d, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x72, 0x75, 0x62, 0x79, - 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, - 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, - 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x22, 0x3a, 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, - 0x65, 0x12, 0x09, 0x0a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, - 0x43, 0x4f, 0x44, 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4c, - 0x49, 0x54, 0x45, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x09, 0x08, - 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x22, 0xbb, - 0x03, 0x0a, 0x0e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x12, 0x3c, 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, - 0x5f, 0x77, 0x69, 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x53, 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, - 0x4c, 0x0a, 0x1f, 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, - 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, - 0x1c, 0x6e, 0x6f, 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, - 0x69, 0x70, 0x74, 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x25, 0x0a, - 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, - 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, - 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, - 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, 0x10, 0x0a, 0x22, 0x85, 0x09, 0x0a, - 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, - 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, - 0x65, 0x3a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x52, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x47, 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, - 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x52, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, - 0x65, 0x12, 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, - 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, - 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, - 0x0f, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, - 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4c, 0x61, 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, - 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, - 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, - 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, - 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, - 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, - 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x4b, 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, - 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, - 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4a, 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, - 0x12, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x54, 0x79, 0x70, 0x65, 0x42, 0x02, 0x18, 0x01, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, - 0x74, 0x12, 0x48, 0x0a, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, 0x20, 0x03, - 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, - 0x70, 0x65, 0x52, 0x07, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, - 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x2f, 0x0a, 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, - 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, - 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, - 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x35, 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, - 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, - 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, - 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, - 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, - 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, - 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, - 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, - 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, 0x02, 0x0a, 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, - 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, - 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, - 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, - 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, - 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, - 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, - 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, 0x12, 0x1a, 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, - 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, - 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, - 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, - 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, - 0x08, 0x04, 0x10, 0x05, 0x22, 0x73, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, + 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, - 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x98, 0x02, 0x0a, 0x0b, 0x45, 0x6e, - 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, - 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, - 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3a, + 0x0a, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x7a, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x12, 0x09, + 0x0a, 0x05, 0x53, 0x50, 0x45, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x44, + 0x45, 0x5f, 0x53, 0x49, 0x5a, 0x45, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x4c, 0x49, 0x54, 0x45, + 0x5f, 0x52, 0x55, 0x4e, 0x54, 0x49, 0x4d, 0x45, 0x10, 0x03, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, + 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x26, 0x10, 0x27, 0x22, 0xf4, 0x03, 0x0a, 0x0e, + 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3c, + 0x0a, 0x17, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x65, 0x74, 0x5f, 0x77, 0x69, + 0x72, 0x65, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, + 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x14, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x53, + 0x65, 0x74, 0x57, 0x69, 0x72, 0x65, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x4c, 0x0a, 0x1f, + 0x6e, 0x6f, 0x5f, 0x73, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x5f, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x5f, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x1c, 0x6e, 0x6f, + 0x53, 0x74, 0x61, 0x6e, 0x64, 0x61, 0x72, 0x64, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x6f, 0x72, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, - 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, - 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, - 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, - 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, - 0x08, 0x05, 0x10, 0x06, 0x22, 0x9e, 0x01, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, - 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, - 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, - 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, - 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, - 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, - 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9c, 0x01, 0x0a, 0x0e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, - 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, - 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, + 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x61, 0x70, 0x5f, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6d, 0x61, 0x70, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x56, + 0x0a, 0x26, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, + 0x61, 0x63, 0x79, 0x5f, 0x6a, 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, + 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, + 0x18, 0x01, 0x52, 0x22, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, + 0x66, 0x6c, 0x69, 0x63, 0x74, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, + 0x65, 0x73, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, - 0x80, 0x80, 0x80, 0x02, 0x22, 0xe0, 0x02, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, - 0x61, 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, - 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, - 0x11, 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, - 0x65, 0x6c, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, - 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, - 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, - 0x4f, 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, - 0x69, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, - 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, - 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, - 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x50, 0x0a, 0x10, 0x49, 0x64, - 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, - 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, - 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x4f, 0x5f, 0x53, 0x49, - 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, - 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, - 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9a, 0x03, 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6e, - 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, - 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x05, 0x10, 0x06, + 0x4a, 0x04, 0x08, 0x06, 0x10, 0x07, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x4a, 0x04, 0x08, 0x09, + 0x10, 0x0a, 0x22, 0xad, 0x0a, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x41, 0x0a, 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x2e, 0x43, 0x54, 0x79, 0x70, 0x65, 0x3a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x52, + 0x05, 0x63, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x70, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x12, 0x47, + 0x0a, 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4a, 0x53, + 0x54, 0x79, 0x70, 0x65, 0x3a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x52, + 0x06, 0x6a, 0x73, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x04, 0x6c, 0x61, 0x7a, 0x79, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, 0x6c, 0x61, + 0x7a, 0x79, 0x12, 0x2e, 0x0a, 0x0f, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, + 0x5f, 0x6c, 0x61, 0x7a, 0x79, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, + 0x73, 0x65, 0x52, 0x0e, 0x75, 0x6e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x4c, 0x61, + 0x7a, 0x79, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x77, 0x65, 0x61, + 0x6b, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x04, + 0x77, 0x65, 0x61, 0x6b, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, + 0x64, 0x61, 0x63, 0x74, 0x18, 0x10, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, + 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, 0x64, 0x61, 0x63, 0x74, 0x12, 0x4b, + 0x0a, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x11, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x2e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x09, 0x72, 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x48, 0x0a, 0x07, 0x74, + 0x61, 0x72, 0x67, 0x65, 0x74, 0x73, 0x18, 0x13, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, + 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x07, 0x74, 0x61, + 0x72, 0x67, 0x65, 0x74, 0x73, 0x12, 0x57, 0x0a, 0x10, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x14, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x2c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x45, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x52, 0x0f, 0x65, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x37, + 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x15, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, + 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, + 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x1a, 0x5a, 0x0a, 0x0e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, + 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, + 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x2f, 0x0a, + 0x05, 0x43, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, + 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x4f, 0x52, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, + 0x53, 0x54, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x49, 0x45, 0x43, 0x45, 0x10, 0x02, 0x22, 0x35, + 0x0a, 0x06, 0x4a, 0x53, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, + 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x53, 0x54, + 0x52, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x4a, 0x53, 0x5f, 0x4e, 0x55, 0x4d, + 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0x55, 0x0a, 0x0f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x74, 0x65, 0x6e, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, + 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, + 0x15, 0x0a, 0x11, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x55, 0x4e, + 0x54, 0x49, 0x4d, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x45, 0x54, 0x45, 0x4e, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x10, 0x02, 0x22, 0x8c, 0x02, 0x0a, + 0x10, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, + 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x4c, 0x45, 0x10, 0x01, + 0x12, 0x1f, 0x0a, 0x1b, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x45, 0x58, 0x54, 0x45, 0x4e, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x41, 0x4e, 0x47, 0x45, 0x10, + 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, + 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x10, + 0x04, 0x12, 0x15, 0x0a, 0x11, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, + 0x5f, 0x4f, 0x4e, 0x45, 0x4f, 0x46, 0x10, 0x05, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x41, 0x52, 0x47, + 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, 0x55, 0x4d, 0x10, 0x06, 0x12, 0x1a, + 0x0a, 0x16, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x4e, + 0x55, 0x4d, 0x5f, 0x45, 0x4e, 0x54, 0x52, 0x59, 0x10, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x41, + 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, + 0x45, 0x10, 0x08, 0x12, 0x16, 0x0a, 0x12, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x4d, 0x45, 0x54, 0x48, 0x4f, 0x44, 0x10, 0x09, 0x2a, 0x09, 0x08, 0xe8, 0x07, + 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, 0x04, 0x08, 0x04, 0x10, 0x05, 0x4a, 0x04, 0x08, 0x12, + 0x10, 0x13, 0x22, 0xac, 0x01, 0x0a, 0x0c, 0x4f, 0x6e, 0x65, 0x6f, 0x66, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, + 0x02, 0x22, 0xd1, 0x02, 0x0a, 0x0b, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x61, 0x6c, 0x69, 0x61, 0x73, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x6c, 0x69, + 0x61, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x56, 0x0a, 0x26, 0x64, 0x65, 0x70, + 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x6a, + 0x73, 0x6f, 0x6e, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x6c, 0x69, + 0x63, 0x74, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x42, 0x02, 0x18, 0x01, 0x52, 0x22, 0x64, + 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x4a, + 0x73, 0x6f, 0x6e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x43, 0x6f, 0x6e, 0x66, 0x6c, 0x69, 0x63, 0x74, + 0x73, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x07, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, + 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x4a, + 0x04, 0x08, 0x05, 0x10, 0x06, 0x22, 0x81, 0x02, 0x0a, 0x10, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, + 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, + 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x28, 0x0a, 0x0c, 0x64, 0x65, + 0x62, 0x75, 0x67, 0x5f, 0x72, 0x65, 0x64, 0x61, 0x63, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, + 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x52, 0x65, + 0x64, 0x61, 0x63, 0x74, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, + 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, + 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0xd5, 0x01, 0x0a, 0x0e, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x37, 0x0a, 0x08, + 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x22, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, + 0x74, 0x65, 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, + 0x52, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x58, 0x0a, 0x14, + 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, + 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, + 0x02, 0x22, 0x99, 0x03, 0x0a, 0x0d, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x12, 0x25, 0x0a, 0x0a, 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, + 0x64, 0x18, 0x21, 0x20, 0x01, 0x28, 0x08, 0x3a, 0x05, 0x66, 0x61, 0x6c, 0x73, 0x65, 0x52, 0x0a, + 0x64, 0x65, 0x70, 0x72, 0x65, 0x63, 0x61, 0x74, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x11, 0x69, 0x64, + 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, + 0x22, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x4f, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, + 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x3a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, + 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x52, 0x10, 0x69, 0x64, 0x65, + 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x37, 0x0a, + 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x23, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x52, 0x08, 0x66, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x12, 0x58, 0x0a, 0x14, 0x75, 0x6e, 0x69, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0xe7, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x13, 0x75, 0x6e, 0x69, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0x50, 0x0a, 0x10, 0x49, 0x64, 0x65, 0x6d, 0x70, 0x6f, 0x74, 0x65, 0x6e, 0x63, 0x79, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x12, 0x17, 0x0a, 0x13, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, + 0x4e, 0x43, 0x59, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, + 0x0f, 0x4e, 0x4f, 0x5f, 0x53, 0x49, 0x44, 0x45, 0x5f, 0x45, 0x46, 0x46, 0x45, 0x43, 0x54, 0x53, + 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x49, 0x44, 0x45, 0x4d, 0x50, 0x4f, 0x54, 0x45, 0x4e, 0x54, + 0x10, 0x02, 0x2a, 0x09, 0x08, 0xe8, 0x07, 0x10, 0x80, 0x80, 0x80, 0x80, 0x02, 0x22, 0x9a, 0x03, + 0x0a, 0x13, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, + 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, + 0x72, 0x74, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, + 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, + 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x10, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, + 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, + 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, + 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, + 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, + 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, + 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x4a, + 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x61, + 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x6e, + 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x78, + 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, 0x0b, 0x69, + 0x73, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xfc, 0x09, 0x0a, 0x0a, 0x46, + 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x12, 0x8b, 0x01, 0x0a, 0x0e, 0x66, 0x69, + 0x65, 0x6c, 0x64, 0x5f, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x29, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, + 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x42, 0x39, 0x88, + 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, + 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x49, 0x4d, 0x50, + 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe7, 0x07, 0xa2, 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, + 0x4c, 0x49, 0x43, 0x49, 0x54, 0x18, 0xe8, 0x07, 0x52, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x50, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x66, 0x0a, 0x09, 0x65, 0x6e, 0x75, 0x6d, 0x5f, + 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x24, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, + 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, + 0x42, 0x23, 0x88, 0x01, 0x01, 0x98, 0x01, 0x06, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x0b, 0x12, 0x06, + 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4f, 0x50, + 0x45, 0x4e, 0x18, 0xe7, 0x07, 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x92, 0x01, 0x0a, 0x17, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x66, 0x69, 0x65, + 0x6c, 0x64, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x31, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x52, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x42, 0x27, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, 0xa2, + 0x01, 0x0d, 0x12, 0x08, 0x45, 0x58, 0x50, 0x41, 0x4e, 0x44, 0x45, 0x44, 0x18, 0xe6, 0x07, 0xa2, + 0x01, 0x0b, 0x12, 0x06, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x44, 0x18, 0xe7, 0x07, 0x52, 0x15, 0x72, + 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, 0x63, 0x6f, + 0x64, 0x69, 0x6e, 0x67, 0x12, 0x78, 0x0a, 0x0f, 0x75, 0x74, 0x66, 0x38, 0x5f, 0x76, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x55, 0x6e, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x65, 0x74, 0x65, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, 0x74, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x10, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, - 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, - 0x12, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x69, 0x76, 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x6e, - 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x69, 0x6e, 0x74, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x10, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, - 0x65, 0x49, 0x6e, 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x6f, 0x75, - 0x62, 0x6c, 0x65, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, - 0x0b, 0x64, 0x6f, 0x75, 0x62, 0x6c, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x21, 0x0a, 0x0c, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x07, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, - 0x27, 0x0a, 0x0f, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x5f, 0x76, 0x61, 0x6c, - 0x75, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, - 0x61, 0x74, 0x65, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x1a, 0x4a, 0x0a, 0x08, 0x4e, 0x61, 0x6d, 0x65, - 0x50, 0x61, 0x72, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x70, 0x61, 0x72, - 0x74, 0x18, 0x01, 0x20, 0x02, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x61, 0x6d, 0x65, 0x50, 0x61, 0x72, - 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x02, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x45, 0x78, 0x74, 0x65, 0x6e, - 0x73, 0x69, 0x6f, 0x6e, 0x22, 0xa7, 0x02, 0x0a, 0x0e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, - 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, - 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xce, 0x01, - 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, - 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, - 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x65, - 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, - 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, - 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, - 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, - 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, - 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, - 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, - 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, - 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, - 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, - 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, - 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, - 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, - 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, - 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, - 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x52, 0x08, 0x73, - 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, 0x28, 0x0a, 0x08, 0x53, 0x65, 0x6d, 0x61, 0x6e, - 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, - 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x49, 0x41, 0x53, 0x10, - 0x02, 0x42, 0x7e, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, 0x2d, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2f, 0x64, - 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xa2, 0x02, - 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, 0x74, 0x69, 0x6f, - 0x6e, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x55, 0x74, 0x66, 0x38, 0x56, + 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x23, 0x88, 0x01, 0x01, 0x98, 0x01, + 0x04, 0x98, 0x01, 0x01, 0xa2, 0x01, 0x09, 0x12, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x18, 0xe6, 0x07, + 0xa2, 0x01, 0x0b, 0x12, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x18, 0xe7, 0x07, 0x52, 0x0e, + 0x75, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x78, + 0x0a, 0x10, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, + 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, + 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, + 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x42, 0x20, 0x88, 0x01, 0x01, 0x98, 0x01, 0x04, 0x98, 0x01, 0x01, + 0xa2, 0x01, 0x14, 0x12, 0x0f, 0x4c, 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, + 0x49, 0x58, 0x45, 0x44, 0x18, 0xe6, 0x07, 0x52, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x7c, 0x0a, 0x0b, 0x6a, 0x73, 0x6f, 0x6e, + 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x2e, 0x4a, 0x73, 0x6f, 0x6e, 0x46, + 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x42, 0x33, 0x88, 0x01, 0x01, 0x98, 0x01, 0x03, 0x98, 0x01, 0x06, + 0x98, 0x01, 0x01, 0xa2, 0x01, 0x17, 0x12, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, + 0x45, 0x53, 0x54, 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x18, 0xe6, 0x07, 0xa2, 0x01, 0x0a, + 0x12, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x18, 0xe7, 0x07, 0x52, 0x0a, 0x6a, 0x73, 0x6f, 0x6e, + 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x22, 0x5c, 0x0a, 0x0d, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x50, + 0x72, 0x65, 0x73, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x1a, 0x0a, 0x16, 0x46, 0x49, 0x45, 0x4c, 0x44, + 0x5f, 0x50, 0x52, 0x45, 0x53, 0x45, 0x4e, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, + 0x4e, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, + 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x49, 0x4d, 0x50, 0x4c, 0x49, 0x43, 0x49, 0x54, 0x10, 0x02, 0x12, + 0x13, 0x0a, 0x0f, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x52, 0x45, 0x51, 0x55, 0x49, 0x52, + 0x45, 0x44, 0x10, 0x03, 0x22, 0x37, 0x0a, 0x08, 0x45, 0x6e, 0x75, 0x6d, 0x54, 0x79, 0x70, 0x65, + 0x12, 0x15, 0x0a, 0x11, 0x45, 0x4e, 0x55, 0x4d, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, + 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4f, 0x50, 0x45, 0x4e, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0x10, 0x02, 0x22, 0x56, 0x0a, + 0x15, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x45, 0x6e, + 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x23, 0x0a, 0x1f, 0x52, 0x45, 0x50, 0x45, 0x41, 0x54, + 0x45, 0x44, 0x5f, 0x46, 0x49, 0x45, 0x4c, 0x44, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, + 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, + 0x41, 0x43, 0x4b, 0x45, 0x44, 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x45, 0x58, 0x50, 0x41, 0x4e, + 0x44, 0x45, 0x44, 0x10, 0x02, 0x22, 0x43, 0x0a, 0x0e, 0x55, 0x74, 0x66, 0x38, 0x56, 0x61, 0x6c, + 0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x55, 0x54, 0x46, 0x38, 0x5f, + 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, + 0x57, 0x4e, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x0a, + 0x0a, 0x06, 0x56, 0x45, 0x52, 0x49, 0x46, 0x59, 0x10, 0x02, 0x22, 0x53, 0x0a, 0x0f, 0x4d, 0x65, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x45, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x1c, 0x0a, + 0x18, 0x4d, 0x45, 0x53, 0x53, 0x41, 0x47, 0x45, 0x5f, 0x45, 0x4e, 0x43, 0x4f, 0x44, 0x49, 0x4e, + 0x47, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4c, + 0x45, 0x4e, 0x47, 0x54, 0x48, 0x5f, 0x50, 0x52, 0x45, 0x46, 0x49, 0x58, 0x45, 0x44, 0x10, 0x01, + 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x4c, 0x49, 0x4d, 0x49, 0x54, 0x45, 0x44, 0x10, 0x02, 0x22, + 0x48, 0x0a, 0x0a, 0x4a, 0x73, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x17, 0x0a, + 0x13, 0x4a, 0x53, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x4b, + 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x4c, 0x4c, 0x4f, 0x57, 0x10, + 0x01, 0x12, 0x16, 0x0a, 0x12, 0x4c, 0x45, 0x47, 0x41, 0x43, 0x59, 0x5f, 0x42, 0x45, 0x53, 0x54, + 0x5f, 0x45, 0x46, 0x46, 0x4f, 0x52, 0x54, 0x10, 0x02, 0x2a, 0x06, 0x08, 0xe8, 0x07, 0x10, 0xe9, + 0x07, 0x2a, 0x06, 0x08, 0xe9, 0x07, 0x10, 0xea, 0x07, 0x2a, 0x06, 0x08, 0x8b, 0x4e, 0x10, 0x90, + 0x4e, 0x4a, 0x06, 0x08, 0xe7, 0x07, 0x10, 0xe8, 0x07, 0x22, 0xfe, 0x02, 0x0a, 0x12, 0x46, 0x65, + 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, + 0x12, 0x58, 0x0a, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x3c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, + 0x65, 0x74, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, + 0x52, 0x08, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x41, 0x0a, 0x0f, 0x6d, 0x69, + 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0e, 0x6d, + 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, + 0x0f, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x5f, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x52, 0x0e, 0x6d, 0x61, 0x78, 0x69, 0x6d, 0x75, 0x6d, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, + 0x1a, 0x87, 0x01, 0x0a, 0x18, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, 0x45, + 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x12, 0x32, 0x0a, + 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x18, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x45, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x65, 0x64, 0x69, 0x74, 0x69, 0x6f, + 0x6e, 0x12, 0x37, 0x0a, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x53, 0x65, 0x74, + 0x52, 0x08, 0x66, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x73, 0x22, 0xa7, 0x02, 0x0a, 0x0e, 0x53, + 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x44, 0x0a, + 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2e, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, + 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x6c, 0x6f, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x1a, 0xce, 0x01, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, + 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x12, 0x16, 0x0a, 0x04, 0x73, 0x70, 0x61, 0x6e, + 0x18, 0x02, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x73, 0x70, 0x61, 0x6e, + 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x65, 0x61, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x65, 0x61, 0x64, + 0x69, 0x6e, 0x67, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x2b, 0x0a, 0x11, 0x74, + 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, 0x5f, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x74, 0x72, 0x61, 0x69, 0x6c, 0x69, 0x6e, 0x67, + 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x12, 0x3a, 0x0a, 0x19, 0x6c, 0x65, 0x61, 0x64, + 0x69, 0x6e, 0x67, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x6d, + 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x17, 0x6c, 0x65, 0x61, + 0x64, 0x69, 0x6e, 0x67, 0x44, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x64, 0x43, 0x6f, 0x6d, 0x6d, + 0x65, 0x6e, 0x74, 0x73, 0x22, 0xd0, 0x02, 0x0a, 0x11, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, + 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x4d, 0x0a, 0x0a, 0x61, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, + 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, + 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x2e, 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x1a, 0xeb, 0x01, 0x0a, 0x0a, 0x41, 0x6e, + 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x05, 0x42, 0x02, 0x10, 0x01, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, + 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x46, 0x69, 0x6c, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x05, 0x62, 0x65, 0x67, 0x69, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x6e, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x6e, 0x64, 0x12, 0x52, 0x0a, 0x08, 0x73, 0x65, 0x6d, + 0x61, 0x6e, 0x74, 0x69, 0x63, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x36, 0x2e, 0x67, 0x6f, + 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x47, 0x65, + 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x43, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, + 0x41, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, + 0x74, 0x69, 0x63, 0x52, 0x08, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x22, 0x28, 0x0a, + 0x08, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x12, 0x08, 0x0a, 0x04, 0x4e, 0x4f, 0x4e, + 0x45, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x45, 0x54, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, + 0x41, 0x4c, 0x49, 0x41, 0x53, 0x10, 0x02, 0x2a, 0xea, 0x01, 0x0a, 0x07, 0x45, 0x64, 0x69, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0e, 0x45, 0x44, 0x49, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x32, 0x10, 0xe6, 0x07, 0x12, 0x13, 0x0a, + 0x0e, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x50, 0x52, 0x4f, 0x54, 0x4f, 0x33, 0x10, + 0xe7, 0x07, 0x12, 0x11, 0x0a, 0x0c, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x30, + 0x32, 0x33, 0x10, 0xe8, 0x07, 0x12, 0x17, 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x31, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x01, 0x12, 0x17, + 0x0a, 0x13, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x32, 0x5f, 0x54, 0x45, 0x53, 0x54, + 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x37, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, + 0x4c, 0x59, 0x10, 0x9d, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, + 0x4e, 0x5f, 0x39, 0x39, 0x39, 0x39, 0x38, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, + 0x59, 0x10, 0x9e, 0x8d, 0x06, 0x12, 0x1d, 0x0a, 0x17, 0x45, 0x44, 0x49, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x39, 0x39, 0x39, 0x39, 0x39, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, + 0x10, 0x9f, 0x8d, 0x06, 0x42, 0x7e, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x10, 0x44, 0x65, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x48, 0x01, 0x5a, + 0x2d, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, + 0x72, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2f, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x70, 0x62, 0xf8, 0x01, + 0x01, 0xa2, 0x02, 0x03, 0x47, 0x50, 0x42, 0xaa, 0x02, 0x1a, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, + 0x2e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x52, 0x65, 0x66, 0x6c, 0x65, 0x63, + 0x74, 0x69, 0x6f, 0x6e, } var ( @@ -4123,103 +5091,136 @@ func file_google_protobuf_descriptor_proto_rawDescGZIP() []byte { return file_google_protobuf_descriptor_proto_rawDescData } -var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 10) -var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 28) +var file_google_protobuf_descriptor_proto_enumTypes = make([]protoimpl.EnumInfo, 17) +var file_google_protobuf_descriptor_proto_msgTypes = make([]protoimpl.MessageInfo, 32) var file_google_protobuf_descriptor_proto_goTypes = []interface{}{ - (ExtensionRangeOptions_VerificationState)(0), // 0: google.protobuf.ExtensionRangeOptions.VerificationState - (FieldDescriptorProto_Type)(0), // 1: google.protobuf.FieldDescriptorProto.Type - (FieldDescriptorProto_Label)(0), // 2: google.protobuf.FieldDescriptorProto.Label - (FileOptions_OptimizeMode)(0), // 3: google.protobuf.FileOptions.OptimizeMode - (FieldOptions_CType)(0), // 4: google.protobuf.FieldOptions.CType - (FieldOptions_JSType)(0), // 5: google.protobuf.FieldOptions.JSType - (FieldOptions_OptionRetention)(0), // 6: google.protobuf.FieldOptions.OptionRetention - (FieldOptions_OptionTargetType)(0), // 7: google.protobuf.FieldOptions.OptionTargetType - (MethodOptions_IdempotencyLevel)(0), // 8: google.protobuf.MethodOptions.IdempotencyLevel - (GeneratedCodeInfo_Annotation_Semantic)(0), // 9: google.protobuf.GeneratedCodeInfo.Annotation.Semantic - (*FileDescriptorSet)(nil), // 10: google.protobuf.FileDescriptorSet - (*FileDescriptorProto)(nil), // 11: google.protobuf.FileDescriptorProto - (*DescriptorProto)(nil), // 12: google.protobuf.DescriptorProto - (*ExtensionRangeOptions)(nil), // 13: google.protobuf.ExtensionRangeOptions - (*FieldDescriptorProto)(nil), // 14: google.protobuf.FieldDescriptorProto - (*OneofDescriptorProto)(nil), // 15: google.protobuf.OneofDescriptorProto - (*EnumDescriptorProto)(nil), // 16: google.protobuf.EnumDescriptorProto - (*EnumValueDescriptorProto)(nil), // 17: google.protobuf.EnumValueDescriptorProto - (*ServiceDescriptorProto)(nil), // 18: google.protobuf.ServiceDescriptorProto - (*MethodDescriptorProto)(nil), // 19: google.protobuf.MethodDescriptorProto - (*FileOptions)(nil), // 20: google.protobuf.FileOptions - (*MessageOptions)(nil), // 21: google.protobuf.MessageOptions - (*FieldOptions)(nil), // 22: google.protobuf.FieldOptions - (*OneofOptions)(nil), // 23: google.protobuf.OneofOptions - (*EnumOptions)(nil), // 24: google.protobuf.EnumOptions - (*EnumValueOptions)(nil), // 25: google.protobuf.EnumValueOptions - (*ServiceOptions)(nil), // 26: google.protobuf.ServiceOptions - (*MethodOptions)(nil), // 27: google.protobuf.MethodOptions - (*UninterpretedOption)(nil), // 28: google.protobuf.UninterpretedOption - (*SourceCodeInfo)(nil), // 29: google.protobuf.SourceCodeInfo - (*GeneratedCodeInfo)(nil), // 30: google.protobuf.GeneratedCodeInfo - (*DescriptorProto_ExtensionRange)(nil), // 31: google.protobuf.DescriptorProto.ExtensionRange - (*DescriptorProto_ReservedRange)(nil), // 32: google.protobuf.DescriptorProto.ReservedRange - (*ExtensionRangeOptions_Declaration)(nil), // 33: google.protobuf.ExtensionRangeOptions.Declaration - (*EnumDescriptorProto_EnumReservedRange)(nil), // 34: google.protobuf.EnumDescriptorProto.EnumReservedRange - (*UninterpretedOption_NamePart)(nil), // 35: google.protobuf.UninterpretedOption.NamePart - (*SourceCodeInfo_Location)(nil), // 36: google.protobuf.SourceCodeInfo.Location - (*GeneratedCodeInfo_Annotation)(nil), // 37: google.protobuf.GeneratedCodeInfo.Annotation + (Edition)(0), // 0: google.protobuf.Edition + (ExtensionRangeOptions_VerificationState)(0), // 1: google.protobuf.ExtensionRangeOptions.VerificationState + (FieldDescriptorProto_Type)(0), // 2: google.protobuf.FieldDescriptorProto.Type + (FieldDescriptorProto_Label)(0), // 3: google.protobuf.FieldDescriptorProto.Label + (FileOptions_OptimizeMode)(0), // 4: google.protobuf.FileOptions.OptimizeMode + (FieldOptions_CType)(0), // 5: google.protobuf.FieldOptions.CType + (FieldOptions_JSType)(0), // 6: google.protobuf.FieldOptions.JSType + (FieldOptions_OptionRetention)(0), // 7: google.protobuf.FieldOptions.OptionRetention + (FieldOptions_OptionTargetType)(0), // 8: google.protobuf.FieldOptions.OptionTargetType + (MethodOptions_IdempotencyLevel)(0), // 9: google.protobuf.MethodOptions.IdempotencyLevel + (FeatureSet_FieldPresence)(0), // 10: google.protobuf.FeatureSet.FieldPresence + (FeatureSet_EnumType)(0), // 11: google.protobuf.FeatureSet.EnumType + (FeatureSet_RepeatedFieldEncoding)(0), // 12: google.protobuf.FeatureSet.RepeatedFieldEncoding + (FeatureSet_Utf8Validation)(0), // 13: google.protobuf.FeatureSet.Utf8Validation + (FeatureSet_MessageEncoding)(0), // 14: google.protobuf.FeatureSet.MessageEncoding + (FeatureSet_JsonFormat)(0), // 15: google.protobuf.FeatureSet.JsonFormat + (GeneratedCodeInfo_Annotation_Semantic)(0), // 16: google.protobuf.GeneratedCodeInfo.Annotation.Semantic + (*FileDescriptorSet)(nil), // 17: google.protobuf.FileDescriptorSet + (*FileDescriptorProto)(nil), // 18: google.protobuf.FileDescriptorProto + (*DescriptorProto)(nil), // 19: google.protobuf.DescriptorProto + (*ExtensionRangeOptions)(nil), // 20: google.protobuf.ExtensionRangeOptions + (*FieldDescriptorProto)(nil), // 21: google.protobuf.FieldDescriptorProto + (*OneofDescriptorProto)(nil), // 22: google.protobuf.OneofDescriptorProto + (*EnumDescriptorProto)(nil), // 23: google.protobuf.EnumDescriptorProto + (*EnumValueDescriptorProto)(nil), // 24: google.protobuf.EnumValueDescriptorProto + (*ServiceDescriptorProto)(nil), // 25: google.protobuf.ServiceDescriptorProto + (*MethodDescriptorProto)(nil), // 26: google.protobuf.MethodDescriptorProto + (*FileOptions)(nil), // 27: google.protobuf.FileOptions + (*MessageOptions)(nil), // 28: google.protobuf.MessageOptions + (*FieldOptions)(nil), // 29: google.protobuf.FieldOptions + (*OneofOptions)(nil), // 30: google.protobuf.OneofOptions + (*EnumOptions)(nil), // 31: google.protobuf.EnumOptions + (*EnumValueOptions)(nil), // 32: google.protobuf.EnumValueOptions + (*ServiceOptions)(nil), // 33: google.protobuf.ServiceOptions + (*MethodOptions)(nil), // 34: google.protobuf.MethodOptions + (*UninterpretedOption)(nil), // 35: google.protobuf.UninterpretedOption + (*FeatureSet)(nil), // 36: google.protobuf.FeatureSet + (*FeatureSetDefaults)(nil), // 37: google.protobuf.FeatureSetDefaults + (*SourceCodeInfo)(nil), // 38: google.protobuf.SourceCodeInfo + (*GeneratedCodeInfo)(nil), // 39: google.protobuf.GeneratedCodeInfo + (*DescriptorProto_ExtensionRange)(nil), // 40: google.protobuf.DescriptorProto.ExtensionRange + (*DescriptorProto_ReservedRange)(nil), // 41: google.protobuf.DescriptorProto.ReservedRange + (*ExtensionRangeOptions_Declaration)(nil), // 42: google.protobuf.ExtensionRangeOptions.Declaration + (*EnumDescriptorProto_EnumReservedRange)(nil), // 43: google.protobuf.EnumDescriptorProto.EnumReservedRange + (*FieldOptions_EditionDefault)(nil), // 44: google.protobuf.FieldOptions.EditionDefault + (*UninterpretedOption_NamePart)(nil), // 45: google.protobuf.UninterpretedOption.NamePart + (*FeatureSetDefaults_FeatureSetEditionDefault)(nil), // 46: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + (*SourceCodeInfo_Location)(nil), // 47: google.protobuf.SourceCodeInfo.Location + (*GeneratedCodeInfo_Annotation)(nil), // 48: google.protobuf.GeneratedCodeInfo.Annotation } var file_google_protobuf_descriptor_proto_depIdxs = []int32{ - 11, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto - 12, // 1: google.protobuf.FileDescriptorProto.message_type:type_name -> google.protobuf.DescriptorProto - 16, // 2: google.protobuf.FileDescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto - 18, // 3: google.protobuf.FileDescriptorProto.service:type_name -> google.protobuf.ServiceDescriptorProto - 14, // 4: google.protobuf.FileDescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto - 20, // 5: google.protobuf.FileDescriptorProto.options:type_name -> google.protobuf.FileOptions - 29, // 6: google.protobuf.FileDescriptorProto.source_code_info:type_name -> google.protobuf.SourceCodeInfo - 14, // 7: google.protobuf.DescriptorProto.field:type_name -> google.protobuf.FieldDescriptorProto - 14, // 8: google.protobuf.DescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto - 12, // 9: google.protobuf.DescriptorProto.nested_type:type_name -> google.protobuf.DescriptorProto - 16, // 10: google.protobuf.DescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto - 31, // 11: google.protobuf.DescriptorProto.extension_range:type_name -> google.protobuf.DescriptorProto.ExtensionRange - 15, // 12: google.protobuf.DescriptorProto.oneof_decl:type_name -> google.protobuf.OneofDescriptorProto - 21, // 13: google.protobuf.DescriptorProto.options:type_name -> google.protobuf.MessageOptions - 32, // 14: google.protobuf.DescriptorProto.reserved_range:type_name -> google.protobuf.DescriptorProto.ReservedRange - 28, // 15: google.protobuf.ExtensionRangeOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 33, // 16: google.protobuf.ExtensionRangeOptions.declaration:type_name -> google.protobuf.ExtensionRangeOptions.Declaration - 0, // 17: google.protobuf.ExtensionRangeOptions.verification:type_name -> google.protobuf.ExtensionRangeOptions.VerificationState - 2, // 18: google.protobuf.FieldDescriptorProto.label:type_name -> google.protobuf.FieldDescriptorProto.Label - 1, // 19: google.protobuf.FieldDescriptorProto.type:type_name -> google.protobuf.FieldDescriptorProto.Type - 22, // 20: google.protobuf.FieldDescriptorProto.options:type_name -> google.protobuf.FieldOptions - 23, // 21: google.protobuf.OneofDescriptorProto.options:type_name -> google.protobuf.OneofOptions - 17, // 22: google.protobuf.EnumDescriptorProto.value:type_name -> google.protobuf.EnumValueDescriptorProto - 24, // 23: google.protobuf.EnumDescriptorProto.options:type_name -> google.protobuf.EnumOptions - 34, // 24: google.protobuf.EnumDescriptorProto.reserved_range:type_name -> google.protobuf.EnumDescriptorProto.EnumReservedRange - 25, // 25: google.protobuf.EnumValueDescriptorProto.options:type_name -> google.protobuf.EnumValueOptions - 19, // 26: google.protobuf.ServiceDescriptorProto.method:type_name -> google.protobuf.MethodDescriptorProto - 26, // 27: google.protobuf.ServiceDescriptorProto.options:type_name -> google.protobuf.ServiceOptions - 27, // 28: google.protobuf.MethodDescriptorProto.options:type_name -> google.protobuf.MethodOptions - 3, // 29: google.protobuf.FileOptions.optimize_for:type_name -> google.protobuf.FileOptions.OptimizeMode - 28, // 30: google.protobuf.FileOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 31: google.protobuf.MessageOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 4, // 32: google.protobuf.FieldOptions.ctype:type_name -> google.protobuf.FieldOptions.CType - 5, // 33: google.protobuf.FieldOptions.jstype:type_name -> google.protobuf.FieldOptions.JSType - 6, // 34: google.protobuf.FieldOptions.retention:type_name -> google.protobuf.FieldOptions.OptionRetention - 7, // 35: google.protobuf.FieldOptions.target:type_name -> google.protobuf.FieldOptions.OptionTargetType - 7, // 36: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType - 28, // 37: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 38: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 39: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 40: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 28, // 41: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 8, // 42: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel - 28, // 43: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption - 35, // 44: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart - 36, // 45: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location - 37, // 46: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation - 13, // 47: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions - 9, // 48: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic - 49, // [49:49] is the sub-list for method output_type - 49, // [49:49] is the sub-list for method input_type - 49, // [49:49] is the sub-list for extension type_name - 49, // [49:49] is the sub-list for extension extendee - 0, // [0:49] is the sub-list for field type_name + 18, // 0: google.protobuf.FileDescriptorSet.file:type_name -> google.protobuf.FileDescriptorProto + 19, // 1: google.protobuf.FileDescriptorProto.message_type:type_name -> google.protobuf.DescriptorProto + 23, // 2: google.protobuf.FileDescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto + 25, // 3: google.protobuf.FileDescriptorProto.service:type_name -> google.protobuf.ServiceDescriptorProto + 21, // 4: google.protobuf.FileDescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto + 27, // 5: google.protobuf.FileDescriptorProto.options:type_name -> google.protobuf.FileOptions + 38, // 6: google.protobuf.FileDescriptorProto.source_code_info:type_name -> google.protobuf.SourceCodeInfo + 0, // 7: google.protobuf.FileDescriptorProto.edition:type_name -> google.protobuf.Edition + 21, // 8: google.protobuf.DescriptorProto.field:type_name -> google.protobuf.FieldDescriptorProto + 21, // 9: google.protobuf.DescriptorProto.extension:type_name -> google.protobuf.FieldDescriptorProto + 19, // 10: google.protobuf.DescriptorProto.nested_type:type_name -> google.protobuf.DescriptorProto + 23, // 11: google.protobuf.DescriptorProto.enum_type:type_name -> google.protobuf.EnumDescriptorProto + 40, // 12: google.protobuf.DescriptorProto.extension_range:type_name -> google.protobuf.DescriptorProto.ExtensionRange + 22, // 13: google.protobuf.DescriptorProto.oneof_decl:type_name -> google.protobuf.OneofDescriptorProto + 28, // 14: google.protobuf.DescriptorProto.options:type_name -> google.protobuf.MessageOptions + 41, // 15: google.protobuf.DescriptorProto.reserved_range:type_name -> google.protobuf.DescriptorProto.ReservedRange + 35, // 16: google.protobuf.ExtensionRangeOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 42, // 17: google.protobuf.ExtensionRangeOptions.declaration:type_name -> google.protobuf.ExtensionRangeOptions.Declaration + 36, // 18: google.protobuf.ExtensionRangeOptions.features:type_name -> google.protobuf.FeatureSet + 1, // 19: google.protobuf.ExtensionRangeOptions.verification:type_name -> google.protobuf.ExtensionRangeOptions.VerificationState + 3, // 20: google.protobuf.FieldDescriptorProto.label:type_name -> google.protobuf.FieldDescriptorProto.Label + 2, // 21: google.protobuf.FieldDescriptorProto.type:type_name -> google.protobuf.FieldDescriptorProto.Type + 29, // 22: google.protobuf.FieldDescriptorProto.options:type_name -> google.protobuf.FieldOptions + 30, // 23: google.protobuf.OneofDescriptorProto.options:type_name -> google.protobuf.OneofOptions + 24, // 24: google.protobuf.EnumDescriptorProto.value:type_name -> google.protobuf.EnumValueDescriptorProto + 31, // 25: google.protobuf.EnumDescriptorProto.options:type_name -> google.protobuf.EnumOptions + 43, // 26: google.protobuf.EnumDescriptorProto.reserved_range:type_name -> google.protobuf.EnumDescriptorProto.EnumReservedRange + 32, // 27: google.protobuf.EnumValueDescriptorProto.options:type_name -> google.protobuf.EnumValueOptions + 26, // 28: google.protobuf.ServiceDescriptorProto.method:type_name -> google.protobuf.MethodDescriptorProto + 33, // 29: google.protobuf.ServiceDescriptorProto.options:type_name -> google.protobuf.ServiceOptions + 34, // 30: google.protobuf.MethodDescriptorProto.options:type_name -> google.protobuf.MethodOptions + 4, // 31: google.protobuf.FileOptions.optimize_for:type_name -> google.protobuf.FileOptions.OptimizeMode + 36, // 32: google.protobuf.FileOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 33: google.protobuf.FileOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 34: google.protobuf.MessageOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 35: google.protobuf.MessageOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 5, // 36: google.protobuf.FieldOptions.ctype:type_name -> google.protobuf.FieldOptions.CType + 6, // 37: google.protobuf.FieldOptions.jstype:type_name -> google.protobuf.FieldOptions.JSType + 7, // 38: google.protobuf.FieldOptions.retention:type_name -> google.protobuf.FieldOptions.OptionRetention + 8, // 39: google.protobuf.FieldOptions.targets:type_name -> google.protobuf.FieldOptions.OptionTargetType + 44, // 40: google.protobuf.FieldOptions.edition_defaults:type_name -> google.protobuf.FieldOptions.EditionDefault + 36, // 41: google.protobuf.FieldOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 42: google.protobuf.FieldOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 43: google.protobuf.OneofOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 44: google.protobuf.OneofOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 45: google.protobuf.EnumOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 46: google.protobuf.EnumOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 47: google.protobuf.EnumValueOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 48: google.protobuf.EnumValueOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 36, // 49: google.protobuf.ServiceOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 50: google.protobuf.ServiceOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 9, // 51: google.protobuf.MethodOptions.idempotency_level:type_name -> google.protobuf.MethodOptions.IdempotencyLevel + 36, // 52: google.protobuf.MethodOptions.features:type_name -> google.protobuf.FeatureSet + 35, // 53: google.protobuf.MethodOptions.uninterpreted_option:type_name -> google.protobuf.UninterpretedOption + 45, // 54: google.protobuf.UninterpretedOption.name:type_name -> google.protobuf.UninterpretedOption.NamePart + 10, // 55: google.protobuf.FeatureSet.field_presence:type_name -> google.protobuf.FeatureSet.FieldPresence + 11, // 56: google.protobuf.FeatureSet.enum_type:type_name -> google.protobuf.FeatureSet.EnumType + 12, // 57: google.protobuf.FeatureSet.repeated_field_encoding:type_name -> google.protobuf.FeatureSet.RepeatedFieldEncoding + 13, // 58: google.protobuf.FeatureSet.utf8_validation:type_name -> google.protobuf.FeatureSet.Utf8Validation + 14, // 59: google.protobuf.FeatureSet.message_encoding:type_name -> google.protobuf.FeatureSet.MessageEncoding + 15, // 60: google.protobuf.FeatureSet.json_format:type_name -> google.protobuf.FeatureSet.JsonFormat + 46, // 61: google.protobuf.FeatureSetDefaults.defaults:type_name -> google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault + 0, // 62: google.protobuf.FeatureSetDefaults.minimum_edition:type_name -> google.protobuf.Edition + 0, // 63: google.protobuf.FeatureSetDefaults.maximum_edition:type_name -> google.protobuf.Edition + 47, // 64: google.protobuf.SourceCodeInfo.location:type_name -> google.protobuf.SourceCodeInfo.Location + 48, // 65: google.protobuf.GeneratedCodeInfo.annotation:type_name -> google.protobuf.GeneratedCodeInfo.Annotation + 20, // 66: google.protobuf.DescriptorProto.ExtensionRange.options:type_name -> google.protobuf.ExtensionRangeOptions + 0, // 67: google.protobuf.FieldOptions.EditionDefault.edition:type_name -> google.protobuf.Edition + 0, // 68: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.edition:type_name -> google.protobuf.Edition + 36, // 69: google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault.features:type_name -> google.protobuf.FeatureSet + 16, // 70: google.protobuf.GeneratedCodeInfo.Annotation.semantic:type_name -> google.protobuf.GeneratedCodeInfo.Annotation.Semantic + 71, // [71:71] is the sub-list for method output_type + 71, // [71:71] is the sub-list for method input_type + 71, // [71:71] is the sub-list for extension type_name + 71, // [71:71] is the sub-list for extension extendee + 0, // [0:71] is the sub-list for field type_name } func init() { file_google_protobuf_descriptor_proto_init() } @@ -4475,19 +5476,21 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SourceCodeInfo); i { + switch v := v.(*FeatureSet); i { case 0: return &v.state case 1: return &v.sizeCache case 2: return &v.unknownFields + case 3: + return &v.extensionFields default: return nil } } file_google_protobuf_descriptor_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GeneratedCodeInfo); i { + switch v := v.(*FeatureSetDefaults); i { case 0: return &v.state case 1: @@ -4499,7 +5502,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DescriptorProto_ExtensionRange); i { + switch v := v.(*SourceCodeInfo); i { case 0: return &v.state case 1: @@ -4511,7 +5514,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DescriptorProto_ReservedRange); i { + switch v := v.(*GeneratedCodeInfo); i { case 0: return &v.state case 1: @@ -4523,7 +5526,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ExtensionRangeOptions_Declaration); i { + switch v := v.(*DescriptorProto_ExtensionRange); i { case 0: return &v.state case 1: @@ -4535,7 +5538,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EnumDescriptorProto_EnumReservedRange); i { + switch v := v.(*DescriptorProto_ReservedRange); i { case 0: return &v.state case 1: @@ -4547,7 +5550,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UninterpretedOption_NamePart); i { + switch v := v.(*ExtensionRangeOptions_Declaration); i { case 0: return &v.state case 1: @@ -4559,7 +5562,7 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SourceCodeInfo_Location); i { + switch v := v.(*EnumDescriptorProto_EnumReservedRange); i { case 0: return &v.state case 1: @@ -4571,6 +5574,54 @@ func file_google_protobuf_descriptor_proto_init() { } } file_google_protobuf_descriptor_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FieldOptions_EditionDefault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UninterpretedOption_NamePart); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*FeatureSetDefaults_FeatureSetEditionDefault); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SourceCodeInfo_Location); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_google_protobuf_descriptor_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GeneratedCodeInfo_Annotation); i { case 0: return &v.state @@ -4588,8 +5639,8 @@ func file_google_protobuf_descriptor_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_google_protobuf_descriptor_proto_rawDesc, - NumEnums: 10, - NumMessages: 28, + NumEnums: 17, + NumMessages: 32, NumExtensions: 0, NumServices: 0, }, diff --git a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go index 580b232f..9de51be5 100644 --- a/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go +++ b/vendor/google.golang.org/protobuf/types/known/anypb/any.pb.go @@ -237,7 +237,8 @@ type Any struct { // // Note: this functionality is not currently available in the official // protobuf release, and it is not used for type URLs beginning with - // type.googleapis.com. + // type.googleapis.com. As of May 2023, there are no widely used type server + // implementations and no plans to implement one. // // Schemes other than `http`, `https` (or the empty scheme) might be // used with implementation specific semantics. diff --git a/vendor/modules.txt b/vendor/modules.txt index 370f2ec5..888c7557 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,5 +1,5 @@ -# filippo.io/edwards25519 v1.0.0 -## explicit; go 1.17 +# filippo.io/edwards25519 v1.1.0 +## explicit; go 1.20 filippo.io/edwards25519 filippo.io/edwards25519/field # github.com/ManyakRus/logrus v0.0.0-20231019115155-9e6fede0d792 @@ -11,7 +11,7 @@ github.com/andybalholm/brotli # github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 ## explicit; go 1.13 github.com/asaskevich/govalidator -# github.com/camunda/zeebe/clients/go/v8 v8.3.2 +# github.com/camunda/zeebe/clients/go/v8 v8.3.4 ## explicit; go 1.19 github.com/camunda/zeebe/clients/go/v8/internal/embedded github.com/camunda/zeebe/clients/go/v8/internal/utils @@ -54,7 +54,7 @@ github.com/emersion/go-sasl # github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 ## explicit github.com/emersion/go-textwrapper -# github.com/go-faster/errors v0.7.0 +# github.com/go-faster/errors v0.7.1 ## explicit; go 1.20 github.com/go-faster/errors # github.com/go-faster/jx v1.1.0 @@ -76,7 +76,7 @@ github.com/gofiber/fiber/v2 github.com/gofiber/fiber/v2/internal/schema github.com/gofiber/fiber/v2/log github.com/gofiber/fiber/v2/utils -# github.com/golang-module/carbon/v2 v2.2.13 +# github.com/golang-module/carbon/v2 v2.3.0 ## explicit; go 1.16 github.com/golang-module/carbon/v2 # github.com/golang-sql/civil v0.0.0-20220223132316-b832511892a9 @@ -104,7 +104,7 @@ github.com/google/go-cmp/cmp/internal/diff github.com/google/go-cmp/cmp/internal/flags github.com/google/go-cmp/cmp/internal/function github.com/google/go-cmp/cmp/internal/value -# github.com/google/uuid v1.4.0 +# github.com/google/uuid v1.5.0 ## explicit github.com/google/uuid # github.com/gorilla/websocket v1.5.1 @@ -119,8 +119,8 @@ github.com/gotd/ige # github.com/gotd/neo v0.1.5 ## explicit; go 1.12 github.com/gotd/neo -# github.com/gotd/td v0.89.0 -## explicit; go 1.19 +# github.com/gotd/td v0.92.0 +## explicit; go 1.21 github.com/gotd/td/bin github.com/gotd/td/clock github.com/gotd/td/constant @@ -185,7 +185,7 @@ github.com/jackc/pgpassfile # github.com/jackc/pgproto3/v2 v2.3.2 ## explicit; go 1.12 github.com/jackc/pgproto3/v2 -# github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a +# github.com/jackc/pgservicefile v0.0.0-20231201235250-de7065d80cb9 ## explicit; go 1.14 github.com/jackc/pgservicefile # github.com/jackc/pgtype v1.14.0 @@ -195,7 +195,7 @@ github.com/jackc/pgtype ## explicit; go 1.13 github.com/jackc/pgx/v4 github.com/jackc/pgx/v4/internal/sanitize -# github.com/jackc/pgx/v5 v5.5.0 +# github.com/jackc/pgx/v5 v5.5.1 ## explicit; go 1.19 github.com/jackc/pgx/v5 github.com/jackc/pgx/v5/internal/anynil @@ -230,8 +230,8 @@ github.com/joho/godotenv # github.com/json-iterator/go v1.1.12 ## explicit; go 1.12 github.com/json-iterator/go -# github.com/klauspost/compress v1.17.2 -## explicit; go 1.18 +# github.com/klauspost/compress v1.17.4 +## explicit; go 1.19 github.com/klauspost/compress github.com/klauspost/compress/flate github.com/klauspost/compress/fse @@ -261,7 +261,7 @@ github.com/mattn/go-isatty # github.com/mattn/go-runewidth v0.0.15 ## explicit; go 1.9 github.com/mattn/go-runewidth -# github.com/mattn/go-sqlite3 v1.14.18 +# github.com/mattn/go-sqlite3 v1.14.19 ## explicit; go 1.16 github.com/mattn/go-sqlite3 # github.com/mdp/qrterminal/v3 v3.2.0 @@ -286,7 +286,7 @@ github.com/microsoft/go-mssqldb/msdsn # github.com/minio/md5-simd v1.1.2 ## explicit; go 1.14 github.com/minio/md5-simd -# github.com/minio/minio-go/v7 v7.0.63 +# github.com/minio/minio-go/v7 v7.0.66 ## explicit; go 1.17 github.com/minio/minio-go/v7 github.com/minio/minio-go/v7/pkg/credentials @@ -323,7 +323,7 @@ github.com/nats-io/nkeys # github.com/nats-io/nuid v1.0.1 ## explicit github.com/nats-io/nuid -# github.com/pierrec/lz4/v4 v4.1.18 +# github.com/pierrec/lz4/v4 v4.1.19 ## explicit; go 1.14 github.com/pierrec/lz4/v4 github.com/pierrec/lz4/v4/internal/lz4block @@ -339,7 +339,7 @@ github.com/rivo/uniseg # github.com/rs/xid v1.5.0 ## explicit; go 1.12 github.com/rs/xid -# github.com/sashabaranov/go-openai v1.17.6 +# github.com/sashabaranov/go-openai v1.17.9 ## explicit; go 1.18 github.com/sashabaranov/go-openai github.com/sashabaranov/go-openai/internal @@ -352,7 +352,7 @@ github.com/segmentio/asm/cpu/arm64 github.com/segmentio/asm/cpu/cpuid github.com/segmentio/asm/cpu/x86 github.com/segmentio/asm/internal/unsafebytes -# github.com/segmentio/kafka-go v0.4.44 +# github.com/segmentio/kafka-go v0.4.47 ## explicit; go 1.15 github.com/segmentio/kafka-go github.com/segmentio/kafka-go/compress @@ -391,11 +391,13 @@ github.com/segmentio/kafka-go/protocol/joingroup github.com/segmentio/kafka-go/protocol/leavegroup github.com/segmentio/kafka-go/protocol/listgroups github.com/segmentio/kafka-go/protocol/listoffsets +github.com/segmentio/kafka-go/protocol/listpartitionreassignments github.com/segmentio/kafka-go/protocol/metadata github.com/segmentio/kafka-go/protocol/offsetcommit github.com/segmentio/kafka-go/protocol/offsetdelete github.com/segmentio/kafka-go/protocol/offsetfetch github.com/segmentio/kafka-go/protocol/produce +github.com/segmentio/kafka-go/protocol/rawproduce github.com/segmentio/kafka-go/protocol/saslauthenticate github.com/segmentio/kafka-go/protocol/saslhandshake github.com/segmentio/kafka-go/protocol/syncgroup @@ -429,7 +431,7 @@ github.com/toorop/go-dkim # github.com/valyala/bytebufferpool v1.0.0 ## explicit github.com/valyala/bytebufferpool -# github.com/valyala/fasthttp v1.50.0 +# github.com/valyala/fasthttp v1.51.0 ## explicit; go 1.20 github.com/valyala/fasthttp github.com/valyala/fasthttp/fasthttputil @@ -457,12 +459,11 @@ gitlab.aescorp.ru/dsp_dev/claim/common/sync_exchange/data_packer gitlab.aescorp.ru/dsp_dev/claim/common/sync_exchange/sync_confirm gitlab.aescorp.ru/dsp_dev/claim/common/sync_exchange/sync_global gitlab.aescorp.ru/dsp_dev/claim/common/sync_exchange/sync_types -# gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres v1.0.15 -## explicit; go 1.18 -gitlab.aescorp.ru/dsp_dev/claim/stack_exchange_postgres/internal/v0/app/constants -# gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.24 +# gitlab.aescorp.ru/dsp_dev/claim/sync_service v1.2.35 ## explicit; go 1.20 -gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/functions/calc_struct_version +gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/calc_struct_version +gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/constants +gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/tables/table_connections gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/connections # go.mau.fi/libsignal v0.1.0 ## explicit; go 1.18 @@ -492,12 +493,12 @@ go.mau.fi/libsignal/util/errorhelper go.mau.fi/libsignal/util/keyhelper go.mau.fi/libsignal/util/medium go.mau.fi/libsignal/util/optional -# go.mau.fi/util v0.2.0 +# go.mau.fi/util v0.2.1 ## explicit; go 1.20 go.mau.fi/util/jsontime go.mau.fi/util/random go.mau.fi/util/retryafter -# go.mau.fi/whatsmeow v0.0.0-20231112141858-68b25b3f6fe9 +# go.mau.fi/whatsmeow v0.0.0-20231216213200-9d803dd92735 ## explicit; go 1.20 go.mau.fi/whatsmeow go.mau.fi/whatsmeow/appstate @@ -515,13 +516,13 @@ go.mau.fi/whatsmeow/util/gcmutil go.mau.fi/whatsmeow/util/hkdfutil go.mau.fi/whatsmeow/util/keys go.mau.fi/whatsmeow/util/log -# go.opentelemetry.io/otel v1.20.0 +# go.opentelemetry.io/otel v1.21.0 ## explicit; go 1.20 go.opentelemetry.io/otel/attribute go.opentelemetry.io/otel/codes go.opentelemetry.io/otel/internal go.opentelemetry.io/otel/internal/attribute -# go.opentelemetry.io/otel/trace v1.20.0 +# go.opentelemetry.io/otel/trace v1.21.0 ## explicit; go 1.20 go.opentelemetry.io/otel/trace go.opentelemetry.io/otel/trace/embedded @@ -542,7 +543,7 @@ go.uber.org/zap/internal/exit go.uber.org/zap/internal/pool go.uber.org/zap/internal/stacktrace go.uber.org/zap/zapcore -# golang.org/x/crypto v0.15.0 +# golang.org/x/crypto v0.17.0 ## explicit; go 1.18 golang.org/x/crypto/argon2 golang.org/x/crypto/blake2b @@ -558,10 +559,10 @@ golang.org/x/crypto/nacl/secretbox golang.org/x/crypto/pbkdf2 golang.org/x/crypto/salsa20/salsa golang.org/x/crypto/ssh/terminal -# golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa +# golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 ## explicit; go 1.20 golang.org/x/exp/maps -# golang.org/x/net v0.18.0 +# golang.org/x/net v0.19.0 ## explicit; go 1.18 golang.org/x/net/http/httpguts golang.org/x/net/http2 @@ -572,7 +573,7 @@ golang.org/x/net/internal/timeseries golang.org/x/net/proxy golang.org/x/net/publicsuffix golang.org/x/net/trace -# golang.org/x/oauth2 v0.14.0 +# golang.org/x/oauth2 v0.15.0 ## explicit; go 1.18 golang.org/x/oauth2 golang.org/x/oauth2/clientcredentials @@ -582,13 +583,13 @@ golang.org/x/oauth2/internal golang.org/x/sync/errgroup golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.14.0 +# golang.org/x/sys v0.15.0 ## explicit; go 1.18 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.14.0 +# golang.org/x/term v0.15.0 ## explicit; go 1.18 golang.org/x/term # golang.org/x/text v0.14.0 @@ -620,10 +621,10 @@ google.golang.org/appengine/internal/log google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch -# google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 +# google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 ## explicit; go 1.19 google.golang.org/genproto/googleapis/rpc/status -# google.golang.org/grpc v1.59.0 +# google.golang.org/grpc v1.60.1 ## explicit; go 1.19 google.golang.org/grpc google.golang.org/grpc/attributes @@ -659,6 +660,7 @@ google.golang.org/grpc/internal/metadata google.golang.org/grpc/internal/pretty google.golang.org/grpc/internal/resolver google.golang.org/grpc/internal/resolver/dns +google.golang.org/grpc/internal/resolver/dns/internal google.golang.org/grpc/internal/resolver/passthrough google.golang.org/grpc/internal/resolver/unix google.golang.org/grpc/internal/serviceconfig @@ -670,12 +672,13 @@ google.golang.org/grpc/keepalive google.golang.org/grpc/metadata google.golang.org/grpc/peer google.golang.org/grpc/resolver +google.golang.org/grpc/resolver/dns google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -# google.golang.org/protobuf v1.31.0 -## explicit; go 1.11 +# google.golang.org/protobuf v1.32.0 +## explicit; go 1.17 google.golang.org/protobuf/encoding/protojson google.golang.org/protobuf/encoding/prototext google.golang.org/protobuf/encoding/protowire