twitter-openapi-python-generated 0.0.35__py3-none-any.whl → 0.1.1__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 (111) hide show
  1. twitter_openapi_python_generated/__init__.py +135 -9
  2. twitter_openapi_python_generated/api_client.py +1 -1
  3. twitter_openapi_python_generated/configuration.py +1 -1
  4. twitter_openapi_python_generated/models/__init__.py +67 -4
  5. twitter_openapi_python_generated/models/ad_metadata_container.py +104 -0
  6. twitter_openapi_python_generated/models/affiliates_highlighted_label.py +93 -0
  7. twitter_openapi_python_generated/models/api_image.py +108 -0
  8. twitter_openapi_python_generated/models/api_media.py +110 -0
  9. twitter_openapi_python_generated/models/article_cover_media_info.py +3 -3
  10. twitter_openapi_python_generated/models/birdwatch_pivot.py +2 -2
  11. twitter_openapi_python_generated/models/cashtag_info.py +93 -0
  12. twitter_openapi_python_generated/models/click_tracking_info.py +96 -0
  13. twitter_openapi_python_generated/models/client_event_info.py +6 -2
  14. twitter_openapi_python_generated/models/client_event_info_details.py +99 -0
  15. twitter_openapi_python_generated/models/community.py +20 -7
  16. twitter_openapi_python_generated/models/community_banner_media.py +95 -0
  17. twitter_openapi_python_generated/models/community_banner_media_info.py +108 -0
  18. twitter_openapi_python_generated/models/community_moderation_state.py +90 -0
  19. twitter_openapi_python_generated/models/community_relationship.py +6 -2
  20. twitter_openapi_python_generated/models/community_viewer_relationship.py +95 -0
  21. twitter_openapi_python_generated/models/conversation_control.py +10 -11
  22. twitter_openapi_python_generated/models/conversation_details.py +96 -0
  23. twitter_openapi_python_generated/models/conversation_metadata.py +92 -0
  24. twitter_openapi_python_generated/models/conversation_owner.py +96 -0
  25. twitter_openapi_python_generated/models/conversation_owner_core.py +89 -0
  26. twitter_openapi_python_generated/models/conversation_owner_results.py +93 -0
  27. twitter_openapi_python_generated/models/cta_limited_action_prompt.py +110 -0
  28. twitter_openapi_python_generated/models/cta_limited_action_prompt_text.py +91 -0
  29. twitter_openapi_python_generated/models/deepsearch_header.py +96 -0
  30. twitter_openapi_python_generated/models/deepsearch_step.py +99 -0
  31. twitter_openapi_python_generated/models/deepsearch_web_result.py +89 -0
  32. twitter_openapi_python_generated/models/entities.py +27 -6
  33. twitter_openapi_python_generated/models/error_extensions.py +1 -1
  34. twitter_openapi_python_generated/models/error_response.py +1 -1
  35. twitter_openapi_python_generated/models/feedback_action.py +136 -0
  36. twitter_openapi_python_generated/models/feedback_action_entry.py +95 -0
  37. twitter_openapi_python_generated/models/feedback_client_event_info.py +93 -0
  38. twitter_openapi_python_generated/models/feedback_info.py +8 -6
  39. twitter_openapi_python_generated/models/grok_share_attachment_item.py +9 -2
  40. twitter_openapi_python_generated/models/grouped_trend.py +95 -0
  41. twitter_openapi_python_generated/models/hashtag.py +91 -0
  42. twitter_openapi_python_generated/models/jetfuel_attachment.py +91 -0
  43. twitter_openapi_python_generated/models/key_value.py +91 -0
  44. twitter_openapi_python_generated/models/landing_url.py +98 -0
  45. twitter_openapi_python_generated/models/limited_action.py +95 -0
  46. twitter_openapi_python_generated/models/limited_action_results.py +96 -0
  47. twitter_openapi_python_generated/models/limited_action_results_data.py +1 -8
  48. twitter_openapi_python_generated/models/list_banner_media_info.py +3 -3
  49. twitter_openapi_python_generated/models/list_banner_media_results.py +93 -0
  50. twitter_openapi_python_generated/models/{article_cover_media_color_info.py → media_color_info.py} +7 -7
  51. twitter_openapi_python_generated/models/{article_cover_media_color_info_palette.py → media_color_info_palette.py} +7 -7
  52. twitter_openapi_python_generated/models/{article_cover_media_color_info_palette_rgb.py → media_color_info_palette_rgb.py} +4 -4
  53. twitter_openapi_python_generated/models/{list_banner_media_salient_rect.py → media_salient_rect.py} +4 -4
  54. twitter_openapi_python_generated/models/module_footer.py +104 -0
  55. twitter_openapi_python_generated/models/module_header.py +100 -0
  56. twitter_openapi_python_generated/models/module_metadata.py +93 -0
  57. twitter_openapi_python_generated/models/promoted_metadata.py +109 -0
  58. twitter_openapi_python_generated/models/reader_mode_config.py +89 -0
  59. twitter_openapi_python_generated/models/scribe_config.py +89 -0
  60. twitter_openapi_python_generated/models/search_timeline.py +2 -2
  61. twitter_openapi_python_generated/models/smarttag_tag.py +6 -2
  62. twitter_openapi_python_generated/models/smarttag_tag_info.py +93 -0
  63. twitter_openapi_python_generated/models/symbol.py +97 -0
  64. twitter_openapi_python_generated/models/timeline.py +12 -4
  65. twitter_openapi_python_generated/models/timeline_community.py +13 -17
  66. twitter_openapi_python_generated/models/timeline_message_prompt.py +13 -17
  67. twitter_openapi_python_generated/models/timeline_message_prompt_button.py +95 -0
  68. twitter_openapi_python_generated/models/timeline_message_prompt_button_action.py +91 -0
  69. twitter_openapi_python_generated/models/timeline_message_prompt_content.py +112 -0
  70. twitter_openapi_python_generated/models/timeline_message_prompt_rich_text.py +98 -0
  71. twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity.py +97 -0
  72. twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity_ref.py +107 -0
  73. twitter_openapi_python_generated/models/timeline_metadata.py +99 -0
  74. twitter_openapi_python_generated/models/timeline_prompt.py +19 -17
  75. twitter_openapi_python_generated/models/timeline_prompt_callback.py +89 -0
  76. twitter_openapi_python_generated/models/timeline_prompt_content.py +124 -0
  77. twitter_openapi_python_generated/models/timeline_response_objects.py +96 -0
  78. twitter_openapi_python_generated/models/timeline_show_alert.py +18 -21
  79. twitter_openapi_python_generated/models/timeline_show_alert_color_config.py +93 -0
  80. twitter_openapi_python_generated/models/timeline_show_alert_icon_display_info.py +91 -0
  81. twitter_openapi_python_generated/models/timeline_show_alert_rich_text.py +3 -3
  82. twitter_openapi_python_generated/models/timeline_timeline_item.py +6 -2
  83. twitter_openapi_python_generated/models/timeline_timeline_module.py +18 -6
  84. twitter_openapi_python_generated/models/timeline_trend.py +10 -1
  85. twitter_openapi_python_generated/models/timeline_tweet.py +6 -2
  86. twitter_openapi_python_generated/models/timelines_details.py +93 -0
  87. twitter_openapi_python_generated/models/tweet.py +7 -1
  88. twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +6 -2
  89. twitter_openapi_python_generated/models/tweet_legacy.py +6 -2
  90. twitter_openapi_python_generated/models/tweet_with_visibility_results.py +6 -2
  91. twitter_openapi_python_generated/models/twitter_list.py +17 -3
  92. twitter_openapi_python_generated/models/type_name.py +3 -0
  93. twitter_openapi_python_generated/models/user.py +6 -2
  94. twitter_openapi_python_generated/models/user_label.py +128 -0
  95. twitter_openapi_python_generated/models/user_label_badge.py +89 -0
  96. twitter_openapi_python_generated/models/user_label_mention_results.py +93 -0
  97. twitter_openapi_python_generated/models/user_label_mention_user.py +106 -0
  98. twitter_openapi_python_generated/models/user_label_mention_user_core.py +89 -0
  99. twitter_openapi_python_generated/models/user_label_text.py +98 -0
  100. twitter_openapi_python_generated/models/user_label_text_entity.py +97 -0
  101. twitter_openapi_python_generated/models/user_label_text_entity_ref.py +104 -0
  102. twitter_openapi_python_generated/models/user_label_url.py +98 -0
  103. twitter_openapi_python_generated/models/user_legacy.py +6 -2
  104. twitter_openapi_python_generated/models/user_mention.py +115 -0
  105. twitter_openapi_python_generated/models/user_professional.py +7 -2
  106. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/METADATA +72 -9
  107. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/RECORD +111 -48
  108. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/WHEEL +0 -0
  109. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/licenses/LICENSE +0 -0
  110. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/licenses/LICENSE.AGPL +0 -0
  111. {twitter_openapi_python_generated-0.0.35.dist-info → twitter_openapi_python_generated-0.1.1.dist-info}/top_level.txt +0 -0
