twitter-openapi-python-generated 0.0.35__py3-none-any.whl → 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. twitter_openapi_python_generated/__init__.py +117 -9
  2. twitter_openapi_python_generated/api_client.py +1 -1
  3. twitter_openapi_python_generated/configuration.py +1 -1
  4. twitter_openapi_python_generated/models/__init__.py +58 -4
  5. twitter_openapi_python_generated/models/ad_metadata_container.py +104 -0
  6. twitter_openapi_python_generated/models/affiliates_highlighted_label.py +93 -0
  7. twitter_openapi_python_generated/models/api_image.py +108 -0
  8. twitter_openapi_python_generated/models/api_media.py +110 -0
  9. twitter_openapi_python_generated/models/article_cover_media_info.py +3 -3
  10. twitter_openapi_python_generated/models/birdwatch_pivot.py +2 -2
  11. twitter_openapi_python_generated/models/cashtag_info.py +93 -0
  12. twitter_openapi_python_generated/models/click_tracking_info.py +96 -0
  13. twitter_openapi_python_generated/models/client_event_info.py +6 -2
  14. twitter_openapi_python_generated/models/client_event_info_details.py +99 -0
  15. twitter_openapi_python_generated/models/community.py +17 -6
  16. twitter_openapi_python_generated/models/community_banner_media.py +95 -0
  17. twitter_openapi_python_generated/models/community_banner_media_info.py +108 -0
  18. twitter_openapi_python_generated/models/community_moderation_state.py +90 -0
  19. twitter_openapi_python_generated/models/community_relationship.py +6 -2
  20. twitter_openapi_python_generated/models/community_viewer_relationship.py +95 -0
  21. twitter_openapi_python_generated/models/conversation_control.py +10 -11
  22. twitter_openapi_python_generated/models/conversation_details.py +96 -0
  23. twitter_openapi_python_generated/models/conversation_metadata.py +92 -0
  24. twitter_openapi_python_generated/models/conversation_owner.py +96 -0
  25. twitter_openapi_python_generated/models/conversation_owner_core.py +89 -0
  26. twitter_openapi_python_generated/models/conversation_owner_results.py +93 -0
  27. twitter_openapi_python_generated/models/cta_limited_action_prompt.py +110 -0
  28. twitter_openapi_python_generated/models/cta_limited_action_prompt_text.py +91 -0
  29. twitter_openapi_python_generated/models/deepsearch_header.py +96 -0
  30. twitter_openapi_python_generated/models/deepsearch_step.py +99 -0
  31. twitter_openapi_python_generated/models/deepsearch_web_result.py +89 -0
  32. twitter_openapi_python_generated/models/entities.py +27 -6
  33. twitter_openapi_python_generated/models/feedback_action.py +136 -0
  34. twitter_openapi_python_generated/models/feedback_action_entry.py +95 -0
  35. twitter_openapi_python_generated/models/feedback_client_event_info.py +93 -0
  36. twitter_openapi_python_generated/models/feedback_info.py +8 -6
  37. twitter_openapi_python_generated/models/grok_share_attachment_item.py +9 -2
  38. twitter_openapi_python_generated/models/hashtag.py +91 -0
  39. twitter_openapi_python_generated/models/jetfuel_attachment.py +91 -0
  40. twitter_openapi_python_generated/models/key_value.py +91 -0
  41. twitter_openapi_python_generated/models/landing_url.py +98 -0
  42. twitter_openapi_python_generated/models/limited_action.py +95 -0
  43. twitter_openapi_python_generated/models/limited_action_results.py +96 -0
  44. twitter_openapi_python_generated/models/limited_action_results_data.py +1 -8
  45. twitter_openapi_python_generated/models/list_banner_media_info.py +3 -3
  46. twitter_openapi_python_generated/models/list_banner_media_results.py +93 -0
  47. twitter_openapi_python_generated/models/{article_cover_media_color_info.py → media_color_info.py} +7 -7
  48. twitter_openapi_python_generated/models/{article_cover_media_color_info_palette.py → media_color_info_palette.py} +7 -7
  49. twitter_openapi_python_generated/models/{article_cover_media_color_info_palette_rgb.py → media_color_info_palette_rgb.py} +4 -4
  50. twitter_openapi_python_generated/models/{list_banner_media_salient_rect.py → media_salient_rect.py} +4 -4
  51. twitter_openapi_python_generated/models/module_footer.py +104 -0
  52. twitter_openapi_python_generated/models/module_header.py +100 -0
  53. twitter_openapi_python_generated/models/module_metadata.py +93 -0
  54. twitter_openapi_python_generated/models/promoted_metadata.py +109 -0
  55. twitter_openapi_python_generated/models/reader_mode_config.py +89 -0
  56. twitter_openapi_python_generated/models/scribe_config.py +89 -0
  57. twitter_openapi_python_generated/models/smarttag_tag.py +6 -2
  58. twitter_openapi_python_generated/models/smarttag_tag_info.py +93 -0
  59. twitter_openapi_python_generated/models/symbol.py +97 -0
  60. twitter_openapi_python_generated/models/timeline.py +12 -4
  61. twitter_openapi_python_generated/models/timeline_metadata.py +99 -0
  62. twitter_openapi_python_generated/models/timeline_response_objects.py +96 -0
  63. twitter_openapi_python_generated/models/timeline_show_alert.py +18 -21
  64. twitter_openapi_python_generated/models/timeline_show_alert_color_config.py +93 -0
  65. twitter_openapi_python_generated/models/timeline_show_alert_icon_display_info.py +91 -0
  66. twitter_openapi_python_generated/models/timeline_show_alert_rich_text.py +3 -3
  67. twitter_openapi_python_generated/models/timeline_timeline_item.py +6 -2
  68. twitter_openapi_python_generated/models/timeline_timeline_module.py +18 -6
  69. twitter_openapi_python_generated/models/timeline_tweet.py +6 -2
  70. twitter_openapi_python_generated/models/timelines_details.py +93 -0
  71. twitter_openapi_python_generated/models/tweet.py +7 -1
  72. twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +6 -2
  73. twitter_openapi_python_generated/models/tweet_legacy.py +6 -2
  74. twitter_openapi_python_generated/models/tweet_with_visibility_results.py +6 -2
  75. twitter_openapi_python_generated/models/twitter_list.py +17 -3
  76. twitter_openapi_python_generated/models/type_name.py +3 -0
  77. twitter_openapi_python_generated/models/user.py +6 -2
  78. twitter_openapi_python_generated/models/user_label.py +128 -0
  79. twitter_openapi_python_generated/models/user_label_badge.py +89 -0
  80. twitter_openapi_python_generated/models/user_label_mention_results.py +93 -0
  81. twitter_openapi_python_generated/models/user_label_mention_user.py +106 -0
  82. twitter_openapi_python_generated/models/user_label_mention_user_core.py +89 -0
  83. twitter_openapi_python_generated/models/user_label_text.py +98 -0
  84. twitter_openapi_python_generated/models/user_label_text_entity.py +97 -0
  85. twitter_openapi_python_generated/models/user_label_text_entity_ref.py +104 -0
  86. twitter_openapi_python_generated/models/user_label_url.py +98 -0
  87. twitter_openapi_python_generated/models/user_legacy.py +6 -2
  88. twitter_openapi_python_generated/models/user_mention.py +115 -0
  89. twitter_openapi_python_generated/models/user_professional.py +7 -2
  90. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/METADATA +63 -9
  91. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/RECORD +95 -41
  92. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/WHEEL +0 -0
  93. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/licenses/LICENSE +0 -0
  94. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/licenses/LICENSE.AGPL +0 -0
  95. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,91 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, 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, Optional
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: Optional[List[Dict[str, Any]]] = None
32
- text: Optional[StrictStr] = None
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[Dict[str, Any]] = Field(default=None, alias="feedbackInfo")
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[Dict[str, Any]] = None
42
- header: Optional[Dict[str, Any]] = None
44
+ footer: Optional[ModuleFooter] = None
45
+ header: Optional[ModuleHeader] = None
43
46
  items: Optional[List[ModuleItem]] = None
