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,91 @@
|
|
|
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, StrictInt
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class UserTweetCounts(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
UserTweetCounts
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
media_tweets: StrictInt
|
|
32
|
+
tweets: StrictInt
|
|
33
|
+
__properties: ClassVar[List[str]] = ["media_tweets", "tweets"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of UserTweetCounts from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of UserTweetCounts from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"media_tweets": obj.get("media_tweets"),
|
|
87
|
+
"tweets": obj.get("tweets")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -80,8 +80,7 @@ class UserTweetsResponse(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
|
|
|
@@ -18,7 +18,6 @@ import json
|
|
|
18
18
|
import pprint
|
|
19
19
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
20
|
from typing import Any, List, Optional
|
|
21
|
-
from twitter_openapi_python_generated.models.user import User
|
|
22
21
|
from twitter_openapi_python_generated.models.user_unavailable import UserUnavailable
|
|
23
22
|
from pydantic import StrictStr, Field
|
|
24
23
|
from typing import Union, List, Set, Optional, Dict
|
|
@@ -92,9 +91,10 @@ class UserUnion(BaseModel):
|
|
|
92
91
|
match = 0
|
|
93
92
|
|
|
94
93
|
# use oneOf discriminator to lookup the data type
|
|
95
|
-
|
|
94
|
+
_discriminator_property = "__typename"
|
|
95
|
+
_data_type = json.loads(json_str).get(_discriminator_property)
|
|
96
96
|
if not _data_type:
|
|
97
|
-
raise ValueError("Failed to lookup data type from the field `
|
|
97
|
+
raise ValueError(f"Failed to lookup data type from the field `{_discriminator_property}` in the input.")
|
|
98
98
|
|
|
99
99
|
# check if data type is `User`
|
|
100
100
|
if _data_type == "User":
|
|
@@ -153,4 +153,7 @@ class UserUnion(BaseModel):
|
|
|
153
153
|
"""Returns the string representation of the actual instance"""
|
|
154
154
|
return pprint.pformat(self.model_dump())
|
|
155
155
|
|
|
156
|
+
from twitter_openapi_python_generated.models.user import User
|
|
157
|
+
# TODO: Rewrite to not use raise_errors
|
|
158
|
+
UserUnion.model_rebuild(raise_errors=False)
|
|
156
159
|
|
|
@@ -18,8 +18,8 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -30,15 +30,13 @@ class UserValue(BaseModel):
|
|
|
30
30
|
UserValue
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
id_str: Annotated[str, Field(strict=True)]
|
|
33
|
-
|
|
33
|
+
path: Optional[List[StrictStr]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id_str", "path"]
|
|
34
35
|
|
|
35
|
-
@field_validator('id_str')
|
|
36
|
+
@field_validator('id_str', mode="before")
|
|
36
37
|
def id_str_validate_regular_expression(cls, value):
|
|
37
38
|
"""Validates the regular expression"""
|
|
38
|
-
if
|
|
39
|
-
value = str(value)
|
|
40
|
-
|
|
41
|
-
if not re.match(r"^[0-9]+$", value):
|
|
39
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
42
40
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
43
41
|
return value
|
|
44
42
|
|
|
@@ -93,7 +91,8 @@ class UserValue(BaseModel):
|
|
|
93
91
|
return cls.model_validate(obj)
|
|
94
92
|
|
|
95
93
|
_obj = cls.model_validate({
|
|
96
|
-
"id_str": obj.get("id_str")
|
|
94
|
+
"id_str": obj.get("id_str"),
|
|
95
|
+
"path": obj.get("path")
|
|
97
96
|
})
|
|
98
97
|
return _obj
|
|
99
98
|
|
|
@@ -35,13 +35,10 @@ class UserVerificationInfoReason(BaseModel):
|
|
|
35
35
|
verified_since_msec: Annotated[str, Field(strict=True)]
|
|
36
36
|
__properties: ClassVar[List[str]] = ["description", "override_verified_year", "verified_since_msec"]
|
|
37
37
|
|
|
38
|
-
@field_validator('verified_since_msec')
|
|
38
|
+
@field_validator('verified_since_msec', mode="before")
|
|
39
39
|
def verified_since_msec_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
|
|
|
@@ -76,8 +76,7 @@ class UserVerificationInfoReasonDescription(BaseModel):
|
|
|
76
76
|
_items = []
|
|
77
77
|
if self.entities:
|
|
78
78
|
for _item_entities in self.entities:
|
|
79
|
-
if _item_entities
|
|
80
|
-
_items.append(_item_entities.to_dict())
|
|
79
|
+
_items.append(_item_entities.to_dict() if _item_entities is not None else None)
|
|
81
80
|
_dict['entities'] = _items
|
|
82
81
|
return _dict
|
|
83
82
|
|
|
@@ -0,0 +1,89 @@
|
|
|
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, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class UserWebsite(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
UserWebsite
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
url: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["url"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
validate_by_name=True,
|
|
36
|
+
validate_by_alias=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of UserWebsite from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of UserWebsite from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"url": obj.get("url")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -80,8 +80,7 @@ class UsersResponse(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
|
|
|
@@ -75,8 +75,7 @@ class UsersResponseData(BaseModel):
|
|
|
75
75
|
_items = []
|
|
76
76
|
if self.users:
|
|
77
77
|
for _item_users in self.users:
|
|
78
|
-
if _item_users
|
|
79
|
-
_items.append(_item_users.to_dict())
|
|
78
|
+
_items.append(_item_users.to_dict() if _item_users is not None else None)
|
|
80
79
|
_dict['users'] = _items
|
|
81
80
|
return _dict
|
|
82
81
|
|
|
@@ -0,0 +1,102 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.error_response import ErrorResponse
|
|
24
|
+
from twitter_openapi_python_generated.models.viewer_badge_counts_response_data import ViewerBadgeCountsResponseData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class ViewerBadgeCountsResponse(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
ViewerBadgeCountsResponse
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
data: ViewerBadgeCountsResponseData
|
|
34
|
+
errors: Optional[List[ErrorResponse]] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["data", "errors"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of ViewerBadgeCountsResponse from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
77
|
+
if self.data:
|
|
78
|
+
_dict['data'] = self.data.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
|
|
80
|
+
_items = []
|
|
81
|
+
if self.errors:
|
|
82
|
+
for _item_errors in self.errors:
|
|
83
|
+
_items.append(_item_errors.to_dict() if _item_errors is not None else None)
|
|
84
|
+
_dict['errors'] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of ViewerBadgeCountsResponse from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"data": ViewerBadgeCountsResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None,
|
|
98
|
+
"errors": [ErrorResponse.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.viewer_badge_counts_viewer import ViewerBadgeCountsViewer
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class ViewerBadgeCountsResponseData(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ViewerBadgeCountsResponseData
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
viewer_v2: ViewerBadgeCountsViewer
|
|
33
|
+
__properties: ClassVar[List[str]] = ["viewer_v2"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of ViewerBadgeCountsResponseData from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of viewer_v2
|
|
75
|
+
if self.viewer_v2:
|
|
76
|
+
_dict['viewer_v2'] = self.viewer_v2.to_dict()
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of ViewerBadgeCountsResponseData from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"viewer_v2": ViewerBadgeCountsViewer.from_dict(obj["viewer_v2"]) if obj.get("viewer_v2") is not None else None
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.badge_counts import BadgeCounts
|
|
24
|
+
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class ViewerBadgeCountsResult(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
ViewerBadgeCountsResult
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
typename: TypeName = Field(alias="__typename")
|
|
34
|
+
badge_counts: BadgeCounts
|
|
35
|
+
__properties: ClassVar[List[str]] = ["__typename", "badge_counts"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of ViewerBadgeCountsResult from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of badge_counts
|
|
77
|
+
if self.badge_counts:
|
|
78
|
+
_dict['badge_counts'] = self.badge_counts.to_dict()
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of ViewerBadgeCountsResult from a dict"""
|
|
84
|
+
if obj is None:
|
|
85
|
+
return None
|
|
86
|
+
|
|
87
|
+
if not isinstance(obj, dict):
|
|
88
|
+
return cls.model_validate(obj)
|
|
89
|
+
|
|
90
|
+
_obj = cls.model_validate({
|
|
91
|
+
"__typename": obj.get("__typename"),
|
|
92
|
+
"badge_counts": BadgeCounts.from_dict(obj["badge_counts"]) if obj.get("badge_counts") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|