@@ -30,6 +30,7 @@ from twitter_openapi_python_generated.models.community_result import CommunityRe
30
30
  from twitter_openapi_python_generated.models.content_disclosure import ContentDisclosure
31
31
  from twitter_openapi_python_generated.models.grok_annotation import GrokAnnotation
32
32
  from twitter_openapi_python_generated.models.grok_translated_post_with_availability import GrokTranslatedPostWithAvailability
33
+ from twitter_openapi_python_generated.models.jetfuel_attachment import JetfuelAttachment
33
34
  from twitter_openapi_python_generated.models.note_tweet import NoteTweet
34
35
  from twitter_openapi_python_generated.models.super_follows_reply_user_result import SuperFollowsReplyUserResult
35
36
  from twitter_openapi_python_generated.models.trend_results import TrendResults
@@ -69,6 +70,7 @@ class Tweet(BaseModel):
69
70
  grok_translated_post_with_availability: Optional[GrokTranslatedPostWithAvailability] = None
70
71
  has_birdwatch_notes: Optional[StrictBool] = None
71
72
  is_translatable: Optional[StrictBool] = None
73
+ jetfuel_attachment: Optional[JetfuelAttachment] = None
72
74
  legacy: Optional[TweetLegacy] = None
73
75
  nested_quoted_tweet_results: Optional[ItemResult] = None
