twitter-openapi-python-generated 0.0.28__py3-none-any.whl → 0.0.30__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 +10 -1
- twitter_openapi_python_generated/api/default_api.py +0 -335
- twitter_openapi_python_generated/api_client.py +2 -2
- twitter_openapi_python_generated/configuration.py +10 -3
- twitter_openapi_python_generated/exceptions.py +17 -0
- twitter_openapi_python_generated/models/__init__.py +9 -0
- 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/item_content_union.py +46 -8
- twitter_openapi_python_generated/models/module_item.py +5 -3
- twitter_openapi_python_generated/models/thumbnail_image.py +92 -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_trend.py +130 -0
- 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_image.py +88 -0
- twitter_openapi_python_generated/models/trend_metadata.py +92 -0
- twitter_openapi_python_generated/models/tweet.py +3 -1
- twitter_openapi_python_generated/models/type_name.py +1 -0
- twitter_openapi_python_generated/models/user.py +13 -1
- twitter_openapi_python_generated/rest.py +1 -0
- {twitter_openapi_python_generated-0.0.28.dist-info → twitter_openapi_python_generated-0.0.30.dist-info}/METADATA +1 -1
- {twitter_openapi_python_generated-0.0.28.dist-info → twitter_openapi_python_generated-0.0.30.dist-info}/RECORD +30 -21
- {twitter_openapi_python_generated-0.0.28.dist-info → twitter_openapi_python_generated-0.0.30.dist-info}/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.28.dist-info → twitter_openapi_python_generated-0.0.30.dist-info}/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.28.dist-info → twitter_openapi_python_generated-0.0.30.dist-info}/WHEEL +0 -0
- {twitter_openapi_python_generated-0.0.28.dist-info → twitter_openapi_python_generated-0.0.30.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.30"
|
|
19
19
|
|
|
20
20
|
# import apis into sdk package
|
|
21
21
|
from twitter_openapi_python_generated.api.default_api import DefaultApi
|
|
@@ -206,6 +206,7 @@ from twitter_openapi_python_generated.models.text import Text
|
|
|
206
206
|
from twitter_openapi_python_generated.models.text_entity import TextEntity
|
|
207
207
|
from twitter_openapi_python_generated.models.text_entity_ref import TextEntityRef
|
|
208
208
|
from twitter_openapi_python_generated.models.text_highlight import TextHighlight
|
|
209
|
+
from twitter_openapi_python_generated.models.thumbnail_image import ThumbnailImage
|
|
209
210
|
from twitter_openapi_python_generated.models.timeline import Timeline
|
|
210
211
|
from twitter_openapi_python_generated.models.timeline_add_entries import TimelineAddEntries
|
|
211
212
|
from twitter_openapi_python_generated.models.timeline_add_entry import TimelineAddEntry
|
|
@@ -228,13 +229,21 @@ from twitter_openapi_python_generated.models.timeline_terminate_timeline import
|
|
|
228
229
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
229
230
|
from twitter_openapi_python_generated.models.timeline_timeline_item import TimelineTimelineItem
|
|
230
231
|
from twitter_openapi_python_generated.models.timeline_timeline_module import TimelineTimelineModule
|
|
232
|
+
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone
|
|
231
233
|
from twitter_openapi_python_generated.models.timeline_topic_context import TimelineTopicContext
|
|
234
|
+
from twitter_openapi_python_generated.models.timeline_trend import TimelineTrend
|
|
232
235
|
from twitter_openapi_python_generated.models.timeline_tweet import TimelineTweet
|
|
233
236
|
from twitter_openapi_python_generated.models.timeline_user import TimelineUser
|
|
234
237
|
from twitter_openapi_python_generated.models.timeline_v2 import TimelineV2
|
|
235
238
|
from twitter_openapi_python_generated.models.timestamp import Timestamp
|
|
239
|
+
from twitter_openapi_python_generated.models.tombstone_entity import TombstoneEntity
|
|
240
|
+
from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo
|
|
241
|
+
from twitter_openapi_python_generated.models.tombstone_ref import TombstoneRef
|
|
242
|
+
from twitter_openapi_python_generated.models.tombstone_rich_text import TombstoneRichText
|
|
236
243
|
from twitter_openapi_python_generated.models.topic_context import TopicContext
|
|
237
244
|
from twitter_openapi_python_generated.models.tracing import Tracing
|
|
245
|
+
from twitter_openapi_python_generated.models.trend_image import TrendImage
|
|
246
|
+
from twitter_openapi_python_generated.models.trend_metadata import TrendMetadata
|
|
238
247
|
from twitter_openapi_python_generated.models.trend_results import TrendResults
|
|
239
248
|
from twitter_openapi_python_generated.models.tweet import Tweet
|
|
240
249
|
from twitter_openapi_python_generated.models.tweet_card import TweetCard
|
|
@@ -19,7 +19,6 @@ from typing_extensions import Annotated
|
|
|
19
19
|
|
|
20
20
|
from pydantic import StrictStr
|
|
21
21
|
from twitter_openapi_python_generated.models.profile_response import ProfileResponse
|
|
22
|
-
from twitter_openapi_python_generated.models.tweet_result_by_rest_id_response import TweetResultByRestIdResponse
|
|
23
22
|
|
|
24
23
|
from twitter_openapi_python_generated.api_client import ApiClient, RequestSerialized
|
|
25
24
|
from twitter_openapi_python_generated.api_response import ApiResponse
|
|
@@ -354,337 +353,3 @@ class DefaultApi:
|
|
|
354
353
|
)
|
|
355
354
|
|
|
356
355
|
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
@validate_call
|
|
360
|
-
def get_tweet_result_by_rest_id(
|
|
361
|
-
self,
|
|
362
|
-
path_query_id: StrictStr,
|
|
363
|
-
variables: StrictStr,
|
|
364
|
-
features: StrictStr,
|
|
365
|
-
field_toggles: StrictStr,
|
|
366
|
-
_request_timeout: Union[
|
|
367
|
-
None,
|
|
368
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
369
|
-
Tuple[
|
|
370
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
371
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
372
|
-
]
|
|
373
|
-
] = None,
|
|
374
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
375
|
-
_content_type: Optional[StrictStr] = None,
|
|
376
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
377
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
378
|
-
) -> TweetResultByRestIdResponse:
|
|
379
|
-
"""get_tweet_result_by_rest_id
|
|
380
|
-
|
|
381
|
-
get TweetResultByRestId
|
|
382
|
-
|
|
383
|
-
:param path_query_id: (required)
|
|
384
|
-
:type path_query_id: str
|
|
385
|
-
:param variables: (required)
|
|
386
|
-
:type variables: str
|
|
387
|
-
:param features: (required)
|
|
388
|
-
:type features: str
|
|
389
|
-
:param field_toggles: (required)
|
|
390
|
-
:type field_toggles: str
|
|
391
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
392
|
-
number provided, it will be total request
|
|
393
|
-
timeout. It can also be a pair (tuple) of
|
|
394
|
-
(connection, read) timeouts.
|
|
395
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
396
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
397
|
-
request; this effectively ignores the
|
|
398
|
-
authentication in the spec for a single request.
|
|
399
|
-
:type _request_auth: dict, optional
|
|
400
|
-
:param _content_type: force content-type for the request.
|
|
401
|
-
:type _content_type: str, Optional
|
|
402
|
-
:param _headers: set to override the headers for a single
|
|
403
|
-
request; this effectively ignores the headers
|
|
404
|
-
in the spec for a single request.
|
|
405
|
-
:type _headers: dict, optional
|
|
406
|
-
:param _host_index: set to override the host_index for a single
|
|
407
|
-
request; this effectively ignores the host_index
|
|
408
|
-
in the spec for a single request.
|
|
409
|
-
:type _host_index: int, optional
|
|
410
|
-
:return: Returns the result object.
|
|
411
|
-
""" # noqa: E501
|
|
412
|
-
|
|
413
|
-
_param = self._get_tweet_result_by_rest_id_serialize(
|
|
414
|
-
path_query_id=path_query_id,
|
|
415
|
-
variables=variables,
|
|
416
|
-
features=features,
|
|
417
|
-
field_toggles=field_toggles,
|
|
418
|
-
_request_auth=_request_auth,
|
|
419
|
-
_content_type=_content_type,
|
|
420
|
-
_headers=_headers,
|
|
421
|
-
_host_index=_host_index
|
|
422
|
-
)
|
|
423
|
-
|
|
424
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
425
|
-
'200': "TweetResultByRestIdResponse",
|
|
426
|
-
}
|
|
427
|
-
response_data = self.api_client.call_api(
|
|
428
|
-
*_param,
|
|
429
|
-
_request_timeout=_request_timeout
|
|
430
|
-
)
|
|
431
|
-
response_data.read()
|
|
432
|
-
return self.api_client.response_deserialize(
|
|
433
|
-
response_data=response_data,
|
|
434
|
-
response_types_map=_response_types_map,
|
|
435
|
-
).data
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
@validate_call
|
|
439
|
-
def get_tweet_result_by_rest_id_with_http_info(
|
|
440
|
-
self,
|
|
441
|
-
path_query_id: StrictStr,
|
|
442
|
-
variables: StrictStr,
|
|
443
|
-
features: StrictStr,
|
|
444
|
-
field_toggles: StrictStr,
|
|
445
|
-
_request_timeout: Union[
|
|
446
|
-
None,
|
|
447
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
448
|
-
Tuple[
|
|
449
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
450
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
451
|
-
]
|
|
452
|
-
] = None,
|
|
453
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
454
|
-
_content_type: Optional[StrictStr] = None,
|
|
455
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
456
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
457
|
-
) -> ApiResponse[TweetResultByRestIdResponse]:
|
|
458
|
-
"""get_tweet_result_by_rest_id
|
|
459
|
-
|
|
460
|
-
get TweetResultByRestId
|
|
461
|
-
|
|
462
|
-
:param path_query_id: (required)
|
|
463
|
-
:type path_query_id: str
|
|
464
|
-
:param variables: (required)
|
|
465
|
-
:type variables: str
|
|
466
|
-
:param features: (required)
|
|
467
|
-
:type features: str
|
|
468
|
-
:param field_toggles: (required)
|
|
469
|
-
:type field_toggles: str
|
|
470
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
471
|
-
number provided, it will be total request
|
|
472
|
-
timeout. It can also be a pair (tuple) of
|
|
473
|
-
(connection, read) timeouts.
|
|
474
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
475
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
476
|
-
request; this effectively ignores the
|
|
477
|
-
authentication in the spec for a single request.
|
|
478
|
-
:type _request_auth: dict, optional
|
|
479
|
-
:param _content_type: force content-type for the request.
|
|
480
|
-
:type _content_type: str, Optional
|
|
481
|
-
:param _headers: set to override the headers for a single
|
|
482
|
-
request; this effectively ignores the headers
|
|
483
|
-
in the spec for a single request.
|
|
484
|
-
:type _headers: dict, optional
|
|
485
|
-
:param _host_index: set to override the host_index for a single
|
|
486
|
-
request; this effectively ignores the host_index
|
|
487
|
-
in the spec for a single request.
|
|
488
|
-
:type _host_index: int, optional
|
|
489
|
-
:return: Returns the result object.
|
|
490
|
-
""" # noqa: E501
|
|
491
|
-
|
|
492
|
-
_param = self._get_tweet_result_by_rest_id_serialize(
|
|
493
|
-
path_query_id=path_query_id,
|
|
494
|
-
variables=variables,
|
|
495
|
-
features=features,
|
|
496
|
-
field_toggles=field_toggles,
|
|
497
|
-
_request_auth=_request_auth,
|
|
498
|
-
_content_type=_content_type,
|
|
499
|
-
_headers=_headers,
|
|
500
|
-
_host_index=_host_index
|
|
501
|
-
)
|
|
502
|
-
|
|
503
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
504
|
-
'200': "TweetResultByRestIdResponse",
|
|
505
|
-
}
|
|
506
|
-
response_data = self.api_client.call_api(
|
|
507
|
-
*_param,
|
|
508
|
-
_request_timeout=_request_timeout
|
|
509
|
-
)
|
|
510
|
-
response_data.read()
|
|
511
|
-
return self.api_client.response_deserialize(
|
|
512
|
-
response_data=response_data,
|
|
513
|
-
response_types_map=_response_types_map,
|
|
514
|
-
)
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
@validate_call
|
|
518
|
-
def get_tweet_result_by_rest_id_without_preload_content(
|
|
519
|
-
self,
|
|
520
|
-
path_query_id: StrictStr,
|
|
521
|
-
variables: StrictStr,
|
|
522
|
-
features: StrictStr,
|
|
523
|
-
field_toggles: StrictStr,
|
|
524
|
-
_request_timeout: Union[
|
|
525
|
-
None,
|
|
526
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
527
|
-
Tuple[
|
|
528
|
-
Annotated[StrictFloat, Field(gt=0)],
|
|
529
|
-
Annotated[StrictFloat, Field(gt=0)]
|
|
530
|
-
]
|
|
531
|
-
] = None,
|
|
532
|
-
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
533
|
-
_content_type: Optional[StrictStr] = None,
|
|
534
|
-
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
535
|
-
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
536
|
-
) -> RESTResponseType:
|
|
537
|
-
"""get_tweet_result_by_rest_id
|
|
538
|
-
|
|
539
|
-
get TweetResultByRestId
|
|
540
|
-
|
|
541
|
-
:param path_query_id: (required)
|
|
542
|
-
:type path_query_id: str
|
|
543
|
-
:param variables: (required)
|
|
544
|
-
:type variables: str
|
|
545
|
-
:param features: (required)
|
|
546
|
-
:type features: str
|
|
547
|
-
:param field_toggles: (required)
|
|
548
|
-
:type field_toggles: str
|
|
549
|
-
:param _request_timeout: timeout setting for this request. If one
|
|
550
|
-
number provided, it will be total request
|
|
551
|
-
timeout. It can also be a pair (tuple) of
|
|
552
|
-
(connection, read) timeouts.
|
|
553
|
-
:type _request_timeout: int, tuple(int, int), optional
|
|
554
|
-
:param _request_auth: set to override the auth_settings for an a single
|
|
555
|
-
request; this effectively ignores the
|
|
556
|
-
authentication in the spec for a single request.
|
|
557
|
-
:type _request_auth: dict, optional
|
|
558
|
-
:param _content_type: force content-type for the request.
|
|
559
|
-
:type _content_type: str, Optional
|
|
560
|
-
:param _headers: set to override the headers for a single
|
|
561
|
-
request; this effectively ignores the headers
|
|
562
|
-
in the spec for a single request.
|
|
563
|
-
:type _headers: dict, optional
|
|
564
|
-
:param _host_index: set to override the host_index for a single
|
|
565
|
-
request; this effectively ignores the host_index
|
|
566
|
-
in the spec for a single request.
|
|
567
|
-
:type _host_index: int, optional
|
|
568
|
-
:return: Returns the result object.
|
|
569
|
-
""" # noqa: E501
|
|
570
|
-
|
|
571
|
-
_param = self._get_tweet_result_by_rest_id_serialize(
|
|
572
|
-
path_query_id=path_query_id,
|
|
573
|
-
variables=variables,
|
|
574
|
-
features=features,
|
|
575
|
-
field_toggles=field_toggles,
|
|
576
|
-
_request_auth=_request_auth,
|
|
577
|
-
_content_type=_content_type,
|
|
578
|
-
_headers=_headers,
|
|
579
|
-
_host_index=_host_index
|
|
580
|
-
)
|
|
581
|
-
|
|
582
|
-
_response_types_map: Dict[str, Optional[str]] = {
|
|
583
|
-
'200': "TweetResultByRestIdResponse",
|
|
584
|
-
}
|
|
585
|
-
response_data = self.api_client.call_api(
|
|
586
|
-
*_param,
|
|
587
|
-
_request_timeout=_request_timeout
|
|
588
|
-
)
|
|
589
|
-
return response_data.response
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
def _get_tweet_result_by_rest_id_serialize(
|
|
593
|
-
self,
|
|
594
|
-
path_query_id,
|
|
595
|
-
variables,
|
|
596
|
-
features,
|
|
597
|
-
field_toggles,
|
|
598
|
-
_request_auth,
|
|
599
|
-
_content_type,
|
|
600
|
-
_headers,
|
|
601
|
-
_host_index,
|
|
602
|
-
) -> RequestSerialized:
|
|
603
|
-
|
|
604
|
-
_host = None
|
|
605
|
-
|
|
606
|
-
_collection_formats: Dict[str, str] = {
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
_path_params: Dict[str, str] = {}
|
|
610
|
-
_query_params: List[Tuple[str, str]] = []
|
|
611
|
-
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
612
|
-
_form_params: List[Tuple[str, str]] = []
|
|
613
|
-
_files: Dict[
|
|
614
|
-
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
615
|
-
] = {}
|
|
616
|
-
_body_params: Optional[bytes] = None
|
|
617
|
-
|
|
618
|
-
# process the path parameters
|
|
619
|
-
if path_query_id is not None:
|
|
620
|
-
_path_params['pathQueryId'] = path_query_id
|
|
621
|
-
# process the query parameters
|
|
622
|
-
if variables is not None:
|
|
623
|
-
|
|
624
|
-
_query_params.append(('variables', variables))
|
|
625
|
-
|
|
626
|
-
if features is not None:
|
|
627
|
-
|
|
628
|
-
_query_params.append(('features', features))
|
|
629
|
-
|
|
630
|
-
if field_toggles is not None:
|
|
631
|
-
|
|
632
|
-
_query_params.append(('fieldToggles', field_toggles))
|
|
633
|
-
|
|
634
|
-
# process the header parameters
|
|
635
|
-
# process the form parameters
|
|
636
|
-
# process the body parameter
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
# set the HTTP header `Accept`
|
|
640
|
-
if 'Accept' not in _header_params:
|
|
641
|
-
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
642
|
-
[
|
|
643
|
-
'application/json'
|
|
644
|
-
]
|
|
645
|
-
)
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
# authentication setting
|
|
649
|
-
_auth_settings: List[str] = [
|
|
650
|
-
'Accept',
|
|
651
|
-
'ClientLanguage',
|
|
652
|
-
'Priority',
|
|
653
|
-
'Referer',
|
|
654
|
-
'SecFetchDest',
|
|
655
|
-
'SecChUaPlatform',
|
|
656
|
-
'SecFetchMode',
|
|
657
|
-
'CsrfToken',
|
|
658
|
-
'ClientUuid',
|
|
659
|
-
'BearerAuth',
|
|
660
|
-
'GuestToken',
|
|
661
|
-
'SecChUa',
|
|
662
|
-
'CookieGt0',
|
|
663
|
-
'ClientTransactionId',
|
|
664
|
-
'ActiveUser',
|
|
665
|
-
'CookieCt0',
|
|
666
|
-
'UserAgent',
|
|
667
|
-
'AcceptLanguage',
|
|
668
|
-
'SecFetchSite',
|
|
669
|
-
'AuthType',
|
|
670
|
-
'CookieAuthToken',
|
|
671
|
-
'SecChUaMobile',
|
|
672
|
-
'AcceptEncoding'
|
|
673
|
-
]
|
|
674
|
-
|
|
675
|
-
return self.api_client.param_serialize(
|
|
676
|
-
method='GET',
|
|
677
|
-
resource_path='/graphql/{pathQueryId}/TweetResultByRestId',
|
|
678
|
-
path_params=_path_params,
|
|
679
|
-
query_params=_query_params,
|
|
680
|
-
header_params=_header_params,
|
|
681
|
-
body=_body_params,
|
|
682
|
-
post_params=_form_params,
|
|
683
|
-
files=_files,
|
|
684
|
-
auth_settings=_auth_settings,
|
|
685
|
-
collection_formats=_collection_formats,
|
|
686
|
-
_host=_host,
|
|
687
|
-
_request_auth=_request_auth
|
|
688
|
-
)
|
|
689
|
-
|
|
690
|
-
|
|
@@ -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.30/python'
|
|
95
95
|
self.client_side_validation = configuration.client_side_validation
|
|
96
96
|
|
|
97
97
|
def __enter__(self):
|
|
@@ -518,7 +518,7 @@ class ApiClient:
|
|
|
518
518
|
if k in collection_formats:
|
|
519
519
|
collection_format = collection_formats[k]
|
|
520
520
|
if collection_format == 'multi':
|
|
521
|
-
new_params.extend((k, str(value)) for value in v)
|
|
521
|
+
new_params.extend((k, quote(str(value))) for value in v)
|
|
522
522
|
else:
|
|
523
523
|
if collection_format == 'ssv':
|
|
524
524
|
delimiter = ' '
|
|
@@ -19,7 +19,7 @@ import logging
|
|
|
19
19
|
from logging import FileHandler
|
|
20
20
|
import multiprocessing
|
|
21
21
|
import sys
|
|
22
|
-
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union
|
|
23
23
|
from typing_extensions import NotRequired, Self
|
|
24
24
|
|
|
25
25
|
import urllib3
|
|
@@ -184,6 +184,8 @@ class Configuration:
|
|
|
184
184
|
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
|
|
185
185
|
in PEM format.
|
|
186
186
|
:param retries: Number of retries for API requests.
|
|
187
|
+
:param ca_cert_data: verify the peer using concatenated CA certificate data
|
|
188
|
+
in PEM (str) or DER (bytes) format.
|
|
187
189
|
|
|
188
190
|
:Example:
|
|
189
191
|
|
|
@@ -217,13 +219,14 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
217
219
|
username: Optional[str]=None,
|
|
218
220
|
password: Optional[str]=None,
|
|
219
221
|
access_token: Optional[str]=None,
|
|
220
|
-
server_index: Optional[int]=None,
|
|
222
|
+
server_index: Optional[int]=None,
|
|
221
223
|
server_variables: Optional[ServerVariablesT]=None,
|
|
222
224
|
server_operation_index: Optional[Dict[int, int]]=None,
|
|
223
225
|
server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None,
|
|
224
226
|
ignore_operation_servers: bool=False,
|
|
225
227
|
ssl_ca_cert: Optional[str]=None,
|
|
226
228
|
retries: Optional[int] = None,
|
|
229
|
+
ca_cert_data: Optional[Union[str, bytes]] = None,
|
|
227
230
|
*,
|
|
228
231
|
debug: Optional[bool] = None,
|
|
229
232
|
) -> None:
|
|
@@ -301,6 +304,10 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
301
304
|
self.ssl_ca_cert = ssl_ca_cert
|
|
302
305
|
"""Set this to customize the certificate file to verify the peer.
|
|
303
306
|
"""
|
|
307
|
+
self.ca_cert_data = ca_cert_data
|
|
308
|
+
"""Set this to verify the peer using PEM (str) or DER (bytes)
|
|
309
|
+
certificate data.
|
|
310
|
+
"""
|
|
304
311
|
self.cert_file = None
|
|
305
312
|
"""client certificate file
|
|
306
313
|
"""
|
|
@@ -743,7 +750,7 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
743
750
|
"OS: {env}\n"\
|
|
744
751
|
"Python Version: {pyversion}\n"\
|
|
745
752
|
"Version of the API: 0.0.1\n"\
|
|
746
|
-
"SDK Package Version: 0.0.
|
|
753
|
+
"SDK Package Version: 0.0.30".\
|
|
747
754
|
format(env=sys.platform, pyversion=sys.version)
|
|
748
755
|
|
|
749
756
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -151,6 +151,13 @@ class ApiException(OpenApiException):
|
|
|
151
151
|
if http_resp.status == 404:
|
|
152
152
|
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
153
153
|
|
|
154
|
+
# Added new conditions for 409 and 422
|
|
155
|
+
if http_resp.status == 409:
|
|
156
|
+
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
157
|
+
|
|
158
|
+
if http_resp.status == 422:
|
|
159
|
+
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
160
|
+
|
|
154
161
|
if 500 <= http_resp.status <= 599:
|
|
155
162
|
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
156
163
|
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
@@ -189,6 +196,16 @@ class ServiceException(ApiException):
|
|
|
189
196
|
pass
|
|
190
197
|
|
|
191
198
|
|
|
199
|
+
class ConflictException(ApiException):
|
|
200
|
+
"""Exception for HTTP 409 Conflict."""
|
|
201
|
+
pass
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
class UnprocessableEntityException(ApiException):
|
|
205
|
+
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
|
|
192
209
|
def render_path(path_to_item):
|
|
193
210
|
"""Returns a string representation of a path"""
|
|
194
211
|
result = ""
|
|
@@ -180,6 +180,7 @@ from twitter_openapi_python_generated.models.text import Text
|
|
|
180
180
|
from twitter_openapi_python_generated.models.text_entity import TextEntity
|
|
181
181
|
from twitter_openapi_python_generated.models.text_entity_ref import TextEntityRef
|
|
182
182
|
from twitter_openapi_python_generated.models.text_highlight import TextHighlight
|
|
183
|
+
from twitter_openapi_python_generated.models.thumbnail_image import ThumbnailImage
|
|
183
184
|
from twitter_openapi_python_generated.models.timeline import Timeline
|
|
184
185
|
from twitter_openapi_python_generated.models.timeline_add_entries import TimelineAddEntries
|
|
185
186
|
from twitter_openapi_python_generated.models.timeline_add_entry import TimelineAddEntry
|
|
@@ -202,13 +203,21 @@ from twitter_openapi_python_generated.models.timeline_terminate_timeline import
|
|
|
202
203
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
203
204
|
from twitter_openapi_python_generated.models.timeline_timeline_item import TimelineTimelineItem
|
|
204
205
|
from twitter_openapi_python_generated.models.timeline_timeline_module import TimelineTimelineModule
|
|
206
|
+
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone
|
|
205
207
|
from twitter_openapi_python_generated.models.timeline_topic_context import TimelineTopicContext
|
|
208
|
+
from twitter_openapi_python_generated.models.timeline_trend import TimelineTrend
|
|
206
209
|
from twitter_openapi_python_generated.models.timeline_tweet import TimelineTweet
|
|
207
210
|
from twitter_openapi_python_generated.models.timeline_user import TimelineUser
|
|
208
211
|
from twitter_openapi_python_generated.models.timeline_v2 import TimelineV2
|
|
209
212
|
from twitter_openapi_python_generated.models.timestamp import Timestamp
|
|
213
|
+
from twitter_openapi_python_generated.models.tombstone_entity import TombstoneEntity
|
|
214
|
+
from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo
|
|
215
|
+
from twitter_openapi_python_generated.models.tombstone_ref import TombstoneRef
|
|
216
|
+
from twitter_openapi_python_generated.models.tombstone_rich_text import TombstoneRichText
|
|
210
217
|
from twitter_openapi_python_generated.models.topic_context import TopicContext
|
|
211
218
|
from twitter_openapi_python_generated.models.tracing import Tracing
|
|
219
|
+
from twitter_openapi_python_generated.models.trend_image import TrendImage
|
|
220
|
+
from twitter_openapi_python_generated.models.trend_metadata import TrendMetadata
|
|
212
221
|
from twitter_openapi_python_generated.models.trend_results import TrendResults
|
|
213
222
|
from twitter_openapi_python_generated.models.tweet import Tweet
|
|
214
223
|
from twitter_openapi_python_generated.models.tweet_card import TweetCard
|
|
@@ -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
|
|
@@ -22,13 +22,15 @@ 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
|
|
26
|
+
from twitter_openapi_python_generated.models.timeline_trend import TimelineTrend
|
|
25
27
|
from twitter_openapi_python_generated.models.timeline_tweet import TimelineTweet
|
|
26
28
|
from twitter_openapi_python_generated.models.timeline_user import TimelineUser
|
|
27
29
|
from pydantic import StrictStr, Field
|
|
28
30
|
from typing import Union, List, Set, Optional, Dict
|
|
29
31
|
from typing_extensions import Literal, Self
|
|
30
32
|
|
|
31
|
-
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineMessagePrompt", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTweet", "TimelineUser"]
|
|
33
|
+
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineMessagePrompt", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineUser"]
|
|
32
34
|
|
|
33
35
|
class ItemContentUnion(BaseModel):
|
|
34
36
|
"""
|
|
@@ -46,8 +48,12 @@ class ItemContentUnion(BaseModel):
|
|
|
46
48
|
oneof_schema_5_validator: Optional[TimelineMessagePrompt] = None
|
|
47
49
|
# data type: TimelineCommunity
|
|
48
50
|
oneof_schema_6_validator: Optional[TimelineCommunity] = None
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
# data type: TimelineTombstone
|
|
52
|
+
oneof_schema_7_validator: Optional[TimelineTombstone] = None
|
|
53
|
+
# data type: TimelineTrend
|
|
54
|
+
oneof_schema_8_validator: Optional[TimelineTrend] = None
|
|
55
|
+
actual_instance: Optional[Union[TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser]] = None
|
|
56
|
+
one_of_schemas: Set[str] = { "TimelineCommunity", "TimelineMessagePrompt", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineUser" }
|
|
51
57
|
|
|
52
58
|
model_config = ConfigDict(
|
|
53
59
|
validate_assignment=True,
|
|
@@ -103,12 +109,22 @@ class ItemContentUnion(BaseModel):
|
|
|
103
109
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineCommunity`")
|
|
104
110
|
else:
|
|
105
111
|
match += 1
|
|
112
|
+
# validate data type: TimelineTombstone
|
|
113
|
+
if not isinstance(v, TimelineTombstone):
|
|
114
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineTombstone`")
|
|
115
|
+
else:
|
|
116
|
+
match += 1
|
|
117
|
+
# validate data type: TimelineTrend
|
|
118
|
+
if not isinstance(v, TimelineTrend):
|
|
119
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineTrend`")
|
|
120
|
+
else:
|
|
121
|
+
match += 1
|
|
106
122
|
if match > 1:
|
|
107
123
|
# 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))
|
|
124
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
109
125
|
elif match == 0:
|
|
110
126
|
# 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))
|
|
127
|
+
raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
112
128
|
else:
|
|
113
129
|
return v
|
|
114
130
|
|
|
@@ -148,6 +164,16 @@ class ItemContentUnion(BaseModel):
|
|
|
148
164
|
instance.actual_instance = TimelineTimelineCursor.from_json(json_str)
|
|
149
165
|
return instance
|
|
150
166
|
|
|
167
|
+
# check if data type is `TimelineTombstone`
|
|
168
|
+
if _data_type == "TimelineTombstone":
|
|
169
|
+
instance.actual_instance = TimelineTombstone.from_json(json_str)
|
|
170
|
+
return instance
|
|
171
|
+
|
|
172
|
+
# check if data type is `TimelineTrend`
|
|
173
|
+
if _data_type == "TimelineTrend":
|
|
174
|
+
instance.actual_instance = TimelineTrend.from_json(json_str)
|
|
175
|
+
return instance
|
|
176
|
+
|
|
151
177
|
# check if data type is `TimelineTweet`
|
|
152
178
|
if _data_type == "TimelineTweet":
|
|
153
179
|
instance.actual_instance = TimelineTweet.from_json(json_str)
|
|
@@ -194,13 +220,25 @@ class ItemContentUnion(BaseModel):
|
|
|
194
220
|
match += 1
|
|
195
221
|
except (ValidationError, ValueError) as e:
|
|
196
222
|
error_messages.append(str(e))
|
|
223
|
+
# deserialize data into TimelineTombstone
|
|
224
|
+
try:
|
|
225
|
+
instance.actual_instance = TimelineTombstone.from_json(json_str)
|
|
226
|
+
match += 1
|
|
227
|
+
except (ValidationError, ValueError) as e:
|
|
228
|
+
error_messages.append(str(e))
|
|
229
|
+
# deserialize data into TimelineTrend
|
|
230
|
+
try:
|
|
231
|
+
instance.actual_instance = TimelineTrend.from_json(json_str)
|
|
232
|
+
match += 1
|
|
233
|
+
except (ValidationError, ValueError) as e:
|
|
234
|
+
error_messages.append(str(e))
|
|
197
235
|
|
|
198
236
|
if match > 1:
|
|
199
237
|
# 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))
|
|
238
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
201
239
|
elif match == 0:
|
|
202
240
|
# 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))
|
|
241
|
+
raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
204
242
|
else:
|
|
205
243
|
return instance
|
|
206
244
|
|
|
@@ -214,7 +252,7 @@ class ItemContentUnion(BaseModel):
|
|
|
214
252
|
else:
|
|
215
253
|
return json.dumps(self.actual_instance)
|
|
216
254
|
|
|
217
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTweet, TimelineUser]]:
|
|
255
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser]]:
|
|
218
256
|
"""Returns the dict representation of the actual instance"""
|
|
219
257
|
if self.actual_instance is None:
|
|
220
258
|
return None
|