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.media_community_tweet_data import MediaCommunityTweetData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class CommunityMediaTimelineResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CommunityMediaTimelineResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
data: MediaCommunityTweetData
|
|
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 CommunityMediaTimelineResponse 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 CommunityMediaTimelineResponse 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": MediaCommunityTweetData.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,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.ranked_community_tweet_data import RankedCommunityTweetData
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class CommunityTweetsTimelineResponse(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
CommunityTweetsTimelineResponse
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
data: RankedCommunityTweetData
|
|
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 CommunityTweetsTimelineResponse 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 CommunityTweetsTimelineResponse 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": RankedCommunityTweetData.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
|
+
|
|
@@ -34,6 +34,8 @@ class ContentItemType(str, Enum):
|
|
|
34
34
|
TIMELINEMESSAGEPROMPT = 'TimelineMessagePrompt'
|
|
35
35
|
TIMELINECOMMUNITY = 'TimelineCommunity'
|
|
36
36
|
TIMELINETOMBSTONE = 'TimelineTombstone'
|
|
37
|
+
TIMELINETREND = 'TimelineTrend'
|
|
38
|
+
TIMELINENOTIFICATION = 'TimelineNotification'
|
|
37
39
|
|
|
38
40
|
@classmethod
|
|
39
41
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GrokImageAnnotation(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GrokImageAnnotation
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
prompt: StrictStr
|
|
31
|
+
upsampled_prompt: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["prompt", "upsampled_prompt"]
|
|
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 GrokImageAnnotation 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
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of GrokImageAnnotation from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"prompt": obj.get("prompt"),
|
|
86
|
+
"upsampled_prompt": obj.get("upsampled_prompt")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|
|
@@ -20,7 +20,6 @@ import json
|
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
|
-
from twitter_openapi_python_generated.models.grok_share_attachment_item import GrokShareAttachmentItem
|
|
24
23
|
from typing import Optional, Set
|
|
25
24
|
from typing_extensions import Self
|
|
26
25
|
|
|
@@ -93,4 +92,7 @@ class GrokShareAttachment(BaseModel):
|
|
|
93
92
|
})
|
|
94
93
|
return _obj
|
|
95
94
|
|
|
95
|
+
from twitter_openapi_python_generated.models.grok_share_attachment_item import GrokShareAttachmentItem
|
|
96
|
+
# TODO: Rewrite to not use raise_errors
|
|
97
|
+
GrokShareAttachment.model_rebuild(raise_errors=False)
|
|
96
98
|
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
@@ -27,9 +27,10 @@ class GrokShareAttachmentItem(BaseModel):
|
|
|
27
27
|
"""
|
|
28
28
|
GrokShareAttachmentItem
|
|
29
29
|
""" # noqa: E501
|
|
30
|
+
analysis_post_id_results: Optional[AnalysisResults] = None
|
|
30
31
|
media_urls: List[StrictStr]
|
|
31
32
|
message: StrictStr
|
|
32
|
-
__properties: ClassVar[List[str]] = ["media_urls", "message"]
|
|
33
|
+
__properties: ClassVar[List[str]] = ["analysis_post_id_results", "media_urls", "message"]
|
|
33
34
|
|
|
34
35
|
model_config = ConfigDict(
|
|
35
36
|
populate_by_name=True,
|
|
@@ -70,6 +71,9 @@ class GrokShareAttachmentItem(BaseModel):
|
|
|
70
71
|
exclude=excluded_fields,
|
|
71
72
|
exclude_none=True,
|
|
72
73
|
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of analysis_post_id_results
|
|
75
|
+
if self.analysis_post_id_results:
|
|
76
|
+
_dict['analysis_post_id_results'] = self.analysis_post_id_results.to_dict()
|
|
73
77
|
return _dict
|
|
74
78
|
|
|
75
79
|
@classmethod
|
|
@@ -82,9 +86,13 @@ class GrokShareAttachmentItem(BaseModel):
|
|
|
82
86
|
return cls.model_validate(obj)
|
|
83
87
|
|
|
84
88
|
_obj = cls.model_validate({
|
|
89
|
+
"analysis_post_id_results": AnalysisResults.from_dict(obj["analysis_post_id_results"]) if obj.get("analysis_post_id_results") is not None else None,
|
|
85
90
|
"media_urls": obj.get("media_urls"),
|
|
86
91
|
"message": obj.get("message")
|
|
87
92
|
})
|
|
88
93
|
return _obj
|
|
89
94
|
|
|
95
|
+
from twitter_openapi_python_generated.models.analysis_results import AnalysisResults
|
|
96
|
+
# TODO: Rewrite to not use raise_errors
|
|
97
|
+
GrokShareAttachmentItem.model_rebuild(raise_errors=False)
|
|
90
98
|
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from twitter_openapi_python_generated.models.home_timeline_home import HomeTimelineHome
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -28,7 +28,7 @@ class HomeTimelineResponseData(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
HomeTimelineResponseData
|
|
30
30
|
""" # noqa: E501
|
|
31
|
-
home:
|
|
31
|
+
home: HomeTimelineHome
|
|
32
32
|
__properties: ClassVar[List[str]] = ["home"]
|
|
33
33
|
|
|
34
34
|
model_config = ConfigDict(
|
|
@@ -35,6 +35,8 @@ class InstructionType(str, Enum):
|
|
|
35
35
|
TIMELINESHOWALERT = 'TimelineShowAlert'
|
|
36
36
|
TIMELINETERMINATETIMELINE = 'TimelineTerminateTimeline'
|
|
37
37
|
TIMELINESHOWCOVER = 'TimelineShowCover'
|
|
38
|
+
TIMELINECLEARENTRIESUNREADSTATE = 'TimelineClearEntriesUnreadState'
|
|
39
|
+
TIMELINEMARKENTRIESUNREADGREATERTHANSORTINDEX = 'TimelineMarkEntriesUnreadGreaterThanSortIndex'
|
|
38
40
|
|
|
39
41
|
@classmethod
|
|
40
42
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -21,6 +21,8 @@ from typing import Any, List, Optional
|
|
|
21
21
|
from twitter_openapi_python_generated.models.timeline_add_entries import TimelineAddEntries
|
|
22
22
|
from twitter_openapi_python_generated.models.timeline_add_to_module import TimelineAddToModule
|
|
23
23
|
from twitter_openapi_python_generated.models.timeline_clear_cache import TimelineClearCache
|
|
24
|
+
from twitter_openapi_python_generated.models.timeline_clear_entries_unread_state import TimelineClearEntriesUnreadState
|
|
25
|
+
from twitter_openapi_python_generated.models.timeline_mark_entries_unread_greater_than_sort_index import TimelineMarkEntriesUnreadGreaterThanSortIndex
|
|
24
26
|
from twitter_openapi_python_generated.models.timeline_pin_entry import TimelinePinEntry
|
|
25
27
|
from twitter_openapi_python_generated.models.timeline_replace_entry import TimelineReplaceEntry
|
|
26
28
|
from twitter_openapi_python_generated.models.timeline_show_alert import TimelineShowAlert
|
|
@@ -30,7 +32,7 @@ from pydantic import StrictStr, Field
|
|
|
30
32
|
from typing import Union, List, Set, Optional, Dict
|
|
31
33
|
from typing_extensions import Literal, Self
|
|
32
34
|
|
|
33
|
-
INSTRUCTIONUNION_ONE_OF_SCHEMAS = ["TimelineAddEntries", "TimelineAddToModule", "TimelineClearCache", "TimelinePinEntry", "TimelineReplaceEntry", "TimelineShowAlert", "TimelineShowCover", "TimelineTerminateTimeline"]
|
|
35
|
+
INSTRUCTIONUNION_ONE_OF_SCHEMAS = ["TimelineAddEntries", "TimelineAddToModule", "TimelineClearCache", "TimelineClearEntriesUnreadState", "TimelineMarkEntriesUnreadGreaterThanSortIndex", "TimelinePinEntry", "TimelineReplaceEntry", "TimelineShowAlert", "TimelineShowCover", "TimelineTerminateTimeline"]
|
|
34
36
|
|
|
35
37
|
class InstructionUnion(BaseModel):
|
|
36
38
|
"""
|
|
@@ -52,8 +54,12 @@ class InstructionUnion(BaseModel):
|
|
|
52
54
|
oneof_schema_7_validator: Optional[TimelineTerminateTimeline] = None
|
|
53
55
|
# data type: TimelineShowCover
|
|
54
56
|
oneof_schema_8_validator: Optional[TimelineShowCover] = None
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
# data type: TimelineClearEntriesUnreadState
|
|
58
|
+
oneof_schema_9_validator: Optional[TimelineClearEntriesUnreadState] = None
|
|
59
|
+
# data type: TimelineMarkEntriesUnreadGreaterThanSortIndex
|
|
60
|
+
oneof_schema_10_validator: Optional[TimelineMarkEntriesUnreadGreaterThanSortIndex] = None
|
|
61
|
+
actual_instance: Optional[Union[TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelineClearEntriesUnreadState, TimelineMarkEntriesUnreadGreaterThanSortIndex, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline]] = None
|
|
62
|
+
one_of_schemas: Set[str] = { "TimelineAddEntries", "TimelineAddToModule", "TimelineClearCache", "TimelineClearEntriesUnreadState", "TimelineMarkEntriesUnreadGreaterThanSortIndex", "TimelinePinEntry", "TimelineReplaceEntry", "TimelineShowAlert", "TimelineShowCover", "TimelineTerminateTimeline" }
|
|
57
63
|
|
|
58
64
|
model_config = ConfigDict(
|
|
59
65
|
validate_assignment=True,
|
|
@@ -119,12 +125,22 @@ class InstructionUnion(BaseModel):
|
|
|
119
125
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineShowCover`")
|
|
120
126
|
else:
|
|
121
127
|
match += 1
|
|
128
|
+
# validate data type: TimelineClearEntriesUnreadState
|
|
129
|
+
if not isinstance(v, TimelineClearEntriesUnreadState):
|
|
130
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineClearEntriesUnreadState`")
|
|
131
|
+
else:
|
|
132
|
+
match += 1
|
|
133
|
+
# validate data type: TimelineMarkEntriesUnreadGreaterThanSortIndex
|
|
134
|
+
if not isinstance(v, TimelineMarkEntriesUnreadGreaterThanSortIndex):
|
|
135
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineMarkEntriesUnreadGreaterThanSortIndex`")
|
|
136
|
+
else:
|
|
137
|
+
match += 1
|
|
122
138
|
if match > 1:
|
|
123
139
|
# more than 1 match
|
|
124
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
140
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelineClearEntriesUnreadState, TimelineMarkEntriesUnreadGreaterThanSortIndex, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
125
141
|
elif match == 0:
|
|
126
142
|
# no match
|
|
127
|
-
raise ValueError("No match found when setting `actual_instance` in InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
143
|
+
raise ValueError("No match found when setting `actual_instance` in InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelineClearEntriesUnreadState, TimelineMarkEntriesUnreadGreaterThanSortIndex, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
128
144
|
else:
|
|
129
145
|
return v
|
|
130
146
|
|
|
@@ -159,6 +175,16 @@ class InstructionUnion(BaseModel):
|
|
|
159
175
|
instance.actual_instance = TimelineClearCache.from_json(json_str)
|
|
160
176
|
return instance
|
|
161
177
|
|
|
178
|
+
# check if data type is `TimelineClearEntriesUnreadState`
|
|
179
|
+
if _data_type == "TimelineClearEntriesUnreadState":
|
|
180
|
+
instance.actual_instance = TimelineClearEntriesUnreadState.from_json(json_str)
|
|
181
|
+
return instance
|
|
182
|
+
|
|
183
|
+
# check if data type is `TimelineMarkEntriesUnreadGreaterThanSortIndex`
|
|
184
|
+
if _data_type == "TimelineMarkEntriesUnreadGreaterThanSortIndex":
|
|
185
|
+
instance.actual_instance = TimelineMarkEntriesUnreadGreaterThanSortIndex.from_json(json_str)
|
|
186
|
+
return instance
|
|
187
|
+
|
|
162
188
|
# check if data type is `TimelinePinEntry`
|
|
163
189
|
if _data_type == "TimelinePinEntry":
|
|
164
190
|
instance.actual_instance = TimelinePinEntry.from_json(json_str)
|
|
@@ -232,13 +258,25 @@ class InstructionUnion(BaseModel):
|
|
|
232
258
|
match += 1
|
|
233
259
|
except (ValidationError, ValueError) as e:
|
|
234
260
|
error_messages.append(str(e))
|
|
261
|
+
# deserialize data into TimelineClearEntriesUnreadState
|
|
262
|
+
try:
|
|
263
|
+
instance.actual_instance = TimelineClearEntriesUnreadState.from_json(json_str)
|
|
264
|
+
match += 1
|
|
265
|
+
except (ValidationError, ValueError) as e:
|
|
266
|
+
error_messages.append(str(e))
|
|
267
|
+
# deserialize data into TimelineMarkEntriesUnreadGreaterThanSortIndex
|
|
268
|
+
try:
|
|
269
|
+
instance.actual_instance = TimelineMarkEntriesUnreadGreaterThanSortIndex.from_json(json_str)
|
|
270
|
+
match += 1
|
|
271
|
+
except (ValidationError, ValueError) as e:
|
|
272
|
+
error_messages.append(str(e))
|
|
235
273
|
|
|
236
274
|
if match > 1:
|
|
237
275
|
# more than 1 match
|
|
238
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
276
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelineClearEntriesUnreadState, TimelineMarkEntriesUnreadGreaterThanSortIndex, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
239
277
|
elif match == 0:
|
|
240
278
|
# no match
|
|
241
|
-
raise ValueError("No match found when deserializing the JSON string into InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
279
|
+
raise ValueError("No match found when deserializing the JSON string into InstructionUnion with oneOf schemas: TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelineClearEntriesUnreadState, TimelineMarkEntriesUnreadGreaterThanSortIndex, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline. Details: " + ", ".join(error_messages))
|
|
242
280
|
else:
|
|
243
281
|
return instance
|
|
244
282
|
|
|
@@ -252,7 +290,7 @@ class InstructionUnion(BaseModel):
|
|
|
252
290
|
else:
|
|
253
291
|
return json.dumps(self.actual_instance)
|
|
254
292
|
|
|
255
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline]]:
|
|
293
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineAddEntries, TimelineAddToModule, TimelineClearCache, TimelineClearEntriesUnreadState, TimelineMarkEntriesUnreadGreaterThanSortIndex, TimelinePinEntry, TimelineReplaceEntry, TimelineShowAlert, TimelineShowCover, TimelineTerminateTimeline]]:
|
|
256
294
|
"""Returns the dict representation of the actual instance"""
|
|
257
295
|
if self.actual_instance is None:
|
|
258
296
|
return None
|
|
@@ -20,6 +20,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, f
|
|
|
20
20
|
from typing import Any, List, Optional
|
|
21
21
|
from twitter_openapi_python_generated.models.timeline_community import TimelineCommunity
|
|
22
22
|
from twitter_openapi_python_generated.models.timeline_message_prompt import TimelineMessagePrompt
|
|
23
|
+
from twitter_openapi_python_generated.models.timeline_notification import TimelineNotification
|
|
23
24
|
from twitter_openapi_python_generated.models.timeline_prompt import TimelinePrompt
|
|
24
25
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
25
26
|
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone
|
|
@@ -30,7 +31,7 @@ from pydantic import StrictStr, Field
|
|
|
30
31
|
from typing import Union, List, Set, Optional, Dict
|
|
31
32
|
from typing_extensions import Literal, Self
|
|
32
33
|
|
|
33
|
-
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineMessagePrompt", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineUser"]
|
|
34
|
+
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineUser"]
|
|
34
35
|
|
|
35
36
|
class ItemContentUnion(BaseModel):
|
|
36
37
|
"""
|
|
@@ -52,8 +53,10 @@ class ItemContentUnion(BaseModel):
|
|
|
52
53
|
oneof_schema_7_validator: Optional[TimelineTombstone] = None
|
|
53
54
|
# data type: TimelineTrend
|
|
54
55
|
oneof_schema_8_validator: Optional[TimelineTrend] = None
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
# data type: TimelineNotification
|
|
57
|
+
oneof_schema_9_validator: Optional[TimelineNotification] = None
|
|
58
|
+
actual_instance: Optional[Union[TimelineCommunity, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser]] = None
|
|
59
|
+
one_of_schemas: Set[str] = { "TimelineCommunity", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineUser" }
|
|
57
60
|
|
|
58
61
|
model_config = ConfigDict(
|
|
59
62
|
validate_assignment=True,
|
|
@@ -119,12 +122,17 @@ class ItemContentUnion(BaseModel):
|
|
|
119
122
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineTrend`")
|
|
120
123
|
else:
|
|
121
124
|
match += 1
|
|
125
|
+
# validate data type: TimelineNotification
|
|
126
|
+
if not isinstance(v, TimelineNotification):
|
|
127
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineNotification`")
|
|
128
|
+
else:
|
|
129
|
+
match += 1
|
|
122
130
|
if match > 1:
|
|
123
131
|
# more than 1 match
|
|
124
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
132
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
125
133
|
elif match == 0:
|
|
126
134
|
# no match
|
|
127
|
-
raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
135
|
+
raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
128
136
|
else:
|
|
129
137
|
return v
|
|
130
138
|
|
|
@@ -154,6 +162,11 @@ class ItemContentUnion(BaseModel):
|
|
|
154
162
|
instance.actual_instance = TimelineMessagePrompt.from_json(json_str)
|
|
155
163
|
return instance
|
|
156
164
|
|
|
165
|
+
# check if data type is `TimelineNotification`
|
|
166
|
+
if _data_type == "TimelineNotification":
|
|
167
|
+
instance.actual_instance = TimelineNotification.from_json(json_str)
|
|
168
|
+
return instance
|
|
169
|
+
|
|
157
170
|
# check if data type is `TimelinePrompt`
|
|
158
171
|
if _data_type == "TimelinePrompt":
|
|
159
172
|
instance.actual_instance = TimelinePrompt.from_json(json_str)
|
|
@@ -232,13 +245,19 @@ class ItemContentUnion(BaseModel):
|
|
|
232
245
|
match += 1
|
|
233
246
|
except (ValidationError, ValueError) as e:
|
|
234
247
|
error_messages.append(str(e))
|
|
248
|
+
# deserialize data into TimelineNotification
|
|
249
|
+
try:
|
|
250
|
+
instance.actual_instance = TimelineNotification.from_json(json_str)
|
|
251
|
+
match += 1
|
|
252
|
+
except (ValidationError, ValueError) as e:
|
|
253
|
+
error_messages.append(str(e))
|
|
235
254
|
|
|
236
255
|
if match > 1:
|
|
237
256
|
# more than 1 match
|
|
238
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
257
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
239
258
|
elif match == 0:
|
|
240
259
|
# no match
|
|
241
|
-
raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
260
|
+
raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser. Details: " + ", ".join(error_messages))
|
|
242
261
|
else:
|
|
243
262
|
return instance
|
|
244
263
|
|
|
@@ -252,7 +271,7 @@ class ItemContentUnion(BaseModel):
|
|
|
252
271
|
else:
|
|
253
272
|
return json.dumps(self.actual_instance)
|
|
254
273
|
|
|
255
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineMessagePrompt, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser]]:
|
|
274
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineUser]]:
|
|
256
275
|
"""Returns the dict representation of the actual instance"""
|
|
257
276
|
if self.actual_instance is None:
|
|
258
277
|
return None
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
23
|
from twitter_openapi_python_generated.models.list_tweets_timeline_list import ListTweetsTimelineList
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -28,7 +28,7 @@ class ListTweetsTimelineData(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
ListTweetsTimelineData
|
|
30
30
|
""" # noqa: E501
|
|
31
|
-
list:
|
|
31
|
+
list: ListTweetsTimelineList
|
|
32
32
|
__properties: ClassVar[List[str]] = ["list"]
|
|
33
33
|
|
|
34
34
|
model_config = ConfigDict(
|
|
@@ -20,7 +20,7 @@ import json
|
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
23
|
-
from twitter_openapi_python_generated.models.
|
|
23
|
+
from twitter_openapi_python_generated.models.timeline_result import TimelineResult
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
26
|
|
|
@@ -28,7 +28,7 @@ class ListTweetsTimelineList(BaseModel):
|
|
|
28
28
|
"""
|
|
29
29
|
ListTweetsTimelineList
|
|
30
30
|
""" # noqa: E501
|
|
31
|
-
tweets_timeline:
|
|
31
|
+
tweets_timeline: TimelineResult
|
|
32
32
|
__properties: ClassVar[List[str]] = ["tweets_timeline"]
|
|
33
33
|
|
|
34
34
|
model_config = ConfigDict(
|
|
@@ -85,7 +85,7 @@ class ListTweetsTimelineList(BaseModel):
|
|
|
85
85
|
return cls.model_validate(obj)
|
|
86
86
|
|
|
87
87
|
_obj = cls.model_validate({
|
|
88
|
-
"tweets_timeline":
|
|
88
|
+
"tweets_timeline": TimelineResult.from_dict(obj["tweets_timeline"]) if obj.get("tweets_timeline") is not None else None
|
|
89
89
|
})
|
|
90
90
|
return _obj
|
|
91
91
|
|