twitter-openapi-python-generated 0.0.27__py3-none-any.whl → 0.0.29__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 +16 -1
- twitter_openapi_python_generated/api/tweet_api.py +17 -0
- twitter_openapi_python_generated/api_client.py +1 -1
- twitter_openapi_python_generated/configuration.py +1 -1
- twitter_openapi_python_generated/models/__init__.py +15 -0
- twitter_openapi_python_generated/models/community_data.py +24 -15
- twitter_openapi_python_generated/models/content_item_type.py +1 -0
- twitter_openapi_python_generated/models/feedback_info.py +7 -1
- twitter_openapi_python_generated/models/grok_share_attachment.py +96 -0
- twitter_openapi_python_generated/models/grok_share_attachment_item.py +90 -0
- twitter_openapi_python_generated/models/item_content_union.py +27 -8
- twitter_openapi_python_generated/models/limited_action_results_data.py +95 -0
- twitter_openapi_python_generated/models/timeline_timeline_module.py +6 -2
- twitter_openapi_python_generated/models/timeline_tombstone.py +110 -0
- twitter_openapi_python_generated/models/timeline_tweet.py +4 -2
- twitter_openapi_python_generated/models/tombstone_entity.py +96 -0
- twitter_openapi_python_generated/models/tombstone_info.py +94 -0
- twitter_openapi_python_generated/models/tombstone_ref.py +112 -0
- twitter_openapi_python_generated/models/tombstone_rich_text.py +100 -0
- twitter_openapi_python_generated/models/trend_results.py +96 -0
- twitter_openapi_python_generated/models/tweet.py +17 -1
- twitter_openapi_python_generated/models/tweet_limited_action_results.py +96 -0
- twitter_openapi_python_generated/models/tweet_preview_display.py +107 -0
- twitter_openapi_python_generated/models/tweet_preview_display_cta.py +94 -0
- twitter_openapi_python_generated/models/tweet_preview_display_cta_url.py +97 -0
- twitter_openapi_python_generated/models/tweet_preview_display_tweet.py +131 -0
- twitter_openapi_python_generated/models/tweet_preview_display_tweet_view_count.py +96 -0
- twitter_openapi_python_generated/models/tweet_union.py +27 -8
- twitter_openapi_python_generated/models/type_name.py +2 -0
- twitter_openapi_python_generated/models/user.py +15 -1
- {twitter_openapi_python_generated-0.0.27.dist-info → twitter_openapi_python_generated-0.0.29.dist-info}/METADATA +6 -6
- {twitter_openapi_python_generated-0.0.27.dist-info → twitter_openapi_python_generated-0.0.29.dist-info}/RECORD +36 -21
- {twitter_openapi_python_generated-0.0.27.dist-info → twitter_openapi_python_generated-0.0.29.dist-info}/WHEEL +1 -1
- {twitter_openapi_python_generated-0.0.27.dist-info → twitter_openapi_python_generated-0.0.29.dist-info}/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.27.dist-info → twitter_openapi_python_generated-0.0.29.dist-info}/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.27.dist-info → twitter_openapi_python_generated-0.0.29.dist-info}/top_level.txt +0 -0
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
""" # noqa: E501
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
__version__ = "0.0.
|
|
18
|
+
__version__ = "0.0.29"
|
|
19
19
|
|
|
20
20
|
# import apis into sdk package
|
|
21
21
|
from twitter_openapi_python_generated.api.default_api import DefaultApi
|
|
@@ -126,6 +126,8 @@ from twitter_openapi_python_generated.models.follow_response_data import FollowR
|
|
|
126
126
|
from twitter_openapi_python_generated.models.follow_response_result import FollowResponseResult
|
|
127
127
|
from twitter_openapi_python_generated.models.follow_response_user import FollowResponseUser
|
|
128
128
|
from twitter_openapi_python_generated.models.follow_timeline import FollowTimeline
|
|
129
|
+
from twitter_openapi_python_generated.models.grok_share_attachment import GrokShareAttachment
|
|
130
|
+
from twitter_openapi_python_generated.models.grok_share_attachment_item import GrokShareAttachmentItem
|
|
129
131
|
from twitter_openapi_python_generated.models.highlight import Highlight
|
|
130
132
|
from twitter_openapi_python_generated.models.home_timeline_home import HomeTimelineHome
|
|
131
133
|
from twitter_openapi_python_generated.models.home_timeline_response_data import HomeTimelineResponseData
|
|
@@ -133,6 +135,7 @@ from twitter_openapi_python_generated.models.instruction_type import Instruction
|
|
|
133
135
|
from twitter_openapi_python_generated.models.instruction_union import InstructionUnion
|
|
134
136
|
from twitter_openapi_python_generated.models.item_content_union import ItemContentUnion
|
|
135
137
|
from twitter_openapi_python_generated.models.item_result import ItemResult
|
|
138
|
+
from twitter_openapi_python_generated.models.limited_action_results_data import LimitedActionResultsData
|
|
136
139
|
from twitter_openapi_python_generated.models.list_latest_tweets_timeline_response import ListLatestTweetsTimelineResponse
|
|
137
140
|
from twitter_openapi_python_generated.models.list_tweets_timeline import ListTweetsTimeline
|
|
138
141
|
from twitter_openapi_python_generated.models.list_tweets_timeline_data import ListTweetsTimelineData
|
|
@@ -225,13 +228,19 @@ from twitter_openapi_python_generated.models.timeline_terminate_timeline import
|
|
|
225
228
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
226
229
|
from twitter_openapi_python_generated.models.timeline_timeline_item import TimelineTimelineItem
|
|
227
230
|
from twitter_openapi_python_generated.models.timeline_timeline_module import TimelineTimelineModule
|
|
231
|
+
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone
|
|
228
232
|
from twitter_openapi_python_generated.models.timeline_topic_context import TimelineTopicContext
|
|
229
233
|
from twitter_openapi_python_generated.models.timeline_tweet import TimelineTweet
|
|
230
234
|
from twitter_openapi_python_generated.models.timeline_user import TimelineUser
|
|
231
235
|
from twitter_openapi_python_generated.models.timeline_v2 import TimelineV2
|
|
232
236
|
from twitter_openapi_python_generated.models.timestamp import Timestamp
|
|
237
|
+
from twitter_openapi_python_generated.models.tombstone_entity import TombstoneEntity
|
|
238
|
+
from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo
|
|
239
|
+
from twitter_openapi_python_generated.models.tombstone_ref import TombstoneRef
|
|
240
|
+
from twitter_openapi_python_generated.models.tombstone_rich_text import TombstoneRichText
|
|
233
241
|
from twitter_openapi_python_generated.models.topic_context import TopicContext
|
|
234
242
|
from twitter_openapi_python_generated.models.tracing import Tracing
|
|
243
|
+
from twitter_openapi_python_generated.models.trend_results import TrendResults
|
|
235
244
|
from twitter_openapi_python_generated.models.tweet import Tweet
|
|
236
245
|
from twitter_openapi_python_generated.models.tweet_card import TweetCard
|
|
237
246
|
from twitter_openapi_python_generated.models.tweet_card_legacy import TweetCardLegacy
|
|
@@ -256,6 +265,12 @@ from twitter_openapi_python_generated.models.tweet_interstitial_text_entity impo
|
|
|
256
265
|
from twitter_openapi_python_generated.models.tweet_interstitial_text_entity_ref import TweetInterstitialTextEntityRef
|
|
257
266
|
from twitter_openapi_python_generated.models.tweet_legacy import TweetLegacy
|
|
258
267
|
from twitter_openapi_python_generated.models.tweet_legacy_scopes import TweetLegacyScopes
|
|
268
|
+
from twitter_openapi_python_generated.models.tweet_limited_action_results import TweetLimitedActionResults
|
|
269
|
+
from twitter_openapi_python_generated.models.tweet_preview_display import TweetPreviewDisplay
|
|
270
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_cta import TweetPreviewDisplayCta
|
|
271
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_cta_url import TweetPreviewDisplayCtaUrl
|
|
272
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_tweet import TweetPreviewDisplayTweet
|
|
273
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_tweet_view_count import TweetPreviewDisplayTweetViewCount
|
|
259
274
|
from twitter_openapi_python_generated.models.tweet_previous_counts import TweetPreviousCounts
|
|
260
275
|
from twitter_openapi_python_generated.models.tweet_result_by_rest_id_data import TweetResultByRestIdData
|
|
261
276
|
from twitter_openapi_python_generated.models.tweet_result_by_rest_id_response import TweetResultByRestIdResponse
|
|
@@ -2303,6 +2303,7 @@ class TweetApi:
|
|
|
2303
2303
|
path_query_id: StrictStr,
|
|
2304
2304
|
variables: StrictStr,
|
|
2305
2305
|
features: StrictStr,
|
|
2306
|
+
field_toggles: StrictStr,
|
|
2306
2307
|
_request_timeout: Union[
|
|
2307
2308
|
None,
|
|
2308
2309
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -2326,6 +2327,8 @@ class TweetApi:
|
|
|
2326
2327
|
:type variables: str
|
|
2327
2328
|
:param features: (required)
|
|
2328
2329
|
:type features: str
|
|
2330
|
+
:param field_toggles: (required)
|
|
2331
|
+
:type field_toggles: str
|
|
2329
2332
|
:param _request_timeout: timeout setting for this request. If one
|
|
2330
2333
|
number provided, it will be total request
|
|
2331
2334
|
timeout. It can also be a pair (tuple) of
|
|
@@ -2352,6 +2355,7 @@ class TweetApi:
|
|
|
2352
2355
|
path_query_id=path_query_id,
|
|
2353
2356
|
variables=variables,
|
|
2354
2357
|
features=features,
|
|
2358
|
+
field_toggles=field_toggles,
|
|
2355
2359
|
_request_auth=_request_auth,
|
|
2356
2360
|
_content_type=_content_type,
|
|
2357
2361
|
_headers=_headers,
|
|
@@ -2378,6 +2382,7 @@ class TweetApi:
|
|
|
2378
2382
|
path_query_id: StrictStr,
|
|
2379
2383
|
variables: StrictStr,
|
|
2380
2384
|
features: StrictStr,
|
|
2385
|
+
field_toggles: StrictStr,
|
|
2381
2386
|
_request_timeout: Union[
|
|
2382
2387
|
None,
|
|
2383
2388
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -2401,6 +2406,8 @@ class TweetApi:
|
|
|
2401
2406
|
:type variables: str
|
|
2402
2407
|
:param features: (required)
|
|
2403
2408
|
:type features: str
|
|
2409
|
+
:param field_toggles: (required)
|
|
2410
|
+
:type field_toggles: str
|
|
2404
2411
|
:param _request_timeout: timeout setting for this request. If one
|
|
2405
2412
|
number provided, it will be total request
|
|
2406
2413
|
timeout. It can also be a pair (tuple) of
|
|
@@ -2427,6 +2434,7 @@ class TweetApi:
|
|
|
2427
2434
|
path_query_id=path_query_id,
|
|
2428
2435
|
variables=variables,
|
|
2429
2436
|
features=features,
|
|
2437
|
+
field_toggles=field_toggles,
|
|
2430
2438
|
_request_auth=_request_auth,
|
|
2431
2439
|
_content_type=_content_type,
|
|
2432
2440
|
_headers=_headers,
|
|
@@ -2453,6 +2461,7 @@ class TweetApi:
|
|
|
2453
2461
|
path_query_id: StrictStr,
|
|
2454
2462
|
variables: StrictStr,
|
|
2455
2463
|
features: StrictStr,
|
|
2464
|
+
field_toggles: StrictStr,
|
|
2456
2465
|
_request_timeout: Union[
|
|
2457
2466
|
None,
|
|
2458
2467
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -2476,6 +2485,8 @@ class TweetApi:
|
|
|
2476
2485
|
:type variables: str
|
|
2477
2486
|
:param features: (required)
|
|
2478
2487
|
:type features: str
|
|
2488
|
+
:param field_toggles: (required)
|
|
2489
|
+
:type field_toggles: str
|
|
2479
2490
|
:param _request_timeout: timeout setting for this request. If one
|
|
2480
2491
|
number provided, it will be total request
|
|
2481
2492
|
timeout. It can also be a pair (tuple) of
|
|
@@ -2502,6 +2513,7 @@ class TweetApi:
|
|
|
2502
2513
|
path_query_id=path_query_id,
|
|
2503
2514
|
variables=variables,
|
|
2504
2515
|
features=features,
|
|
2516
|
+
field_toggles=field_toggles,
|
|
2505
2517
|
_request_auth=_request_auth,
|
|
2506
2518
|
_content_type=_content_type,
|
|
2507
2519
|
_headers=_headers,
|
|
@@ -2523,6 +2535,7 @@ class TweetApi:
|
|
|
2523
2535
|
path_query_id,
|
|
2524
2536
|
variables,
|
|
2525
2537
|
features,
|
|
2538
|
+
field_toggles,
|
|
2526
2539
|
_request_auth,
|
|
2527
2540
|
_content_type,
|
|
2528
2541
|
_headers,
|
|
@@ -2555,6 +2568,10 @@ class TweetApi:
|
|
|
2555
2568
|
|
|
2556
2569
|
_query_params.append(('features', features))
|
|
2557
2570
|
|
|
2571
|
+
if field_toggles is not None:
|
|
2572
|
+
|
|
2573
|
+
_query_params.append(('fieldToggles', field_toggles))
|
|
2574
|
+
|
|
2558
2575
|
# process the header parameters
|
|
2559
2576
|
# process the form parameters
|
|
2560
2577
|
# process the body parameter
|
|
@@ -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.
|
|
94
|
+
self.user_agent = 'OpenAPI-Generator/0.0.29/python'
|
|
95
95
|
self.client_side_validation = configuration.client_side_validation
|
|
96
96
|
|
|
97
97
|
def __enter__(self):
|
|
@@ -743,7 +743,7 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
743
743
|
"OS: {env}\n"\
|
|
744
744
|
"Python Version: {pyversion}\n"\
|
|
745
745
|
"Version of the API: 0.0.1\n"\
|
|
746
|
-
"SDK Package Version: 0.0.
|
|
746
|
+
"SDK Package Version: 0.0.29".\
|
|
747
747
|
format(env=sys.platform, pyversion=sys.version)
|
|
748
748
|
|
|
749
749
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -100,6 +100,8 @@ from twitter_openapi_python_generated.models.follow_response_data import FollowR
|
|
|
100
100
|
from twitter_openapi_python_generated.models.follow_response_result import FollowResponseResult
|
|
101
101
|
from twitter_openapi_python_generated.models.follow_response_user import FollowResponseUser
|
|
102
102
|
from twitter_openapi_python_generated.models.follow_timeline import FollowTimeline
|
|
103
|
+
from twitter_openapi_python_generated.models.grok_share_attachment import GrokShareAttachment
|
|
104
|
+
from twitter_openapi_python_generated.models.grok_share_attachment_item import GrokShareAttachmentItem
|
|
103
105
|
from twitter_openapi_python_generated.models.highlight import Highlight
|
|
104
106
|
from twitter_openapi_python_generated.models.home_timeline_home import HomeTimelineHome
|
|
105
107
|
from twitter_openapi_python_generated.models.home_timeline_response_data import HomeTimelineResponseData
|
|
@@ -107,6 +109,7 @@ from twitter_openapi_python_generated.models.instruction_type import Instruction
|
|
|
107
109
|
from twitter_openapi_python_generated.models.instruction_union import InstructionUnion
|
|
108
110
|
from twitter_openapi_python_generated.models.item_content_union import ItemContentUnion
|
|
109
111
|
from twitter_openapi_python_generated.models.item_result import ItemResult
|
|
112
|
+
from twitter_openapi_python_generated.models.limited_action_results_data import LimitedActionResultsData
|
|
110
113
|
from twitter_openapi_python_generated.models.list_latest_tweets_timeline_response import ListLatestTweetsTimelineResponse
|
|
111
114
|
from twitter_openapi_python_generated.models.list_tweets_timeline import ListTweetsTimeline
|
|
112
115
|
from twitter_openapi_python_generated.models.list_tweets_timeline_data import ListTweetsTimelineData
|
|
@@ -199,13 +202,19 @@ from twitter_openapi_python_generated.models.timeline_terminate_timeline import
|
|
|
199
202
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
200
203
|
from twitter_openapi_python_generated.models.timeline_timeline_item import TimelineTimelineItem
|
|
201
204
|
from twitter_openapi_python_generated.models.timeline_timeline_module import TimelineTimelineModule
|
|
205
|
+
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone
|
|
202
206
|
from twitter_openapi_python_generated.models.timeline_topic_context import TimelineTopicContext
|
|
203
207
|
from twitter_openapi_python_generated.models.timeline_tweet import TimelineTweet
|
|
204
208
|
from twitter_openapi_python_generated.models.timeline_user import TimelineUser
|
|
205
209
|
from twitter_openapi_python_generated.models.timeline_v2 import TimelineV2
|
|
206
210
|
from twitter_openapi_python_generated.models.timestamp import Timestamp
|
|
211
|
+
from twitter_openapi_python_generated.models.tombstone_entity import TombstoneEntity
|
|
212
|
+
from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo
|
|
213
|
+
from twitter_openapi_python_generated.models.tombstone_ref import TombstoneRef
|
|
214
|
+
from twitter_openapi_python_generated.models.tombstone_rich_text import TombstoneRichText
|
|
207
215
|
from twitter_openapi_python_generated.models.topic_context import TopicContext
|
|
208
216
|
from twitter_openapi_python_generated.models.tracing import Tracing
|
|
217
|
+
from twitter_openapi_python_generated.models.trend_results import TrendResults
|
|
209
218
|
from twitter_openapi_python_generated.models.tweet import Tweet
|
|
210
219
|
from twitter_openapi_python_generated.models.tweet_card import TweetCard
|
|
211
220
|
from twitter_openapi_python_generated.models.tweet_card_legacy import TweetCardLegacy
|
|
@@ -230,6 +239,12 @@ from twitter_openapi_python_generated.models.tweet_interstitial_text_entity impo
|
|
|
230
239
|
from twitter_openapi_python_generated.models.tweet_interstitial_text_entity_ref import TweetInterstitialTextEntityRef
|
|
231
240
|
from twitter_openapi_python_generated.models.tweet_legacy import TweetLegacy
|
|
232
241
|
from twitter_openapi_python_generated.models.tweet_legacy_scopes import TweetLegacyScopes
|
|
242
|
+
from twitter_openapi_python_generated.models.tweet_limited_action_results import TweetLimitedActionResults
|
|
243
|
+
from twitter_openapi_python_generated.models.tweet_preview_display import TweetPreviewDisplay
|
|
244
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_cta import TweetPreviewDisplayCta
|
|
245
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_cta_url import TweetPreviewDisplayCtaUrl
|
|
246
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_tweet import TweetPreviewDisplayTweet
|
|
247
|
+
from twitter_openapi_python_generated.models.tweet_preview_display_tweet_view_count import TweetPreviewDisplayTweetViewCount
|
|
233
248
|
from twitter_openapi_python_generated.models.tweet_previous_counts import TweetPreviousCounts
|
|
234
249
|
from twitter_openapi_python_generated.models.tweet_result_by_rest_id_data import TweetResultByRestIdData
|
|
235
250
|
from twitter_openapi_python_generated.models.tweet_result_by_rest_id_response import TweetResultByRestIdResponse
|
|
@@ -37,28 +37,28 @@ class CommunityData(BaseModel):
|
|
|
37
37
|
CommunityData
|
|
38
38
|
""" # noqa: E501
|
|
39
39
|
typename: TypeName = Field(alias="__typename")
|
|
40
|
-
actions: CommunityActions
|
|
41
|
-
admin_results: UserResults
|
|
40
|
+
actions: Optional[CommunityActions] = None
|
|
41
|
+
admin_results: Optional[UserResults] = None
|
|
42
42
|
created_at: Optional[StrictInt] = None
|
|
43
|
-
creator_results: UserResults
|
|
43
|
+
creator_results: Optional[UserResults] = None
|
|
44
44
|
custom_banner_media: Optional[Dict[str, Any]] = None
|
|
45
45
|
default_banner_media: Optional[Dict[str, Any]] = None
|
|
46
|
-
description: StrictStr
|
|
46
|
+
description: Optional[StrictStr] = None
|
|
47
47
|
id_str: Annotated[str, Field(strict=True)]
|
|
48
|
-
invites_policy: StrictStr
|
|
49
|
-
invites_result: CommunityInvitesResult
|
|
50
|
-
is_pinned: StrictBool
|
|
51
|
-
join_policy: StrictStr
|
|
48
|
+
invites_policy: Optional[StrictStr] = None
|
|
49
|
+
invites_result: Optional[CommunityInvitesResult] = None
|
|
50
|
+
is_pinned: Optional[StrictBool] = None
|
|
51
|
+
join_policy: Optional[StrictStr] = None
|
|
52
52
|
join_requests_result: Optional[CommunityJoinRequestsResult] = None
|
|
53
|
-
member_count: StrictInt
|
|
54
|
-
members_facepile_results: List[UserResults]
|
|
55
|
-
moderator_count: StrictInt
|
|
56
|
-
name: StrictStr
|
|
53
|
+
member_count: Optional[StrictInt] = None
|
|
54
|
+
members_facepile_results: Optional[List[UserResults]] = None
|
|
55
|
+
moderator_count: Optional[StrictInt] = None
|
|
56
|
+
name: Optional[StrictStr] = None
|
|
57
57
|
primary_community_topic: Optional[PrimaryCommunityTopic] = None
|
|
58
58
|
question: Optional[StrictStr] = None
|
|
59
|
-
role: StrictStr
|
|
60
|
-
rules: List[CommunityRule]
|
|
61
|
-
search_tags: List[StrictStr]
|
|
59
|
+
role: Optional[StrictStr] = None
|
|
60
|
+
rules: Optional[List[CommunityRule]] = None
|
|
61
|
+
search_tags: Optional[List[StrictStr]] = None
|
|
62
62
|
show_only_users_to_display: Optional[List[StrictStr]] = None
|
|
63
63
|
urls: Optional[CommunityUrls] = None
|
|
64
64
|
viewer_relationship: Optional[Dict[str, Any]] = None
|
|
@@ -74,6 +74,9 @@ class CommunityData(BaseModel):
|
|
|
74
74
|
@field_validator('invites_policy')
|
|
75
75
|
def invites_policy_validate_enum(cls, value):
|
|
76
76
|
"""Validates the enum"""
|
|
77
|
+
if value is None:
|
|
78
|
+
return value
|
|
79
|
+
|
|
77
80
|
if value not in set(['MemberInvitesAllowed', 'ModeratorInvitesAllowed']):
|
|
78
81
|
raise ValueError("must be one of enum values ('MemberInvitesAllowed', 'ModeratorInvitesAllowed')")
|
|
79
82
|
return value
|
|
@@ -81,6 +84,9 @@ class CommunityData(BaseModel):
|
|
|
81
84
|
@field_validator('join_policy')
|
|
82
85
|
def join_policy_validate_enum(cls, value):
|
|
83
86
|
"""Validates the enum"""
|
|
87
|
+
if value is None:
|
|
88
|
+
return value
|
|
89
|
+
|
|
84
90
|
if value not in set(['Open', 'RestrictedJoinRequestsRequireModeratorApproval']):
|
|
85
91
|
raise ValueError("must be one of enum values ('Open', 'RestrictedJoinRequestsRequireModeratorApproval')")
|
|
86
92
|
return value
|
|
@@ -88,6 +94,9 @@ class CommunityData(BaseModel):
|
|
|
88
94
|
@field_validator('role')
|
|
89
95
|
def role_validate_enum(cls, value):
|
|
90
96
|
"""Validates the enum"""
|
|
97
|
+
if value is None:
|
|
98
|
+
return value
|
|
99
|
+
|
|
91
100
|
if value not in set(['NonMember']):
|
|
92
101
|
raise ValueError("must be one of enum values ('NonMember')")
|
|
93
102
|
return value
|
|
@@ -33,6 +33,7 @@ class ContentItemType(str, Enum):
|
|
|
33
33
|
TIMELINEPROMPT = 'TimelinePrompt'
|
|
34
34
|
TIMELINEMESSAGEPROMPT = 'TimelineMessagePrompt'
|
|
35
35
|
TIMELINECOMMUNITY = 'TimelineCommunity'
|
|
36
|
+
TIMELINETOMBSTONE = 'TimelineTombstone'
|
|
36
37
|
|
|
37
38
|
@classmethod
|
|
38
39
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.client_event_info import ClientEventInfo
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -27,8 +28,9 @@ class FeedbackInfo(BaseModel):
|
|
|
27
28
|
"""
|
|
28
29
|
FeedbackInfo
|
|
29
30
|
""" # noqa: E501
|
|
31
|
+
client_event_info: Optional[ClientEventInfo] = Field(default=None, alias="clientEventInfo")
|
|
30
32
|
feedback_keys: Optional[List[StrictStr]] = Field(default=None, alias="feedbackKeys")
|
|
31
|
-
__properties: ClassVar[List[str]] = ["feedbackKeys"]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["clientEventInfo", "feedbackKeys"]
|
|
32
34
|
|
|
33
35
|
model_config = ConfigDict(
|
|
34
36
|
populate_by_name=True,
|
|
@@ -69,6 +71,9 @@ class FeedbackInfo(BaseModel):
|
|
|
69
71
|
exclude=excluded_fields,
|
|
70
72
|
exclude_none=True,
|
|
71
73
|
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of client_event_info
|
|
75
|
+
if self.client_event_info:
|
|
76
|
+
_dict['clientEventInfo'] = self.client_event_info.to_dict()
|
|
72
77
|
return _dict
|
|
73
78
|
|
|
74
79
|
@classmethod
|
|
@@ -81,6 +86,7 @@ class FeedbackInfo(BaseModel):
|
|
|
81
86
|
return cls.model_validate(obj)
|
|
82
87
|
|
|
83
88
|
_obj = cls.model_validate({
|
|
89
|
+
"clientEventInfo": ClientEventInfo.from_dict(obj["clientEventInfo"]) if obj.get("clientEventInfo") is not None else None,
|
|
84
90
|
"feedbackKeys": obj.get("feedbackKeys")
|
|
85
91
|
})
|
|
86
92
|
return _obj
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.grok_share_attachment_item import GrokShareAttachmentItem
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class GrokShareAttachment(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
GrokShareAttachment
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
items: List[GrokShareAttachmentItem]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["items"]
|
|
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 GrokShareAttachment 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 each item in items (list)
|
|
74
|
+
_items = []
|
|
75
|
+
if self.items:
|
|
76
|
+
for _item_items in self.items:
|
|
77
|
+
if _item_items:
|
|
78
|
+
_items.append(_item_items.to_dict())
|
|
79
|
+
_dict['items'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of GrokShareAttachment from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"items": [GrokShareAttachmentItem.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
|
|
26
|
+
class GrokShareAttachmentItem(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GrokShareAttachmentItem
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
media_urls: List[StrictStr]
|
|
31
|
+
message: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["media_urls", "message"]
|
|
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 GrokShareAttachmentItem 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
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of GrokShareAttachmentItem from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"media_urls": obj.get("media_urls"),
|
|
86
|
+
"message": obj.get("message")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|
|
@@ -22,13 +22,14 @@ from twitter_openapi_python_generated.models.timeline_community import TimelineC
|
|
|
22
22
|
from twitter_openapi_python_generated.models.timeline_message_prompt import TimelineMessagePrompt
|
|
23
23
|
from twitter_openapi_python_generated.models.timeline_prompt import TimelinePrompt
|
|
24
24
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
25
|
+
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone
|
|
25
26
|
from twitter_openapi_python_generated.models.timeline_tweet import TimelineTweet
|
|
26
27
|
from twitter_openapi_python_generated.models.timeline_user import TimelineUser
|
|
27
28
|
from pydantic import StrictStr, Field
|
|
28
29
|
from typing import Union, List, Set, Optional, Dict
|
|
29
30
|
from typing_extensions import Literal, Self
|
|
30
31
|
|
|
31
|
-
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineMessagePrompt", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTweet", "TimelineUser"]
|
|
32
|
+
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineMessagePrompt", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTweet", "TimelineUser"]
|
|
32
33
|
|
|
33
34
|
class ItemContentUnion(BaseModel):
|
|
34
35
|
"""
|
|
@@ -46,8 +47,10 @@ class ItemContentUnion(BaseModel):
|
|
|
46
47
|
oneof_schema_5_validator: Optional[TimelineMessagePrompt] = None
|
|
47
48
|
# data type: TimelineCommunity
|
|
48
49
|
oneof_schema_6_validator: Optional[TimelineCommunity] = None
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
# data type: TimelineTombstone
|
|
51
|
+
oneof_schema_7_validator: Optional[TimelineTombstone] = None
|
|
52
|
+
actual_instance: Optional[Union[TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTweet, TimelineUser]] = None
|
|
53
|
+
one_of_schemas: Set[str] = { "TimelineCommunity", "TimelineMessagePrompt", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTweet", "TimelineUser" }
|
|
51
54
|
|
|
52
55
|
model_config = ConfigDict(
|
|
53
56
|
validate_assignment=True,
|
|
@@ -103,12 +106,17 @@ class ItemContentUnion(BaseModel):
|
|
|
103
106
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineCommunity`")
|
|
104
107
|
else:
|
|
105
108
|
match += 1
|
|
109
|
+
# validate data type: TimelineTombstone
|
|
110
|
+
if not isinstance(v, TimelineTombstone):
|
|
111
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineTombstone`")
|
|
112
|
+
else:
|
|
113
|
+
match += 1
|
|
106
114
|
if match > 1:
|
|
107
115
|
# more than 1 match
|
|
108
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
116
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
109
117
|
elif match == 0:
|
|
110
118
|
# no match
|
|
111
|
-
raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
119
|
+
raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
112
120
|
else:
|
|
113
121
|
return v
|
|
114
122
|
|
|
@@ -148,6 +156,11 @@ class ItemContentUnion(BaseModel):
|
|
|
148
156
|
instance.actual_instance = TimelineTimelineCursor.from_json(json_str)
|
|
149
157
|
return instance
|
|
150
158
|
|
|
159
|
+
# check if data type is `TimelineTombstone`
|
|
160
|
+
if _data_type == "TimelineTombstone":
|
|
161
|
+
instance.actual_instance = TimelineTombstone.from_json(json_str)
|
|
162
|
+
return instance
|
|
163
|
+
|
|
151
164
|
# check if data type is `TimelineTweet`
|
|
152
165
|
if _data_type == "TimelineTweet":
|
|
153
166
|
instance.actual_instance = TimelineTweet.from_json(json_str)
|
|
@@ -194,13 +207,19 @@ class ItemContentUnion(BaseModel):
|
|
|
194
207
|
match += 1
|
|
195
208
|
except (ValidationError, ValueError) as e:
|
|
196
209
|
error_messages.append(str(e))
|
|
210
|
+
# deserialize data into TimelineTombstone
|
|
211
|
+
try:
|
|
212
|
+
instance.actual_instance = TimelineTombstone.from_json(json_str)
|
|
213
|
+
match += 1
|
|
214
|
+
except (ValidationError, ValueError) as e:
|
|
215
|
+
error_messages.append(str(e))
|
|
197
216
|
|
|
198
217
|
if match > 1:
|
|
199
218
|
# more than 1 match
|
|
200
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
219
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
201
220
|
elif match == 0:
|
|
202
221
|
# no match
|
|
203
|
-
raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
222
|
+
raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
204
223
|
else:
|
|
205
224
|
return instance
|
|
206
225
|
|
|
@@ -214,7 +233,7 @@ class ItemContentUnion(BaseModel):
|
|
|
214
233
|
else:
|
|
215
234
|
return json.dumps(self.actual_instance)
|
|
216
235
|
|
|
217
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTweet, TimelineUser]]:
|
|
236
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTweet, TimelineUser]]:
|
|
218
237
|
"""Returns the dict representation of the actual instance"""
|
|
219
238
|
if self.actual_instance is None:
|
|
220
239
|
return None
|