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,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
23
+ from twitter_openapi_python_generated.models.community_search_results import CommunitySearchResults
24
+ from twitter_openapi_python_generated.models.slice_info import SliceInfo
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class CommunitiesSearchSlice(BaseModel):
30
+ """
31
+ CommunitiesSearchSlice
32
+ """ # noqa: E501
33
+ items_results: List[CommunitySearchResults]
34
+ slice_info: SliceInfo
35
+ __properties: ClassVar[List[str]] = ["items_results", "slice_info"]
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 CommunitiesSearchSlice 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 each item in items_results (list)
77
+ _items = []
78
+ if self.items_results:
79
+ for _item_items_results in self.items_results:
80
+ _items.append(_item_items_results.to_dict() if _item_items_results is not None else None)
81
+ _dict['items_results'] = _items
82
+ # override the default output from pydantic by calling `to_dict()` of slice_info
83
+ if self.slice_info:
84
+ _dict['slice_info'] = self.slice_info.to_dict()
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of CommunitiesSearchSlice 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
+ "items_results": [CommunitySearchResults.from_dict(_item) for _item in obj["items_results"]] if obj.get("items_results") is not None else None,
98
+ "slice_info": SliceInfo.from_dict(obj["slice_info"]) if obj.get("slice_info") is not None else None
99
+ })
100
+ return _obj
101
+
102
+
@@ -50,6 +50,7 @@ class Community(BaseModel):
50
50
  id_str: Optional[Annotated[str, Field(strict=True)]] = None
51
51
  invites_policy: Optional[StrictStr] = None
52
52
  invites_result: Optional[CommunityInvitesResult] = None
53
+ is_nsfw: Optional[StrictBool] = None
53
54
  is_pinned: Optional[StrictBool] = None
54
55
  join_policy: Optional[StrictStr] = None
55
56
  join_requests_result: Optional[CommunityJoinRequestsResult] = None
@@ -65,7 +66,7 @@ class Community(BaseModel):
65
66
  show_only_users_to_display: Optional[List[StrictStr]] = None
66
67
  urls: Optional[CommunityUrls] = None
67
68
  viewer_relationship: Optional[CommunityViewerRelationship] = None
68
- __properties: ClassVar[List[str]] = ["__typename", "actions", "admin_results", "created_at", "creator_results", "custom_banner_media", "default_banner_media", "description", "id_str", "invites_policy", "invites_result", "is_pinned", "join_policy", "join_requests_result", "member_count", "members_facepile_results", "moderator_count", "name", "primary_community_topic", "question", "role", "rules", "search_tags", "show_only_users_to_display", "urls", "viewer_relationship"]
69
+ __properties: ClassVar[List[str]] = ["__typename", "actions", "admin_results", "created_at", "creator_results", "custom_banner_media", "default_banner_media", "description", "id_str", "invites_policy", "invites_result", "is_nsfw", "is_pinned", "join_policy", "join_requests_result", "member_count", "members_facepile_results", "moderator_count", "name", "primary_community_topic", "question", "role", "rules", "search_tags", "show_only_users_to_display", "urls", "viewer_relationship"]
69
70
 
70
71
  @field_validator('id_str', mode="before")
71
72
  def id_str_validate_regular_expression(cls, value):
@@ -211,6 +212,7 @@ class Community(BaseModel):
211
212
  "id_str": obj.get("id_str"),
212
213
  "invites_policy": obj.get("invites_policy"),
213
214
  "invites_result": CommunityInvitesResult.from_dict(obj["invites_result"]) if obj.get("invites_result") is not None else None,
215
+ "is_nsfw": obj.get("is_nsfw"),
214
216
  "is_pinned": obj.get("is_pinned"),
215
217
  "join_policy": obj.get("join_policy"),
216
218
  "join_requests_result": CommunityJoinRequestsResult.from_dict(obj["join_requests_result"]) if obj.get("join_requests_result") is not None else None,
