twitter-openapi-python-generated 0.0.31__py3-none-any.whl → 0.0.32__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 (71) hide show
  1. twitter_openapi_python_generated/__init__.py +28 -4
  2. twitter_openapi_python_generated/api/tweet_api.py +1356 -84
  3. twitter_openapi_python_generated/api_client.py +1 -1
  4. twitter_openapi_python_generated/configuration.py +1 -1
  5. twitter_openapi_python_generated/models/__init__.py +27 -3
  6. twitter_openapi_python_generated/models/about_community_result.py +95 -0
  7. twitter_openapi_python_generated/models/{timeline_v2.py → about_community_results.py} +12 -12
  8. twitter_openapi_python_generated/models/about_community_tweet_data.py +92 -0
  9. twitter_openapi_python_generated/models/analysis_results.py +94 -0
  10. twitter_openapi_python_generated/models/birdwatch_pivot.py +3 -1
  11. twitter_openapi_python_generated/models/community_about_timeline_response.py +102 -0
  12. twitter_openapi_python_generated/models/community_media_timeline_response.py +102 -0
  13. twitter_openapi_python_generated/models/community_tweets_timeline_response.py +102 -0
  14. twitter_openapi_python_generated/models/content_item_type.py +2 -0
  15. twitter_openapi_python_generated/models/grok_image_annotation.py +90 -0
  16. twitter_openapi_python_generated/models/grok_share_attachment.py +3 -1
  17. twitter_openapi_python_generated/models/grok_share_attachment_item.py +10 -2
  18. twitter_openapi_python_generated/models/home_timeline_response_data.py +2 -2
  19. twitter_openapi_python_generated/models/instruction_type.py +2 -0
  20. twitter_openapi_python_generated/models/instruction_union.py +46 -8
  21. twitter_openapi_python_generated/models/item_content_union.py +27 -8
  22. twitter_openapi_python_generated/models/list_tweets_timeline_data.py +2 -2
  23. twitter_openapi_python_generated/models/list_tweets_timeline_list.py +3 -3
  24. twitter_openapi_python_generated/models/media_community_result.py +95 -0
  25. twitter_openapi_python_generated/models/media_community_results.py +92 -0
  26. twitter_openapi_python_generated/models/media_community_tweet_data.py +92 -0
  27. twitter_openapi_python_generated/models/media_result.py +8 -2
  28. twitter_openapi_python_generated/models/module_item.py +2 -2
  29. twitter_openapi_python_generated/models/notification_template.py +93 -0
  30. twitter_openapi_python_generated/models/notifications_result.py +105 -0
  31. twitter_openapi_python_generated/models/notifications_timeline_data.py +92 -0
  32. twitter_openapi_python_generated/models/notifications_timeline_response.py +102 -0
  33. twitter_openapi_python_generated/models/notifications_user_results.py +92 -0
  34. twitter_openapi_python_generated/models/notifications_viewer_v2.py +92 -0
  35. twitter_openapi_python_generated/models/post_create_bookmark_request.py +5 -1
  36. twitter_openapi_python_generated/models/post_create_retweet_request.py +5 -1
  37. twitter_openapi_python_generated/models/post_create_tweet_request.py +6 -2
  38. twitter_openapi_python_generated/models/post_create_tweet_request_features.py +19 -5
  39. twitter_openapi_python_generated/models/post_delete_bookmark_request.py +5 -1
  40. twitter_openapi_python_generated/models/post_delete_retweet_request.py +5 -1
  41. twitter_openapi_python_generated/models/post_delete_tweet_request.py +5 -1
  42. twitter_openapi_python_generated/models/post_favorite_tweet_request.py +5 -1
  43. twitter_openapi_python_generated/models/post_unfavorite_tweet_request.py +5 -1
  44. twitter_openapi_python_generated/models/ranked_community_result.py +95 -0
  45. twitter_openapi_python_generated/models/ranked_community_results.py +92 -0
  46. twitter_openapi_python_generated/models/ranked_community_tweet_data.py +92 -0
  47. twitter_openapi_python_generated/models/rich_message.py +90 -0
  48. twitter_openapi_python_generated/models/search_timeline_data.py +2 -2
  49. twitter_openapi_python_generated/models/timeline_add_entry.py +2 -2
  50. twitter_openapi_python_generated/models/timeline_clear_entries_unread_state.py +89 -0
  51. twitter_openapi_python_generated/models/timeline_general_context.py +5 -3
  52. twitter_openapi_python_generated/models/timeline_mark_entries_unread_greater_than_sort_index.py +102 -0
  53. twitter_openapi_python_generated/models/timeline_notification.py +116 -0
  54. twitter_openapi_python_generated/models/{list_tweets_timeline.py → timeline_result.py} +8 -6
  55. twitter_openapi_python_generated/models/timeline_timeline_module.py +1 -1
  56. twitter_openapi_python_generated/models/timeline_trend.py +3 -3
  57. twitter_openapi_python_generated/models/timeline_user.py +2 -2
  58. twitter_openapi_python_generated/models/tweet.py +1 -1
  59. twitter_openapi_python_generated/models/tweet_favoriters_response_data.py +3 -3
  60. twitter_openapi_python_generated/models/tweet_retweeters_response_data.py +3 -3
  61. twitter_openapi_python_generated/models/type_name.py +2 -0
  62. twitter_openapi_python_generated/models/user.py +2 -2
  63. twitter_openapi_python_generated/models/user_tweets_result_v1.py +95 -0
  64. twitter_openapi_python_generated/models/{user_tweets_result.py → user_tweets_result_v2.py} +7 -7
  65. twitter_openapi_python_generated/models/user_tweets_user.py +3 -3
  66. {twitter_openapi_python_generated-0.0.31.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/METADATA +12 -2
  67. {twitter_openapi_python_generated-0.0.31.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/RECORD +71 -47
  68. {twitter_openapi_python_generated-0.0.31.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/WHEEL +1 -1
  69. {twitter_openapi_python_generated-0.0.31.dist-info → twitter_openapi_python_generated-0.0.32.dist-info/licenses}/LICENSE +0 -0
  70. {twitter_openapi_python_generated-0.0.31.dist-info → twitter_openapi_python_generated-0.0.32.dist-info/licenses}/LICENSE.AGPL +0 -0
  71. {twitter_openapi_python_generated-0.0.31.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/top_level.txt +0 -0
@@ -91,7 +91,7 @@ class ApiClient:
91
91
  self.default_headers[header_name] = header_value
92
92
  self.cookie = cookie
93
93
  # Set default User-Agent.
94
- self.user_agent = 'OpenAPI-Generator/0.0.31/python'
94
+ self.user_agent = 'OpenAPI-Generator/0.0.32/python'
95
95
  self.client_side_validation = configuration.client_side_validation
96
96
 
97
97
  def __enter__(self):
@@ -750,7 +750,7 @@ conf = twitter_openapi_python_generated.Configuration(
750
750
  "OS: {env}\n"\
751
751
  "Python Version: {pyversion}\n"\
752
752
  "Version of the API: 0.0.1\n"\
753
- "SDK Package Version: 0.0.31".\
753
+ "SDK Package Version: 0.0.32".\
754
754
  format(env=sys.platform, pyversion=sys.version)
755
755
 
756
756
  def get_host_settings(self) -> List[HostSetting]:
@@ -15,10 +15,14 @@
15
15
 
16
16
 
17
17
  # import models into model package
18
+ from twitter_openapi_python_generated.models.about_community_result import AboutCommunityResult
19
+ from twitter_openapi_python_generated.models.about_community_results import AboutCommunityResults
20
+ from twitter_openapi_python_generated.models.about_community_tweet_data import AboutCommunityTweetData
18
21
  from twitter_openapi_python_generated.models.additional_media_info import AdditionalMediaInfo
19
22
  from twitter_openapi_python_generated.models.additional_media_info_call_to_actions import AdditionalMediaInfoCallToActions
20
23
  from twitter_openapi_python_generated.models.additional_media_info_call_to_actions_url import AdditionalMediaInfoCallToActionsUrl
21
24
  from twitter_openapi_python_generated.models.allow_download_status import AllowDownloadStatus
25
+ from twitter_openapi_python_generated.models.analysis_results import AnalysisResults
22
26
  from twitter_openapi_python_generated.models.article import Article
23
27
  from twitter_openapi_python_generated.models.article_cover_media import ArticleCoverMedia
24
28
  from twitter_openapi_python_generated.models.article_cover_media_color_info import ArticleCoverMediaColorInfo
@@ -44,6 +48,7 @@ from twitter_openapi_python_generated.models.callback import Callback
44
48
  from twitter_openapi_python_generated.models.client_event_info import ClientEventInfo
45
49
  from twitter_openapi_python_generated.models.communities_actions import CommunitiesActions
46
50
  from twitter_openapi_python_generated.models.community import Community
51
+ from twitter_openapi_python_generated.models.community_about_timeline_response import CommunityAboutTimelineResponse
47
52
  from twitter_openapi_python_generated.models.community_actions import CommunityActions
48
53
  from twitter_openapi_python_generated.models.community_data import CommunityData
49
54
  from twitter_openapi_python_generated.models.community_delete_action_result import CommunityDeleteActionResult
@@ -53,9 +58,11 @@ from twitter_openapi_python_generated.models.community_join_action_result_union
53
58
  from twitter_openapi_python_generated.models.community_join_action_unavailable import CommunityJoinActionUnavailable
54
59
  from twitter_openapi_python_generated.models.community_join_requests_result import CommunityJoinRequestsResult
55
60
  from twitter_openapi_python_generated.models.community_leave_action_result import CommunityLeaveActionResult
61
+ from twitter_openapi_python_generated.models.community_media_timeline_response import CommunityMediaTimelineResponse
56
62
  from twitter_openapi_python_generated.models.community_pin_action_result import CommunityPinActionResult
57
63
  from twitter_openapi_python_generated.models.community_relationship import CommunityRelationship
58
64
  from twitter_openapi_python_generated.models.community_rule import CommunityRule
65
+ from twitter_openapi_python_generated.models.community_tweets_timeline_response import CommunityTweetsTimelineResponse
59
66
  from twitter_openapi_python_generated.models.community_unpin_action_result import CommunityUnpinActionResult
60
67
  from twitter_openapi_python_generated.models.community_urls import CommunityUrls
61
68
  from twitter_openapi_python_generated.models.community_urls_permalink import CommunityUrlsPermalink
@@ -100,6 +107,7 @@ from twitter_openapi_python_generated.models.follow_response_data import FollowR
100
107
  from twitter_openapi_python_generated.models.follow_response_result import FollowResponseResult
101
108
  from twitter_openapi_python_generated.models.follow_response_user import FollowResponseUser
102
109
  from twitter_openapi_python_generated.models.follow_timeline import FollowTimeline
110
+ from twitter_openapi_python_generated.models.grok_image_annotation import GrokImageAnnotation
103
111
  from twitter_openapi_python_generated.models.grok_share_attachment import GrokShareAttachment
104
112
  from twitter_openapi_python_generated.models.grok_share_attachment_item import GrokShareAttachmentItem
105
113
  from twitter_openapi_python_generated.models.highlight import Highlight
@@ -111,11 +119,13 @@ from twitter_openapi_python_generated.models.item_content_union import ItemConte
111
119
  from twitter_openapi_python_generated.models.item_result import ItemResult
112
120
  from twitter_openapi_python_generated.models.limited_action_results_data import LimitedActionResultsData
113
121
  from twitter_openapi_python_generated.models.list_latest_tweets_timeline_response import ListLatestTweetsTimelineResponse
114
- from twitter_openapi_python_generated.models.list_tweets_timeline import ListTweetsTimeline
115
122
  from twitter_openapi_python_generated.models.list_tweets_timeline_data import ListTweetsTimelineData
116
123
  from twitter_openapi_python_generated.models.list_tweets_timeline_list import ListTweetsTimelineList
117
124
  from twitter_openapi_python_generated.models.location import Location
118
125
  from twitter_openapi_python_generated.models.media import Media
126
+ from twitter_openapi_python_generated.models.media_community_result import MediaCommunityResult
127
+ from twitter_openapi_python_generated.models.media_community_results import MediaCommunityResults
128
+ from twitter_openapi_python_generated.models.media_community_tweet_data import MediaCommunityTweetData
119
129
  from twitter_openapi_python_generated.models.media_extended import MediaExtended
120
130
  from twitter_openapi_python_generated.models.media_original_info import MediaOriginalInfo
121
131
  from twitter_openapi_python_generated.models.media_original_info_focus_rect import MediaOriginalInfoFocusRect
@@ -137,6 +147,12 @@ from twitter_openapi_python_generated.models.note_tweet_result_media import Note
137
147
  from twitter_openapi_python_generated.models.note_tweet_result_media_inline_media import NoteTweetResultMediaInlineMedia
138
148
  from twitter_openapi_python_generated.models.note_tweet_result_rich_text import NoteTweetResultRichText
139
149
  from twitter_openapi_python_generated.models.note_tweet_result_rich_text_tag import NoteTweetResultRichTextTag
150
+ from twitter_openapi_python_generated.models.notification_template import NotificationTemplate
151
+ from twitter_openapi_python_generated.models.notifications_result import NotificationsResult
152
+ from twitter_openapi_python_generated.models.notifications_timeline_data import NotificationsTimelineData
153
+ from twitter_openapi_python_generated.models.notifications_timeline_response import NotificationsTimelineResponse
154
+ from twitter_openapi_python_generated.models.notifications_user_results import NotificationsUserResults
155
+ from twitter_openapi_python_generated.models.notifications_viewer_v2 import NotificationsViewerV2
140
156
  from twitter_openapi_python_generated.models.one_factor_login_eligibility import OneFactorLoginEligibility
141
157
  from twitter_openapi_python_generated.models.other_object_all import OtherObjectAll
142
158
  from twitter_openapi_python_generated.models.post_create_bookmark_request import PostCreateBookmarkRequest
@@ -161,8 +177,12 @@ from twitter_openapi_python_generated.models.profile_response import ProfileResp
161
177
  from twitter_openapi_python_generated.models.profile_response_data import ProfileResponseData
162
178
  from twitter_openapi_python_generated.models.quoted_ref_result import QuotedRefResult
163
179
  from twitter_openapi_python_generated.models.quoted_status_permalink import QuotedStatusPermalink
180
+ from twitter_openapi_python_generated.models.ranked_community_result import RankedCommunityResult
181
+ from twitter_openapi_python_generated.models.ranked_community_results import RankedCommunityResults
182
+ from twitter_openapi_python_generated.models.ranked_community_tweet_data import RankedCommunityTweetData
164
183
  from twitter_openapi_python_generated.models.retweet import Retweet
165
184
  from twitter_openapi_python_generated.models.retweet_legacy import RetweetLegacy
185
+ from twitter_openapi_python_generated.models.rich_message import RichMessage
166
186
  from twitter_openapi_python_generated.models.search_by_raw_query import SearchByRawQuery
167
187
  from twitter_openapi_python_generated.models.search_timeline import SearchTimeline
168
188
  from twitter_openapi_python_generated.models.search_timeline_data import SearchTimelineData
@@ -186,16 +206,20 @@ from twitter_openapi_python_generated.models.timeline_add_entries import Timelin
186
206
  from twitter_openapi_python_generated.models.timeline_add_entry import TimelineAddEntry
187
207
  from twitter_openapi_python_generated.models.timeline_add_to_module import TimelineAddToModule
188
208
  from twitter_openapi_python_generated.models.timeline_clear_cache import TimelineClearCache
209
+ from twitter_openapi_python_generated.models.timeline_clear_entries_unread_state import TimelineClearEntriesUnreadState
189
210
  from twitter_openapi_python_generated.models.timeline_community import TimelineCommunity
190
211
  from twitter_openapi_python_generated.models.timeline_cover_behavior import TimelineCoverBehavior
191
212
  from twitter_openapi_python_generated.models.timeline_cover_behavior_url import TimelineCoverBehaviorUrl
192
213
  from twitter_openapi_python_generated.models.timeline_general_context import TimelineGeneralContext
193
214
  from twitter_openapi_python_generated.models.timeline_half_cover import TimelineHalfCover
215
+ from twitter_openapi_python_generated.models.timeline_mark_entries_unread_greater_than_sort_index import TimelineMarkEntriesUnreadGreaterThanSortIndex
194
216
  from twitter_openapi_python_generated.models.timeline_message_prompt import TimelineMessagePrompt
217
+ from twitter_openapi_python_generated.models.timeline_notification import TimelineNotification
195
218
  from twitter_openapi_python_generated.models.timeline_pin_entry import TimelinePinEntry
196
219
  from twitter_openapi_python_generated.models.timeline_prompt import TimelinePrompt
197
220
  from twitter_openapi_python_generated.models.timeline_replace_entry import TimelineReplaceEntry
198
221
  from twitter_openapi_python_generated.models.timeline_response import TimelineResponse
222
+ from twitter_openapi_python_generated.models.timeline_result import TimelineResult
199
223
  from twitter_openapi_python_generated.models.timeline_show_alert import TimelineShowAlert
200
224
  from twitter_openapi_python_generated.models.timeline_show_alert_rich_text import TimelineShowAlertRichText
201
225
  from twitter_openapi_python_generated.models.timeline_show_cover import TimelineShowCover
@@ -208,7 +232,6 @@ from twitter_openapi_python_generated.models.timeline_topic_context import Timel
208
232
  from twitter_openapi_python_generated.models.timeline_trend import TimelineTrend
209
233
  from twitter_openapi_python_generated.models.timeline_tweet import TimelineTweet
210
234
  from twitter_openapi_python_generated.models.timeline_user import TimelineUser
211
- from twitter_openapi_python_generated.models.timeline_v2 import TimelineV2
212
235
  from twitter_openapi_python_generated.models.timestamp import Timestamp
213
236
  from twitter_openapi_python_generated.models.tombstone_entity import TombstoneEntity
214
237
  from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo
@@ -289,7 +312,8 @@ from twitter_openapi_python_generated.models.user_results import UserResults
289
312
  from twitter_openapi_python_generated.models.user_tip_jar_settings import UserTipJarSettings
290
313
  from twitter_openapi_python_generated.models.user_tweets_data import UserTweetsData
291
314
  from twitter_openapi_python_generated.models.user_tweets_response import UserTweetsResponse
292
- from twitter_openapi_python_generated.models.user_tweets_result import UserTweetsResult
315
+ from twitter_openapi_python_generated.models.user_tweets_result_v1 import UserTweetsResultV1
316
+ from twitter_openapi_python_generated.models.user_tweets_result_v2 import UserTweetsResultV2
293
317
  from twitter_openapi_python_generated.models.user_tweets_user import UserTweetsUser
294
318
  from twitter_openapi_python_generated.models.user_unavailable import UserUnavailable
295
319
  from twitter_openapi_python_generated.models.user_union import UserUnion
@@ -0,0 +1,95 @@
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
23
+ from twitter_openapi_python_generated.models.timeline_result import TimelineResult
24
+ from twitter_openapi_python_generated.models.type_name import TypeName
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class AboutCommunityResult(BaseModel):
29
+ """
30
+ AboutCommunityResult
31
+ """ # noqa: E501
32
+ typename: TypeName = Field(alias="__typename")
33
+ about_timeline: TimelineResult
34
+ __properties: ClassVar[List[str]] = ["__typename", "about_timeline"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=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
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of AboutCommunityResult 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
+ # override the default output from pydantic by calling `to_dict()` of about_timeline
76
+ if self.about_timeline:
77
+ _dict['about_timeline'] = self.about_timeline.to_dict()
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of AboutCommunityResult from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "__typename": obj.get("__typename"),
91
+ "about_timeline": TimelineResult.from_dict(obj["about_timeline"]) if obj.get("about_timeline") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -19,17 +19,17 @@ import re # noqa: F401
19
19
  import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict
22
- from typing import Any, ClassVar, Dict, List, Optional
23
- from twitter_openapi_python_generated.models.timeline import Timeline
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.about_community_result import AboutCommunityResult
24
24
  from typing import Optional, Set
25
25
  from typing_extensions import Self
26
26
 
27
- class TimelineV2(BaseModel):
27
+ class AboutCommunityResults(BaseModel):
28
28
  """
29
- TimelineV2
29
+ AboutCommunityResults
30
30
  """ # noqa: E501
31
- timeline: Optional[Timeline] = None
32
- __properties: ClassVar[List[str]] = ["timeline"]
31
+ result: AboutCommunityResult
32
+ __properties: ClassVar[List[str]] = ["result"]
33
33
 
34
34
  model_config = ConfigDict(
35
35
  populate_by_name=True,
@@ -49,7 +49,7 @@ class TimelineV2(BaseModel):
49
49
 
50
50
  @classmethod
51
51
  def from_json(cls, json_str: str) -> Optional[Self]:
52
- """Create an instance of TimelineV2 from a JSON string"""
52
+ """Create an instance of AboutCommunityResults from a JSON string"""
53
53
  return cls.from_dict(json.loads(json_str))
54
54
 
55
55
  def to_dict(self) -> Dict[str, Any]:
@@ -70,14 +70,14 @@ class TimelineV2(BaseModel):
70
70
  exclude=excluded_fields,
71
71
  exclude_none=True,
72
72
  )
73
- # override the default output from pydantic by calling `to_dict()` of timeline
74
- if self.timeline:
75
- _dict['timeline'] = self.timeline.to_dict()
73
+ # override the default output from pydantic by calling `to_dict()` of result
74
+ if self.result:
75
+ _dict['result'] = self.result.to_dict()
76
76
  return _dict
77
77
 
78
78
  @classmethod
79
79
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
- """Create an instance of TimelineV2 from a dict"""
80
+ """Create an instance of AboutCommunityResults from a dict"""
81
81
  if obj is None:
82
82
  return None
83
83
 
@@ -85,7 +85,7 @@ class TimelineV2(BaseModel):
85
85
  return cls.model_validate(obj)
86
86
 
87
87
  _obj = cls.model_validate({
88
- "timeline": Timeline.from_dict(obj["timeline"]) if obj.get("timeline") is not None else None
88
+ "result": AboutCommunityResult.from_dict(obj["result"]) if obj.get("result") is not None else None
89
89
  })
90
90
  return _obj
91
91
 
@@ -0,0 +1,92 @@
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
23
+ from twitter_openapi_python_generated.models.about_community_results import AboutCommunityResults
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class AboutCommunityTweetData(BaseModel):
28
+ """
29
+ AboutCommunityTweetData
30
+ """ # noqa: E501
31
+ community_results: AboutCommunityResults = Field(alias="communityResults")
32
+ __properties: ClassVar[List[str]] = ["communityResults"]
33
+
34
+ model_config = ConfigDict(
35
+ populate_by_name=True,
36
+ validate_assignment=True,
37
+ protected_namespaces=(),
38
+ )
39
+
40
+
41
+ def to_str(self) -> str:
42
+ """Returns the string representation of the model using alias"""
43
+ return pprint.pformat(self.model_dump(by_alias=True))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of AboutCommunityTweetData from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # override the default output from pydantic by calling `to_dict()` of community_results
74
+ if self.community_results:
75
+ _dict['communityResults'] = self.community_results.to_dict()
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of AboutCommunityTweetData from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "communityResults": AboutCommunityResults.from_dict(obj["communityResults"]) if obj.get("communityResults") is not None else None
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,94 @@
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 typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class AnalysisResults(BaseModel):
27
+ """
28
+ AnalysisResults
29
+ """ # noqa: E501
30
+ result: Tweet
31
+ __properties: ClassVar[List[str]] = ["result"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of AnalysisResults from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of result
73
+ if self.result:
74
+ _dict['result'] = self.result.to_dict()
75
+ return _dict
76
+
77
+ @classmethod
78
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
79
+ """Create an instance of AnalysisResults 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
+ "result": Tweet.from_dict(obj["result"]) if obj.get("result") is not None else None
88
+ })
89
+ return _obj
90
+
91
+ from twitter_openapi_python_generated.models.tweet import Tweet
92
+ # TODO: Rewrite to not use raise_errors
93
+ AnalysisResults.model_rebuild(raise_errors=False)
94
+
@@ -39,8 +39,9 @@ class BirdwatchPivot(BaseModel):
39
39
  shorttitle: Optional[StrictStr] = None
40
40
  subtitle: Optional[BirdwatchPivotSubtitle] = None
41
41
  title: StrictStr
42
+ title_detail: Optional[StrictStr] = Field(default=None, alias="titleDetail")
42
43
  visual_style: Optional[StrictStr] = Field(default=None, alias="visualStyle")
43
- __properties: ClassVar[List[str]] = ["callToAction", "destinationUrl", "footer", "iconType", "note", "shorttitle", "subtitle", "title", "visualStyle"]
44
+ __properties: ClassVar[List[str]] = ["callToAction", "destinationUrl", "footer", "iconType", "note", "shorttitle", "subtitle", "title", "titleDetail", "visualStyle"]
44
45
 
45
46
  @field_validator('icon_type')
46
47
  def icon_type_validate_enum(cls, value):
@@ -130,6 +131,7 @@ class BirdwatchPivot(BaseModel):
130
131
  "shorttitle": obj.get("shorttitle"),
131
132
  "subtitle": BirdwatchPivotSubtitle.from_dict(obj["subtitle"]) if obj.get("subtitle") is not None else None,
132
133
  "title": obj.get("title"),
134
+ "titleDetail": obj.get("titleDetail"),
133
135
  "visualStyle": obj.get("visualStyle")
134
136
  })
135
137
  return _obj
@@ -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.about_community_tweet_data import AboutCommunityTweetData
24
+ from twitter_openapi_python_generated.models.error_response import ErrorResponse
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+
28
+ class CommunityAboutTimelineResponse(BaseModel):
29
+ """
30
+ CommunityAboutTimelineResponse
31
+ """ # noqa: E501
32
+ data: AboutCommunityTweetData
33
+ errors: Optional[List[ErrorResponse]] = None
34
+ __properties: ClassVar[List[str]] = ["data", "errors"]
35
+
36
+ model_config = ConfigDict(
37
+ populate_by_name=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
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
50
+ return json.dumps(self.to_dict())
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of CommunityAboutTimelineResponse 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
+ # override the default output from pydantic by calling `to_dict()` of data
76
+ if self.data:
77
+ _dict['data'] = self.data.to_dict()
78
+ # override the default output from pydantic by calling `to_dict()` of each item in errors (list)
79
+ _items = []
80
+ if self.errors:
81
+ for _item_errors in self.errors:
82
+ if _item_errors:
83
+ _items.append(_item_errors.to_dict())
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 CommunityAboutTimelineResponse 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": AboutCommunityTweetData.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
+