twitter-openapi-python-generated 0.0.16__py3-none-any.whl → 0.0.17__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 +3 -3
- twitter_openapi_python_generated/api/default_api.py +12 -10
- twitter_openapi_python_generated/api/other_api.py +6 -5
- twitter_openapi_python_generated/api/post_api.py +48 -40
- twitter_openapi_python_generated/api/tweet_api.py +66 -55
- twitter_openapi_python_generated/api/user_api.py +12 -10
- twitter_openapi_python_generated/api/user_list_api.py +30 -25
- twitter_openapi_python_generated/api/users_api.py +6 -5
- twitter_openapi_python_generated/api_client.py +28 -10
- twitter_openapi_python_generated/configuration.py +22 -4
- twitter_openapi_python_generated/models/__init__.py +2 -2
- twitter_openapi_python_generated/models/allow_download_status.py +2 -2
- twitter_openapi_python_generated/models/article_cover_media_color_info.py +3 -3
- twitter_openapi_python_generated/models/birdwatch_pivot_footer.py +3 -3
- twitter_openapi_python_generated/models/birdwatch_pivot_subtitle.py +3 -3
- twitter_openapi_python_generated/models/community_data.py +6 -6
- twitter_openapi_python_generated/models/cover_cta.py +3 -3
- twitter_openapi_python_generated/models/delete_retweet.py +3 -3
- twitter_openapi_python_generated/models/entities.py +9 -9
- twitter_openapi_python_generated/models/error.py +5 -5
- twitter_openapi_python_generated/models/error_extensions.py +2 -2
- twitter_openapi_python_generated/models/errors.py +3 -3
- twitter_openapi_python_generated/models/extended_entities.py +3 -3
- twitter_openapi_python_generated/models/highlight.py +3 -3
- twitter_openapi_python_generated/models/media_original_info.py +3 -3
- twitter_openapi_python_generated/models/media_video_info.py +3 -3
- twitter_openapi_python_generated/models/note_tweet_result_media.py +3 -3
- twitter_openapi_python_generated/models/note_tweet_result_rich_text.py +3 -3
- twitter_openapi_python_generated/models/post_create_tweet_request.py +1 -1
- twitter_openapi_python_generated/models/post_create_tweet_request_features.py +9 -5
- twitter_openapi_python_generated/models/post_create_tweet_request_variables.py +3 -1
- twitter_openapi_python_generated/models/post_create_tweet_request_variables_media.py +3 -3
- twitter_openapi_python_generated/models/post_favorite_tweet_request.py +3 -3
- twitter_openapi_python_generated/models/sensitive_media_warning.py +3 -3
- twitter_openapi_python_generated/models/text.py +3 -3
- twitter_openapi_python_generated/models/timeline.py +3 -3
- twitter_openapi_python_generated/models/timeline_add_entries.py +3 -3
- twitter_openapi_python_generated/models/timeline_add_to_module.py +3 -3
- twitter_openapi_python_generated/models/timeline_cover_behavior.py +11 -5
- twitter_openapi_python_generated/models/{extensions.py → timeline_cover_behavior_url.py} +17 -20
- twitter_openapi_python_generated/models/timeline_half_cover.py +3 -3
- twitter_openapi_python_generated/models/timeline_show_alert.py +3 -3
- twitter_openapi_python_generated/models/timeline_timeline_cursor.py +2 -2
- twitter_openapi_python_generated/models/timeline_timeline_module.py +3 -3
- twitter_openapi_python_generated/models/timeline_v2.py +2 -2
- twitter_openapi_python_generated/models/tweet.py +9 -3
- twitter_openapi_python_generated/models/tweet_card_legacy.py +6 -6
- twitter_openapi_python_generated/models/tweet_interstitial_reveal_text.py +3 -3
- twitter_openapi_python_generated/models/tweet_interstitial_text.py +3 -3
- twitter_openapi_python_generated/models/tweet_legacy.py +4 -4
- twitter_openapi_python_generated/models/{error_response.py → tweet_unavailable.py} +12 -13
- twitter_openapi_python_generated/models/tweet_union.py +27 -8
- twitter_openapi_python_generated/models/urt_endpoint_options.py +3 -3
- twitter_openapi_python_generated/models/user.py +14 -10
- twitter_openapi_python_generated/models/user_legacy.py +31 -31
- twitter_openapi_python_generated/models/user_professional.py +3 -3
- twitter_openapi_python_generated/models/user_tip_jar_settings.py +3 -1
- twitter_openapi_python_generated/models/user_verification_info.py +1 -1
- twitter_openapi_python_generated/models/user_verification_info_reason_description.py +3 -3
- twitter_openapi_python_generated/models/users_response_data.py +3 -3
- {twitter_openapi_python_generated-0.0.16.dist-info → twitter_openapi_python_generated-0.0.17.dist-info}/METADATA +5 -5
- {twitter_openapi_python_generated-0.0.16.dist-info → twitter_openapi_python_generated-0.0.17.dist-info}/RECORD +66 -66
- {twitter_openapi_python_generated-0.0.16.dist-info → twitter_openapi_python_generated-0.0.17.dist-info}/WHEEL +1 -1
- {twitter_openapi_python_generated-0.0.16.dist-info → twitter_openapi_python_generated-0.0.17.dist-info}/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.16.dist-info → twitter_openapi_python_generated-0.0.17.dist-info}/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.16.dist-info → twitter_openapi_python_generated-0.0.17.dist-info}/top_level.txt +0 -0
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import datetime
|
|
17
17
|
from dateutil.parser import parse
|
|
18
18
|
from enum import Enum
|
|
19
|
+
import decimal
|
|
19
20
|
import json
|
|
20
21
|
import mimetypes
|
|
21
22
|
import os
|
|
@@ -67,6 +68,7 @@ class ApiClient:
|
|
|
67
68
|
'bool': bool,
|
|
68
69
|
'date': datetime.date,
|
|
69
70
|
'datetime': datetime.datetime,
|
|
71
|
+
'decimal': decimal.Decimal,
|
|
70
72
|
'object': object,
|
|
71
73
|
}
|
|
72
74
|
_pool = None
|
|
@@ -89,7 +91,7 @@ class ApiClient:
|
|
|
89
91
|
self.default_headers[header_name] = header_value
|
|
90
92
|
self.cookie = cookie
|
|
91
93
|
# Set default User-Agent.
|
|
92
|
-
self.user_agent = 'OpenAPI-Generator/0.0.
|
|
94
|
+
self.user_agent = 'OpenAPI-Generator/0.0.17/python'
|
|
93
95
|
self.client_side_validation = configuration.client_side_validation
|
|
94
96
|
|
|
95
97
|
def __enter__(self):
|
|
@@ -228,7 +230,7 @@ class ApiClient:
|
|
|
228
230
|
body = self.sanitize_for_serialization(body)
|
|
229
231
|
|
|
230
232
|
# request url
|
|
231
|
-
if _host is None:
|
|
233
|
+
if _host is None or self.configuration.ignore_operation_servers:
|
|
232
234
|
url = self.configuration.host + resource_path
|
|
233
235
|
else:
|
|
234
236
|
# use server/host defined in path or operation instead
|
|
@@ -315,10 +317,7 @@ class ApiClient:
|
|
|
315
317
|
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
|
|
316
318
|
encoding = match.group(1) if match else "utf-8"
|
|
317
319
|
response_text = response_data.data.decode(encoding)
|
|
318
|
-
|
|
319
|
-
return_data = self.__deserialize_primitive(response_text, response_type)
|
|
320
|
-
else:
|
|
321
|
-
return_data = self.deserialize(response_text, response_type)
|
|
320
|
+
return_data = self.deserialize(response_text, response_type, content_type)
|
|
322
321
|
finally:
|
|
323
322
|
if not 200 <= response_data.status <= 299:
|
|
324
323
|
raise ApiException.from_response(
|
|
@@ -342,6 +341,7 @@ class ApiClient:
|
|
|
342
341
|
If obj is str, int, long, float, bool, return directly.
|
|
343
342
|
If obj is datetime.datetime, datetime.date
|
|
344
343
|
convert to string in iso8601 format.
|
|
344
|
+
If obj is decimal.Decimal return string representation.
|
|
345
345
|
If obj is list, sanitize each element in the list.
|
|
346
346
|
If obj is dict, return the dict.
|
|
347
347
|
If obj is OpenAPI model, return the properties dict.
|
|
@@ -367,6 +367,8 @@ class ApiClient:
|
|
|
367
367
|
)
|
|
368
368
|
elif isinstance(obj, (datetime.datetime, datetime.date)):
|
|
369
369
|
return obj.isoformat()
|
|
370
|
+
elif isinstance(obj, decimal.Decimal):
|
|
371
|
+
return str(obj)
|
|
370
372
|
|
|
371
373
|
elif isinstance(obj, dict):
|
|
372
374
|
obj_dict = obj
|
|
@@ -386,21 +388,35 @@ class ApiClient:
|
|
|
386
388
|
for key, val in obj_dict.items()
|
|
387
389
|
}
|
|
388
390
|
|
|
389
|
-
def deserialize(self, response_text, response_type):
|
|
391
|
+
def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]):
|
|
390
392
|
"""Deserializes response into an object.
|
|
391
393
|
|
|
392
394
|
:param response: RESTResponse object to be deserialized.
|
|
393
395
|
:param response_type: class literal for
|
|
394
396
|
deserialized object, or string of class name.
|
|
397
|
+
:param content_type: content type of response.
|
|
395
398
|
|
|
396
399
|
:return: deserialized object.
|
|
397
400
|
"""
|
|
398
401
|
|
|
399
402
|
# fetch data from response object
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
+
if content_type is None:
|
|
404
|
+
try:
|
|
405
|
+
data = json.loads(response_text)
|
|
406
|
+
except ValueError:
|
|
407
|
+
data = response_text
|
|
408
|
+
elif content_type.startswith("application/json"):
|
|
409
|
+
if response_text == "":
|
|
410
|
+
data = ""
|
|
411
|
+
else:
|
|
412
|
+
data = json.loads(response_text)
|
|
413
|
+
elif content_type.startswith("text/plain"):
|
|
403
414
|
data = response_text
|
|
415
|
+
else:
|
|
416
|
+
raise ApiException(
|
|
417
|
+
status=0,
|
|
418
|
+
reason="Unsupported content type: {0}".format(content_type)
|
|
419
|
+
)
|
|
404
420
|
|
|
405
421
|
return self.__deserialize(data, response_type)
|
|
406
422
|
|
|
@@ -444,6 +460,8 @@ class ApiClient:
|
|
|
444
460
|
return self.__deserialize_date(data)
|
|
445
461
|
elif klass == datetime.datetime:
|
|
446
462
|
return self.__deserialize_datetime(data)
|
|
463
|
+
elif klass == decimal.Decimal:
|
|
464
|
+
return decimal.Decimal(data)
|
|
447
465
|
elif issubclass(klass, Enum):
|
|
448
466
|
return self.__deserialize_enum(data, klass)
|
|
449
467
|
else:
|
|
@@ -33,6 +33,9 @@ class Configuration:
|
|
|
33
33
|
"""This class contains various settings of the API client.
|
|
34
34
|
|
|
35
35
|
:param host: Base url.
|
|
36
|
+
:param ignore_operation_servers
|
|
37
|
+
Boolean to ignore operation servers for the API client.
|
|
38
|
+
Config will use `host` as the base url regardless of the operation servers.
|
|
36
39
|
:param api_key: Dict to store API key(s).
|
|
37
40
|
Each entry in the dict specifies an API key.
|
|
38
41
|
The dict key is the name of the security scheme in the OAS specification.
|
|
@@ -55,6 +58,7 @@ class Configuration:
|
|
|
55
58
|
values before.
|
|
56
59
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
|
57
60
|
in PEM format.
|
|
61
|
+
:param retries: Number of retries for API requests.
|
|
58
62
|
|
|
59
63
|
:Example:
|
|
60
64
|
|
|
@@ -86,11 +90,15 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
86
90
|
access_token=None,
|
|
87
91
|
server_index=None, server_variables=None,
|
|
88
92
|
server_operation_index=None, server_operation_variables=None,
|
|
93
|
+
ignore_operation_servers=False,
|
|
89
94
|
ssl_ca_cert=None,
|
|
95
|
+
retries=None,
|
|
96
|
+
*,
|
|
97
|
+
debug: Optional[bool] = None
|
|
90
98
|
) -> None:
|
|
91
99
|
"""Constructor
|
|
92
100
|
"""
|
|
93
|
-
self._base_path = "https://
|
|
101
|
+
self._base_path = "https://x.com/i/api" if host is None else host
|
|
94
102
|
"""Default Base url
|
|
95
103
|
"""
|
|
96
104
|
self.server_index = 0 if server_index is None and host is None else server_index
|
|
@@ -101,6 +109,9 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
101
109
|
self.server_operation_variables = server_operation_variables or {}
|
|
102
110
|
"""Default server variables
|
|
103
111
|
"""
|
|
112
|
+
self.ignore_operation_servers = ignore_operation_servers
|
|
113
|
+
"""Ignore operation servers
|
|
114
|
+
"""
|
|
104
115
|
self.temp_folder_path = None
|
|
105
116
|
"""Temp file folder for downloading files
|
|
106
117
|
"""
|
|
@@ -144,7 +155,10 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
144
155
|
self.logger_file = None
|
|
145
156
|
"""Debug file location
|
|
146
157
|
"""
|
|
147
|
-
|
|
158
|
+
if debug is not None:
|
|
159
|
+
self.debug = debug
|
|
160
|
+
else:
|
|
161
|
+
self.__debug = False
|
|
148
162
|
"""Debug switch
|
|
149
163
|
"""
|
|
150
164
|
|
|
@@ -187,7 +201,7 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
187
201
|
self.safe_chars_for_path_param = ''
|
|
188
202
|
"""Safe chars for path_param
|
|
189
203
|
"""
|
|
190
|
-
self.retries =
|
|
204
|
+
self.retries = retries
|
|
191
205
|
"""Adding retries to override urllib3 default value 3
|
|
192
206
|
"""
|
|
193
207
|
# Enable client side validation
|
|
@@ -569,7 +583,7 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
569
583
|
"OS: {env}\n"\
|
|
570
584
|
"Python Version: {pyversion}\n"\
|
|
571
585
|
"Version of the API: 0.0.1\n"\
|
|
572
|
-
"SDK Package Version: 0.0.
|
|
586
|
+
"SDK Package Version: 0.0.17".\
|
|
573
587
|
format(env=sys.platform, pyversion=sys.version)
|
|
574
588
|
|
|
575
589
|
def get_host_settings(self):
|
|
@@ -578,6 +592,10 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
578
592
|
:return: An array of host settings
|
|
579
593
|
"""
|
|
580
594
|
return [
|
|
595
|
+
{
|
|
596
|
+
'url': "https://x.com/i/api",
|
|
597
|
+
'description': "No description provided",
|
|
598
|
+
},
|
|
581
599
|
{
|
|
582
600
|
'url': "https://twitter.com/i/api",
|
|
583
601
|
'description': "No description provided",
|
|
@@ -85,11 +85,9 @@ from twitter_openapi_python_generated.models.display_type import DisplayType
|
|
|
85
85
|
from twitter_openapi_python_generated.models.entities import Entities
|
|
86
86
|
from twitter_openapi_python_generated.models.error import Error
|
|
87
87
|
from twitter_openapi_python_generated.models.error_extensions import ErrorExtensions
|
|
88
|
-
from twitter_openapi_python_generated.models.error_response import ErrorResponse
|
|
89
88
|
from twitter_openapi_python_generated.models.errors import Errors
|
|
90
89
|
from twitter_openapi_python_generated.models.ext_media_availability import ExtMediaAvailability
|
|
91
90
|
from twitter_openapi_python_generated.models.extended_entities import ExtendedEntities
|
|
92
|
-
from twitter_openapi_python_generated.models.extensions import Extensions
|
|
93
91
|
from twitter_openapi_python_generated.models.favorite_tweet import FavoriteTweet
|
|
94
92
|
from twitter_openapi_python_generated.models.favorite_tweet_response_data import FavoriteTweetResponseData
|
|
95
93
|
from twitter_openapi_python_generated.models.feedback_info import FeedbackInfo
|
|
@@ -204,6 +202,7 @@ from twitter_openapi_python_generated.models.timeline_add_to_module import Timel
|
|
|
204
202
|
from twitter_openapi_python_generated.models.timeline_clear_cache import TimelineClearCache
|
|
205
203
|
from twitter_openapi_python_generated.models.timeline_community import TimelineCommunity
|
|
206
204
|
from twitter_openapi_python_generated.models.timeline_cover_behavior import TimelineCoverBehavior
|
|
205
|
+
from twitter_openapi_python_generated.models.timeline_cover_behavior_url import TimelineCoverBehaviorUrl
|
|
207
206
|
from twitter_openapi_python_generated.models.timeline_general_context import TimelineGeneralContext
|
|
208
207
|
from twitter_openapi_python_generated.models.timeline_half_cover import TimelineHalfCover
|
|
209
208
|
from twitter_openapi_python_generated.models.timeline_message_prompt import TimelineMessagePrompt
|
|
@@ -255,6 +254,7 @@ from twitter_openapi_python_generated.models.tweet_result_by_rest_id_response im
|
|
|
255
254
|
from twitter_openapi_python_generated.models.tweet_retweeters_response import TweetRetweetersResponse
|
|
256
255
|
from twitter_openapi_python_generated.models.tweet_retweeters_response_data import TweetRetweetersResponseData
|
|
257
256
|
from twitter_openapi_python_generated.models.tweet_tombstone import TweetTombstone
|
|
257
|
+
from twitter_openapi_python_generated.models.tweet_unavailable import TweetUnavailable
|
|
258
258
|
from twitter_openapi_python_generated.models.tweet_union import TweetUnion
|
|
259
259
|
from twitter_openapi_python_generated.models.tweet_view import TweetView
|
|
260
260
|
from twitter_openapi_python_generated.models.tweet_with_visibility_results import TweetWithVisibilityResults
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictBool
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ class AllowDownloadStatus(BaseModel):
|
|
|
27
27
|
"""
|
|
28
28
|
AllowDownloadStatus
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
allow_download: StrictBool
|
|
30
|
+
allow_download: Optional[StrictBool] = None
|
|
31
31
|
__properties: ClassVar[List[str]] = ["allow_download"]
|
|
32
32
|
|
|
33
33
|
model_config = ConfigDict(
|
|
@@ -73,9 +73,9 @@ class ArticleCoverMediaColorInfo(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in palette (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.palette:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_palette in self.palette:
|
|
77
|
+
if _item_palette:
|
|
78
|
+
_items.append(_item_palette.to_dict())
|
|
79
79
|
_dict['palette'] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -74,9 +74,9 @@ class BirdwatchPivotFooter(BaseModel):
|
|
|
74
74
|
# override the default output from pydantic by calling `to_dict()` of each item in entities (list)
|
|
75
75
|
_items = []
|
|
76
76
|
if self.entities:
|
|
77
|
-
for
|
|
78
|
-
if
|
|
79
|
-
_items.append(
|
|
77
|
+
for _item_entities in self.entities:
|
|
78
|
+
if _item_entities:
|
|
79
|
+
_items.append(_item_entities.to_dict())
|
|
80
80
|
_dict['entities'] = _items
|
|
81
81
|
return _dict
|
|
82
82
|
|
|
@@ -74,9 +74,9 @@ class BirdwatchPivotSubtitle(BaseModel):
|
|
|
74
74
|
# override the default output from pydantic by calling `to_dict()` of each item in entities (list)
|
|
75
75
|
_items = []
|
|
76
76
|
if self.entities:
|
|
77
|
-
for
|
|
78
|
-
if
|
|
79
|
-
_items.append(
|
|
77
|
+
for _item_entities in self.entities:
|
|
78
|
+
if _item_entities:
|
|
79
|
+
_items.append(_item_entities.to_dict())
|
|
80
80
|
_dict['entities'] = _items
|
|
81
81
|
return _dict
|
|
82
82
|
|
|
@@ -149,9 +149,9 @@ class CommunityData(BaseModel):
|
|
|
149
149
|
# override the default output from pydantic by calling `to_dict()` of each item in members_facepile_results (list)
|
|
150
150
|
_items = []
|
|
151
151
|
if self.members_facepile_results:
|
|
152
|
-
for
|
|
153
|
-
if
|
|
154
|
-
_items.append(
|
|
152
|
+
for _item_members_facepile_results in self.members_facepile_results:
|
|
153
|
+
if _item_members_facepile_results:
|
|
154
|
+
_items.append(_item_members_facepile_results.to_dict())
|
|
155
155
|
_dict['members_facepile_results'] = _items
|
|
156
156
|
# override the default output from pydantic by calling `to_dict()` of primary_community_topic
|
|
157
157
|
if self.primary_community_topic:
|
|
@@ -159,9 +159,9 @@ class CommunityData(BaseModel):
|
|
|
159
159
|
# override the default output from pydantic by calling `to_dict()` of each item in rules (list)
|
|
160
160
|
_items = []
|
|
161
161
|
if self.rules:
|
|
162
|
-
for
|
|
163
|
-
if
|
|
164
|
-
_items.append(
|
|
162
|
+
for _item_rules in self.rules:
|
|
163
|
+
if _item_rules:
|
|
164
|
+
_items.append(_item_rules.to_dict())
|
|
165
165
|
_dict['rules'] = _items
|
|
166
166
|
# override the default output from pydantic by calling `to_dict()` of urls
|
|
167
167
|
if self.urls:
|
|
@@ -89,9 +89,9 @@ class CoverCta(BaseModel):
|
|
|
89
89
|
# override the default output from pydantic by calling `to_dict()` of each item in callbacks (list)
|
|
90
90
|
_items = []
|
|
91
91
|
if self.callbacks:
|
|
92
|
-
for
|
|
93
|
-
if
|
|
94
|
-
_items.append(
|
|
92
|
+
for _item_callbacks in self.callbacks:
|
|
93
|
+
if _item_callbacks:
|
|
94
|
+
_items.append(_item_callbacks.to_dict())
|
|
95
95
|
_dict['callbacks'] = _items
|
|
96
96
|
# override the default output from pydantic by calling `to_dict()` of client_event_info
|
|
97
97
|
if self.client_event_info:
|
|
@@ -73,9 +73,9 @@ class DeleteRetweet(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in result (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.result:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_result in self.result:
|
|
77
|
+
if _item_result:
|
|
78
|
+
_items.append(_item_result.to_dict())
|
|
79
79
|
_dict['result'] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -80,23 +80,23 @@ class Entities(BaseModel):
|
|
|
80
80
|
# override the default output from pydantic by calling `to_dict()` of each item in media (list)
|
|
81
81
|
_items = []
|
|
82
82
|
if self.media:
|
|
83
|
-
for
|
|
84
|
-
if
|
|
85
|
-
_items.append(
|
|
83
|
+
for _item_media in self.media:
|
|
84
|
+
if _item_media:
|
|
85
|
+
_items.append(_item_media.to_dict())
|
|
86
86
|
_dict['media'] = _items
|
|
87
87
|
# override the default output from pydantic by calling `to_dict()` of each item in timestamps (list)
|
|
88
88
|
_items = []
|
|
89
89
|
if self.timestamps:
|
|
90
|
-
for
|
|
91
|
-
if
|
|
92
|
-
_items.append(
|
|
90
|
+
for _item_timestamps in self.timestamps:
|
|
91
|
+
if _item_timestamps:
|
|
92
|
+
_items.append(_item_timestamps.to_dict())
|
|
93
93
|
_dict['timestamps'] = _items
|
|
94
94
|
# override the default output from pydantic by calling `to_dict()` of each item in urls (list)
|
|
95
95
|
_items = []
|
|
96
96
|
if self.urls:
|
|
97
|
-
for
|
|
98
|
-
if
|
|
99
|
-
_items.append(
|
|
97
|
+
for _item_urls in self.urls:
|
|
98
|
+
if _item_urls:
|
|
99
|
+
_items.append(_item_urls.to_dict())
|
|
100
100
|
_dict['urls'] = _items
|
|
101
101
|
return _dict
|
|
102
102
|
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.error_extensions import ErrorExtensions
|
|
24
24
|
from twitter_openapi_python_generated.models.location import Location
|
|
25
25
|
from twitter_openapi_python_generated.models.tracing import Tracing
|
|
@@ -37,7 +37,7 @@ class Error(BaseModel):
|
|
|
37
37
|
message: StrictStr
|
|
38
38
|
name: StrictStr
|
|
39
39
|
path: List[StrictStr]
|
|
40
|
-
retry_after: StrictInt
|
|
40
|
+
retry_after: Optional[StrictInt] = None
|
|
41
41
|
source: StrictStr
|
|
42
42
|
tracing: Tracing
|
|
43
43
|
__properties: ClassVar[List[str]] = ["code", "extensions", "kind", "locations", "message", "name", "path", "retry_after", "source", "tracing"]
|
|
@@ -87,9 +87,9 @@ class Error(BaseModel):
|
|
|
87
87
|
# override the default output from pydantic by calling `to_dict()` of each item in locations (list)
|
|
88
88
|
_items = []
|
|
89
89
|
if self.locations:
|
|
90
|
-
for
|
|
91
|
-
if
|
|
92
|
-
_items.append(
|
|
90
|
+
for _item_locations in self.locations:
|
|
91
|
+
if _item_locations:
|
|
92
|
+
_items.append(_item_locations.to_dict())
|
|
93
93
|
_dict['locations'] = _items
|
|
94
94
|
# override the default output from pydantic by calling `to_dict()` of tracing
|
|
95
95
|
if self.tracing:
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.tracing import Tracing
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -31,7 +31,7 @@ class ErrorExtensions(BaseModel):
|
|
|
31
31
|
code: StrictInt
|
|
32
32
|
kind: StrictStr
|
|
33
33
|
name: StrictStr
|
|
34
|
-
retry_after: StrictInt
|
|
34
|
+
retry_after: Optional[StrictInt] = None
|
|
35
35
|
source: StrictStr
|
|
36
36
|
tracing: Tracing
|
|
37
37
|
__properties: ClassVar[List[str]] = ["code", "kind", "name", "retry_after", "source", "tracing"]
|
|
@@ -73,9 +73,9 @@ class Errors(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.errors:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_errors in self.errors:
|
|
77
|
+
if _item_errors:
|
|
78
|
+
_items.append(_item_errors.to_dict())
|
|
79
79
|
_dict['errors'] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -73,9 +73,9 @@ class ExtendedEntities(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in media (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.media:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_media in self.media:
|
|
77
|
+
if _item_media:
|
|
78
|
+
_items.append(_item_media.to_dict())
|
|
79
79
|
_dict['media'] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -73,9 +73,9 @@ class Highlight(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in text_highlights (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.text_highlights:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_text_highlights in self.text_highlights:
|
|
77
|
+
if _item_text_highlights:
|
|
78
|
+
_items.append(_item_text_highlights.to_dict())
|
|
79
79
|
_dict['textHighlights'] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -75,9 +75,9 @@ class MediaOriginalInfo(BaseModel):
|
|
|
75
75
|
# override the default output from pydantic by calling `to_dict()` of each item in focus_rects (list)
|
|
76
76
|
_items = []
|
|
77
77
|
if self.focus_rects:
|
|
78
|
-
for
|
|
79
|
-
if
|
|
80
|
-
_items.append(
|
|
78
|
+
for _item_focus_rects in self.focus_rects:
|
|
79
|
+
if _item_focus_rects:
|
|
80
|
+
_items.append(_item_focus_rects.to_dict())
|
|
81
81
|
_dict['focus_rects'] = _items
|
|
82
82
|
return _dict
|
|
83
83
|
|
|
@@ -75,9 +75,9 @@ class MediaVideoInfo(BaseModel):
|
|
|
75
75
|
# override the default output from pydantic by calling `to_dict()` of each item in variants (list)
|
|
76
76
|
_items = []
|
|
77
77
|
if self.variants:
|
|
78
|
-
for
|
|
79
|
-
if
|
|
80
|
-
_items.append(
|
|
78
|
+
for _item_variants in self.variants:
|
|
79
|
+
if _item_variants:
|
|
80
|
+
_items.append(_item_variants.to_dict())
|
|
81
81
|
_dict['variants'] = _items
|
|
82
82
|
return _dict
|
|
83
83
|
|
|
@@ -73,9 +73,9 @@ class NoteTweetResultMedia(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in inline_media (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.inline_media:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_inline_media in self.inline_media:
|
|
77
|
+
if _item_inline_media:
|
|
78
|
+
_items.append(_item_inline_media.to_dict())
|
|
79
79
|
_dict['inline_media'] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -73,9 +73,9 @@ class NoteTweetResultRichText(BaseModel):
|
|
|
73
73
|
# override the default output from pydantic by calling `to_dict()` of each item in richtext_tags (list)
|
|
74
74
|
_items = []
|
|
75
75
|
if self.richtext_tags:
|
|
76
|
-
for
|
|
77
|
-
if
|
|
78
|
-
_items.append(
|
|
76
|
+
for _item_richtext_tags in self.richtext_tags:
|
|
77
|
+
if _item_richtext_tags:
|
|
78
|
+
_items.append(_item_richtext_tags.to_dict())
|
|
79
79
|
_dict['richtext_tags'] = _items
|
|
80
80
|
return _dict
|
|
81
81
|
|
|
@@ -92,7 +92,7 @@ class PostCreateTweetRequest(BaseModel):
|
|
|
92
92
|
|
|
93
93
|
_obj = cls.model_validate({
|
|
94
94
|
"features": PostCreateTweetRequestFeatures.from_dict(obj["features"]) if obj.get("features") is not None else None,
|
|
95
|
-
"queryId": obj.get("queryId") if obj.get("queryId") is not None else '
|
|
95
|
+
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'xT36w0XM3A8jDynpkram2A',
|
|
96
96
|
"variables": PostCreateTweetRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
97
97
|
})
|
|
98
98
|
return _obj
|
|
@@ -27,7 +27,10 @@ class PostCreateTweetRequestFeatures(BaseModel):
|
|
|
27
27
|
"""
|
|
28
28
|
PostCreateTweetRequestFeatures
|
|
29
29
|
""" # noqa: E501
|
|
30
|
+
articles_preview_enabled: StrictBool
|
|
30
31
|
c9s_tweet_anatomy_moderator_badge_enabled: StrictBool
|
|
32
|
+
communities_web_enable_tweet_community_results_fetch: StrictBool
|
|
33
|
+
creator_subscriptions_quote_tweet_preview_enabled: StrictBool
|
|
31
34
|
freedom_of_speech_not_reach_fetch_enabled: StrictBool
|
|
32
35
|
graphql_is_translatable_rweb_tweet_is_translatable_enabled: StrictBool
|
|
33
36
|
longform_notetweets_consumption_enabled: StrictBool
|
|
@@ -38,16 +41,15 @@ class PostCreateTweetRequestFeatures(BaseModel):
|
|
|
38
41
|
responsive_web_graphql_exclude_directive_enabled: StrictBool
|
|
39
42
|
responsive_web_graphql_skip_user_profile_image_extensions_enabled: StrictBool
|
|
40
43
|
responsive_web_graphql_timeline_navigation_enabled: StrictBool
|
|
41
|
-
responsive_web_media_download_video_enabled: StrictBool
|
|
42
44
|
responsive_web_twitter_article_tweet_consumption_enabled: StrictBool
|
|
45
|
+
rweb_tipjar_consumption_enabled: StrictBool
|
|
43
46
|
rweb_video_timestamps_enabled: StrictBool
|
|
44
47
|
standardized_nudges_misinfo: StrictBool
|
|
45
48
|
tweet_awards_web_tipping_enabled: StrictBool
|
|
46
49
|
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: StrictBool
|
|
47
|
-
tweetypie_unmention_optimization_enabled: StrictBool
|
|
48
50
|
verified_phone_label_enabled: StrictBool
|
|
49
51
|
view_counts_everywhere_api_enabled: StrictBool
|
|
50
|
-
__properties: ClassVar[List[str]] = ["c9s_tweet_anatomy_moderator_badge_enabled", "freedom_of_speech_not_reach_fetch_enabled", "graphql_is_translatable_rweb_tweet_is_translatable_enabled", "longform_notetweets_consumption_enabled", "longform_notetweets_inline_media_enabled", "longform_notetweets_rich_text_read_enabled", "responsive_web_edit_tweet_api_enabled", "responsive_web_enhance_cards_enabled", "responsive_web_graphql_exclude_directive_enabled", "responsive_web_graphql_skip_user_profile_image_extensions_enabled", "responsive_web_graphql_timeline_navigation_enabled", "
|
|
52
|
+
__properties: ClassVar[List[str]] = ["articles_preview_enabled", "c9s_tweet_anatomy_moderator_badge_enabled", "communities_web_enable_tweet_community_results_fetch", "creator_subscriptions_quote_tweet_preview_enabled", "freedom_of_speech_not_reach_fetch_enabled", "graphql_is_translatable_rweb_tweet_is_translatable_enabled", "longform_notetweets_consumption_enabled", "longform_notetweets_inline_media_enabled", "longform_notetweets_rich_text_read_enabled", "responsive_web_edit_tweet_api_enabled", "responsive_web_enhance_cards_enabled", "responsive_web_graphql_exclude_directive_enabled", "responsive_web_graphql_skip_user_profile_image_extensions_enabled", "responsive_web_graphql_timeline_navigation_enabled", "responsive_web_twitter_article_tweet_consumption_enabled", "rweb_tipjar_consumption_enabled", "rweb_video_timestamps_enabled", "standardized_nudges_misinfo", "tweet_awards_web_tipping_enabled", "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled", "verified_phone_label_enabled", "view_counts_everywhere_api_enabled"]
|
|
51
53
|
|
|
52
54
|
model_config = ConfigDict(
|
|
53
55
|
populate_by_name=True,
|
|
@@ -100,7 +102,10 @@ class PostCreateTweetRequestFeatures(BaseModel):
|
|
|
100
102
|
return cls.model_validate(obj)
|
|
101
103
|
|
|
102
104
|
_obj = cls.model_validate({
|
|
105
|
+
"articles_preview_enabled": obj.get("articles_preview_enabled") if obj.get("articles_preview_enabled") is not None else True,
|
|
103
106
|
"c9s_tweet_anatomy_moderator_badge_enabled": obj.get("c9s_tweet_anatomy_moderator_badge_enabled") if obj.get("c9s_tweet_anatomy_moderator_badge_enabled") is not None else True,
|
|
107
|
+
"communities_web_enable_tweet_community_results_fetch": obj.get("communities_web_enable_tweet_community_results_fetch") if obj.get("communities_web_enable_tweet_community_results_fetch") is not None else True,
|
|
108
|
+
"creator_subscriptions_quote_tweet_preview_enabled": obj.get("creator_subscriptions_quote_tweet_preview_enabled") if obj.get("creator_subscriptions_quote_tweet_preview_enabled") is not None else False,
|
|
104
109
|
"freedom_of_speech_not_reach_fetch_enabled": obj.get("freedom_of_speech_not_reach_fetch_enabled") if obj.get("freedom_of_speech_not_reach_fetch_enabled") is not None else True,
|
|
105
110
|
"graphql_is_translatable_rweb_tweet_is_translatable_enabled": obj.get("graphql_is_translatable_rweb_tweet_is_translatable_enabled") if obj.get("graphql_is_translatable_rweb_tweet_is_translatable_enabled") is not None else True,
|
|
106
111
|
"longform_notetweets_consumption_enabled": obj.get("longform_notetweets_consumption_enabled") if obj.get("longform_notetweets_consumption_enabled") is not None else True,
|
|
@@ -111,13 +116,12 @@ class PostCreateTweetRequestFeatures(BaseModel):
|
|
|
111
116
|
"responsive_web_graphql_exclude_directive_enabled": obj.get("responsive_web_graphql_exclude_directive_enabled") if obj.get("responsive_web_graphql_exclude_directive_enabled") is not None else True,
|
|
112
117
|
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": obj.get("responsive_web_graphql_skip_user_profile_image_extensions_enabled") if obj.get("responsive_web_graphql_skip_user_profile_image_extensions_enabled") is not None else False,
|
|
113
118
|
"responsive_web_graphql_timeline_navigation_enabled": obj.get("responsive_web_graphql_timeline_navigation_enabled") if obj.get("responsive_web_graphql_timeline_navigation_enabled") is not None else True,
|
|
114
|
-
"responsive_web_media_download_video_enabled": obj.get("responsive_web_media_download_video_enabled") if obj.get("responsive_web_media_download_video_enabled") is not None else False,
|
|
115
119
|
"responsive_web_twitter_article_tweet_consumption_enabled": obj.get("responsive_web_twitter_article_tweet_consumption_enabled") if obj.get("responsive_web_twitter_article_tweet_consumption_enabled") is not None else True,
|
|
120
|
+
"rweb_tipjar_consumption_enabled": obj.get("rweb_tipjar_consumption_enabled") if obj.get("rweb_tipjar_consumption_enabled") is not None else True,
|
|
116
121
|
"rweb_video_timestamps_enabled": obj.get("rweb_video_timestamps_enabled") if obj.get("rweb_video_timestamps_enabled") is not None else True,
|
|
117
122
|
"standardized_nudges_misinfo": obj.get("standardized_nudges_misinfo") if obj.get("standardized_nudges_misinfo") is not None else True,
|
|
118
123
|
"tweet_awards_web_tipping_enabled": obj.get("tweet_awards_web_tipping_enabled") if obj.get("tweet_awards_web_tipping_enabled") is not None else False,
|
|
119
124
|
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": obj.get("tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled") if obj.get("tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled") is not None else True,
|
|
120
|
-
"tweetypie_unmention_optimization_enabled": obj.get("tweetypie_unmention_optimization_enabled") if obj.get("tweetypie_unmention_optimization_enabled") is not None else True,
|
|
121
125
|
"verified_phone_label_enabled": obj.get("verified_phone_label_enabled") if obj.get("verified_phone_label_enabled") is not None else False,
|
|
122
126
|
"view_counts_everywhere_api_enabled": obj.get("view_counts_everywhere_api_enabled") if obj.get("view_counts_everywhere_api_enabled") is not None else True
|
|
123
127
|
})
|
|
@@ -30,11 +30,12 @@ class PostCreateTweetRequestVariables(BaseModel):
|
|
|
30
30
|
PostCreateTweetRequestVariables
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
dark_request: StrictBool
|
|
33
|
+
disallowed_reply_options: StrictBool
|
|
33
34
|
media: PostCreateTweetRequestVariablesMedia
|
|
34
35
|
reply: Optional[PostCreateTweetRequestVariablesReply] = None
|
|
35
36
|
semantic_annotation_ids: List[Dict[str, Any]]
|
|
36
37
|
tweet_text: StrictStr
|
|
37
|
-
__properties: ClassVar[List[str]] = ["dark_request", "media", "reply", "semantic_annotation_ids", "tweet_text"]
|
|
38
|
+
__properties: ClassVar[List[str]] = ["dark_request", "disallowed_reply_options", "media", "reply", "semantic_annotation_ids", "tweet_text"]
|
|
38
39
|
|
|
39
40
|
model_config = ConfigDict(
|
|
40
41
|
populate_by_name=True,
|
|
@@ -94,6 +95,7 @@ class PostCreateTweetRequestVariables(BaseModel):
|
|
|
94
95
|
|
|
95
96
|
_obj = cls.model_validate({
|
|
96
97
|
"dark_request": obj.get("dark_request") if obj.get("dark_request") is not None else False,
|
|
98
|
+
"disallowed_reply_options": obj.get("disallowed_reply_options") if obj.get("disallowed_reply_options") is not None else False,
|
|
97
99
|
"media": PostCreateTweetRequestVariablesMedia.from_dict(obj["media"]) if obj.get("media") is not None else None,
|
|
98
100
|
"reply": PostCreateTweetRequestVariablesReply.from_dict(obj["reply"]) if obj.get("reply") is not None else None,
|
|
99
101
|
"semantic_annotation_ids": obj.get("semantic_annotation_ids"),
|
|
@@ -74,9 +74,9 @@ class PostCreateTweetRequestVariablesMedia(BaseModel):
|
|
|
74
74
|
# override the default output from pydantic by calling `to_dict()` of each item in media_entities (list)
|
|
75
75
|
_items = []
|
|
76
76
|
if self.media_entities:
|
|
77
|
-
for
|
|
78
|
-
if
|
|
79
|
-
_items.append(
|
|
77
|
+
for _item_media_entities in self.media_entities:
|
|
78
|
+
if _item_media_entities:
|
|
79
|
+
_items.append(_item_media_entities.to_dict())
|
|
80
80
|
_dict['media_entities'] = _items
|
|
81
81
|
return _dict
|
|
82
82
|
|