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