44
- metadata: Optional[Dict[str, Any]] = None
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
 
@@ -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[Dict[str, Any]] = Field(default=None, alias="promotedMetadata")
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
+
@@ -30,6 +30,7 @@ from twitter_openapi_python_generated.models.community_result import CommunityRe
30
30
  from twitter_openapi_python_generated.models.content_disclosure import ContentDisclosure
31
31
  from twitter_openapi_python_generated.models.grok_annotation import GrokAnnotation
32
32
  from twitter_openapi_python_generated.models.grok_translated_post_with_availability import GrokTranslatedPostWithAvailability
33
+ from twitter_openapi_python_generated.models.jetfuel_attachment import JetfuelAttachment
33
34
  from twitter_openapi_python_generated.models.note_tweet import NoteTweet
34
35
  from twitter_openapi_python_generated.models.super_follows_reply_user_result import SuperFollowsReplyUserResult
35
36
  from twitter_openapi_python_generated.models.trend_results import TrendResults
@@ -69,6 +70,7 @@ class Tweet(BaseModel):
69
70
  grok_translated_post_with_availability: Optional[GrokTranslatedPostWithAvailability] = None
70
71
  has_birdwatch_notes: Optional[StrictBool] = None
71
72
  is_translatable: Optional[StrictBool] = None
