twitter-openapi-python-generated 0.0.34__py3-none-any.whl → 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- twitter_openapi_python_generated/__init__.py +279 -7
- twitter_openapi_python_generated/api/post_api.py +2079 -203
- twitter_openapi_python_generated/api/tweet_api.py +3207 -231
- twitter_openapi_python_generated/api/user_api.py +969 -66
- twitter_openapi_python_generated/api/user_list_api.py +1907 -0
- twitter_openapi_python_generated/api_client.py +47 -9
- twitter_openapi_python_generated/configuration.py +55 -6
- twitter_openapi_python_generated/models/__init__.py +139 -3
- twitter_openapi_python_generated/models/ad_metadata_container.py +104 -0
- twitter_openapi_python_generated/models/additional_media_info.py +3 -1
- twitter_openapi_python_generated/models/affiliates_highlighted_label.py +93 -0
- twitter_openapi_python_generated/models/api_image.py +108 -0
- twitter_openapi_python_generated/models/api_media.py +110 -0
- twitter_openapi_python_generated/models/article_cover_media.py +2 -5
- twitter_openapi_python_generated/models/article_cover_media_info.py +3 -3
- twitter_openapi_python_generated/models/article_result.py +3 -7
- twitter_openapi_python_generated/models/badge_counts.py +97 -0
- twitter_openapi_python_generated/models/birdwatch_entity_ref.py +3 -1
- twitter_openapi_python_generated/models/birdwatch_pivot.py +2 -2
- twitter_openapi_python_generated/models/birdwatch_pivot_footer.py +1 -2
- twitter_openapi_python_generated/models/birdwatch_pivot_note.py +2 -5
- twitter_openapi_python_generated/models/birdwatch_pivot_subtitle.py +1 -2
- twitter_openapi_python_generated/models/bookmarks_response.py +1 -2
- twitter_openapi_python_generated/models/cashtag_attachment.py +89 -0
- twitter_openapi_python_generated/models/cashtag_info.py +93 -0
- twitter_openapi_python_generated/models/click_tracking_info.py +96 -0
- twitter_openapi_python_generated/models/client_event_info.py +6 -2
- twitter_openapi_python_generated/models/client_event_info_details.py +99 -0
- twitter_openapi_python_generated/models/community.py +21 -15
- twitter_openapi_python_generated/models/community_about_timeline_response.py +1 -2
- twitter_openapi_python_generated/models/community_banner_media.py +95 -0
- twitter_openapi_python_generated/models/community_banner_media_info.py +108 -0
- twitter_openapi_python_generated/models/community_discovery_timeline_response.py +102 -0
- twitter_openapi_python_generated/models/community_discovery_timeline_response_data.py +93 -0
- twitter_openapi_python_generated/models/community_discovery_timeline_viewer.py +93 -0
- twitter_openapi_python_generated/models/community_join_action_result_union.py +3 -2
- twitter_openapi_python_generated/models/community_media_timeline_response.py +1 -2
- twitter_openapi_python_generated/models/community_moderation_state.py +90 -0
- twitter_openapi_python_generated/models/community_relationship.py +8 -7
- twitter_openapi_python_generated/models/community_rule.py +2 -5
- twitter_openapi_python_generated/models/community_tweets_timeline_response.py +1 -2
- twitter_openapi_python_generated/models/community_union.py +3 -2
- twitter_openapi_python_generated/models/community_viewer_relationship.py +95 -0
- twitter_openapi_python_generated/models/connect_tab_timeline_response.py +102 -0
- twitter_openapi_python_generated/models/connect_tab_timeline_response_data.py +93 -0
- twitter_openapi_python_generated/models/content_disclosure_ai_generated_disclosure.py +2 -2
- twitter_openapi_python_generated/models/content_item_type.py +3 -0
- twitter_openapi_python_generated/models/content_union.py +3 -2
- twitter_openapi_python_generated/models/conversation_control.py +10 -11
- twitter_openapi_python_generated/models/conversation_details.py +96 -0
- twitter_openapi_python_generated/models/conversation_metadata.py +92 -0
- twitter_openapi_python_generated/models/conversation_owner.py +96 -0
- twitter_openapi_python_generated/models/conversation_owner_core.py +89 -0
- twitter_openapi_python_generated/models/conversation_owner_results.py +93 -0
- twitter_openapi_python_generated/models/cover_cta.py +1 -2
- twitter_openapi_python_generated/models/create_bookmark_response.py +1 -2
- twitter_openapi_python_generated/models/create_draft_tweet_response.py +102 -0
- twitter_openapi_python_generated/models/create_draft_tweet_response_data.py +93 -0
- twitter_openapi_python_generated/models/create_draft_tweet_response_tweet.py +97 -0
- twitter_openapi_python_generated/models/create_retweet_response.py +1 -2
- twitter_openapi_python_generated/models/create_tweet_response.py +1 -2
- twitter_openapi_python_generated/models/cta_limited_action_prompt.py +110 -0
- twitter_openapi_python_generated/models/cta_limited_action_prompt_text.py +91 -0
- twitter_openapi_python_generated/models/deepsearch_header.py +96 -0
- twitter_openapi_python_generated/models/deepsearch_step.py +99 -0
- twitter_openapi_python_generated/models/deepsearch_web_result.py +89 -0
- twitter_openapi_python_generated/models/delete_bookmark_response.py +1 -2
- twitter_openapi_python_generated/models/delete_draft_tweets_response.py +102 -0
- twitter_openapi_python_generated/models/delete_draft_tweets_response_data.py +89 -0
- twitter_openapi_python_generated/models/delete_list_response.py +102 -0
- twitter_openapi_python_generated/models/delete_list_response_data.py +89 -0
- twitter_openapi_python_generated/models/delete_retweet.py +1 -2
- twitter_openapi_python_generated/models/delete_retweet_response.py +1 -2
- twitter_openapi_python_generated/models/delete_tweet_response.py +1 -2
- twitter_openapi_python_generated/models/draft_list.py +96 -0
- twitter_openapi_python_generated/models/draft_tweet.py +109 -0
- twitter_openapi_python_generated/models/draft_tweet_create_request.py +99 -0
- twitter_openapi_python_generated/models/draft_tweet_user.py +100 -0
- twitter_openapi_python_generated/models/draft_tweet_user_results.py +93 -0
- twitter_openapi_python_generated/models/draft_tweets_viewer.py +93 -0
- twitter_openapi_python_generated/models/entities.py +34 -15
- twitter_openapi_python_generated/models/error_extensions.py +1 -1
- twitter_openapi_python_generated/models/error_response.py +3 -5
- twitter_openapi_python_generated/models/explore_page.py +95 -0
- twitter_openapi_python_generated/models/explore_page_body.py +104 -0
- twitter_openapi_python_generated/models/explore_page_response.py +102 -0
- twitter_openapi_python_generated/models/explore_page_response_data.py +93 -0
- twitter_openapi_python_generated/models/explore_timeline.py +105 -0
- twitter_openapi_python_generated/models/explore_timeline_scribe_config.py +91 -0
- twitter_openapi_python_generated/models/extended_entities.py +1 -2
- twitter_openapi_python_generated/models/favorite_tweet_response.py +1 -2
- twitter_openapi_python_generated/models/feedback_action.py +136 -0
- twitter_openapi_python_generated/models/feedback_action_entry.py +95 -0
- twitter_openapi_python_generated/models/feedback_client_event_info.py +93 -0
- twitter_openapi_python_generated/models/feedback_info.py +8 -6
- twitter_openapi_python_generated/models/fetch_draft_tweets_response.py +102 -0
- twitter_openapi_python_generated/models/fetch_draft_tweets_response_data.py +93 -0
- twitter_openapi_python_generated/models/fetch_scheduled_tweets_response.py +102 -0
- twitter_openapi_python_generated/models/fetch_scheduled_tweets_response_data.py +93 -0
- twitter_openapi_python_generated/models/follow_response.py +1 -2
- twitter_openapi_python_generated/models/generic_timeline_by_id_response.py +102 -0
- twitter_openapi_python_generated/models/generic_timeline_by_id_response_data.py +93 -0
- twitter_openapi_python_generated/models/grok_share_attachment.py +1 -2
- twitter_openapi_python_generated/models/grok_share_attachment_item.py +9 -2
- twitter_openapi_python_generated/models/grok_translated_bio.py +101 -0
- twitter_openapi_python_generated/models/grok_translated_bio_with_availability.py +97 -0
- twitter_openapi_python_generated/models/grok_translated_community_note.py +1 -2
- twitter_openapi_python_generated/models/hashtag.py +91 -0
- twitter_openapi_python_generated/models/highlight.py +1 -2
- twitter_openapi_python_generated/models/instruction_union.py +3 -2
- twitter_openapi_python_generated/models/item_content_union.py +68 -10
- twitter_openapi_python_generated/models/jetfuel_attachment.py +91 -0
- twitter_openapi_python_generated/models/key_value.py +91 -0
- twitter_openapi_python_generated/models/landing_url.py +98 -0
- twitter_openapi_python_generated/models/limited_action.py +95 -0
- twitter_openapi_python_generated/models/limited_action_results.py +96 -0
- twitter_openapi_python_generated/models/limited_action_results_data.py +1 -8
- twitter_openapi_python_generated/models/list_banner_media.py +93 -0
- twitter_openapi_python_generated/models/list_banner_media_info.py +99 -0
- twitter_openapi_python_generated/models/list_banner_media_results.py +93 -0
- twitter_openapi_python_generated/models/list_latest_tweets_timeline_response.py +1 -2
- twitter_openapi_python_generated/models/list_members_list.py +93 -0
- twitter_openapi_python_generated/models/list_members_response.py +102 -0
- twitter_openapi_python_generated/models/list_members_response_data.py +93 -0
- twitter_openapi_python_generated/models/list_recommended_users_list.py +93 -0
- twitter_openapi_python_generated/models/list_recommended_users_response.py +102 -0
- twitter_openapi_python_generated/models/list_recommended_users_response_data.py +93 -0
- twitter_openapi_python_generated/models/list_response.py +102 -0
- twitter_openapi_python_generated/models/list_response_data.py +93 -0
- twitter_openapi_python_generated/models/list_subscribers_list.py +93 -0
- twitter_openapi_python_generated/models/list_subscribers_response.py +102 -0
- twitter_openapi_python_generated/models/list_subscribers_response_data.py +93 -0
- twitter_openapi_python_generated/models/media.py +16 -17
- twitter_openapi_python_generated/models/{article_cover_media_color_info.py → media_color_info.py} +8 -9
- twitter_openapi_python_generated/models/{article_cover_media_color_info_palette.py → media_color_info_palette.py} +7 -7
- twitter_openapi_python_generated/models/{article_cover_media_color_info_palette_rgb.py → media_color_info_palette_rgb.py} +4 -4
- twitter_openapi_python_generated/models/media_extended.py +13 -16
- twitter_openapi_python_generated/models/media_original_info.py +1 -2
- twitter_openapi_python_generated/models/media_salient_rect.py +95 -0
- twitter_openapi_python_generated/models/media_video_info.py +1 -2
- twitter_openapi_python_generated/models/module_footer.py +104 -0
- twitter_openapi_python_generated/models/module_header.py +100 -0
- twitter_openapi_python_generated/models/module_item.py +2 -5
- twitter_openapi_python_generated/models/module_metadata.py +93 -0
- twitter_openapi_python_generated/models/note_tweet_result_data.py +2 -5
- twitter_openapi_python_generated/models/note_tweet_result_media.py +1 -2
- twitter_openapi_python_generated/models/note_tweet_result_media_inline_media.py +2 -5
- twitter_openapi_python_generated/models/note_tweet_result_rich_text.py +1 -2
- twitter_openapi_python_generated/models/notifications_result.py +2 -5
- twitter_openapi_python_generated/models/notifications_timeline_response.py +1 -2
- twitter_openapi_python_generated/models/post_create_bookmark_request.py +1 -1
- twitter_openapi_python_generated/models/post_create_bookmark_request_variables.py +2 -2
- twitter_openapi_python_generated/models/post_create_draft_tweet_request.py +95 -0
- twitter_openapi_python_generated/models/post_create_draft_tweet_request_variables.py +93 -0
- twitter_openapi_python_generated/models/post_create_draft_tweet_request_variables_post_tweet_request.py +97 -0
- twitter_openapi_python_generated/models/post_create_list_request.py +101 -0
- twitter_openapi_python_generated/models/post_create_list_request_features.py +97 -0
- twitter_openapi_python_generated/models/post_create_list_request_variables.py +93 -0
- twitter_openapi_python_generated/models/post_create_retweet_request.py +1 -1
- twitter_openapi_python_generated/models/post_create_retweet_request_variables.py +3 -3
- twitter_openapi_python_generated/models/post_create_tweet_request.py +2 -2
- twitter_openapi_python_generated/models/post_create_tweet_request_features.py +43 -41
- twitter_openapi_python_generated/models/post_create_tweet_request_variables.py +4 -4
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_conversation_control.py +2 -2
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_media.py +3 -4
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_media_media_entities_inner.py +2 -2
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_reply.py +2 -2
- twitter_openapi_python_generated/models/post_cta_title_text.py +1 -2
- twitter_openapi_python_generated/models/post_delete_bookmark_request.py +1 -1
- twitter_openapi_python_generated/models/post_delete_draft_tweets_request.py +95 -0
- twitter_openapi_python_generated/models/post_delete_draft_tweets_request_variables.py +89 -0
- twitter_openapi_python_generated/models/post_delete_list_request.py +95 -0
- twitter_openapi_python_generated/models/post_delete_list_request_variables.py +89 -0
- twitter_openapi_python_generated/models/post_delete_retweet_request.py +1 -1
- twitter_openapi_python_generated/models/post_delete_retweet_request_variables.py +3 -3
- twitter_openapi_python_generated/models/post_delete_tweet_request.py +2 -2
- twitter_openapi_python_generated/models/post_favorite_tweet_request.py +1 -1
- twitter_openapi_python_generated/models/post_list_add_member_request.py +101 -0
- twitter_openapi_python_generated/models/post_list_add_member_request_variables.py +91 -0
- twitter_openapi_python_generated/models/post_list_remove_member_request.py +101 -0
- twitter_openapi_python_generated/models/post_unfavorite_tweet_request.py +1 -1
- twitter_openapi_python_generated/models/primary_community_topic.py +2 -5
- twitter_openapi_python_generated/models/profile_bio.py +11 -3
- twitter_openapi_python_generated/models/profile_bio_entities.py +98 -0
- twitter_openapi_python_generated/models/profile_bio_entities_urls.py +96 -0
- twitter_openapi_python_generated/models/profile_response.py +1 -2
- twitter_openapi_python_generated/models/promoted_metadata.py +109 -0
- twitter_openapi_python_generated/models/reader_mode_config.py +89 -0
- twitter_openapi_python_generated/models/retweet.py +4 -7
- twitter_openapi_python_generated/models/scheduled_tweets_viewer.py +89 -0
- twitter_openapi_python_generated/models/scribe_config.py +89 -0
- twitter_openapi_python_generated/models/search_timeline_response.py +1 -2
- twitter_openapi_python_generated/models/self_thread.py +2 -5
- twitter_openapi_python_generated/models/session.py +8 -20
- twitter_openapi_python_generated/models/smarttag_tag.py +6 -2
- twitter_openapi_python_generated/models/smarttag_tag_info.py +93 -0
- twitter_openapi_python_generated/models/social_context_union.py +3 -2
- twitter_openapi_python_generated/models/symbol.py +97 -0
- twitter_openapi_python_generated/models/text.py +1 -2
- twitter_openapi_python_generated/models/timeline.py +13 -6
- twitter_openapi_python_generated/models/timeline_add_entries.py +1 -2
- twitter_openapi_python_generated/models/timeline_add_entry.py +4 -10
- twitter_openapi_python_generated/models/timeline_add_to_module.py +1 -2
- twitter_openapi_python_generated/models/timeline_frame.py +97 -0
- twitter_openapi_python_generated/models/timeline_half_cover.py +1 -2
- twitter_openapi_python_generated/models/timeline_label.py +101 -0
- twitter_openapi_python_generated/models/timeline_mark_entries_unread_greater_than_sort_index.py +2 -5
- twitter_openapi_python_generated/models/timeline_metadata.py +99 -0
- twitter_openapi_python_generated/models/timeline_response.py +1 -2
- twitter_openapi_python_generated/models/timeline_response_objects.py +96 -0
- twitter_openapi_python_generated/models/timeline_show_alert.py +19 -18
- twitter_openapi_python_generated/models/timeline_show_alert_color_config.py +93 -0
- twitter_openapi_python_generated/models/timeline_show_alert_icon_display_info.py +91 -0
- twitter_openapi_python_generated/models/timeline_show_alert_rich_text.py +3 -3
- twitter_openapi_python_generated/models/timeline_timeline_item.py +6 -2
- twitter_openapi_python_generated/models/timeline_timeline_module.py +19 -8
- twitter_openapi_python_generated/models/timeline_trend.py +16 -4
- twitter_openapi_python_generated/models/timeline_tweet.py +6 -2
- twitter_openapi_python_generated/models/timeline_twitter_list.py +101 -0
- twitter_openapi_python_generated/models/timelines_details.py +93 -0
- twitter_openapi_python_generated/models/tombstone_rich_text.py +1 -2
- twitter_openapi_python_generated/models/tracing.py +2 -5
- twitter_openapi_python_generated/models/trend_metadata.py +4 -2
- twitter_openapi_python_generated/models/trend_results.py +2 -5
- twitter_openapi_python_generated/models/tweet.py +23 -6
- twitter_openapi_python_generated/models/tweet_card_legacy.py +2 -4
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +6 -2
- twitter_openapi_python_generated/models/tweet_card_platform_device.py +2 -5
- twitter_openapi_python_generated/models/tweet_detail_response.py +1 -2
- twitter_openapi_python_generated/models/tweet_edit_control.py +6 -15
- twitter_openapi_python_generated/models/tweet_edit_control_initial.py +4 -10
- twitter_openapi_python_generated/models/tweet_favoriters_response.py +1 -2
- twitter_openapi_python_generated/models/tweet_interstitial_reveal_text.py +1 -2
- twitter_openapi_python_generated/models/tweet_interstitial_text.py +1 -2
- twitter_openapi_python_generated/models/tweet_legacy.py +21 -38
- twitter_openapi_python_generated/models/tweet_limited_action_results.py +1 -2
- twitter_openapi_python_generated/models/tweet_preview_display_tweet.py +5 -11
- twitter_openapi_python_generated/models/tweet_preview_display_tweet_view_count.py +2 -5
- twitter_openapi_python_generated/models/tweet_result_by_rest_id_response.py +1 -2
- twitter_openapi_python_generated/models/tweet_retweeters_response.py +1 -2
- twitter_openapi_python_generated/models/tweet_union.py +3 -2
- twitter_openapi_python_generated/models/tweet_view.py +2 -5
- twitter_openapi_python_generated/models/tweet_with_visibility_results.py +6 -2
- twitter_openapi_python_generated/models/twitter_list.py +160 -0
- twitter_openapi_python_generated/models/type_name.py +7 -0
- twitter_openapi_python_generated/models/unfavorite_tweet_response.py +1 -2
- twitter_openapi_python_generated/models/urt_endpoint_options.py +3 -4
- twitter_openapi_python_generated/models/user.py +81 -15
- twitter_openapi_python_generated/models/user_action_counts.py +89 -0
- twitter_openapi_python_generated/models/user_banner.py +89 -0
- twitter_openapi_python_generated/models/user_core.py +3 -6
- twitter_openapi_python_generated/models/user_highlights_tweets_response.py +1 -2
- twitter_openapi_python_generated/models/user_label.py +128 -0
- twitter_openapi_python_generated/models/user_label_badge.py +89 -0
- twitter_openapi_python_generated/models/user_label_mention_results.py +93 -0
- twitter_openapi_python_generated/models/user_label_mention_user.py +106 -0
- twitter_openapi_python_generated/models/user_label_mention_user_core.py +89 -0
- twitter_openapi_python_generated/models/user_label_text.py +98 -0
- twitter_openapi_python_generated/models/user_label_text_entity.py +97 -0
- twitter_openapi_python_generated/models/user_label_text_entity_ref.py +104 -0
- twitter_openapi_python_generated/models/user_label_url.py +98 -0
- twitter_openapi_python_generated/models/user_legacy.py +9 -8
- twitter_openapi_python_generated/models/user_mention.py +115 -0
- twitter_openapi_python_generated/models/user_notifications_settings.py +89 -0
- twitter_openapi_python_generated/models/user_pinned_items.py +90 -0
- twitter_openapi_python_generated/models/user_professional.py +10 -9
- twitter_openapi_python_generated/models/user_profile_metadata.py +89 -0
- twitter_openapi_python_generated/models/user_profile_translation.py +89 -0
- twitter_openapi_python_generated/models/user_relationship_counts.py +91 -0
- twitter_openapi_python_generated/models/user_relationship_perspectives.py +6 -2
- twitter_openapi_python_generated/models/user_response.py +1 -2
- twitter_openapi_python_generated/models/user_result_by_screen_name.py +2 -5
- twitter_openapi_python_generated/models/user_result_by_screen_name_result.py +8 -12
- twitter_openapi_python_generated/models/user_result_core.py +3 -1
- twitter_openapi_python_generated/models/user_results.py +3 -1
- twitter_openapi_python_generated/models/user_tweet_counts.py +91 -0
- twitter_openapi_python_generated/models/user_tweets_response.py +1 -2
- twitter_openapi_python_generated/models/user_union.py +6 -3
- twitter_openapi_python_generated/models/user_value.py +8 -9
- twitter_openapi_python_generated/models/user_verification_info_reason.py +2 -5
- twitter_openapi_python_generated/models/user_verification_info_reason_description.py +1 -2
- twitter_openapi_python_generated/models/user_website.py +89 -0
- twitter_openapi_python_generated/models/users_response.py +1 -2
- twitter_openapi_python_generated/models/users_response_data.py +1 -2
- twitter_openapi_python_generated/models/viewer_badge_counts_response.py +102 -0
- twitter_openapi_python_generated/models/viewer_badge_counts_response_data.py +93 -0
- twitter_openapi_python_generated/models/viewer_badge_counts_result.py +96 -0
- twitter_openapi_python_generated/models/viewer_badge_counts_user_results.py +93 -0
- twitter_openapi_python_generated/models/viewer_badge_counts_viewer.py +93 -0
- twitter_openapi_python_generated/rest.py +79 -8
- {twitter_openapi_python_generated-0.0.34.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/METADATA +980 -816
- {twitter_openapi_python_generated-0.0.34.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/RECORD +296 -160
- {twitter_openapi_python_generated-0.0.34.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/WHEEL +1 -1
- {twitter_openapi_python_generated-0.0.34.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/licenses/LICENSE +31 -31
- {twitter_openapi_python_generated-0.0.34.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/licenses/LICENSE.AGPL +660 -660
- {twitter_openapi_python_generated-0.0.34.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class TimelinesDetails(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
TimelinesDetails
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
controller_data: Optional[StrictStr] = Field(default=None, alias="controllerData")
|
|
32
|
+
injection_type: Optional[StrictStr] = Field(default=None, alias="injectionType")
|
|
33
|
+
source_data: Optional[StrictStr] = Field(default=None, alias="sourceData")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["controllerData", "injectionType", "sourceData"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of TimelinesDetails from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of TimelinesDetails from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"controllerData": obj.get("controllerData"),
|
|
88
|
+
"injectionType": obj.get("injectionType"),
|
|
89
|
+
"sourceData": obj.get("sourceData")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -77,8 +77,7 @@ class TombstoneRichText(BaseModel):
|
|
|
77
77
|
_items = []
|
|
78
78
|
if self.entities:
|
|
79
79
|
for _item_entities in self.entities:
|
|
80
|
-
if _item_entities
|
|
81
|
-
_items.append(_item_entities.to_dict())
|
|
80
|
+
_items.append(_item_entities.to_dict() if _item_entities is not None else None)
|
|
82
81
|
_dict['entities'] = _items
|
|
83
82
|
return _dict
|
|
84
83
|
|
|
@@ -32,13 +32,10 @@ class Tracing(BaseModel):
|
|
|
32
32
|
trace_id: Annotated[str, Field(strict=True)]
|
|
33
33
|
__properties: ClassVar[List[str]] = ["trace_id"]
|
|
34
34
|
|
|
35
|
-
@field_validator('trace_id')
|
|
35
|
+
@field_validator('trace_id', mode="before")
|
|
36
36
|
def trace_id_validate_regular_expression(cls, value):
|
|
37
37
|
"""Validates the regular expression"""
|
|
38
|
-
if
|
|
39
|
-
value = str(value)
|
|
40
|
-
|
|
41
|
-
if not re.match(r"^[0-9a-f]{16}$", value):
|
|
38
|
+
if isinstance(value, str) and not re.match(r"^[0-9a-f]{16}$", value):
|
|
42
39
|
raise ValueError(r"must validate the regular expression /^[0-9a-f]{16}$/")
|
|
43
40
|
return value
|
|
44
41
|
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.social_context_landing_url import SocialContextLandingUrl
|
|
24
24
|
from typing import Optional, Set
|
|
@@ -29,8 +29,9 @@ class TrendMetadata(BaseModel):
|
|
|
29
29
|
"""
|
|
30
30
|
TrendMetadata
|
|
31
31
|
""" # noqa: E501
|
|
32
|
+
domain_context: Optional[StrictStr] = None
|
|
32
33
|
url: Optional[SocialContextLandingUrl] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["url"]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["domain_context", "url"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
37
|
validate_by_name=True,
|
|
@@ -86,6 +87,7 @@ class TrendMetadata(BaseModel):
|
|
|
86
87
|
return cls.model_validate(obj)
|
|
87
88
|
|
|
88
89
|
_obj = cls.model_validate({
|
|
90
|
+
"domain_context": obj.get("domain_context"),
|
|
89
91
|
"url": SocialContextLandingUrl.from_dict(obj["url"]) if obj.get("url") is not None else None
|
|
90
92
|
})
|
|
91
93
|
return _obj
|
|
@@ -32,13 +32,10 @@ class TrendResults(BaseModel):
|
|
|
32
32
|
rest_id: Annotated[str, Field(strict=True)]
|
|
33
33
|
__properties: ClassVar[List[str]] = ["rest_id"]
|
|
34
34
|
|
|
35
|
-
@field_validator('rest_id')
|
|
35
|
+
@field_validator('rest_id', mode="before")
|
|
36
36
|
def rest_id_validate_regular_expression(cls, value):
|
|
37
37
|
"""Validates the regular expression"""
|
|
38
|
-
if
|
|
39
|
-
value = str(value)
|
|
40
|
-
|
|
41
|
-
if not re.match(r"^[0-9]+$", value):
|
|
38
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
42
39
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
43
40
|
return value
|
|
44
41
|
|
|
@@ -24,11 +24,13 @@ from typing_extensions import Annotated
|
|
|
24
24
|
from twitter_openapi_python_generated.models.article import Article
|
|
25
25
|
from twitter_openapi_python_generated.models.author_community_relationship import AuthorCommunityRelationship
|
|
26
26
|
from twitter_openapi_python_generated.models.birdwatch_pivot import BirdwatchPivot
|
|
27
|
+
from twitter_openapi_python_generated.models.cashtag_attachment import CashtagAttachment
|
|
27
28
|
from twitter_openapi_python_generated.models.community_relationship import CommunityRelationship
|
|
28
29
|
from twitter_openapi_python_generated.models.community_result import CommunityResult
|
|
29
30
|
from twitter_openapi_python_generated.models.content_disclosure import ContentDisclosure
|
|
30
31
|
from twitter_openapi_python_generated.models.grok_annotation import GrokAnnotation
|
|
31
32
|
from twitter_openapi_python_generated.models.grok_translated_post_with_availability import GrokTranslatedPostWithAvailability
|
|
33
|
+
from twitter_openapi_python_generated.models.jetfuel_attachment import JetfuelAttachment
|
|
32
34
|
from twitter_openapi_python_generated.models.note_tweet import NoteTweet
|
|
33
35
|
from twitter_openapi_python_generated.models.super_follows_reply_user_result import SuperFollowsReplyUserResult
|
|
34
36
|
from twitter_openapi_python_generated.models.trend_results import TrendResults
|
|
@@ -54,6 +56,7 @@ class Tweet(BaseModel):
|
|
|
54
56
|
author_community_relationship: Optional[AuthorCommunityRelationship] = None
|
|
55
57
|
birdwatch_pivot: Optional[BirdwatchPivot] = None
|
|
56
58
|
card: Optional[TweetCard] = None
|
|
59
|
+
cashtag_attachments: Optional[List[CashtagAttachment]] = None
|
|
57
60
|
community_relationship: Optional[CommunityRelationship] = None
|
|
58
61
|
community_results: Optional[CommunityResult] = None
|
|
59
62
|
content_disclosure: Optional[ContentDisclosure] = None
|
|
@@ -67,7 +70,9 @@ class Tweet(BaseModel):
|
|
|
67
70
|
grok_translated_post_with_availability: Optional[GrokTranslatedPostWithAvailability] = None
|
|
68
71
|
has_birdwatch_notes: Optional[StrictBool] = None
|
|
69
72
|
is_translatable: Optional[StrictBool] = None
|
|
73
|
+
jetfuel_attachment: Optional[JetfuelAttachment] = None
|
|
70
74
|
legacy: Optional[TweetLegacy] = None
|
|
75
|
+
nested_quoted_tweet_results: Optional[ItemResult] = None
|
|
71
76
|
note_tweet: Optional[NoteTweet] = None
|
|
72
77
|
post_cta: Optional[TweetPostCta] = Field(default=None, alias="postCta")
|
|
73
78
|
post_image_description: Optional[StrictStr] = None
|
|
@@ -83,15 +88,12 @@ class Tweet(BaseModel):
|
|
|
83
88
|
unified_card: Optional[UnifiedCard] = None
|
|
84
89
|
unmention_data: Optional[Dict[str, Any]] = None
|
|
85
90
|
views: Optional[TweetView] = None
|
|
86
|
-
__properties: ClassVar[List[str]] = ["__typename", "article", "author_community_relationship", "birdwatch_pivot", "card", "community_relationship", "community_results", "content_disclosure", "core", "edit_control", "edit_prespective", "grok_analysis_button", "grok_analysis_followups", "grok_annotations", "grok_share_attachment", "grok_translated_post_with_availability", "has_birdwatch_notes", "is_translatable", "legacy", "note_tweet", "postCta", "post_image_description", "post_video_description", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views"]
|
|
91
|
+
__properties: ClassVar[List[str]] = ["__typename", "article", "author_community_relationship", "birdwatch_pivot", "card", "cashtag_attachments", "community_relationship", "community_results", "content_disclosure", "core", "edit_control", "edit_prespective", "grok_analysis_button", "grok_analysis_followups", "grok_annotations", "grok_share_attachment", "grok_translated_post_with_availability", "has_birdwatch_notes", "is_translatable", "jetfuel_attachment", "legacy", "nested_quoted_tweet_results", "note_tweet", "postCta", "post_image_description", "post_video_description", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views"]
|
|
87
92
|
|
|
88
|
-
@field_validator('rest_id')
|
|
93
|
+
@field_validator('rest_id', mode="before")
|
|
89
94
|
def rest_id_validate_regular_expression(cls, value):
|
|
90
95
|
"""Validates the regular expression"""
|
|
91
|
-
if
|
|
92
|
-
value = str(value)
|
|
93
|
-
|
|
94
|
-
if not re.match(r"^[0-9]+$", value):
|
|
96
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
95
97
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
96
98
|
return value
|
|
97
99
|
|
|
@@ -146,6 +148,12 @@ class Tweet(BaseModel):
|
|
|
146
148
|
# override the default output from pydantic by calling `to_dict()` of card
|
|
147
149
|
if self.card:
|
|
148
150
|
_dict['card'] = self.card.to_dict()
|
|
151
|
+
# override the default output from pydantic by calling `to_dict()` of each item in cashtag_attachments (list)
|
|
152
|
+
_items = []
|
|
153
|
+
if self.cashtag_attachments:
|
|
154
|
+
for _item_cashtag_attachments in self.cashtag_attachments:
|
|
155
|
+
_items.append(_item_cashtag_attachments.to_dict() if _item_cashtag_attachments is not None else None)
|
|
156
|
+
_dict['cashtag_attachments'] = _items
|
|
149
157
|
# override the default output from pydantic by calling `to_dict()` of community_relationship
|
|
150
158
|
if self.community_relationship:
|
|
151
159
|
_dict['community_relationship'] = self.community_relationship.to_dict()
|
|
@@ -173,9 +181,15 @@ class Tweet(BaseModel):
|
|
|
173
181
|
# override the default output from pydantic by calling `to_dict()` of grok_translated_post_with_availability
|
|
174
182
|
if self.grok_translated_post_with_availability:
|
|
175
183
|
_dict['grok_translated_post_with_availability'] = self.grok_translated_post_with_availability.to_dict()
|
|
184
|
+
# override the default output from pydantic by calling `to_dict()` of jetfuel_attachment
|
|
185
|
+
if self.jetfuel_attachment:
|
|
186
|
+
_dict['jetfuel_attachment'] = self.jetfuel_attachment.to_dict()
|
|
176
187
|
# override the default output from pydantic by calling `to_dict()` of legacy
|
|
177
188
|
if self.legacy:
|
|
178
189
|
_dict['legacy'] = self.legacy.to_dict()
|
|
190
|
+
# override the default output from pydantic by calling `to_dict()` of nested_quoted_tweet_results
|
|
191
|
+
if self.nested_quoted_tweet_results:
|
|
192
|
+
_dict['nested_quoted_tweet_results'] = self.nested_quoted_tweet_results.to_dict()
|
|
179
193
|
# override the default output from pydantic by calling `to_dict()` of note_tweet
|
|
180
194
|
if self.note_tweet:
|
|
181
195
|
_dict['note_tweet'] = self.note_tweet.to_dict()
|
|
@@ -220,6 +234,7 @@ class Tweet(BaseModel):
|
|
|
220
234
|
"author_community_relationship": AuthorCommunityRelationship.from_dict(obj["author_community_relationship"]) if obj.get("author_community_relationship") is not None else None,
|
|
221
235
|
"birdwatch_pivot": BirdwatchPivot.from_dict(obj["birdwatch_pivot"]) if obj.get("birdwatch_pivot") is not None else None,
|
|
222
236
|
"card": TweetCard.from_dict(obj["card"]) if obj.get("card") is not None else None,
|
|
237
|
+
"cashtag_attachments": [CashtagAttachment.from_dict(_item) for _item in obj["cashtag_attachments"]] if obj.get("cashtag_attachments") is not None else None,
|
|
223
238
|
"community_relationship": CommunityRelationship.from_dict(obj["community_relationship"]) if obj.get("community_relationship") is not None else None,
|
|
224
239
|
"community_results": CommunityResult.from_dict(obj["community_results"]) if obj.get("community_results") is not None else None,
|
|
225
240
|
"content_disclosure": ContentDisclosure.from_dict(obj["content_disclosure"]) if obj.get("content_disclosure") is not None else None,
|
|
@@ -233,7 +248,9 @@ class Tweet(BaseModel):
|
|
|
233
248
|
"grok_translated_post_with_availability": GrokTranslatedPostWithAvailability.from_dict(obj["grok_translated_post_with_availability"]) if obj.get("grok_translated_post_with_availability") is not None else None,
|
|
234
249
|
"has_birdwatch_notes": obj.get("has_birdwatch_notes"),
|
|
235
250
|
"is_translatable": obj.get("is_translatable"),
|
|
251
|
+
"jetfuel_attachment": JetfuelAttachment.from_dict(obj["jetfuel_attachment"]) if obj.get("jetfuel_attachment") is not None else None,
|
|
236
252
|
"legacy": TweetLegacy.from_dict(obj["legacy"]) if obj.get("legacy") is not None else None,
|
|
253
|
+
"nested_quoted_tweet_results": ItemResult.from_dict(obj["nested_quoted_tweet_results"]) if obj.get("nested_quoted_tweet_results") is not None else None,
|
|
237
254
|
"note_tweet": NoteTweet.from_dict(obj["note_tweet"]) if obj.get("note_tweet") is not None else None,
|
|
238
255
|
"postCta": TweetPostCta.from_dict(obj["postCta"]) if obj.get("postCta") is not None else None,
|
|
239
256
|
"post_image_description": obj.get("post_image_description"),
|
|
@@ -81,8 +81,7 @@ class TweetCardLegacy(BaseModel):
|
|
|
81
81
|
_items = []
|
|
82
82
|
if self.binding_values:
|
|
83
83
|
for _item_binding_values in self.binding_values:
|
|
84
|
-
if _item_binding_values
|
|
85
|
-
_items.append(_item_binding_values.to_dict())
|
|
84
|
+
_items.append(_item_binding_values.to_dict() if _item_binding_values is not None else None)
|
|
86
85
|
_dict['binding_values'] = _items
|
|
87
86
|
# override the default output from pydantic by calling `to_dict()` of card_platform
|
|
88
87
|
if self.card_platform:
|
|
@@ -91,8 +90,7 @@ class TweetCardLegacy(BaseModel):
|
|
|
91
90
|
_items = []
|
|
92
91
|
if self.user_refs_results:
|
|
93
92
|
for _item_user_refs_results in self.user_refs_results:
|
|
94
|
-
if _item_user_refs_results
|
|
95
|
-
_items.append(_item_user_refs_results.to_dict())
|
|
93
|
+
_items.append(_item_user_refs_results.to_dict() if _item_user_refs_results is not None else None)
|
|
96
94
|
_dict['user_refs_results'] = _items
|
|
97
95
|
return _dict
|
|
98
96
|
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.media_color_info import MediaColorInfo
|
|
23
24
|
from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value_data_image import TweetCardLegacyBindingValueDataImage
|
|
24
25
|
from twitter_openapi_python_generated.models.user_value import UserValue
|
|
25
26
|
from typing import Optional, Set
|
|
@@ -31,7 +32,7 @@ class TweetCardLegacyBindingValueData(BaseModel):
|
|
|
31
32
|
TweetCardLegacyBindingValueData
|
|
32
33
|
""" # noqa: E501
|
|
33
34
|
boolean_value: Optional[StrictBool] = None
|
|
34
|
-
image_color_value: Optional[
|
|
35
|
+
image_color_value: Optional[MediaColorInfo] = None
|
|
35
36
|
image_value: Optional[TweetCardLegacyBindingValueDataImage] = None
|
|
36
37
|
scribe_key: Optional[StrictStr] = None
|
|
37
38
|
string_value: Optional[StrictStr] = None
|
|
@@ -78,6 +79,9 @@ class TweetCardLegacyBindingValueData(BaseModel):
|
|
|
78
79
|
exclude=excluded_fields,
|
|
79
80
|
exclude_none=True,
|
|
80
81
|
)
|
|
82
|
+
# override the default output from pydantic by calling `to_dict()` of image_color_value
|
|
83
|
+
if self.image_color_value:
|
|
84
|
+
_dict['image_color_value'] = self.image_color_value.to_dict()
|
|
81
85
|
# override the default output from pydantic by calling `to_dict()` of image_value
|
|
82
86
|
if self.image_value:
|
|
83
87
|
_dict['image_value'] = self.image_value.to_dict()
|
|
@@ -97,7 +101,7 @@ class TweetCardLegacyBindingValueData(BaseModel):
|
|
|
97
101
|
|
|
98
102
|
_obj = cls.model_validate({
|
|
99
103
|
"boolean_value": obj.get("boolean_value"),
|
|
100
|
-
"image_color_value": obj.get("image_color_value"),
|
|
104
|
+
"image_color_value": MediaColorInfo.from_dict(obj["image_color_value"]) if obj.get("image_color_value") is not None else None,
|
|
101
105
|
"image_value": TweetCardLegacyBindingValueDataImage.from_dict(obj["image_value"]) if obj.get("image_value") is not None else None,
|
|
102
106
|
"scribe_key": obj.get("scribe_key"),
|
|
103
107
|
"string_value": obj.get("string_value"),
|
|
@@ -33,13 +33,10 @@ class TweetCardPlatformDevice(BaseModel):
|
|
|
33
33
|
version: Annotated[str, Field(strict=True)]
|
|
34
34
|
__properties: ClassVar[List[str]] = ["name", "version"]
|
|
35
35
|
|
|
36
|
-
@field_validator('version')
|
|
36
|
+
@field_validator('version', mode="before")
|
|
37
37
|
def version_validate_regular_expression(cls, value):
|
|
38
38
|
"""Validates the regular expression"""
|
|
39
|
-
if
|
|
40
|
-
value = str(value)
|
|
41
|
-
|
|
42
|
-
if not re.match(r"^[0-9]+$", value):
|
|
39
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
43
40
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
44
41
|
return value
|
|
45
42
|
|
|
@@ -80,8 +80,7 @@ class TweetDetailResponse(BaseModel):
|
|
|
80
80
|
_items = []
|
|
81
81
|
if self.errors:
|
|
82
82
|
for _item_errors in self.errors:
|
|
83
|
-
if _item_errors
|
|
84
|
-
_items.append(_item_errors.to_dict())
|
|
83
|
+
_items.append(_item_errors.to_dict() if _item_errors is not None else None)
|
|
85
84
|
_dict['errors'] = _items
|
|
86
85
|
return _dict
|
|
87
86
|
|
|
@@ -38,42 +38,33 @@ class TweetEditControl(BaseModel):
|
|
|
38
38
|
is_edit_eligible: Optional[StrictBool] = None
|
|
39
39
|
__properties: ClassVar[List[str]] = ["edit_control_initial", "edit_tweet_ids", "editable_until_msecs", "edits_remaining", "initial_tweet_id", "is_edit_eligible"]
|
|
40
40
|
|
|
41
|
-
@field_validator('editable_until_msecs')
|
|
41
|
+
@field_validator('editable_until_msecs', mode="before")
|
|
42
42
|
def editable_until_msecs_validate_regular_expression(cls, value):
|
|
43
43
|
"""Validates the regular expression"""
|
|
44
44
|
if value is None:
|
|
45
45
|
return value
|
|
46
46
|
|
|
47
|
-
if
|
|
48
|
-
value = str(value)
|
|
49
|
-
|
|
50
|
-
if not re.match(r"^[0-9]+$", value):
|
|
47
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
51
48
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
52
49
|
return value
|
|
53
50
|
|
|
54
|
-
@field_validator('edits_remaining')
|
|
51
|
+
@field_validator('edits_remaining', mode="before")
|
|
55
52
|
def edits_remaining_validate_regular_expression(cls, value):
|
|
56
53
|
"""Validates the regular expression"""
|
|
57
54
|
if value is None:
|
|
58
55
|
return value
|
|
59
56
|
|
|
60
|
-
if
|
|
61
|
-
value = str(value)
|
|
62
|
-
|
|
63
|
-
if not re.match(r"^[0-9]+$", value):
|
|
57
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
64
58
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
65
59
|
return value
|
|
66
60
|
|
|
67
|
-
@field_validator('initial_tweet_id')
|
|
61
|
+
@field_validator('initial_tweet_id', mode="before")
|
|
68
62
|
def initial_tweet_id_validate_regular_expression(cls, value):
|
|
69
63
|
"""Validates the regular expression"""
|
|
70
64
|
if value is None:
|
|
71
65
|
return value
|
|
72
66
|
|
|
73
|
-
if
|
|
74
|
-
value = str(value)
|
|
75
|
-
|
|
76
|
-
if not re.match(r"^[0-9]+$", value):
|
|
67
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
77
68
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
78
69
|
return value
|
|
79
70
|
|
|
@@ -35,23 +35,17 @@ class TweetEditControlInitial(BaseModel):
|
|
|
35
35
|
is_edit_eligible: StrictBool
|
|
36
36
|
__properties: ClassVar[List[str]] = ["edit_tweet_ids", "editable_until_msecs", "edits_remaining", "is_edit_eligible"]
|
|
37
37
|
|
|
38
|
-
@field_validator('editable_until_msecs')
|
|
38
|
+
@field_validator('editable_until_msecs', mode="before")
|
|
39
39
|
def editable_until_msecs_validate_regular_expression(cls, value):
|
|
40
40
|
"""Validates the regular expression"""
|
|
41
|
-
if
|
|
42
|
-
value = str(value)
|
|
43
|
-
|
|
44
|
-
if not re.match(r"^[0-9]+$", value):
|
|
41
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
45
42
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
46
43
|
return value
|
|
47
44
|
|
|
48
|
-
@field_validator('edits_remaining')
|
|
45
|
+
@field_validator('edits_remaining', mode="before")
|
|
49
46
|
def edits_remaining_validate_regular_expression(cls, value):
|
|
50
47
|
"""Validates the regular expression"""
|
|
51
|
-
if
|
|
52
|
-
value = str(value)
|
|
53
|
-
|
|
54
|
-
if not re.match(r"^[0-9]+$", value):
|
|
48
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
55
49
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
56
50
|
return value
|
|
57
51
|
|
|
@@ -80,8 +80,7 @@ class TweetFavoritersResponse(BaseModel):
|
|
|
80
80
|
_items = []
|
|
81
81
|
if self.errors:
|
|
82
82
|
for _item_errors in self.errors:
|
|
83
|
-
if _item_errors
|
|
84
|
-
_items.append(_item_errors.to_dict())
|
|
83
|
+
_items.append(_item_errors.to_dict() if _item_errors is not None else None)
|
|
85
84
|
_dict['errors'] = _items
|
|
86
85
|
return _dict
|
|
87
86
|
|
|
@@ -77,8 +77,7 @@ class TweetInterstitialRevealText(BaseModel):
|
|
|
77
77
|
_items = []
|
|
78
78
|
if self.entities:
|
|
79
79
|
for _item_entities in self.entities:
|
|
80
|
-
if _item_entities
|
|
81
|
-
_items.append(_item_entities.to_dict())
|
|
80
|
+
_items.append(_item_entities.to_dict() if _item_entities is not None else None)
|
|
82
81
|
_dict['entities'] = _items
|
|
83
82
|
return _dict
|
|
84
83
|
|
|
@@ -77,8 +77,7 @@ class TweetInterstitialText(BaseModel):
|
|
|
77
77
|
_items = []
|
|
78
78
|
if self.entities:
|
|
79
79
|
for _item_entities in self.entities:
|
|
80
|
-
if _item_entities
|
|
81
|
-
_items.append(_item_entities.to_dict())
|
|
80
|
+
_items.append(_item_entities.to_dict() if _item_entities is not None else None)
|
|
82
81
|
_dict['entities'] = _items
|
|
83
82
|
return _dict
|
|
84
83
|
|
|
@@ -21,6 +21,7 @@ import json
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
|
+
from twitter_openapi_python_generated.models.conversation_control import ConversationControl
|
|
24
25
|
from twitter_openapi_python_generated.models.entities import Entities
|
|
25
26
|
from twitter_openapi_python_generated.models.extended_entities import ExtendedEntities
|
|
26
27
|
from twitter_openapi_python_generated.models.quoted_status_permalink import QuotedStatusPermalink
|
|
@@ -36,9 +37,9 @@ class TweetLegacy(BaseModel):
|
|
|
36
37
|
""" # noqa: E501
|
|
37
38
|
bookmark_count: StrictInt
|
|
38
39
|
bookmarked: StrictBool
|
|
39
|
-
conversation_control: Optional[
|
|
40
|
+
conversation_control: Optional[ConversationControl] = None
|
|
40
41
|
conversation_id_str: Annotated[str, Field(strict=True)]
|
|
41
|
-
created_at: Annotated[str, Field(strict=True)]
|
|
42
|
+
created_at: Annotated[str, Field(strict=True)] = Field(json_schema_extra={"examples": ["Sat Dec 31 23:59:59 +0000 2023"]})
|
|
42
43
|
display_text_range: List[StrictInt]
|
|
43
44
|
entities: Optional[Entities] = None
|
|
44
45
|
extended_entities: Optional[ExtendedEntities] = None
|
|
@@ -67,59 +68,44 @@ class TweetLegacy(BaseModel):
|
|
|
67
68
|
user_id_str: Annotated[str, Field(strict=True)]
|
|
68
69
|
__properties: ClassVar[List[str]] = ["bookmark_count", "bookmarked", "conversation_control", "conversation_id_str", "created_at", "display_text_range", "entities", "extended_entities", "favorite_count", "favorited", "full_text", "id_str", "in_reply_to_screen_name", "in_reply_to_status_id_str", "in_reply_to_user_id_str", "is_quote_status", "lang", "limited_actions", "place", "possibly_sensitive", "possibly_sensitive_editable", "quote_count", "quoted_status_id_str", "quoted_status_permalink", "reply_count", "retweet_count", "retweeted", "retweeted_status_result", "scopes", "self_thread", "user_id_str"]
|
|
69
70
|
|
|
70
|
-
@field_validator('conversation_id_str')
|
|
71
|
+
@field_validator('conversation_id_str', mode="before")
|
|
71
72
|
def conversation_id_str_validate_regular_expression(cls, value):
|
|
72
73
|
"""Validates the regular expression"""
|
|
73
|
-
if
|
|
74
|
-
value = str(value)
|
|
75
|
-
|
|
76
|
-
if not re.match(r"^[0-9]+$", value):
|
|
74
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
77
75
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
78
76
|
return value
|
|
79
77
|
|
|
80
|
-
@field_validator('created_at')
|
|
78
|
+
@field_validator('created_at', mode="before")
|
|
81
79
|
def created_at_validate_regular_expression(cls, value):
|
|
82
80
|
"""Validates the regular expression"""
|
|
83
|
-
if
|
|
84
|
-
value = str(value)
|
|
85
|
-
|
|
86
|
-
if not re.match(r"^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (0[1-9]|[12][0-9]|3[01]) (0[0-9]|1[0-9]|2[0-3])(: ?)([0-5][0-9])(: ?)([0-5][0-9]) ([+-][0-9]{4}) ([0-9]{4})$", value):
|
|
81
|
+
if isinstance(value, str) and not re.match(r"^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (0[1-9]|[12][0-9]|3[01]) (0[0-9]|1[0-9]|2[0-3])(: ?)([0-5][0-9])(: ?)([0-5][0-9]) ([+-][0-9]{4}) ([0-9]{4})$", value):
|
|
87
82
|
raise ValueError(r"must validate the regular expression /^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (0[1-9]|[12][0-9]|3[01]) (0[0-9]|1[0-9]|2[0-3])(: ?)([0-5][0-9])(: ?)([0-5][0-9]) ([+-][0-9]{4}) ([0-9]{4})$/")
|
|
88
83
|
return value
|
|
89
84
|
|
|
90
|
-
@field_validator('id_str')
|
|
85
|
+
@field_validator('id_str', mode="before")
|
|
91
86
|
def id_str_validate_regular_expression(cls, value):
|
|
92
87
|
"""Validates the regular expression"""
|
|
93
|
-
if
|
|
94
|
-
value = str(value)
|
|
95
|
-
|
|
96
|
-
if not re.match(r"^[0-9]+$", value):
|
|
88
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
97
89
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
98
90
|
return value
|
|
99
91
|
|
|
100
|
-
@field_validator('in_reply_to_status_id_str')
|
|
92
|
+
@field_validator('in_reply_to_status_id_str', mode="before")
|
|
101
93
|
def in_reply_to_status_id_str_validate_regular_expression(cls, value):
|
|
102
94
|
"""Validates the regular expression"""
|
|
103
95
|
if value is None:
|
|
104
96
|
return value
|
|
105
97
|
|
|
106
|
-
if
|
|
107
|
-
value = str(value)
|
|
108
|
-
|
|
109
|
-
if not re.match(r"^[0-9]+$", value):
|
|
98
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
110
99
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
111
100
|
return value
|
|
112
101
|
|
|
113
|
-
@field_validator('in_reply_to_user_id_str')
|
|
102
|
+
@field_validator('in_reply_to_user_id_str', mode="before")
|
|
114
103
|
def in_reply_to_user_id_str_validate_regular_expression(cls, value):
|
|
115
104
|
"""Validates the regular expression"""
|
|
116
105
|
if value is None:
|
|
117
106
|
return value
|
|
118
107
|
|
|
119
|
-
if
|
|
120
|
-
value = str(value)
|
|
121
|
-
|
|
122
|
-
if not re.match(r"^[0-9]+$", value):
|
|
108
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
123
109
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
124
110
|
return value
|
|
125
111
|
|
|
@@ -133,26 +119,20 @@ class TweetLegacy(BaseModel):
|
|
|
133
119
|
raise ValueError("must be one of enum values ('limited_replies', 'non_compliant', 'dynamic_product_ad', 'stale_tweet', 'community_tweet_non_member_public_community', 'community_tweet_non_member_closed_community', 'blocked_viewer')")
|
|
134
120
|
return value
|
|
135
121
|
|
|
136
|
-
@field_validator('quoted_status_id_str')
|
|
122
|
+
@field_validator('quoted_status_id_str', mode="before")
|
|
137
123
|
def quoted_status_id_str_validate_regular_expression(cls, value):
|
|
138
124
|
"""Validates the regular expression"""
|
|
139
125
|
if value is None:
|
|
140
126
|
return value
|
|
141
127
|
|
|
142
|
-
if
|
|
143
|
-
value = str(value)
|
|
144
|
-
|
|
145
|
-
if not re.match(r"^[0-9]+$", value):
|
|
128
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
146
129
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
147
130
|
return value
|
|
148
131
|
|
|
149
|
-
@field_validator('user_id_str')
|
|
132
|
+
@field_validator('user_id_str', mode="before")
|
|
150
133
|
def user_id_str_validate_regular_expression(cls, value):
|
|
151
134
|
"""Validates the regular expression"""
|
|
152
|
-
if
|
|
153
|
-
value = str(value)
|
|
154
|
-
|
|
155
|
-
if not re.match(r"^[0-9]+$", value):
|
|
135
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
156
136
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
157
137
|
return value
|
|
158
138
|
|
|
@@ -195,6 +175,9 @@ class TweetLegacy(BaseModel):
|
|
|
195
175
|
exclude=excluded_fields,
|
|
196
176
|
exclude_none=True,
|
|
197
177
|
)
|
|
178
|
+
# override the default output from pydantic by calling `to_dict()` of conversation_control
|
|
179
|
+
if self.conversation_control:
|
|
180
|
+
_dict['conversation_control'] = self.conversation_control.to_dict()
|
|
198
181
|
# override the default output from pydantic by calling `to_dict()` of entities
|
|
199
182
|
if self.entities:
|
|
200
183
|
_dict['entities'] = self.entities.to_dict()
|
|
@@ -227,7 +210,7 @@ class TweetLegacy(BaseModel):
|
|
|
227
210
|
_obj = cls.model_validate({
|
|
228
211
|
"bookmark_count": obj.get("bookmark_count"),
|
|
229
212
|
"bookmarked": obj.get("bookmarked"),
|
|
230
|
-
"conversation_control": obj.get("conversation_control"),
|
|
213
|
+
"conversation_control": ConversationControl.from_dict(obj["conversation_control"]) if obj.get("conversation_control") is not None else None,
|
|
231
214
|
"conversation_id_str": obj.get("conversation_id_str"),
|
|
232
215
|
"created_at": obj.get("created_at"),
|
|
233
216
|
"display_text_range": obj.get("display_text_range"),
|
|
@@ -75,8 +75,7 @@ class TweetLimitedActionResults(BaseModel):
|
|
|
75
75
|
_items = []
|
|
76
76
|
if self.limited_actions:
|
|
77
77
|
for _item_limited_actions in self.limited_actions:
|
|
78
|
-
if _item_limited_actions
|
|
79
|
-
_items.append(_item_limited_actions.to_dict())
|
|
78
|
+
_items.append(_item_limited_actions.to_dict() if _item_limited_actions is not None else None)
|
|
80
79
|
_dict['limited_actions'] = _items
|
|
81
80
|
return _dict
|
|
82
81
|
|