@@ -0,0 +1,98 @@
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.type_name import TypeName
24
+ from twitter_openapi_python_generated.models.user_avatar import UserAvatar
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class CommunityFacepileUser(BaseModel):
30
+ """
31
+ CommunityFacepileUser
32
+ """ # noqa: E501
33
+ typename: TypeName = Field(alias="__typename")
34
+ avatar: UserAvatar
35
+ id: StrictStr
36
+ __properties: ClassVar[List[str]] = ["__typename", "avatar", "id"]
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 CommunityFacepileUser 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 avatar
78
+ if self.avatar:
79
+ _dict['avatar'] = self.avatar.to_dict()
80
+ return _dict
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
+ """Create an instance of CommunityFacepileUser 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
+ "__typename": obj.get("__typename"),
93
+ "avatar": UserAvatar.from_dict(obj["avatar"]) if obj.get("avatar") is not None else None,
94
+ "id": obj.get("id")
95
+ })
96
+ return _obj
97
+
98
+
@@ -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_facepile_user import CommunityFacepileUser
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class CommunityFacepileUserResults(BaseModel):
29
+ """
30
+ CommunityFacepileUserResults
31
+ """ # noqa: E501
32
+ id: StrictStr
33
+ result: CommunityFacepileUser
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 CommunityFacepileUserResults 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 CommunityFacepileUserResults 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": CommunityFacepileUser.from_dict(obj["result"]) if obj.get("result") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,91 @@
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 CommunityHashtag(BaseModel):
28
+ """
29
+ CommunityHashtag
30
+ """ # noqa: E501
31
+ hashtag: StrictStr
32
+ id: StrictStr
33
+ __properties: ClassVar[List[str]] = ["hashtag", "id"]
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 CommunityHashtag 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
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of CommunityHashtag from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "hashtag": obj.get("hashtag"),
87
+ "id": obj.get("id")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,99 @@
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_hashtag import CommunityHashtag
24
+ from twitter_openapi_python_generated.models.type_name import TypeName
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class CommunityHashtagSlice(BaseModel):
30
+ """
31
+ CommunityHashtagSlice
32
+ """ # noqa: E501
33
+ typename: TypeName = Field(alias="__typename")
34
+ items: List[CommunityHashtag]
35
+ __properties: ClassVar[List[str]] = ["__typename", "items"]
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 CommunityHashtagSlice 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 each item in items (list)
77
+ _items = []
78
+ if self.items:
79
+ for _item_items in self.items:
80
+ _items.append(_item_items.to_dict() if _item_items is not None else None)
81
+ _dict['items'] = _items
82
+ return _dict
83
+
84
+ @classmethod
85
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
86
+ """Create an instance of CommunityHashtagSlice from a dict"""
87
+ if obj is None:
88
+ return None
89
+
90
+ if not isinstance(obj, dict):
91
+ return cls.model_validate(obj)
92
+
93
+ _obj = cls.model_validate({
94
+ "__typename": obj.get("__typename"),
95
+ "items": [CommunityHashtag.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None
96
+ })
97
+ return _obj
98
+
99
+
@@ -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.user_union import UserUnion
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class CommunityIdUserResults(BaseModel):
29
+ """
30
+ CommunityIdUserResults
31
+ """ # noqa: E501
32
+ id: StrictStr
33
+ result: UserUnion
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 CommunityIdUserResults 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 CommunityIdUserResults 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": UserUnion.from_dict(obj["result"]) if obj.get("result") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,90 @@
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.type_name import TypeName
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class CommunityListMembersActionResult(BaseModel):
29
+ """
30
+ CommunityListMembersActionResult
31
+ """ # noqa: E501
32
+ typename: TypeName = Field(alias="__typename")
33
+ __properties: ClassVar[List[str]] = ["__typename"]
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 CommunityListMembersActionResult 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
+ return _dict
75
+
76
+ @classmethod
77
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
78
+ """Create an instance of CommunityListMembersActionResult from a dict"""
79
+ if obj is None:
80
+ return None
81
+
82
+ if not isinstance(obj, dict):
83
+ return cls.model_validate(obj)
84
+
85
+ _obj = cls.model_validate({
86
+ "__typename": obj.get("__typename")
87
+ })
88
+ return _obj
89
+
90
+