73
+ jetfuel_attachment: Optional[JetfuelAttachment] = None
72
74
  legacy: Optional[TweetLegacy] = None
73
75
  nested_quoted_tweet_results: Optional[ItemResult] = None
74
76
  note_tweet: Optional[NoteTweet] = None
@@ -86,7 +88,7 @@ class Tweet(BaseModel):
86
88
  unified_card: Optional[UnifiedCard] = None
87
89
  unmention_data: Optional[Dict[str, Any]] = None
88
90
  views: Optional[TweetView] = None
89
- __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", "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", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views"]
91
+ __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", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views"]
90
92
 
91
93
  @field_validator('rest_id', mode="before")
92
94
  def rest_id_validate_regular_expression(cls, value):
@@ -179,6 +181,9 @@ class Tweet(BaseModel):
179
181
  # override the default output from pydantic by calling `to_dict()` of grok_translated_post_with_availability
180
182
  if self.grok_translated_post_with_availability:
181
183
  _dict['grok_translated_post_with_availability'] = self.grok_translated_post_with_availability.to_dict()
184
+ # override the default output from pydantic by calling `to_dict()` of jetfuel_attachment
185
+ if self.jetfuel_attachment:
186
+ _dict['jetfuel_attachment'] = self.jetfuel_attachment.to_dict()
182
187
  # override the default output from pydantic by calling `to_dict()` of legacy
183
188
  if self.legacy:
184
189
  _dict['legacy'] = self.legacy.to_dict()
@@ -243,6 +248,7 @@ class Tweet(BaseModel):
243
248
  "grok_translated_post_with_availability": GrokTranslatedPostWithAvailability.from_dict(obj["grok_translated_post_with_availability"]) if obj.get("grok_translated_post_with_availability") is not None else None,
244
249
  "has_birdwatch_notes": obj.get("has_birdwatch_notes"),
245
250
  "is_translatable": obj.get("is_translatable"),
251
+ "jetfuel_attachment": JetfuelAttachment.from_dict(obj["jetfuel_attachment"]) if obj.get("jetfuel_attachment") is not None else None,
246
252
  "legacy": TweetLegacy.from_dict(obj["legacy"]) if obj.get("legacy") is not None else None,
247
253
  "nested_quoted_tweet_results": ItemResult.from_dict(obj["nested_quoted_tweet_results"]) if obj.get("nested_quoted_tweet_results") is not None else None,
248
254
  "note_tweet": NoteTweet.from_dict(obj["note_tweet"]) if obj.get("note_tweet") is not None else None,
@@ -20,6 +20,7 @@ import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from twitter_openapi_python_generated.models.media_color_info import MediaColorInfo
23
24
  from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value_data_image import TweetCardLegacyBindingValueDataImage
24
25
  from twitter_openapi_python_generated.models.user_value import UserValue
25
26
  from typing import Optional, Set
@@ -31,7 +32,7 @@ class TweetCardLegacyBindingValueData(BaseModel):
31
32
  TweetCardLegacyBindingValueData
