twitter-openapi-python-generated 0.1.8__py3-none-any.whl → 0.1.10__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 +9 -1
- twitter_openapi_python_generated/api_client.py +1 -1
- twitter_openapi_python_generated/configuration.py +1 -1
- twitter_openapi_python_generated/models/__init__.py +4 -0
- twitter_openapi_python_generated/models/about_account_verification_info.py +5 -3
- twitter_openapi_python_generated/models/about_profile.py +7 -5
- twitter_openapi_python_generated/models/ad_metadata_container.py +3 -1
- twitter_openapi_python_generated/models/badge_counts.py +6 -2
- twitter_openapi_python_generated/models/cashtag_attachment.py +32 -3
- twitter_openapi_python_generated/models/community_page_community.py +11 -3
- twitter_openapi_python_generated/models/community_page_join_action_result.py +7 -3
- twitter_openapi_python_generated/models/content_item_type.py +1 -0
- twitter_openapi_python_generated/models/conversation_control_details.py +89 -0
- twitter_openapi_python_generated/models/event_summary_ad_metadata_container.py +7 -3
- twitter_openapi_python_generated/models/item_content_union.py +27 -8
- twitter_openapi_python_generated/models/media.py +11 -2
- twitter_openapi_python_generated/models/media_extended.py +11 -2
- twitter_openapi_python_generated/models/profile_bio.py +3 -1
- twitter_openapi_python_generated/models/timeline_message_prompt.py +11 -2
- twitter_openapi_python_generated/models/timeline_message_prompt_button_action.py +17 -2
- twitter_openapi_python_generated/models/timeline_message_prompt_content.py +15 -2
- twitter_openapi_python_generated/models/timeline_message_prompt_image.py +96 -0
- twitter_openapi_python_generated/models/timeline_message_prompt_image_variant.py +93 -0
- twitter_openapi_python_generated/models/timeline_smart_tag.py +103 -0
- twitter_openapi_python_generated/models/tweet.py +7 -1
- twitter_openapi_python_generated/models/type_name.py +1 -0
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.10.dist-info}/METADATA +6 -2
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.10.dist-info}/RECORD +32 -28
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.10.dist-info}/WHEEL +0 -0
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.10.dist-info}/licenses/LICENSE +0 -0
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.10.dist-info}/licenses/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.10.dist-info}/top_level.txt +0 -0
|
@@ -21,7 +21,6 @@ import json
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
|
-
from uuid import UUID
|
|
25
24
|
from twitter_openapi_python_generated.models.allow_download_status import AllowDownloadStatus
|
|
26
25
|
from twitter_openapi_python_generated.models.ext_media_availability import ExtMediaAvailability
|
|
27
26
|
from twitter_openapi_python_generated.models.media_original_info import MediaOriginalInfo
|
|
@@ -44,7 +43,7 @@ class Media(BaseModel):
|
|
|
44
43
|
ext_alt_text: Optional[StrictStr] = None
|
|
45
44
|
ext_media_availability: ExtMediaAvailability
|
|
46
45
|
features: Optional[Dict[str, Any]] = None
|
|
47
|
-
grok_post_id: Optional[
|
|
46
|
+
grok_post_id: Optional[Annotated[str, Field(strict=True)]] = None
|
|
48
47
|
id_str: Annotated[str, Field(strict=True)]
|
|
49
48
|
indices: List[StrictInt]
|
|
50
49
|
media_key: StrictStr
|
|
@@ -61,6 +60,16 @@ class Media(BaseModel):
|
|
|
61
60
|
video_info: Optional[MediaVideoInfo] = None
|
|
62
61
|
__properties: ClassVar[List[str]] = ["additional_media_info", "allow_download_status", "display_url", "expanded_url", "ext_alt_text", "ext_media_availability", "features", "grok_post_id", "id_str", "indices", "media_key", "media_results", "media_url_https", "original_info", "sensitive_media_warning", "sizes", "source_status_id_str", "source_user_id_str", "source_user_results", "type", "url", "video_info"]
|
|
63
62
|
|
|
63
|
+
@field_validator('grok_post_id', mode="before")
|
|
64
|
+
def grok_post_id_validate_regular_expression(cls, value):
|
|
65
|
+
"""Validates the regular expression"""
|
|
66
|
+
if value is None:
|
|
67
|
+
return value
|
|
68
|
+
|
|
69
|
+
if isinstance(value, str) and not re.match(r"^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$", value):
|
|
70
|
+
raise ValueError(r"must validate the regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$/")
|
|
71
|
+
return value
|
|
72
|
+
|
|
64
73
|
@field_validator('id_str', mode="before")
|
|
65
74
|
def id_str_validate_regular_expression(cls, value):
|
|
66
75
|
"""Validates the regular expression"""
|
|
@@ -21,7 +21,6 @@ import json
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
|
-
from uuid import UUID
|
|
25
24
|
from twitter_openapi_python_generated.models.additional_media_info import AdditionalMediaInfo
|
|
26
25
|
from twitter_openapi_python_generated.models.allow_download_status import AllowDownloadStatus
|
|
27
26
|
from twitter_openapi_python_generated.models.ext_media_availability import ExtMediaAvailability
|
|
@@ -47,7 +46,7 @@ class MediaExtended(BaseModel):
|
|
|
47
46
|
ext_alt_text: Optional[StrictStr] = None
|
|
48
47
|
ext_media_availability: Optional[ExtMediaAvailability] = None
|
|
49
48
|
features: Optional[Dict[str, Any]] = None
|
|
50
|
-
grok_post_id: Optional[
|
|
49
|
+
grok_post_id: Optional[Annotated[str, Field(strict=True)]] = None
|
|
51
50
|
id_str: Annotated[str, Field(strict=True)]
|
|
52
51
|
indices: List[StrictInt]
|
|
53
52
|
media_stats: Optional[MediaStats] = Field(default=None, alias="mediaStats")
|
|
@@ -65,6 +64,16 @@ class MediaExtended(BaseModel):
|
|
|
65
64
|
video_info: Optional[MediaVideoInfo] = None
|
|
66
65
|
__properties: ClassVar[List[str]] = ["additional_media_info", "allow_download_status", "display_url", "expanded_url", "ext_alt_text", "ext_media_availability", "features", "grok_post_id", "id_str", "indices", "mediaStats", "media_key", "media_results", "media_url_https", "original_info", "sensitive_media_warning", "sizes", "source_status_id_str", "source_user_id_str", "source_user_results", "type", "url", "video_info"]
|
|
67
66
|
|
|
67
|
+
@field_validator('grok_post_id', mode="before")
|
|
68
|
+
def grok_post_id_validate_regular_expression(cls, value):
|
|
69
|
+
"""Validates the regular expression"""
|
|
70
|
+
if value is None:
|
|
71
|
+
return value
|
|
72
|
+
|
|
73
|
+
if isinstance(value, str) and not re.match(r"^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$", value):
|
|
74
|
+
raise ValueError(r"must validate the regular expression /^([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})?$/")
|
|
75
|
+
return value
|
|
76
|
+
|
|
68
77
|
@field_validator('id_str', mode="before")
|
|
69
78
|
def id_str_validate_regular_expression(cls, value):
|
|
70
79
|
"""Validates the regular expression"""
|
|
@@ -31,8 +31,9 @@ class ProfileBio(BaseModel):
|
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
description: StrictStr
|
|
33
33
|
entities: Optional[ProfileBioEntities] = None
|
|
34
|
+
with_held_scope: Optional[StrictStr] = None
|
|
34
35
|
withheld_in_countries: Optional[List[StrictStr]] = None
|
|
35
|
-
__properties: ClassVar[List[str]] = ["description", "entities", "withheld_in_countries"]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["description", "entities", "with_held_scope", "withheld_in_countries"]
|
|
36
37
|
|
|
37
38
|
model_config = ConfigDict(
|
|
38
39
|
validate_by_name=True,
|
|
@@ -90,6 +91,7 @@ class ProfileBio(BaseModel):
|
|
|
90
91
|
_obj = cls.model_validate({
|
|
91
92
|
"description": obj.get("description"),
|
|
92
93
|
"entities": ProfileBioEntities.from_dict(obj["entities"]) if obj.get("entities") is not None else None,
|
|
94
|
+
"with_held_scope": obj.get("with_held_scope"),
|
|
93
95
|
"withheld_in_countries": obj.get("withheld_in_countries")
|
|
94
96
|
})
|
|
95
97
|
return _obj
|
|
@@ -19,7 +19,8 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.callback import Callback
|
|
23
24
|
from twitter_openapi_python_generated.models.content_item_type import ContentItemType
|
|
24
25
|
from twitter_openapi_python_generated.models.timeline_message_prompt_content import TimelineMessagePromptContent
|
|
25
26
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
@@ -33,8 +34,9 @@ class TimelineMessagePrompt(BaseModel):
|
|
|
33
34
|
""" # noqa: E501
|
|
34
35
|
typename: TypeName = Field(alias="__typename")
|
|
35
36
|
content: TimelineMessagePromptContent
|
|
37
|
+
impression_callbacks: Optional[List[Callback]] = Field(default=None, alias="impressionCallbacks")
|
|
36
38
|
item_type: ContentItemType = Field(alias="itemType")
|
|
37
|
-
__properties: ClassVar[List[str]] = ["__typename", "content", "itemType"]
|
|
39
|
+
__properties: ClassVar[List[str]] = ["__typename", "content", "impressionCallbacks", "itemType"]
|
|
38
40
|
|
|
39
41
|
model_config = ConfigDict(
|
|
40
42
|
validate_by_name=True,
|
|
@@ -78,6 +80,12 @@ class TimelineMessagePrompt(BaseModel):
|
|
|
78
80
|
# override the default output from pydantic by calling `to_dict()` of content
|
|
79
81
|
if self.content:
|
|
80
82
|
_dict['content'] = self.content.to_dict()
|
|
83
|
+
# override the default output from pydantic by calling `to_dict()` of each item in impression_callbacks (list)
|
|
84
|
+
_items = []
|
|
85
|
+
if self.impression_callbacks:
|
|
86
|
+
for _item_impression_callbacks in self.impression_callbacks:
|
|
87
|
+
_items.append(_item_impression_callbacks.to_dict() if _item_impression_callbacks is not None else None)
|
|
88
|
+
_dict['impressionCallbacks'] = _items
|
|
81
89
|
return _dict
|
|
82
90
|
|
|
83
91
|
@classmethod
|
|
@@ -92,6 +100,7 @@ class TimelineMessagePrompt(BaseModel):
|
|
|
92
100
|
_obj = cls.model_validate({
|
|
93
101
|
"__typename": obj.get("__typename"),
|
|
94
102
|
"content": TimelineMessagePromptContent.from_dict(obj["content"]) if obj.get("content") is not None else None,
|
|
103
|
+
"impressionCallbacks": [Callback.from_dict(_item) for _item in obj["impressionCallbacks"]] if obj.get("impressionCallbacks") is not None else None,
|
|
95
104
|
"itemType": obj.get("itemType")
|
|
96
105
|
})
|
|
97
106
|
return _obj
|
|
@@ -19,7 +19,9 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.callback import Callback
|
|
24
|
+
from twitter_openapi_python_generated.models.cta_client_event_info import CtaClientEventInfo
|
|
23
25
|
from typing import Optional, Set
|
|
24
26
|
from typing_extensions import Self
|
|
25
27
|
from pydantic_core import to_jsonable_python
|
|
@@ -28,9 +30,11 @@ class TimelineMessagePromptButtonAction(BaseModel):
|
|
|
28
30
|
"""
|
|
29
31
|
TimelineMessagePromptButtonAction
|
|
30
32
|
""" # noqa: E501
|
|
33
|
+
client_event_info: Optional[CtaClientEventInfo] = Field(default=None, alias="clientEventInfo")
|
|
31
34
|
dismiss_on_click: StrictBool = Field(alias="dismissOnClick")
|
|
35
|
+
on_click_callbacks: Optional[List[Callback]] = Field(default=None, alias="onClickCallbacks")
|
|
32
36
|
url: StrictStr
|
|
33
|
-
__properties: ClassVar[List[str]] = ["dismissOnClick", "url"]
|
|
37
|
+
__properties: ClassVar[List[str]] = ["clientEventInfo", "dismissOnClick", "onClickCallbacks", "url"]
|
|
34
38
|
|
|
35
39
|
model_config = ConfigDict(
|
|
36
40
|
validate_by_name=True,
|
|
@@ -71,6 +75,15 @@ class TimelineMessagePromptButtonAction(BaseModel):
|
|
|
71
75
|
exclude=excluded_fields,
|
|
72
76
|
exclude_none=True,
|
|
73
77
|
)
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of client_event_info
|
|
79
|
+
if self.client_event_info:
|
|
80
|
+
_dict['clientEventInfo'] = self.client_event_info.to_dict()
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in on_click_callbacks (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.on_click_callbacks:
|
|
84
|
+
for _item_on_click_callbacks in self.on_click_callbacks:
|
|
85
|
+
_items.append(_item_on_click_callbacks.to_dict() if _item_on_click_callbacks is not None else None)
|
|
86
|
+
_dict['onClickCallbacks'] = _items
|
|
74
87
|
return _dict
|
|
75
88
|
|
|
76
89
|
@classmethod
|
|
@@ -83,7 +96,9 @@ class TimelineMessagePromptButtonAction(BaseModel):
|
|
|
83
96
|
return cls.model_validate(obj)
|
|
84
97
|
|
|
85
98
|
_obj = cls.model_validate({
|
|
99
|
+
"clientEventInfo": CtaClientEventInfo.from_dict(obj["clientEventInfo"]) if obj.get("clientEventInfo") is not None else None,
|
|
86
100
|
"dismissOnClick": obj.get("dismissOnClick"),
|
|
101
|
+
"onClickCallbacks": [Callback.from_dict(_item) for _item in obj["onClickCallbacks"]] if obj.get("onClickCallbacks") is not None else None,
|
|
87
102
|
"url": obj.get("url")
|
|
88
103
|
})
|
|
89
104
|
return _obj
|
|
@@ -21,6 +21,7 @@ import json
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.timeline_message_prompt_button import TimelineMessagePromptButton
|
|
24
|
+
from twitter_openapi_python_generated.models.timeline_message_prompt_image import TimelineMessagePromptImage
|
|
24
25
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text import TimelineMessagePromptRichText
|
|
25
26
|
from typing import Optional, Set
|
|
26
27
|
from typing_extensions import Self
|
|
@@ -33,9 +34,12 @@ class TimelineMessagePromptContent(BaseModel):
|
|
|
33
34
|
body_rich_text: Optional[TimelineMessagePromptRichText] = Field(default=None, alias="bodyRichText")
|
|
34
35
|
body_text: Optional[StrictStr] = Field(default=None, alias="bodyText")
|
|
35
36
|
content_type: StrictStr = Field(alias="contentType")
|
|
36
|
-
|
|
37
|
+
header_image: Optional[TimelineMessagePromptImage] = Field(default=None, alias="headerImage")
|
|
38
|
+
header_rich_text: Optional[TimelineMessagePromptRichText] = Field(default=None, alias="headerRichText")
|
|
39
|
+
header_text: Optional[StrictStr] = Field(default=None, alias="headerText")
|
|
40
|
+
optional_header_text: Optional[StrictStr] = Field(default=None, alias="optionalHeaderText")
|
|
37
41
|
primary_button_action: Optional[TimelineMessagePromptButton] = Field(default=None, alias="primaryButtonAction")
|
|
38
|
-
__properties: ClassVar[List[str]] = ["bodyRichText", "bodyText", "contentType", "headerText", "primaryButtonAction"]
|
|
42
|
+
__properties: ClassVar[List[str]] = ["bodyRichText", "bodyText", "contentType", "headerImage", "headerRichText", "headerText", "optionalHeaderText", "primaryButtonAction"]
|
|
39
43
|
|
|
40
44
|
model_config = ConfigDict(
|
|
41
45
|
validate_by_name=True,
|
|
@@ -79,6 +83,12 @@ class TimelineMessagePromptContent(BaseModel):
|
|
|
79
83
|
# override the default output from pydantic by calling `to_dict()` of body_rich_text
|
|
80
84
|
if self.body_rich_text:
|
|
81
85
|
_dict['bodyRichText'] = self.body_rich_text.to_dict()
|
|
86
|
+
# override the default output from pydantic by calling `to_dict()` of header_image
|
|
87
|
+
if self.header_image:
|
|
88
|
+
_dict['headerImage'] = self.header_image.to_dict()
|
|
89
|
+
# override the default output from pydantic by calling `to_dict()` of header_rich_text
|
|
90
|
+
if self.header_rich_text:
|
|
91
|
+
_dict['headerRichText'] = self.header_rich_text.to_dict()
|
|
82
92
|
# override the default output from pydantic by calling `to_dict()` of primary_button_action
|
|
83
93
|
if self.primary_button_action:
|
|
84
94
|
_dict['primaryButtonAction'] = self.primary_button_action.to_dict()
|
|
@@ -97,7 +107,10 @@ class TimelineMessagePromptContent(BaseModel):
|
|
|
97
107
|
"bodyRichText": TimelineMessagePromptRichText.from_dict(obj["bodyRichText"]) if obj.get("bodyRichText") is not None else None,
|
|
98
108
|
"bodyText": obj.get("bodyText"),
|
|
99
109
|
"contentType": obj.get("contentType"),
|
|
110
|
+
"headerImage": TimelineMessagePromptImage.from_dict(obj["headerImage"]) if obj.get("headerImage") is not None else None,
|
|
111
|
+
"headerRichText": TimelineMessagePromptRichText.from_dict(obj["headerRichText"]) if obj.get("headerRichText") is not None else None,
|
|
100
112
|
"headerText": obj.get("headerText"),
|
|
113
|
+
"optionalHeaderText": obj.get("optionalHeaderText"),
|
|
101
114
|
"primaryButtonAction": TimelineMessagePromptButton.from_dict(obj["primaryButtonAction"]) if obj.get("primaryButtonAction") is not None else None
|
|
102
115
|
})
|
|
103
116
|
return _obj
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from twitter_openapi_python_generated.models.timeline_message_prompt_image_variant import TimelineMessagePromptImageVariant
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class TimelineMessagePromptImage(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
TimelineMessagePromptImage
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
image_variants: List[TimelineMessagePromptImageVariant] = Field(alias="imageVariants")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["imageVariants"]
|
|
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 TimelineMessagePromptImage 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 each item in image_variants (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.image_variants:
|
|
77
|
+
for _item_image_variants in self.image_variants:
|
|
78
|
+
_items.append(_item_image_variants.to_dict() if _item_image_variants is not None else None)
|
|
79
|
+
_dict['imageVariants'] = _items
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of TimelineMessagePromptImage from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"imageVariants": [TimelineMessagePromptImageVariant.from_dict(_item) for _item in obj["imageVariants"]] if obj.get("imageVariants") is not None else None
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -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, 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 TimelineMessagePromptImageVariant(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
TimelineMessagePromptImageVariant
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
height: StrictInt
|
|
32
|
+
url: StrictStr
|
|
33
|
+
width: StrictInt
|
|
34
|
+
__properties: ClassVar[List[str]] = ["height", "url", "width"]
|
|
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 TimelineMessagePromptImageVariant from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of TimelineMessagePromptImageVariant from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"height": obj.get("height"),
|
|
88
|
+
"url": obj.get("url"),
|
|
89
|
+
"width": obj.get("width")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Twitter OpenAPI
|
|
5
|
+
|
|
6
|
+
Twitter OpenAPI(Swagger) specification
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.0.1
|
|
9
|
+
Contact: yuki@yuki0311.com
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
from __future__ import annotations
|
|
17
|
+
import pprint
|
|
18
|
+
import re # noqa: F401
|
|
19
|
+
import json
|
|
20
|
+
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from twitter_openapi_python_generated.models.content_item_type import ContentItemType
|
|
24
|
+
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
from pydantic_core import to_jsonable_python
|
|
28
|
+
|
|
29
|
+
class TimelineSmartTag(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
TimelineSmartTag
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
typename: TypeName = Field(alias="__typename")
|
|
34
|
+
active: StrictBool
|
|
35
|
+
item_type: ContentItemType = Field(alias="itemType")
|
|
36
|
+
rest_id: StrictStr = Field(alias="restId")
|
|
37
|
+
supports_ohlc: StrictBool = Field(alias="supportsOhlc")
|
|
38
|
+
theme_override: Optional[StrictStr] = Field(default=None, alias="themeOverride")
|
|
39
|
+
tradable_platforms: List[Dict[str, Any]] = Field(alias="tradablePlatforms")
|
|
40
|
+
__properties: ClassVar[List[str]] = ["__typename", "active", "itemType", "restId", "supportsOhlc", "themeOverride", "tradablePlatforms"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
validate_by_name=True,
|
|
44
|
+
validate_by_alias=True,
|
|
45
|
+
validate_assignment=True,
|
|
46
|
+
protected_namespaces=(),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_str(self) -> str:
|
|
51
|
+
"""Returns the string representation of the model using alias"""
|
|
52
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
53
|
+
|
|
54
|
+
def to_json(self) -> str:
|
|
55
|
+
"""Returns the JSON representation of the model using alias"""
|
|
56
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of TimelineSmartTag from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of TimelineSmartTag from a dict"""
|
|
86
|
+
if obj is None:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
if not isinstance(obj, dict):
|
|
90
|
+
return cls.model_validate(obj)
|
|
91
|
+
|
|
92
|
+
_obj = cls.model_validate({
|
|
93
|
+
"__typename": obj.get("__typename"),
|
|
94
|
+
"active": obj.get("active"),
|
|
95
|
+
"itemType": obj.get("itemType"),
|
|
96
|
+
"restId": obj.get("restId"),
|
|
97
|
+
"supportsOhlc": obj.get("supportsOhlc"),
|
|
98
|
+
"themeOverride": obj.get("themeOverride"),
|
|
99
|
+
"tradablePlatforms": obj.get("tradablePlatforms")
|
|
100
|
+
})
|
|
101
|
+
return _obj
|
|
102
|
+
|
|
103
|
+
|
|
@@ -28,6 +28,7 @@ from twitter_openapi_python_generated.models.cashtag_attachment import CashtagAt
|
|
|
28
28
|
from twitter_openapi_python_generated.models.community_relationship import CommunityRelationship
|
|
29
29
|
from twitter_openapi_python_generated.models.community_result import CommunityResult
|
|
30
30
|
from twitter_openapi_python_generated.models.content_disclosure import ContentDisclosure
|
|
31
|
+
from twitter_openapi_python_generated.models.conversation_control_details import ConversationControlDetails
|
|
31
32
|
from twitter_openapi_python_generated.models.grok_annotation import GrokAnnotation
|
|
32
33
|
from twitter_openapi_python_generated.models.grok_translated_post_with_availability import GrokTranslatedPostWithAvailability
|
|
33
34
|
from twitter_openapi_python_generated.models.jetfuel_attachment import JetfuelAttachment
|
|
@@ -61,6 +62,7 @@ class Tweet(BaseModel):
|
|
|
61
62
|
community_relationship: Optional[CommunityRelationship] = None
|
|
62
63
|
community_results: Optional[CommunityResult] = None
|
|
63
64
|
content_disclosure: Optional[ContentDisclosure] = None
|
|
65
|
+
conversation_control_details: Optional[ConversationControlDetails] = None
|
|
64
66
|
core: Optional[UserResultCore] = None
|
|
65
67
|
edit_control: Optional[TweetEditControl] = None
|
|
66
68
|
edit_prespective: Optional[TweetEditPrespective] = None
|
|
@@ -91,7 +93,7 @@ class Tweet(BaseModel):
|
|
|
91
93
|
unmention_data: Optional[Dict[str, Any]] = None
|
|
92
94
|
views: Optional[TweetView] = None
|
|
93
95
|
voice_info: Optional[Dict[str, Any]] = Field(default=None, alias="voiceInfo")
|
|
94
|
-
__properties: ClassVar[List[str]] = ["__typename", "article", "author_community_relationship", "birdwatch_pivot", "card", "cashtag_attachments", "community_relationship", "community_results", "content_disclosure", "core", "edit_control", "edit_prespective", "grok_analysis_button", "grok_analysis_followups", "grok_annotations", "grok_share_attachment", "grok_translated_post_with_availability", "has_birdwatch_notes", "is_translatable", "jetfuel_attachment", "legacy", "nested_quoted_tweet_results", "note_tweet", "postCta", "post_image_description", "post_video_description", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "sports_post_context", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views", "voiceInfo"]
|
|
96
|
+
__properties: ClassVar[List[str]] = ["__typename", "article", "author_community_relationship", "birdwatch_pivot", "card", "cashtag_attachments", "community_relationship", "community_results", "content_disclosure", "conversation_control_details", "core", "edit_control", "edit_prespective", "grok_analysis_button", "grok_analysis_followups", "grok_annotations", "grok_share_attachment", "grok_translated_post_with_availability", "has_birdwatch_notes", "is_translatable", "jetfuel_attachment", "legacy", "nested_quoted_tweet_results", "note_tweet", "postCta", "post_image_description", "post_video_description", "previous_counts", "quick_promote_eligibility", "quotedRefResult", "quoted_status_result", "rest_id", "source", "sports_post_context", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views", "voiceInfo"]
|
|
95
97
|
|
|
96
98
|
@field_validator('rest_id', mode="before")
|
|
97
99
|
def rest_id_validate_regular_expression(cls, value):
|
|
@@ -166,6 +168,9 @@ class Tweet(BaseModel):
|
|
|
166
168
|
# override the default output from pydantic by calling `to_dict()` of content_disclosure
|
|
167
169
|
if self.content_disclosure:
|
|
168
170
|
_dict['content_disclosure'] = self.content_disclosure.to_dict()
|
|
171
|
+
# override the default output from pydantic by calling `to_dict()` of conversation_control_details
|
|
172
|
+
if self.conversation_control_details:
|
|
173
|
+
_dict['conversation_control_details'] = self.conversation_control_details.to_dict()
|
|
169
174
|
# override the default output from pydantic by calling `to_dict()` of core
|
|
170
175
|
if self.core:
|
|
171
176
|
_dict['core'] = self.core.to_dict()
|
|
@@ -244,6 +249,7 @@ class Tweet(BaseModel):
|
|
|
244
249
|
"community_relationship": CommunityRelationship.from_dict(obj["community_relationship"]) if obj.get("community_relationship") is not None else None,
|
|
245
250
|
"community_results": CommunityResult.from_dict(obj["community_results"]) if obj.get("community_results") is not None else None,
|
|
246
251
|
"content_disclosure": ContentDisclosure.from_dict(obj["content_disclosure"]) if obj.get("content_disclosure") is not None else None,
|
|
252
|
+
"conversation_control_details": ConversationControlDetails.from_dict(obj["conversation_control_details"]) if obj.get("conversation_control_details") is not None else None,
|
|
247
253
|
"core": UserResultCore.from_dict(obj["core"]) if obj.get("core") is not None else None,
|
|
248
254
|
"edit_control": TweetEditControl.from_dict(obj["edit_control"]) if obj.get("edit_control") is not None else None,
|
|
249
255
|
"edit_prespective": TweetEditPrespective.from_dict(obj["edit_prespective"]) if obj.get("edit_prespective") is not None else None,
|
|
@@ -33,6 +33,7 @@ class TypeName(str, Enum):
|
|
|
33
33
|
TIMELINETWITTERLIST = 'TimelineTwitterList'
|
|
34
34
|
TIMELINELABEL = 'TimelineLabel'
|
|
35
35
|
TIMELINEEVENTSUMMARY = 'TimelineEventSummary'
|
|
36
|
+
TIMELINESMARTTAG = 'TimelineSmartTag'
|
|
36
37
|
AITREND = 'AiTrend'
|
|
37
38
|
TIMELINERICHTEXT = 'TimelineRichText'
|
|
38
39
|
TIMELINETIMELINEITEM = 'TimelineTimelineItem'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: twitter_openapi_python_generated
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.10
|
|
4
4
|
Summary: Twitter OpenAPI
|
|
5
5
|
Home-page: https://github.com/fa0311/twitter_openapi_python_generated
|
|
6
6
|
Author: OpenAPI Generator community
|
|
@@ -26,7 +26,7 @@ Twitter OpenAPI(Swagger) specification
|
|
|
26
26
|
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
|
27
27
|
|
|
28
28
|
- API version: 0.0.1
|
|
29
|
-
- Package version: 0.1.
|
|
29
|
+
- Package version: 0.1.10
|
|
30
30
|
- Generator version: 7.26.0
|
|
31
31
|
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
|
32
32
|
|
|
@@ -523,6 +523,7 @@ Class | Method | HTTP request | Description
|
|
|
523
523
|
- [ContentItemType](docs/ContentItemType.md)
|
|
524
524
|
- [ContentUnion](docs/ContentUnion.md)
|
|
525
525
|
- [ConversationControl](docs/ConversationControl.md)
|
|
526
|
+
- [ConversationControlDetails](docs/ConversationControlDetails.md)
|
|
526
527
|
- [ConversationDetails](docs/ConversationDetails.md)
|
|
527
528
|
- [ConversationMetadata](docs/ConversationMetadata.md)
|
|
528
529
|
- [ConversationOwner](docs/ConversationOwner.md)
|
|
@@ -841,6 +842,8 @@ Class | Method | HTTP request | Description
|
|
|
841
842
|
- [TimelineMessagePromptButton](docs/TimelineMessagePromptButton.md)
|
|
842
843
|
- [TimelineMessagePromptButtonAction](docs/TimelineMessagePromptButtonAction.md)
|
|
843
844
|
- [TimelineMessagePromptContent](docs/TimelineMessagePromptContent.md)
|
|
845
|
+
- [TimelineMessagePromptImage](docs/TimelineMessagePromptImage.md)
|
|
846
|
+
- [TimelineMessagePromptImageVariant](docs/TimelineMessagePromptImageVariant.md)
|
|
844
847
|
- [TimelineMessagePromptRichText](docs/TimelineMessagePromptRichText.md)
|
|
845
848
|
- [TimelineMessagePromptRichTextEntity](docs/TimelineMessagePromptRichTextEntity.md)
|
|
846
849
|
- [TimelineMessagePromptRichTextEntityRef](docs/TimelineMessagePromptRichTextEntityRef.md)
|
|
@@ -859,6 +862,7 @@ Class | Method | HTTP request | Description
|
|
|
859
862
|
- [TimelineShowAlertIconDisplayInfo](docs/TimelineShowAlertIconDisplayInfo.md)
|
|
860
863
|
- [TimelineShowAlertRichText](docs/TimelineShowAlertRichText.md)
|
|
861
864
|
- [TimelineShowCover](docs/TimelineShowCover.md)
|
|
865
|
+
- [TimelineSmartTag](docs/TimelineSmartTag.md)
|
|
862
866
|
- [TimelineTerminateTimeline](docs/TimelineTerminateTimeline.md)
|
|
863
867
|
- [TimelineTimelineCursor](docs/TimelineTimelineCursor.md)
|
|
864
868
|
- [TimelineTimelineItem](docs/TimelineTimelineItem.md)
|