twitter-openapi-python-generated 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. twitter_openapi_python_generated/__init__.py +107 -1
  2. twitter_openapi_python_generated/api/default_api.py +1437 -199
  3. twitter_openapi_python_generated/api/user_api.py +301 -0
  4. twitter_openapi_python_generated/api/users_api.py +318 -0
  5. twitter_openapi_python_generated/api_client.py +1 -1
  6. twitter_openapi_python_generated/configuration.py +1 -1
  7. twitter_openapi_python_generated/models/__init__.py +53 -0
  8. twitter_openapi_python_generated/models/about_account_data.py +93 -0
  9. twitter_openapi_python_generated/models/about_account_response.py +102 -0
  10. twitter_openapi_python_generated/models/about_account_user.py +161 -0
  11. twitter_openapi_python_generated/models/about_account_user_result.py +95 -0
  12. twitter_openapi_python_generated/models/about_account_verification_info.py +95 -0
  13. twitter_openapi_python_generated/models/about_account_verification_info_reason.py +99 -0
  14. twitter_openapi_python_generated/models/about_profile.py +103 -0
  15. twitter_openapi_python_generated/models/about_profile_username_changes.py +109 -0
  16. twitter_openapi_python_generated/models/ai_trend.py +126 -0
  17. twitter_openapi_python_generated/models/ai_trend_core.py +95 -0
  18. twitter_openapi_python_generated/models/ai_trend_results.py +95 -0
  19. twitter_openapi_python_generated/models/ai_trend_social_proof.py +89 -0
  20. twitter_openapi_python_generated/models/article_content_block.py +117 -0
  21. twitter_openapi_python_generated/models/article_content_block_data.py +104 -0
  22. twitter_openapi_python_generated/models/article_content_entity.py +95 -0
  23. twitter_openapi_python_generated/models/article_content_entity_data.py +115 -0
  24. twitter_openapi_python_generated/models/article_content_entity_range.py +93 -0
  25. twitter_openapi_python_generated/models/article_content_entity_value.py +104 -0
  26. twitter_openapi_python_generated/models/article_content_inline_style_range.py +100 -0
  27. twitter_openapi_python_generated/models/article_content_media_item.py +101 -0
  28. twitter_openapi_python_generated/models/article_content_state.py +105 -0
  29. twitter_openapi_python_generated/models/article_content_text_range.py +93 -0
  30. twitter_openapi_python_generated/models/article_result.py +9 -3
  31. twitter_openapi_python_generated/models/audio_space.py +107 -0
  32. twitter_openapi_python_generated/models/audio_space_data.py +93 -0
  33. twitter_openapi_python_generated/models/audio_space_mentioned_user.py +97 -0
  34. twitter_openapi_python_generated/models/audio_space_metadata.py +165 -0
  35. twitter_openapi_python_generated/models/audio_space_participant.py +109 -0
  36. twitter_openapi_python_generated/models/audio_space_participant_user.py +104 -0
  37. twitter_openapi_python_generated/models/audio_space_participant_user_results.py +103 -0
  38. twitter_openapi_python_generated/models/audio_space_participant_verification.py +99 -0
  39. twitter_openapi_python_generated/models/audio_space_participants.py +114 -0
  40. twitter_openapi_python_generated/models/audio_space_response.py +102 -0
  41. twitter_openapi_python_generated/models/audio_space_sharings.py +91 -0
  42. twitter_openapi_python_generated/models/birdwatch_pivot.py +0 -17
  43. twitter_openapi_python_generated/models/broadcast.py +159 -0
  44. twitter_openapi_python_generated/models/broadcast_data.py +93 -0
  45. twitter_openapi_python_generated/models/broadcast_edited_replay.py +89 -0
  46. twitter_openapi_python_generated/models/broadcast_periscope_user.py +95 -0
  47. twitter_openapi_python_generated/models/broadcast_response.py +102 -0
  48. twitter_openapi_python_generated/models/cashtag_attachment.py +6 -4
  49. twitter_openapi_python_generated/models/community.py +2 -2
  50. twitter_openapi_python_generated/models/community_delete_action_result.py +1 -8
  51. twitter_openapi_python_generated/models/community_invites_result.py +1 -8
  52. twitter_openapi_python_generated/models/community_join_action_unavailable.py +1 -8
  53. twitter_openapi_python_generated/models/community_leave_action_result.py +1 -8
  54. twitter_openapi_python_generated/models/conversation_control.py +8 -1
  55. twitter_openapi_python_generated/models/conversation_details.py +1 -8
  56. twitter_openapi_python_generated/models/cover_cta.py +5 -15
  57. twitter_openapi_python_generated/models/cta_client_event_info.py +1 -8
  58. twitter_openapi_python_generated/models/cta_limited_action_prompt.py +1 -8
  59. twitter_openapi_python_generated/models/feedback_action.py +1 -21
  60. twitter_openapi_python_generated/models/grok_account_jwt.py +89 -0
  61. twitter_openapi_python_generated/models/grok_account_jwt_data.py +93 -0
  62. twitter_openapi_python_generated/models/grok_account_jwt_response.py +102 -0
  63. twitter_openapi_python_generated/models/grok_entity_ref.py +19 -4
  64. twitter_openapi_python_generated/models/grok_image_annotation.py +2 -2
  65. twitter_openapi_python_generated/models/identity_profile_labels_highlighted_label.py +93 -0
  66. twitter_openapi_python_generated/models/limited_action.py +8 -1
  67. twitter_openapi_python_generated/models/limited_action_results_data.py +8 -1
  68. twitter_openapi_python_generated/models/media_result.py +1 -1
  69. twitter_openapi_python_generated/models/module_header.py +8 -9
  70. twitter_openapi_python_generated/models/note_tweet_result_data.py +2 -2
  71. twitter_openapi_python_generated/models/session.py +0 -7
  72. twitter_openapi_python_generated/models/sidebar_user_recommendation.py +95 -0
  73. twitter_openapi_python_generated/models/sidebar_user_recommendations_data.py +96 -0
  74. twitter_openapi_python_generated/models/sidebar_user_recommendations_response.py +102 -0
  75. twitter_openapi_python_generated/models/story_topic.py +95 -0
  76. twitter_openapi_python_generated/models/story_topic_data.py +93 -0
  77. twitter_openapi_python_generated/models/story_topic_item.py +93 -0
  78. twitter_openapi_python_generated/models/story_topic_response.py +102 -0
  79. twitter_openapi_python_generated/models/story_topic_stories.py +96 -0
  80. twitter_openapi_python_generated/models/timeline_general_context.py +2 -2
  81. twitter_openapi_python_generated/models/timeline_half_cover.py +0 -7
  82. twitter_openapi_python_generated/models/timeline_message_prompt_content.py +1 -8
  83. twitter_openapi_python_generated/models/timeline_prompt_content.py +1 -15
  84. twitter_openapi_python_generated/models/timeline_show_alert.py +1 -15
  85. twitter_openapi_python_generated/models/timeline_tombstone.py +1 -11
  86. twitter_openapi_python_generated/models/timeline_topic_context.py +1 -11
  87. twitter_openapi_python_generated/models/tweet.py +4 -2
  88. twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +8 -1
  89. twitter_openapi_python_generated/models/tweet_card_platform_audience.py +1 -8
  90. twitter_openapi_python_generated/models/tweet_legacy.py +18 -3
  91. twitter_openapi_python_generated/models/tweet_legacy_place.py +107 -0
  92. twitter_openapi_python_generated/models/tweet_legacy_place_bounding_box.py +98 -0
  93. twitter_openapi_python_generated/models/tweet_legacy_point.py +98 -0
  94. twitter_openapi_python_generated/models/tweet_post_cta.py +1 -9
  95. twitter_openapi_python_generated/models/type_name.py +1 -0
  96. twitter_openapi_python_generated/models/unified_card.py +1 -8
  97. twitter_openapi_python_generated/models/user_highlights_tweets_result.py +2 -2
  98. twitter_openapi_python_generated/models/user_tweets_result_v1.py +2 -2
  99. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/METADATA +61 -2
  100. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/RECORD +104 -51
  101. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/WHEEL +0 -0
  102. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/licenses/LICENSE +0 -0
  103. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/licenses/LICENSE.AGPL +0 -0
  104. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/top_level.txt +0 -0