32
33
  """ # noqa: E501
33
34
  boolean_value: Optional[StrictBool] = None
34
- image_color_value: Optional[Dict[str, Any]] = None
35
+ image_color_value: Optional[MediaColorInfo] = None
35
36
  image_value: Optional[TweetCardLegacyBindingValueDataImage] = None
36
37
  scribe_key: Optional[StrictStr] = None
37
38
  string_value: Optional[StrictStr] = None
@@ -78,6 +79,9 @@ class TweetCardLegacyBindingValueData(BaseModel):
78
79
  exclude=excluded_fields,
79
80
  exclude_none=True,
80
81
  )
82
+ # override the default output from pydantic by calling `to_dict()` of image_color_value
83
+ if self.image_color_value:
84
+ _dict['image_color_value'] = self.image_color_value.to_dict()
81
85
  # override the default output from pydantic by calling `to_dict()` of image_value
82
86
  if self.image_value:
83
87
  _dict['image_value'] = self.image_value.to_dict()
@@ -97,7 +101,7 @@ class TweetCardLegacyBindingValueData(BaseModel):
97
101
 
98
102
  _obj = cls.model_validate({
99
103
  "boolean_value": obj.get("boolean_value"),
100
- "image_color_value": obj.get("image_color_value"),
104
+ "image_color_value": MediaColorInfo.from_dict(obj["image_color_value"]) if obj.get("image_color_value") is not None else None,
101
105
  "image_value": TweetCardLegacyBindingValueDataImage.from_dict(obj["image_value"]) if obj.get("image_value") is not None else None,
102
106
  "scribe_key": obj.get("scribe_key"),
103
107
  "string_value": obj.get("string_value"),
@@ -21,6 +21,7 @@ import json
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
+ from twitter_openapi_python_generated.models.conversation_control import ConversationControl
24
25
  from twitter_openapi_python_generated.models.entities import Entities
25
26
  from twitter_openapi_python_generated.models.extended_entities import ExtendedEntities
26
27
  from twitter_openapi_python_generated.models.quoted_status_permalink import QuotedStatusPermalink
@@ -36,7 +37,7 @@ class TweetLegacy(BaseModel):
36
37
  """ # noqa: E501
37
38
  bookmark_count: StrictInt
38
39
  bookmarked: StrictBool
39
- conversation_control: Optional[Dict[str, Any]] = None
40
+ conversation_control: Optional[ConversationControl] = None
40
41
  conversation_id_str: Annotated[str, Field(strict=True)]
41
42
  created_at: Annotated[str, Field(strict=True)] = Field(json_schema_extra={"examples": ["Sat Dec 31 23:59:59 +0000 2023"]})
42
43
  display_text_range: List[StrictInt]
@@ -174,6 +175,9 @@ class TweetLegacy(BaseModel):
174
175
  exclude=excluded_fields,
175
176
  exclude_none=True,
176
177
  )
178
+ # override the default output from pydantic by calling `to_dict()` of conversation_control
179
+ if self.conversation_control:
180
+ _dict['conversation_control'] = self.conversation_control.to_dict()
177
181
  # override the default output from pydantic by calling `to_dict()` of entities
178
182
  if self.entities:
179
183
  _dict['entities'] = self.entities.to_dict()
