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,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.grok_home_response_data import GrokHomeResponseData
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class GrokHomeResponse(BaseModel):
30
+ """
31
+ GrokHomeResponse
32
+ """ # noqa: E501
33
+ data: GrokHomeResponseData
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 GrokHomeResponse 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 GrokHomeResponse 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": GrokHomeResponseData.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
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.grok_home import GrokHome
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class GrokHomeResponseData(BaseModel):
29
+ """
30
+ GrokHomeResponseData
31
+ """ # noqa: E501
32
+ grok_home: GrokHome
33
+ __properties: ClassVar[List[str]] = ["grok_home"]
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 GrokHomeResponseData 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 grok_home
75
+ if self.grok_home:
76
+ _dict['grok_home'] = self.grok_home.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 GrokHomeResponseData 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
+ "grok_home": GrokHome.from_dict(obj["grok_home"]) if obj.get("grok_home") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -19,7 +19,7 @@ import re # noqa: F401
19
19
  import json
20
20
 
21
21
  from pydantic import BaseModel, ConfigDict, StrictStr
22
- from typing import Any, ClassVar, Dict, List
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
25
  from pydantic_core import to_jsonable_python
@@ -29,7 +29,7 @@ class GrokImageAnnotation(BaseModel):
29
29
  GrokImageAnnotation
30
30
  """ # noqa: E501
31
31
  prompt: StrictStr
32
- upsampled_prompt: StrictStr
32
+ upsampled_prompt: Optional[StrictStr] = None
33
33
  __properties: ClassVar[List[str]] = ["prompt", "upsampled_prompt"]
34
34
 
35
35
  model_config = ConfigDict(
@@ -0,0 +1,103 @@
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, StrictBool, 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 GrokModelOption(BaseModel):
28
+ """
29
+ GrokModelOption
30
+ """ # noqa: E501
31
+ description: StrictStr
32
+ icon_name: StrictStr
33
+ id: StrictStr
34
+ is_analyze_enabled: StrictBool
35
+ is_enabled: StrictBool
36
+ is_enhance_enabled: StrictBool
37
+ mode: StrictStr
38
+ name: StrictStr
39
+ __properties: ClassVar[List[str]] = ["description", "icon_name", "id", "is_analyze_enabled", "is_enabled", "is_enhance_enabled", "mode", "name"]
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 GrokModelOption 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
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of GrokModelOption from a dict"""
85
+ if obj is None:
86
+ return None
87
+
88
+ if not isinstance(obj, dict):
89
+ return cls.model_validate(obj)
90
+
91
+ _obj = cls.model_validate({
92
+ "description": obj.get("description"),
93
+ "icon_name": obj.get("icon_name"),
94
+ "id": obj.get("id"),
95
+ "is_analyze_enabled": obj.get("is_analyze_enabled"),
96
+ "is_enabled": obj.get("is_enabled"),
97
+ "is_enhance_enabled": obj.get("is_enhance_enabled"),
98
+ "mode": obj.get("mode"),
99
+ "name": obj.get("name")
100
+ })
101
+ return _obj
102
+
103
+
@@ -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, Optional
23
+ from twitter_openapi_python_generated.models.user_label import UserLabel
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class IdentityProfileLabelsHighlightedLabel(BaseModel):
29
+ """
30
+ IdentityProfileLabelsHighlightedLabel
31
+ """ # noqa: E501
32
+ label: Optional[UserLabel] = None
33
+ __properties: ClassVar[List[str]] = ["label"]
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 IdentityProfileLabelsHighlightedLabel 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 label
75
+ if self.label:
76
+ _dict['label'] = self.label.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 IdentityProfileLabelsHighlightedLabel 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
+ "label": UserLabel.from_dict(obj["label"]) if obj.get("label") is not None else None
90
+ })
91
+ return _obj
92
+
93
+
@@ -19,6 +19,7 @@ import pprint
19
19
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
20
20
  from typing import Any, List, Optional