@@ -14,19 +14,41 @@
14
14
  """ # noqa: E501
15
15
 
16
16
  # import models into model package
17
+ from twitter_openapi_python_generated.models.about_account_data import AboutAccountData
18
+ from twitter_openapi_python_generated.models.about_account_response import AboutAccountResponse
19
+ from twitter_openapi_python_generated.models.about_account_user import AboutAccountUser
20
+ from twitter_openapi_python_generated.models.about_account_user_result import AboutAccountUserResult
21
+ from twitter_openapi_python_generated.models.about_account_verification_info import AboutAccountVerificationInfo
22
+ from twitter_openapi_python_generated.models.about_account_verification_info_reason import AboutAccountVerificationInfoReason
17
23
  from twitter_openapi_python_generated.models.about_community_result import AboutCommunityResult
18
24
  from twitter_openapi_python_generated.models.about_community_results import AboutCommunityResults
19
25
  from twitter_openapi_python_generated.models.about_community_tweet_data import AboutCommunityTweetData
26
+ from twitter_openapi_python_generated.models.about_profile import AboutProfile
27
+ from twitter_openapi_python_generated.models.about_profile_username_changes import AboutProfileUsernameChanges
20
28
  from twitter_openapi_python_generated.models.ad_metadata_container import AdMetadataContainer
21
29
  from twitter_openapi_python_generated.models.additional_media_info import AdditionalMediaInfo
22
30
  from twitter_openapi_python_generated.models.additional_media_info_call_to_actions import AdditionalMediaInfoCallToActions
23
31
  from twitter_openapi_python_generated.models.additional_media_info_call_to_actions_url import AdditionalMediaInfoCallToActionsUrl
24
32
  from twitter_openapi_python_generated.models.affiliates_highlighted_label import AffiliatesHighlightedLabel
33
+ from twitter_openapi_python_generated.models.ai_trend import AiTrend
34
+ from twitter_openapi_python_generated.models.ai_trend_core import AiTrendCore
35
+ from twitter_openapi_python_generated.models.ai_trend_results import AiTrendResults
36
+ from twitter_openapi_python_generated.models.ai_trend_social_proof import AiTrendSocialProof
25
37
  from twitter_openapi_python_generated.models.allow_download_status import AllowDownloadStatus
26
38
  from twitter_openapi_python_generated.models.analysis_results import AnalysisResults
27
39
  from twitter_openapi_python_generated.models.api_image import ApiImage
28
40
  from twitter_openapi_python_generated.models.api_media import ApiMedia
29
41
  from twitter_openapi_python_generated.models.article import Article
42
+ from twitter_openapi_python_generated.models.article_content_block import ArticleContentBlock
43
+ from twitter_openapi_python_generated.models.article_content_block_data import ArticleContentBlockData
44
+ from twitter_openapi_python_generated.models.article_content_entity import ArticleContentEntity
45
+ from twitter_openapi_python_generated.models.article_content_entity_data import ArticleContentEntityData
46
+ from twitter_openapi_python_generated.models.article_content_entity_range import ArticleContentEntityRange
47
+ from twitter_openapi_python_generated.models.article_content_entity_value import ArticleContentEntityValue
48
+ from twitter_openapi_python_generated.models.article_content_inline_style_range import ArticleContentInlineStyleRange
49
+ from twitter_openapi_python_generated.models.article_content_media_item import ArticleContentMediaItem
50
+ from twitter_openapi_python_generated.models.article_content_state import ArticleContentState
51
+ from twitter_openapi_python_generated.models.article_content_text_range import ArticleContentTextRange
30
52
  from twitter_openapi_python_generated.models.article_cover_media import ArticleCoverMedia
31
53
  from twitter_openapi_python_generated.models.article_cover_media_info import ArticleCoverMediaInfo
32
54
  from twitter_openapi_python_generated.models.article_lifecycle_state import ArticleLifecycleState
@@ -34,6 +56,17 @@ from twitter_openapi_python_generated.models.article_metadata import ArticleMeta
34
56
  from twitter_openapi_python_generated.models.article_preview import ArticlePreview
35
57
  from twitter_openapi_python_generated.models.article_result import ArticleResult
36
58
  from twitter_openapi_python_generated.models.article_results import ArticleResults
59
+ from twitter_openapi_python_generated.models.audio_space import AudioSpace
60
+ from twitter_openapi_python_generated.models.audio_space_data import AudioSpaceData
61
+ from twitter_openapi_python_generated.models.audio_space_mentioned_user import AudioSpaceMentionedUser
62
+ from twitter_openapi_python_generated.models.audio_space_metadata import AudioSpaceMetadata
63
+ from twitter_openapi_python_generated.models.audio_space_participant import AudioSpaceParticipant
64
+ from twitter_openapi_python_generated.models.audio_space_participant_user import AudioSpaceParticipantUser
65
+ from twitter_openapi_python_generated.models.audio_space_participant_user_results import AudioSpaceParticipantUserResults
66
+ from twitter_openapi_python_generated.models.audio_space_participant_verification import AudioSpaceParticipantVerification
67
+ from twitter_openapi_python_generated.models.audio_space_participants import AudioSpaceParticipants
68
+ from twitter_openapi_python_generated.models.audio_space_response import AudioSpaceResponse
69
+ from twitter_openapi_python_generated.models.audio_space_sharings import AudioSpaceSharings
37
70
  from twitter_openapi_python_generated.models.authenticate_periscope_response import AuthenticatePeriscopeResponse
38
71
  from twitter_openapi_python_generated.models.authenticate_periscope_response_data import AuthenticatePeriscopeResponseData
39
72
  from twitter_openapi_python_generated.models.author_community_relationship import AuthorCommunityRelationship
@@ -69,6 +102,11 @@ from twitter_openapi_python_generated.models.bookmark_search_timeline_response_d
69
102
  from twitter_openapi_python_generated.models.bookmarks_response import BookmarksResponse
70
103
  from twitter_openapi_python_generated.models.bookmarks_response_data import BookmarksResponseData
71
104
  from twitter_openapi_python_generated.models.bookmarks_timeline import BookmarksTimeline
105
+ from twitter_openapi_python_generated.models.broadcast import Broadcast
106
+ from twitter_openapi_python_generated.models.broadcast_data import BroadcastData
107
+ from twitter_openapi_python_generated.models.broadcast_edited_replay import BroadcastEditedReplay
108
+ from twitter_openapi_python_generated.models.broadcast_periscope_user import BroadcastPeriscopeUser
109
+ from twitter_openapi_python_generated.models.broadcast_response import BroadcastResponse
72
110
  from twitter_openapi_python_generated.models.callback import Callback
73
111
  from twitter_openapi_python_generated.models.cashtag_attachment import CashtagAttachment
74
112
  from twitter_openapi_python_generated.models.cashtag_info import CashtagInfo
@@ -243,6 +281,9 @@ from twitter_openapi_python_generated.models.global_communities_latest_post_sear
243
281
  from twitter_openapi_python_generated.models.global_communities_post_search import GlobalCommunitiesPostSearch
244
282
  from twitter_openapi_python_generated.models.global_communities_post_search_timeline_response import GlobalCommunitiesPostSearchTimelineResponse
245
283
  from twitter_openapi_python_generated.models.global_communities_post_search_timeline_response_data import GlobalCommunitiesPostSearchTimelineResponseData
284
+ from twitter_openapi_python_generated.models.grok_account_jwt import GrokAccountJwt
285
+ from twitter_openapi_python_generated.models.grok_account_jwt_data import GrokAccountJwtData
286
+ from twitter_openapi_python_generated.models.grok_account_jwt_response import GrokAccountJwtResponse
246
287
  from twitter_openapi_python_generated.models.grok_annotation import GrokAnnotation
247
288
  from twitter_openapi_python_generated.models.grok_entity import GrokEntity
248
289
  from twitter_openapi_python_generated.models.grok_entity_ref import GrokEntityRef
@@ -267,6 +308,7 @@ from twitter_openapi_python_generated.models.hashtag import Hashtag
267
308
  from twitter_openapi_python_generated.models.highlight import Highlight
268
309
  from twitter_openapi_python_generated.models.home_timeline_home import HomeTimelineHome
269
310
  from twitter_openapi_python_generated.models.home_timeline_response_data import HomeTimelineResponseData
311
+ from twitter_openapi_python_generated.models.identity_profile_labels_highlighted_label import IdentityProfileLabelsHighlightedLabel
270
312
  from twitter_openapi_python_generated.models.instruction_type import InstructionType
271
313
  from twitter_openapi_python_generated.models.instruction_union import InstructionUnion
272
314
  from twitter_openapi_python_generated.models.item_content_union import ItemContentUnion
@@ -410,6 +452,9 @@ from twitter_openapi_python_generated.models.search_timeline_response import Sea
410
452
  from twitter_openapi_python_generated.models.self_thread import SelfThread
411
453
  from twitter_openapi_python_generated.models.sensitive_media_warning import SensitiveMediaWarning
412
454
  from twitter_openapi_python_generated.models.session import Session
455
+ from twitter_openapi_python_generated.models.sidebar_user_recommendation import SidebarUserRecommendation
456
+ from twitter_openapi_python_generated.models.sidebar_user_recommendations_data import SidebarUserRecommendationsData
457
+ from twitter_openapi_python_generated.models.sidebar_user_recommendations_response import SidebarUserRecommendationsResponse
413
458
  from twitter_openapi_python_generated.models.slice_info import SliceInfo
414
459
  from twitter_openapi_python_generated.models.smarttag import Smarttag
415
460
  from twitter_openapi_python_generated.models.smarttag_tag import SmarttagTag
@@ -417,6 +462,11 @@ from twitter_openapi_python_generated.models.smarttag_tag_info import SmarttagTa
417
462
  from twitter_openapi_python_generated.models.social_context_landing_url import SocialContextLandingUrl
418
463
  from twitter_openapi_python_generated.models.social_context_union import SocialContextUnion
419
464
  from twitter_openapi_python_generated.models.social_context_union_type import SocialContextUnionType
465
+ from twitter_openapi_python_generated.models.story_topic import StoryTopic
466
+ from twitter_openapi_python_generated.models.story_topic_data import StoryTopicData
467
+ from twitter_openapi_python_generated.models.story_topic_item import StoryTopicItem
468
+ from twitter_openapi_python_generated.models.story_topic_response import StoryTopicResponse
469
+ from twitter_openapi_python_generated.models.story_topic_stories import StoryTopicStories
420
470
  from twitter_openapi_python_generated.models.super_follow_user_profile import SuperFollowUserProfile
421
471
  from twitter_openapi_python_generated.models.super_follows_reply_user_result import SuperFollowsReplyUserResult
422
472
  from twitter_openapi_python_generated.models.super_follows_reply_user_result_core import SuperFollowsReplyUserResultCore
@@ -512,6 +562,9 @@ from twitter_openapi_python_generated.models.tweet_interstitial_text import Twee
512
562
  from twitter_openapi_python_generated.models.tweet_interstitial_text_entity import TweetInterstitialTextEntity
513
563
  from twitter_openapi_python_generated.models.tweet_interstitial_text_entity_ref import TweetInterstitialTextEntityRef
514
564
  from twitter_openapi_python_generated.models.tweet_legacy import TweetLegacy
565
+ from twitter_openapi_python_generated.models.tweet_legacy_place import TweetLegacyPlace
566
+ from twitter_openapi_python_generated.models.tweet_legacy_place_bounding_box import TweetLegacyPlaceBoundingBox
567
+ from twitter_openapi_python_generated.models.tweet_legacy_point import TweetLegacyPoint
515
568
  from twitter_openapi_python_generated.models.tweet_legacy_scopes import TweetLegacyScopes
516
569
  from twitter_openapi_python_generated.models.tweet_limited_action_results import TweetLimitedActionResults
517
570
  from twitter_openapi_python_generated.models.tweet_post_cta import TweetPostCta
@@ -0,0 +1,93 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.about_account_user_result import AboutAccountUserResult
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class AboutAccountData(BaseModel):
29
+ """
30
+ AboutAccountData
31
+ """ # noqa: E501
32
+ user_result_by_screen_name: AboutAccountUserResult
33
+ __properties: ClassVar[List[str]] = ["user_result_by_screen_name"]
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of AboutAccountData from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of user_result_by_screen_name
75
+ if self.user_result_by_screen_name:
76
+ _dict['user_result_by_screen_name'] = self.user_result_by_screen_name.to_dict()
77
+ return _dict
78
+
79
+ @classmethod
80
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
81
+ """Create an instance of AboutAccountData from a dict"""
82
+ if obj is None:
83
+ return None
84
+
85
+ if not isinstance(obj, dict):
86
+ return cls.model_validate(obj)
87
+
88
+ _obj = cls.model_validate({
89
+ "user_result_by_screen_name": AboutAccountUserResult.from_dict(obj["user_result_by_screen_name"]) if obj.get("user_result_by_screen_name") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -0,0 +1,102 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from twitter_openapi_python_generated.models.about_account_data import AboutAccountData
24
+ from twitter_openapi_python_generated.models.error_response import ErrorResponse
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class AboutAccountResponse(BaseModel):
30
+ """
31
+ AboutAccountResponse
32
+ """ # noqa: E501
33
+ data: AboutAccountData
34
+ errors: Optional[List[ErrorResponse]] = None
35
+ __properties: ClassVar[List[str]] = ["data", "errors"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of AboutAccountResponse from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of data
77
+ if self.data:
78
+ _dict['data'] = self.data.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of each item in errors (list)
80
+ _items = []
81
+ if self.errors:
82
+ for _item_errors in self.errors:
83
+ _items.append(_item_errors.to_dict() if _item_errors is not None else None)
84
+ _dict['errors'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of AboutAccountResponse from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "data": AboutAccountData.from_dict(obj["data"]) if obj.get("data") is not None else None,
98
+ "errors": [ErrorResponse.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
99
+ })
100
+ return _obj
101
+
102
+
@@ -0,0 +1,161 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing_extensions import Annotated
24
+ from twitter_openapi_python_generated.models.about_account_verification_info import AboutAccountVerificationInfo
25
+ from twitter_openapi_python_generated.models.about_profile import AboutProfile
26
+ from twitter_openapi_python_generated.models.affiliates_highlighted_label import AffiliatesHighlightedLabel
27
+ from twitter_openapi_python_generated.models.identity_profile_labels_highlighted_label import IdentityProfileLabelsHighlightedLabel
28
+ from twitter_openapi_python_generated.models.type_name import TypeName
29
+ from twitter_openapi_python_generated.models.user_avatar import UserAvatar
30
+ from twitter_openapi_python_generated.models.user_core import UserCore
31
+ from twitter_openapi_python_generated.models.user_privacy import UserPrivacy
32
+ from twitter_openapi_python_generated.models.user_verification import UserVerification
33
+ from typing import Optional, Set
34
+ from typing_extensions import Self
35
+ from pydantic_core import to_jsonable_python
36
+
37
+ class AboutAccountUser(BaseModel):
38
+ """
39
+ AboutAccountUser
40
+ """ # noqa: E501
41
+ typename: TypeName = Field(alias="__typename")
42
+ about_profile: AboutProfile
43
+ affiliates_highlighted_label: AffiliatesHighlightedLabel
44
+ avatar: UserAvatar
45
+ core: UserCore
46
+ id: StrictStr
47
+ identity_profile_labels_highlighted_label: IdentityProfileLabelsHighlightedLabel
48
+ is_blue_verified: StrictBool
49
+ privacy: UserPrivacy
50
+ profile_image_shape: StrictStr
51
+ rest_id: Annotated[str, Field(strict=True)]
52
+ verification: UserVerification
53
+ verification_info: AboutAccountVerificationInfo
54
+ __properties: ClassVar[List[str]] = ["__typename", "about_profile", "affiliates_highlighted_label", "avatar", "core", "id", "identity_profile_labels_highlighted_label", "is_blue_verified", "privacy", "profile_image_shape", "rest_id", "verification", "verification_info"]
55
+
56
+ @field_validator('profile_image_shape')
57
+ def profile_image_shape_validate_enum(cls, value):
58
+ """Validates the enum"""
59
+ if value not in set(['Circle', 'Square', 'Hexagon']):
60
+ raise ValueError("must be one of enum values ('Circle', 'Square', 'Hexagon')")
61
+ return value
62
+
63
+ @field_validator('rest_id', mode="before")
64
+ def rest_id_validate_regular_expression(cls, value):
65
+ """Validates the regular expression"""
66
+ if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
67
+ raise ValueError(r"must validate the regular expression /^[0-9]+$/")
68
+ return value
69
+
70
+ model_config = ConfigDict(
71
+ validate_by_name=True,
72
+ validate_by_alias=True,
73
+ validate_assignment=True,
74
+ protected_namespaces=(),
75
+ )
76
+
77
+
78
+ def to_str(self) -> str:
79
+ """Returns the string representation of the model using alias"""
80
+ return pprint.pformat(self.model_dump(by_alias=True))
81
+
82
+ def to_json(self) -> str:
83
+ """Returns the JSON representation of the model using alias"""
84
+ return json.dumps(to_jsonable_python(self.to_dict()))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Optional[Self]:
88
+ """Create an instance of AboutAccountUser from a JSON string"""
89
+ return cls.from_dict(json.loads(json_str))
90
+
91
+ def to_dict(self) -> Dict[str, Any]:
92
+ """Return the dictionary representation of the model using alias.
93
+
94
+ This has the following differences from calling pydantic's
95
+ `self.model_dump(by_alias=True)`:
96
+
97
+ * `None` is only added to the output dict for nullable fields that
98
+ were set at model initialization. Other fields with value `None`
99
+ are ignored.
100
+ """
101
+ excluded_fields: Set[str] = set([
102
+ ])
103
+
104
+ _dict = self.model_dump(
105
+ by_alias=True,
106
+ exclude=excluded_fields,
107
+ exclude_none=True,
108
+ )
109
+ # override the default output from pydantic by calling `to_dict()` of about_profile
110
+ if self.about_profile:
111
+ _dict['about_profile'] = self.about_profile.to_dict()
112
+ # override the default output from pydantic by calling `to_dict()` of affiliates_highlighted_label
113
+ if self.affiliates_highlighted_label:
114
+ _dict['affiliates_highlighted_label'] = self.affiliates_highlighted_label.to_dict()
115
+ # override the default output from pydantic by calling `to_dict()` of avatar
116
+ if self.avatar:
117
+ _dict['avatar'] = self.avatar.to_dict()
118
+ # override the default output from pydantic by calling `to_dict()` of core
119
+ if self.core:
120
+ _dict['core'] = self.core.to_dict()
121
+ # override the default output from pydantic by calling `to_dict()` of identity_profile_labels_highlighted_label
122
+ if self.identity_profile_labels_highlighted_label:
123
+ _dict['identity_profile_labels_highlighted_label'] = self.identity_profile_labels_highlighted_label.to_dict()
124
+ # override the default output from pydantic by calling `to_dict()` of privacy
125
+ if self.privacy:
126
+ _dict['privacy'] = self.privacy.to_dict()
127
+ # override the default output from pydantic by calling `to_dict()` of verification
128
+ if self.verification:
129
+ _dict['verification'] = self.verification.to_dict()
130
+ # override the default output from pydantic by calling `to_dict()` of verification_info
131
+ if self.verification_info:
132
+ _dict['verification_info'] = self.verification_info.to_dict()
133
+ return _dict
134
+
135
+ @classmethod
136
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
137
+ """Create an instance of AboutAccountUser from a dict"""
138
+ if obj is None:
139
+ return None
140
+
141
+ if not isinstance(obj, dict):
142
+ return cls.model_validate(obj)
143
+
144
+ _obj = cls.model_validate({
145
+ "__typename": obj.get("__typename"),
146
+ "about_profile": AboutProfile.from_dict(obj["about_profile"]) if obj.get("about_profile") is not None else None,
147
+ "affiliates_highlighted_label": AffiliatesHighlightedLabel.from_dict(obj["affiliates_highlighted_label"]) if obj.get("affiliates_highlighted_label") is not None else None,
148
+ "avatar": UserAvatar.from_dict(obj["avatar"]) if obj.get("avatar") is not None else None,
149
+ "core": UserCore.from_dict(obj["core"]) if obj.get("core") is not None else None,
150
+ "id": obj.get("id"),
151
+ "identity_profile_labels_highlighted_label": IdentityProfileLabelsHighlightedLabel.from_dict(obj["identity_profile_labels_highlighted_label"]) if obj.get("identity_profile_labels_highlighted_label") is not None else None,
152
+ "is_blue_verified": obj.get("is_blue_verified"),
153
+ "privacy": UserPrivacy.from_dict(obj["privacy"]) if obj.get("privacy") is not None else None,
154
+ "profile_image_shape": obj.get("profile_image_shape"),
155
+ "rest_id": obj.get("rest_id"),
156
+ "verification": UserVerification.from_dict(obj["verification"]) if obj.get("verification") is not None else None,
157
+ "verification_info": AboutAccountVerificationInfo.from_dict(obj["verification_info"]) if obj.get("verification_info") is not None else None
158
+ })
159
+ return _obj
160
+
161
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.about_account_user import AboutAccountUser
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class AboutAccountUserResult(BaseModel):
29
+ """
30
+ AboutAccountUserResult
31
+ """ # noqa: E501
32
+ id: StrictStr
33
+ result: AboutAccountUser
34
+ __properties: ClassVar[List[str]] = ["id", "result"]
35
+
36
+ model_config = ConfigDict(
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of AboutAccountUserResult from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of result
76
+ if self.result:
77
+ _dict['result'] = self.result.to_dict()
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of AboutAccountUserResult from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "id": obj.get("id"),
91
+ "result": AboutAccountUser.from_dict(obj["result"]) if obj.get("result") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.about_account_verification_info_reason import AboutAccountVerificationInfoReason
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class AboutAccountVerificationInfo(BaseModel):
29
+ """
30
+ AboutAccountVerificationInfo
31
+ """ # noqa: E501
32
+ id: StrictStr
33
+ reason: AboutAccountVerificationInfoReason
34
+ __properties: ClassVar[List[str]] = ["id", "reason"]
35
+
36
+ model_config = ConfigDict(
37
+ validate_by_name=True,
38
+ validate_by_alias=True,
39
+ validate_assignment=True,
40
+ protected_namespaces=(),
41
+ )
42
+
43
+
44
+ def to_str(self) -> str:
45
+ """Returns the string representation of the model using alias"""
46
+ return pprint.pformat(self.model_dump(by_alias=True))
47
+
48
+ def to_json(self) -> str:
49
+ """Returns the JSON representation of the model using alias"""
50
+ return json.dumps(to_jsonable_python(self.to_dict()))
51
+
52
+ @classmethod
53
+ def from_json(cls, json_str: str) -> Optional[Self]:
54
+ """Create an instance of AboutAccountVerificationInfo from a JSON string"""
55
+ return cls.from_dict(json.loads(json_str))
56
+
57
+ def to_dict(self) -> Dict[str, Any]:
58
+ """Return the dictionary representation of the model using alias.
59
+
60
+ This has the following differences from calling pydantic's
61
+ `self.model_dump(by_alias=True)`:
62
+
63
+ * `None` is only added to the output dict for nullable fields that
64
+ were set at model initialization. Other fields with value `None`
65
+ are ignored.
66
+ """
67
+ excluded_fields: Set[str] = set([
68
+ ])
69
+
70
+ _dict = self.model_dump(
71
+ by_alias=True,
72
+ exclude=excluded_fields,
73
+ exclude_none=True,
74
+ )
75
+ # override the default output from pydantic by calling `to_dict()` of reason
76
+ if self.reason:
77
+ _dict['reason'] = self.reason.to_dict()
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of AboutAccountVerificationInfo from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "id": obj.get("id"),
91
+ "reason": AboutAccountVerificationInfoReason.from_dict(obj["reason"]) if obj.get("reason") is not None else None
92
+ })
93
+ return _obj
94
+
95
+