twitter-openapi-python-generated 0.1.2__py3-none-any.whl → 0.1.3__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.
Files changed (104) hide show
  1. twitter_openapi_python_generated/__init__.py +107 -1
  2. twitter_openapi_python_generated/api/default_api.py +1437 -199
  3. twitter_openapi_python_generated/api/user_api.py +301 -0
  4. twitter_openapi_python_generated/api/users_api.py +318 -0
  5. twitter_openapi_python_generated/api_client.py +1 -1
  6. twitter_openapi_python_generated/configuration.py +1 -1
  7. twitter_openapi_python_generated/models/__init__.py +53 -0
  8. twitter_openapi_python_generated/models/about_account_data.py +93 -0
  9. twitter_openapi_python_generated/models/about_account_response.py +102 -0
  10. twitter_openapi_python_generated/models/about_account_user.py +161 -0
  11. twitter_openapi_python_generated/models/about_account_user_result.py +95 -0
  12. twitter_openapi_python_generated/models/about_account_verification_info.py +95 -0
  13. twitter_openapi_python_generated/models/about_account_verification_info_reason.py +99 -0
  14. twitter_openapi_python_generated/models/about_profile.py +103 -0
  15. twitter_openapi_python_generated/models/about_profile_username_changes.py +109 -0
  16. twitter_openapi_python_generated/models/ai_trend.py +126 -0
  17. twitter_openapi_python_generated/models/ai_trend_core.py +95 -0
  18. twitter_openapi_python_generated/models/ai_trend_results.py +95 -0
  19. twitter_openapi_python_generated/models/ai_trend_social_proof.py +89 -0
  20. twitter_openapi_python_generated/models/article_content_block.py +117 -0
  21. twitter_openapi_python_generated/models/article_content_block_data.py +104 -0
  22. twitter_openapi_python_generated/models/article_content_entity.py +95 -0
  23. twitter_openapi_python_generated/models/article_content_entity_data.py +115 -0
  24. twitter_openapi_python_generated/models/article_content_entity_range.py +93 -0
  25. twitter_openapi_python_generated/models/article_content_entity_value.py +104 -0
  26. twitter_openapi_python_generated/models/article_content_inline_style_range.py +100 -0
  27. twitter_openapi_python_generated/models/article_content_media_item.py +101 -0
  28. twitter_openapi_python_generated/models/article_content_state.py +105 -0
  29. twitter_openapi_python_generated/models/article_content_text_range.py +93 -0
  30. twitter_openapi_python_generated/models/article_result.py +9 -3
  31. twitter_openapi_python_generated/models/audio_space.py +107 -0
  32. twitter_openapi_python_generated/models/audio_space_data.py +93 -0
  33. twitter_openapi_python_generated/models/audio_space_mentioned_user.py +97 -0
  34. twitter_openapi_python_generated/models/audio_space_metadata.py +165 -0
  35. twitter_openapi_python_generated/models/audio_space_participant.py +109 -0
  36. twitter_openapi_python_generated/models/audio_space_participant_user.py +104 -0
  37. twitter_openapi_python_generated/models/audio_space_participant_user_results.py +103 -0
  38. twitter_openapi_python_generated/models/audio_space_participant_verification.py +99 -0
  39. twitter_openapi_python_generated/models/audio_space_participants.py +114 -0
  40. twitter_openapi_python_generated/models/audio_space_response.py +102 -0
  41. twitter_openapi_python_generated/models/audio_space_sharings.py +91 -0
  42. twitter_openapi_python_generated/models/birdwatch_pivot.py +0 -17
  43. twitter_openapi_python_generated/models/broadcast.py +159 -0
  44. twitter_openapi_python_generated/models/broadcast_data.py +93 -0
  45. twitter_openapi_python_generated/models/broadcast_edited_replay.py +89 -0
  46. twitter_openapi_python_generated/models/broadcast_periscope_user.py +95 -0
  47. twitter_openapi_python_generated/models/broadcast_response.py +102 -0
  48. twitter_openapi_python_generated/models/cashtag_attachment.py +6 -4
  49. twitter_openapi_python_generated/models/community.py +2 -2
  50. twitter_openapi_python_generated/models/community_delete_action_result.py +1 -8
  51. twitter_openapi_python_generated/models/community_invites_result.py +1 -8
  52. twitter_openapi_python_generated/models/community_join_action_unavailable.py +1 -8
  53. twitter_openapi_python_generated/models/community_leave_action_result.py +1 -8
  54. twitter_openapi_python_generated/models/conversation_control.py +8 -1
  55. twitter_openapi_python_generated/models/conversation_details.py +1 -8
  56. twitter_openapi_python_generated/models/cover_cta.py +5 -15
  57. twitter_openapi_python_generated/models/cta_client_event_info.py +1 -8
  58. twitter_openapi_python_generated/models/cta_limited_action_prompt.py +1 -8
  59. twitter_openapi_python_generated/models/feedback_action.py +1 -21
  60. twitter_openapi_python_generated/models/grok_account_jwt.py +89 -0
  61. twitter_openapi_python_generated/models/grok_account_jwt_data.py +93 -0
  62. twitter_openapi_python_generated/models/grok_account_jwt_response.py +102 -0
  63. twitter_openapi_python_generated/models/grok_entity_ref.py +19 -4
  64. twitter_openapi_python_generated/models/grok_image_annotation.py +2 -2
  65. twitter_openapi_python_generated/models/identity_profile_labels_highlighted_label.py +93 -0
  66. twitter_openapi_python_generated/models/limited_action.py +8 -1
  67. twitter_openapi_python_generated/models/limited_action_results_data.py +8 -1
  68. twitter_openapi_python_generated/models/media_result.py +1 -1
  69. twitter_openapi_python_generated/models/module_header.py +8 -9
  70. twitter_openapi_python_generated/models/note_tweet_result_data.py +2 -2
  71. twitter_openapi_python_generated/models/session.py +0 -7
  72. twitter_openapi_python_generated/models/sidebar_user_recommendation.py +95 -0
  73. twitter_openapi_python_generated/models/sidebar_user_recommendations_data.py +96 -0
  74. twitter_openapi_python_generated/models/sidebar_user_recommendations_response.py +102 -0
  75. twitter_openapi_python_generated/models/story_topic.py +95 -0
  76. twitter_openapi_python_generated/models/story_topic_data.py +93 -0
  77. twitter_openapi_python_generated/models/story_topic_item.py +93 -0
  78. twitter_openapi_python_generated/models/story_topic_response.py +102 -0
  79. twitter_openapi_python_generated/models/story_topic_stories.py +96 -0
  80. twitter_openapi_python_generated/models/timeline_general_context.py +2 -2
  81. twitter_openapi_python_generated/models/timeline_half_cover.py +0 -7
  82. twitter_openapi_python_generated/models/timeline_message_prompt_content.py +1 -8
  83. twitter_openapi_python_generated/models/timeline_prompt_content.py +1 -15
  84. twitter_openapi_python_generated/models/timeline_show_alert.py +1 -15
  85. twitter_openapi_python_generated/models/timeline_tombstone.py +1 -11
  86. twitter_openapi_python_generated/models/timeline_topic_context.py +1 -11
  87. twitter_openapi_python_generated/models/tweet.py +4 -2
  88. twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +8 -1
  89. twitter_openapi_python_generated/models/tweet_card_platform_audience.py +1 -8
  90. twitter_openapi_python_generated/models/tweet_legacy.py +18 -3
  91. twitter_openapi_python_generated/models/tweet_legacy_place.py +107 -0
  92. twitter_openapi_python_generated/models/tweet_legacy_place_bounding_box.py +98 -0
  93. twitter_openapi_python_generated/models/tweet_legacy_point.py +98 -0
  94. twitter_openapi_python_generated/models/tweet_post_cta.py +1 -9
  95. twitter_openapi_python_generated/models/type_name.py +1 -0
  96. twitter_openapi_python_generated/models/unified_card.py +1 -8
  97. twitter_openapi_python_generated/models/user_highlights_tweets_result.py +2 -2
  98. twitter_openapi_python_generated/models/user_tweets_result_v1.py +2 -2
  99. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/METADATA +61 -2
  100. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/RECORD +104 -51
  101. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/WHEEL +0 -0
  102. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/licenses/LICENSE +0 -0
  103. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/licenses/LICENSE.AGPL +0 -0
  104. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.3.dist-info}/top_level.txt +0 -0