21
21
  from twitter_openapi_python_generated.models.timeline_community import TimelineCommunity
22
+ from twitter_openapi_python_generated.models.timeline_event_summary import TimelineEventSummary
22
23
  from twitter_openapi_python_generated.models.timeline_frame import TimelineFrame
23
24
  from twitter_openapi_python_generated.models.timeline_label import TimelineLabel
24
25
  from twitter_openapi_python_generated.models.timeline_message_prompt import TimelineMessagePrompt
@@ -34,7 +35,7 @@ from pydantic import StrictStr, Field
34
35
  from typing import Union, List, Set, Optional, Dict
35
36
  from typing_extensions import Literal, Self
36
37
 
37
- ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineFrame", "TimelineLabel", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineTwitterList", "TimelineUser"]
38
+ ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineEventSummary", "TimelineFrame", "TimelineLabel", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineTwitterList", "TimelineUser"]
38
39
 
39
40
  class ItemContentUnion(BaseModel):
40
41
  """
@@ -64,8 +65,10 @@ class ItemContentUnion(BaseModel):
64
65
  oneof_schema_11_validator: Optional[TimelineTwitterList] = None
65
66
  # data type: TimelineLabel
66
67
  oneof_schema_12_validator: Optional[TimelineLabel] = None
67
- actual_instance: Optional[Union[TimelineCommunity, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser]] = None
68
- one_of_schemas: Set[str] = { "TimelineCommunity", "TimelineFrame", "TimelineLabel", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineTwitterList", "TimelineUser" }
68
+ # data type: TimelineEventSummary
69
+ oneof_schema_13_validator: Optional[TimelineEventSummary] = None
70
+ actual_instance: Optional[Union[TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser]] = None
71
+ one_of_schemas: Set[str] = { "TimelineCommunity", "TimelineEventSummary", "TimelineFrame", "TimelineLabel", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineTwitterList", "TimelineUser" }
69
72
 
70
73
  model_config = ConfigDict(
71
74
  validate_assignment=True,
@@ -151,12 +154,17 @@ class ItemContentUnion(BaseModel):
151
154
  error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineLabel`")
152
155
  else:
153
156
  match += 1
157
+ # validate data type: TimelineEventSummary
158
+ if not isinstance(v, TimelineEventSummary):
159
+ error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineEventSummary`")
160
+ else:
161
+ match += 1
154
162
  if match > 1:
155
163
  # more than 1 match
156
- raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
164
+ raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
157
165
  elif match == 0:
158
166
  # no match
159
- raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
167
+ raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
160
168
  else:
161
169
  return v
162
170
 
@@ -182,6 +190,11 @@ class ItemContentUnion(BaseModel):
182
190
  instance.actual_instance = TimelineCommunity.from_json(json_str)
183
191
  return instance
184
192
 
193
+ # check if data type is `TimelineEventSummary`
194
+ if _data_type == "TimelineEventSummary":
195
+ instance.actual_instance = TimelineEventSummary.from_json(json_str)
196
+ return instance
197
+
185
198
  # check if data type is `TimelineFrame`
186
199
  if _data_type == "TimelineFrame":
187
200
  instance.actual_instance = TimelineFrame.from_json(json_str)
@@ -309,13 +322,19 @@ class ItemContentUnion(BaseModel):
309
322
  match += 1
310
323
  except (ValidationError, ValueError) as e:
311
324
  error_messages.append(str(e))
325
+ # deserialize data into TimelineEventSummary
326
+ try:
327
+ instance.actual_instance = TimelineEventSummary.from_json(json_str)
328
+ match += 1
329
+ except (ValidationError, ValueError) as e:
330
+ error_messages.append(str(e))
312
331
 
313
332
  if match > 1:
314
333
  # more than 1 match
315
- raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
334
+ raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
316
335
  elif match == 0:
317
336
  # no match
318
- raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
337
+ raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
319
338
  else:
320
339
  return instance
321
340
 
@@ -329,7 +348,7 @@ class ItemContentUnion(BaseModel):
329
348
  else:
330
349
  return json.dumps(self.actual_instance)
331
350
 
332
- def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser]]:
351
+ def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser]]:
333
352
  """Returns the dict representation of the actual instance"""
334
353
  if self.actual_instance is None:
335
354
  return None
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from twitter_openapi_python_generated.models.cta_limited_action_prompt import CtaLimitedActionPrompt
24
24
  from typing import Optional, Set
@@ -33,6 +33,13 @@ class LimitedAction(BaseModel):
33
33
  prompt: Optional[CtaLimitedActionPrompt] = None
34
34
  __properties: ClassVar[List[str]] = ["action", "prompt"]
35
35
 
36
+ @field_validator('action')
37
+ def action_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value not in set(['Reply', 'Retweet', 'QuoteTweet', 'Like', 'React', 'AddToBookmarks', 'AddToMoment', 'PinToProfile', 'ViewHiddenReplies', 'VoteOnPoll', 'ShowRetweetActionMenu', 'ReplyDownVote', 'SendViaDm', 'ViewPostEngagements', 'CopyLink', 'ShareTweetVia', 'Embed', 'HideCommunityTweet', 'ViewTweetActivity']):
40
+ raise ValueError("must be one of enum values ('Reply', 'Retweet', 'QuoteTweet', 'Like', 'React', 'AddToBookmarks', 'AddToMoment', 'PinToProfile', 'ViewHiddenReplies', 'VoteOnPoll', 'ShowRetweetActionMenu', 'ReplyDownVote', 'SendViaDm', 'ViewPostEngagements', 'CopyLink', 'ShareTweetVia', 'Embed', 'HideCommunityTweet', 'ViewTweetActivity')")
41
+ return value
42
+
36
43
  model_config = ConfigDict(
37
44
  validate_by_name=True,
38
45
  validate_by_alias=True,
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
@@ -31,6 +31,13 @@ class LimitedActionResultsData(BaseModel):
31
31
  action: StrictStr
32
32
  __properties: ClassVar[List[str]] = ["action"]
33
33
 
34
+ @field_validator('action')
35
+ def action_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['Reply', 'Retweet', 'QuoteTweet', 'Like', 'React', 'AddToBookmarks', 'AddToMoment', 'PinToProfile', 'ViewHiddenReplies', 'VoteOnPoll', 'ShowRetweetActionMenu', 'ReplyDownVote', 'SendViaDm', 'ViewPostEngagements', 'CopyLink', 'ShareTweetVia', 'Embed', 'HideCommunityTweet', 'ViewTweetActivity']):
38
+ raise ValueError("must be one of enum values ('Reply', 'Retweet', 'QuoteTweet', 'Like', 'React', 'AddToBookmarks', 'AddToMoment', 'PinToProfile', 'ViewHiddenReplies', 'VoteOnPoll', 'ShowRetweetActionMenu', 'ReplyDownVote', 'SendViaDm', 'ViewPostEngagements', 'CopyLink', 'ShareTweetVia', 'Embed', 'HideCommunityTweet', 'ViewTweetActivity')")
39
+ return value
40
+
34
41
  model_config = ConfigDict(
35
42
  validate_by_name=True,
36
43
  validate_by_alias=True,
@@ -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.timeline_result import TimelineResult
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class ListSearch(BaseModel):
29
+ """
30
+ ListSearch
31
+ """ # noqa: E501
32
+ list_search_timeline: TimelineResult
33
+ __properties: ClassVar[List[str]] = ["list_search_timeline"]
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 ListSearch 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 list_search_timeline
75
+ if self.list_search_timeline:
76
+ _dict['list_search_timeline'] = self.list_search_timeline.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 ListSearch 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
+ "list_search_timeline": TimelineResult.from_dict(obj["list_search_timeline"]) if obj.get("list_search_timeline") is not None else None
90
+ })
91
+ return _obj
92
+
93
+