twitter-openapi-python-generated 0.0.9__py3-none-any.whl → 0.0.11__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 +59 -2
- twitter_openapi_python_generated/api/default_api.py +5 -13
- twitter_openapi_python_generated/api/other_api.py +4 -11
- twitter_openapi_python_generated/api/post_api.py +10 -19
- twitter_openapi_python_generated/api/tweet_api.py +14 -22
- twitter_openapi_python_generated/api/user_api.py +5 -13
- twitter_openapi_python_generated/api/user_list_api.py +8 -16
- twitter_openapi_python_generated/api/users_api.py +4 -12
- twitter_openapi_python_generated/api/v11_get_api.py +5 -13
- twitter_openapi_python_generated/api/v11_post_api.py +5 -13
- twitter_openapi_python_generated/api/v20_get_api.py +4 -12
- twitter_openapi_python_generated/api_client.py +45 -18
- twitter_openapi_python_generated/api_response.py +3 -3
- twitter_openapi_python_generated/configuration.py +5 -3
- twitter_openapi_python_generated/exceptions.py +0 -1
- twitter_openapi_python_generated/models/__init__.py +58 -1
- twitter_openapi_python_generated/models/additional_media_info.py +30 -13
- twitter_openapi_python_generated/models/additional_media_info_call_to_actions.py +92 -0
- twitter_openapi_python_generated/models/additional_media_info_call_to_actions_visit_site.py +88 -0
- twitter_openapi_python_generated/models/author_community_relationship.py +110 -0
- twitter_openapi_python_generated/models/birdwatch_entity.py +10 -12
- twitter_openapi_python_generated/models/birdwatch_entity_ref.py +11 -13
- twitter_openapi_python_generated/models/birdwatch_pivot.py +21 -17
- twitter_openapi_python_generated/models/birdwatch_pivot_call_to_action.py +92 -0
- twitter_openapi_python_generated/models/birdwatch_pivot_footer.py +10 -11
- twitter_openapi_python_generated/models/birdwatch_pivot_note.py +9 -11
- twitter_openapi_python_generated/models/birdwatch_pivot_subtitle.py +10 -11
- twitter_openapi_python_generated/models/bookmarks_response.py +10 -11
- twitter_openapi_python_generated/models/bookmarks_response_data.py +10 -11
- twitter_openapi_python_generated/models/bookmarks_timeline.py +10 -11
- twitter_openapi_python_generated/models/callback.py +9 -10
- twitter_openapi_python_generated/models/client_event_info.py +9 -10
- twitter_openapi_python_generated/models/communities_actions.py +9 -10
- twitter_openapi_python_generated/models/community.py +92 -0
- twitter_openapi_python_generated/models/community_actions.py +110 -0
- twitter_openapi_python_generated/models/community_data.py +210 -0
- twitter_openapi_python_generated/models/community_delete_action_result.py +98 -0
- twitter_openapi_python_generated/models/community_invites_result.py +100 -0
- twitter_openapi_python_generated/models/community_join_action_result.py +89 -0
- twitter_openapi_python_generated/models/community_join_requests_result.py +89 -0
- twitter_openapi_python_generated/models/community_leave_action_result.py +100 -0
- twitter_openapi_python_generated/models/community_pin_action_result.py +89 -0
- twitter_openapi_python_generated/models/community_rule.py +100 -0
- twitter_openapi_python_generated/models/community_urls.py +92 -0
- twitter_openapi_python_generated/models/community_urls_permalink.py +88 -0
- twitter_openapi_python_generated/models/content_entry_type.py +1 -9
- twitter_openapi_python_generated/models/content_item_type.py +1 -9
- twitter_openapi_python_generated/models/content_union.py +8 -17
- twitter_openapi_python_generated/models/cover_cta.py +13 -15
- twitter_openapi_python_generated/models/create_retweet.py +10 -11
- twitter_openapi_python_generated/models/create_retweet_response.py +10 -11
- twitter_openapi_python_generated/models/create_retweet_response_data.py +10 -11
- twitter_openapi_python_generated/models/create_retweet_response_result.py +10 -11
- twitter_openapi_python_generated/models/create_tweet.py +10 -11
- twitter_openapi_python_generated/models/create_tweet_response.py +10 -11
- twitter_openapi_python_generated/models/create_tweet_response_data.py +10 -11
- twitter_openapi_python_generated/models/create_tweet_response_result.py +10 -11
- twitter_openapi_python_generated/models/cta_client_event_info.py +10 -11
- twitter_openapi_python_generated/models/cursor_type.py +1 -9
- twitter_openapi_python_generated/models/delete_retweet.py +10 -11
- twitter_openapi_python_generated/models/delete_retweet_response.py +10 -11
- twitter_openapi_python_generated/models/delete_retweet_response_data.py +10 -11
- twitter_openapi_python_generated/models/delete_retweet_response_result.py +10 -11
- twitter_openapi_python_generated/models/delete_tweet_response.py +10 -11
- twitter_openapi_python_generated/models/delete_tweet_response_data.py +10 -11
- twitter_openapi_python_generated/models/delete_tweet_response_result.py +9 -10
- twitter_openapi_python_generated/models/display_treatment.py +88 -0
- twitter_openapi_python_generated/models/display_type.py +40 -0
- twitter_openapi_python_generated/models/entities.py +11 -12
- twitter_openapi_python_generated/models/error.py +12 -13
- twitter_openapi_python_generated/models/error_extensions.py +10 -11
- twitter_openapi_python_generated/models/error_response.py +10 -11
- twitter_openapi_python_generated/models/errors.py +10 -11
- twitter_openapi_python_generated/models/ext_media_availability.py +10 -11
- twitter_openapi_python_generated/models/extended_entities.py +10 -11
- twitter_openapi_python_generated/models/extensions.py +10 -11
- twitter_openapi_python_generated/models/favorite_tweet.py +9 -10
- twitter_openapi_python_generated/models/favorite_tweet_response_data.py +10 -11
- twitter_openapi_python_generated/models/{social_context.py → feedback_info.py} +17 -23
- twitter_openapi_python_generated/models/follow_response.py +10 -11
- twitter_openapi_python_generated/models/follow_response_data.py +10 -11
- twitter_openapi_python_generated/models/follow_response_result.py +10 -12
- twitter_openapi_python_generated/models/follow_response_user.py +10 -11
- twitter_openapi_python_generated/models/follow_timeline.py +10 -11
- twitter_openapi_python_generated/models/get_bookmarks200_response.py +8 -17
- twitter_openapi_python_generated/models/get_favoriters200_response.py +8 -17
- twitter_openapi_python_generated/models/get_followers200_response.py +8 -17
- twitter_openapi_python_generated/models/get_home_latest_timeline200_response.py +8 -17
- twitter_openapi_python_generated/models/get_likes200_response.py +8 -17
- twitter_openapi_python_generated/models/get_list_latest_tweets_timeline200_response.py +8 -17
- twitter_openapi_python_generated/models/get_profile_spotlights_query200_response.py +8 -17
- twitter_openapi_python_generated/models/get_retweeters200_response.py +8 -17
- twitter_openapi_python_generated/models/get_search_timeline200_response.py +8 -17
- twitter_openapi_python_generated/models/get_tweet_detail200_response.py +8 -17
- twitter_openapi_python_generated/models/get_tweet_result_by_rest_id200_response.py +8 -17
- twitter_openapi_python_generated/models/get_user_by_rest_id200_response.py +8 -17
- twitter_openapi_python_generated/models/get_user_highlights_tweets200_response.py +8 -17
- twitter_openapi_python_generated/models/get_users_by_rest_ids200_response.py +8 -17
- twitter_openapi_python_generated/models/highlight.py +96 -0
- twitter_openapi_python_generated/models/home_timeline_home.py +10 -11
- twitter_openapi_python_generated/models/home_timeline_response_data.py +10 -11
- twitter_openapi_python_generated/models/instruction_type.py +1 -9
- twitter_openapi_python_generated/models/instruction_union.py +8 -17
- twitter_openapi_python_generated/models/item_content_union.py +8 -17
- twitter_openapi_python_generated/models/item_result.py +10 -12
- twitter_openapi_python_generated/models/list_latest_tweets_timeline_response.py +10 -11
- twitter_openapi_python_generated/models/list_tweets_timeline.py +10 -11
- twitter_openapi_python_generated/models/list_tweets_timeline_data.py +10 -11
- twitter_openapi_python_generated/models/list_tweets_timeline_list.py +10 -11
- twitter_openapi_python_generated/models/location.py +9 -10
- twitter_openapi_python_generated/models/media.py +52 -16
- twitter_openapi_python_generated/models/media_extended.py +43 -19
- twitter_openapi_python_generated/models/media_original_info.py +10 -11
- twitter_openapi_python_generated/models/media_original_info_focus_rect.py +9 -10
- twitter_openapi_python_generated/models/media_size.py +10 -11
- twitter_openapi_python_generated/models/media_sizes.py +13 -14
- twitter_openapi_python_generated/models/media_stats.py +9 -11
- twitter_openapi_python_generated/models/media_video_info.py +10 -11
- twitter_openapi_python_generated/models/media_video_info_variant.py +9 -10
- twitter_openapi_python_generated/models/module_entry.py +11 -13
- twitter_openapi_python_generated/models/module_item.py +10 -12
- twitter_openapi_python_generated/models/note_tweet.py +10 -11
- twitter_openapi_python_generated/models/note_tweet_result.py +10 -11
- twitter_openapi_python_generated/models/note_tweet_result_data.py +12 -14
- twitter_openapi_python_generated/models/note_tweet_result_media.py +10 -11
- twitter_openapi_python_generated/models/note_tweet_result_media_inline_media.py +9 -11
- twitter_openapi_python_generated/models/note_tweet_result_rich_text.py +10 -11
- twitter_openapi_python_generated/models/note_tweet_result_rich_text_tag.py +10 -11
- twitter_openapi_python_generated/models/one_factor_login_eligibility.py +9 -11
- twitter_openapi_python_generated/models/other200_response.py +8 -17
- twitter_openapi_python_generated/models/other_response.py +10 -12
- twitter_openapi_python_generated/models/post_create_retweet200_response.py +8 -17
- twitter_openapi_python_generated/models/post_create_retweet_request.py +10 -12
- twitter_openapi_python_generated/models/post_create_retweet_request_variables.py +9 -10
- twitter_openapi_python_generated/models/post_create_tweet200_response.py +8 -17
- twitter_openapi_python_generated/models/post_create_tweet_request.py +12 -14
- twitter_openapi_python_generated/models/post_create_tweet_request_features.py +15 -12
- twitter_openapi_python_generated/models/post_create_tweet_request_variables.py +11 -12
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_media.py +10 -11
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_media_media_entities_inner.py +9 -10
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_reply.py +9 -10
- twitter_openapi_python_generated/models/post_delete_retweet200_response.py +8 -17
- twitter_openapi_python_generated/models/post_delete_retweet_request.py +10 -12
- twitter_openapi_python_generated/models/post_delete_retweet_request_variables.py +9 -10
- twitter_openapi_python_generated/models/post_delete_tweet200_response.py +8 -17
- twitter_openapi_python_generated/models/post_delete_tweet_request.py +10 -12
- twitter_openapi_python_generated/models/post_favorite_tweet200_response.py +8 -17
- twitter_openapi_python_generated/models/post_favorite_tweet_request.py +10 -12
- twitter_openapi_python_generated/models/post_unfavorite_tweet200_response.py +8 -17
- twitter_openapi_python_generated/models/post_unfavorite_tweet_request.py +10 -12
- twitter_openapi_python_generated/models/primary_community_topic.py +98 -0
- twitter_openapi_python_generated/models/profile_response.py +10 -11
- twitter_openapi_python_generated/models/profile_response_data.py +10 -11
- twitter_openapi_python_generated/models/quoted_ref_result.py +92 -0
- twitter_openapi_python_generated/models/quoted_ref_result_data.py +99 -0
- twitter_openapi_python_generated/models/quoted_status_permalink.py +92 -0
- twitter_openapi_python_generated/models/retweet.py +10 -12
- twitter_openapi_python_generated/models/retweet_legacy.py +9 -10
- twitter_openapi_python_generated/models/search_by_raw_query.py +10 -11
- twitter_openapi_python_generated/models/search_timeline.py +10 -11
- twitter_openapi_python_generated/models/search_timeline_data.py +10 -11
- twitter_openapi_python_generated/models/search_timeline_response.py +10 -11
- twitter_openapi_python_generated/models/self_thread.py +9 -11
- twitter_openapi_python_generated/models/session.py +13 -15
- twitter_openapi_python_generated/models/social_context_landing_url.py +106 -0
- twitter_openapi_python_generated/models/social_context_union.py +156 -0
- twitter_openapi_python_generated/models/social_context_union_type.py +38 -0
- twitter_openapi_python_generated/models/super_follows_reply_user_result.py +92 -0
- twitter_openapi_python_generated/models/super_follows_reply_user_result_data.py +95 -0
- twitter_openapi_python_generated/models/super_follows_reply_user_result_legacy.py +88 -0
- twitter_openapi_python_generated/models/text.py +10 -11
- twitter_openapi_python_generated/models/text_entity.py +10 -12
- twitter_openapi_python_generated/models/text_entity_ref.py +11 -13
- twitter_openapi_python_generated/models/text_highlight.py +90 -0
- twitter_openapi_python_generated/models/timeline.py +10 -12
- twitter_openapi_python_generated/models/timeline_add_entries.py +10 -11
- twitter_openapi_python_generated/models/timeline_add_entry.py +10 -12
- twitter_openapi_python_generated/models/timeline_add_to_module.py +10 -12
- twitter_openapi_python_generated/models/timeline_clear_cache.py +9 -10
- twitter_openapi_python_generated/models/timeline_community.py +10 -12
- twitter_openapi_python_generated/models/timeline_cover_behavior.py +10 -11
- twitter_openapi_python_generated/models/timeline_general_context.py +109 -0
- twitter_openapi_python_generated/models/timeline_half_cover.py +15 -17
- twitter_openapi_python_generated/models/timeline_message_prompt.py +10 -12
- twitter_openapi_python_generated/models/timeline_pin_entry.py +10 -11
- twitter_openapi_python_generated/models/timeline_prompt.py +10 -12
- twitter_openapi_python_generated/models/timeline_replace_entry.py +10 -11
- twitter_openapi_python_generated/models/timeline_response.py +10 -11
- twitter_openapi_python_generated/models/timeline_show_alert.py +13 -15
- twitter_openapi_python_generated/models/timeline_show_alert_rich_text.py +9 -10
- twitter_openapi_python_generated/models/timeline_show_cover.py +11 -13
- twitter_openapi_python_generated/models/timeline_terminate_timeline.py +10 -11
- twitter_openapi_python_generated/models/timeline_timeline_cursor.py +18 -12
- twitter_openapi_python_generated/models/timeline_timeline_item.py +11 -13
- twitter_openapi_python_generated/models/timeline_timeline_module.py +21 -21
- twitter_openapi_python_generated/models/timeline_topic_context.py +107 -0
- twitter_openapi_python_generated/models/timeline_tweet.py +21 -17
- twitter_openapi_python_generated/models/timeline_user.py +16 -18
- twitter_openapi_python_generated/models/timeline_v2.py +10 -11
- twitter_openapi_python_generated/models/topic_context.py +100 -0
- twitter_openapi_python_generated/models/tracing.py +9 -11
- twitter_openapi_python_generated/models/tweet.py +51 -21
- twitter_openapi_python_generated/models/tweet_card.py +10 -11
- twitter_openapi_python_generated/models/tweet_card_legacy.py +28 -13
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value.py +10 -11
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +25 -12
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data_image.py +94 -0
- twitter_openapi_python_generated/models/tweet_card_platform.py +98 -0
- twitter_openapi_python_generated/models/tweet_card_platform_audience.py +95 -0
- twitter_openapi_python_generated/models/tweet_card_platform_data.py +92 -0
- twitter_openapi_python_generated/models/tweet_card_platform_device.py +98 -0
- twitter_openapi_python_generated/models/tweet_detail_response.py +10 -11
- twitter_openapi_python_generated/models/tweet_detail_response_data.py +10 -11
- twitter_openapi_python_generated/models/tweet_edit_control.py +10 -12
- twitter_openapi_python_generated/models/tweet_edit_control_initial.py +9 -11
- twitter_openapi_python_generated/models/tweet_edit_prespective.py +9 -10
- twitter_openapi_python_generated/models/tweet_favoriters_response.py +10 -11
- twitter_openapi_python_generated/models/tweet_favoriters_response_data.py +10 -11
- twitter_openapi_python_generated/models/tweet_interstitial.py +110 -0
- twitter_openapi_python_generated/models/tweet_interstitial_reveal_text.py +100 -0
- twitter_openapi_python_generated/models/tweet_interstitial_text.py +100 -0
- twitter_openapi_python_generated/models/tweet_interstitial_text_entity.py +96 -0
- twitter_openapi_python_generated/models/tweet_interstitial_text_entity_ref.py +106 -0
- twitter_openapi_python_generated/models/tweet_legacy.py +80 -16
- twitter_openapi_python_generated/models/tweet_legacy_scopes.py +88 -0
- twitter_openapi_python_generated/models/tweet_previous_counts.py +96 -0
- twitter_openapi_python_generated/models/tweet_result_by_rest_id_data.py +10 -12
- twitter_openapi_python_generated/models/tweet_result_by_rest_id_response.py +10 -11
- twitter_openapi_python_generated/models/tweet_retweeters_response.py +10 -11
- twitter_openapi_python_generated/models/tweet_retweeters_response_data.py +10 -11
- twitter_openapi_python_generated/models/tweet_tombstone.py +10 -12
- twitter_openapi_python_generated/models/tweet_union.py +8 -17
- twitter_openapi_python_generated/models/tweet_view.py +10 -12
- twitter_openapi_python_generated/models/tweet_with_visibility_results.py +20 -14
- twitter_openapi_python_generated/models/type_name.py +9 -9
- twitter_openapi_python_generated/models/unfavorite_tweet.py +9 -10
- twitter_openapi_python_generated/models/unfavorite_tweet_response_data.py +10 -11
- twitter_openapi_python_generated/models/unified_card.py +95 -0
- twitter_openapi_python_generated/models/url.py +9 -10
- twitter_openapi_python_generated/models/urt_endpoint_options.py +98 -0
- twitter_openapi_python_generated/models/urt_endpoint_request_params.py +90 -0
- twitter_openapi_python_generated/models/user.py +45 -14
- twitter_openapi_python_generated/models/user_features.py +9 -10
- twitter_openapi_python_generated/models/user_highlights_info.py +90 -0
- twitter_openapi_python_generated/models/user_highlights_tweets_data.py +10 -11
- twitter_openapi_python_generated/models/user_highlights_tweets_response.py +10 -11
- twitter_openapi_python_generated/models/user_highlights_tweets_result.py +10 -12
- twitter_openapi_python_generated/models/user_highlights_tweets_timeline.py +10 -11
- twitter_openapi_python_generated/models/user_highlights_tweets_user.py +10 -11
- twitter_openapi_python_generated/models/user_legacy.py +25 -13
- twitter_openapi_python_generated/models/user_professional.py +115 -0
- twitter_openapi_python_generated/models/user_professional_category.py +92 -0
- twitter_openapi_python_generated/models/user_response.py +10 -11
- twitter_openapi_python_generated/models/user_response_data.py +10 -11
- twitter_openapi_python_generated/models/user_result_by_screen_name.py +10 -12
- twitter_openapi_python_generated/models/user_result_by_screen_name_legacy.py +9 -10
- twitter_openapi_python_generated/models/user_result_by_screen_name_result.py +10 -12
- twitter_openapi_python_generated/models/user_result_core.py +10 -11
- twitter_openapi_python_generated/models/user_results.py +10 -11
- twitter_openapi_python_generated/models/user_tweets_data.py +10 -11
- twitter_openapi_python_generated/models/user_tweets_response.py +10 -11
- twitter_openapi_python_generated/models/user_tweets_result.py +10 -12
- twitter_openapi_python_generated/models/user_tweets_user.py +10 -11
- twitter_openapi_python_generated/models/user_unavailable.py +9 -11
- twitter_openapi_python_generated/models/user_union.py +8 -17
- twitter_openapi_python_generated/models/user_value.py +96 -0
- twitter_openapi_python_generated/models/user_verification_info.py +94 -0
- twitter_openapi_python_generated/models/user_verification_info_reason.py +104 -0
- twitter_openapi_python_generated/models/user_verification_info_reason_description.py +98 -0
- twitter_openapi_python_generated/models/user_verification_info_reason_description_entities.py +96 -0
- twitter_openapi_python_generated/models/user_verification_info_reason_description_entities_ref.py +97 -0
- twitter_openapi_python_generated/models/users_response.py +10 -11
- twitter_openapi_python_generated/models/users_response_data.py +10 -11
- twitter_openapi_python_generated/rest.py +23 -35
- {twitter_openapi_python_generated-0.0.9.dist-info → twitter_openapi_python_generated-0.0.11.dist-info}/METADATA +1 -1
- twitter_openapi_python_generated-0.0.11.dist-info/RECORD +282 -0
- twitter_openapi_python_generated-0.0.9.dist-info/RECORD +0 -225
- {twitter_openapi_python_generated-0.0.9.dist-info → twitter_openapi_python_generated-0.0.11.dist-info}/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.9.dist-info → twitter_openapi_python_generated-0.0.11.dist-info}/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.9.dist-info → twitter_openapi_python_generated-0.0.11.dist-info}/WHEEL +0 -0
- {twitter_openapi_python_generated-0.0.9.dist-info → twitter_openapi_python_generated-0.0.11.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,100 @@
|
|
|
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, StrictBool, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class TopicContext(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TopicContext
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
description: Optional[StrictStr] = None
|
|
31
|
+
following: Optional[StrictBool] = None
|
|
32
|
+
icon_url: Optional[StrictStr] = None
|
|
33
|
+
id: Optional[StrictStr] = None
|
|
34
|
+
name: Optional[StrictStr] = None
|
|
35
|
+
not_interested: Optional[StrictBool] = None
|
|
36
|
+
topic_id: Optional[StrictStr] = None
|
|
37
|
+
__properties: ClassVar[List[str]] = ["description", "following", "icon_url", "id", "name", "not_interested", "topic_id"]
|
|
38
|
+
|
|
39
|
+
model_config = {
|
|
40
|
+
"populate_by_name": True,
|
|
41
|
+
"validate_assignment": True,
|
|
42
|
+
"protected_namespaces": (),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def to_str(self) -> str:
|
|
47
|
+
"""Returns the string representation of the model using alias"""
|
|
48
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
49
|
+
|
|
50
|
+
def to_json(self) -> str:
|
|
51
|
+
"""Returns the JSON representation of the model using alias"""
|
|
52
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
53
|
+
return json.dumps(self.to_dict())
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
|
+
"""Create an instance of TopicContext from a JSON string"""
|
|
58
|
+
return cls.from_dict(json.loads(json_str))
|
|
59
|
+
|
|
60
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
61
|
+
"""Return the dictionary representation of the model using alias.
|
|
62
|
+
|
|
63
|
+
This has the following differences from calling pydantic's
|
|
64
|
+
`self.model_dump(by_alias=True)`:
|
|
65
|
+
|
|
66
|
+
* `None` is only added to the output dict for nullable fields that
|
|
67
|
+
were set at model initialization. Other fields with value `None`
|
|
68
|
+
are ignored.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
return _dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of TopicContext from a dict"""
|
|
83
|
+
if obj is None:
|
|
84
|
+
return None
|
|
85
|
+
|
|
86
|
+
if not isinstance(obj, dict):
|
|
87
|
+
return cls.model_validate(obj)
|
|
88
|
+
|
|
89
|
+
_obj = cls.model_validate({
|
|
90
|
+
"description": obj.get("description"),
|
|
91
|
+
"following": obj.get("following"),
|
|
92
|
+
"icon_url": obj.get("icon_url"),
|
|
93
|
+
"id": obj.get("id"),
|
|
94
|
+
"name": obj.get("name"),
|
|
95
|
+
"not_interested": obj.get("not_interested"),
|
|
96
|
+
"topic_id": obj.get("topic_id")
|
|
97
|
+
})
|
|
98
|
+
return _obj
|
|
99
|
+
|
|
100
|
+
|
|
@@ -18,15 +18,11 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
from pydantic import BaseModel, Field, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
|
-
from pydantic import BaseModel, field_validator
|
|
24
|
-
from pydantic import Field
|
|
25
23
|
from typing_extensions import Annotated
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
except ImportError:
|
|
29
|
-
from typing_extensions import Self
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
30
26
|
|
|
31
27
|
class Tracing(BaseModel):
|
|
32
28
|
"""
|
|
@@ -59,7 +55,7 @@ class Tracing(BaseModel):
|
|
|
59
55
|
return json.dumps(self.to_dict())
|
|
60
56
|
|
|
61
57
|
@classmethod
|
|
62
|
-
def from_json(cls, json_str: str) -> Self:
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
59
|
"""Create an instance of Tracing from a JSON string"""
|
|
64
60
|
return cls.from_dict(json.loads(json_str))
|
|
65
61
|
|
|
@@ -73,16 +69,18 @@ class Tracing(BaseModel):
|
|
|
73
69
|
were set at model initialization. Other fields with value `None`
|
|
74
70
|
are ignored.
|
|
75
71
|
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
76
75
|
_dict = self.model_dump(
|
|
77
76
|
by_alias=True,
|
|
78
|
-
exclude=
|
|
79
|
-
},
|
|
77
|
+
exclude=excluded_fields,
|
|
80
78
|
exclude_none=True,
|
|
81
79
|
)
|
|
82
80
|
return _dict
|
|
83
81
|
|
|
84
82
|
@classmethod
|
|
85
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
84
|
"""Create an instance of Tracing from a dict"""
|
|
87
85
|
if obj is None:
|
|
88
86
|
return None
|
|
@@ -18,44 +18,51 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from pydantic import BaseModel, StrictBool, StrictStr, field_validator
|
|
24
|
-
from pydantic import Field
|
|
25
23
|
from typing_extensions import Annotated
|
|
24
|
+
from twitter_openapi_python_generated.models.author_community_relationship import AuthorCommunityRelationship
|
|
26
25
|
from twitter_openapi_python_generated.models.birdwatch_pivot import BirdwatchPivot
|
|
27
26
|
from twitter_openapi_python_generated.models.note_tweet import NoteTweet
|
|
27
|
+
from twitter_openapi_python_generated.models.quoted_ref_result import QuotedRefResult
|
|
28
|
+
from twitter_openapi_python_generated.models.super_follows_reply_user_result import SuperFollowsReplyUserResult
|
|
28
29
|
from twitter_openapi_python_generated.models.tweet_card import TweetCard
|
|
29
30
|
from twitter_openapi_python_generated.models.tweet_edit_control import TweetEditControl
|
|
30
31
|
from twitter_openapi_python_generated.models.tweet_edit_prespective import TweetEditPrespective
|
|
32
|
+
from twitter_openapi_python_generated.models.tweet_previous_counts import TweetPreviousCounts
|
|
31
33
|
from twitter_openapi_python_generated.models.tweet_view import TweetView
|
|
32
34
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
35
|
+
from twitter_openapi_python_generated.models.unified_card import UnifiedCard
|
|
33
36
|
from twitter_openapi_python_generated.models.user_result_core import UserResultCore
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
except ImportError:
|
|
37
|
-
from typing_extensions import Self
|
|
37
|
+
from typing import Optional, Set
|
|
38
|
+
from typing_extensions import Self
|
|
38
39
|
|
|
39
40
|
class Tweet(BaseModel):
|
|
40
41
|
"""
|
|
41
42
|
Tweet
|
|
42
43
|
""" # noqa: E501
|
|
43
44
|
typename: Optional[TypeName] = Field(default=None, alias="__typename")
|
|
45
|
+
author_community_relationship: Optional[AuthorCommunityRelationship] = None
|
|
44
46
|
birdwatch_pivot: Optional[BirdwatchPivot] = None
|
|
45
47
|
card: Optional[TweetCard] = None
|
|
46
48
|
core: Optional[UserResultCore] = None
|
|
47
49
|
edit_control: TweetEditControl
|
|
48
50
|
edit_prespective: Optional[TweetEditPrespective] = None
|
|
51
|
+
has_birdwatch_notes: Optional[StrictBool] = None
|
|
49
52
|
is_translatable: StrictBool
|
|
50
53
|
legacy: Optional[TweetLegacy] = None
|
|
51
54
|
note_tweet: Optional[NoteTweet] = None
|
|
55
|
+
previous_counts: Optional[TweetPreviousCounts] = None
|
|
52
56
|
quick_promote_eligibility: Optional[Dict[str, Any]] = None
|
|
57
|
+
quoted_ref_result: Optional[QuotedRefResult] = Field(default=None, alias="quotedRefResult")
|
|
53
58
|
quoted_status_result: Optional[ItemResult] = None
|
|
54
59
|
rest_id: Annotated[str, Field(strict=True)]
|
|
55
60
|
source: Optional[StrictStr] = None
|
|
61
|
+
super_follows_reply_user_result: Optional[SuperFollowsReplyUserResult] = Field(default=None, alias="superFollowsReplyUserResult")
|
|
62
|
+
unified_card: Optional[UnifiedCard] = None
|
|
56
63
|
unmention_data: Optional[Dict[str, Any]] = None
|
|
57
64
|
views: TweetView
|
|
58
|
-
__properties: ClassVar[List[str]] = ["__typename", "birdwatch_pivot", "card", "core", "edit_control", "edit_prespective", "is_translatable", "legacy", "note_tweet", "quick_promote_eligibility", "quoted_status_result", "rest_id", "source", "unmention_data", "views"]
|
|
65
|
+
__properties: ClassVar[List[str]] = ["__typename", "author_community_relationship", "birdwatch_pivot", "card", "core", "edit_control", "edit_prespective", "has_birdwatch_notes", "is_translatable", "legacy", "note_tweet", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "superFollowsReplyUserResult", "unified_card", "unmention_data", "views"]
|
|
59
66
|
|
|
60
67
|
@field_validator('rest_id')
|
|
61
68
|
def rest_id_validate_regular_expression(cls, value):
|
|
@@ -81,7 +88,7 @@ class Tweet(BaseModel):
|
|
|
81
88
|
return json.dumps(self.to_dict())
|
|
82
89
|
|
|
83
90
|
@classmethod
|
|
84
|
-
def from_json(cls, json_str: str) -> Self:
|
|
91
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
85
92
|
"""Create an instance of Tweet from a JSON string"""
|
|
86
93
|
return cls.from_dict(json.loads(json_str))
|
|
87
94
|
|
|
@@ -95,12 +102,17 @@ class Tweet(BaseModel):
|
|
|
95
102
|
were set at model initialization. Other fields with value `None`
|
|
96
103
|
are ignored.
|
|
97
104
|
"""
|
|
105
|
+
excluded_fields: Set[str] = set([
|
|
106
|
+
])
|
|
107
|
+
|
|
98
108
|
_dict = self.model_dump(
|
|
99
109
|
by_alias=True,
|
|
100
|
-
exclude=
|
|
101
|
-
},
|
|
110
|
+
exclude=excluded_fields,
|
|
102
111
|
exclude_none=True,
|
|
103
112
|
)
|
|
113
|
+
# override the default output from pydantic by calling `to_dict()` of author_community_relationship
|
|
114
|
+
if self.author_community_relationship:
|
|
115
|
+
_dict['author_community_relationship'] = self.author_community_relationship.to_dict()
|
|
104
116
|
# override the default output from pydantic by calling `to_dict()` of birdwatch_pivot
|
|
105
117
|
if self.birdwatch_pivot:
|
|
106
118
|
_dict['birdwatch_pivot'] = self.birdwatch_pivot.to_dict()
|
|
@@ -122,16 +134,28 @@ class Tweet(BaseModel):
|
|
|
122
134
|
# override the default output from pydantic by calling `to_dict()` of note_tweet
|
|
123
135
|
if self.note_tweet:
|
|
124
136
|
_dict['note_tweet'] = self.note_tweet.to_dict()
|
|
137
|
+
# override the default output from pydantic by calling `to_dict()` of previous_counts
|
|
138
|
+
if self.previous_counts:
|
|
139
|
+
_dict['previous_counts'] = self.previous_counts.to_dict()
|
|
140
|
+
# override the default output from pydantic by calling `to_dict()` of quoted_ref_result
|
|
141
|
+
if self.quoted_ref_result:
|
|
142
|
+
_dict['quotedRefResult'] = self.quoted_ref_result.to_dict()
|
|
125
143
|
# override the default output from pydantic by calling `to_dict()` of quoted_status_result
|
|
126
144
|
if self.quoted_status_result:
|
|
127
145
|
_dict['quoted_status_result'] = self.quoted_status_result.to_dict()
|
|
146
|
+
# override the default output from pydantic by calling `to_dict()` of super_follows_reply_user_result
|
|
147
|
+
if self.super_follows_reply_user_result:
|
|
148
|
+
_dict['superFollowsReplyUserResult'] = self.super_follows_reply_user_result.to_dict()
|
|
149
|
+
# override the default output from pydantic by calling `to_dict()` of unified_card
|
|
150
|
+
if self.unified_card:
|
|
151
|
+
_dict['unified_card'] = self.unified_card.to_dict()
|
|
128
152
|
# override the default output from pydantic by calling `to_dict()` of views
|
|
129
153
|
if self.views:
|
|
130
154
|
_dict['views'] = self.views.to_dict()
|
|
131
155
|
return _dict
|
|
132
156
|
|
|
133
157
|
@classmethod
|
|
134
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
158
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
135
159
|
"""Create an instance of Tweet from a dict"""
|
|
136
160
|
if obj is None:
|
|
137
161
|
return None
|
|
@@ -141,20 +165,26 @@ class Tweet(BaseModel):
|
|
|
141
165
|
|
|
142
166
|
_obj = cls.model_validate({
|
|
143
167
|
"__typename": obj.get("__typename"),
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"
|
|
147
|
-
"
|
|
148
|
-
"
|
|
168
|
+
"author_community_relationship": AuthorCommunityRelationship.from_dict(obj["author_community_relationship"]) if obj.get("author_community_relationship") is not None else None,
|
|
169
|
+
"birdwatch_pivot": BirdwatchPivot.from_dict(obj["birdwatch_pivot"]) if obj.get("birdwatch_pivot") is not None else None,
|
|
170
|
+
"card": TweetCard.from_dict(obj["card"]) if obj.get("card") is not None else None,
|
|
171
|
+
"core": UserResultCore.from_dict(obj["core"]) if obj.get("core") is not None else None,
|
|
172
|
+
"edit_control": TweetEditControl.from_dict(obj["edit_control"]) if obj.get("edit_control") is not None else None,
|
|
173
|
+
"edit_prespective": TweetEditPrespective.from_dict(obj["edit_prespective"]) if obj.get("edit_prespective") is not None else None,
|
|
174
|
+
"has_birdwatch_notes": obj.get("has_birdwatch_notes"),
|
|
149
175
|
"is_translatable": obj.get("is_translatable") if obj.get("is_translatable") is not None else False,
|
|
150
|
-
"legacy": TweetLegacy.from_dict(obj
|
|
151
|
-
"note_tweet": NoteTweet.from_dict(obj
|
|
176
|
+
"legacy": TweetLegacy.from_dict(obj["legacy"]) if obj.get("legacy") is not None else None,
|
|
177
|
+
"note_tweet": NoteTweet.from_dict(obj["note_tweet"]) if obj.get("note_tweet") is not None else None,
|
|
178
|
+
"previous_counts": TweetPreviousCounts.from_dict(obj["previous_counts"]) if obj.get("previous_counts") is not None else None,
|
|
152
179
|
"quick_promote_eligibility": obj.get("quick_promote_eligibility"),
|
|
153
|
-
"
|
|
180
|
+
"quotedRefResult": QuotedRefResult.from_dict(obj["quotedRefResult"]) if obj.get("quotedRefResult") is not None else None,
|
|
181
|
+
"quoted_status_result": ItemResult.from_dict(obj["quoted_status_result"]) if obj.get("quoted_status_result") is not None else None,
|
|
154
182
|
"rest_id": obj.get("rest_id"),
|
|
155
183
|
"source": obj.get("source"),
|
|
184
|
+
"superFollowsReplyUserResult": SuperFollowsReplyUserResult.from_dict(obj["superFollowsReplyUserResult"]) if obj.get("superFollowsReplyUserResult") is not None else None,
|
|
185
|
+
"unified_card": UnifiedCard.from_dict(obj["unified_card"]) if obj.get("unified_card") is not None else None,
|
|
156
186
|
"unmention_data": obj.get("unmention_data"),
|
|
157
|
-
"views": TweetView.from_dict(obj
|
|
187
|
+
"views": TweetView.from_dict(obj["views"]) if obj.get("views") is not None else None
|
|
158
188
|
})
|
|
159
189
|
return _obj
|
|
160
190
|
|
|
@@ -18,14 +18,11 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
21
|
from pydantic import BaseModel, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
23
|
from twitter_openapi_python_generated.models.tweet_card_legacy import TweetCardLegacy
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
except ImportError:
|
|
28
|
-
from typing_extensions import Self
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
29
26
|
|
|
30
27
|
class TweetCard(BaseModel):
|
|
31
28
|
"""
|
|
@@ -52,7 +49,7 @@ class TweetCard(BaseModel):
|
|
|
52
49
|
return json.dumps(self.to_dict())
|
|
53
50
|
|
|
54
51
|
@classmethod
|
|
55
|
-
def from_json(cls, json_str: str) -> Self:
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
53
|
"""Create an instance of TweetCard from a JSON string"""
|
|
57
54
|
return cls.from_dict(json.loads(json_str))
|
|
58
55
|
|
|
@@ -66,10 +63,12 @@ class TweetCard(BaseModel):
|
|
|
66
63
|
were set at model initialization. Other fields with value `None`
|
|
67
64
|
are ignored.
|
|
68
65
|
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
69
|
_dict = self.model_dump(
|
|
70
70
|
by_alias=True,
|
|
71
|
-
exclude=
|
|
72
|
-
},
|
|
71
|
+
exclude=excluded_fields,
|
|
73
72
|
exclude_none=True,
|
|
74
73
|
)
|
|
75
74
|
# override the default output from pydantic by calling `to_dict()` of legacy
|
|
@@ -78,7 +77,7 @@ class TweetCard(BaseModel):
|
|
|
78
77
|
return _dict
|
|
79
78
|
|
|
80
79
|
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
81
|
"""Create an instance of TweetCard from a dict"""
|
|
83
82
|
if obj is None:
|
|
84
83
|
return None
|
|
@@ -87,7 +86,7 @@ class TweetCard(BaseModel):
|
|
|
87
86
|
return cls.model_validate(obj)
|
|
88
87
|
|
|
89
88
|
_obj = cls.model_validate({
|
|
90
|
-
"legacy": TweetCardLegacy.from_dict(obj
|
|
89
|
+
"legacy": TweetCardLegacy.from_dict(obj["legacy"]) if obj.get("legacy") is not None else None,
|
|
91
90
|
"rest_id": obj.get("rest_id")
|
|
92
91
|
})
|
|
93
92
|
return _obj
|
|
@@ -18,23 +18,24 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
23
21
|
from pydantic import BaseModel, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
24
23
|
from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value import TweetCardLegacyBindingValue
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
from twitter_openapi_python_generated.models.tweet_card_platform_data import TweetCardPlatformData
|
|
25
|
+
from twitter_openapi_python_generated.models.user_results import UserResults
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
29
28
|
|
|
30
29
|
class TweetCardLegacy(BaseModel):
|
|
31
30
|
"""
|
|
32
31
|
TweetCardLegacy
|
|
33
32
|
""" # noqa: E501
|
|
34
33
|
binding_values: List[TweetCardLegacyBindingValue]
|
|
34
|
+
card_platform: Optional[TweetCardPlatformData] = None
|
|
35
35
|
name: StrictStr
|
|
36
36
|
url: StrictStr
|
|
37
|
-
|
|
37
|
+
user_refs_results: Optional[List[UserResults]] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["binding_values", "card_platform", "name", "url", "user_refs_results"]
|
|
38
39
|
|
|
39
40
|
model_config = {
|
|
40
41
|
"populate_by_name": True,
|
|
@@ -53,7 +54,7 @@ class TweetCardLegacy(BaseModel):
|
|
|
53
54
|
return json.dumps(self.to_dict())
|
|
54
55
|
|
|
55
56
|
@classmethod
|
|
56
|
-
def from_json(cls, json_str: str) -> Self:
|
|
57
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
58
|
"""Create an instance of TweetCardLegacy from a JSON string"""
|
|
58
59
|
return cls.from_dict(json.loads(json_str))
|
|
59
60
|
|
|
@@ -67,10 +68,12 @@ class TweetCardLegacy(BaseModel):
|
|
|
67
68
|
were set at model initialization. Other fields with value `None`
|
|
68
69
|
are ignored.
|
|
69
70
|
"""
|
|
71
|
+
excluded_fields: Set[str] = set([
|
|
72
|
+
])
|
|
73
|
+
|
|
70
74
|
_dict = self.model_dump(
|
|
71
75
|
by_alias=True,
|
|
72
|
-
exclude=
|
|
73
|
-
},
|
|
76
|
+
exclude=excluded_fields,
|
|
74
77
|
exclude_none=True,
|
|
75
78
|
)
|
|
76
79
|
# override the default output from pydantic by calling `to_dict()` of each item in binding_values (list)
|
|
@@ -80,10 +83,20 @@ class TweetCardLegacy(BaseModel):
|
|
|
80
83
|
if _item:
|
|
81
84
|
_items.append(_item.to_dict())
|
|
82
85
|
_dict['binding_values'] = _items
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of card_platform
|
|
87
|
+
if self.card_platform:
|
|
88
|
+
_dict['card_platform'] = self.card_platform.to_dict()
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of each item in user_refs_results (list)
|
|
90
|
+
_items = []
|
|
91
|
+
if self.user_refs_results:
|
|
92
|
+
for _item in self.user_refs_results:
|
|
93
|
+
if _item:
|
|
94
|
+
_items.append(_item.to_dict())
|
|
95
|
+
_dict['user_refs_results'] = _items
|
|
83
96
|
return _dict
|
|
84
97
|
|
|
85
98
|
@classmethod
|
|
86
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
99
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
100
|
"""Create an instance of TweetCardLegacy from a dict"""
|
|
88
101
|
if obj is None:
|
|
89
102
|
return None
|
|
@@ -92,9 +105,11 @@ class TweetCardLegacy(BaseModel):
|
|
|
92
105
|
return cls.model_validate(obj)
|
|
93
106
|
|
|
94
107
|
_obj = cls.model_validate({
|
|
95
|
-
"binding_values": [TweetCardLegacyBindingValue.from_dict(_item) for _item in obj
|
|
108
|
+
"binding_values": [TweetCardLegacyBindingValue.from_dict(_item) for _item in obj["binding_values"]] if obj.get("binding_values") is not None else None,
|
|
109
|
+
"card_platform": TweetCardPlatformData.from_dict(obj["card_platform"]) if obj.get("card_platform") is not None else None,
|
|
96
110
|
"name": obj.get("name"),
|
|
97
|
-
"url": obj.get("url")
|
|
111
|
+
"url": obj.get("url"),
|
|
112
|
+
"user_refs_results": [UserResults.from_dict(_item) for _item in obj["user_refs_results"]] if obj.get("user_refs_results") is not None else None
|
|
98
113
|
})
|
|
99
114
|
return _obj
|
|
100
115
|
|
|
@@ -18,14 +18,11 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
23
21
|
from pydantic import BaseModel, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
24
23
|
from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value_data import TweetCardLegacyBindingValueData
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
except ImportError:
|
|
28
|
-
from typing_extensions import Self
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
29
26
|
|
|
30
27
|
class TweetCardLegacyBindingValue(BaseModel):
|
|
31
28
|
"""
|
|
@@ -52,7 +49,7 @@ class TweetCardLegacyBindingValue(BaseModel):
|
|
|
52
49
|
return json.dumps(self.to_dict())
|
|
53
50
|
|
|
54
51
|
@classmethod
|
|
55
|
-
def from_json(cls, json_str: str) -> Self:
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
53
|
"""Create an instance of TweetCardLegacyBindingValue from a JSON string"""
|
|
57
54
|
return cls.from_dict(json.loads(json_str))
|
|
58
55
|
|
|
@@ -66,10 +63,12 @@ class TweetCardLegacyBindingValue(BaseModel):
|
|
|
66
63
|
were set at model initialization. Other fields with value `None`
|
|
67
64
|
are ignored.
|
|
68
65
|
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
69
|
_dict = self.model_dump(
|
|
70
70
|
by_alias=True,
|
|
71
|
-
exclude=
|
|
72
|
-
},
|
|
71
|
+
exclude=excluded_fields,
|
|
73
72
|
exclude_none=True,
|
|
74
73
|
)
|
|
75
74
|
# override the default output from pydantic by calling `to_dict()` of value
|
|
@@ -78,7 +77,7 @@ class TweetCardLegacyBindingValue(BaseModel):
|
|
|
78
77
|
return _dict
|
|
79
78
|
|
|
80
79
|
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
81
|
"""Create an instance of TweetCardLegacyBindingValue from a dict"""
|
|
83
82
|
if obj is None:
|
|
84
83
|
return None
|
|
@@ -88,7 +87,7 @@ class TweetCardLegacyBindingValue(BaseModel):
|
|
|
88
87
|
|
|
89
88
|
_obj = cls.model_validate({
|
|
90
89
|
"key": obj.get("key"),
|
|
91
|
-
"value": TweetCardLegacyBindingValueData.from_dict(obj
|
|
90
|
+
"value": TweetCardLegacyBindingValueData.from_dict(obj["value"]) if obj.get("value") is not None else None
|
|
92
91
|
})
|
|
93
92
|
return _obj
|
|
94
93
|
|
|
@@ -18,23 +18,25 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
21
|
from pydantic import BaseModel, StrictBool, StrictStr
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value_data_image import TweetCardLegacyBindingValueDataImage
|
|
24
|
+
from twitter_openapi_python_generated.models.user_value import UserValue
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
28
27
|
|
|
29
28
|
class TweetCardLegacyBindingValueData(BaseModel):
|
|
30
29
|
"""
|
|
31
30
|
TweetCardLegacyBindingValueData
|
|
32
31
|
""" # noqa: E501
|
|
33
32
|
boolean_value: Optional[StrictBool] = None
|
|
33
|
+
image_color_value: Optional[Dict[str, Any]] = None
|
|
34
|
+
image_value: Optional[TweetCardLegacyBindingValueDataImage] = None
|
|
34
35
|
scribe_key: Optional[StrictStr] = None
|
|
35
36
|
string_value: Optional[StrictStr] = None
|
|
36
37
|
type: StrictStr
|
|
37
|
-
|
|
38
|
+
user_value: Optional[UserValue] = None
|
|
39
|
+
__properties: ClassVar[List[str]] = ["boolean_value", "image_color_value", "image_value", "scribe_key", "string_value", "type", "user_value"]
|
|
38
40
|
|
|
39
41
|
model_config = {
|
|
40
42
|
"populate_by_name": True,
|
|
@@ -53,7 +55,7 @@ class TweetCardLegacyBindingValueData(BaseModel):
|
|
|
53
55
|
return json.dumps(self.to_dict())
|
|
54
56
|
|
|
55
57
|
@classmethod
|
|
56
|
-
def from_json(cls, json_str: str) -> Self:
|
|
58
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
57
59
|
"""Create an instance of TweetCardLegacyBindingValueData from a JSON string"""
|
|
58
60
|
return cls.from_dict(json.loads(json_str))
|
|
59
61
|
|
|
@@ -67,16 +69,24 @@ class TweetCardLegacyBindingValueData(BaseModel):
|
|
|
67
69
|
were set at model initialization. Other fields with value `None`
|
|
68
70
|
are ignored.
|
|
69
71
|
"""
|
|
72
|
+
excluded_fields: Set[str] = set([
|
|
73
|
+
])
|
|
74
|
+
|
|
70
75
|
_dict = self.model_dump(
|
|
71
76
|
by_alias=True,
|
|
72
|
-
exclude=
|
|
73
|
-
},
|
|
77
|
+
exclude=excluded_fields,
|
|
74
78
|
exclude_none=True,
|
|
75
79
|
)
|
|
80
|
+
# override the default output from pydantic by calling `to_dict()` of image_value
|
|
81
|
+
if self.image_value:
|
|
82
|
+
_dict['image_value'] = self.image_value.to_dict()
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of user_value
|
|
84
|
+
if self.user_value:
|
|
85
|
+
_dict['user_value'] = self.user_value.to_dict()
|
|
76
86
|
return _dict
|
|
77
87
|
|
|
78
88
|
@classmethod
|
|
79
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
89
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
90
|
"""Create an instance of TweetCardLegacyBindingValueData from a dict"""
|
|
81
91
|
if obj is None:
|
|
82
92
|
return None
|
|
@@ -86,9 +96,12 @@ class TweetCardLegacyBindingValueData(BaseModel):
|
|
|
86
96
|
|
|
87
97
|
_obj = cls.model_validate({
|
|
88
98
|
"boolean_value": obj.get("boolean_value"),
|
|
99
|
+
"image_color_value": obj.get("image_color_value"),
|
|
100
|
+
"image_value": TweetCardLegacyBindingValueDataImage.from_dict(obj["image_value"]) if obj.get("image_value") is not None else None,
|
|
89
101
|
"scribe_key": obj.get("scribe_key"),
|
|
90
102
|
"string_value": obj.get("string_value"),
|
|
91
|
-
"type": obj.get("type")
|
|
103
|
+
"type": obj.get("type"),
|
|
104
|
+
"user_value": UserValue.from_dict(obj["user_value"]) if obj.get("user_value") is not None else None
|
|
92
105
|
})
|
|
93
106
|
return _obj
|
|
94
107
|
|