74
76
  note_tweet: Optional[NoteTweet] = None
@@ -86,7 +88,7 @@ class Tweet(BaseModel):
86
88
  unified_card: Optional[UnifiedCard] = None
87
89
  unmention_data: Optional[Dict[str, Any]] = None
88
90
  views: Optional[TweetView] = None
89
- __properties: ClassVar[List[str]] = ["__typename", "article", "author_community_relationship", "birdwatch_pivot", "card", "cashtag_attachments", "community_relationship", "community_results", "content_disclosure", "core", "edit_control", "edit_prespective", "grok_analysis_button", "grok_analysis_followups", "grok_annotations", "grok_share_attachment", "grok_translated_post_with_availability", "has_birdwatch_notes", "is_translatable", "legacy", "nested_quoted_tweet_results", "note_tweet", "postCta", "post_image_description", "post_video_description", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views"]
91
+ __properties: ClassVar[List[str]] = ["__typename", "article", "author_community_relationship", "birdwatch_pivot", "card", "cashtag_attachments", "community_relationship", "community_results", "content_disclosure", "core", "edit_control", "edit_prespective", "grok_analysis_button", "grok_analysis_followups", "grok_annotations", "grok_share_attachment", "grok_translated_post_with_availability", "has_birdwatch_notes", "is_translatable", "jetfuel_attachment", "legacy", "nested_quoted_tweet_results", "note_tweet", "postCta", "post_image_description", "post_video_description", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views"]
90
92
 
91
93
  @field_validator('rest_id', mode="before")
92
94
  def rest_id_validate_regular_expression(cls, value):
@@ -179,6 +181,9 @@ class Tweet(BaseModel):
179
181
  # override the default output from pydantic by calling `to_dict()` of grok_translated_post_with_availability
180
182
  if self.grok_translated_post_with_availability:
181
183
  _dict['grok_translated_post_with_availability'] = self.grok_translated_post_with_availability.to_dict()
184
+ # override the default output from pydantic by calling `to_dict()` of jetfuel_attachment
185
+ if self.jetfuel_attachment:
186
+ _dict['jetfuel_attachment'] = self.jetfuel_attachment.to_dict()
182
187
  # override the default output from pydantic by calling `to_dict()` of legacy
183
188
  if self.legacy:
184
189
  _dict['legacy'] = self.legacy.to_dict()
@@ -243,6 +248,7 @@ class Tweet(BaseModel):
243
248
  "grok_translated_post_with_availability": GrokTranslatedPostWithAvailability.from_dict(obj["grok_translated_post_with_availability"]) if obj.get("grok_translated_post_with_availability") is not None else None,
244
249
  "has_birdwatch_notes": obj.get("has_birdwatch_notes"),
245
250
  "is_translatable": obj.get("is_translatable"),
251
+ "jetfuel_attachment": JetfuelAttachment.from_dict(obj["jetfuel_attachment"]) if obj.get("jetfuel_attachment") is not None else None,
246
252
  "legacy": TweetLegacy.from_dict(obj["legacy"]) if obj.get("legacy") is not None else None,
247
253
  "nested_quoted_tweet_results": ItemResult.from_dict(obj["nested_quoted_tweet_results"]) if obj.get("nested_quoted_tweet_results") is not None else None,
248
254
  "note_tweet": NoteTweet.from_dict(obj["note_tweet"]) if obj.get("note_tweet") is not None else None,
@@ -20,6 +20,7 @@ import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from twitter_openapi_python_generated.models.media_color_info import MediaColorInfo
23
24
  from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value_data_image import TweetCardLegacyBindingValueDataImage
24
25
  from twitter_openapi_python_generated.models.user_value import UserValue
25
26
  from typing import Optional, Set
@@ -31,7 +32,7 @@ class TweetCardLegacyBindingValueData(BaseModel):
31
32
  TweetCardLegacyBindingValueData
32
33
  """ # noqa: E501
33
34
  boolean_value: Optional[StrictBool] = None
34
- image_color_value: Optional[Dict[str, Any]] = None
35
+ image_color_value: Optional[MediaColorInfo] = None
35
36
  image_value: Optional[TweetCardLegacyBindingValueDataImage] = None
36
37
  scribe_key: Optional[StrictStr] = None
37
38
  string_value: Optional[StrictStr] = None
@@ -78,6 +79,9 @@ class TweetCardLegacyBindingValueData(BaseModel):
78
79
  exclude=excluded_fields,
79
80
  exclude_none=True,
80
81
  )
82
+ # override the default output from pydantic by calling `to_dict()` of image_color_value
83
+ if self.image_color_value:
84
+ _dict['image_color_value'] = self.image_color_value.to_dict()
81
85
  # override the default output from pydantic by calling `to_dict()` of image_value
82
86
  if self.image_value:
83
87
  _dict['image_value'] = self.image_value.to_dict()
@@ -97,7 +101,7 @@ class TweetCardLegacyBindingValueData(BaseModel):
97
101
 
98
102
  _obj = cls.model_validate({
99
103
  "boolean_value": obj.get("boolean_value"),
100
- "image_color_value": obj.get("image_color_value"),
104
+ "image_color_value": MediaColorInfo.from_dict(obj["image_color_value"]) if obj.get("image_color_value") is not None else None,
101
105
  "image_value": TweetCardLegacyBindingValueDataImage.from_dict(obj["image_value"]) if obj.get("image_value") is not None else None,
102
106
  "scribe_key": obj.get("scribe_key"),
103
107
  "string_value": obj.get("string_value"),
@@ -21,6 +21,7 @@ import json
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
+ from twitter_openapi_python_generated.models.conversation_control import ConversationControl
24
25
  from twitter_openapi_python_generated.models.entities import Entities
25
26
  from twitter_openapi_python_generated.models.extended_entities import ExtendedEntities
26
27
  from twitter_openapi_python_generated.models.quoted_status_permalink import QuotedStatusPermalink
@@ -36,7 +37,7 @@ class TweetLegacy(BaseModel):
36
37
  """ # noqa: E501
37
38
  bookmark_count: StrictInt
38
39
  bookmarked: StrictBool
39
- conversation_control: Optional[Dict[str, Any]] = None
40
+ conversation_control: Optional[ConversationControl] = None
40
41
  conversation_id_str: Annotated[str, Field(strict=True)]
41
42
  created_at: Annotated[str, Field(strict=True)] = Field(json_schema_extra={"examples": ["Sat Dec 31 23:59:59 +0000 2023"]})
42
43
  display_text_range: List[StrictInt]
@@ -174,6 +175,9 @@ class TweetLegacy(BaseModel):
174
175
  exclude=excluded_fields,
175
176
  exclude_none=True,
176
177
  )
178
+ # override the default output from pydantic by calling `to_dict()` of conversation_control
179
+ if self.conversation_control:
180
+ _dict['conversation_control'] = self.conversation_control.to_dict()
177
181
  # override the default output from pydantic by calling `to_dict()` of entities
178
182
  if self.entities:
179
183
  _dict['entities'] = self.entities.to_dict()
@@ -206,7 +210,7 @@ class TweetLegacy(BaseModel):
206
210
  _obj = cls.model_validate({
207
211
  "bookmark_count": obj.get("bookmark_count"),
208
212
  "bookmarked": obj.get("bookmarked"),
209
- "conversation_control": obj.get("conversation_control"),
213
+ "conversation_control": ConversationControl.from_dict(obj["conversation_control"]) if obj.get("conversation_control") is not None else None,
210
214
  "conversation_id_str": obj.get("conversation_id_str"),
211
215
  "created_at": obj.get("created_at"),
212
216
  "display_text_range": obj.get("display_text_range"),
@@ -20,6 +20,7 @@ import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, Field
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from twitter_openapi_python_generated.models.limited_action_results import LimitedActionResults
23
24
  from twitter_openapi_python_generated.models.media_visibility_results import MediaVisibilityResults
24
25
  from twitter_openapi_python_generated.models.tweet_interstitial import TweetInterstitial
25
26
  from twitter_openapi_python_generated.models.type_name import TypeName
@@ -32,7 +33,7 @@ class TweetWithVisibilityResults(BaseModel):
32
33
  TweetWithVisibilityResults
33
34
  """ # noqa: E501
34
35
  typename: TypeName = Field(alias="__typename")
35
- limited_action_results: Optional[Dict[str, Any]] = Field(default=None, alias="limitedActionResults")
36
+ limited_action_results: Optional[LimitedActionResults] = Field(default=None, alias="limitedActionResults")
36
37
  media_visibility_results: Optional[MediaVisibilityResults] = Field(default=None, alias="mediaVisibilityResults")
37
38
  tweet: Tweet
38
39
  tweet_interstitial: Optional[TweetInterstitial] = Field(default=None, alias="tweetInterstitial")
@@ -77,6 +78,9 @@ class TweetWithVisibilityResults(BaseModel):
77
78
  exclude=excluded_fields,
78
79
  exclude_none=True,
79
80
  )
81
+ # override the default output from pydantic by calling `to_dict()` of limited_action_results
82
+ if self.limited_action_results:
83
+ _dict['limitedActionResults'] = self.limited_action_results.to_dict()
80
84
  # override the default output from pydantic by calling `to_dict()` of media_visibility_results
81
85
  if self.media_visibility_results:
82
86
  _dict['mediaVisibilityResults'] = self.media_visibility_results.to_dict()
@@ -99,7 +103,7 @@ class TweetWithVisibilityResults(BaseModel):
99
103
 
100
104
  _obj = cls.model_validate({
101
105
  "__typename": obj.get("__typename"),
102
- "limitedActionResults": obj.get("limitedActionResults"),
106
+ "limitedActionResults": LimitedActionResults.from_dict(obj["limitedActionResults"]) if obj.get("limitedActionResults") is not None else None,
103
107
  "mediaVisibilityResults": MediaVisibilityResults.from_dict(obj["mediaVisibilityResults"]) if obj.get("mediaVisibilityResults") is not None else None,
104
108
  "tweet": Tweet.from_dict(obj["tweet"]) if obj.get("tweet") is not None else None,
105
109
  "tweetInterstitial": TweetInterstitial.from_dict(obj["tweetInterstitial"]) if obj.get("tweetInterstitial") is not None else None
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, Strict
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
24
  from twitter_openapi_python_generated.models.list_banner_media import ListBannerMedia
25
+ from twitter_openapi_python_generated.models.list_banner_media_results import ListBannerMediaResults
25
26
  from twitter_openapi_python_generated.models.user_results import UserResults
26
27
  from typing import Optional, Set
27
28
  from typing_extensions import Self
@@ -32,8 +33,10 @@ class TwitterList(BaseModel):
32
33
  TwitterList
33
34
  """ # noqa: E501
34
35
  created_at: StrictInt
36
+ custom_banner_media: Optional[ListBannerMedia] = None
37
+ custom_banner_media_results: Optional[ListBannerMediaResults] = None
35
38
  default_banner_media: ListBannerMedia
36
- default_banner_media_results: Dict[str, Any]
39
+ default_banner_media_results: ListBannerMediaResults
37
40
  description: StrictStr
38
41
  facepile_urls: List[StrictStr]
39
42
  followers_context: Optional[StrictStr] = None
@@ -49,7 +52,7 @@ class TwitterList(BaseModel):
49
52
  pinning: StrictBool
50
53
  subscriber_count: StrictInt
51
54
  user_results: UserResults
52
- __properties: ClassVar[List[str]] = ["created_at", "default_banner_media", "default_banner_media_results", "description", "facepile_urls", "followers_context", "following", "id", "id_str", "is_member", "member_count", "members_context", "mode", "muting", "name", "pinning", "subscriber_count", "user_results"]
55
+ __properties: ClassVar[List[str]] = ["created_at", "custom_banner_media", "custom_banner_media_results", "default_banner_media", "default_banner_media_results", "description", "facepile_urls", "followers_context", "following", "id", "id_str", "is_member", "member_count", "members_context", "mode", "muting", "name", "pinning", "subscriber_count", "user_results"]
53
56
 
54
57
  @field_validator('id_str', mode="before")
55
58
  def id_str_validate_regular_expression(cls, value):
@@ -104,9 +107,18 @@ class TwitterList(BaseModel):
104
107
  exclude=excluded_fields,
105
108
  exclude_none=True,
106
109
  )
110
+ # override the default output from pydantic by calling `to_dict()` of custom_banner_media
111
+ if self.custom_banner_media:
112
+ _dict['custom_banner_media'] = self.custom_banner_media.to_dict()
113
+ # override the default output from pydantic by calling `to_dict()` of custom_banner_media_results
114
+ if self.custom_banner_media_results:
115
+ _dict['custom_banner_media_results'] = self.custom_banner_media_results.to_dict()
107
116
  # override the default output from pydantic by calling `to_dict()` of default_banner_media
108
117
  if self.default_banner_media:
109
118
  _dict['default_banner_media'] = self.default_banner_media.to_dict()
119
+ # override the default output from pydantic by calling `to_dict()` of default_banner_media_results
120
+ if self.default_banner_media_results:
121
+ _dict['default_banner_media_results'] = self.default_banner_media_results.to_dict()
110
122
  # override the default output from pydantic by calling `to_dict()` of user_results
111
123
  if self.user_results:
112
124
  _dict['user_results'] = self.user_results.to_dict()
@@ -123,8 +135,10 @@ class TwitterList(BaseModel):
123
135
 
124
136
  _obj = cls.model_validate({
125
137
  "created_at": obj.get("created_at"),
138
+ "custom_banner_media": ListBannerMedia.from_dict(obj["custom_banner_media"]) if obj.get("custom_banner_media") is not None else None,
139
+ "custom_banner_media_results": ListBannerMediaResults.from_dict(obj["custom_banner_media_results"]) if obj.get("custom_banner_media_results") is not None else None,
126
140
  "default_banner_media": ListBannerMedia.from_dict(obj["default_banner_media"]) if obj.get("default_banner_media") is not None else None,
127
- "default_banner_media_results": obj.get("default_banner_media_results"),
141
+ "default_banner_media_results": ListBannerMediaResults.from_dict(obj["default_banner_media_results"]) if obj.get("default_banner_media_results") is not None else None,
128
142
  "description": obj.get("description"),
129
143
  "facepile_urls": obj.get("facepile_urls"),
130
144
  "followers_context": obj.get("followers_context"),
@@ -62,6 +62,9 @@ class TypeName(str, Enum):
62
62
  COMMUNITYJOINREQUESTSUNAVAILABLE = 'CommunityJoinRequestsUnavailable'
63
63
  COMMUNITYUNAVAILABLE = 'CommunityUnavailable'
64
64
  APIIMAGE = 'ApiImage'
65
+ APIMEDIA = 'ApiMedia'
66
+ COMMUNITYUSERDEFAULTMODERATIONSTATE = 'CommunityUserDefaultModerationState'
67
+ CTALIMITEDACTIONPROMPT = 'CtaLimitedActionPrompt'
65
68
  TIMELINERICHTEXTUSER = 'TimelineRichTextUser'
66
69
 
67
70
  @classmethod
@@ -21,6 +21,7 @@ import json
21
21
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing_extensions import Annotated
24
+ from twitter_openapi_python_generated.models.affiliates_highlighted_label import AffiliatesHighlightedLabel
24
25
  from twitter_openapi_python_generated.models.profile_bio import ProfileBio
25
26
  from twitter_openapi_python_generated.models.type_name import TypeName
26
27
  from twitter_openapi_python_generated.models.user_action_counts import UserActionCounts
@@ -57,7 +58,7 @@ class User(BaseModel):
57
58
  """ # noqa: E501
58
59
  typename: TypeName = Field(alias="__typename")
59
60
  action_counts: Optional[UserActionCounts] = None
60
- affiliates_highlighted_label: Optional[Dict[str, Any]] = None
61
+ affiliates_highlighted_label: Optional[AffiliatesHighlightedLabel] = None
61
62
  avatar: Optional[UserAvatar] = None
62
63
  banner: Optional[UserBanner] = None
63
64
  business_account: Optional[Dict[str, Any]] = None
@@ -181,6 +182,9 @@ class User(BaseModel):
181
182
  # override the default output from pydantic by calling `to_dict()` of action_counts
182
183
  if self.action_counts:
183
184
  _dict['action_counts'] = self.action_counts.to_dict()
185
+ # override the default output from pydantic by calling `to_dict()` of affiliates_highlighted_label
186
+ if self.affiliates_highlighted_label:
187
+ _dict['affiliates_highlighted_label'] = self.affiliates_highlighted_label.to_dict()
184
188
  # override the default output from pydantic by calling `to_dict()` of avatar
185
189
  if self.avatar:
186
190
  _dict['avatar'] = self.avatar.to_dict()
@@ -273,7 +277,7 @@ class User(BaseModel):
273
277
  _obj = cls.model_validate({
274
278
  "__typename": obj.get("__typename"),
275
279
  "action_counts": UserActionCounts.from_dict(obj["action_counts"]) if obj.get("action_counts") is not None else None,
276
- "affiliates_highlighted_label": obj.get("affiliates_highlighted_label"),
280
+ "affiliates_highlighted_label": AffiliatesHighlightedLabel.from_dict(obj["affiliates_highlighted_label"]) if obj.get("affiliates_highlighted_label") is not None else None,
277
281
  "avatar": UserAvatar.from_dict(obj["avatar"]) if obj.get("avatar") is not None else None,
278
282
  "banner": UserBanner.from_dict(obj["banner"]) if obj.get("banner") is not None else None,
279
283
  "business_account": obj.get("business_account"),
@@ -0,0 +1,128 @@
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, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from twitter_openapi_python_generated.models.user_label_badge import UserLabelBadge
24
+ from twitter_openapi_python_generated.models.user_label_text import UserLabelText
25
+ from twitter_openapi_python_generated.models.user_label_url import UserLabelUrl
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+ from pydantic_core import to_jsonable_python
29
+
30
+ class UserLabel(BaseModel):
31
+ """
32
+ UserLabel
33
+ """ # noqa: E501
34
+ badge: UserLabelBadge
35
+ description: StrictStr
36
+ long_description: Optional[UserLabelText] = Field(default=None, alias="longDescription")
37
+ url: Optional[UserLabelUrl] = None
38
+ user_label_display_type: Optional[StrictStr] = Field(default=None, alias="userLabelDisplayType")
39
+ user_label_type: StrictStr = Field(alias="userLabelType")
40
+ __properties: ClassVar[List[str]] = ["badge", "description", "longDescription", "url", "userLabelDisplayType", "userLabelType"]
41
+
42
+ @field_validator('user_label_display_type')
43
+ def user_label_display_type_validate_enum(cls, value):
44
+ """Validates the enum"""
45
+ if value is None:
46
+ return value
47
+
48
+ if value not in set(['Badge']):
49
+ raise ValueError("must be one of enum values ('Badge')")
50
+ return value
51
+
52
+ @field_validator('user_label_type')
53
+ def user_label_type_validate_enum(cls, value):
54
+ """Validates the enum"""
55
+ if value not in set(['AutomatedLabel', 'BusinessLabel']):
56
+ raise ValueError("must be one of enum values ('AutomatedLabel', 'BusinessLabel')")
57
+ return value
58
+
59
+ model_config = ConfigDict(
60
+ validate_by_name=True,
61
+ validate_by_alias=True,
62
+ validate_assignment=True,
63
+ protected_namespaces=(),
64
+ )
65
+
66
+
67
+ def to_str(self) -> str:
68
+ """Returns the string representation of the model using alias"""
69
+ return pprint.pformat(self.model_dump(by_alias=True))
70
+
71
+ def to_json(self) -> str:
72
+ """Returns the JSON representation of the model using alias"""
73
+ return json.dumps(to_jsonable_python(self.to_dict()))
74
+
75
+ @classmethod
76
+ def from_json(cls, json_str: str) -> Optional[Self]:
77
+ """Create an instance of UserLabel from a JSON string"""
78
+ return cls.from_dict(json.loads(json_str))
79
+
80
+ def to_dict(self) -> Dict[str, Any]:
81
+ """Return the dictionary representation of the model using alias.
82
+
83
+ This has the following differences from calling pydantic's
84
+ `self.model_dump(by_alias=True)`:
85
+
86
+ * `None` is only added to the output dict for nullable fields that
87
+ were set at model initialization. Other fields with value `None`
88
+ are ignored.
89
+ """
90
+ excluded_fields: Set[str] = set([
91
+ ])
92
+
93
+ _dict = self.model_dump(
94
+ by_alias=True,
95
+ exclude=excluded_fields,
96
+ exclude_none=True,
97
+ )
98
+ # override the default output from pydantic by calling `to_dict()` of badge
99
+ if self.badge:
100
+ _dict['badge'] = self.badge.to_dict()
101
+ # override the default output from pydantic by calling `to_dict()` of long_description
102
+ if self.long_description:
103
+ _dict['longDescription'] = self.long_description.to_dict()
104
+ # override the default output from pydantic by calling `to_dict()` of url
105
+ if self.url:
106
+ _dict['url'] = self.url.to_dict()
107
+ return _dict
108
+
109
+ @classmethod
110
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
111
+ """Create an instance of UserLabel from a dict"""
112
+ if obj is None:
113
+ return None
114
+
115
+ if not isinstance(obj, dict):
116
+ return cls.model_validate(obj)
117
+
118
+ _obj = cls.model_validate({
119
+ "badge": UserLabelBadge.from_dict(obj["badge"]) if obj.get("badge") is not None else None,
120
+ "description": obj.get("description"),
121
+ "longDescription": UserLabelText.from_dict(obj["longDescription"]) if obj.get("longDescription") is not None else None,
122
+ "url": UserLabelUrl.from_dict(obj["url"]) if obj.get("url") is not None else None,
123
+ "userLabelDisplayType": obj.get("userLabelDisplayType"),
124
+ "userLabelType": obj.get("userLabelType")
125
+ })
126
+ return _obj
127
+
128
+
@@ -0,0 +1,89 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class UserLabelBadge(BaseModel):
28
+ """
29
+ UserLabelBadge
30
+ """ # noqa: E501
31
+ url: StrictStr
32
+ __properties: ClassVar[List[str]] = ["url"]
33
+
34
+ model_config = ConfigDict(
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of UserLabelBadge from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of UserLabelBadge from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "url": obj.get("url")
86
+ })
87
+ return _obj
88
+
89
+
@@ -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.user_label_mention_user import UserLabelMentionUser
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class UserLabelMentionResults(BaseModel):
29
+ """
30
+ UserLabelMentionResults
31
+ """ # noqa: E501
32
+ result: UserLabelMentionUser
33
+ __properties: ClassVar[List[str]] = ["result"]
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 UserLabelMentionResults 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 result
75
+ if self.result:
76
+ _dict['result'] = self.result.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 UserLabelMentionResults 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
+ "result": UserLabelMentionUser.from_dict(obj["result"]) if obj.get("result") is not None else None
90
+ })
91
+ return _obj
92
+
93
+