@@ -40,13 +40,6 @@ class TimelineHalfCover(BaseModel):
40
40
  type: StrictStr
41
41
  __properties: ClassVar[List[str]] = ["dismissible", "halfCoverDisplayType", "impressionCallbacks", "primaryCoverCta", "primaryText", "secondaryText", "type"]
42
42
 
43
- @field_validator('half_cover_display_type')
44
- def half_cover_display_type_validate_enum(cls, value):
45
- """Validates the enum"""
46
- if value not in set(['Cover']):
47
- raise ValueError("must be one of enum values ('Cover')")
48
- return value
49
-
50
43
  @field_validator('type')
51
44
  def type_validate_enum(cls, value):
52
45
  """Validates the enum"""
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
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
24
  from twitter_openapi_python_generated.models.timeline_message_prompt_rich_text import TimelineMessagePromptRichText
@@ -37,13 +37,6 @@ class TimelineMessagePromptContent(BaseModel):
37
37
  primary_button_action: Optional[TimelineMessagePromptButton] = Field(default=None, alias="primaryButtonAction")
38
38
  __properties: ClassVar[List[str]] = ["bodyRichText", "bodyText", "contentType", "headerText", "primaryButtonAction"]
39
39
 
40
- @field_validator('content_type')
41
- def content_type_validate_enum(cls, value):
42
- """Validates the enum"""
43
- if value not in set(['TimelineInlinePrompt', 'TimelineCompactPrompt']):
44
- raise ValueError("must be one of enum values ('TimelineInlinePrompt', 'TimelineCompactPrompt')")
45
- return value
46
-
47
40
  model_config = ConfigDict(
48
41
  validate_by_name=True,
49
42
  validate_by_alias=True,
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List
23
23
  from twitter_openapi_python_generated.models.timeline_prompt_callback import TimelinePromptCallback
24
24
  from typing import Optional, Set
@@ -39,20 +39,6 @@ class TimelinePromptContent(BaseModel):
39
39
  title: StrictStr
40
40
  __properties: ClassVar[List[str]] = ["confirmation", "contentType", "displayType", "isRelevantCallback", "isRelevantText", "notRelevantCallback", "notRelevantText", "title"]
41
41
 
42
- @field_validator('content_type')
43
- def content_type_validate_enum(cls, value):
44
- """Validates the enum"""
45
- if value not in set(['TimelineRelevancePrompt']):
46
- raise ValueError("must be one of enum values ('TimelineRelevancePrompt')")
47
- return value
48
-
49
- @field_validator('display_type')
50
- def display_type_validate_enum(cls, value):
51
- """Validates the enum"""
52
- if value not in set(['Compact']):
53
- raise ValueError("must be one of enum values ('Compact')")
54
- return value
55
-
56
42
  model_config = ConfigDict(
57
43
  validate_by_name=True,
58
44
  validate_by_alias=True,
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from twitter_openapi_python_generated.models.client_event_info import ClientEventInfo
24
24
  from twitter_openapi_python_generated.models.instruction_type import InstructionType
@@ -46,20 +46,6 @@ class TimelineShowAlert(BaseModel):
46
46
  users_results: Optional[List[UserResults]] = Field(default=None, alias="usersResults")
47
47
  __properties: ClassVar[List[str]] = ["alertType", "clientEventInfo", "colorConfig", "displayDurationMs", "displayLocation", "iconDisplayInfo", "richText", "triggerDelayMs", "type", "usersResults"]
48
48
 
49
- @field_validator('alert_type')
50
- def alert_type_validate_enum(cls, value):
51
- """Validates the enum"""
52
- if value not in set(['NewTweets']):
53
- raise ValueError("must be one of enum values ('NewTweets')")
54
- return value
55
-
56
- @field_validator('display_location')
57
- def display_location_validate_enum(cls, value):
58
- """Validates the enum"""
59
- if value not in set(['Top']):
60
- raise ValueError("must be one of enum values ('Top')")
61
- return value
62
-
63
49
  model_config = ConfigDict(
64
50
  validate_by_name=True,
65
51
  validate_by_alias=True,
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
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.content_item_type import ContentItemType
24
24
  from twitter_openapi_python_generated.models.tombstone_info import TombstoneInfo
@@ -37,16 +37,6 @@ class TimelineTombstone(BaseModel):
37
37
  tombstone_info: Optional[TombstoneInfo] = Field(default=None, alias="tombstoneInfo")
38
38
  __properties: ClassVar[List[str]] = ["__typename", "itemType", "tombstoneDisplayType", "tombstoneInfo"]
39
39
 
40
- @field_validator('tombstone_display_type')
41
- def tombstone_display_type_validate_enum(cls, value):
42
- """Validates the enum"""
43
- if value is None:
44
- return value
45
-
46
- if value not in set(['Inline']):
47
- raise ValueError("must be one of enum values ('Inline')")
48
- return value
49
-
50
40
  model_config = ConfigDict(
51
41
  validate_by_name=True,
52
42
  validate_by_alias=True,
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
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.social_context_union_type import SocialContextUnionType
24
24
  from twitter_openapi_python_generated.models.topic_context import TopicContext
@@ -35,16 +35,6 @@ class TimelineTopicContext(BaseModel):
35
35
  type: Optional[SocialContextUnionType] = None
36
36
  __properties: ClassVar[List[str]] = ["functionalityType", "topic", "type"]
37
37
 
38
- @field_validator('functionality_type')
39
- def functionality_type_validate_enum(cls, value):
40
- """Validates the enum"""
41
- if value is None:
42
- return value
43
-
44
- if value not in set(['Basic']):
45
- raise ValueError("must be one of enum values ('Basic')")
46
- return value
47
-
48
38
  model_config = ConfigDict(
49
39
  validate_by_name=True,
50
40
  validate_by_alias=True,
@@ -88,7 +88,8 @@ class Tweet(BaseModel):
88
88
  unified_card: Optional[UnifiedCard] = None
89
89
  unmention_data: Optional[Dict[str, Any]] = None
90
90
  views: Optional[TweetView] = None
91
- __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", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views"]
91
+ voice_info: Optional[Dict[str, Any]] = Field(default=None, alias="voiceInfo")
92
+ __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", "superFollowsReplyUserResult", "trend_results", "unified_card", "unmention_data", "views", "voiceInfo"]
92
93
 
93
94
  @field_validator('rest_id', mode="before")
94
95
  def rest_id_validate_regular_expression(cls, value):
@@ -265,7 +266,8 @@ class Tweet(BaseModel):
265
266
  "trend_results": TrendResults.from_dict(obj["trend_results"]) if obj.get("trend_results") is not None else None,
266
267
  "unified_card": UnifiedCard.from_dict(obj["unified_card"]) if obj.get("unified_card") is not None else None,
267
268
  "unmention_data": obj.get("unmention_data"),
268
- "views": TweetView.from_dict(obj["views"]) if obj.get("views") is not None else None
269
+ "views": TweetView.from_dict(obj["views"]) if obj.get("views") is not None else None,
270
+ "voiceInfo": obj.get("voiceInfo")
269
271
  })
270
272
  return _obj
271
273
 
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from twitter_openapi_python_generated.models.media_color_info import MediaColorInfo
24
24
  from twitter_openapi_python_generated.models.tweet_card_legacy_binding_value_data_image import TweetCardLegacyBindingValueDataImage
@@ -40,6 +40,13 @@ class TweetCardLegacyBindingValueData(BaseModel):
40
40
  user_value: Optional[UserValue] = None
41
41
  __properties: ClassVar[List[str]] = ["boolean_value", "image_color_value", "image_value", "scribe_key", "string_value", "type", "user_value"]
42
42
 
43
+ @field_validator('type')
44
+ def type_validate_enum(cls, value):
45
+ """Validates the enum"""
46
+ if value not in set(['STRING', 'IMAGE', 'USER', 'BOOLEAN', 'IMAGE_COLOR']):
47
+ raise ValueError("must be one of enum values ('STRING', 'IMAGE', 'USER', 'BOOLEAN', 'IMAGE_COLOR')")
48
+ return value
49
+
43
50
  model_config = ConfigDict(
44
51
  validate_by_name=True,
45
52
  validate_by_alias=True,
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
@@ -31,13 +31,6 @@ class TweetCardPlatformAudience(BaseModel):
31
31
  name: StrictStr
32
32
  __properties: ClassVar[List[str]] = ["name"]
33
33
 
34
- @field_validator('name')
35
- def name_validate_enum(cls, value):
36
- """Validates the enum"""
37
- if value not in set(['production']):
38
- raise ValueError("must be one of enum values ('production')")
39
- return value
40
-
41
34
  model_config = ConfigDict(
42
35
  validate_by_name=True,
43
36
  validate_by_alias=True,
@@ -26,6 +26,8 @@ from twitter_openapi_python_generated.models.entities import Entities
26
26
  from twitter_openapi_python_generated.models.extended_entities import ExtendedEntities
27
27
  from twitter_openapi_python_generated.models.quoted_status_permalink import QuotedStatusPermalink
28
28
  from twitter_openapi_python_generated.models.self_thread import SelfThread
29
+ from twitter_openapi_python_generated.models.tweet_legacy_place import TweetLegacyPlace
30
+ from twitter_openapi_python_generated.models.tweet_legacy_point import TweetLegacyPoint
29
31
  from twitter_openapi_python_generated.models.tweet_legacy_scopes import TweetLegacyScopes
30
32
  from typing import Optional, Set
31
33
  from typing_extensions import Self
@@ -39,6 +41,7 @@ class TweetLegacy(BaseModel):
39
41
  bookmarked: StrictBool
40
42
  conversation_control: Optional[ConversationControl] = None
41
43
  conversation_id_str: Annotated[str, Field(strict=True)]
44
+ coordinates: Optional[TweetLegacyPoint] = None
42
45
  created_at: Annotated[str, Field(strict=True)] = Field(json_schema_extra={"examples": ["Sat Dec 31 23:59:59 +0000 2023"]})
43
46
  display_text_range: List[StrictInt]
44
47
  entities: Optional[Entities] = None
@@ -46,6 +49,7 @@ class TweetLegacy(BaseModel):
46
49
  favorite_count: StrictInt
47
50
  favorited: StrictBool
48
51
  full_text: StrictStr
52
+ geo: Optional[TweetLegacyPoint] = None
49
53
  id_str: Annotated[str, Field(strict=True)]
50
54
  in_reply_to_screen_name: Optional[StrictStr] = None
51
55
  in_reply_to_status_id_str: Optional[Annotated[str, Field(strict=True)]] = None
@@ -53,7 +57,7 @@ class TweetLegacy(BaseModel):
53
57
  is_quote_status: StrictBool
54
58
  lang: StrictStr
55
59
  limited_actions: Optional[StrictStr] = None
56
- place: Optional[Dict[str, Any]] = None
60
+ place: Optional[TweetLegacyPlace] = None
57
61
  possibly_sensitive: Optional[StrictBool] = None
58
62
  possibly_sensitive_editable: Optional[StrictBool] = None
59
63
  quote_count: StrictInt
@@ -66,7 +70,7 @@ class TweetLegacy(BaseModel):
66
70
  scopes: Optional[TweetLegacyScopes] = None
67
71
  self_thread: Optional[SelfThread] = None
68
72
  user_id_str: Annotated[str, Field(strict=True)]
69
- __properties: ClassVar[List[str]] = ["bookmark_count", "bookmarked", "conversation_control", "conversation_id_str", "created_at", "display_text_range", "entities", "extended_entities", "favorite_count", "favorited", "full_text", "id_str", "in_reply_to_screen_name", "in_reply_to_status_id_str", "in_reply_to_user_id_str", "is_quote_status", "lang", "limited_actions", "place", "possibly_sensitive", "possibly_sensitive_editable", "quote_count", "quoted_status_id_str", "quoted_status_permalink", "reply_count", "retweet_count", "retweeted", "retweeted_status_result", "scopes", "self_thread", "user_id_str"]
73
+ __properties: ClassVar[List[str]] = ["bookmark_count", "bookmarked", "conversation_control", "conversation_id_str", "coordinates", "created_at", "display_text_range", "entities", "extended_entities", "favorite_count", "favorited", "full_text", "geo", "id_str", "in_reply_to_screen_name", "in_reply_to_status_id_str", "in_reply_to_user_id_str", "is_quote_status", "lang", "limited_actions", "place", "possibly_sensitive", "possibly_sensitive_editable", "quote_count", "quoted_status_id_str", "quoted_status_permalink", "reply_count", "retweet_count", "retweeted", "retweeted_status_result", "scopes", "self_thread", "user_id_str"]
70
74
 
71
75
  @field_validator('conversation_id_str', mode="before")
72
76
  def conversation_id_str_validate_regular_expression(cls, value):
@@ -178,12 +182,21 @@ class TweetLegacy(BaseModel):
178
182
  # override the default output from pydantic by calling `to_dict()` of conversation_control
179
183
  if self.conversation_control:
180
184
  _dict['conversation_control'] = self.conversation_control.to_dict()
185
+ # override the default output from pydantic by calling `to_dict()` of coordinates
186
+ if self.coordinates:
187
+ _dict['coordinates'] = self.coordinates.to_dict()
181
188
  # override the default output from pydantic by calling `to_dict()` of entities
182
189
  if self.entities:
183
190
  _dict['entities'] = self.entities.to_dict()
184
191
  # override the default output from pydantic by calling `to_dict()` of extended_entities
185
192
  if self.extended_entities:
186
193
  _dict['extended_entities'] = self.extended_entities.to_dict()
194
+ # override the default output from pydantic by calling `to_dict()` of geo
195
+ if self.geo:
196
+ _dict['geo'] = self.geo.to_dict()
197
+ # override the default output from pydantic by calling `to_dict()` of place
198
+ if self.place:
199
+ _dict['place'] = self.place.to_dict()
187
200
  # override the default output from pydantic by calling `to_dict()` of quoted_status_permalink
188
201
  if self.quoted_status_permalink:
189
202
  _dict['quoted_status_permalink'] = self.quoted_status_permalink.to_dict()
@@ -212,6 +225,7 @@ class TweetLegacy(BaseModel):
212
225
  "bookmarked": obj.get("bookmarked"),
213
226
  "conversation_control": ConversationControl.from_dict(obj["conversation_control"]) if obj.get("conversation_control") is not None else None,
214
227
  "conversation_id_str": obj.get("conversation_id_str"),
228
+ "coordinates": TweetLegacyPoint.from_dict(obj["coordinates"]) if obj.get("coordinates") is not None else None,
215
229
  "created_at": obj.get("created_at"),
216
230
  "display_text_range": obj.get("display_text_range"),
217
231
  "entities": Entities.from_dict(obj["entities"]) if obj.get("entities") is not None else None,
@@ -219,6 +233,7 @@ class TweetLegacy(BaseModel):
219
233
  "favorite_count": obj.get("favorite_count"),
220
234
  "favorited": obj.get("favorited"),
221
235
  "full_text": obj.get("full_text"),
236
+ "geo": TweetLegacyPoint.from_dict(obj["geo"]) if obj.get("geo") is not None else None,
222
237
  "id_str": obj.get("id_str"),
223
238
  "in_reply_to_screen_name": obj.get("in_reply_to_screen_name"),
224
239
  "in_reply_to_status_id_str": obj.get("in_reply_to_status_id_str"),
@@ -226,7 +241,7 @@ class TweetLegacy(BaseModel):
226
241
  "is_quote_status": obj.get("is_quote_status"),
227
242
  "lang": obj.get("lang"),
228
243
  "limited_actions": obj.get("limited_actions"),
229
- "place": obj.get("place"),
244
+ "place": TweetLegacyPlace.from_dict(obj["place"]) if obj.get("place") is not None else None,
230
245
  "possibly_sensitive": obj.get("possibly_sensitive"),
231
246
  "possibly_sensitive_editable": obj.get("possibly_sensitive_editable"),
232
247
  "quote_count": obj.get("quote_count"),
@@ -0,0 +1,107 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.tweet_legacy_place_bounding_box import TweetLegacyPlaceBoundingBox
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class TweetLegacyPlace(BaseModel):
29
+ """
30
+ TweetLegacyPlace
31
+ """ # noqa: E501
32
+ bounding_box: TweetLegacyPlaceBoundingBox
33
+ country: StrictStr
34
+ country_code: StrictStr
35
+ full_name: StrictStr
36
+ id: StrictStr
37
+ name: StrictStr
38
+ place_type: StrictStr
39
+ url: StrictStr
40
+ __properties: ClassVar[List[str]] = ["bounding_box", "country", "country_code", "full_name", "id", "name", "place_type", "url"]
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 TweetLegacyPlace 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
+ # override the default output from pydantic by calling `to_dict()` of bounding_box
82
+ if self.bounding_box:
83
+ _dict['bounding_box'] = self.bounding_box.to_dict()
84
+ return _dict
85
+
86
+ @classmethod
87
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
88
+ """Create an instance of TweetLegacyPlace from a dict"""
89
+ if obj is None:
90
+ return None
91
+
92
+ if not isinstance(obj, dict):
93
+ return cls.model_validate(obj)
94
+
95
+ _obj = cls.model_validate({
96
+ "bounding_box": TweetLegacyPlaceBoundingBox.from_dict(obj["bounding_box"]) if obj.get("bounding_box") is not None else None,
97
+ "country": obj.get("country"),
98
+ "country_code": obj.get("country_code"),
99
+ "full_name": obj.get("full_name"),
100
+ "id": obj.get("id"),
101
+ "name": obj.get("name"),
102
+ "place_type": obj.get("place_type"),
103
+ "url": obj.get("url")
104
+ })
105
+ return _obj
106
+
107
+
@@ -0,0 +1,98 @@
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, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class TweetLegacyPlaceBoundingBox(BaseModel):
28
+ """
29
+ TweetLegacyPlaceBoundingBox
30
+ """ # noqa: E501
31
+ coordinates: List[List[List[Union[StrictFloat, StrictInt]]]]
32
+ type: StrictStr
33
+ __properties: ClassVar[List[str]] = ["coordinates", "type"]
34
+
35
+ @field_validator('type')
36
+ def type_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['Polygon']):
39
+ raise ValueError("must be one of enum values ('Polygon')")
40
+ return value
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 TweetLegacyPlaceBoundingBox 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 TweetLegacyPlaceBoundingBox 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
+ "coordinates": obj.get("coordinates"),
94
+ "type": obj.get("type")
95
+ })
96
+ return _obj
97
+
98
+
@@ -0,0 +1,98 @@
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, StrictFloat, StrictInt, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List, Union
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class TweetLegacyPoint(BaseModel):
28
+ """
29
+ TweetLegacyPoint
30
+ """ # noqa: E501
31
+ coordinates: List[Union[StrictFloat, StrictInt]]
32
+ type: StrictStr
33
+ __properties: ClassVar[List[str]] = ["coordinates", "type"]
34
+
35
+ @field_validator('type')
36
+ def type_validate_enum(cls, value):
37
+ """Validates the enum"""
38
+ if value not in set(['Point']):
39
+ raise ValueError("must be one of enum values ('Point')")
40
+ return value
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 TweetLegacyPoint 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 TweetLegacyPoint 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
+ "coordinates": obj.get("coordinates"),
94
+ "type": obj.get("type")
95
+ })
96
+ return _obj
97
+
98
+
@@ -18,7 +18,7 @@ import pprint
18
18
  import re # noqa: F401
