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,106 @@
|
|
|
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, Field, StrictStr, field_validator
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class TweetInterstitialTextEntityRef(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TweetInterstitialTextEntityRef
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
type: StrictStr
|
|
31
|
+
url: StrictStr
|
|
32
|
+
url_type: StrictStr = Field(alias="urlType")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["type", "url", "urlType"]
|
|
34
|
+
|
|
35
|
+
@field_validator('type')
|
|
36
|
+
def type_validate_enum(cls, value):
|
|
37
|
+
"""Validates the enum"""
|
|
38
|
+
if value not in set(['TimelineUrl']):
|
|
39
|
+
raise ValueError("must be one of enum values ('TimelineUrl')")
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
@field_validator('url_type')
|
|
43
|
+
def url_type_validate_enum(cls, value):
|
|
44
|
+
"""Validates the enum"""
|
|
45
|
+
if value not in set(['ExternalUrl']):
|
|
46
|
+
raise ValueError("must be one of enum values ('ExternalUrl')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = {
|
|
50
|
+
"populate_by_name": True,
|
|
51
|
+
"validate_assignment": True,
|
|
52
|
+
"protected_namespaces": (),
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of TweetInterstitialTextEntityRef from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
return _dict
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
92
|
+
"""Create an instance of TweetInterstitialTextEntityRef from a dict"""
|
|
93
|
+
if obj is None:
|
|
94
|
+
return None
|
|
95
|
+
|
|
96
|
+
if not isinstance(obj, dict):
|
|
97
|
+
return cls.model_validate(obj)
|
|
98
|
+
|
|
99
|
+
_obj = cls.model_validate({
|
|
100
|
+
"type": obj.get("type"),
|
|
101
|
+
"url": obj.get("url"),
|
|
102
|
+
"urlType": obj.get("urlType")
|
|
103
|
+
})
|
|
104
|
+
return _obj
|
|
105
|
+
|
|
106
|
+
|
|
@@ -18,18 +18,16 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
-
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr, field_validator
|
|
24
|
-
from pydantic import Field
|
|
25
23
|
from typing_extensions import Annotated
|
|
26
24
|
from twitter_openapi_python_generated.models.entities import Entities
|
|
27
25
|
from twitter_openapi_python_generated.models.extended_entities import ExtendedEntities
|
|
26
|
+
from twitter_openapi_python_generated.models.quoted_status_permalink import QuotedStatusPermalink
|
|
28
27
|
from twitter_openapi_python_generated.models.self_thread import SelfThread
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
from typing_extensions import Self
|
|
28
|
+
from twitter_openapi_python_generated.models.tweet_legacy_scopes import TweetLegacyScopes
|
|
29
|
+
from typing import Optional, Set
|
|
30
|
+
from typing_extensions import Self
|
|
33
31
|
|
|
34
32
|
class TweetLegacy(BaseModel):
|
|
35
33
|
"""
|
|
@@ -37,6 +35,7 @@ class TweetLegacy(BaseModel):
|
|
|
37
35
|
""" # noqa: E501
|
|
38
36
|
bookmark_count: StrictInt
|
|
39
37
|
bookmarked: StrictBool
|
|
38
|
+
conversation_control: Optional[Dict[str, Any]] = None
|
|
40
39
|
conversation_id_str: Annotated[str, Field(strict=True)]
|
|
41
40
|
created_at: Annotated[str, Field(strict=True)]
|
|
42
41
|
display_text_range: List[StrictInt]
|
|
@@ -46,18 +45,26 @@ class TweetLegacy(BaseModel):
|
|
|
46
45
|
favorited: StrictBool
|
|
47
46
|
full_text: StrictStr
|
|
48
47
|
id_str: Annotated[str, Field(strict=True)]
|
|
48
|
+
in_reply_to_screen_name: Optional[StrictStr] = None
|
|
49
|
+
in_reply_to_status_id_str: Optional[Annotated[str, Field(strict=True)]] = None
|
|
50
|
+
in_reply_to_user_id_str: Optional[Annotated[str, Field(strict=True)]] = None
|
|
49
51
|
is_quote_status: StrictBool
|
|
50
52
|
lang: StrictStr
|
|
53
|
+
limited_actions: Optional[StrictStr] = None
|
|
54
|
+
place: Optional[Dict[str, Any]] = None
|
|
51
55
|
possibly_sensitive: Optional[StrictBool] = False
|
|
52
56
|
possibly_sensitive_editable: Optional[StrictBool] = False
|
|
53
57
|
quote_count: StrictInt
|
|
58
|
+
quoted_status_id_str: Optional[Annotated[str, Field(strict=True)]] = None
|
|
59
|
+
quoted_status_permalink: Optional[QuotedStatusPermalink] = None
|
|
54
60
|
reply_count: StrictInt
|
|
55
61
|
retweet_count: StrictInt
|
|
56
62
|
retweeted: StrictBool
|
|
57
63
|
retweeted_status_result: Optional[ItemResult] = None
|
|
64
|
+
scopes: Optional[TweetLegacyScopes] = None
|
|
58
65
|
self_thread: Optional[SelfThread] = None
|
|
59
66
|
user_id_str: Annotated[str, Field(strict=True)]
|
|
60
|
-
__properties: ClassVar[List[str]] = ["bookmark_count", "bookmarked", "conversation_id_str", "created_at", "display_text_range", "entities", "extended_entities", "favorite_count", "favorited", "full_text", "id_str", "is_quote_status", "lang", "possibly_sensitive", "possibly_sensitive_editable", "quote_count", "reply_count", "retweet_count", "retweeted", "retweeted_status_result", "self_thread", "user_id_str"]
|
|
67
|
+
__properties: ClassVar[List[str]] = ["bookmark_count", "bookmarked", "conversation_control", "conversation_id_str", "created_at", "display_text_range", "entities", "extended_entities", "favorite_count", "favorited", "full_text", "id_str", "in_reply_to_screen_name", "in_reply_to_status_id_str", "in_reply_to_user_id_str", "is_quote_status", "lang", "limited_actions", "place", "possibly_sensitive", "possibly_sensitive_editable", "quote_count", "quoted_status_id_str", "quoted_status_permalink", "reply_count", "retweet_count", "retweeted", "retweeted_status_result", "scopes", "self_thread", "user_id_str"]
|
|
61
68
|
|
|
62
69
|
@field_validator('conversation_id_str')
|
|
63
70
|
def conversation_id_str_validate_regular_expression(cls, value):
|
|
@@ -80,6 +87,46 @@ class TweetLegacy(BaseModel):
|
|
|
80
87
|
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
81
88
|
return value
|
|
82
89
|
|
|
90
|
+
@field_validator('in_reply_to_status_id_str')
|
|
91
|
+
def in_reply_to_status_id_str_validate_regular_expression(cls, value):
|
|
92
|
+
"""Validates the regular expression"""
|
|
93
|
+
if value is None:
|
|
94
|
+
return value
|
|
95
|
+
|
|
96
|
+
if not re.match(r"^[0-9]+$", value):
|
|
97
|
+
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
98
|
+
return value
|
|
99
|
+
|
|
100
|
+
@field_validator('in_reply_to_user_id_str')
|
|
101
|
+
def in_reply_to_user_id_str_validate_regular_expression(cls, value):
|
|
102
|
+
"""Validates the regular expression"""
|
|
103
|
+
if value is None:
|
|
104
|
+
return value
|
|
105
|
+
|
|
106
|
+
if not re.match(r"^[0-9]+$", value):
|
|
107
|
+
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
108
|
+
return value
|
|
109
|
+
|
|
110
|
+
@field_validator('limited_actions')
|
|
111
|
+
def limited_actions_validate_enum(cls, value):
|
|
112
|
+
"""Validates the enum"""
|
|
113
|
+
if value is None:
|
|
114
|
+
return value
|
|
115
|
+
|
|
116
|
+
if value not in set(['limited_replies', 'community_tweet_non_member_public_community', 'non_compliant', 'dynamic_product_ad']):
|
|
117
|
+
raise ValueError("must be one of enum values ('limited_replies', 'community_tweet_non_member_public_community', 'non_compliant', 'dynamic_product_ad')")
|
|
118
|
+
return value
|
|
119
|
+
|
|
120
|
+
@field_validator('quoted_status_id_str')
|
|
121
|
+
def quoted_status_id_str_validate_regular_expression(cls, value):
|
|
122
|
+
"""Validates the regular expression"""
|
|
123
|
+
if value is None:
|
|
124
|
+
return value
|
|
125
|
+
|
|
126
|
+
if not re.match(r"^[0-9]+$", value):
|
|
127
|
+
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
128
|
+
return value
|
|
129
|
+
|
|
83
130
|
@field_validator('user_id_str')
|
|
84
131
|
def user_id_str_validate_regular_expression(cls, value):
|
|
85
132
|
"""Validates the regular expression"""
|
|
@@ -104,7 +151,7 @@ class TweetLegacy(BaseModel):
|
|
|
104
151
|
return json.dumps(self.to_dict())
|
|
105
152
|
|
|
106
153
|
@classmethod
|
|
107
|
-
def from_json(cls, json_str: str) -> Self:
|
|
154
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
108
155
|
"""Create an instance of TweetLegacy from a JSON string"""
|
|
109
156
|
return cls.from_dict(json.loads(json_str))
|
|
110
157
|
|
|
@@ -118,10 +165,12 @@ class TweetLegacy(BaseModel):
|
|
|
118
165
|
were set at model initialization. Other fields with value `None`
|
|
119
166
|
are ignored.
|
|
120
167
|
"""
|
|
168
|
+
excluded_fields: Set[str] = set([
|
|
169
|
+
])
|
|
170
|
+
|
|
121
171
|
_dict = self.model_dump(
|
|
122
172
|
by_alias=True,
|
|
123
|
-
exclude=
|
|
124
|
-
},
|
|
173
|
+
exclude=excluded_fields,
|
|
125
174
|
exclude_none=True,
|
|
126
175
|
)
|
|
127
176
|
# override the default output from pydantic by calling `to_dict()` of entities
|
|
@@ -130,16 +179,22 @@ class TweetLegacy(BaseModel):
|
|
|
130
179
|
# override the default output from pydantic by calling `to_dict()` of extended_entities
|
|
131
180
|
if self.extended_entities:
|
|
132
181
|
_dict['extended_entities'] = self.extended_entities.to_dict()
|
|
182
|
+
# override the default output from pydantic by calling `to_dict()` of quoted_status_permalink
|
|
183
|
+
if self.quoted_status_permalink:
|
|
184
|
+
_dict['quoted_status_permalink'] = self.quoted_status_permalink.to_dict()
|
|
133
185
|
# override the default output from pydantic by calling `to_dict()` of retweeted_status_result
|
|
134
186
|
if self.retweeted_status_result:
|
|
135
187
|
_dict['retweeted_status_result'] = self.retweeted_status_result.to_dict()
|
|
188
|
+
# override the default output from pydantic by calling `to_dict()` of scopes
|
|
189
|
+
if self.scopes:
|
|
190
|
+
_dict['scopes'] = self.scopes.to_dict()
|
|
136
191
|
# override the default output from pydantic by calling `to_dict()` of self_thread
|
|
137
192
|
if self.self_thread:
|
|
138
193
|
_dict['self_thread'] = self.self_thread.to_dict()
|
|
139
194
|
return _dict
|
|
140
195
|
|
|
141
196
|
@classmethod
|
|
142
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
197
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
143
198
|
"""Create an instance of TweetLegacy from a dict"""
|
|
144
199
|
if obj is None:
|
|
145
200
|
return None
|
|
@@ -150,25 +205,34 @@ class TweetLegacy(BaseModel):
|
|
|
150
205
|
_obj = cls.model_validate({
|
|
151
206
|
"bookmark_count": obj.get("bookmark_count"),
|
|
152
207
|
"bookmarked": obj.get("bookmarked"),
|
|
208
|
+
"conversation_control": obj.get("conversation_control"),
|
|
153
209
|
"conversation_id_str": obj.get("conversation_id_str"),
|
|
154
210
|
"created_at": obj.get("created_at"),
|
|
155
211
|
"display_text_range": obj.get("display_text_range"),
|
|
156
|
-
"entities": Entities.from_dict(obj
|
|
157
|
-
"extended_entities": ExtendedEntities.from_dict(obj
|
|
212
|
+
"entities": Entities.from_dict(obj["entities"]) if obj.get("entities") is not None else None,
|
|
213
|
+
"extended_entities": ExtendedEntities.from_dict(obj["extended_entities"]) if obj.get("extended_entities") is not None else None,
|
|
158
214
|
"favorite_count": obj.get("favorite_count"),
|
|
159
215
|
"favorited": obj.get("favorited"),
|
|
160
216
|
"full_text": obj.get("full_text"),
|
|
161
217
|
"id_str": obj.get("id_str"),
|
|
218
|
+
"in_reply_to_screen_name": obj.get("in_reply_to_screen_name"),
|
|
219
|
+
"in_reply_to_status_id_str": obj.get("in_reply_to_status_id_str"),
|
|
220
|
+
"in_reply_to_user_id_str": obj.get("in_reply_to_user_id_str"),
|
|
162
221
|
"is_quote_status": obj.get("is_quote_status"),
|
|
163
222
|
"lang": obj.get("lang"),
|
|
223
|
+
"limited_actions": obj.get("limited_actions"),
|
|
224
|
+
"place": obj.get("place"),
|
|
164
225
|
"possibly_sensitive": obj.get("possibly_sensitive") if obj.get("possibly_sensitive") is not None else False,
|
|
165
226
|
"possibly_sensitive_editable": obj.get("possibly_sensitive_editable") if obj.get("possibly_sensitive_editable") is not None else False,
|
|
166
227
|
"quote_count": obj.get("quote_count"),
|
|
228
|
+
"quoted_status_id_str": obj.get("quoted_status_id_str"),
|
|
229
|
+
"quoted_status_permalink": QuotedStatusPermalink.from_dict(obj["quoted_status_permalink"]) if obj.get("quoted_status_permalink") is not None else None,
|
|
167
230
|
"reply_count": obj.get("reply_count"),
|
|
168
231
|
"retweet_count": obj.get("retweet_count"),
|
|
169
232
|
"retweeted": obj.get("retweeted"),
|
|
170
|
-
"retweeted_status_result": ItemResult.from_dict(obj
|
|
171
|
-
"
|
|
233
|
+
"retweeted_status_result": ItemResult.from_dict(obj["retweeted_status_result"]) if obj.get("retweeted_status_result") is not None else None,
|
|
234
|
+
"scopes": TweetLegacyScopes.from_dict(obj["scopes"]) if obj.get("scopes") is not None else None,
|
|
235
|
+
"self_thread": SelfThread.from_dict(obj["self_thread"]) if obj.get("self_thread") is not None else None,
|
|
172
236
|
"user_id_str": obj.get("user_id_str")
|
|
173
237
|
})
|
|
174
238
|
return _obj
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class TweetLegacyScopes(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TweetLegacyScopes
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
followers: StrictBool
|
|
31
|
+
__properties: ClassVar[List[str]] = ["followers"]
|
|
32
|
+
|
|
33
|
+
model_config = {
|
|
34
|
+
"populate_by_name": True,
|
|
35
|
+
"validate_assignment": True,
|
|
36
|
+
"protected_namespaces": (),
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of TweetLegacyScopes from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of TweetLegacyScopes from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"followers": obj.get("followers")
|
|
85
|
+
})
|
|
86
|
+
return _obj
|
|
87
|
+
|
|
88
|
+
|
|
@@ -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, StrictInt
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class TweetPreviousCounts(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TweetPreviousCounts
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
bookmark_count: StrictInt
|
|
31
|
+
favorite_count: StrictInt
|
|
32
|
+
quote_count: StrictInt
|
|
33
|
+
reply_count: StrictInt
|
|
34
|
+
retweet_count: StrictInt
|
|
35
|
+
__properties: ClassVar[List[str]] = ["bookmark_count", "favorite_count", "quote_count", "reply_count", "retweet_count"]
|
|
36
|
+
|
|
37
|
+
model_config = {
|
|
38
|
+
"populate_by_name": True,
|
|
39
|
+
"validate_assignment": True,
|
|
40
|
+
"protected_namespaces": (),
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of TweetPreviousCounts 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
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of TweetPreviousCounts from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"bookmark_count": obj.get("bookmark_count"),
|
|
89
|
+
"favorite_count": obj.get("favorite_count"),
|
|
90
|
+
"quote_count": obj.get("quote_count"),
|
|
91
|
+
"reply_count": obj.get("reply_count"),
|
|
92
|
+
"retweet_count": obj.get("retweet_count")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -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
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
|
-
from pydantic import BaseModel
|
|
24
|
-
from pydantic import Field
|
|
25
23
|
from twitter_openapi_python_generated.models.item_result import ItemResult
|
|
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 TweetResultByRestIdData(BaseModel):
|
|
32
28
|
"""
|
|
@@ -52,7 +48,7 @@ class TweetResultByRestIdData(BaseModel):
|
|
|
52
48
|
return json.dumps(self.to_dict())
|
|
53
49
|
|
|
54
50
|
@classmethod
|
|
55
|
-
def from_json(cls, json_str: str) -> Self:
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
52
|
"""Create an instance of TweetResultByRestIdData from a JSON string"""
|
|
57
53
|
return cls.from_dict(json.loads(json_str))
|
|
58
54
|
|
|
@@ -66,10 +62,12 @@ class TweetResultByRestIdData(BaseModel):
|
|
|
66
62
|
were set at model initialization. Other fields with value `None`
|
|
67
63
|
are ignored.
|
|
68
64
|
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
69
68
|
_dict = self.model_dump(
|
|
70
69
|
by_alias=True,
|
|
71
|
-
exclude=
|
|
72
|
-
},
|
|
70
|
+
exclude=excluded_fields,
|
|
73
71
|
exclude_none=True,
|
|
74
72
|
)
|
|
75
73
|
# override the default output from pydantic by calling `to_dict()` of tweet_result
|
|
@@ -78,7 +76,7 @@ class TweetResultByRestIdData(BaseModel):
|
|
|
78
76
|
return _dict
|
|
79
77
|
|
|
80
78
|
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
82
80
|
"""Create an instance of TweetResultByRestIdData from a dict"""
|
|
83
81
|
if obj is None:
|
|
84
82
|
return None
|
|
@@ -87,7 +85,7 @@ class TweetResultByRestIdData(BaseModel):
|
|
|
87
85
|
return cls.model_validate(obj)
|
|
88
86
|
|
|
89
87
|
_obj = cls.model_validate({
|
|
90
|
-
"tweetResult": ItemResult.from_dict(obj
|
|
88
|
+
"tweetResult": ItemResult.from_dict(obj["tweetResult"]) if obj.get("tweetResult") is not None else None
|
|
91
89
|
})
|
|
92
90
|
return _obj
|
|
93
91
|
|
|
@@ -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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
24
23
|
from twitter_openapi_python_generated.models.tweet_result_by_rest_id_data import TweetResultByRestIdData
|
|
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 TweetResultByRestIdResponse(BaseModel):
|
|
31
28
|
"""
|
|
@@ -51,7 +48,7 @@ class TweetResultByRestIdResponse(BaseModel):
|
|
|
51
48
|
return json.dumps(self.to_dict())
|
|
52
49
|
|
|
53
50
|
@classmethod
|
|
54
|
-
def from_json(cls, json_str: str) -> Self:
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
52
|
"""Create an instance of TweetResultByRestIdResponse from a JSON string"""
|
|
56
53
|
return cls.from_dict(json.loads(json_str))
|
|
57
54
|
|
|
@@ -65,10 +62,12 @@ class TweetResultByRestIdResponse(BaseModel):
|
|
|
65
62
|
were set at model initialization. Other fields with value `None`
|
|
66
63
|
are ignored.
|
|
67
64
|
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
68
|
_dict = self.model_dump(
|
|
69
69
|
by_alias=True,
|
|
70
|
-
exclude=
|
|
71
|
-
},
|
|
70
|
+
exclude=excluded_fields,
|
|
72
71
|
exclude_none=True,
|
|
73
72
|
)
|
|
74
73
|
# override the default output from pydantic by calling `to_dict()` of data
|
|
@@ -77,7 +76,7 @@ class TweetResultByRestIdResponse(BaseModel):
|
|
|
77
76
|
return _dict
|
|
78
77
|
|
|
79
78
|
@classmethod
|
|
80
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
80
|
"""Create an instance of TweetResultByRestIdResponse from a dict"""
|
|
82
81
|
if obj is None:
|
|
83
82
|
return None
|
|
@@ -86,7 +85,7 @@ class TweetResultByRestIdResponse(BaseModel):
|
|
|
86
85
|
return cls.model_validate(obj)
|
|
87
86
|
|
|
88
87
|
_obj = cls.model_validate({
|
|
89
|
-
"data": TweetResultByRestIdData.from_dict(obj
|
|
88
|
+
"data": TweetResultByRestIdData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
90
89
|
})
|
|
91
90
|
return _obj
|
|
92
91
|
|
|
@@ -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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
24
23
|
from twitter_openapi_python_generated.models.tweet_retweeters_response_data import TweetRetweetersResponseData
|
|
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 TweetRetweetersResponse(BaseModel):
|
|
31
28
|
"""
|
|
@@ -51,7 +48,7 @@ class TweetRetweetersResponse(BaseModel):
|
|
|
51
48
|
return json.dumps(self.to_dict())
|
|
52
49
|
|
|
53
50
|
@classmethod
|
|
54
|
-
def from_json(cls, json_str: str) -> Self:
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
52
|
"""Create an instance of TweetRetweetersResponse from a JSON string"""
|
|
56
53
|
return cls.from_dict(json.loads(json_str))
|
|
57
54
|
|
|
@@ -65,10 +62,12 @@ class TweetRetweetersResponse(BaseModel):
|
|
|
65
62
|
were set at model initialization. Other fields with value `None`
|
|
66
63
|
are ignored.
|
|
67
64
|
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
68
|
_dict = self.model_dump(
|
|
69
69
|
by_alias=True,
|
|
70
|
-
exclude=
|
|
71
|
-
},
|
|
70
|
+
exclude=excluded_fields,
|
|
72
71
|
exclude_none=True,
|
|
73
72
|
)
|
|
74
73
|
# override the default output from pydantic by calling `to_dict()` of data
|
|
@@ -77,7 +76,7 @@ class TweetRetweetersResponse(BaseModel):
|
|
|
77
76
|
return _dict
|
|
78
77
|
|
|
79
78
|
@classmethod
|
|
80
|
-
def from_dict(cls, obj: Dict) -> Self:
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
80
|
"""Create an instance of TweetRetweetersResponse from a dict"""
|
|
82
81
|
if obj is None:
|
|
83
82
|
return None
|
|
@@ -86,7 +85,7 @@ class TweetRetweetersResponse(BaseModel):
|
|
|
86
85
|
return cls.model_validate(obj)
|
|
87
86
|
|
|
88
87
|
_obj = cls.model_validate({
|
|
89
|
-
"data": TweetRetweetersResponseData.from_dict(obj
|
|
88
|
+
"data": TweetRetweetersResponseData.from_dict(obj["data"]) if obj.get("data") is not None else None
|
|
90
89
|
})
|
|
91
90
|
return _obj
|
|
92
91
|
|