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.
- twitter_openapi_python_generated/__init__.py +235 -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 +1522 -0
- twitter_openapi_python_generated/api/tweet_api.py +778 -142
- twitter_openapi_python_generated/api/user_list_api.py +1145 -192
- twitter_openapi_python_generated/api/users_api.py +318 -0
- twitter_openapi_python_generated/api_client.py +1 -1
- twitter_openapi_python_generated/configuration.py +1 -1
- twitter_openapi_python_generated/models/__init__.py +115 -0
- twitter_openapi_python_generated/models/ad_metadata_container.py +5 -3
- 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_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/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 +3 -1
- 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_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/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/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/error_extensions.py +1 -1
- twitter_openapi_python_generated/models/error_response.py +1 -1
- 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 +0 -7
- 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_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_model_option.py +103 -0
- twitter_openapi_python_generated/models/grouped_trend.py +95 -0
- twitter_openapi_python_generated/models/item_content_union.py +27 -8
- 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/module_footer.py +1 -8
- 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/search_timeline.py +2 -2
- twitter_openapi_python_generated/models/slice_info.py +89 -0
- twitter_openapi_python_generated/models/timeline_community.py +13 -17
- twitter_openapi_python_generated/models/timeline_event_summary.py +121 -0
- twitter_openapi_python_generated/models/timeline_message_prompt.py +13 -17
- twitter_openapi_python_generated/models/timeline_message_prompt_button.py +95 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_button_action.py +91 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_content.py +112 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_rich_text.py +98 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity.py +97 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_rich_text_entity_ref.py +107 -0
- twitter_openapi_python_generated/models/timeline_prompt.py +19 -17
- twitter_openapi_python_generated/models/timeline_prompt_callback.py +89 -0
- twitter_openapi_python_generated/models/timeline_prompt_content.py +124 -0
- twitter_openapi_python_generated/models/timeline_trend.py +18 -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/type_name.py +3 -0
- 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.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/METADATA +145 -9
- {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/RECORD +149 -32
- {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/WHEEL +0 -0
- {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/licenses/LICENSE +0 -0
- {twitter_openapi_python_generated-0.1.0.dist-info → twitter_openapi_python_generated-0.1.2.dist-info}/licenses/LICENSE.AGPL +0 -0
- {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,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.event_summary_media_entity import EventSummaryMediaEntity
|
|
24
|
+
from twitter_openapi_python_generated.models.event_summary_media_key import EventSummaryMediaKey
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class EventSummaryMedia(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
EventSummaryMedia
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
media_entity: EventSummaryMediaEntity = Field(alias="mediaEntity")
|
|
34
|
+
media_key: EventSummaryMediaKey = Field(alias="mediaKey")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["mediaEntity", "mediaKey"]
|
|
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 EventSummaryMedia 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 media_entity
|
|
77
|
+
if self.media_entity:
|
|
78
|
+
_dict['mediaEntity'] = self.media_entity.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of media_key
|
|
80
|
+
if self.media_key:
|
|
81
|
+
_dict['mediaKey'] = self.media_key.to_dict()
|
|
82
|
+
return _dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
86
|
+
"""Create an instance of EventSummaryMedia 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
|
+
"mediaEntity": EventSummaryMediaEntity.from_dict(obj["mediaEntity"]) if obj.get("mediaEntity") is not None else None,
|
|
95
|
+
"mediaKey": EventSummaryMediaKey.from_dict(obj["mediaKey"]) if obj.get("mediaKey") 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.item_result import ItemResult
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class EventSummaryMediaEntity(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
EventSummaryMediaEntity
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
tweet_results: ItemResult
|
|
33
|
+
type: StrictStr
|
|
34
|
+
__properties: ClassVar[List[str]] = ["tweet_results", "type"]
|
|
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 EventSummaryMediaEntity 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 tweet_results
|
|
76
|
+
if self.tweet_results:
|
|
77
|
+
_dict['tweet_results'] = self.tweet_results.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 EventSummaryMediaEntity 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
|
+
"tweet_results": ItemResult.from_dict(obj["tweet_results"]) if obj.get("tweet_results") is not None else None,
|
|
91
|
+
"type": obj.get("type")
|
|
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, StrictInt, 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 EventSummaryMediaKey(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
EventSummaryMediaKey
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
category: StrictInt
|
|
32
|
+
id: StrictStr
|
|
33
|
+
__properties: ClassVar[List[str]] = ["category", "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 EventSummaryMediaKey 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 EventSummaryMediaKey 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
|
+
"category": obj.get("category"),
|
|
87
|
+
"id": obj.get("id")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,117 @@
|
|
|
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.event_summary_ad_metadata_container import EventSummaryAdMetadataContainer
|
|
24
|
+
from twitter_openapi_python_generated.models.promoted_trend import PromotedTrend
|
|
25
|
+
from twitter_openapi_python_generated.models.user_results import UserResults
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
from pydantic_core import to_jsonable_python
|
|
29
|
+
|
|
30
|
+
class EventSummaryPromotedMetadata(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
EventSummaryPromotedMetadata
|
|
33
|
+
""" # noqa: E501
|
|
34
|
+
ad_metadata_container: EventSummaryAdMetadataContainer = Field(alias="adMetadataContainer")
|
|
35
|
+
advertiser_results: UserResults
|
|
36
|
+
disclosure_type: StrictStr = Field(alias="disclosureType")
|
|
37
|
+
impression_id: StrictStr = Field(alias="impressionId")
|
|
38
|
+
impression_string: StrictStr = Field(alias="impressionString")
|
|
39
|
+
promoted_trend: PromotedTrend = Field(alias="promotedTrend")
|
|
40
|
+
promoted_trend_description: StrictStr = Field(alias="promotedTrendDescription")
|
|
41
|
+
promoted_trend_name: StrictStr = Field(alias="promotedTrendName")
|
|
42
|
+
promoted_trend_query_term: StrictStr = Field(alias="promotedTrendQueryTerm")
|
|
43
|
+
__properties: ClassVar[List[str]] = ["adMetadataContainer", "advertiser_results", "disclosureType", "impressionId", "impressionString", "promotedTrend", "promotedTrendDescription", "promotedTrendName", "promotedTrendQueryTerm"]
|
|
44
|
+
|
|
45
|
+
model_config = ConfigDict(
|
|
46
|
+
validate_by_name=True,
|
|
47
|
+
validate_by_alias=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
63
|
+
"""Create an instance of EventSummaryPromotedMetadata from a JSON string"""
|
|
64
|
+
return cls.from_dict(json.loads(json_str))
|
|
65
|
+
|
|
66
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
67
|
+
"""Return the dictionary representation of the model using alias.
|
|
68
|
+
|
|
69
|
+
This has the following differences from calling pydantic's
|
|
70
|
+
`self.model_dump(by_alias=True)`:
|
|
71
|
+
|
|
72
|
+
* `None` is only added to the output dict for nullable fields that
|
|
73
|
+
were set at model initialization. Other fields with value `None`
|
|
74
|
+
are ignored.
|
|
75
|
+
"""
|
|
76
|
+
excluded_fields: Set[str] = set([
|
|
77
|
+
])
|
|
78
|
+
|
|
79
|
+
_dict = self.model_dump(
|
|
80
|
+
by_alias=True,
|
|
81
|
+
exclude=excluded_fields,
|
|
82
|
+
exclude_none=True,
|
|
83
|
+
)
|
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of ad_metadata_container
|
|
85
|
+
if self.ad_metadata_container:
|
|
86
|
+
_dict['adMetadataContainer'] = self.ad_metadata_container.to_dict()
|
|
87
|
+
# override the default output from pydantic by calling `to_dict()` of advertiser_results
|
|
88
|
+
if self.advertiser_results:
|
|
89
|
+
_dict['advertiser_results'] = self.advertiser_results.to_dict()
|
|
90
|
+
# override the default output from pydantic by calling `to_dict()` of promoted_trend
|
|
91
|
+
if self.promoted_trend:
|
|
92
|
+
_dict['promotedTrend'] = self.promoted_trend.to_dict()
|
|
93
|
+
return _dict
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
+
"""Create an instance of EventSummaryPromotedMetadata from a dict"""
|
|
98
|
+
if obj is None:
|
|
99
|
+
return None
|
|
100
|
+
|
|
101
|
+
if not isinstance(obj, dict):
|
|
102
|
+
return cls.model_validate(obj)
|
|
103
|
+
|
|
104
|
+
_obj = cls.model_validate({
|
|
105
|
+
"adMetadataContainer": EventSummaryAdMetadataContainer.from_dict(obj["adMetadataContainer"]) if obj.get("adMetadataContainer") is not None else None,
|
|
106
|
+
"advertiser_results": UserResults.from_dict(obj["advertiser_results"]) if obj.get("advertiser_results") is not None else None,
|
|
107
|
+
"disclosureType": obj.get("disclosureType"),
|
|
108
|
+
"impressionId": obj.get("impressionId"),
|
|
109
|
+
"impressionString": obj.get("impressionString"),
|
|
110
|
+
"promotedTrend": PromotedTrend.from_dict(obj["promotedTrend"]) if obj.get("promotedTrend") is not None else None,
|
|
111
|
+
"promotedTrendDescription": obj.get("promotedTrendDescription"),
|
|
112
|
+
"promotedTrendName": obj.get("promotedTrendName"),
|
|
113
|
+
"promotedTrendQueryTerm": obj.get("promotedTrendQueryTerm")
|
|
114
|
+
})
|
|
115
|
+
return _obj
|
|
116
|
+
|
|
117
|
+
|
|
@@ -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.explore_sidebar_response_data import ExploreSidebarResponseData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class ExploreSidebarResponse(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
ExploreSidebarResponse
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
data: ExploreSidebarResponseData
|
|
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 ExploreSidebarResponse 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 ExploreSidebarResponse 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": ExploreSidebarResponseData.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.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 ExploreSidebarResponseData(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ExploreSidebarResponseData
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
explore_sidebar: TimelineResult
|
|
33
|
+
__properties: ClassVar[List[str]] = ["explore_sidebar"]
|
|
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 ExploreSidebarResponseData 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 explore_sidebar
|
|
75
|
+
if self.explore_sidebar:
|
|
76
|
+
_dict['explore_sidebar'] = self.explore_sidebar.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 ExploreSidebarResponseData 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
|
+
"explore_sidebar": TimelineResult.from_dict(obj["explore_sidebar"]) if obj.get("explore_sidebar") is not None else None
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -50,13 +50,6 @@ class FeedbackAction(BaseModel):
|
|
|
50
50
|
raise ValueError("must be one of enum values ('BottomSheet', 'Inline')")
|
|
51
51
|
return value
|
|
52
52
|
|
|
53
|
-
@field_validator('feedback_type')
|
|
54
|
-
def feedback_type_validate_enum(cls, value):
|
|
55
|
-
"""Validates the enum"""
|
|
56
|
-
if value not in set(['DontLike', 'GiveFeedback', 'NotCredible', 'NotRelevant', 'SeeFewer']):
|
|
57
|
-
raise ValueError("must be one of enum values ('DontLike', 'GiveFeedback', 'NotCredible', 'NotRelevant', 'SeeFewer')")
|
|
58
|
-
return value
|
|
59
|
-
|
|
60
53
|
@field_validator('icon')
|
|
61
54
|
def icon_validate_enum(cls, value):
|
|
62
55
|
"""Validates the enum"""
|