twitter-openapi-python-generated 0.0.35__py3-none-any.whl → 0.1.1__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 +135 -9
- twitter_openapi_python_generated/api_client.py +1 -1
- twitter_openapi_python_generated/configuration.py +1 -1
- twitter_openapi_python_generated/models/__init__.py +67 -4
- twitter_openapi_python_generated/models/ad_metadata_container.py +104 -0
- twitter_openapi_python_generated/models/affiliates_highlighted_label.py +93 -0
- twitter_openapi_python_generated/models/api_image.py +108 -0
- twitter_openapi_python_generated/models/api_media.py +110 -0
- twitter_openapi_python_generated/models/article_cover_media_info.py +3 -3
- twitter_openapi_python_generated/models/birdwatch_pivot.py +2 -2
- twitter_openapi_python_generated/models/cashtag_info.py +93 -0
- twitter_openapi_python_generated/models/click_tracking_info.py +96 -0
- twitter_openapi_python_generated/models/client_event_info.py +6 -2
- twitter_openapi_python_generated/models/client_event_info_details.py +99 -0
- twitter_openapi_python_generated/models/community.py +20 -7
- twitter_openapi_python_generated/models/community_banner_media.py +95 -0
- twitter_openapi_python_generated/models/community_banner_media_info.py +108 -0
- twitter_openapi_python_generated/models/community_moderation_state.py +90 -0
- twitter_openapi_python_generated/models/community_relationship.py +6 -2
- twitter_openapi_python_generated/models/community_viewer_relationship.py +95 -0
- twitter_openapi_python_generated/models/conversation_control.py +10 -11
- twitter_openapi_python_generated/models/conversation_details.py +96 -0
- twitter_openapi_python_generated/models/conversation_metadata.py +92 -0
- twitter_openapi_python_generated/models/conversation_owner.py +96 -0
- twitter_openapi_python_generated/models/conversation_owner_core.py +89 -0
- twitter_openapi_python_generated/models/conversation_owner_results.py +93 -0
- twitter_openapi_python_generated/models/cta_limited_action_prompt.py +110 -0
- twitter_openapi_python_generated/models/cta_limited_action_prompt_text.py +91 -0
- twitter_openapi_python_generated/models/deepsearch_header.py +96 -0
- twitter_openapi_python_generated/models/deepsearch_step.py +99 -0
- twitter_openapi_python_generated/models/deepsearch_web_result.py +89 -0
- twitter_openapi_python_generated/models/entities.py +27 -6
- twitter_openapi_python_generated/models/error_extensions.py +1 -1
- twitter_openapi_python_generated/models/error_response.py +1 -1
- twitter_openapi_python_generated/models/feedback_action.py +136 -0
- twitter_openapi_python_generated/models/feedback_action_entry.py +95 -0
- twitter_openapi_python_generated/models/feedback_client_event_info.py +93 -0
- twitter_openapi_python_generated/models/feedback_info.py +8 -6
- twitter_openapi_python_generated/models/grok_share_attachment_item.py +9 -2
- twitter_openapi_python_generated/models/grouped_trend.py +95 -0
- twitter_openapi_python_generated/models/hashtag.py +91 -0
- twitter_openapi_python_generated/models/jetfuel_attachment.py +91 -0
- twitter_openapi_python_generated/models/key_value.py +91 -0
- twitter_openapi_python_generated/models/landing_url.py +98 -0
- twitter_openapi_python_generated/models/limited_action.py +95 -0
- twitter_openapi_python_generated/models/limited_action_results.py +96 -0
- twitter_openapi_python_generated/models/limited_action_results_data.py +1 -8
- twitter_openapi_python_generated/models/list_banner_media_info.py +3 -3
- twitter_openapi_python_generated/models/list_banner_media_results.py +93 -0
- twitter_openapi_python_generated/models/{article_cover_media_color_info.py → media_color_info.py} +7 -7
- twitter_openapi_python_generated/models/{article_cover_media_color_info_palette.py → media_color_info_palette.py} +7 -7
- twitter_openapi_python_generated/models/{article_cover_media_color_info_palette_rgb.py → media_color_info_palette_rgb.py} +4 -4
- twitter_openapi_python_generated/models/{list_banner_media_salient_rect.py → media_salient_rect.py} +4 -4
- twitter_openapi_python_generated/models/module_footer.py +104 -0
- twitter_openapi_python_generated/models/module_header.py +100 -0
- twitter_openapi_python_generated/models/module_metadata.py +93 -0
- twitter_openapi_python_generated/models/promoted_metadata.py +109 -0
- twitter_openapi_python_generated/models/reader_mode_config.py +89 -0
- twitter_openapi_python_generated/models/scribe_config.py +89 -0
- twitter_openapi_python_generated/models/search_timeline.py +2 -2
- twitter_openapi_python_generated/models/smarttag_tag.py +6 -2
- twitter_openapi_python_generated/models/smarttag_tag_info.py +93 -0
- twitter_openapi_python_generated/models/symbol.py +97 -0
- twitter_openapi_python_generated/models/timeline.py +12 -4
- twitter_openapi_python_generated/models/timeline_community.py +13 -17
- twitter_openapi_python_generated/models/timeline_message_prompt.py +13 -17
- twitter_openapi_python_generated/models/timeline_message_prompt_button.py +95 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_button_action.py +91 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_content.py +112 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_rich_text.py +98 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity.py +97 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity_ref.py +107 -0
- twitter_openapi_python_generated/models/timeline_metadata.py +99 -0
- twitter_openapi_python_generated/models/timeline_prompt.py +19 -17
- twitter_openapi_python_generated/models/timeline_prompt_callback.py +89 -0
- twitter_openapi_python_generated/models/timeline_prompt_content.py +124 -0
- twitter_openapi_python_generated/models/timeline_response_objects.py +96 -0
- twitter_openapi_python_generated/models/timeline_show_alert.py +18 -21
- twitter_openapi_python_generated/models/timeline_show_alert_color_config.py +93 -0
- twitter_openapi_python_generated/models/timeline_show_alert_icon_display_info.py +91 -0
- twitter_openapi_python_generated/models/timeline_show_alert_rich_text.py +3 -3
- twitter_openapi_python_generated/models/timeline_timeline_item.py +6 -2
- twitter_openapi_python_generated/models/timeline_timeline_module.py +18 -6
- twitter_openapi_python_generated/models/timeline_trend.py +10 -1
- twitter_openapi_python_generated/models/timeline_tweet.py +6 -2
- twitter_openapi_python_generated/models/timelines_details.py +93 -0
- twitter_openapi_python_generated/models/tweet.py +7 -1
- twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +6 -2
- twitter_openapi_python_generated/models/tweet_legacy.py +6 -2
- twitter_openapi_python_generated/models/tweet_with_visibility_results.py +6 -2
- twitter_openapi_python_generated/models/twitter_list.py +17 -3
- twitter_openapi_python_generated/models/type_name.py +3 -0
- twitter_openapi_python_generated/models/user.py +6 -2
- twitter_openapi_python_generated/models/user_label.py +128 -0
- twitter_openapi_python_generated/models/user_label_badge.py +89 -0
- twitter_openapi_python_generated/models/user_label_mention_results.py +93 -0
- twitter_openapi_python_generated/models/user_label_mention_user.py +106 -0
- twitter_openapi_python_generated/models/user_label_mention_user_core.py +89 -0
- twitter_openapi_python_generated/models/user_label_text.py +98 -0
- twitter_openapi_python_generated/models/user_label_text_entity.py +97 -0
- twitter_openapi_python_generated/models/user_label_text_entity_ref.py +104 -0
- twitter_openapi_python_generated/models/user_label_url.py +98 -0
- twitter_openapi_python_generated/models/user_legacy.py +6 -2
- twitter_openapi_python_generated/models/user_mention.py +115 -0
- twitter_openapi_python_generated/models/user_professional.py +7 -2
- {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/METADATA +72 -9
- {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/RECORD +111 -48
- {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/WHEEL +0 -0
- {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/licenses/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/licenses/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.feedback_action_entry import FeedbackActionEntry
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class TimelineResponseObjects(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
TimelineResponseObjects
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
feedback_actions: Optional[List[FeedbackActionEntry]] = Field(default=None, alias="feedbackActions")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["feedbackActions"]
|
|
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 TimelineResponseObjects 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 feedback_actions (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.feedback_actions:
|
|
77
|
+
for _item_feedback_actions in self.feedback_actions:
|
|
78
|
+
_items.append(_item_feedback_actions.to_dict() if _item_feedback_actions is not None else None)
|
|
79
|
+
_dict['feedbackActions'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of TimelineResponseObjects 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
|
+
"feedbackActions": [FeedbackActionEntry.from_dict(_item) for _item in obj["feedbackActions"]] if obj.get("feedbackActions") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -22,6 +22,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_v
|
|
|
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
|
|
25
|
+
from twitter_openapi_python_generated.models.timeline_show_alert_color_config import TimelineShowAlertColorConfig
|
|
26
|
+
from twitter_openapi_python_generated.models.timeline_show_alert_icon_display_info import TimelineShowAlertIconDisplayInfo
|
|
25
27
|
from twitter_openapi_python_generated.models.timeline_show_alert_rich_text import TimelineShowAlertRichText
|
|
26
28
|
from twitter_openapi_python_generated.models.user_results import UserResults
|
|
27
29
|
from typing import Optional, Set
|
|
@@ -32,24 +34,21 @@ class TimelineShowAlert(BaseModel):
|
|
|
32
34
|
"""
|
|
33
35
|
TimelineShowAlert
|
|
34
36
|
""" # noqa: E501
|
|
35
|
-
alert_type:
|
|
36
|
-
client_event_info:
|
|
37
|
-
color_config:
|
|
38
|
-
display_duration_ms:
|
|
39
|
-
display_location:
|
|
40
|
-
icon_display_info:
|
|
37
|
+
alert_type: StrictStr = Field(alias="alertType")
|
|
38
|
+
client_event_info: ClientEventInfo = Field(alias="clientEventInfo")
|
|
39
|
+
color_config: TimelineShowAlertColorConfig = Field(alias="colorConfig")
|
|
40
|
+
display_duration_ms: StrictInt = Field(alias="displayDurationMs")
|
|
41
|
+
display_location: StrictStr = Field(alias="displayLocation")
|
|
42
|
+
icon_display_info: TimelineShowAlertIconDisplayInfo = Field(alias="iconDisplayInfo")
|
|
41
43
|
rich_text: TimelineShowAlertRichText = Field(alias="richText")
|
|
42
|
-
trigger_delay_ms:
|
|
44
|
+
trigger_delay_ms: StrictInt = Field(alias="triggerDelayMs")
|
|
43
45
|
type: InstructionType
|
|
44
|
-
users_results: Optional[List[UserResults]] = Field(alias="usersResults")
|
|
46
|
+
users_results: Optional[List[UserResults]] = Field(default=None, alias="usersResults")
|
|
45
47
|
__properties: ClassVar[List[str]] = ["alertType", "clientEventInfo", "colorConfig", "displayDurationMs", "displayLocation", "iconDisplayInfo", "richText", "triggerDelayMs", "type", "usersResults"]
|
|
46
48
|
|
|
47
49
|
@field_validator('alert_type')
|
|
48
50
|
def alert_type_validate_enum(cls, value):
|
|
49
51
|
"""Validates the enum"""
|
|
50
|
-
if value is None:
|
|
51
|
-
return value
|
|
52
|
-
|
|
53
52
|
if value not in set(['NewTweets']):
|
|
54
53
|
raise ValueError("must be one of enum values ('NewTweets')")
|
|
55
54
|
return value
|
|
@@ -57,9 +56,6 @@ class TimelineShowAlert(BaseModel):
|
|
|
57
56
|
@field_validator('display_location')
|
|
58
57
|
def display_location_validate_enum(cls, value):
|
|
59
58
|
"""Validates the enum"""
|
|
60
|
-
if value is None:
|
|
61
|
-
return value
|
|
62
|
-
|
|
63
59
|
if value not in set(['Top']):
|
|
64
60
|
raise ValueError("must be one of enum values ('Top')")
|
|
65
61
|
return value
|
|
@@ -106,6 +102,12 @@ class TimelineShowAlert(BaseModel):
|
|
|
106
102
|
# override the default output from pydantic by calling `to_dict()` of client_event_info
|
|
107
103
|
if self.client_event_info:
|
|
108
104
|
_dict['clientEventInfo'] = self.client_event_info.to_dict()
|
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of color_config
|
|
106
|
+
if self.color_config:
|
|
107
|
+
_dict['colorConfig'] = self.color_config.to_dict()
|
|
108
|
+
# override the default output from pydantic by calling `to_dict()` of icon_display_info
|
|
109
|
+
if self.icon_display_info:
|
|
110
|
+
_dict['iconDisplayInfo'] = self.icon_display_info.to_dict()
|
|
109
111
|
# override the default output from pydantic by calling `to_dict()` of rich_text
|
|
110
112
|
if self.rich_text:
|
|
111
113
|
_dict['richText'] = self.rich_text.to_dict()
|
|
@@ -115,11 +117,6 @@ class TimelineShowAlert(BaseModel):
|
|
|
115
117
|
for _item_users_results in self.users_results:
|
|
116
118
|
_items.append(_item_users_results.to_dict() if _item_users_results is not None else None)
|
|
117
119
|
_dict['usersResults'] = _items
|
|
118
|
-
# set to None if users_results (nullable) is None
|
|
119
|
-
# and model_fields_set contains the field
|
|
120
|
-
if self.users_results is None and "users_results" in self.model_fields_set:
|
|
121
|
-
_dict['usersResults'] = None
|
|
122
|
-
|
|
123
120
|
return _dict
|
|
124
121
|
|
|
125
122
|
@classmethod
|
|
@@ -134,10 +131,10 @@ class TimelineShowAlert(BaseModel):
|
|
|
134
131
|
_obj = cls.model_validate({
|
|
135
132
|
"alertType": obj.get("alertType"),
|
|
136
133
|
"clientEventInfo": ClientEventInfo.from_dict(obj["clientEventInfo"]) if obj.get("clientEventInfo") is not None else None,
|
|
137
|
-
"colorConfig": obj.get("colorConfig"),
|
|
134
|
+
"colorConfig": TimelineShowAlertColorConfig.from_dict(obj["colorConfig"]) if obj.get("colorConfig") is not None else None,
|
|
138
135
|
"displayDurationMs": obj.get("displayDurationMs"),
|
|
139
136
|
"displayLocation": obj.get("displayLocation"),
|
|
140
|
-
"iconDisplayInfo": obj.get("iconDisplayInfo"),
|
|
137
|
+
"iconDisplayInfo": TimelineShowAlertIconDisplayInfo.from_dict(obj["iconDisplayInfo"]) if obj.get("iconDisplayInfo") is not None else None,
|
|
141
138
|
"richText": TimelineShowAlertRichText.from_dict(obj["richText"]) if obj.get("richText") is not None else None,
|
|
142
139
|
"triggerDelayMs": obj.get("triggerDelayMs"),
|
|
143
140
|
"type": obj.get("type"),
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class TimelineShowAlertColorConfig(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
TimelineShowAlertColorConfig
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
background: StrictStr
|
|
32
|
+
border: StrictStr
|
|
33
|
+
text: StrictStr
|
|
34
|
+
__properties: ClassVar[List[str]] = ["background", "border", "text"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of TimelineShowAlertColorConfig from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of TimelineShowAlertColorConfig from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"background": obj.get("background"),
|
|
88
|
+
"border": obj.get("border"),
|
|
89
|
+
"text": obj.get("text")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class TimelineShowAlertIconDisplayInfo(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
TimelineShowAlertIconDisplayInfo
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
icon: StrictStr
|
|
32
|
+
tint: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["icon", "tint"]
|
|
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 TimelineShowAlertIconDisplayInfo from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
return _dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
78
|
+
"""Create an instance of TimelineShowAlertIconDisplayInfo from a dict"""
|
|
79
|
+
if obj is None:
|
|
80
|
+
return None
|
|
81
|
+
|
|
82
|
+
if not isinstance(obj, dict):
|
|
83
|
+
return cls.model_validate(obj)
|
|
84
|
+
|
|
85
|
+
_obj = cls.model_validate({
|
|
86
|
+
"icon": obj.get("icon"),
|
|
87
|
+
"tint": obj.get("tint")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
from pydantic_core import to_jsonable_python
|
|
@@ -28,8 +28,8 @@ class TimelineShowAlertRichText(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
TimelineShowAlertRichText
|
|
30
30
|
""" # noqa: E501
|
|
31
|
-
entities:
|
|
32
|
-
text:
|
|
31
|
+
entities: List[Dict[str, Any]]
|
|
32
|
+
text: StrictStr
|
|
33
33
|
__properties: ClassVar[List[str]] = ["entities", "text"]
|
|
34
34
|
|
|
35
35
|
model_config = ConfigDict(
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field
|
|
|
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.content_entry_type import ContentEntryType
|
|
25
|
+
from twitter_openapi_python_generated.models.feedback_info import FeedbackInfo
|
|
25
26
|
from twitter_openapi_python_generated.models.item_content_union import ItemContentUnion
|
|
26
27
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
27
28
|
from typing import Optional, Set
|
|
@@ -35,7 +36,7 @@ class TimelineTimelineItem(BaseModel):
|
|
|
35
36
|
typename: TypeName = Field(alias="__typename")
|
|
36
37
|
client_event_info: Optional[ClientEventInfo] = Field(default=None, alias="clientEventInfo")
|
|
37
38
|
entry_type: ContentEntryType = Field(alias="entryType")
|
|
38
|
-
feedback_info: Optional[
|
|
39
|
+
feedback_info: Optional[FeedbackInfo] = Field(default=None, alias="feedbackInfo")
|
|
39
40
|
item_content: ItemContentUnion = Field(alias="itemContent")
|
|
40
41
|
__properties: ClassVar[List[str]] = ["__typename", "clientEventInfo", "entryType", "feedbackInfo", "itemContent"]
|
|
41
42
|
|
|
@@ -81,6 +82,9 @@ class TimelineTimelineItem(BaseModel):
|
|
|
81
82
|
# override the default output from pydantic by calling `to_dict()` of client_event_info
|
|
82
83
|
if self.client_event_info:
|
|
83
84
|
_dict['clientEventInfo'] = self.client_event_info.to_dict()
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of feedback_info
|
|
86
|
+
if self.feedback_info:
|
|
87
|
+
_dict['feedbackInfo'] = self.feedback_info.to_dict()
|
|
84
88
|
# override the default output from pydantic by calling `to_dict()` of item_content
|
|
85
89
|
if self.item_content:
|
|
86
90
|
_dict['itemContent'] = self.item_content.to_dict()
|
|
@@ -99,7 +103,7 @@ class TimelineTimelineItem(BaseModel):
|
|
|
99
103
|
"__typename": obj.get("__typename"),
|
|
100
104
|
"clientEventInfo": ClientEventInfo.from_dict(obj["clientEventInfo"]) if obj.get("clientEventInfo") is not None else None,
|
|
101
105
|
"entryType": obj.get("entryType"),
|
|
102
|
-
"feedbackInfo": obj.get("feedbackInfo"),
|
|
106
|
+
"feedbackInfo": FeedbackInfo.from_dict(obj["feedbackInfo"]) if obj.get("feedbackInfo") is not None else None,
|
|
103
107
|
"itemContent": ItemContentUnion.from_dict(obj["itemContent"]) if obj.get("itemContent") is not None else None
|
|
104
108
|
})
|
|
105
109
|
return _obj
|
|
@@ -24,7 +24,10 @@ from twitter_openapi_python_generated.models.client_event_info import ClientEven
|
|
|
24
24
|
from twitter_openapi_python_generated.models.content_entry_type import ContentEntryType
|
|
25
25
|
from twitter_openapi_python_generated.models.display_type import DisplayType
|
|
26
26
|
from twitter_openapi_python_generated.models.feedback_info import FeedbackInfo
|
|
27
|
+
from twitter_openapi_python_generated.models.module_footer import ModuleFooter
|
|
28
|
+
from twitter_openapi_python_generated.models.module_header import ModuleHeader
|
|
27
29
|
from twitter_openapi_python_generated.models.module_item import ModuleItem
|
|
30
|
+
from twitter_openapi_python_generated.models.module_metadata import ModuleMetadata
|
|
28
31
|
from typing import Optional, Set
|
|
29
32
|
from typing_extensions import Self
|
|
30
33
|
from pydantic_core import to_jsonable_python
|
|
@@ -38,10 +41,10 @@ class TimelineTimelineModule(BaseModel):
|
|
|
38
41
|
display_type: DisplayType = Field(alias="displayType")
|
|
39
42
|
entry_type: ContentEntryType = Field(alias="entryType")
|
|
40
43
|
feedback_info: Optional[FeedbackInfo] = Field(default=None, alias="feedbackInfo")
|
|
41
|
-
footer: Optional[
|
|
42
|
-
header: Optional[
|
|
44
|
+
footer: Optional[ModuleFooter] = None
|
|
45
|
+
header: Optional[ModuleHeader] = None
|
|
43
46
|
items: Optional[List[ModuleItem]] = None
|
|
44
|
-
metadata: Optional[
|
|
47
|
+
metadata: Optional[ModuleMetadata] = None
|
|
45
48
|
__properties: ClassVar[List[str]] = ["__typename", "clientEventInfo", "displayType", "entryType", "feedbackInfo", "footer", "header", "items", "metadata"]
|
|
46
49
|
|
|
47
50
|
model_config = ConfigDict(
|
|
@@ -89,12 +92,21 @@ class TimelineTimelineModule(BaseModel):
|
|
|
89
92
|
# override the default output from pydantic by calling `to_dict()` of feedback_info
|
|
90
93
|
if self.feedback_info:
|
|
91
94
|
_dict['feedbackInfo'] = self.feedback_info.to_dict()
|
|
95
|
+
# override the default output from pydantic by calling `to_dict()` of footer
|
|
96
|
+
if self.footer:
|
|
97
|
+
_dict['footer'] = self.footer.to_dict()
|
|
98
|
+
# override the default output from pydantic by calling `to_dict()` of header
|
|
99
|
+
if self.header:
|
|
100
|
+
_dict['header'] = self.header.to_dict()
|
|
92
101
|
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
93
102
|
_items = []
|
|
94
103
|
if self.items:
|
|
95
104
|
for _item_items in self.items:
|
|
96
105
|
_items.append(_item_items.to_dict() if _item_items is not None else None)
|
|
97
106
|
_dict['items'] = _items
|
|
107
|
+
# override the default output from pydantic by calling `to_dict()` of metadata
|
|
108
|
+
if self.metadata:
|
|
109
|
+
_dict['metadata'] = self.metadata.to_dict()
|
|
98
110
|
return _dict
|
|
99
111
|
|
|
100
112
|
@classmethod
|
|
@@ -112,10 +124,10 @@ class TimelineTimelineModule(BaseModel):
|
|
|
112
124
|
"displayType": obj.get("displayType"),
|
|
113
125
|
"entryType": obj.get("entryType"),
|
|
114
126
|
"feedbackInfo": FeedbackInfo.from_dict(obj["feedbackInfo"]) if obj.get("feedbackInfo") is not None else None,
|
|
115
|
-
"footer": obj.get("footer"),
|
|
116
|
-
"header": obj.get("header"),
|
|
127
|
+
"footer": ModuleFooter.from_dict(obj["footer"]) if obj.get("footer") is not None else None,
|
|
128
|
+
"header": ModuleHeader.from_dict(obj["header"]) if obj.get("header") is not None else None,
|
|
117
129
|
"items": [ModuleItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
|
118
|
-
"metadata": obj.get("metadata")
|
|
130
|
+
"metadata": ModuleMetadata.from_dict(obj["metadata"]) if obj.get("metadata") is not None else None
|
|
119
131
|
})
|
|
120
132
|
return _obj
|
|
121
133
|
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
24
|
from twitter_openapi_python_generated.models.content_item_type import ContentItemType
|
|
25
|
+
from twitter_openapi_python_generated.models.grouped_trend import GroupedTrend
|
|
25
26
|
from twitter_openapi_python_generated.models.social_context_landing_url import SocialContextLandingUrl
|
|
26
27
|
from twitter_openapi_python_generated.models.social_context_union import SocialContextUnion
|
|
27
28
|
from twitter_openapi_python_generated.models.thumbnail_image import ThumbnailImage
|
|
@@ -37,6 +38,7 @@ class TimelineTrend(BaseModel):
|
|
|
37
38
|
TimelineTrend
|
|
38
39
|
""" # noqa: E501
|
|
39
40
|
typename: TypeName = Field(alias="__typename")
|
|
41
|
+
grouped_trends: Optional[List[GroupedTrend]] = None
|
|
40
42
|
images: Optional[List[TrendImage]] = None
|
|
41
43
|
is_ai_trend: Optional[StrictBool] = None
|
|
42
44
|
item_type: Optional[ContentItemType] = Field(default=None, alias="itemType")
|
|
@@ -46,7 +48,7 @@ class TimelineTrend(BaseModel):
|
|
|
46
48
|
thumbnail_image: Optional[ThumbnailImage] = None
|
|
47
49
|
trend_metadata: TrendMetadata
|
|
48
50
|
trend_url: SocialContextLandingUrl
|
|
49
|
-
__properties: ClassVar[List[str]] = ["__typename", "images", "is_ai_trend", "itemType", "name", "rank", "social_context", "thumbnail_image", "trend_metadata", "trend_url"]
|
|
51
|
+
__properties: ClassVar[List[str]] = ["__typename", "grouped_trends", "images", "is_ai_trend", "itemType", "name", "rank", "social_context", "thumbnail_image", "trend_metadata", "trend_url"]
|
|
50
52
|
|
|
51
53
|
@field_validator('rank', mode="before")
|
|
52
54
|
def rank_validate_regular_expression(cls, value):
|
|
@@ -97,6 +99,12 @@ class TimelineTrend(BaseModel):
|
|
|
97
99
|
exclude=excluded_fields,
|
|
98
100
|
exclude_none=True,
|
|
99
101
|
)
|
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of each item in grouped_trends (list)
|
|
103
|
+
_items = []
|
|
104
|
+
if self.grouped_trends:
|
|
105
|
+
for _item_grouped_trends in self.grouped_trends:
|
|
106
|
+
_items.append(_item_grouped_trends.to_dict() if _item_grouped_trends is not None else None)
|
|
107
|
+
_dict['grouped_trends'] = _items
|
|
100
108
|
# override the default output from pydantic by calling `to_dict()` of each item in images (list)
|
|
101
109
|
_items = []
|
|
102
110
|
if self.images:
|
|
@@ -128,6 +136,7 @@ class TimelineTrend(BaseModel):
|
|
|
128
136
|
|
|
129
137
|
_obj = cls.model_validate({
|
|
130
138
|
"__typename": obj.get("__typename"),
|
|
139
|
+
"grouped_trends": [GroupedTrend.from_dict(_item) for _item in obj["grouped_trends"]] if obj.get("grouped_trends") is not None else None,
|
|
131
140
|
"images": [TrendImage.from_dict(_item) for _item in obj["images"]] if obj.get("images") is not None else None,
|
|
132
141
|
"is_ai_trend": obj.get("is_ai_trend"),
|
|
133
142
|
"itemType": obj.get("itemType"),
|
|
@@ -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.promoted_metadata import PromotedMetadata
|
|
26
27
|
from twitter_openapi_python_generated.models.social_context_union import SocialContextUnion
|
|
27
28
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
28
29
|
from typing import Optional, Set
|
|
@@ -37,7 +38,7 @@ class TimelineTweet(BaseModel):
|
|
|
37
38
|
has_moderated_replies: Optional[StrictBool] = Field(default=None, alias="hasModeratedReplies")
|
|
38
39
|
highlights: Optional[Highlight] = None
|
|
39
40
|
item_type: ContentItemType = Field(alias="itemType")
|
|
40
|
-
promoted_metadata: Optional[
|
|
41
|
+
promoted_metadata: Optional[PromotedMetadata] = Field(default=None, alias="promotedMetadata")
|
|
41
42
|
social_context: Optional[SocialContextUnion] = Field(default=None, alias="socialContext")
|
|
42
43
|
tweet_display_type: StrictStr = Field(alias="tweetDisplayType")
|
|
43
44
|
tweet_results: ItemResult
|
|
@@ -92,6 +93,9 @@ class TimelineTweet(BaseModel):
|
|
|
92
93
|
# override the default output from pydantic by calling `to_dict()` of highlights
|
|
93
94
|
if self.highlights:
|
|
94
95
|
_dict['highlights'] = self.highlights.to_dict()
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of promoted_metadata
|
|
97
|
+
if self.promoted_metadata:
|
|
98
|
+
_dict['promotedMetadata'] = self.promoted_metadata.to_dict()
|
|
95
99
|
# override the default output from pydantic by calling `to_dict()` of social_context
|
|
96
100
|
if self.social_context:
|
|
97
101
|
_dict['socialContext'] = self.social_context.to_dict()
|
|
@@ -114,7 +118,7 @@ class TimelineTweet(BaseModel):
|
|
|
114
118
|
"hasModeratedReplies": obj.get("hasModeratedReplies"),
|
|
115
119
|
"highlights": Highlight.from_dict(obj["highlights"]) if obj.get("highlights") is not None else None,
|
|
116
120
|
"itemType": obj.get("itemType"),
|
|
117
|
-
"promotedMetadata": obj.get("promotedMetadata"),
|
|
121
|
+
"promotedMetadata": PromotedMetadata.from_dict(obj["promotedMetadata"]) if obj.get("promotedMetadata") is not None else None,
|
|
118
122
|
"socialContext": SocialContextUnion.from_dict(obj["socialContext"]) if obj.get("socialContext") is not None else None,
|
|
119
123
|
"tweetDisplayType": obj.get("tweetDisplayType"),
|
|
120
124
|
"tweet_results": ItemResult.from_dict(obj["tweet_results"]) if obj.get("tweet_results") is not None else None
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class TimelinesDetails(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
TimelinesDetails
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
controller_data: Optional[StrictStr] = Field(default=None, alias="controllerData")
|
|
32
|
+
injection_type: Optional[StrictStr] = Field(default=None, alias="injectionType")
|
|
33
|
+
source_data: Optional[StrictStr] = Field(default=None, alias="sourceData")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["controllerData", "injectionType", "sourceData"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of TimelinesDetails from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of TimelinesDetails from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"controllerData": obj.get("controllerData"),
|
|
88
|
+
"injectionType": obj.get("injectionType"),
|
|
89
|
+
"sourceData": obj.get("sourceData")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|