twitter-openapi-python-generated 0.1.1__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 (223) hide show
  1. twitter_openapi_python_generated/__init__.py +323 -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 +2831 -71
  6. twitter_openapi_python_generated/api/tweet_api.py +778 -142
  7. twitter_openapi_python_generated/api/user_api.py +301 -0
  8. twitter_openapi_python_generated/api/user_list_api.py +1145 -192
  9. twitter_openapi_python_generated/api/users_api.py +655 -19
  10. twitter_openapi_python_generated/api_client.py +1 -1
  11. twitter_openapi_python_generated/configuration.py +1 -1
  12. twitter_openapi_python_generated/models/__init__.py +159 -0
  13. twitter_openapi_python_generated/models/about_account_data.py +93 -0
  14. twitter_openapi_python_generated/models/about_account_response.py +102 -0
  15. twitter_openapi_python_generated/models/about_account_user.py +161 -0
  16. twitter_openapi_python_generated/models/about_account_user_result.py +95 -0
  17. twitter_openapi_python_generated/models/about_account_verification_info.py +95 -0
  18. twitter_openapi_python_generated/models/about_account_verification_info_reason.py +99 -0
  19. twitter_openapi_python_generated/models/about_profile.py +103 -0
  20. twitter_openapi_python_generated/models/about_profile_username_changes.py +109 -0
  21. twitter_openapi_python_generated/models/ad_metadata_container.py +5 -3
  22. twitter_openapi_python_generated/models/ai_trend.py +126 -0
  23. twitter_openapi_python_generated/models/ai_trend_core.py +95 -0
  24. twitter_openapi_python_generated/models/ai_trend_results.py +95 -0
  25. twitter_openapi_python_generated/models/ai_trend_social_proof.py +89 -0
  26. twitter_openapi_python_generated/models/article_content_block.py +117 -0
  27. twitter_openapi_python_generated/models/article_content_block_data.py +104 -0
  28. twitter_openapi_python_generated/models/article_content_entity.py +95 -0
  29. twitter_openapi_python_generated/models/article_content_entity_data.py +115 -0
  30. twitter_openapi_python_generated/models/article_content_entity_range.py +93 -0
  31. twitter_openapi_python_generated/models/article_content_entity_value.py +104 -0
  32. twitter_openapi_python_generated/models/article_content_inline_style_range.py +100 -0
  33. twitter_openapi_python_generated/models/article_content_media_item.py +101 -0
  34. twitter_openapi_python_generated/models/article_content_state.py +105 -0
  35. twitter_openapi_python_generated/models/article_content_text_range.py +93 -0
  36. twitter_openapi_python_generated/models/article_result.py +9 -3
  37. twitter_openapi_python_generated/models/audio_space.py +107 -0
  38. twitter_openapi_python_generated/models/audio_space_data.py +93 -0
  39. twitter_openapi_python_generated/models/audio_space_mentioned_user.py +97 -0
  40. twitter_openapi_python_generated/models/audio_space_metadata.py +165 -0
  41. twitter_openapi_python_generated/models/audio_space_participant.py +109 -0
  42. twitter_openapi_python_generated/models/audio_space_participant_user.py +104 -0
  43. twitter_openapi_python_generated/models/audio_space_participant_user_results.py +103 -0
  44. twitter_openapi_python_generated/models/audio_space_participant_verification.py +99 -0
  45. twitter_openapi_python_generated/models/audio_space_participants.py +114 -0
  46. twitter_openapi_python_generated/models/audio_space_response.py +102 -0
  47. twitter_openapi_python_generated/models/audio_space_sharings.py +91 -0
  48. twitter_openapi_python_generated/models/authenticate_periscope_response.py +102 -0
  49. twitter_openapi_python_generated/models/authenticate_periscope_response_data.py +89 -0
  50. twitter_openapi_python_generated/models/birdwatch_alias_self_select_status.py +91 -0
  51. twitter_openapi_python_generated/models/birdwatch_fetch_alias_self_select_status_response.py +102 -0
  52. twitter_openapi_python_generated/models/birdwatch_fetch_alias_self_select_status_response_data.py +93 -0
  53. twitter_openapi_python_generated/models/birdwatch_fetch_authenticated_user_profile_response.py +102 -0
  54. twitter_openapi_python_generated/models/birdwatch_fetch_authenticated_user_profile_response_data.py +93 -0
  55. twitter_openapi_python_generated/models/birdwatch_fetch_birdwatch_profile_response.py +102 -0
  56. twitter_openapi_python_generated/models/birdwatch_fetch_birdwatch_profile_response_data.py +93 -0
  57. twitter_openapi_python_generated/models/birdwatch_fetch_global_timeline_response.py +102 -0
  58. twitter_openapi_python_generated/models/birdwatch_fetch_global_timeline_response_data.py +93 -0
  59. twitter_openapi_python_generated/models/birdwatch_fetch_public_data_response.py +102 -0
  60. twitter_openapi_python_generated/models/birdwatch_fetch_public_data_response_data.py +93 -0
  61. twitter_openapi_python_generated/models/birdwatch_home_page.py +101 -0
  62. twitter_openapi_python_generated/models/birdwatch_home_page_body.py +104 -0
  63. twitter_openapi_python_generated/models/birdwatch_home_timeline.py +97 -0
  64. twitter_openapi_python_generated/models/birdwatch_pivot.py +0 -17
  65. twitter_openapi_python_generated/models/birdwatch_profile.py +89 -0
  66. twitter_openapi_python_generated/models/birdwatch_public_data_file.py +91 -0
  67. twitter_openapi_python_generated/models/birdwatch_public_data_file_bundle.py +113 -0
  68. twitter_openapi_python_generated/models/birdwatch_viewer.py +93 -0
  69. twitter_openapi_python_generated/models/bookmark_search.py +93 -0
  70. twitter_openapi_python_generated/models/bookmark_search_timeline_response.py +102 -0
  71. twitter_openapi_python_generated/models/bookmark_search_timeline_response_data.py +93 -0
  72. twitter_openapi_python_generated/models/broadcast.py +159 -0
  73. twitter_openapi_python_generated/models/broadcast_data.py +93 -0
  74. twitter_openapi_python_generated/models/broadcast_edited_replay.py +89 -0
  75. twitter_openapi_python_generated/models/broadcast_periscope_user.py +95 -0
  76. twitter_openapi_python_generated/models/broadcast_response.py +102 -0
  77. twitter_openapi_python_generated/models/cashtag_attachment.py +6 -4
  78. twitter_openapi_python_generated/models/client_event_info_details.py +8 -2
  79. twitter_openapi_python_generated/models/communities_fetch_one_query_response.py +102 -0
  80. twitter_openapi_python_generated/models/communities_fetch_one_query_response_data.py +93 -0
  81. twitter_openapi_python_generated/models/communities_search_query_response.py +102 -0
  82. twitter_openapi_python_generated/models/communities_search_query_response_data.py +93 -0
  83. twitter_openapi_python_generated/models/communities_search_slice.py +102 -0
  84. twitter_openapi_python_generated/models/community.py +2 -2
  85. twitter_openapi_python_generated/models/community_delete_action_result.py +1 -8
  86. twitter_openapi_python_generated/models/community_facepile_user.py +98 -0
  87. twitter_openapi_python_generated/models/community_facepile_user_results.py +95 -0
  88. twitter_openapi_python_generated/models/community_hashtag.py +91 -0
  89. twitter_openapi_python_generated/models/community_hashtag_slice.py +99 -0
  90. twitter_openapi_python_generated/models/community_id_user_results.py +95 -0
  91. twitter_openapi_python_generated/models/community_invites_result.py +1 -8
  92. twitter_openapi_python_generated/models/community_join_action_unavailable.py +1 -8
  93. twitter_openapi_python_generated/models/community_leave_action_result.py +1 -8
  94. twitter_openapi_python_generated/models/community_list_members_action_result.py +90 -0
  95. twitter_openapi_python_generated/models/community_page_actions.py +113 -0
  96. twitter_openapi_python_generated/models/community_page_community.py +187 -0
  97. twitter_openapi_python_generated/models/community_page_delete_action_result.py +94 -0
  98. twitter_openapi_python_generated/models/community_page_invites_result.py +96 -0
  99. twitter_openapi_python_generated/models/community_page_join_action_result.py +92 -0
  100. twitter_openapi_python_generated/models/community_page_leave_action_result.py +96 -0
  101. twitter_openapi_python_generated/models/community_page_pin_action_result.py +92 -0
  102. twitter_openapi_python_generated/models/community_page_results.py +95 -0
  103. twitter_openapi_python_generated/models/community_primary_topic_name.py +89 -0
  104. twitter_openapi_python_generated/models/community_query_response.py +102 -0
  105. twitter_openapi_python_generated/models/community_query_response_data.py +93 -0
  106. twitter_openapi_python_generated/models/community_relay_rule.py +103 -0
  107. twitter_openapi_python_generated/models/community_search_community.py +134 -0
  108. twitter_openapi_python_generated/models/community_search_results.py +95 -0
  109. twitter_openapi_python_generated/models/community_settings_actions.py +101 -0
  110. twitter_openapi_python_generated/models/community_settings_community.py +183 -0
  111. twitter_openapi_python_generated/models/community_settings_creator.py +106 -0
  112. twitter_openapi_python_generated/models/community_settings_creator_core.py +89 -0
  113. twitter_openapi_python_generated/models/community_settings_creator_results.py +95 -0
  114. twitter_openapi_python_generated/models/community_settings_creator_verification.py +89 -0
  115. twitter_openapi_python_generated/models/community_settings_invites_result.py +90 -0
  116. twitter_openapi_python_generated/models/community_settings_results.py +95 -0
  117. twitter_openapi_python_generated/models/community_subtopic.py +99 -0
  118. twitter_openapi_python_generated/models/community_topic.py +108 -0
  119. twitter_openapi_python_generated/models/community_topic_results.py +96 -0
  120. twitter_openapi_python_generated/models/content_item_type.py +1 -0
  121. twitter_openapi_python_generated/models/conversation_control.py +8 -1
  122. twitter_openapi_python_generated/models/conversation_details.py +1 -8
  123. twitter_openapi_python_generated/models/cover_cta.py +5 -15
  124. twitter_openapi_python_generated/models/creator_studio_tab_bar_item_query_response.py +102 -0
  125. twitter_openapi_python_generated/models/creator_studio_tab_bar_item_query_response_data.py +89 -0
  126. twitter_openapi_python_generated/models/cta_client_event_info.py +1 -8
  127. twitter_openapi_python_generated/models/cta_limited_action_prompt.py +1 -8
  128. twitter_openapi_python_generated/models/data_saver_mode_response.py +102 -0
  129. twitter_openapi_python_generated/models/data_saver_mode_response_data.py +89 -0
  130. twitter_openapi_python_generated/models/event_summary_ad_metadata_container.py +91 -0
  131. twitter_openapi_python_generated/models/event_summary_event.py +97 -0
  132. twitter_openapi_python_generated/models/event_summary_media.py +99 -0
  133. twitter_openapi_python_generated/models/event_summary_media_entity.py +95 -0
  134. twitter_openapi_python_generated/models/event_summary_media_key.py +91 -0
  135. twitter_openapi_python_generated/models/event_summary_promoted_metadata.py +117 -0
  136. twitter_openapi_python_generated/models/explore_sidebar_response.py +102 -0
  137. twitter_openapi_python_generated/models/explore_sidebar_response_data.py +93 -0
  138. twitter_openapi_python_generated/models/feedback_action.py +1 -28
  139. twitter_openapi_python_generated/models/global_communities_latest_post_search.py +93 -0
  140. twitter_openapi_python_generated/models/global_communities_latest_post_search_timeline_response.py +102 -0
  141. twitter_openapi_python_generated/models/global_communities_latest_post_search_timeline_response_data.py +93 -0
  142. twitter_openapi_python_generated/models/global_communities_post_search.py +93 -0
  143. twitter_openapi_python_generated/models/global_communities_post_search_timeline_response.py +102 -0
  144. twitter_openapi_python_generated/models/global_communities_post_search_timeline_response_data.py +93 -0
  145. twitter_openapi_python_generated/models/grok_account_jwt.py +89 -0
  146. twitter_openapi_python_generated/models/grok_account_jwt_data.py +93 -0
  147. twitter_openapi_python_generated/models/grok_account_jwt_response.py +102 -0
  148. twitter_openapi_python_generated/models/grok_entity_ref.py +19 -4
  149. twitter_openapi_python_generated/models/grok_home.py +114 -0
  150. twitter_openapi_python_generated/models/grok_home_layout.py +98 -0
  151. twitter_openapi_python_generated/models/grok_home_layout_section.py +98 -0
  152. twitter_openapi_python_generated/models/grok_home_prompt.py +99 -0
  153. twitter_openapi_python_generated/models/grok_home_response.py +102 -0
  154. twitter_openapi_python_generated/models/grok_home_response_data.py +93 -0
  155. twitter_openapi_python_generated/models/grok_image_annotation.py +2 -2
  156. twitter_openapi_python_generated/models/grok_model_option.py +103 -0
  157. twitter_openapi_python_generated/models/identity_profile_labels_highlighted_label.py +93 -0
  158. twitter_openapi_python_generated/models/item_content_union.py +27 -8
  159. twitter_openapi_python_generated/models/limited_action.py +8 -1
  160. twitter_openapi_python_generated/models/limited_action_results_data.py +8 -1
  161. twitter_openapi_python_generated/models/list_search.py +93 -0
  162. twitter_openapi_python_generated/models/list_search_timeline_response.py +102 -0
  163. twitter_openapi_python_generated/models/list_search_timeline_response_data.py +93 -0
  164. twitter_openapi_python_generated/models/lists_management_page_timeline_response.py +102 -0
  165. twitter_openapi_python_generated/models/lists_management_page_timeline_response_data.py +93 -0
  166. twitter_openapi_python_generated/models/lists_management_viewer.py +93 -0
  167. twitter_openapi_python_generated/models/media_result.py +1 -1
  168. twitter_openapi_python_generated/models/module_footer.py +1 -8
  169. twitter_openapi_python_generated/models/module_header.py +8 -9
  170. twitter_openapi_python_generated/models/note_tweet_result_data.py +2 -2
  171. twitter_openapi_python_generated/models/notification_details.py +91 -0
  172. twitter_openapi_python_generated/models/pinned_timelines.py +89 -0
  173. twitter_openapi_python_generated/models/pinned_timelines_response.py +102 -0
  174. twitter_openapi_python_generated/models/pinned_timelines_response_data.py +93 -0
  175. twitter_openapi_python_generated/models/promoted_trend.py +97 -0
  176. twitter_openapi_python_generated/models/rich_message.py +10 -1
  177. twitter_openapi_python_generated/models/rich_message_entity.py +97 -0
  178. twitter_openapi_python_generated/models/rich_message_entity_ref.py +117 -0
  179. twitter_openapi_python_generated/models/session.py +0 -7
  180. twitter_openapi_python_generated/models/sidebar_user_recommendation.py +95 -0
  181. twitter_openapi_python_generated/models/sidebar_user_recommendations_data.py +96 -0
  182. twitter_openapi_python_generated/models/sidebar_user_recommendations_response.py +102 -0
  183. twitter_openapi_python_generated/models/slice_info.py +89 -0
  184. twitter_openapi_python_generated/models/story_topic.py +95 -0
  185. twitter_openapi_python_generated/models/story_topic_data.py +93 -0
  186. twitter_openapi_python_generated/models/story_topic_item.py +93 -0
  187. twitter_openapi_python_generated/models/story_topic_response.py +102 -0
  188. twitter_openapi_python_generated/models/story_topic_stories.py +96 -0
  189. twitter_openapi_python_generated/models/timeline_event_summary.py +121 -0
  190. twitter_openapi_python_generated/models/timeline_general_context.py +2 -2
  191. twitter_openapi_python_generated/models/timeline_half_cover.py +0 -7
  192. twitter_openapi_python_generated/models/timeline_message_prompt_content.py +1 -8
  193. twitter_openapi_python_generated/models/timeline_prompt_content.py +1 -15
  194. twitter_openapi_python_generated/models/timeline_show_alert.py +1 -15
  195. twitter_openapi_python_generated/models/timeline_tombstone.py +1 -11
  196. twitter_openapi_python_generated/models/timeline_topic_context.py +1 -11
  197. twitter_openapi_python_generated/models/timeline_trend.py +9 -1
  198. twitter_openapi_python_generated/models/topic_carousel_query_response.py +102 -0
  199. twitter_openapi_python_generated/models/topic_carousel_query_response_data.py +93 -0
  200. twitter_openapi_python_generated/models/trend_metadata.py +3 -1
  201. twitter_openapi_python_generated/models/trend_promoted_metadata.py +111 -0
  202. twitter_openapi_python_generated/models/tweet.py +4 -2
  203. twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +8 -1
  204. twitter_openapi_python_generated/models/tweet_card_platform_audience.py +1 -8
  205. twitter_openapi_python_generated/models/tweet_legacy.py +18 -3
  206. twitter_openapi_python_generated/models/tweet_legacy_place.py +107 -0
  207. twitter_openapi_python_generated/models/tweet_legacy_place_bounding_box.py +98 -0
  208. twitter_openapi_python_generated/models/tweet_legacy_point.py +98 -0
  209. twitter_openapi_python_generated/models/tweet_post_cta.py +1 -9
  210. twitter_openapi_python_generated/models/type_name.py +4 -0
  211. twitter_openapi_python_generated/models/unified_card.py +1 -8
  212. twitter_openapi_python_generated/models/user_highlights_tweets_result.py +2 -2
  213. twitter_openapi_python_generated/models/user_tweets_result_v1.py +2 -2
  214. twitter_openapi_python_generated/models/users_verified_avatars_response.py +102 -0
  215. twitter_openapi_python_generated/models/users_verified_avatars_response_data.py +96 -0
  216. twitter_openapi_python_generated/models/verified_avatar_user.py +112 -0
  217. twitter_openapi_python_generated/models/verified_avatar_user_results.py +93 -0
  218. {twitter_openapi_python_generated-0.1.1.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/METADATA +195 -9
  219. {twitter_openapi_python_generated-0.1.1.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/RECORD +223 -62
  220. {twitter_openapi_python_generated-0.1.1.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/WHEEL +0 -0
  221. {twitter_openapi_python_generated-0.1.1.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/licenses/LICENSE +0 -0
  222. {twitter_openapi_python_generated-0.1.1.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/licenses/LICENSE.AGPL +0 -0
  223. {twitter_openapi_python_generated-0.1.1.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/top_level.txt +0 -0
@@ -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.community_search_community import CommunitySearchCommunity
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class CommunitySearchResults(BaseModel):
29
+ """
30
+ CommunitySearchResults
31
+ """ # noqa: E501
32
+ id: StrictStr
33
+ result: CommunitySearchCommunity
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 CommunitySearchResults 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 CommunitySearchResults 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": CommunitySearchCommunity.from_dict(obj["result"]) if obj.get("result") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,101 @@
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.community_join_action_result_union import CommunityJoinActionResultUnion
24
+ from twitter_openapi_python_generated.models.community_list_members_action_result import CommunityListMembersActionResult
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class CommunitySettingsActions(BaseModel):
30
+ """
31
+ CommunitySettingsActions
32
+ """ # noqa: E501
33
+ id: StrictStr
34
+ join_action_result: CommunityJoinActionResultUnion
35
+ list_members_action_result: CommunityListMembersActionResult
36
+ __properties: ClassVar[List[str]] = ["id", "join_action_result", "list_members_action_result"]
37
+
38
+ model_config = ConfigDict(
39
+ validate_by_name=True,
40
+ validate_by_alias=True,
41
+ validate_assignment=True,
42
+ protected_namespaces=(),
43
+ )
44
+
45
+
46
+ def to_str(self) -> str:
47
+ """Returns the string representation of the model using alias"""
48
+ return pprint.pformat(self.model_dump(by_alias=True))
49
+
50
+ def to_json(self) -> str:
51
+ """Returns the JSON representation of the model using alias"""
52
+ return json.dumps(to_jsonable_python(self.to_dict()))
53
+
54
+ @classmethod
55
+ def from_json(cls, json_str: str) -> Optional[Self]:
56
+ """Create an instance of CommunitySettingsActions from a JSON string"""
57
+ return cls.from_dict(json.loads(json_str))
58
+
59
+ def to_dict(self) -> Dict[str, Any]:
60
+ """Return the dictionary representation of the model using alias.
61
+
62
+ This has the following differences from calling pydantic's
63
+ `self.model_dump(by_alias=True)`:
64
+
65
+ * `None` is only added to the output dict for nullable fields that
66
+ were set at model initialization. Other fields with value `None`
67
+ are ignored.
68
+ """
69
+ excluded_fields: Set[str] = set([
70
+ ])
71
+
72
+ _dict = self.model_dump(
73
+ by_alias=True,
74
+ exclude=excluded_fields,
75
+ exclude_none=True,
76
+ )
77
+ # override the default output from pydantic by calling `to_dict()` of join_action_result
78
+ if self.join_action_result:
79
+ _dict['join_action_result'] = self.join_action_result.to_dict()
80
+ # override the default output from pydantic by calling `to_dict()` of list_members_action_result
81
+ if self.list_members_action_result:
82
+ _dict['list_members_action_result'] = self.list_members_action_result.to_dict()
83
+ return _dict
84
+
85
+ @classmethod
86
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
87
+ """Create an instance of CommunitySettingsActions from a dict"""
88
+ if obj is None:
89
+ return None
90
+
91
+ if not isinstance(obj, dict):
92
+ return cls.model_validate(obj)
93
+
94
+ _obj = cls.model_validate({
95
+ "id": obj.get("id"),
96
+ "join_action_result": CommunityJoinActionResultUnion.from_dict(obj["join_action_result"]) if obj.get("join_action_result") is not None else None,
97
+ "list_members_action_result": CommunityListMembersActionResult.from_dict(obj["list_members_action_result"]) if obj.get("list_members_action_result") is not None else None
98
+ })
99
+ return _obj
100
+
101
+
@@ -0,0 +1,183 @@
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, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing_extensions import Annotated
24
+ from twitter_openapi_python_generated.models.community_banner_media import CommunityBannerMedia
25
+ from twitter_openapi_python_generated.models.community_facepile_user_results import CommunityFacepileUserResults
26
+ from twitter_openapi_python_generated.models.community_hashtag_slice import CommunityHashtagSlice
27
+ from twitter_openapi_python_generated.models.community_join_requests_result import CommunityJoinRequestsResult
28
+ from twitter_openapi_python_generated.models.community_primary_topic_name import CommunityPrimaryTopicName
29
+ from twitter_openapi_python_generated.models.community_relay_rule import CommunityRelayRule
30
+ from twitter_openapi_python_generated.models.community_settings_actions import CommunitySettingsActions
31
+ from twitter_openapi_python_generated.models.community_settings_creator_results import CommunitySettingsCreatorResults
32
+ from twitter_openapi_python_generated.models.community_settings_invites_result import CommunitySettingsInvitesResult
33
+ from twitter_openapi_python_generated.models.type_name import TypeName
34
+ from typing import Optional, Set
35
+ from typing_extensions import Self
36
+ from pydantic_core import to_jsonable_python
37
+
38
+ class CommunitySettingsCommunity(BaseModel):
39
+ """
40
+ CommunitySettingsCommunity
41
+ """ # noqa: E501
42
+ typename: TypeName = Field(alias="__typename")
43
+ actions: CommunitySettingsActions
44
+ created_at: StrictInt
45
+ creator_results: CommunitySettingsCreatorResults
46
+ custom_banner_media: CommunityBannerMedia
47
+ default_banner_media: CommunityBannerMedia
48
+ description: StrictStr
49
+ id: StrictStr
50
+ invites_result: CommunitySettingsInvitesResult
51
+ is_member: StrictBool
52
+ is_nsfw: StrictBool
53
+ join_policy: StrictStr
54
+ join_requests_result: CommunityJoinRequestsResult
55
+ member_count: StrictInt
56
+ members_facepile_results: List[CommunityFacepileUserResults]
57
+ name: StrictStr
58
+ primary_community_topic: CommunityPrimaryTopicName
59
+ rest_id: Annotated[str, Field(strict=True)]
60
+ role: StrictStr
61
+ rules: List[CommunityRelayRule]
62
+ trending_hashtags_slice: CommunityHashtagSlice
63
+ __properties: ClassVar[List[str]] = ["__typename", "actions", "created_at", "creator_results", "custom_banner_media", "default_banner_media", "description", "id", "invites_result", "is_member", "is_nsfw", "join_policy", "join_requests_result", "member_count", "members_facepile_results", "name", "primary_community_topic", "rest_id", "role", "rules", "trending_hashtags_slice"]
64
+
65
+ @field_validator('rest_id', mode="before")
66
+ def rest_id_validate_regular_expression(cls, value):
67
+ """Validates the regular expression"""
68
+ if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
69
+ raise ValueError(r"must validate the regular expression /^[0-9]+$/")
70
+ return value
71
+
72
+ model_config = ConfigDict(
73
+ validate_by_name=True,
74
+ validate_by_alias=True,
75
+ validate_assignment=True,
76
+ protected_namespaces=(),
77
+ )
78
+
79
+
80
+ def to_str(self) -> str:
81
+ """Returns the string representation of the model using alias"""
82
+ return pprint.pformat(self.model_dump(by_alias=True))
83
+
84
+ def to_json(self) -> str:
85
+ """Returns the JSON representation of the model using alias"""
86
+ return json.dumps(to_jsonable_python(self.to_dict()))
87
+
88
+ @classmethod
89
+ def from_json(cls, json_str: str) -> Optional[Self]:
90
+ """Create an instance of CommunitySettingsCommunity from a JSON string"""
91
+ return cls.from_dict(json.loads(json_str))
92
+
93
+ def to_dict(self) -> Dict[str, Any]:
94
+ """Return the dictionary representation of the model using alias.
95
+
96
+ This has the following differences from calling pydantic's
97
+ `self.model_dump(by_alias=True)`:
98
+
99
+ * `None` is only added to the output dict for nullable fields that
100
+ were set at model initialization. Other fields with value `None`
101
+ are ignored.
102
+ """
103
+ excluded_fields: Set[str] = set([
104
+ ])
105
+
106
+ _dict = self.model_dump(
107
+ by_alias=True,
108
+ exclude=excluded_fields,
109
+ exclude_none=True,
110
+ )
111
+ # override the default output from pydantic by calling `to_dict()` of actions
112
+ if self.actions:
113
+ _dict['actions'] = self.actions.to_dict()
114
+ # override the default output from pydantic by calling `to_dict()` of creator_results
115
+ if self.creator_results:
116
+ _dict['creator_results'] = self.creator_results.to_dict()
117
+ # override the default output from pydantic by calling `to_dict()` of custom_banner_media
118
+ if self.custom_banner_media:
119
+ _dict['custom_banner_media'] = self.custom_banner_media.to_dict()
120
+ # override the default output from pydantic by calling `to_dict()` of default_banner_media
121
+ if self.default_banner_media:
122
+ _dict['default_banner_media'] = self.default_banner_media.to_dict()
123
+ # override the default output from pydantic by calling `to_dict()` of invites_result
124
+ if self.invites_result:
125
+ _dict['invites_result'] = self.invites_result.to_dict()
126
+ # override the default output from pydantic by calling `to_dict()` of join_requests_result
127
+ if self.join_requests_result:
128
+ _dict['join_requests_result'] = self.join_requests_result.to_dict()
129
+ # override the default output from pydantic by calling `to_dict()` of each item in members_facepile_results (list)
130
+ _items = []
131
+ if self.members_facepile_results:
132
+ for _item_members_facepile_results in self.members_facepile_results:
133
+ _items.append(_item_members_facepile_results.to_dict() if _item_members_facepile_results is not None else None)
134
+ _dict['members_facepile_results'] = _items
135
+ # override the default output from pydantic by calling `to_dict()` of primary_community_topic
136
+ if self.primary_community_topic:
137
+ _dict['primary_community_topic'] = self.primary_community_topic.to_dict()
138
+ # override the default output from pydantic by calling `to_dict()` of each item in rules (list)
139
+ _items = []
140
+ if self.rules:
141
+ for _item_rules in self.rules:
142
+ _items.append(_item_rules.to_dict() if _item_rules is not None else None)
143
+ _dict['rules'] = _items
144
+ # override the default output from pydantic by calling `to_dict()` of trending_hashtags_slice
145
+ if self.trending_hashtags_slice:
146
+ _dict['trending_hashtags_slice'] = self.trending_hashtags_slice.to_dict()
147
+ return _dict
148
+
149
+ @classmethod
150
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
151
+ """Create an instance of CommunitySettingsCommunity from a dict"""
152
+ if obj is None:
153
+ return None
154
+
155
+ if not isinstance(obj, dict):
156
+ return cls.model_validate(obj)
157
+
158
+ _obj = cls.model_validate({
159
+ "__typename": obj.get("__typename"),
160
+ "actions": CommunitySettingsActions.from_dict(obj["actions"]) if obj.get("actions") is not None else None,
161
+ "created_at": obj.get("created_at"),
162
+ "creator_results": CommunitySettingsCreatorResults.from_dict(obj["creator_results"]) if obj.get("creator_results") is not None else None,
163
+ "custom_banner_media": CommunityBannerMedia.from_dict(obj["custom_banner_media"]) if obj.get("custom_banner_media") is not None else None,
164
+ "default_banner_media": CommunityBannerMedia.from_dict(obj["default_banner_media"]) if obj.get("default_banner_media") is not None else None,
165
+ "description": obj.get("description"),
166
+ "id": obj.get("id"),
167
+ "invites_result": CommunitySettingsInvitesResult.from_dict(obj["invites_result"]) if obj.get("invites_result") is not None else None,
168
+ "is_member": obj.get("is_member"),
169
+ "is_nsfw": obj.get("is_nsfw"),
170
+ "join_policy": obj.get("join_policy"),
171
+ "join_requests_result": CommunityJoinRequestsResult.from_dict(obj["join_requests_result"]) if obj.get("join_requests_result") is not None else None,
172
+ "member_count": obj.get("member_count"),
173
+ "members_facepile_results": [CommunityFacepileUserResults.from_dict(_item) for _item in obj["members_facepile_results"]] if obj.get("members_facepile_results") is not None else None,
174
+ "name": obj.get("name"),
175
+ "primary_community_topic": CommunityPrimaryTopicName.from_dict(obj["primary_community_topic"]) if obj.get("primary_community_topic") is not None else None,
176
+ "rest_id": obj.get("rest_id"),
177
+ "role": obj.get("role"),
178
+ "rules": [CommunityRelayRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None,
179
+ "trending_hashtags_slice": CommunityHashtagSlice.from_dict(obj["trending_hashtags_slice"]) if obj.get("trending_hashtags_slice") is not None else None
180
+ })
181
+ return _obj
182
+
183
+
@@ -0,0 +1,106 @@
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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.community_settings_creator_core import CommunitySettingsCreatorCore
24
+ from twitter_openapi_python_generated.models.community_settings_creator_verification import CommunitySettingsCreatorVerification
25
+ from twitter_openapi_python_generated.models.type_name import TypeName
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+ from pydantic_core import to_jsonable_python
29
+
30
+ class CommunitySettingsCreator(BaseModel):
31
+ """
32
+ CommunitySettingsCreator
33
+ """ # noqa: E501
34
+ typename: TypeName = Field(alias="__typename")
35
+ core: CommunitySettingsCreatorCore
36
+ id: StrictStr
37
+ is_blue_verified: StrictBool
38
+ verification: CommunitySettingsCreatorVerification
39
+ __properties: ClassVar[List[str]] = ["__typename", "core", "id", "is_blue_verified", "verification"]
40
+
41
+ model_config = ConfigDict(
42
+ validate_by_name=True,
43
+ validate_by_alias=True,
44
+ validate_assignment=True,
45
+ protected_namespaces=(),
46
+ )
47
+
48
+
49
+ def to_str(self) -> str:
50
+ """Returns the string representation of the model using alias"""
51
+ return pprint.pformat(self.model_dump(by_alias=True))
52
+
53
+ def to_json(self) -> str:
54
+ """Returns the JSON representation of the model using alias"""
55
+ return json.dumps(to_jsonable_python(self.to_dict()))
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of CommunitySettingsCreator from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # override the default output from pydantic by calling `to_dict()` of core
81
+ if self.core:
82
+ _dict['core'] = self.core.to_dict()
83
+ # override the default output from pydantic by calling `to_dict()` of verification
84
+ if self.verification:
85
+ _dict['verification'] = self.verification.to_dict()
86
+ return _dict
87
+
88
+ @classmethod
89
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90
+ """Create an instance of CommunitySettingsCreator from a dict"""
91
+ if obj is None:
92
+ return None
93
+
94
+ if not isinstance(obj, dict):
95
+ return cls.model_validate(obj)
96
+
97
+ _obj = cls.model_validate({
98
+ "__typename": obj.get("__typename"),
99
+ "core": CommunitySettingsCreatorCore.from_dict(obj["core"]) if obj.get("core") is not None else None,
100
+ "id": obj.get("id"),
101
+ "is_blue_verified": obj.get("is_blue_verified"),
102
+ "verification": CommunitySettingsCreatorVerification.from_dict(obj["verification"]) if obj.get("verification") is not None else None
103
+ })
104
+ return _obj
105
+
106
+
@@ -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 CommunitySettingsCreatorCore(BaseModel):
28
+ """
29
+ CommunitySettingsCreatorCore
30
+ """ # noqa: E501
31
+ screen_name: StrictStr
32
+ __properties: ClassVar[List[str]] = ["screen_name"]
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 CommunitySettingsCreatorCore 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 CommunitySettingsCreatorCore 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
+ "screen_name": obj.get("screen_name")
86
+ })
87
+ return _obj
88
+
89
+
@@ -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.community_settings_creator import CommunitySettingsCreator
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class CommunitySettingsCreatorResults(BaseModel):
29
+ """
30
+ CommunitySettingsCreatorResults
31
+ """ # noqa: E501
32
+ id: StrictStr
33
+ result: CommunitySettingsCreator
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 CommunitySettingsCreatorResults 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 CommunitySettingsCreatorResults 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": CommunitySettingsCreator.from_dict(obj["result"]) if obj.get("result") is not None else None
92
+ })
93
+ return _obj
94
+
95
+