twitter-openapi-python-generated 0.1.2__py3-none-any.whl → 0.1.4__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 +129 -1
- twitter_openapi_python_generated/api/default_api.py +1437 -199
- twitter_openapi_python_generated/api/user_api.py +310 -6
- twitter_openapi_python_generated/api/users_api.py +327 -6
- twitter_openapi_python_generated/api_client.py +1 -1
- twitter_openapi_python_generated/configuration.py +1 -1
- twitter_openapi_python_generated/models/__init__.py +64 -0
- twitter_openapi_python_generated/models/about_account_data.py +93 -0
- twitter_openapi_python_generated/models/about_account_response.py +102 -0
- twitter_openapi_python_generated/models/about_account_user.py +161 -0
- twitter_openapi_python_generated/models/about_account_user_result.py +95 -0
- twitter_openapi_python_generated/models/about_account_verification_info.py +95 -0
- twitter_openapi_python_generated/models/about_account_verification_info_reason.py +99 -0
- twitter_openapi_python_generated/models/about_profile.py +103 -0
- twitter_openapi_python_generated/models/about_profile_username_changes.py +109 -0
- twitter_openapi_python_generated/models/ad_metadata_container.py +3 -1
- twitter_openapi_python_generated/models/ai_trend.py +126 -0
- twitter_openapi_python_generated/models/ai_trend_core.py +95 -0
- twitter_openapi_python_generated/models/ai_trend_results.py +95 -0
- twitter_openapi_python_generated/models/ai_trend_social_proof.py +89 -0
- twitter_openapi_python_generated/models/article_content_block.py +117 -0
- twitter_openapi_python_generated/models/article_content_block_data.py +104 -0
- twitter_openapi_python_generated/models/article_content_entity.py +95 -0
- twitter_openapi_python_generated/models/article_content_entity_data.py +115 -0
- twitter_openapi_python_generated/models/article_content_entity_range.py +93 -0
- twitter_openapi_python_generated/models/article_content_entity_value.py +104 -0
- twitter_openapi_python_generated/models/article_content_inline_style_range.py +100 -0
- twitter_openapi_python_generated/models/article_content_media_item.py +101 -0
- twitter_openapi_python_generated/models/article_content_state.py +105 -0
- twitter_openapi_python_generated/models/article_content_text_range.py +93 -0
- twitter_openapi_python_generated/models/article_result.py +9 -3
- twitter_openapi_python_generated/models/audio_space.py +107 -0
- twitter_openapi_python_generated/models/audio_space_data.py +93 -0
- twitter_openapi_python_generated/models/audio_space_mentioned_user.py +97 -0
- twitter_openapi_python_generated/models/audio_space_metadata.py +165 -0
- twitter_openapi_python_generated/models/audio_space_participant.py +109 -0
- twitter_openapi_python_generated/models/audio_space_participant_user.py +104 -0
- twitter_openapi_python_generated/models/audio_space_participant_user_results.py +103 -0
- twitter_openapi_python_generated/models/audio_space_participant_verification.py +99 -0
- twitter_openapi_python_generated/models/audio_space_participants.py +114 -0
- twitter_openapi_python_generated/models/audio_space_response.py +102 -0
- twitter_openapi_python_generated/models/audio_space_sharings.py +91 -0
- twitter_openapi_python_generated/models/birdwatch_pivot.py +0 -17
- twitter_openapi_python_generated/models/broadcast.py +159 -0
- twitter_openapi_python_generated/models/broadcast_data.py +93 -0
- twitter_openapi_python_generated/models/broadcast_edited_replay.py +89 -0
- twitter_openapi_python_generated/models/broadcast_periscope_user.py +95 -0
- twitter_openapi_python_generated/models/broadcast_response.py +102 -0
- twitter_openapi_python_generated/models/cashtag_attachment.py +6 -4
- twitter_openapi_python_generated/models/community.py +2 -2
- twitter_openapi_python_generated/models/community_delete_action_result.py +1 -8
- twitter_openapi_python_generated/models/community_invites_result.py +1 -8
- twitter_openapi_python_generated/models/community_join_action_unavailable.py +1 -8
- twitter_openapi_python_generated/models/community_leave_action_result.py +1 -8
- twitter_openapi_python_generated/models/conversation_control.py +8 -1
- twitter_openapi_python_generated/models/conversation_details.py +1 -8
- twitter_openapi_python_generated/models/cover_cta.py +5 -15
- twitter_openapi_python_generated/models/cta_client_event_info.py +1 -8
- twitter_openapi_python_generated/models/cta_limited_action_prompt.py +1 -8
- twitter_openapi_python_generated/models/feedback_action.py +1 -21
- twitter_openapi_python_generated/models/feedback_client_event_info.py +2 -2
- twitter_openapi_python_generated/models/grok_account_jwt.py +89 -0
- twitter_openapi_python_generated/models/grok_account_jwt_data.py +93 -0
- twitter_openapi_python_generated/models/grok_account_jwt_response.py +102 -0
- twitter_openapi_python_generated/models/grok_entity_ref.py +19 -4
- twitter_openapi_python_generated/models/grok_image_annotation.py +2 -2
- twitter_openapi_python_generated/models/identity_profile_labels_highlighted_label.py +93 -0
- twitter_openapi_python_generated/models/limited_action.py +8 -1
- twitter_openapi_python_generated/models/limited_action_results_data.py +8 -1
- twitter_openapi_python_generated/models/media_result.py +1 -1
- twitter_openapi_python_generated/models/module_header.py +8 -9
- twitter_openapi_python_generated/models/note_tweet_result_data.py +2 -2
- twitter_openapi_python_generated/models/notification_additional_context.py +94 -0
- twitter_openapi_python_generated/models/notification_template.py +10 -2
- twitter_openapi_python_generated/models/notification_url.py +104 -0
- twitter_openapi_python_generated/models/notification_urt_endpoint_options.py +93 -0
- twitter_openapi_python_generated/models/preroll.py +97 -0
- twitter_openapi_python_generated/models/preroll_call_to_action.py +91 -0
- twitter_openapi_python_generated/models/preroll_media_info.py +118 -0
- twitter_openapi_python_generated/models/preroll_metadata.py +93 -0
- twitter_openapi_python_generated/models/preroll_video_variant.py +93 -0
- twitter_openapi_python_generated/models/rich_message_entity.py +6 -4
- twitter_openapi_python_generated/models/session.py +0 -7
- twitter_openapi_python_generated/models/sidebar_user_recommendation.py +95 -0
- twitter_openapi_python_generated/models/sidebar_user_recommendations_data.py +96 -0
- twitter_openapi_python_generated/models/sidebar_user_recommendations_response.py +102 -0
- twitter_openapi_python_generated/models/story_topic.py +95 -0
- twitter_openapi_python_generated/models/story_topic_data.py +93 -0
- twitter_openapi_python_generated/models/story_topic_item.py +93 -0
- twitter_openapi_python_generated/models/story_topic_response.py +102 -0
- twitter_openapi_python_generated/models/story_topic_stories.py +96 -0
- twitter_openapi_python_generated/models/timeline_general_context.py +2 -2
- twitter_openapi_python_generated/models/timeline_half_cover.py +0 -7
- twitter_openapi_python_generated/models/timeline_message_prompt_content.py +1 -8
- twitter_openapi_python_generated/models/timeline_notification.py +3 -3
- twitter_openapi_python_generated/models/timeline_prompt_content.py +1 -15
- twitter_openapi_python_generated/models/timeline_show_alert.py +1 -15
- twitter_openapi_python_generated/models/timeline_tombstone.py +1 -11
- twitter_openapi_python_generated/models/timeline_topic_context.py +1 -11
- twitter_openapi_python_generated/models/timeline_tweet.py +7 -1
- twitter_openapi_python_generated/models/tweet.py +10 -2
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +8 -1
- twitter_openapi_python_generated/models/tweet_card_platform_audience.py +1 -8
- twitter_openapi_python_generated/models/tweet_legacy.py +18 -3
- twitter_openapi_python_generated/models/tweet_legacy_place.py +107 -0
- twitter_openapi_python_generated/models/tweet_legacy_place_bounding_box.py +98 -0
- twitter_openapi_python_generated/models/tweet_legacy_point.py +98 -0
- twitter_openapi_python_generated/models/tweet_post_cta.py +1 -9
- twitter_openapi_python_generated/models/tweet_sports_competitor.py +107 -0
- twitter_openapi_python_generated/models/tweet_sports_post_context.py +122 -0
- twitter_openapi_python_generated/models/tweet_sports_rest_id.py +97 -0
- twitter_openapi_python_generated/models/type_name.py +2 -0
- twitter_openapi_python_generated/models/unified_card.py +1 -8
- twitter_openapi_python_generated/models/user_highlights_tweets_result.py +2 -2
- twitter_openapi_python_generated/models/user_tweets_result_v1.py +2 -2
- {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/METADATA +72 -2
- {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/RECORD +121 -57
- {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/WHEEL +1 -1
- {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/licenses/LICENSE +0 -0
- {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/licenses/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.error_response import ErrorResponse
|
|
24
|
+
from twitter_openapi_python_generated.models.story_topic_data import StoryTopicData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class StoryTopicResponse(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
StoryTopicResponse
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
data: StoryTopicData
|
|
34
|
+
errors: Optional[List[ErrorResponse]] = None
|
|
35
|
+
__properties: ClassVar[List[str]] = ["data", "errors"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of StoryTopicResponse from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of data
|
|
77
|
+
if self.data:
|
|
78
|
+
_dict['data'] = self.data.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
|
|
80
|
+
_items = []
|
|
81
|
+
if self.errors:
|
|
82
|
+
for _item_errors in self.errors:
|
|
83
|
+
_items.append(_item_errors.to_dict() if _item_errors is not None else None)
|
|
84
|
+
_dict['errors'] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of StoryTopicResponse from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"data": StoryTopicData.from_dict(obj["data"]) if obj.get("data") is not None else None,
|
|
98
|
+
"errors": [ErrorResponse.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
|
|
99
|
+
})
|
|
100
|
+
return _obj
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.story_topic_item import StoryTopicItem
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class StoryTopicStories(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
StoryTopicStories
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
items: List[StoryTopicItem]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["items"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of StoryTopicStories from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.items:
|
|
77
|
+
for _item_items in self.items:
|
|
78
|
+
_items.append(_item_items.to_dict() if _item_items is not None else None)
|
|
79
|
+
_dict['items'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of StoryTopicStories from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"items": [StoryTopicItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -43,8 +43,8 @@ class TimelineGeneralContext(BaseModel):
|
|
|
43
43
|
if value is None:
|
|
44
44
|
return value
|
|
45
45
|
|
|
46
|
-
if value not in set(['Follow', 'Pin', 'Like', 'Location', 'Sparkle', 'Conversation', 'List', 'Community', 'Facepile']):
|
|
47
|
-
raise ValueError("must be one of enum values ('Follow', 'Pin', 'Like', 'Location', 'Sparkle', 'Conversation', 'List', 'Community', 'Facepile')")
|
|
46
|
+
if value not in set(['Follow', 'Pin', 'Like', 'Location', 'Sparkle', 'Conversation', 'List', 'TextOnly', 'Community', 'Facepile']):
|
|
47
|
+
raise ValueError("must be one of enum values ('Follow', 'Pin', 'Like', 'Location', 'Sparkle', 'Conversation', 'List', 'TextOnly', 'Community', 'Facepile')")
|
|
48
48
|
return value
|
|
49
49
|
|
|
50
50
|
model_config = ConfigDict(
|
|
@@ -40,13 +40,6 @@ class TimelineHalfCover(BaseModel):
|
|
|
40
40
|
type: StrictStr
|
|
41
41
|
__properties: ClassVar[List[str]] = ["dismissible", "halfCoverDisplayType", "impressionCallbacks", "primaryCoverCta", "primaryText", "secondaryText", "type"]
|
|
42
42
|
|
|
43
|
-
@field_validator('half_cover_display_type')
|
|
44
|
-
def half_cover_display_type_validate_enum(cls, value):
|
|
45
|
-
"""Validates the enum"""
|
|
46
|
-
if value not in set(['Cover']):
|
|
47
|
-
raise ValueError("must be one of enum values ('Cover')")
|
|
48
|
-
return value
|
|
49
|
-
|
|
50
43
|
@field_validator('type')
|
|
51
44
|
def type_validate_enum(cls, value):
|
|
52
45
|
"""Validates the enum"""
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.timeline_message_prompt_button import TimelineMessagePromptButton
|
|
24
24
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text import TimelineMessagePromptRichText
|
|
@@ -37,13 +37,6 @@ class TimelineMessagePromptContent(BaseModel):
|
|
|
37
37
|
primary_button_action: Optional[TimelineMessagePromptButton] = Field(default=None, alias="primaryButtonAction")
|
|
38
38
|
__properties: ClassVar[List[str]] = ["bodyRichText", "bodyText", "contentType", "headerText", "primaryButtonAction"]
|
|
39
39
|
|
|
40
|
-
@field_validator('content_type')
|
|
41
|
-
def content_type_validate_enum(cls, value):
|
|
42
|
-
"""Validates the enum"""
|
|
43
|
-
if value not in set(['TimelineInlinePrompt', 'TimelineCompactPrompt']):
|
|
44
|
-
raise ValueError("must be one of enum values ('TimelineInlinePrompt', 'TimelineCompactPrompt')")
|
|
45
|
-
return value
|
|
46
|
-
|
|
47
40
|
model_config = ConfigDict(
|
|
48
41
|
validate_by_name=True,
|
|
49
42
|
validate_by_alias=True,
|
|
@@ -22,8 +22,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from twitter_openapi_python_generated.models.content_item_type import ContentItemType
|
|
24
24
|
from twitter_openapi_python_generated.models.notification_template import NotificationTemplate
|
|
25
|
+
from twitter_openapi_python_generated.models.notification_url import NotificationUrl
|
|
25
26
|
from twitter_openapi_python_generated.models.rich_message import RichMessage
|
|
26
|
-
from twitter_openapi_python_generated.models.social_context_landing_url import SocialContextLandingUrl
|
|
27
27
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
28
28
|
from typing import Optional, Set
|
|
29
29
|
from typing_extensions import Self
|
|
@@ -37,7 +37,7 @@ class TimelineNotification(BaseModel):
|
|
|
37
37
|
id: StrictStr
|
|
38
38
|
item_type: ContentItemType = Field(alias="itemType")
|
|
39
39
|
notification_icon: StrictStr
|
|
40
|
-
notification_url:
|
|
40
|
+
notification_url: NotificationUrl
|
|
41
41
|
rich_message: RichMessage
|
|
42
42
|
template: NotificationTemplate
|
|
43
43
|
timestamp_ms: StrictStr
|
|
@@ -107,7 +107,7 @@ class TimelineNotification(BaseModel):
|
|
|
107
107
|
"id": obj.get("id"),
|
|
108
108
|
"itemType": obj.get("itemType"),
|
|
109
109
|
"notification_icon": obj.get("notification_icon"),
|
|
110
|
-
"notification_url":
|
|
110
|
+
"notification_url": NotificationUrl.from_dict(obj["notification_url"]) if obj.get("notification_url") is not None else None,
|
|
111
111
|
"rich_message": RichMessage.from_dict(obj["rich_message"]) if obj.get("rich_message") is not None else None,
|
|
112
112
|
"template": NotificationTemplate.from_dict(obj["template"]) if obj.get("template") is not None else None,
|
|
113
113
|
"timestamp_ms": obj.get("timestamp_ms")
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from twitter_openapi_python_generated.models.timeline_prompt_callback import TimelinePromptCallback
|
|
24
24
|
from typing import Optional, Set
|
|
@@ -39,20 +39,6 @@ class TimelinePromptContent(BaseModel):
|
|
|
39
39
|
title: StrictStr
|
|
40
40
|
__properties: ClassVar[List[str]] = ["confirmation", "contentType", "displayType", "isRelevantCallback", "isRelevantText", "notRelevantCallback", "notRelevantText", "title"]
|
|
41
41
|
|
|
42
|
-
@field_validator('content_type')
|
|
43
|
-
def content_type_validate_enum(cls, value):
|
|
44
|
-
"""Validates the enum"""
|
|
45
|
-
if value not in set(['TimelineRelevancePrompt']):
|
|
46
|
-
raise ValueError("must be one of enum values ('TimelineRelevancePrompt')")
|
|
47
|
-
return value
|
|
48
|
-
|
|
49
|
-
@field_validator('display_type')
|
|
50
|
-
def display_type_validate_enum(cls, value):
|
|
51
|
-
"""Validates the enum"""
|
|
52
|
-
if value not in set(['Compact']):
|
|
53
|
-
raise ValueError("must be one of enum values ('Compact')")
|
|
54
|
-
return value
|
|
55
|
-
|
|
56
42
|
model_config = ConfigDict(
|
|
57
43
|
validate_by_name=True,
|
|
58
44
|
validate_by_alias=True,
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.client_event_info import ClientEventInfo
|
|
24
24
|
from twitter_openapi_python_generated.models.instruction_type import InstructionType
|
|
@@ -46,20 +46,6 @@ class TimelineShowAlert(BaseModel):
|
|
|
46
46
|
users_results: Optional[List[UserResults]] = Field(default=None, alias="usersResults")
|
|
47
47
|
__properties: ClassVar[List[str]] = ["alertType", "clientEventInfo", "colorConfig", "displayDurationMs", "displayLocation", "iconDisplayInfo", "richText", "triggerDelayMs", "type", "usersResults"]
|
|
48
48
|
|
|
49
|
-
@field_validator('alert_type')
|
|
50
|
-
def alert_type_validate_enum(cls, value):
|
|
51
|
-
"""Validates the enum"""
|
|
52
|
-
if value not in set(['NewTweets']):
|
|
53
|
-
raise ValueError("must be one of enum values ('NewTweets')")
|
|
54
|
-
return value
|
|
55
|
-
|
|
56
|
-
@field_validator('display_location')
|
|
57
|
-
def display_location_validate_enum(cls, value):
|
|
58
|
-
"""Validates the enum"""
|
|
59
|
-
if value not in set(['Top']):
|
|
60
|
-
raise ValueError("must be one of enum values ('Top')")
|
|
61
|
-
return value
|
|
62
|
-
|
|
63
49
|
model_config = ConfigDict(
|
|
64
50
|
validate_by_name=True,
|
|
65
51
|
validate_by_alias=True,
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.content_item_type import ContentItemType
|
|
24
24
|
from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo
|
|
@@ -37,16 +37,6 @@ class TimelineTombstone(BaseModel):
|
|
|
37
37
|
tombstone_info: Optional[TombstoneInfo] = Field(default=None, alias="tombstoneInfo")
|
|
38
38
|
__properties: ClassVar[List[str]] = ["__typename", "itemType", "tombstoneDisplayType", "tombstoneInfo"]
|
|
39
39
|
|
|
40
|
-
@field_validator('tombstone_display_type')
|
|
41
|
-
def tombstone_display_type_validate_enum(cls, value):
|
|
42
|
-
"""Validates the enum"""
|
|
43
|
-
if value is None:
|
|
44
|
-
return value
|
|
45
|
-
|
|
46
|
-
if value not in set(['Inline']):
|
|
47
|
-
raise ValueError("must be one of enum values ('Inline')")
|
|
48
|
-
return value
|
|
49
|
-
|
|
50
40
|
model_config = ConfigDict(
|
|
51
41
|
validate_by_name=True,
|
|
52
42
|
validate_by_alias=True,
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.social_context_union_type import SocialContextUnionType
|
|
24
24
|
from twitter_openapi_python_generated.models.topic_context import TopicContext
|
|
@@ -35,16 +35,6 @@ class TimelineTopicContext(BaseModel):
|
|
|
35
35
|
type: Optional[SocialContextUnionType] = None
|
|
36
36
|
__properties: ClassVar[List[str]] = ["functionalityType", "topic", "type"]
|
|
37
37
|
|
|
38
|
-
@field_validator('functionality_type')
|
|
39
|
-
def functionality_type_validate_enum(cls, value):
|
|
40
|
-
"""Validates the enum"""
|
|
41
|
-
if value is None:
|
|
42
|
-
return value
|
|
43
|
-
|
|
44
|
-
if value not in set(['Basic']):
|
|
45
|
-
raise ValueError("must be one of enum values ('Basic')")
|
|
46
|
-
return value
|
|
47
|
-
|
|
48
38
|
model_config = ConfigDict(
|
|
49
39
|
validate_by_name=True,
|
|
50
40
|
validate_by_alias=True,
|
|
@@ -23,6 +23,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
23
23
|
from twitter_openapi_python_generated.models.content_item_type import ContentItemType
|
|
24
24
|
from twitter_openapi_python_generated.models.highlight import Highlight
|
|
25
25
|
from twitter_openapi_python_generated.models.item_result import ItemResult
|
|
26
|
+
from twitter_openapi_python_generated.models.preroll_metadata import PrerollMetadata
|
|
26
27
|
from twitter_openapi_python_generated.models.promoted_metadata import PromotedMetadata
|
|
27
28
|
from twitter_openapi_python_generated.models.social_context_union import SocialContextUnion
|
|
28
29
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
@@ -38,11 +39,12 @@ class TimelineTweet(BaseModel):
|
|
|
38
39
|
has_moderated_replies: Optional[StrictBool] = Field(default=None, alias="hasModeratedReplies")
|
|
39
40
|
highlights: Optional[Highlight] = None
|
|
40
41
|
item_type: ContentItemType = Field(alias="itemType")
|
|
42
|
+
preroll_metadata: Optional[PrerollMetadata] = Field(default=None, alias="prerollMetadata")
|
|
41
43
|
promoted_metadata: Optional[PromotedMetadata] = Field(default=None, alias="promotedMetadata")
|
|
42
44
|
social_context: Optional[SocialContextUnion] = Field(default=None, alias="socialContext")
|
|
43
45
|
tweet_display_type: StrictStr = Field(alias="tweetDisplayType")
|
|
44
46
|
tweet_results: ItemResult
|
|
45
|
-
__properties: ClassVar[List[str]] = ["__typename", "hasModeratedReplies", "highlights", "itemType", "promotedMetadata", "socialContext", "tweetDisplayType", "tweet_results"]
|
|
47
|
+
__properties: ClassVar[List[str]] = ["__typename", "hasModeratedReplies", "highlights", "itemType", "prerollMetadata", "promotedMetadata", "socialContext", "tweetDisplayType", "tweet_results"]
|
|
46
48
|
|
|
47
49
|
@field_validator('tweet_display_type')
|
|
48
50
|
def tweet_display_type_validate_enum(cls, value):
|
|
@@ -93,6 +95,9 @@ class TimelineTweet(BaseModel):
|
|
|
93
95
|
# override the default output from pydantic by calling `to_dict()` of highlights
|
|
94
96
|
if self.highlights:
|
|
95
97
|
_dict['highlights'] = self.highlights.to_dict()
|
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of preroll_metadata
|
|
99
|
+
if self.preroll_metadata:
|
|
100
|
+
_dict['prerollMetadata'] = self.preroll_metadata.to_dict()
|
|
96
101
|
# override the default output from pydantic by calling `to_dict()` of promoted_metadata
|
|
97
102
|
if self.promoted_metadata:
|
|
98
103
|
_dict['promotedMetadata'] = self.promoted_metadata.to_dict()
|
|
@@ -118,6 +123,7 @@ class TimelineTweet(BaseModel):
|
|
|
118
123
|
"hasModeratedReplies": obj.get("hasModeratedReplies"),
|
|
119
124
|
"highlights": Highlight.from_dict(obj["highlights"]) if obj.get("highlights") is not None else None,
|
|
120
125
|
"itemType": obj.get("itemType"),
|
|
126
|
+
"prerollMetadata": PrerollMetadata.from_dict(obj["prerollMetadata"]) if obj.get("prerollMetadata") is not None else None,
|
|
121
127
|
"promotedMetadata": PromotedMetadata.from_dict(obj["promotedMetadata"]) if obj.get("promotedMetadata") is not None else None,
|
|
122
128
|
"socialContext": SocialContextUnion.from_dict(obj["socialContext"]) if obj.get("socialContext") is not None else None,
|
|
123
129
|
"tweetDisplayType": obj.get("tweetDisplayType"),
|
|
@@ -39,6 +39,7 @@ from twitter_openapi_python_generated.models.tweet_edit_control import TweetEdit
|
|
|
39
39
|
from twitter_openapi_python_generated.models.tweet_edit_prespective import TweetEditPrespective
|
|
40
40
|
from twitter_openapi_python_generated.models.tweet_post_cta import TweetPostCta
|
|
41
41
|
from twitter_openapi_python_generated.models.tweet_previous_counts import TweetPreviousCounts
|
|
42
|
+
from twitter_openapi_python_generated.models.tweet_sports_post_context import TweetSportsPostContext
|
|
42
43
|
from twitter_openapi_python_generated.models.tweet_view import TweetView
|
|
43
44
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
44
45
|
from twitter_openapi_python_generated.models.unified_card import UnifiedCard
|
|
@@ -83,12 +84,14 @@ class Tweet(BaseModel):
|
|
|
83
84
|
quoted_status_result: Optional[ItemResult] = None
|
|
84
85
|
rest_id: Annotated[str, Field(strict=True)]
|
|
85
86
|
source: Optional[StrictStr] = None
|
|
87
|
+
sports_post_context: Optional[TweetSportsPostContext] = None
|
|
86
88
|
super_follows_reply_user_result: Optional[SuperFollowsReplyUserResult] = Field(default=None, alias="superFollowsReplyUserResult")
|
|
87
89
|
trend_results: Optional[TrendResults] = None
|
|
88
90
|
unified_card: Optional[UnifiedCard] = None
|
|
89
91
|
unmention_data: Optional[Dict[str, Any]] = None
|
|
90
92
|
views: Optional[TweetView] = None
|
|
91
|
-
|
|
93
|
+
voice_info: Optional[Dict[str, Any]] = Field(default=None, alias="voiceInfo")
|
|
94
|
+
__properties: ClassVar[List[str]] = ["__typename", "article", "author_community_relationship", "birdwatch_pivot", "card", "cashtag_attachments", "community_relationship", "community_results", "content_disclosure", "core", "edit_control", "edit_prespective", "grok_analysis_button", "grok_analysis_followups", "grok_annotations", "grok_share_attachment", "grok_translated_post_with_availability", "has_birdwatch_notes", "is_translatable", "jetfuel_attachment", "legacy", "nested_quoted_tweet_results", "note_tweet", "postCta", "post_image_description", "post_video_description", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "sports_post_context", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views", "voiceInfo"]
|
|
92
95
|
|
|
93
96
|
@field_validator('rest_id', mode="before")
|
|
94
97
|
def rest_id_validate_regular_expression(cls, value):
|
|
@@ -205,6 +208,9 @@ class Tweet(BaseModel):
|
|
|
205
208
|
# override the default output from pydantic by calling `to_dict()` of quoted_status_result
|
|
206
209
|
if self.quoted_status_result:
|
|
207
210
|
_dict['quoted_status_result'] = self.quoted_status_result.to_dict()
|
|
211
|
+
# override the default output from pydantic by calling `to_dict()` of sports_post_context
|
|
212
|
+
if self.sports_post_context:
|
|
213
|
+
_dict['sports_post_context'] = self.sports_post_context.to_dict()
|
|
208
214
|
# override the default output from pydantic by calling `to_dict()` of super_follows_reply_user_result
|
|
209
215
|
if self.super_follows_reply_user_result:
|
|
210
216
|
_dict['superFollowsReplyUserResult'] = self.super_follows_reply_user_result.to_dict()
|
|
@@ -261,11 +267,13 @@ class Tweet(BaseModel):
|
|
|
261
267
|
"quoted_status_result": ItemResult.from_dict(obj["quoted_status_result"]) if obj.get("quoted_status_result") is not None else None,
|
|
262
268
|
"rest_id": obj.get("rest_id"),
|
|
263
269
|
"source": obj.get("source"),
|
|
270
|
+
"sports_post_context": TweetSportsPostContext.from_dict(obj["sports_post_context"]) if obj.get("sports_post_context") is not None else None,
|
|
264
271
|
"superFollowsReplyUserResult": SuperFollowsReplyUserResult.from_dict(obj["superFollowsReplyUserResult"]) if obj.get("superFollowsReplyUserResult") is not None else None,
|
|
265
272
|
"trend_results": TrendResults.from_dict(obj["trend_results"]) if obj.get("trend_results") is not None else None,
|
|
266
273
|
"unified_card": UnifiedCard.from_dict(obj["unified_card"]) if obj.get("unified_card") is not None else None,
|
|
267
274
|
"unmention_data": obj.get("unmention_data"),
|
|
268
|
-
"views": TweetView.from_dict(obj["views"]) if obj.get("views") is not None else None
|
|
275
|
+
"views": TweetView.from_dict(obj["views"]) if obj.get("views") is not None else None,
|
|
276
|
+
"voiceInfo": obj.get("voiceInfo")
|
|
269
277
|
})
|
|
270
278
|
return _obj
|
|
271
279
|
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.media_color_info import MediaColorInfo
|
|
24
24
|
from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value_data_image import TweetCardLegacyBindingValueDataImage
|
|
@@ -40,6 +40,13 @@ class TweetCardLegacyBindingValueData(BaseModel):
|
|
|
40
40
|
user_value: Optional[UserValue] = None
|
|
41
41
|
__properties: ClassVar[List[str]] = ["boolean_value", "image_color_value", "image_value", "scribe_key", "string_value", "type", "user_value"]
|
|
42
42
|
|
|
43
|
+
@field_validator('type')
|
|
44
|
+
def type_validate_enum(cls, value):
|
|
45
|
+
"""Validates the enum"""
|
|
46
|
+
if value not in set(['STRING', 'IMAGE', 'USER', 'BOOLEAN', 'IMAGE_COLOR']):
|
|
47
|
+
raise ValueError("must be one of enum values ('STRING', 'IMAGE', 'USER', 'BOOLEAN', 'IMAGE_COLOR')")
|
|
48
|
+
return value
|
|
49
|
+
|
|
43
50
|
model_config = ConfigDict(
|
|
44
51
|
validate_by_name=True,
|
|
45
52
|
validate_by_alias=True,
|
|
@@ -18,7 +18,7 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
@@ -31,13 +31,6 @@ class TweetCardPlatformAudience(BaseModel):
|
|
|
31
31
|
name: StrictStr
|
|
32
32
|
__properties: ClassVar[List[str]] = ["name"]
|
|
33
33
|
|
|
34
|
-
@field_validator('name')
|
|
35
|
-
def name_validate_enum(cls, value):
|
|
36
|
-
"""Validates the enum"""
|
|
37
|
-
if value not in set(['production']):
|
|
38
|
-
raise ValueError("must be one of enum values ('production')")
|
|
39
|
-
return value
|
|
40
|
-
|
|
41
34
|
model_config = ConfigDict(
|
|
42
35
|
validate_by_name=True,
|
|
43
36
|
validate_by_alias=True,
|
|
@@ -26,6 +26,8 @@ from twitter_openapi_python_generated.models.entities import Entities
|
|
|
26
26
|
from twitter_openapi_python_generated.models.extended_entities import ExtendedEntities
|
|
27
27
|
from twitter_openapi_python_generated.models.quoted_status_permalink import QuotedStatusPermalink
|
|
28
28
|
from twitter_openapi_python_generated.models.self_thread import SelfThread
|
|
29
|
+
from twitter_openapi_python_generated.models.tweet_legacy_place import TweetLegacyPlace
|
|
30
|
+
from twitter_openapi_python_generated.models.tweet_legacy_point import TweetLegacyPoint
|
|
29
31
|
from twitter_openapi_python_generated.models.tweet_legacy_scopes import TweetLegacyScopes
|
|
30
32
|
from typing import Optional, Set
|
|
31
33
|
from typing_extensions import Self
|
|
@@ -39,6 +41,7 @@ class TweetLegacy(BaseModel):
|
|
|
39
41
|
bookmarked: StrictBool
|
|
40
42
|
conversation_control: Optional[ConversationControl] = None
|
|
41
43
|
conversation_id_str: Annotated[str, Field(strict=True)]
|
|
44
|
+
coordinates: Optional[TweetLegacyPoint] = None
|
|
42
45
|
created_at: Annotated[str, Field(strict=True)] = Field(json_schema_extra={"examples": ["Sat Dec 31 23:59:59 +0000 2023"]})
|
|
43
46
|
display_text_range: List[StrictInt]
|
|
44
47
|
entities: Optional[Entities] = None
|
|
@@ -46,6 +49,7 @@ class TweetLegacy(BaseModel):
|
|
|
46
49
|
favorite_count: StrictInt
|
|
47
50
|
favorited: StrictBool
|
|
48
51
|
full_text: StrictStr
|
|
52
|
+
geo: Optional[TweetLegacyPoint] = None
|
|
49
53
|
id_str: Annotated[str, Field(strict=True)]
|
|
50
54
|
in_reply_to_screen_name: Optional[StrictStr] = None
|
|
51
55
|
in_reply_to_status_id_str: Optional[Annotated[str, Field(strict=True)]] = None
|
|
@@ -53,7 +57,7 @@ class TweetLegacy(BaseModel):
|
|
|
53
57
|
is_quote_status: StrictBool
|
|
54
58
|
lang: StrictStr
|
|
55
59
|
limited_actions: Optional[StrictStr] = None
|
|
56
|
-
place: Optional[
|
|
60
|
+
place: Optional[TweetLegacyPlace] = None
|
|
57
61
|
possibly_sensitive: Optional[StrictBool] = None
|
|
58
62
|
possibly_sensitive_editable: Optional[StrictBool] = None
|
|
59
63
|
quote_count: StrictInt
|
|
@@ -66,7 +70,7 @@ class TweetLegacy(BaseModel):
|
|
|
66
70
|
scopes: Optional[TweetLegacyScopes] = None
|
|
67
71
|
self_thread: Optional[SelfThread] = None
|
|
68
72
|
user_id_str: Annotated[str, Field(strict=True)]
|
|
69
|
-
__properties: ClassVar[List[str]] = ["bookmark_count", "bookmarked", "conversation_control", "conversation_id_str", "created_at", "display_text_range", "entities", "extended_entities", "favorite_count", "favorited", "full_text", "id_str", "in_reply_to_screen_name", "in_reply_to_status_id_str", "in_reply_to_user_id_str", "is_quote_status", "lang", "limited_actions", "place", "possibly_sensitive", "possibly_sensitive_editable", "quote_count", "quoted_status_id_str", "quoted_status_permalink", "reply_count", "retweet_count", "retweeted", "retweeted_status_result", "scopes", "self_thread", "user_id_str"]
|
|
73
|
+
__properties: ClassVar[List[str]] = ["bookmark_count", "bookmarked", "conversation_control", "conversation_id_str", "coordinates", "created_at", "display_text_range", "entities", "extended_entities", "favorite_count", "favorited", "full_text", "geo", "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"]
|
|
70
74
|
|
|
71
75
|
@field_validator('conversation_id_str', mode="before")
|
|
72
76
|
def conversation_id_str_validate_regular_expression(cls, value):
|
|
@@ -178,12 +182,21 @@ class TweetLegacy(BaseModel):
|
|
|
178
182
|
# override the default output from pydantic by calling `to_dict()` of conversation_control
|
|
179
183
|
if self.conversation_control:
|
|
180
184
|
_dict['conversation_control'] = self.conversation_control.to_dict()
|
|
185
|
+
# override the default output from pydantic by calling `to_dict()` of coordinates
|
|
186
|
+
if self.coordinates:
|
|
187
|
+
_dict['coordinates'] = self.coordinates.to_dict()
|
|
181
188
|
# override the default output from pydantic by calling `to_dict()` of entities
|
|
182
189
|
if self.entities:
|
|
183
190
|
_dict['entities'] = self.entities.to_dict()
|
|
184
191
|
# override the default output from pydantic by calling `to_dict()` of extended_entities
|
|
185
192
|
if self.extended_entities:
|
|
186
193
|
_dict['extended_entities'] = self.extended_entities.to_dict()
|
|
194
|
+
# override the default output from pydantic by calling `to_dict()` of geo
|
|
195
|
+
if self.geo:
|
|
196
|
+
_dict['geo'] = self.geo.to_dict()
|
|
197
|
+
# override the default output from pydantic by calling `to_dict()` of place
|
|
198
|
+
if self.place:
|
|
199
|
+
_dict['place'] = self.place.to_dict()
|
|
187
200
|
# override the default output from pydantic by calling `to_dict()` of quoted_status_permalink
|
|
188
201
|
if self.quoted_status_permalink:
|
|
189
202
|
_dict['quoted_status_permalink'] = self.quoted_status_permalink.to_dict()
|
|
@@ -212,6 +225,7 @@ class TweetLegacy(BaseModel):
|
|
|
212
225
|
"bookmarked": obj.get("bookmarked"),
|
|
213
226
|
"conversation_control": ConversationControl.from_dict(obj["conversation_control"]) if obj.get("conversation_control") is not None else None,
|
|
214
227
|
"conversation_id_str": obj.get("conversation_id_str"),
|
|
228
|
+
"coordinates": TweetLegacyPoint.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None,
|
|
215
229
|
"created_at": obj.get("created_at"),
|
|
216
230
|
"display_text_range": obj.get("display_text_range"),
|
|
217
231
|
"entities": Entities.from_dict(obj["entities"]) if obj.get("entities") is not None else None,
|
|
@@ -219,6 +233,7 @@ class TweetLegacy(BaseModel):
|
|
|
219
233
|
"favorite_count": obj.get("favorite_count"),
|
|
220
234
|
"favorited": obj.get("favorited"),
|
|
221
235
|
"full_text": obj.get("full_text"),
|
|
236
|
+
"geo": TweetLegacyPoint.from_dict(obj["geo"]) if obj.get("geo") is not None else None,
|
|
222
237
|
"id_str": obj.get("id_str"),
|
|
223
238
|
"in_reply_to_screen_name": obj.get("in_reply_to_screen_name"),
|
|
224
239
|
"in_reply_to_status_id_str": obj.get("in_reply_to_status_id_str"),
|
|
@@ -226,7 +241,7 @@ class TweetLegacy(BaseModel):
|
|
|
226
241
|
"is_quote_status": obj.get("is_quote_status"),
|
|
227
242
|
"lang": obj.get("lang"),
|
|
228
243
|
"limited_actions": obj.get("limited_actions"),
|
|
229
|
-
"place": obj.get("place"),
|
|
244
|
+
"place": TweetLegacyPlace.from_dict(obj["place"]) if obj.get("place") is not None else None,
|
|
230
245
|
"possibly_sensitive": obj.get("possibly_sensitive"),
|
|
231
246
|
"possibly_sensitive_editable": obj.get("possibly_sensitive_editable"),
|
|
232
247
|
"quote_count": obj.get("quote_count"),
|