19
19
  import json
20
20
 
21
- from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from twitter_openapi_python_generated.models.post_cta import PostCta
24
24
  from typing import Optional, Set
@@ -34,14 +34,6 @@ class TweetPostCta(BaseModel):
34
34
  scribe_id: Optional[StrictStr] = None
35
35
  __properties: ClassVar[List[str]] = ["display_locations", "post_cta", "scribe_id"]
36
36
 
37
- @field_validator('display_locations')
38
- def display_locations_validate_enum(cls, value):
39
- """Validates the enum"""
40
- for i in value:
41
- if i not in set(['TweetDetails', 'ForYouTimeline', 'RepliesTimeline']):
42
- raise ValueError("each list item must be one of ('TweetDetails', 'ForYouTimeline', 'RepliesTimeline')")
43
- return value
44
-
45
37
  model_config = ConfigDict(
46
38
  validate_by_name=True,
47
39
  validate_by_alias=True,
@@ -33,6 +33,7 @@ class TypeName(str, Enum):
33
33
  TIMELINETWITTERLIST = 'TimelineTwitterList'
34
34
  TIMELINELABEL = 'TimelineLabel'
35
35
  TIMELINEEVENTSUMMARY = 'TimelineEventSummary'
36
+ AITREND = 'AiTrend'
36
37
  TIMELINETIMELINEITEM = 'TimelineTimelineItem'
37
38
  TIMELINEUSER = 'TimelineUser'
38
39
  TIMELINETIMELINECURSOR = 'TimelineTimelineCursor'