twitter-openapi-python-generated 0.0.30__py3-none-any.whl → 0.0.32__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 +28 -4
- twitter_openapi_python_generated/api/default_api.py +335 -0
- twitter_openapi_python_generated/api/tweet_api.py +1356 -84
- twitter_openapi_python_generated/api_client.py +1 -1
- twitter_openapi_python_generated/configuration.py +1 -1
- twitter_openapi_python_generated/models/__init__.py +27 -3
- twitter_openapi_python_generated/models/about_community_result.py +95 -0
- twitter_openapi_python_generated/models/{timeline_v2.py → about_community_results.py} +12 -12
- twitter_openapi_python_generated/models/about_community_tweet_data.py +92 -0
- twitter_openapi_python_generated/models/analysis_results.py +94 -0
- twitter_openapi_python_generated/models/birdwatch_pivot.py +3 -1
- twitter_openapi_python_generated/models/community_about_timeline_response.py +102 -0
- twitter_openapi_python_generated/models/community_media_timeline_response.py +102 -0
- twitter_openapi_python_generated/models/community_tweets_timeline_response.py +102 -0
- twitter_openapi_python_generated/models/content_item_type.py +2 -0
- twitter_openapi_python_generated/models/grok_image_annotation.py +90 -0
- twitter_openapi_python_generated/models/grok_share_attachment.py +3 -1
- twitter_openapi_python_generated/models/grok_share_attachment_item.py +10 -2
- twitter_openapi_python_generated/models/home_timeline_response_data.py +2 -2
- twitter_openapi_python_generated/models/instruction_type.py +2 -0
- twitter_openapi_python_generated/models/instruction_union.py +46 -8
- twitter_openapi_python_generated/models/item_content_union.py +27 -8
- twitter_openapi_python_generated/models/list_tweets_timeline_data.py +2 -2
- twitter_openapi_python_generated/models/list_tweets_timeline_list.py +3 -3
- twitter_openapi_python_generated/models/media_community_result.py +95 -0
- twitter_openapi_python_generated/models/media_community_results.py +92 -0
- twitter_openapi_python_generated/models/media_community_tweet_data.py +92 -0
- twitter_openapi_python_generated/models/media_result.py +8 -2
- twitter_openapi_python_generated/models/module_item.py +2 -2
- twitter_openapi_python_generated/models/notification_template.py +93 -0
- twitter_openapi_python_generated/models/notifications_result.py +105 -0
- twitter_openapi_python_generated/models/notifications_timeline_data.py +92 -0
- twitter_openapi_python_generated/models/notifications_timeline_response.py +102 -0
- twitter_openapi_python_generated/models/notifications_user_results.py +92 -0
- twitter_openapi_python_generated/models/notifications_viewer_v2.py +92 -0
- twitter_openapi_python_generated/models/post_create_bookmark_request.py +5 -1
- twitter_openapi_python_generated/models/post_create_retweet_request.py +5 -1
- twitter_openapi_python_generated/models/post_create_tweet_request.py +6 -2
- twitter_openapi_python_generated/models/post_create_tweet_request_features.py +19 -5
- twitter_openapi_python_generated/models/post_delete_bookmark_request.py +5 -1
- twitter_openapi_python_generated/models/post_delete_retweet_request.py +5 -1
- twitter_openapi_python_generated/models/post_delete_tweet_request.py +5 -1
- twitter_openapi_python_generated/models/post_favorite_tweet_request.py +5 -1
- twitter_openapi_python_generated/models/post_unfavorite_tweet_request.py +5 -1
- twitter_openapi_python_generated/models/ranked_community_result.py +95 -0
- twitter_openapi_python_generated/models/ranked_community_results.py +92 -0
- twitter_openapi_python_generated/models/ranked_community_tweet_data.py +92 -0
- twitter_openapi_python_generated/models/rich_message.py +90 -0
- twitter_openapi_python_generated/models/search_timeline_data.py +2 -2
- twitter_openapi_python_generated/models/timeline_add_entry.py +2 -2
- twitter_openapi_python_generated/models/timeline_clear_entries_unread_state.py +89 -0
- twitter_openapi_python_generated/models/timeline_general_context.py +5 -3
- twitter_openapi_python_generated/models/timeline_mark_entries_unread_greater_than_sort_index.py +102 -0
- twitter_openapi_python_generated/models/timeline_notification.py +116 -0
- twitter_openapi_python_generated/models/{list_tweets_timeline.py → timeline_result.py} +8 -6
- twitter_openapi_python_generated/models/timeline_timeline_module.py +1 -1
- twitter_openapi_python_generated/models/timeline_trend.py +3 -3
- twitter_openapi_python_generated/models/timeline_user.py +2 -2
- twitter_openapi_python_generated/models/tweet.py +1 -1
- twitter_openapi_python_generated/models/tweet_favoriters_response_data.py +3 -3
- twitter_openapi_python_generated/models/tweet_retweeters_response_data.py +3 -3
- twitter_openapi_python_generated/models/type_name.py +3 -0
- twitter_openapi_python_generated/models/user.py +2 -2
- twitter_openapi_python_generated/models/user_tweets_result_v1.py +95 -0
- twitter_openapi_python_generated/models/{user_tweets_result.py → user_tweets_result_v2.py} +7 -7
- twitter_openapi_python_generated/models/user_tweets_user.py +3 -3
- {twitter_openapi_python_generated-0.0.30.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/METADATA +12 -2
- {twitter_openapi_python_generated-0.0.30.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/RECORD +72 -48
- {twitter_openapi_python_generated-0.0.30.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/WHEEL +1 -1
- {twitter_openapi_python_generated-0.0.30.dist-info → twitter_openapi_python_generated-0.0.32.dist-info/licenses}/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.30.dist-info → twitter_openapi_python_generated-0.0.32.dist-info/licenses}/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.30.dist-info → twitter_openapi_python_generated-0.0.32.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.error_response import ErrorResponse
|
|
24
|
+
from twitter_openapi_python_generated.models.notifications_timeline_data import NotificationsTimelineData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class NotificationsTimelineResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
NotificationsTimelineResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
data: NotificationsTimelineData
|
|
33
|
+
errors: Optional[List[ErrorResponse]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["data", "errors"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of NotificationsTimelineResponse 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 data
|
|
76
|
+
if self.data:
|
|
77
|
+
_dict['data'] = self.data.to_dict()
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in errors (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.errors:
|
|
81
|
+
for _item_errors in self.errors:
|
|
82
|
+
if _item_errors:
|
|
83
|
+
_items.append(_item_errors.to_dict())
|
|
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 NotificationsTimelineResponse 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": NotificationsTimelineData.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,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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.notifications_result import NotificationsResult
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class NotificationsUserResults(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
NotificationsUserResults
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
result: NotificationsResult
|
|
32
|
+
__properties: ClassVar[List[str]] = ["result"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of NotificationsUserResults from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of result
|
|
74
|
+
if self.result:
|
|
75
|
+
_dict['result'] = self.result.to_dict()
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of NotificationsUserResults 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
|
+
"result": NotificationsResult.from_dict(obj["result"]) if obj.get("result") is not None else None
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.notifications_user_results import NotificationsUserResults
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class NotificationsViewerV2(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
NotificationsViewerV2
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
user_results: NotificationsUserResults
|
|
32
|
+
__properties: ClassVar[List[str]] = ["user_results"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of NotificationsViewerV2 from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
# override the default output from pydantic by calling `to_dict()` of user_results
|
|
74
|
+
if self.user_results:
|
|
75
|
+
_dict['user_results'] = self.user_results.to_dict()
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of NotificationsViewerV2 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
|
+
"user_results": NotificationsUserResults.from_dict(obj["user_results"]) if obj.get("user_results") is not None else None
|
|
89
|
+
})
|
|
90
|
+
return _obj
|
|
91
|
+
|
|
92
|
+
|
|
@@ -28,9 +28,11 @@ class PostCreateBookmarkRequest(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
PostCreateBookmarkRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
method: StrictStr = Field(alias="@method")
|
|
32
|
+
path: StrictStr = Field(alias="@path")
|
|
31
33
|
query_id: StrictStr = Field(alias="queryId")
|
|
32
34
|
variables: PostCreateBookmarkRequestVariables
|
|
33
|
-
__properties: ClassVar[List[str]] = ["queryId", "variables"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "queryId", "variables"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -86,6 +88,8 @@ class PostCreateBookmarkRequest(BaseModel):
|
|
|
86
88
|
return cls.model_validate(obj)
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
91
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
92
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/aoDbu3RHznuiSkQ9aNM67Q/CreateBookmark',
|
|
89
93
|
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'aoDbu3RHznuiSkQ9aNM67Q',
|
|
90
94
|
"variables": PostCreateBookmarkRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
91
95
|
})
|
|
@@ -28,9 +28,11 @@ class PostCreateRetweetRequest(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
PostCreateRetweetRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
method: StrictStr = Field(alias="@method")
|
|
32
|
+
path: StrictStr = Field(alias="@path")
|
|
31
33
|
query_id: StrictStr = Field(alias="queryId")
|
|
32
34
|
variables: PostCreateRetweetRequestVariables
|
|
33
|
-
__properties: ClassVar[List[str]] = ["queryId", "variables"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "queryId", "variables"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -86,6 +88,8 @@ class PostCreateRetweetRequest(BaseModel):
|
|
|
86
88
|
return cls.model_validate(obj)
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
91
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
92
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/ojPdsZsimiJrUGLR1sjUtA/CreateRetweet',
|
|
89
93
|
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'ojPdsZsimiJrUGLR1sjUtA',
|
|
90
94
|
"variables": PostCreateRetweetRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
91
95
|
})
|
|
@@ -29,10 +29,12 @@ class PostCreateTweetRequest(BaseModel):
|
|
|
29
29
|
"""
|
|
30
30
|
PostCreateTweetRequest
|
|
31
31
|
""" # noqa: E501
|
|
32
|
+
method: StrictStr = Field(alias="@method")
|
|
33
|
+
path: StrictStr = Field(alias="@path")
|
|
32
34
|
features: PostCreateTweetRequestFeatures
|
|
33
35
|
query_id: StrictStr = Field(alias="queryId")
|
|
34
36
|
variables: PostCreateTweetRequestVariables
|
|
35
|
-
__properties: ClassVar[List[str]] = ["features", "queryId", "variables"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "features", "queryId", "variables"]
|
|
36
38
|
|
|
37
39
|
model_config = ConfigDict(
|
|
38
40
|
populate_by_name=True,
|
|
@@ -91,8 +93,10 @@ class PostCreateTweetRequest(BaseModel):
|
|
|
91
93
|
return cls.model_validate(obj)
|
|
92
94
|
|
|
93
95
|
_obj = cls.model_validate({
|
|
96
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
97
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/IID9x6WsdMnTlXnzXGq8ng/CreateTweet',
|
|
94
98
|
"features": PostCreateTweetRequestFeatures.from_dict(obj["features"]) if obj.get("features") is not None else None,
|
|
95
|
-
"queryId": obj.get("queryId") if obj.get("queryId") is not None else '
|
|
99
|
+
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'IID9x6WsdMnTlXnzXGq8ng',
|
|
96
100
|
"variables": PostCreateTweetRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
97
101
|
})
|
|
98
102
|
return _obj
|
|
@@ -36,20 +36,27 @@ class PostCreateTweetRequestFeatures(BaseModel):
|
|
|
36
36
|
longform_notetweets_consumption_enabled: StrictBool
|
|
37
37
|
longform_notetweets_inline_media_enabled: StrictBool
|
|
38
38
|
longform_notetweets_rich_text_read_enabled: StrictBool
|
|
39
|
+
premium_content_api_read_enabled: StrictBool
|
|
40
|
+
profile_label_improvements_pcf_label_in_post_enabled: StrictBool
|
|
39
41
|
responsive_web_edit_tweet_api_enabled: StrictBool
|
|
40
42
|
responsive_web_enhance_cards_enabled: StrictBool
|
|
41
|
-
responsive_web_graphql_exclude_directive_enabled: StrictBool
|
|
42
43
|
responsive_web_graphql_skip_user_profile_image_extensions_enabled: StrictBool
|
|
43
44
|
responsive_web_graphql_timeline_navigation_enabled: StrictBool
|
|
45
|
+
responsive_web_grok_analysis_button_from_backend: StrictBool
|
|
46
|
+
responsive_web_grok_analyze_button_fetch_trends_enabled: StrictBool
|
|
47
|
+
responsive_web_grok_analyze_post_followups_enabled: StrictBool
|
|
48
|
+
responsive_web_grok_image_annotation_enabled: StrictBool
|
|
49
|
+
responsive_web_grok_share_attachment_enabled: StrictBool
|
|
50
|
+
responsive_web_grok_show_grok_translated_post: StrictBool
|
|
51
|
+
responsive_web_jetfuel_frame: StrictBool
|
|
44
52
|
responsive_web_twitter_article_tweet_consumption_enabled: StrictBool
|
|
45
53
|
rweb_tipjar_consumption_enabled: StrictBool
|
|
46
|
-
rweb_video_timestamps_enabled: StrictBool
|
|
47
54
|
standardized_nudges_misinfo: StrictBool
|
|
48
55
|
tweet_awards_web_tipping_enabled: StrictBool
|
|
49
56
|
tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled: StrictBool
|
|
50
57
|
verified_phone_label_enabled: StrictBool
|
|
51
58
|
view_counts_everywhere_api_enabled: StrictBool
|
|
52
|
-
__properties: ClassVar[List[str]] = ["articles_preview_enabled", "c9s_tweet_anatomy_moderator_badge_enabled", "communities_web_enable_tweet_community_results_fetch", "creator_subscriptions_quote_tweet_preview_enabled", "freedom_of_speech_not_reach_fetch_enabled", "graphql_is_translatable_rweb_tweet_is_translatable_enabled", "longform_notetweets_consumption_enabled", "longform_notetweets_inline_media_enabled", "longform_notetweets_rich_text_read_enabled", "
|
|
59
|
+
__properties: ClassVar[List[str]] = ["articles_preview_enabled", "c9s_tweet_anatomy_moderator_badge_enabled", "communities_web_enable_tweet_community_results_fetch", "creator_subscriptions_quote_tweet_preview_enabled", "freedom_of_speech_not_reach_fetch_enabled", "graphql_is_translatable_rweb_tweet_is_translatable_enabled", "longform_notetweets_consumption_enabled", "longform_notetweets_inline_media_enabled", "longform_notetweets_rich_text_read_enabled", "premium_content_api_read_enabled", "profile_label_improvements_pcf_label_in_post_enabled", "responsive_web_edit_tweet_api_enabled", "responsive_web_enhance_cards_enabled", "responsive_web_graphql_skip_user_profile_image_extensions_enabled", "responsive_web_graphql_timeline_navigation_enabled", "responsive_web_grok_analysis_button_from_backend", "responsive_web_grok_analyze_button_fetch_trends_enabled", "responsive_web_grok_analyze_post_followups_enabled", "responsive_web_grok_image_annotation_enabled", "responsive_web_grok_share_attachment_enabled", "responsive_web_grok_show_grok_translated_post", "responsive_web_jetfuel_frame", "responsive_web_twitter_article_tweet_consumption_enabled", "rweb_tipjar_consumption_enabled", "standardized_nudges_misinfo", "tweet_awards_web_tipping_enabled", "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled", "verified_phone_label_enabled", "view_counts_everywhere_api_enabled"]
|
|
53
60
|
|
|
54
61
|
model_config = ConfigDict(
|
|
55
62
|
populate_by_name=True,
|
|
@@ -111,14 +118,21 @@ class PostCreateTweetRequestFeatures(BaseModel):
|
|
|
111
118
|
"longform_notetweets_consumption_enabled": obj.get("longform_notetweets_consumption_enabled") if obj.get("longform_notetweets_consumption_enabled") is not None else True,
|
|
112
119
|
"longform_notetweets_inline_media_enabled": obj.get("longform_notetweets_inline_media_enabled") if obj.get("longform_notetweets_inline_media_enabled") is not None else True,
|
|
113
120
|
"longform_notetweets_rich_text_read_enabled": obj.get("longform_notetweets_rich_text_read_enabled") if obj.get("longform_notetweets_rich_text_read_enabled") is not None else True,
|
|
121
|
+
"premium_content_api_read_enabled": obj.get("premium_content_api_read_enabled") if obj.get("premium_content_api_read_enabled") is not None else False,
|
|
122
|
+
"profile_label_improvements_pcf_label_in_post_enabled": obj.get("profile_label_improvements_pcf_label_in_post_enabled") if obj.get("profile_label_improvements_pcf_label_in_post_enabled") is not None else True,
|
|
114
123
|
"responsive_web_edit_tweet_api_enabled": obj.get("responsive_web_edit_tweet_api_enabled") if obj.get("responsive_web_edit_tweet_api_enabled") is not None else True,
|
|
115
124
|
"responsive_web_enhance_cards_enabled": obj.get("responsive_web_enhance_cards_enabled") if obj.get("responsive_web_enhance_cards_enabled") is not None else False,
|
|
116
|
-
"responsive_web_graphql_exclude_directive_enabled": obj.get("responsive_web_graphql_exclude_directive_enabled") if obj.get("responsive_web_graphql_exclude_directive_enabled") is not None else True,
|
|
117
125
|
"responsive_web_graphql_skip_user_profile_image_extensions_enabled": obj.get("responsive_web_graphql_skip_user_profile_image_extensions_enabled") if obj.get("responsive_web_graphql_skip_user_profile_image_extensions_enabled") is not None else False,
|
|
118
126
|
"responsive_web_graphql_timeline_navigation_enabled": obj.get("responsive_web_graphql_timeline_navigation_enabled") if obj.get("responsive_web_graphql_timeline_navigation_enabled") is not None else True,
|
|
127
|
+
"responsive_web_grok_analysis_button_from_backend": obj.get("responsive_web_grok_analysis_button_from_backend") if obj.get("responsive_web_grok_analysis_button_from_backend") is not None else False,
|
|
128
|
+
"responsive_web_grok_analyze_button_fetch_trends_enabled": obj.get("responsive_web_grok_analyze_button_fetch_trends_enabled") if obj.get("responsive_web_grok_analyze_button_fetch_trends_enabled") is not None else False,
|
|
129
|
+
"responsive_web_grok_analyze_post_followups_enabled": obj.get("responsive_web_grok_analyze_post_followups_enabled") if obj.get("responsive_web_grok_analyze_post_followups_enabled") is not None else True,
|
|
130
|
+
"responsive_web_grok_image_annotation_enabled": obj.get("responsive_web_grok_image_annotation_enabled") if obj.get("responsive_web_grok_image_annotation_enabled") is not None else True,
|
|
131
|
+
"responsive_web_grok_share_attachment_enabled": obj.get("responsive_web_grok_share_attachment_enabled") if obj.get("responsive_web_grok_share_attachment_enabled") is not None else True,
|
|
132
|
+
"responsive_web_grok_show_grok_translated_post": obj.get("responsive_web_grok_show_grok_translated_post") if obj.get("responsive_web_grok_show_grok_translated_post") is not None else False,
|
|
133
|
+
"responsive_web_jetfuel_frame": obj.get("responsive_web_jetfuel_frame") if obj.get("responsive_web_jetfuel_frame") is not None else False,
|
|
119
134
|
"responsive_web_twitter_article_tweet_consumption_enabled": obj.get("responsive_web_twitter_article_tweet_consumption_enabled") if obj.get("responsive_web_twitter_article_tweet_consumption_enabled") is not None else True,
|
|
120
135
|
"rweb_tipjar_consumption_enabled": obj.get("rweb_tipjar_consumption_enabled") if obj.get("rweb_tipjar_consumption_enabled") is not None else True,
|
|
121
|
-
"rweb_video_timestamps_enabled": obj.get("rweb_video_timestamps_enabled") if obj.get("rweb_video_timestamps_enabled") is not None else True,
|
|
122
136
|
"standardized_nudges_misinfo": obj.get("standardized_nudges_misinfo") if obj.get("standardized_nudges_misinfo") is not None else True,
|
|
123
137
|
"tweet_awards_web_tipping_enabled": obj.get("tweet_awards_web_tipping_enabled") if obj.get("tweet_awards_web_tipping_enabled") is not None else False,
|
|
124
138
|
"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled": obj.get("tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled") if obj.get("tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled") is not None else True,
|
|
@@ -28,9 +28,11 @@ class PostDeleteBookmarkRequest(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
PostDeleteBookmarkRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
method: StrictStr = Field(alias="@method")
|
|
32
|
+
path: StrictStr = Field(alias="@path")
|
|
31
33
|
query_id: StrictStr = Field(alias="queryId")
|
|
32
34
|
variables: PostCreateBookmarkRequestVariables
|
|
33
|
-
__properties: ClassVar[List[str]] = ["queryId", "variables"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "queryId", "variables"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -86,6 +88,8 @@ class PostDeleteBookmarkRequest(BaseModel):
|
|
|
86
88
|
return cls.model_validate(obj)
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
91
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
92
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/Wlmlj2-xzyS1GN3a6cj-mQ/DeleteBookmark',
|
|
89
93
|
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'Wlmlj2-xzyS1GN3a6cj-mQ',
|
|
90
94
|
"variables": PostCreateBookmarkRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
91
95
|
})
|
|
@@ -28,9 +28,11 @@ class PostDeleteRetweetRequest(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
PostDeleteRetweetRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
method: StrictStr = Field(alias="@method")
|
|
32
|
+
path: StrictStr = Field(alias="@path")
|
|
31
33
|
query_id: StrictStr = Field(alias="queryId")
|
|
32
34
|
variables: PostDeleteRetweetRequestVariables
|
|
33
|
-
__properties: ClassVar[List[str]] = ["queryId", "variables"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "queryId", "variables"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -86,6 +88,8 @@ class PostDeleteRetweetRequest(BaseModel):
|
|
|
86
88
|
return cls.model_validate(obj)
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
91
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
92
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/iQtK4dl5hBmXewYZuEOKVw/DeleteRetweet',
|
|
89
93
|
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'iQtK4dl5hBmXewYZuEOKVw',
|
|
90
94
|
"variables": PostDeleteRetweetRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
91
95
|
})
|
|
@@ -28,9 +28,11 @@ class PostDeleteTweetRequest(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
PostDeleteTweetRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
method: StrictStr = Field(alias="@method")
|
|
32
|
+
path: StrictStr = Field(alias="@path")
|
|
31
33
|
query_id: StrictStr = Field(alias="queryId")
|
|
32
34
|
variables: PostCreateRetweetRequestVariables
|
|
33
|
-
__properties: ClassVar[List[str]] = ["queryId", "variables"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "queryId", "variables"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -86,6 +88,8 @@ class PostDeleteTweetRequest(BaseModel):
|
|
|
86
88
|
return cls.model_validate(obj)
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
91
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
92
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/VaenaVgh5q5ih7kvyVjgtg/DeleteTweet',
|
|
89
93
|
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'VaenaVgh5q5ih7kvyVjgtg',
|
|
90
94
|
"variables": PostCreateRetweetRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
91
95
|
})
|
|
@@ -28,9 +28,11 @@ class PostFavoriteTweetRequest(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
PostFavoriteTweetRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
method: StrictStr = Field(alias="@method")
|
|
32
|
+
path: StrictStr = Field(alias="@path")
|
|
31
33
|
query_id: StrictStr = Field(alias="queryId")
|
|
32
34
|
variables: PostCreateBookmarkRequestVariables
|
|
33
|
-
__properties: ClassVar[List[str]] = ["queryId", "variables"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "queryId", "variables"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -86,6 +88,8 @@ class PostFavoriteTweetRequest(BaseModel):
|
|
|
86
88
|
return cls.model_validate(obj)
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
91
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
92
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/lI07N6Otwv1PhnEgXILM7A/FavoriteTweet',
|
|
89
93
|
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'lI07N6Otwv1PhnEgXILM7A',
|
|
90
94
|
"variables": PostCreateBookmarkRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
91
95
|
})
|
|
@@ -28,9 +28,11 @@ class PostUnfavoriteTweetRequest(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
PostUnfavoriteTweetRequest
|
|
30
30
|
""" # noqa: E501
|
|
31
|
+
method: StrictStr = Field(alias="@method")
|
|
32
|
+
path: StrictStr = Field(alias="@path")
|
|
31
33
|
query_id: StrictStr = Field(alias="queryId")
|
|
32
34
|
variables: PostCreateRetweetRequestVariables
|
|
33
|
-
__properties: ClassVar[List[str]] = ["queryId", "variables"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["@method", "@path", "queryId", "variables"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -86,6 +88,8 @@ class PostUnfavoriteTweetRequest(BaseModel):
|
|
|
86
88
|
return cls.model_validate(obj)
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
91
|
+
"@method": obj.get("@method") if obj.get("@method") is not None else 'POST',
|
|
92
|
+
"@path": obj.get("@path") if obj.get("@path") is not None else '/i/api/graphql/ZYKSe-w7KEslx3JhSIk5LA/UnfavoriteTweet',
|
|
89
93
|
"queryId": obj.get("queryId") if obj.get("queryId") is not None else 'ZYKSe-w7KEslx3JhSIk5LA',
|
|
90
94
|
"variables": PostCreateRetweetRequestVariables.from_dict(obj["variables"]) if obj.get("variables") is not None else None
|
|
91
95
|
})
|
|
@@ -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, Field
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.timeline_result import TimelineResult
|
|
24
|
+
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class RankedCommunityResult(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
RankedCommunityResult
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
typename: TypeName = Field(alias="__typename")
|
|
33
|
+
ranked_community_timeline: TimelineResult
|
|
34
|
+
__properties: ClassVar[List[str]] = ["__typename", "ranked_community_timeline"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of RankedCommunityResult 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 ranked_community_timeline
|
|
76
|
+
if self.ranked_community_timeline:
|
|
77
|
+
_dict['ranked_community_timeline'] = self.ranked_community_timeline.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 RankedCommunityResult 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
|
+
"__typename": obj.get("__typename"),
|
|
91
|
+
"ranked_community_timeline": TimelineResult.from_dict(obj["ranked_community_timeline"]) if obj.get("ranked_community_timeline") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|