twitter-openapi-python-generated 0.1.0__py3-none-any.whl → 0.1.2__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 (149) hide show
  1. twitter_openapi_python_generated/__init__.py +235 -1
  2. twitter_openapi_python_generated/api/__init__.py +2 -0
  3. twitter_openapi_python_generated/api/birdwatch_api.py +1609 -0
  4. twitter_openapi_python_generated/api/community_api.py +1910 -0
  5. twitter_openapi_python_generated/api/default_api.py +1522 -0
  6. twitter_openapi_python_generated/api/tweet_api.py +778 -142
  7. twitter_openapi_python_generated/api/user_list_api.py +1145 -192
  8. twitter_openapi_python_generated/api/users_api.py +318 -0
  9. twitter_openapi_python_generated/api_client.py +1 -1
  10. twitter_openapi_python_generated/configuration.py +1 -1
  11. twitter_openapi_python_generated/models/__init__.py +115 -0
  12. twitter_openapi_python_generated/models/ad_metadata_container.py +5 -3
  13. twitter_openapi_python_generated/models/authenticate_periscope_response.py +102 -0
  14. twitter_openapi_python_generated/models/authenticate_periscope_response_data.py +89 -0
  15. twitter_openapi_python_generated/models/birdwatch_alias_self_select_status.py +91 -0
  16. twitter_openapi_python_generated/models/birdwatch_fetch_alias_self_select_status_response.py +102 -0
  17. twitter_openapi_python_generated/models/birdwatch_fetch_alias_self_select_status_response_data.py +93 -0
  18. twitter_openapi_python_generated/models/birdwatch_fetch_authenticated_user_profile_response.py +102 -0
  19. twitter_openapi_python_generated/models/birdwatch_fetch_authenticated_user_profile_response_data.py +93 -0
  20. twitter_openapi_python_generated/models/birdwatch_fetch_birdwatch_profile_response.py +102 -0
  21. twitter_openapi_python_generated/models/birdwatch_fetch_birdwatch_profile_response_data.py +93 -0
  22. twitter_openapi_python_generated/models/birdwatch_fetch_global_timeline_response.py +102 -0
  23. twitter_openapi_python_generated/models/birdwatch_fetch_global_timeline_response_data.py +93 -0
  24. twitter_openapi_python_generated/models/birdwatch_fetch_public_data_response.py +102 -0
  25. twitter_openapi_python_generated/models/birdwatch_fetch_public_data_response_data.py +93 -0
  26. twitter_openapi_python_generated/models/birdwatch_home_page.py +101 -0
  27. twitter_openapi_python_generated/models/birdwatch_home_page_body.py +104 -0
  28. twitter_openapi_python_generated/models/birdwatch_home_timeline.py +97 -0
  29. twitter_openapi_python_generated/models/birdwatch_profile.py +89 -0
  30. twitter_openapi_python_generated/models/birdwatch_public_data_file.py +91 -0
  31. twitter_openapi_python_generated/models/birdwatch_public_data_file_bundle.py +113 -0
  32. twitter_openapi_python_generated/models/birdwatch_viewer.py +93 -0
  33. twitter_openapi_python_generated/models/bookmark_search.py +93 -0
  34. twitter_openapi_python_generated/models/bookmark_search_timeline_response.py +102 -0
  35. twitter_openapi_python_generated/models/bookmark_search_timeline_response_data.py +93 -0
  36. twitter_openapi_python_generated/models/client_event_info_details.py +8 -2
  37. twitter_openapi_python_generated/models/communities_fetch_one_query_response.py +102 -0
  38. twitter_openapi_python_generated/models/communities_fetch_one_query_response_data.py +93 -0
  39. twitter_openapi_python_generated/models/communities_search_query_response.py +102 -0
  40. twitter_openapi_python_generated/models/communities_search_query_response_data.py +93 -0
  41. twitter_openapi_python_generated/models/communities_search_slice.py +102 -0
  42. twitter_openapi_python_generated/models/community.py +3 -1
  43. twitter_openapi_python_generated/models/community_facepile_user.py +98 -0
  44. twitter_openapi_python_generated/models/community_facepile_user_results.py +95 -0
  45. twitter_openapi_python_generated/models/community_hashtag.py +91 -0
  46. twitter_openapi_python_generated/models/community_hashtag_slice.py +99 -0
  47. twitter_openapi_python_generated/models/community_id_user_results.py +95 -0
  48. twitter_openapi_python_generated/models/community_list_members_action_result.py +90 -0
  49. twitter_openapi_python_generated/models/community_page_actions.py +113 -0
  50. twitter_openapi_python_generated/models/community_page_community.py +187 -0
  51. twitter_openapi_python_generated/models/community_page_delete_action_result.py +94 -0
  52. twitter_openapi_python_generated/models/community_page_invites_result.py +96 -0
  53. twitter_openapi_python_generated/models/community_page_join_action_result.py +92 -0
  54. twitter_openapi_python_generated/models/community_page_leave_action_result.py +96 -0
  55. twitter_openapi_python_generated/models/community_page_pin_action_result.py +92 -0
  56. twitter_openapi_python_generated/models/community_page_results.py +95 -0
  57. twitter_openapi_python_generated/models/community_primary_topic_name.py +89 -0
  58. twitter_openapi_python_generated/models/community_query_response.py +102 -0
  59. twitter_openapi_python_generated/models/community_query_response_data.py +93 -0
  60. twitter_openapi_python_generated/models/community_relay_rule.py +103 -0
  61. twitter_openapi_python_generated/models/community_search_community.py +134 -0
  62. twitter_openapi_python_generated/models/community_search_results.py +95 -0
  63. twitter_openapi_python_generated/models/community_settings_actions.py +101 -0
  64. twitter_openapi_python_generated/models/community_settings_community.py +183 -0
  65. twitter_openapi_python_generated/models/community_settings_creator.py +106 -0
  66. twitter_openapi_python_generated/models/community_settings_creator_core.py +89 -0
  67. twitter_openapi_python_generated/models/community_settings_creator_results.py +95 -0
  68. twitter_openapi_python_generated/models/community_settings_creator_verification.py +89 -0
  69. twitter_openapi_python_generated/models/community_settings_invites_result.py +90 -0
  70. twitter_openapi_python_generated/models/community_settings_results.py +95 -0
  71. twitter_openapi_python_generated/models/community_subtopic.py +99 -0
  72. twitter_openapi_python_generated/models/community_topic.py +108 -0
  73. twitter_openapi_python_generated/models/community_topic_results.py +96 -0
  74. twitter_openapi_python_generated/models/content_item_type.py +1 -0
  75. twitter_openapi_python_generated/models/creator_studio_tab_bar_item_query_response.py +102 -0
  76. twitter_openapi_python_generated/models/creator_studio_tab_bar_item_query_response_data.py +89 -0
  77. twitter_openapi_python_generated/models/data_saver_mode_response.py +102 -0
  78. twitter_openapi_python_generated/models/data_saver_mode_response_data.py +89 -0
  79. twitter_openapi_python_generated/models/error_extensions.py +1 -1
  80. twitter_openapi_python_generated/models/error_response.py +1 -1
  81. twitter_openapi_python_generated/models/event_summary_ad_metadata_container.py +91 -0
  82. twitter_openapi_python_generated/models/event_summary_event.py +97 -0
  83. twitter_openapi_python_generated/models/event_summary_media.py +99 -0
  84. twitter_openapi_python_generated/models/event_summary_media_entity.py +95 -0
  85. twitter_openapi_python_generated/models/event_summary_media_key.py +91 -0
  86. twitter_openapi_python_generated/models/event_summary_promoted_metadata.py +117 -0
  87. twitter_openapi_python_generated/models/explore_sidebar_response.py +102 -0
  88. twitter_openapi_python_generated/models/explore_sidebar_response_data.py +93 -0
  89. twitter_openapi_python_generated/models/feedback_action.py +0 -7
  90. twitter_openapi_python_generated/models/global_communities_latest_post_search.py +93 -0
  91. twitter_openapi_python_generated/models/global_communities_latest_post_search_timeline_response.py +102 -0
  92. twitter_openapi_python_generated/models/global_communities_latest_post_search_timeline_response_data.py +93 -0
  93. twitter_openapi_python_generated/models/global_communities_post_search.py +93 -0
  94. twitter_openapi_python_generated/models/global_communities_post_search_timeline_response.py +102 -0
  95. twitter_openapi_python_generated/models/global_communities_post_search_timeline_response_data.py +93 -0
  96. twitter_openapi_python_generated/models/grok_home.py +114 -0
  97. twitter_openapi_python_generated/models/grok_home_layout.py +98 -0
  98. twitter_openapi_python_generated/models/grok_home_layout_section.py +98 -0
  99. twitter_openapi_python_generated/models/grok_home_prompt.py +99 -0
  100. twitter_openapi_python_generated/models/grok_home_response.py +102 -0
  101. twitter_openapi_python_generated/models/grok_home_response_data.py +93 -0
  102. twitter_openapi_python_generated/models/grok_model_option.py +103 -0
  103. twitter_openapi_python_generated/models/grouped_trend.py +95 -0
  104. twitter_openapi_python_generated/models/item_content_union.py +27 -8
  105. twitter_openapi_python_generated/models/list_search.py +93 -0
  106. twitter_openapi_python_generated/models/list_search_timeline_response.py +102 -0
  107. twitter_openapi_python_generated/models/list_search_timeline_response_data.py +93 -0
  108. twitter_openapi_python_generated/models/lists_management_page_timeline_response.py +102 -0
  109. twitter_openapi_python_generated/models/lists_management_page_timeline_response_data.py +93 -0
  110. twitter_openapi_python_generated/models/lists_management_viewer.py +93 -0
  111. twitter_openapi_python_generated/models/module_footer.py +1 -8
  112. twitter_openapi_python_generated/models/notification_details.py +91 -0
  113. twitter_openapi_python_generated/models/pinned_timelines.py +89 -0
  114. twitter_openapi_python_generated/models/pinned_timelines_response.py +102 -0
  115. twitter_openapi_python_generated/models/pinned_timelines_response_data.py +93 -0
  116. twitter_openapi_python_generated/models/promoted_trend.py +97 -0
  117. twitter_openapi_python_generated/models/rich_message.py +10 -1
  118. twitter_openapi_python_generated/models/rich_message_entity.py +97 -0
  119. twitter_openapi_python_generated/models/rich_message_entity_ref.py +117 -0
  120. twitter_openapi_python_generated/models/search_timeline.py +2 -2
  121. twitter_openapi_python_generated/models/slice_info.py +89 -0
  122. twitter_openapi_python_generated/models/timeline_community.py +13 -17
  123. twitter_openapi_python_generated/models/timeline_event_summary.py +121 -0
  124. twitter_openapi_python_generated/models/timeline_message_prompt.py +13 -17
  125. twitter_openapi_python_generated/models/timeline_message_prompt_button.py +95 -0
  126. twitter_openapi_python_generated/models/timeline_message_prompt_button_action.py +91 -0
  127. twitter_openapi_python_generated/models/timeline_message_prompt_content.py +112 -0
  128. twitter_openapi_python_generated/models/timeline_message_prompt_rich_text.py +98 -0
  129. twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity.py +97 -0
  130. twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity_ref.py +107 -0
  131. twitter_openapi_python_generated/models/timeline_prompt.py +19 -17
  132. twitter_openapi_python_generated/models/timeline_prompt_callback.py +89 -0
  133. twitter_openapi_python_generated/models/timeline_prompt_content.py +124 -0
  134. twitter_openapi_python_generated/models/timeline_trend.py +18 -1
  135. twitter_openapi_python_generated/models/topic_carousel_query_response.py +102 -0
  136. twitter_openapi_python_generated/models/topic_carousel_query_response_data.py +93 -0
  137. twitter_openapi_python_generated/models/trend_metadata.py +3 -1
  138. twitter_openapi_python_generated/models/trend_promoted_metadata.py +111 -0
  139. twitter_openapi_python_generated/models/type_name.py +3 -0
  140. twitter_openapi_python_generated/models/users_verified_avatars_response.py +102 -0
  141. twitter_openapi_python_generated/models/users_verified_avatars_response_data.py +96 -0
  142. twitter_openapi_python_generated/models/verified_avatar_user.py +112 -0
  143. twitter_openapi_python_generated/models/verified_avatar_user_results.py +93 -0
  144. {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/METADATA +145 -9
  145. {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/RECORD +149 -32
  146. {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/WHEEL +0 -0
  147. {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/licenses/LICENSE +0 -0
  148. {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/licenses/LICENSE.AGPL +0 -0
  149. {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,124 @@
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
23
+ from twitter_openapi_python_generated.models.timeline_prompt_callback import TimelinePromptCallback
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class TimelinePromptContent(BaseModel):
29
+ """
30
+ TimelinePromptContent
31
+ """ # noqa: E501
32
+ confirmation: StrictStr
33
+ content_type: StrictStr = Field(alias="contentType")
34
+ display_type: StrictStr = Field(alias="displayType")
35
+ is_relevant_callback: TimelinePromptCallback = Field(alias="isRelevantCallback")
36
+ is_relevant_text: StrictStr = Field(alias="isRelevantText")
37
+ not_relevant_callback: TimelinePromptCallback = Field(alias="notRelevantCallback")
38
+ not_relevant_text: StrictStr = Field(alias="notRelevantText")
39
+ title: StrictStr
40
+ __properties: ClassVar[List[str]] = ["confirmation", "contentType", "displayType", "isRelevantCallback", "isRelevantText", "notRelevantCallback", "notRelevantText", "title"]
41
+
42
+ @field_validator('content_type')
43
+ def content_type_validate_enum(cls, value):
44
+ """Validates the enum"""
45
+ if value not in set(['TimelineRelevancePrompt']):
46
+ raise ValueError("must be one of enum values ('TimelineRelevancePrompt')")
47
+ return value
48
+
49
+ @field_validator('display_type')
50
+ def display_type_validate_enum(cls, value):
51
+ """Validates the enum"""
52
+ if value not in set(['Compact']):
53
+ raise ValueError("must be one of enum values ('Compact')")
54
+ return value
55
+
56
+ model_config = ConfigDict(
57
+ validate_by_name=True,
58
+ validate_by_alias=True,
59
+ validate_assignment=True,
60
+ protected_namespaces=(),
61
+ )
62
+
63
+
64
+ def to_str(self) -> str:
65
+ """Returns the string representation of the model using alias"""
66
+ return pprint.pformat(self.model_dump(by_alias=True))
67
+
68
+ def to_json(self) -> str:
69
+ """Returns the JSON representation of the model using alias"""
70
+ return json.dumps(to_jsonable_python(self.to_dict()))
71
+
72
+ @classmethod
73
+ def from_json(cls, json_str: str) -> Optional[Self]:
74
+ """Create an instance of TimelinePromptContent from a JSON string"""
75
+ return cls.from_dict(json.loads(json_str))
76
+
77
+ def to_dict(self) -> Dict[str, Any]:
78
+ """Return the dictionary representation of the model using alias.
79
+
80
+ This has the following differences from calling pydantic's
81
+ `self.model_dump(by_alias=True)`:
82
+
83
+ * `None` is only added to the output dict for nullable fields that
84
+ were set at model initialization. Other fields with value `None`
85
+ are ignored.
86
+ """
87
+ excluded_fields: Set[str] = set([
88
+ ])
89
+
90
+ _dict = self.model_dump(
91
+ by_alias=True,
92
+ exclude=excluded_fields,
93
+ exclude_none=True,
94
+ )
95
+ # override the default output from pydantic by calling `to_dict()` of is_relevant_callback
96
+ if self.is_relevant_callback:
97
+ _dict['isRelevantCallback'] = self.is_relevant_callback.to_dict()
98
+ # override the default output from pydantic by calling `to_dict()` of not_relevant_callback
99
+ if self.not_relevant_callback:
100
+ _dict['notRelevantCallback'] = self.not_relevant_callback.to_dict()
101
+ return _dict
102
+
103
+ @classmethod
104
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
105
+ """Create an instance of TimelinePromptContent from a dict"""
106
+ if obj is None:
107
+ return None
108
+
109
+ if not isinstance(obj, dict):
110
+ return cls.model_validate(obj)
111
+
112
+ _obj = cls.model_validate({
113
+ "confirmation": obj.get("confirmation"),
114
+ "contentType": obj.get("contentType"),
115
+ "displayType": obj.get("displayType"),
116
+ "isRelevantCallback": TimelinePromptCallback.from_dict(obj["isRelevantCallback"]) if obj.get("isRelevantCallback") is not None else None,
117
+ "isRelevantText": obj.get("isRelevantText"),
118
+ "notRelevantCallback": TimelinePromptCallback.from_dict(obj["notRelevantCallback"]) if obj.get("notRelevantCallback") is not None else None,
119
+ "notRelevantText": obj.get("notRelevantText"),
120
+ "title": obj.get("title")
121
+ })
122
+ return _obj
123
+
124
+
@@ -22,11 +22,13 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_
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.content_item_type import ContentItemType
25
+ from twitter_openapi_python_generated.models.grouped_trend import GroupedTrend
25
26
  from twitter_openapi_python_generated.models.social_context_landing_url import SocialContextLandingUrl
26
27
  from twitter_openapi_python_generated.models.social_context_union import SocialContextUnion
27
28
  from twitter_openapi_python_generated.models.thumbnail_image import ThumbnailImage
28
29
  from twitter_openapi_python_generated.models.trend_image import TrendImage
29
30
  from twitter_openapi_python_generated.models.trend_metadata import TrendMetadata
31
+ from twitter_openapi_python_generated.models.trend_promoted_metadata import TrendPromotedMetadata
30
32
  from twitter_openapi_python_generated.models.type_name import TypeName
31
33
  from typing import Optional, Set
32
34
  from typing_extensions import Self
@@ -37,16 +39,19 @@ class TimelineTrend(BaseModel):
37
39
  TimelineTrend
38
40
  """ # noqa: E501
39
41
  typename: TypeName = Field(alias="__typename")
42
+ description: Optional[StrictStr] = None
43
+ grouped_trends: Optional[List[GroupedTrend]] = None
40
44
  images: Optional[List[TrendImage]] = None
41
45
  is_ai_trend: Optional[StrictBool] = None
42
46
  item_type: Optional[ContentItemType] = Field(default=None, alias="itemType")
43
47
  name: StrictStr
48
+ promoted_metadata: Optional[TrendPromotedMetadata] = None
44
49
  rank: Optional[Annotated[str, Field(strict=True)]] = None
45
50
  social_context: Optional[SocialContextUnion] = None
46
51
  thumbnail_image: Optional[ThumbnailImage] = None
47
52
  trend_metadata: TrendMetadata
48
53
  trend_url: SocialContextLandingUrl
49
- __properties: ClassVar[List[str]] = ["__typename", "images", "is_ai_trend", "itemType", "name", "rank", "social_context", "thumbnail_image", "trend_metadata", "trend_url"]
54
+ __properties: ClassVar[List[str]] = ["__typename", "description", "grouped_trends", "images", "is_ai_trend", "itemType", "name", "promoted_metadata", "rank", "social_context", "thumbnail_image", "trend_metadata", "trend_url"]
50
55
 
51
56
  @field_validator('rank', mode="before")
52
57
  def rank_validate_regular_expression(cls, value):
@@ -97,12 +102,21 @@ class TimelineTrend(BaseModel):
97
102
  exclude=excluded_fields,
98
103
  exclude_none=True,
99
104
  )
105
+ # override the default output from pydantic by calling `to_dict()` of each item in grouped_trends (list)
106
+ _items = []
107
+ if self.grouped_trends:
108
+ for _item_grouped_trends in self.grouped_trends:
109
+ _items.append(_item_grouped_trends.to_dict() if _item_grouped_trends is not None else None)
110
+ _dict['grouped_trends'] = _items
100
111
  # override the default output from pydantic by calling `to_dict()` of each item in images (list)
101
112
  _items = []
102
113
  if self.images:
103
114
  for _item_images in self.images:
104
115
  _items.append(_item_images.to_dict() if _item_images is not None else None)
105
116
  _dict['images'] = _items
117
+ # override the default output from pydantic by calling `to_dict()` of promoted_metadata
118
+ if self.promoted_metadata:
119
+ _dict['promoted_metadata'] = self.promoted_metadata.to_dict()
106
120
  # override the default output from pydantic by calling `to_dict()` of social_context
107
121
  if self.social_context:
108
122
  _dict['social_context'] = self.social_context.to_dict()
@@ -128,10 +142,13 @@ class TimelineTrend(BaseModel):
128
142
 
129
143
  _obj = cls.model_validate({
130
144
  "__typename": obj.get("__typename"),
145
+ "description": obj.get("description"),
146
+ "grouped_trends": [GroupedTrend.from_dict(_item) for _item in obj["grouped_trends"]] if obj.get("grouped_trends") is not None else None,
131
147
  "images": [TrendImage.from_dict(_item) for _item in obj["images"]] if obj.get("images") is not None else None,
132
148
  "is_ai_trend": obj.get("is_ai_trend"),
133
149
  "itemType": obj.get("itemType"),
134
150
  "name": obj.get("name"),
151
+ "promoted_metadata": TrendPromotedMetadata.from_dict(obj["promoted_metadata"]) if obj.get("promoted_metadata") is not None else None,
135
152
  "rank": obj.get("rank"),
136
153
  "social_context": SocialContextUnion.from_dict(obj["social_context"]) if obj.get("social_context") is not None else None,
137
154
  "thumbnail_image": ThumbnailImage.from_dict(obj["thumbnail_image"]) if obj.get("thumbnail_image") is not None else None,
@@ -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.error_response import ErrorResponse
24
+ from twitter_openapi_python_generated.models.topic_carousel_query_response_data import TopicCarouselQueryResponseData
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class TopicCarouselQueryResponse(BaseModel):
30
+ """
31
+ TopicCarouselQueryResponse
32
+ """ # noqa: E501
33
+ data: TopicCarouselQueryResponseData
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 TopicCarouselQueryResponse 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 TopicCarouselQueryResponse 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": TopicCarouselQueryResponseData.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,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, Field
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.community_topic_results import CommunityTopicResults
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class TopicCarouselQueryResponseData(BaseModel):
29
+ """
30
+ TopicCarouselQueryResponseData
31
+ """ # noqa: E501
32
+ community_topic_results: CommunityTopicResults = Field(alias="communityTopicResults")
33
+ __properties: ClassVar[List[str]] = ["communityTopicResults"]
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 TopicCarouselQueryResponseData 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 community_topic_results
75
+ if self.community_topic_results:
76
+ _dict['communityTopicResults'] = self.community_topic_results.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 TopicCarouselQueryResponseData 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
+ "communityTopicResults": CommunityTopicResults.from_dict(obj["communityTopicResults"]) if obj.get("communityTopicResults") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -30,8 +30,9 @@ class TrendMetadata(BaseModel):
30
30
  TrendMetadata
31
31
  """ # noqa: E501
32
32
  domain_context: Optional[StrictStr] = None
33
+ meta_description: Optional[StrictStr] = None
33
34
  url: Optional[SocialContextLandingUrl] = None
34
- __properties: ClassVar[List[str]] = ["domain_context", "url"]
35
+ __properties: ClassVar[List[str]] = ["domain_context", "meta_description", "url"]
35
36
 
36
37
  model_config = ConfigDict(
37
38
  validate_by_name=True,
@@ -88,6 +89,7 @@ class TrendMetadata(BaseModel):
88
89
 
89
90
  _obj = cls.model_validate({
90
91
  "domain_context": obj.get("domain_context"),
92
+ "meta_description": obj.get("meta_description"),
91
93
  "url": SocialContextLandingUrl.from_dict(obj["url"]) if obj.get("url") is not None else None
92
94
  })
93
95
  return _obj
@@ -0,0 +1,111 @@
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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.promoted_trend import PromotedTrend
24
+ from twitter_openapi_python_generated.models.user_results import UserResults
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class TrendPromotedMetadata(BaseModel):
30
+ """
31
+ TrendPromotedMetadata
32
+ """ # noqa: E501
33
+ advertiser_results: UserResults
34
+ disclosure_type: StrictStr = Field(alias="disclosureType")
35
+ impression_id: StrictStr = Field(alias="impressionId")
36
+ impression_string: StrictStr = Field(alias="impressionString")
37
+ promoted_trend: PromotedTrend = Field(alias="promotedTrend")
38
+ promoted_trend_description: StrictStr = Field(alias="promotedTrendDescription")
39
+ promoted_trend_name: StrictStr = Field(alias="promotedTrendName")
40
+ promoted_trend_query_term: StrictStr = Field(alias="promotedTrendQueryTerm")
41
+ __properties: ClassVar[List[str]] = ["advertiser_results", "disclosureType", "impressionId", "impressionString", "promotedTrend", "promotedTrendDescription", "promotedTrendName", "promotedTrendQueryTerm"]
42
+
43
+ model_config = ConfigDict(
44
+ validate_by_name=True,
45
+ validate_by_alias=True,
46
+ validate_assignment=True,
47
+ protected_namespaces=(),
48
+ )
49
+
50
+
51
+ def to_str(self) -> str:
52
+ """Returns the string representation of the model using alias"""
53
+ return pprint.pformat(self.model_dump(by_alias=True))
54
+
55
+ def to_json(self) -> str:
56
+ """Returns the JSON representation of the model using alias"""
57
+ return json.dumps(to_jsonable_python(self.to_dict()))
58
+
59
+ @classmethod
60
+ def from_json(cls, json_str: str) -> Optional[Self]:
61
+ """Create an instance of TrendPromotedMetadata from a JSON string"""
62
+ return cls.from_dict(json.loads(json_str))
63
+
64
+ def to_dict(self) -> Dict[str, Any]:
65
+ """Return the dictionary representation of the model using alias.
66
+
67
+ This has the following differences from calling pydantic's
68
+ `self.model_dump(by_alias=True)`:
69
+
70
+ * `None` is only added to the output dict for nullable fields that
71
+ were set at model initialization. Other fields with value `None`
72
+ are ignored.
73
+ """
74
+ excluded_fields: Set[str] = set([
75
+ ])
76
+
77
+ _dict = self.model_dump(
78
+ by_alias=True,
79
+ exclude=excluded_fields,
80
+ exclude_none=True,
81
+ )
82
+ # override the default output from pydantic by calling `to_dict()` of advertiser_results
83
+ if self.advertiser_results:
84
+ _dict['advertiser_results'] = self.advertiser_results.to_dict()
85
+ # override the default output from pydantic by calling `to_dict()` of promoted_trend
86
+ if self.promoted_trend:
87
+ _dict['promotedTrend'] = self.promoted_trend.to_dict()
88
+ return _dict
89
+
90
+ @classmethod
91
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
92
+ """Create an instance of TrendPromotedMetadata from a dict"""
93
+ if obj is None:
94
+ return None
95
+
96
+ if not isinstance(obj, dict):
97
+ return cls.model_validate(obj)
98
+
99
+ _obj = cls.model_validate({
100
+ "advertiser_results": UserResults.from_dict(obj["advertiser_results"]) if obj.get("advertiser_results") is not None else None,
101
+ "disclosureType": obj.get("disclosureType"),
102
+ "impressionId": obj.get("impressionId"),
103
+ "impressionString": obj.get("impressionString"),
104
+ "promotedTrend": PromotedTrend.from_dict(obj["promotedTrend"]) if obj.get("promotedTrend") is not None else None,
105
+ "promotedTrendDescription": obj.get("promotedTrendDescription"),
106
+ "promotedTrendName": obj.get("promotedTrendName"),
107
+ "promotedTrendQueryTerm": obj.get("promotedTrendQueryTerm")
108
+ })
109
+ return _obj
110
+
111
+
@@ -32,6 +32,7 @@ class TypeName(str, Enum):
32
32
  TIMELINEFRAME = 'TimelineFrame'
33
33
  TIMELINETWITTERLIST = 'TimelineTwitterList'
34
34
  TIMELINELABEL = 'TimelineLabel'
35
+ TIMELINEEVENTSUMMARY = 'TimelineEventSummary'
35
36
  TIMELINETIMELINEITEM = 'TimelineTimelineItem'
36
37
  TIMELINEUSER = 'TimelineUser'
37
38
  TIMELINETIMELINECURSOR = 'TimelineTimelineCursor'
@@ -64,6 +65,8 @@ class TypeName(str, Enum):
64
65
  APIIMAGE = 'ApiImage'
65
66
  APIMEDIA = 'ApiMedia'
66
67
  COMMUNITYUSERDEFAULTMODERATIONSTATE = 'CommunityUserDefaultModerationState'
68
+ COMMUNITYHASHTAGSLICE = 'CommunityHashtagSlice'
69
+ COMMUNITYLISTMEMBERSACTION = 'CommunityListMembersAction'
67
70
  CTALIMITEDACTIONPROMPT = 'CtaLimitedActionPrompt'
68
71
  TIMELINERICHTEXTUSER = 'TimelineRichTextUser'
69
72
 
@@ -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.error_response import ErrorResponse
24
+ from twitter_openapi_python_generated.models.users_verified_avatars_response_data import UsersVerifiedAvatarsResponseData
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class UsersVerifiedAvatarsResponse(BaseModel):
30
+ """
31
+ UsersVerifiedAvatarsResponse
32
+ """ # noqa: E501
33
+ data: UsersVerifiedAvatarsResponseData
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 UsersVerifiedAvatarsResponse 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 UsersVerifiedAvatarsResponse 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": UsersVerifiedAvatarsResponseData.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
+