twitter-openapi-python-generated 0.1.8__py3-none-any.whl → 0.1.9__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/item_content_union.py +27 -8
- 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.9.dist-info}/METADATA +6 -2
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.9.dist-info}/RECORD +29 -25
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.9.dist-info}/WHEEL +0 -0
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.9.dist-info}/licenses/LICENSE +0 -0
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.9.dist-info}/licenses/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.1.8.dist-info → twitter_openapi_python_generated-0.1.9.dist-info}/top_level.txt +0 -0
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
""" # noqa: E501
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
__version__ = "0.1.
|
|
18
|
+
__version__ = "0.1.9"
|
|
19
19
|
|
|
20
20
|
# Define package exports
|
|
21
21
|
__all__ = [
|
|
@@ -214,6 +214,7 @@ __all__ = [
|
|
|
214
214
|
"ContentItemType",
|
|
215
215
|
"ContentUnion",
|
|
216
216
|
"ConversationControl",
|
|
217
|
+
"ConversationControlDetails",
|
|
217
218
|
"ConversationDetails",
|
|
218
219
|
"ConversationMetadata",
|
|
219
220
|
"ConversationOwner",
|
|
@@ -532,6 +533,8 @@ __all__ = [
|
|
|
532
533
|
"TimelineMessagePromptButton",
|
|
533
534
|
"TimelineMessagePromptButtonAction",
|
|
534
535
|
"TimelineMessagePromptContent",
|
|
536
|
+
"TimelineMessagePromptImage",
|
|
537
|
+
"TimelineMessagePromptImageVariant",
|
|
535
538
|
"TimelineMessagePromptRichText",
|
|
536
539
|
"TimelineMessagePromptRichTextEntity",
|
|
537
540
|
"TimelineMessagePromptRichTextEntityRef",
|
|
@@ -550,6 +553,7 @@ __all__ = [
|
|
|
550
553
|
"TimelineShowAlertIconDisplayInfo",
|
|
551
554
|
"TimelineShowAlertRichText",
|
|
552
555
|
"TimelineShowCover",
|
|
556
|
+
"TimelineSmartTag",
|
|
553
557
|
"TimelineTerminateTimeline",
|
|
554
558
|
"TimelineTimelineCursor",
|
|
555
559
|
"TimelineTimelineItem",
|
|
@@ -907,6 +911,7 @@ from twitter_openapi_python_generated.models.content_entry_type import ContentEn
|
|
|
907
911
|
from twitter_openapi_python_generated.models.content_item_type import ContentItemType as ContentItemType
|
|
908
912
|
from twitter_openapi_python_generated.models.content_union import ContentUnion as ContentUnion
|
|
909
913
|
from twitter_openapi_python_generated.models.conversation_control import ConversationControl as ConversationControl
|
|
914
|
+
from twitter_openapi_python_generated.models.conversation_control_details import ConversationControlDetails as ConversationControlDetails
|
|
910
915
|
from twitter_openapi_python_generated.models.conversation_details import ConversationDetails as ConversationDetails
|
|
911
916
|
from twitter_openapi_python_generated.models.conversation_metadata import ConversationMetadata as ConversationMetadata
|
|
912
917
|
from twitter_openapi_python_generated.models.conversation_owner import ConversationOwner as ConversationOwner
|
|
@@ -1225,6 +1230,8 @@ from twitter_openapi_python_generated.models.timeline_message_prompt import Time
|
|
|
1225
1230
|
from twitter_openapi_python_generated.models.timeline_message_prompt_button import TimelineMessagePromptButton as TimelineMessagePromptButton
|
|
1226
1231
|
from twitter_openapi_python_generated.models.timeline_message_prompt_button_action import TimelineMessagePromptButtonAction as TimelineMessagePromptButtonAction
|
|
1227
1232
|
from twitter_openapi_python_generated.models.timeline_message_prompt_content import TimelineMessagePromptContent as TimelineMessagePromptContent
|
|
1233
|
+
from twitter_openapi_python_generated.models.timeline_message_prompt_image import TimelineMessagePromptImage as TimelineMessagePromptImage
|
|
1234
|
+
from twitter_openapi_python_generated.models.timeline_message_prompt_image_variant import TimelineMessagePromptImageVariant as TimelineMessagePromptImageVariant
|
|
1228
1235
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text import TimelineMessagePromptRichText as TimelineMessagePromptRichText
|
|
1229
1236
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text_entity import TimelineMessagePromptRichTextEntity as TimelineMessagePromptRichTextEntity
|
|
1230
1237
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text_entity_ref import TimelineMessagePromptRichTextEntityRef as TimelineMessagePromptRichTextEntityRef
|
|
@@ -1243,6 +1250,7 @@ from twitter_openapi_python_generated.models.timeline_show_alert_color_config im
|
|
|
1243
1250
|
from twitter_openapi_python_generated.models.timeline_show_alert_icon_display_info import TimelineShowAlertIconDisplayInfo as TimelineShowAlertIconDisplayInfo
|
|
1244
1251
|
from twitter_openapi_python_generated.models.timeline_show_alert_rich_text import TimelineShowAlertRichText as TimelineShowAlertRichText
|
|
1245
1252
|
from twitter_openapi_python_generated.models.timeline_show_cover import TimelineShowCover as TimelineShowCover
|
|
1253
|
+
from twitter_openapi_python_generated.models.timeline_smart_tag import TimelineSmartTag as TimelineSmartTag
|
|
1246
1254
|
from twitter_openapi_python_generated.models.timeline_terminate_timeline import TimelineTerminateTimeline as TimelineTerminateTimeline
|
|
1247
1255
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor as TimelineTimelineCursor
|
|
1248
1256
|
from twitter_openapi_python_generated.models.timeline_timeline_item import TimelineTimelineItem as TimelineTimelineItem
|
|
@@ -92,7 +92,7 @@ class ApiClient:
|
|
|
92
92
|
self.default_headers[header_name] = header_value
|
|
93
93
|
self.cookie = cookie
|
|
94
94
|
# Set default User-Agent.
|
|
95
|
-
self.user_agent = 'OpenAPI-Generator/0.1.
|
|
95
|
+
self.user_agent = 'OpenAPI-Generator/0.1.9/python'
|
|
96
96
|
self.client_side_validation = configuration.client_side_validation
|
|
97
97
|
|
|
98
98
|
def __enter__(self):
|
|
@@ -802,7 +802,7 @@ conf = twitter_openapi_python_generated.Configuration(
|
|
|
802
802
|
"OS: {env}\n"\
|
|
803
803
|
"Python Version: {pyversion}\n"\
|
|
804
804
|
"Version of the API: 0.0.1\n"\
|
|
805
|
-
"SDK Package Version: 0.1.
|
|
805
|
+
"SDK Package Version: 0.1.9".\
|
|
806
806
|
format(env=sys.platform, pyversion=sys.version)
|
|
807
807
|
|
|
808
808
|
def get_host_settings(self) -> List[HostSetting]:
|
|
@@ -187,6 +187,7 @@ from twitter_openapi_python_generated.models.content_entry_type import ContentEn
|
|
|
187
187
|
from twitter_openapi_python_generated.models.content_item_type import ContentItemType
|
|
188
188
|
from twitter_openapi_python_generated.models.content_union import ContentUnion
|
|
189
189
|
from twitter_openapi_python_generated.models.conversation_control import ConversationControl
|
|
190
|
+
from twitter_openapi_python_generated.models.conversation_control_details import ConversationControlDetails
|
|
190
191
|
from twitter_openapi_python_generated.models.conversation_details import ConversationDetails
|
|
191
192
|
from twitter_openapi_python_generated.models.conversation_metadata import ConversationMetadata
|
|
192
193
|
from twitter_openapi_python_generated.models.conversation_owner import ConversationOwner
|
|
@@ -505,6 +506,8 @@ from twitter_openapi_python_generated.models.timeline_message_prompt import Time
|
|
|
505
506
|
from twitter_openapi_python_generated.models.timeline_message_prompt_button import TimelineMessagePromptButton
|
|
506
507
|
from twitter_openapi_python_generated.models.timeline_message_prompt_button_action import TimelineMessagePromptButtonAction
|
|
507
508
|
from twitter_openapi_python_generated.models.timeline_message_prompt_content import TimelineMessagePromptContent
|
|
509
|
+
from twitter_openapi_python_generated.models.timeline_message_prompt_image import TimelineMessagePromptImage
|
|
510
|
+
from twitter_openapi_python_generated.models.timeline_message_prompt_image_variant import TimelineMessagePromptImageVariant
|
|
508
511
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text import TimelineMessagePromptRichText
|
|
509
512
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text_entity import TimelineMessagePromptRichTextEntity
|
|
510
513
|
from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text_entity_ref import TimelineMessagePromptRichTextEntityRef
|
|
@@ -523,6 +526,7 @@ from twitter_openapi_python_generated.models.timeline_show_alert_color_config im
|
|
|
523
526
|
from twitter_openapi_python_generated.models.timeline_show_alert_icon_display_info import TimelineShowAlertIconDisplayInfo
|
|
524
527
|
from twitter_openapi_python_generated.models.timeline_show_alert_rich_text import TimelineShowAlertRichText
|
|
525
528
|
from twitter_openapi_python_generated.models.timeline_show_cover import TimelineShowCover
|
|
529
|
+
from twitter_openapi_python_generated.models.timeline_smart_tag import TimelineSmartTag
|
|
526
530
|
from twitter_openapi_python_generated.models.timeline_terminate_timeline import TimelineTerminateTimeline
|
|
527
531
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
528
532
|
from twitter_openapi_python_generated.models.timeline_timeline_item import TimelineTimelineItem
|
|
@@ -18,8 +18,8 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.about_account_verification_info_reason import AboutAccountVerificationInfoReason
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -30,8 +30,9 @@ class AboutAccountVerificationInfo(BaseModel):
|
|
|
30
30
|
AboutAccountVerificationInfo
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
id: StrictStr
|
|
33
|
+
is_identity_verified: Optional[StrictBool] = None
|
|
33
34
|
reason: AboutAccountVerificationInfoReason
|
|
34
|
-
__properties: ClassVar[List[str]] = ["id", "reason"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["id", "is_identity_verified", "reason"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
validate_by_name=True,
|
|
@@ -88,6 +89,7 @@ class AboutAccountVerificationInfo(BaseModel):
|
|
|
88
89
|
|
|
89
90
|
_obj = cls.model_validate({
|
|
90
91
|
"id": obj.get("id"),
|
|
92
|
+
"is_identity_verified": obj.get("is_identity_verified"),
|
|
91
93
|
"reason": AboutAccountVerificationInfoReason.from_dict(obj["reason"]) if obj.get("reason") is not None else None
|
|
92
94
|
})
|
|
93
95
|
return _obj
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.about_profile_username_changes import AboutProfileUsernameChanges
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -29,13 +29,14 @@ class AboutProfile(BaseModel):
|
|
|
29
29
|
"""
|
|
30
30
|
AboutProfile
|
|
31
31
|
""" # noqa: E501
|
|
32
|
-
account_based_in: StrictStr
|
|
33
|
-
affiliate_username: StrictStr
|
|
32
|
+
account_based_in: Optional[StrictStr] = None
|
|
33
|
+
affiliate_username: Optional[StrictStr] = None
|
|
34
|
+
created_country_accurate: Optional[StrictBool] = None
|
|
34
35
|
learn_more_url: StrictStr
|
|
35
36
|
location_accurate: StrictBool
|
|
36
|
-
source: StrictStr
|
|
37
|
+
source: Optional[StrictStr] = None
|
|
37
38
|
username_changes: AboutProfileUsernameChanges
|
|
38
|
-
__properties: ClassVar[List[str]] = ["account_based_in", "affiliate_username", "learn_more_url", "location_accurate", "source", "username_changes"]
|
|
39
|
+
__properties: ClassVar[List[str]] = ["account_based_in", "affiliate_username", "created_country_accurate", "learn_more_url", "location_accurate", "source", "username_changes"]
|
|
39
40
|
|
|
40
41
|
model_config = ConfigDict(
|
|
41
42
|
validate_by_name=True,
|
|
@@ -93,6 +94,7 @@ class AboutProfile(BaseModel):
|
|
|
93
94
|
_obj = cls.model_validate({
|
|
94
95
|
"account_based_in": obj.get("account_based_in"),
|
|
95
96
|
"affiliate_username": obj.get("affiliate_username"),
|
|
97
|
+
"created_country_accurate": obj.get("created_country_accurate"),
|
|
96
98
|
"learn_more_url": obj.get("learn_more_url"),
|
|
97
99
|
"location_accurate": obj.get("location_accurate"),
|
|
98
100
|
"source": obj.get("source"),
|
|
@@ -29,6 +29,7 @@ class AdMetadataContainer(BaseModel):
|
|
|
29
29
|
"""
|
|
30
30
|
AdMetadataContainer
|
|
31
31
|
""" # noqa: E501
|
|
32
|
+
allow_spine_clicks: Optional[StrictBool] = Field(default=None, alias="allowSpineClicks")
|
|
32
33
|
destination_url_params: Optional[List[KeyValue]] = Field(default=None, alias="destinationUrlParams")
|
|
33
34
|
is_quick_promote: StrictBool = Field(alias="isQuickPromote")
|
|
34
35
|
remove_promoted_attribution_for_preroll: Optional[StrictBool] = None
|
|
@@ -36,7 +37,7 @@ class AdMetadataContainer(BaseModel):
|
|
|
36
37
|
render_sales_cta_website_card: StrictBool = Field(alias="renderSalesCtaWebsiteCard")
|
|
37
38
|
show_overlay_on_first_card: Optional[StrictBool] = Field(default=None, alias="showOverlayOnFirstCard")
|
|
38
39
|
unified_card_override: Optional[StrictStr] = Field(default=None, alias="unifiedCardOverride")
|
|
39
|
-
__properties: ClassVar[List[str]] = ["destinationUrlParams", "isQuickPromote", "remove_promoted_attribution_for_preroll", "renderLegacyWebsiteCard", "renderSalesCtaWebsiteCard", "showOverlayOnFirstCard", "unifiedCardOverride"]
|
|
40
|
+
__properties: ClassVar[List[str]] = ["allowSpineClicks", "destinationUrlParams", "isQuickPromote", "remove_promoted_attribution_for_preroll", "renderLegacyWebsiteCard", "renderSalesCtaWebsiteCard", "showOverlayOnFirstCard", "unifiedCardOverride"]
|
|
40
41
|
|
|
41
42
|
model_config = ConfigDict(
|
|
42
43
|
validate_by_name=True,
|
|
@@ -95,6 +96,7 @@ class AdMetadataContainer(BaseModel):
|
|
|
95
96
|
return cls.model_validate(obj)
|
|
96
97
|
|
|
97
98
|
_obj = cls.model_validate({
|
|
99
|
+
"allowSpineClicks": obj.get("allowSpineClicks"),
|
|
98
100
|
"destinationUrlParams": [KeyValue.from_dict(_item) for _item in obj["destinationUrlParams"]] if obj.get("destinationUrlParams") is not None else None,
|
|
99
101
|
"isQuickPromote": obj.get("isQuickPromote"),
|
|
100
102
|
"remove_promoted_attribution_for_preroll": obj.get("remove_promoted_attribution_for_preroll"),
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt
|
|
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
|
from pydantic_core import to_jsonable_python
|
|
@@ -29,11 +29,13 @@ class BadgeCounts(BaseModel):
|
|
|
29
29
|
BadgeCounts
|
|
30
30
|
""" # noqa: E501
|
|
31
31
|
dm_unread_count: StrictInt
|
|
32
|
+
grok_bot_primary_unread_count: Optional[StrictInt] = None
|
|
33
|
+
grok_bot_unread_conversations: Optional[StrictInt] = None
|
|
32
34
|
is_from_urt: StrictBool
|
|
33
35
|
ntab_unread_count: StrictInt
|
|
34
36
|
total_unread_count: StrictInt
|
|
35
37
|
xchat_unread_count: StrictInt
|
|
36
|
-
__properties: ClassVar[List[str]] = ["dm_unread_count", "is_from_urt", "ntab_unread_count", "total_unread_count", "xchat_unread_count"]
|
|
38
|
+
__properties: ClassVar[List[str]] = ["dm_unread_count", "grok_bot_primary_unread_count", "grok_bot_unread_conversations", "is_from_urt", "ntab_unread_count", "total_unread_count", "xchat_unread_count"]
|
|
37
39
|
|
|
38
40
|
model_config = ConfigDict(
|
|
39
41
|
validate_by_name=True,
|
|
@@ -87,6 +89,8 @@ class BadgeCounts(BaseModel):
|
|
|
87
89
|
|
|
88
90
|
_obj = cls.model_validate({
|
|
89
91
|
"dm_unread_count": obj.get("dm_unread_count"),
|
|
92
|
+
"grok_bot_primary_unread_count": obj.get("grok_bot_primary_unread_count"),
|
|
93
|
+
"grok_bot_unread_conversations": obj.get("grok_bot_unread_conversations"),
|
|
90
94
|
"is_from_urt": obj.get("is_from_urt"),
|
|
91
95
|
"ntab_unread_count": obj.get("ntab_unread_count"),
|
|
92
96
|
"total_unread_count": obj.get("total_unread_count"),
|
|
@@ -18,8 +18,9 @@ import pprint
|
|
|
18
18
|
import re # noqa: F401
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing_extensions import Annotated
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
from pydantic_core import to_jsonable_python
|
|
@@ -28,9 +29,33 @@ class CashtagAttachment(BaseModel):
|
|
|
28
29
|
"""
|
|
29
30
|
CashtagAttachment
|
|
30
31
|
""" # noqa: E501
|
|
32
|
+
candle_size: Optional[StrictStr] = None
|
|
33
|
+
from_timestamp_ms: Optional[Annotated[str, Field(strict=True)]] = None
|
|
31
34
|
rest_id: StrictStr
|
|
32
35
|
size_variant: Optional[StrictInt] = None
|
|
33
|
-
|
|
36
|
+
timeframe: Optional[StrictStr] = None
|
|
37
|
+
to_timestamp_ms: Optional[Annotated[str, Field(strict=True)]] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["candle_size", "from_timestamp_ms", "rest_id", "size_variant", "timeframe", "to_timestamp_ms"]
|
|
39
|
+
|
|
40
|
+
@field_validator('from_timestamp_ms', mode="before")
|
|
41
|
+
def from_timestamp_ms_validate_regular_expression(cls, value):
|
|
42
|
+
"""Validates the regular expression"""
|
|
43
|
+
if value is None:
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
47
|
+
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
48
|
+
return value
|
|
49
|
+
|
|
50
|
+
@field_validator('to_timestamp_ms', mode="before")
|
|
51
|
+
def to_timestamp_ms_validate_regular_expression(cls, value):
|
|
52
|
+
"""Validates the regular expression"""
|
|
53
|
+
if value is None:
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
|
|
57
|
+
raise ValueError(r"must validate the regular expression /^[0-9]+$/")
|
|
58
|
+
return value
|
|
34
59
|
|
|
35
60
|
model_config = ConfigDict(
|
|
36
61
|
validate_by_name=True,
|
|
@@ -83,8 +108,12 @@ class CashtagAttachment(BaseModel):
|
|
|
83
108
|
return cls.model_validate(obj)
|
|
84
109
|
|
|
85
110
|
_obj = cls.model_validate({
|
|
111
|
+
"candle_size": obj.get("candle_size"),
|
|
112
|
+
"from_timestamp_ms": obj.get("from_timestamp_ms"),
|
|
86
113
|
"rest_id": obj.get("rest_id"),
|
|
87
|
-
"size_variant": obj.get("size_variant")
|
|
114
|
+
"size_variant": obj.get("size_variant"),
|
|
115
|
+
"timeframe": obj.get("timeframe"),
|
|
116
|
+
"to_timestamp_ms": obj.get("to_timestamp_ms")
|
|
88
117
|
})
|
|
89
118
|
return _obj
|
|
90
119
|
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from typing_extensions import Annotated
|
|
24
24
|
from twitter_openapi_python_generated.models.community_banner_media import CommunityBannerMedia
|
|
25
25
|
from twitter_openapi_python_generated.models.community_id_user_results import CommunityIdUserResults
|
|
@@ -28,6 +28,7 @@ from twitter_openapi_python_generated.models.community_page_actions import Commu
|
|
|
28
28
|
from twitter_openapi_python_generated.models.community_page_invites_result import CommunityPageInvitesResult
|
|
29
29
|
from twitter_openapi_python_generated.models.community_relay_rule import CommunityRelayRule
|
|
30
30
|
from twitter_openapi_python_generated.models.community_viewer_relationship import CommunityViewerRelationship
|
|
31
|
+
from twitter_openapi_python_generated.models.primary_community_topic import PrimaryCommunityTopic
|
|
31
32
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
32
33
|
from typing import Optional, Set
|
|
33
34
|
from typing_extensions import Self
|
|
@@ -42,7 +43,7 @@ class CommunityPageCommunity(BaseModel):
|
|
|
42
43
|
admin_results: CommunityIdUserResults
|
|
43
44
|
created_at: StrictInt
|
|
44
45
|
creator_results: CommunityIdUserResults
|
|
45
|
-
custom_banner_media: CommunityBannerMedia
|
|
46
|
+
custom_banner_media: Optional[CommunityBannerMedia] = None
|
|
46
47
|
default_banner_media: CommunityBannerMedia
|
|
47
48
|
description: StrictStr
|
|
48
49
|
id: StrictStr
|
|
@@ -57,11 +58,13 @@ class CommunityPageCommunity(BaseModel):
|
|
|
57
58
|
members_facepile_results: List[CommunityIdUserResults]
|
|
58
59
|
moderator_count: StrictInt
|
|
59
60
|
name: StrictStr
|
|
61
|
+
primary_community_topic: Optional[PrimaryCommunityTopic] = None
|
|
62
|
+
question: Optional[StrictStr] = None
|
|
60
63
|
role: StrictStr
|
|
61
64
|
rules: List[CommunityRelayRule]
|
|
62
65
|
search_tags: List[StrictStr]
|
|
63
66
|
viewer_relationship: CommunityViewerRelationship
|
|
64
|
-
__properties: ClassVar[List[str]] = ["__typename", "actions", "admin_results", "created_at", "creator_results", "custom_banner_media", "default_banner_media", "description", "id", "id_str", "invites_policy", "invites_result", "is_nsfw", "is_pinned", "join_policy", "join_requests_result", "member_count", "members_facepile_results", "moderator_count", "name", "role", "rules", "search_tags", "viewer_relationship"]
|
|
67
|
+
__properties: ClassVar[List[str]] = ["__typename", "actions", "admin_results", "created_at", "creator_results", "custom_banner_media", "default_banner_media", "description", "id", "id_str", "invites_policy", "invites_result", "is_nsfw", "is_pinned", "join_policy", "join_requests_result", "member_count", "members_facepile_results", "moderator_count", "name", "primary_community_topic", "question", "role", "rules", "search_tags", "viewer_relationship"]
|
|
65
68
|
|
|
66
69
|
@field_validator('id_str', mode="before")
|
|
67
70
|
def id_str_validate_regular_expression(cls, value):
|
|
@@ -136,6 +139,9 @@ class CommunityPageCommunity(BaseModel):
|
|
|
136
139
|
for _item_members_facepile_results in self.members_facepile_results:
|
|
137
140
|
_items.append(_item_members_facepile_results.to_dict() if _item_members_facepile_results is not None else None)
|
|
138
141
|
_dict['members_facepile_results'] = _items
|
|
142
|
+
# override the default output from pydantic by calling `to_dict()` of primary_community_topic
|
|
143
|
+
if self.primary_community_topic:
|
|
144
|
+
_dict['primary_community_topic'] = self.primary_community_topic.to_dict()
|
|
139
145
|
# override the default output from pydantic by calling `to_dict()` of each item in rules (list)
|
|
140
146
|
_items = []
|
|
141
147
|
if self.rules:
|
|
@@ -177,6 +183,8 @@ class CommunityPageCommunity(BaseModel):
|
|
|
177
183
|
"members_facepile_results": [CommunityIdUserResults.from_dict(_item) for _item in obj["members_facepile_results"]] if obj.get("members_facepile_results") is not None else None,
|
|
178
184
|
"moderator_count": obj.get("moderator_count"),
|
|
179
185
|
"name": obj.get("name"),
|
|
186
|
+
"primary_community_topic": PrimaryCommunityTopic.from_dict(obj["primary_community_topic"]) if obj.get("primary_community_topic") is not None else None,
|
|
187
|
+
"question": obj.get("question"),
|
|
180
188
|
"role": obj.get("role"),
|
|
181
189
|
"rules": [CommunityRelayRule.from_dict(_item) for _item in obj["rules"]] if obj.get("rules") is not None else None,
|
|
182
190
|
"search_tags": obj.get("search_tags"),
|
|
@@ -19,7 +19,7 @@ import re # noqa: F401
|
|
|
19
19
|
import json
|
|
20
20
|
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from twitter_openapi_python_generated.models.type_name import TypeName
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
@@ -31,7 +31,9 @@ class CommunityPageJoinActionResult(BaseModel):
|
|
|
31
31
|
""" # noqa: E501
|
|
32
32
|
is_community_join_action_result: StrictStr = Field(alias="__isCommunityJoinActionResult")
|
|
33
33
|
typename: TypeName = Field(alias="__typename")
|
|
34
|
-
|
|
34
|
+
message: Optional[StrictStr] = None
|
|
35
|
+
reason: Optional[StrictStr] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["__isCommunityJoinActionResult", "__typename", "message", "reason"]
|
|
35
37
|
|
|
36
38
|
model_config = ConfigDict(
|
|
37
39
|
validate_by_name=True,
|
|
@@ -85,7 +87,9 @@ class CommunityPageJoinActionResult(BaseModel):
|
|
|
85
87
|
|
|
86
88
|
_obj = cls.model_validate({
|
|
87
89
|
"__isCommunityJoinActionResult": obj.get("__isCommunityJoinActionResult"),
|
|
88
|
-
"__typename": obj.get("__typename")
|
|
90
|
+
"__typename": obj.get("__typename"),
|
|
91
|
+
"message": obj.get("message"),
|
|
92
|
+
"reason": obj.get("reason")
|
|
89
93
|
})
|
|
90
94
|
return _obj
|
|
91
95
|
|
|
@@ -40,6 +40,7 @@ class ContentItemType(str, Enum):
|
|
|
40
40
|
TIMELINETWITTERLIST = 'TimelineTwitterList'
|
|
41
41
|
TIMELINELABEL = 'TimelineLabel'
|
|
42
42
|
TIMELINEEVENTSUMMARY = 'TimelineEventSummary'
|
|
43
|
+
TIMELINESMARTTAG = 'TimelineSmartTag'
|
|
43
44
|
|
|
44
45
|
@classmethod
|
|
45
46
|
def from_json(cls, json_str: str) -> Self:
|
|
@@ -0,0 +1,89 @@
|
|
|
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
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class ConversationControlDetails(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
ConversationControlDetails
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
mode: StrictStr
|
|
32
|
+
__properties: ClassVar[List[str]] = ["mode"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
validate_by_name=True,
|
|
36
|
+
validate_by_alias=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of ConversationControlDetails 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 ConversationControlDetails 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
|
+
"mode": obj.get("mode")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -25,6 +25,7 @@ from twitter_openapi_python_generated.models.timeline_label import TimelineLabel
|
|
|
25
25
|
from twitter_openapi_python_generated.models.timeline_message_prompt import TimelineMessagePrompt
|
|
26
26
|
from twitter_openapi_python_generated.models.timeline_notification import TimelineNotification
|
|
27
27
|
from twitter_openapi_python_generated.models.timeline_prompt import TimelinePrompt
|
|
28
|
+
from twitter_openapi_python_generated.models.timeline_smart_tag import TimelineSmartTag
|
|
28
29
|
from twitter_openapi_python_generated.models.timeline_timeline_cursor import TimelineTimelineCursor
|
|
29
30
|
from twitter_openapi_python_generated.models.timeline_tombstone import TimelineTombstone
|
|
30
31
|
from twitter_openapi_python_generated.models.timeline_trend import TimelineTrend
|
|
@@ -35,7 +36,7 @@ from pydantic import StrictStr, Field
|
|
|
35
36
|
from typing import Union, List, Set, Optional, Dict
|
|
36
37
|
from typing_extensions import Literal, Self
|
|
37
38
|
|
|
38
|
-
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineEventSummary", "TimelineFrame", "TimelineLabel", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineTwitterList", "TimelineUser"]
|
|
39
|
+
ITEMCONTENTUNION_ONE_OF_SCHEMAS = ["TimelineCommunity", "TimelineEventSummary", "TimelineFrame", "TimelineLabel", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineSmartTag", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineTwitterList", "TimelineUser"]
|
|
39
40
|
|
|
40
41
|
class ItemContentUnion(BaseModel):
|
|
41
42
|
"""
|
|
@@ -67,8 +68,10 @@ class ItemContentUnion(BaseModel):
|
|
|
67
68
|
oneof_schema_12_validator: Optional[TimelineLabel] = None
|
|
68
69
|
# data type: TimelineEventSummary
|
|
69
70
|
oneof_schema_13_validator: Optional[TimelineEventSummary] = None
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
# data type: TimelineSmartTag
|
|
72
|
+
oneof_schema_14_validator: Optional[TimelineSmartTag] = None
|
|
73
|
+
actual_instance: Optional[Union[TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineSmartTag, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser]] = None
|
|
74
|
+
one_of_schemas: Set[str] = { "TimelineCommunity", "TimelineEventSummary", "TimelineFrame", "TimelineLabel", "TimelineMessagePrompt", "TimelineNotification", "TimelinePrompt", "TimelineSmartTag", "TimelineTimelineCursor", "TimelineTombstone", "TimelineTrend", "TimelineTweet", "TimelineTwitterList", "TimelineUser" }
|
|
72
75
|
|
|
73
76
|
model_config = ConfigDict(
|
|
74
77
|
validate_assignment=True,
|
|
@@ -159,12 +162,17 @@ class ItemContentUnion(BaseModel):
|
|
|
159
162
|
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineEventSummary`")
|
|
160
163
|
else:
|
|
161
164
|
match += 1
|
|
165
|
+
# validate data type: TimelineSmartTag
|
|
166
|
+
if not isinstance(v, TimelineSmartTag):
|
|
167
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineSmartTag`")
|
|
168
|
+
else:
|
|
169
|
+
match += 1
|
|
162
170
|
if match > 1:
|
|
163
171
|
# more than 1 match
|
|
164
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
172
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineSmartTag, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
165
173
|
elif match == 0:
|
|
166
174
|
# no match
|
|
167
|
-
raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
175
|
+
raise ValueError("No match found when setting `actual_instance` in ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineSmartTag, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
168
176
|
else:
|
|
169
177
|
return v
|
|
170
178
|
|
|
@@ -220,6 +228,11 @@ class ItemContentUnion(BaseModel):
|
|
|
220
228
|
instance.actual_instance = TimelinePrompt.from_json(json_str)
|
|
221
229
|
return instance
|
|
222
230
|
|
|
231
|
+
# check if data type is `TimelineSmartTag`
|
|
232
|
+
if _data_type == "TimelineSmartTag":
|
|
233
|
+
instance.actual_instance = TimelineSmartTag.from_json(json_str)
|
|
234
|
+
return instance
|
|
235
|
+
|
|
223
236
|
# check if data type is `TimelineTimelineCursor`
|
|
224
237
|
if _data_type == "TimelineTimelineCursor":
|
|
225
238
|
instance.actual_instance = TimelineTimelineCursor.from_json(json_str)
|
|
@@ -328,13 +341,19 @@ class ItemContentUnion(BaseModel):
|
|
|
328
341
|
match += 1
|
|
329
342
|
except (ValidationError, ValueError) as e:
|
|
330
343
|
error_messages.append(str(e))
|
|
344
|
+
# deserialize data into TimelineSmartTag
|
|
345
|
+
try:
|
|
346
|
+
instance.actual_instance = TimelineSmartTag.from_json(json_str)
|
|
347
|
+
match += 1
|
|
348
|
+
except (ValidationError, ValueError) as e:
|
|
349
|
+
error_messages.append(str(e))
|
|
331
350
|
|
|
332
351
|
if match > 1:
|
|
333
352
|
# more than 1 match
|
|
334
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
353
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineSmartTag, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
335
354
|
elif match == 0:
|
|
336
355
|
# no match
|
|
337
|
-
raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
356
|
+
raise ValueError("No match found when deserializing the JSON string into ItemContentUnion with oneOf schemas: TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineSmartTag, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser. Details: " + ", ".join(error_messages))
|
|
338
357
|
else:
|
|
339
358
|
return instance
|
|
340
359
|
|
|
@@ -348,7 +367,7 @@ class ItemContentUnion(BaseModel):
|
|
|
348
367
|
else:
|
|
349
368
|
return json.dumps(self.actual_instance)
|
|
350
369
|
|
|
351
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser]]:
|
|
370
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], TimelineCommunity, TimelineEventSummary, TimelineFrame, TimelineLabel, TimelineMessagePrompt, TimelineNotification, TimelinePrompt, TimelineSmartTag, TimelineTimelineCursor, TimelineTombstone, TimelineTrend, TimelineTweet, TimelineTwitterList, TimelineUser]]:
|
|
352
371
|
"""Returns the dict representation of the actual instance"""
|
|
353
372
|
if self.actual_instance is None:
|
|
354
373
|
return None
|
|
@@ -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
|