@@ -206,7 +210,7 @@ class TweetLegacy(BaseModel):
206
210
  _obj = cls.model_validate({
207
211
  "bookmark_count": obj.get("bookmark_count"),
208
212
  "bookmarked": obj.get("bookmarked"),
209
- "conversation_control": obj.get("conversation_control"),
213
+ "conversation_control": ConversationControl.from_dict(obj["conversation_control"]) if obj.get("conversation_control") is not None else None,
210
214
  "conversation_id_str": obj.get("conversation_id_str"),
211
215
  "created_at": obj.get("created_at"),
212
216
  "display_text_range": obj.get("display_text_range"),
@@ -20,6 +20,7 @@ import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from twitter_openapi_python_generated.models.limited_action_results import LimitedActionResults
23
24
  from twitter_openapi_python_generated.models.media_visibility_results import MediaVisibilityResults
24
25
  from twitter_openapi_python_generated.models.tweet_interstitial import TweetInterstitial
25
26
  from twitter_openapi_python_generated.models.type_name import TypeName
@@ -32,7 +33,7 @@ class TweetWithVisibilityResults(BaseModel):
32
33
  TweetWithVisibilityResults
33
34
  """ # noqa: E501
34
35
  typename: TypeName = Field(alias="__typename")
35
- limited_action_results: Optional[Dict[str, Any]] = Field(default=None, alias="limitedActionResults")
36
+ limited_action_results: Optional[LimitedActionResults] = Field(default=None, alias="limitedActionResults")
36
37
  media_visibility_results: Optional[MediaVisibilityResults] = Field(default=None, alias="mediaVisibilityResults")
37
38
  tweet: Tweet
38
39
  tweet_interstitial: Optional[TweetInterstitial] = Field(default=None, alias="tweetInterstitial")
@@ -77,6 +78,9 @@ class TweetWithVisibilityResults(BaseModel):
77
78
  exclude=excluded_fields,
78
79
  exclude_none=True,
79
80
  )
81
+ # override the default output from pydantic by calling `to_dict()` of limited_action_results
82
+ if self.limited_action_results:
83
+ _dict['limitedActionResults'] = self.limited_action_results.to_dict()
80
84
  # override the default output from pydantic by calling `to_dict()` of media_visibility_results
81
85
  if self.media_visibility_results:
82
86
  _dict['mediaVisibilityResults'] = self.media_visibility_results.to_dict()
@@ -99,7 +103,7 @@ class TweetWithVisibilityResults(BaseModel):
99
103
 
100
104
  _obj = cls.model_validate({
101
105
  "__typename": obj.get("__typename"),
102
- "limitedActionResults": obj.get("limitedActionResults"),
106
+ "limitedActionResults": LimitedActionResults.from_dict(obj["limitedActionResults"]) if obj.get("limitedActionResults") is not None else None,
103
107
  "mediaVisibilityResults": MediaVisibilityResults.from_dict(obj["mediaVisibilityResults"]) if obj.get("mediaVisibilityResults") is not None else None,
104
108
  "tweet": Tweet.from_dict(obj["tweet"]) if obj.get("tweet") is not None else None,
105
109
  "tweetInterstitial": TweetInterstitial.from_dict(obj["tweetInterstitial"]) if obj.get("tweetInterstitial") is not None else None
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, Strict
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.list_banner_media import ListBannerMedia
25
+ from twitter_openapi_python_generated.models.list_banner_media_results import ListBannerMediaResults
25
26
  from twitter_openapi_python_generated.models.user_results import UserResults
26
27
  from typing import Optional, Set
27
28
  from typing_extensions import Self
@@ -32,8 +33,10 @@ class TwitterList(BaseModel):
32
33
  TwitterList
33
34
  """ # noqa: E501
34
35
  created_at: StrictInt
36
+ custom_banner_media: Optional[ListBannerMedia] = None
37
+ custom_banner_media_results: Optional[ListBannerMediaResults] = None
35
38
  default_banner_media: ListBannerMedia
36
- default_banner_media_results: Dict[str, Any]
39
+ default_banner_media_results: ListBannerMediaResults
37
40
  description: StrictStr
38
41
  facepile_urls: List[StrictStr]
39
42
  followers_context: Optional[StrictStr] = None
@@ -49,7 +52,7 @@ class TwitterList(BaseModel):
49
52
  pinning: StrictBool
50
53
  subscriber_count: StrictInt
51
54
  user_results: UserResults
52
- __properties: ClassVar[List[str]] = ["created_at", "default_banner_media", "default_banner_media_results", "description", "facepile_urls", "followers_context", "following", "id", "id_str", "is_member", "member_count", "members_context", "mode", "muting", "name", "pinning", "subscriber_count", "user_results"]
55
+ __properties: ClassVar[List[str]] = ["created_at", "custom_banner_media", "custom_banner_media_results", "default_banner_media", "default_banner_media_results", "description", "facepile_urls", "followers_context", "following", "id", "id_str", "is_member", "member_count", "members_context", "mode", "muting", "name", "pinning", "subscriber_count", "user_results"]
53
56
 
54
57
  @field_validator('id_str', mode="before")
55
58
  def id_str_validate_regular_expression(cls, value):
@@ -104,9 +107,18 @@ class TwitterList(BaseModel):
104
107
  exclude=excluded_fields,
105
108
  exclude_none=True,
106
109
  )
110
+ # override the default output from pydantic by calling `to_dict()` of custom_banner_media
111
+ if self.custom_banner_media:
112
+ _dict['custom_banner_media'] = self.custom_banner_media.to_dict()
113
+ # override the default output from pydantic by calling `to_dict()` of custom_banner_media_results
114
+ if self.custom_banner_media_results:
115
+ _dict['custom_banner_media_results'] = self.custom_banner_media_results.to_dict()
107
116
  # override the default output from pydantic by calling `to_dict()` of default_banner_media
108
117
  if self.default_banner_media:
109
118
  _dict['default_banner_media'] = self.default_banner_media.to_dict()
119
+ # override the default output from pydantic by calling `to_dict()` of default_banner_media_results
120
+ if self.default_banner_media_results:
121
+ _dict['default_banner_media_results'] = self.default_banner_media_results.to_dict()
110
122
  # override the default output from pydantic by calling `to_dict()` of user_results
111
123
  if self.user_results:
112
124
  _dict['user_results'] = self.user_results.to_dict()
@@ -123,8 +135,10 @@ class TwitterList(BaseModel):
123
135
 
124
136
  _obj = cls.model_validate({
125
137
  "created_at": obj.get("created_at"),
138
+ "custom_banner_media": ListBannerMedia.from_dict(obj["custom_banner_media"]) if obj.get("custom_banner_media") is not None else None,
139
+ "custom_banner_media_results": ListBannerMediaResults.from_dict(obj["custom_banner_media_results"]) if obj.get("custom_banner_media_results") is not None else None,
126
140
  "default_banner_media": ListBannerMedia.from_dict(obj["default_banner_media"]) if obj.get("default_banner_media") is not None else None,
127
- "default_banner_media_results": obj.get("default_banner_media_results"),
141
+ "default_banner_media_results": ListBannerMediaResults.from_dict(obj["default_banner_media_results"]) if obj.get("default_banner_media_results") is not None else None,
128
142
  "description": obj.get("description"),
129
143
  "facepile_urls": obj.get("facepile_urls"),
130
144
  "followers_context": obj.get("followers_context"),
@@ -62,6 +62,9 @@ class TypeName(str, Enum):
62
62
  COMMUNITYJOINREQUESTSUNAVAILABLE = 'CommunityJoinRequestsUnavailable'
63
63
  COMMUNITYUNAVAILABLE = 'CommunityUnavailable'
64
64
  APIIMAGE = 'ApiImage'
65
+ APIMEDIA = 'ApiMedia'
66
+ COMMUNITYUSERDEFAULTMODERATIONSTATE = 'CommunityUserDefaultModerationState'
67
+ CTALIMITEDACTIONPROMPT = 'CtaLimitedActionPrompt'
65
68
  TIMELINERICHTEXTUSER = 'TimelineRichTextUser'
66
69
 
67
70
  @classmethod
@@ -21,6 +21,7 @@ import json
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
+ from twitter_openapi_python_generated.models.affiliates_highlighted_label import AffiliatesHighlightedLabel
24
25
  from twitter_openapi_python_generated.models.profile_bio import ProfileBio
25
26
  from twitter_openapi_python_generated.models.type_name import TypeName
26
27
  from twitter_openapi_python_generated.models.user_action_counts import UserActionCounts
@@ -57,7 +58,7 @@ class User(BaseModel):
57
58
  """ # noqa: E501
58
59
  typename: TypeName = Field(alias="__typename")
59
60
  action_counts: Optional[UserActionCounts] = None
60
- affiliates_highlighted_label: Optional[Dict[str, Any]] = None
61
+ affiliates_highlighted_label: Optional[AffiliatesHighlightedLabel] = None
61
62
  avatar: Optional[UserAvatar] = None
62
63
  banner: Optional[UserBanner] = None
63
64
  business_account: Optional[Dict[str, Any]] = None
@@ -181,6 +182,9 @@ class User(BaseModel):
181
182
  # override the default output from pydantic by calling `to_dict()` of action_counts
182
183
  if self.action_counts:
183
184
  _dict['action_counts'] = self.action_counts.to_dict()
185
+ # override the default output from pydantic by calling `to_dict()` of affiliates_highlighted_label
186
+ if self.affiliates_highlighted_label:
187
+ _dict['affiliates_highlighted_label'] = self.affiliates_highlighted_label.to_dict()
184
188
  # override the default output from pydantic by calling `to_dict()` of avatar
185
189
  if self.avatar:
186
190
  _dict['avatar'] = self.avatar.to_dict()
@@ -273,7 +277,7 @@ class User(BaseModel):
273
277
  _obj = cls.model_validate({
274
278
  "__typename": obj.get("__typename"),
275
279
  "action_counts": UserActionCounts.from_dict(obj["action_counts"]) if obj.get("action_counts") is not None else None,
276
- "affiliates_highlighted_label": obj.get("affiliates_highlighted_label"),
280
+ "affiliates_highlighted_label": AffiliatesHighlightedLabel.from_dict(obj["affiliates_highlighted_label"]) if obj.get("affiliates_highlighted_label") is not None else None,
277
281
  "avatar": UserAvatar.from_dict(obj["avatar"]) if obj.get("avatar") is not None else None,
278
282
  "banner": UserBanner.from_dict(obj["banner"]) if obj.get("banner") is not None else None,
279
283
  "business_account": obj.get("business_account"),