twitter-openapi-python-generated 0.1.2__py3-none-any.whl → 0.1.4__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 (121) hide show
  1. twitter_openapi_python_generated/__init__.py +129 -1
  2. twitter_openapi_python_generated/api/default_api.py +1437 -199
  3. twitter_openapi_python_generated/api/user_api.py +310 -6
  4. twitter_openapi_python_generated/api/users_api.py +327 -6
  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 +64 -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/ad_metadata_container.py +3 -1
  17. twitter_openapi_python_generated/models/ai_trend.py +126 -0
  18. twitter_openapi_python_generated/models/ai_trend_core.py +95 -0
  19. twitter_openapi_python_generated/models/ai_trend_results.py +95 -0
  20. twitter_openapi_python_generated/models/ai_trend_social_proof.py +89 -0
  21. twitter_openapi_python_generated/models/article_content_block.py +117 -0
  22. twitter_openapi_python_generated/models/article_content_block_data.py +104 -0
  23. twitter_openapi_python_generated/models/article_content_entity.py +95 -0
  24. twitter_openapi_python_generated/models/article_content_entity_data.py +115 -0
  25. twitter_openapi_python_generated/models/article_content_entity_range.py +93 -0
  26. twitter_openapi_python_generated/models/article_content_entity_value.py +104 -0
  27. twitter_openapi_python_generated/models/article_content_inline_style_range.py +100 -0
  28. twitter_openapi_python_generated/models/article_content_media_item.py +101 -0
  29. twitter_openapi_python_generated/models/article_content_state.py +105 -0
  30. twitter_openapi_python_generated/models/article_content_text_range.py +93 -0
  31. twitter_openapi_python_generated/models/article_result.py +9 -3
  32. twitter_openapi_python_generated/models/audio_space.py +107 -0
  33. twitter_openapi_python_generated/models/audio_space_data.py +93 -0
  34. twitter_openapi_python_generated/models/audio_space_mentioned_user.py +97 -0
  35. twitter_openapi_python_generated/models/audio_space_metadata.py +165 -0
  36. twitter_openapi_python_generated/models/audio_space_participant.py +109 -0
  37. twitter_openapi_python_generated/models/audio_space_participant_user.py +104 -0
  38. twitter_openapi_python_generated/models/audio_space_participant_user_results.py +103 -0
  39. twitter_openapi_python_generated/models/audio_space_participant_verification.py +99 -0
  40. twitter_openapi_python_generated/models/audio_space_participants.py +114 -0
  41. twitter_openapi_python_generated/models/audio_space_response.py +102 -0
  42. twitter_openapi_python_generated/models/audio_space_sharings.py +91 -0
  43. twitter_openapi_python_generated/models/birdwatch_pivot.py +0 -17
  44. twitter_openapi_python_generated/models/broadcast.py +159 -0
  45. twitter_openapi_python_generated/models/broadcast_data.py +93 -0
  46. twitter_openapi_python_generated/models/broadcast_edited_replay.py +89 -0
  47. twitter_openapi_python_generated/models/broadcast_periscope_user.py +95 -0
  48. twitter_openapi_python_generated/models/broadcast_response.py +102 -0
  49. twitter_openapi_python_generated/models/cashtag_attachment.py +6 -4
  50. twitter_openapi_python_generated/models/community.py +2 -2
  51. twitter_openapi_python_generated/models/community_delete_action_result.py +1 -8
  52. twitter_openapi_python_generated/models/community_invites_result.py +1 -8
  53. twitter_openapi_python_generated/models/community_join_action_unavailable.py +1 -8
  54. twitter_openapi_python_generated/models/community_leave_action_result.py +1 -8
  55. twitter_openapi_python_generated/models/conversation_control.py +8 -1
  56. twitter_openapi_python_generated/models/conversation_details.py +1 -8
  57. twitter_openapi_python_generated/models/cover_cta.py +5 -15
  58. twitter_openapi_python_generated/models/cta_client_event_info.py +1 -8
  59. twitter_openapi_python_generated/models/cta_limited_action_prompt.py +1 -8
  60. twitter_openapi_python_generated/models/feedback_action.py +1 -21
  61. twitter_openapi_python_generated/models/feedback_client_event_info.py +2 -2
  62. twitter_openapi_python_generated/models/grok_account_jwt.py +89 -0
  63. twitter_openapi_python_generated/models/grok_account_jwt_data.py +93 -0
  64. twitter_openapi_python_generated/models/grok_account_jwt_response.py +102 -0
  65. twitter_openapi_python_generated/models/grok_entity_ref.py +19 -4
  66. twitter_openapi_python_generated/models/grok_image_annotation.py +2 -2
  67. twitter_openapi_python_generated/models/identity_profile_labels_highlighted_label.py +93 -0
  68. twitter_openapi_python_generated/models/limited_action.py +8 -1
  69. twitter_openapi_python_generated/models/limited_action_results_data.py +8 -1
  70. twitter_openapi_python_generated/models/media_result.py +1 -1
  71. twitter_openapi_python_generated/models/module_header.py +8 -9
  72. twitter_openapi_python_generated/models/note_tweet_result_data.py +2 -2
  73. twitter_openapi_python_generated/models/notification_additional_context.py +94 -0
  74. twitter_openapi_python_generated/models/notification_template.py +10 -2
  75. twitter_openapi_python_generated/models/notification_url.py +104 -0
  76. twitter_openapi_python_generated/models/notification_urt_endpoint_options.py +93 -0
  77. twitter_openapi_python_generated/models/preroll.py +97 -0
  78. twitter_openapi_python_generated/models/preroll_call_to_action.py +91 -0
  79. twitter_openapi_python_generated/models/preroll_media_info.py +118 -0
  80. twitter_openapi_python_generated/models/preroll_metadata.py +93 -0
  81. twitter_openapi_python_generated/models/preroll_video_variant.py +93 -0
  82. twitter_openapi_python_generated/models/rich_message_entity.py +6 -4
  83. twitter_openapi_python_generated/models/session.py +0 -7
  84. twitter_openapi_python_generated/models/sidebar_user_recommendation.py +95 -0
  85. twitter_openapi_python_generated/models/sidebar_user_recommendations_data.py +96 -0
  86. twitter_openapi_python_generated/models/sidebar_user_recommendations_response.py +102 -0
  87. twitter_openapi_python_generated/models/story_topic.py +95 -0
  88. twitter_openapi_python_generated/models/story_topic_data.py +93 -0
  89. twitter_openapi_python_generated/models/story_topic_item.py +93 -0
  90. twitter_openapi_python_generated/models/story_topic_response.py +102 -0
  91. twitter_openapi_python_generated/models/story_topic_stories.py +96 -0
  92. twitter_openapi_python_generated/models/timeline_general_context.py +2 -2
  93. twitter_openapi_python_generated/models/timeline_half_cover.py +0 -7
  94. twitter_openapi_python_generated/models/timeline_message_prompt_content.py +1 -8
  95. twitter_openapi_python_generated/models/timeline_notification.py +3 -3
  96. twitter_openapi_python_generated/models/timeline_prompt_content.py +1 -15
  97. twitter_openapi_python_generated/models/timeline_show_alert.py +1 -15
  98. twitter_openapi_python_generated/models/timeline_tombstone.py +1 -11
  99. twitter_openapi_python_generated/models/timeline_topic_context.py +1 -11
  100. twitter_openapi_python_generated/models/timeline_tweet.py +7 -1
  101. twitter_openapi_python_generated/models/tweet.py +10 -2
  102. twitter_openapi_python_generated/models/tweet_card_legacy_binding_value_data.py +8 -1
  103. twitter_openapi_python_generated/models/tweet_card_platform_audience.py +1 -8
  104. twitter_openapi_python_generated/models/tweet_legacy.py +18 -3
  105. twitter_openapi_python_generated/models/tweet_legacy_place.py +107 -0
  106. twitter_openapi_python_generated/models/tweet_legacy_place_bounding_box.py +98 -0
  107. twitter_openapi_python_generated/models/tweet_legacy_point.py +98 -0
  108. twitter_openapi_python_generated/models/tweet_post_cta.py +1 -9
  109. twitter_openapi_python_generated/models/tweet_sports_competitor.py +107 -0
  110. twitter_openapi_python_generated/models/tweet_sports_post_context.py +122 -0
  111. twitter_openapi_python_generated/models/tweet_sports_rest_id.py +97 -0
  112. twitter_openapi_python_generated/models/type_name.py +2 -0
  113. twitter_openapi_python_generated/models/unified_card.py +1 -8
  114. twitter_openapi_python_generated/models/user_highlights_tweets_result.py +2 -2
  115. twitter_openapi_python_generated/models/user_tweets_result_v1.py +2 -2
  116. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/METADATA +72 -2
  117. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/RECORD +121 -57
  118. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/WHEEL +1 -1
  119. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/licenses/LICENSE +0 -0
  120. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/licenses/LICENSE.AGPL +0 -0
  121. {twitter_openapi_python_generated-0.1.2.dist-info → twitter_openapi_python_generated-0.1.4.dist-info}/top_level.txt +0 -0
@@ -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,
@@ -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, StrictBool, StrictStr
22
+ from typing import Any, ClassVar, Dict, List
23
+ from twitter_openapi_python_generated.models.tweet_sports_rest_id import TweetSportsRestId
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class TweetSportsCompetitor(BaseModel):
29
+ """
30
+ TweetSportsCompetitor
31
+ """ # noqa: E501
32
+ abbreviation: StrictStr
33
+ dark_logo_url: StrictStr
34
+ is_active: StrictBool
35
+ is_winner: StrictBool
36
+ logo_url: StrictStr
37
+ name: StrictStr
38
+ score: StrictStr
39
+ team_rest_id: TweetSportsRestId
40
+ __properties: ClassVar[List[str]] = ["abbreviation", "dark_logo_url", "is_active", "is_winner", "logo_url", "name", "score", "team_rest_id"]
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 TweetSportsCompetitor 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 team_rest_id
82
+ if self.team_rest_id:
83
+ _dict['team_rest_id'] = self.team_rest_id.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 TweetSportsCompetitor 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
+ "abbreviation": obj.get("abbreviation"),
97
+ "dark_logo_url": obj.get("dark_logo_url"),
98
+ "is_active": obj.get("is_active"),
99
+ "is_winner": obj.get("is_winner"),
100
+ "logo_url": obj.get("logo_url"),
101
+ "name": obj.get("name"),
102
+ "score": obj.get("score"),
103
+ "team_rest_id": TweetSportsRestId.from_dict(obj["team_rest_id"]) if obj.get("team_rest_id") is not None else None
104
+ })
105
+ return _obj
106
+
107
+
@@ -0,0 +1,122 @@
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, StrictStr, field_validator
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing_extensions import Annotated
24
+ from twitter_openapi_python_generated.models.tweet_sports_competitor import TweetSportsCompetitor
25
+ from twitter_openapi_python_generated.models.tweet_sports_rest_id import TweetSportsRestId
26
+ from typing import Optional, Set
27
+ from typing_extensions import Self
28
+ from pydantic_core import to_jsonable_python
29
+
30
+ class TweetSportsPostContext(BaseModel):
31
+ """
32
+ TweetSportsPostContext
33
+ """ # noqa: E501
34
+ competitors: List[TweetSportsCompetitor]
35
+ game_id: TweetSportsRestId
36
+ league: StrictStr
37
+ scheduled_at_ms: Annotated[str, Field(strict=True)]
38
+ state: StrictStr
39
+ status_text: StrictStr
40
+ title: StrictStr
41
+ url: StrictStr
42
+ __properties: ClassVar[List[str]] = ["competitors", "game_id", "league", "scheduled_at_ms", "state", "status_text", "title", "url"]
43
+
44
+ @field_validator('scheduled_at_ms', mode="before")
45
+ def scheduled_at_ms_validate_regular_expression(cls, value):
46
+ """Validates the regular expression"""
47
+ if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
48
+ raise ValueError(r"must validate the regular expression /^[0-9]+$/")
49
+ return value
50
+
51
+ model_config = ConfigDict(
52
+ validate_by_name=True,
53
+ validate_by_alias=True,
54
+ validate_assignment=True,
55
+ protected_namespaces=(),
56
+ )
57
+
58
+
59
+ def to_str(self) -> str:
60
+ """Returns the string representation of the model using alias"""
61
+ return pprint.pformat(self.model_dump(by_alias=True))
62
+
63
+ def to_json(self) -> str:
64
+ """Returns the JSON representation of the model using alias"""
65
+ return json.dumps(to_jsonable_python(self.to_dict()))
66
+
67
+ @classmethod
68
+ def from_json(cls, json_str: str) -> Optional[Self]:
69
+ """Create an instance of TweetSportsPostContext from a JSON string"""
70
+ return cls.from_dict(json.loads(json_str))
71
+
72
+ def to_dict(self) -> Dict[str, Any]:
73
+ """Return the dictionary representation of the model using alias.
74
+
75
+ This has the following differences from calling pydantic's
76
+ `self.model_dump(by_alias=True)`:
77
+
78
+ * `None` is only added to the output dict for nullable fields that
79
+ were set at model initialization. Other fields with value `None`
80
+ are ignored.
81
+ """
82
+ excluded_fields: Set[str] = set([
83
+ ])
84
+
85
+ _dict = self.model_dump(
86
+ by_alias=True,
87
+ exclude=excluded_fields,
88
+ exclude_none=True,
89
+ )
90
+ # override the default output from pydantic by calling `to_dict()` of each item in competitors (list)
91
+ _items = []
92
+ if self.competitors:
93
+ for _item_competitors in self.competitors:
94
+ _items.append(_item_competitors.to_dict() if _item_competitors is not None else None)
95
+ _dict['competitors'] = _items
96
+ # override the default output from pydantic by calling `to_dict()` of game_id
97
+ if self.game_id:
98
+ _dict['game_id'] = self.game_id.to_dict()
99
+ return _dict
100
+
101
+ @classmethod
102
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
103
+ """Create an instance of TweetSportsPostContext from a dict"""
104
+ if obj is None:
105
+ return None
106
+
107
+ if not isinstance(obj, dict):
108
+ return cls.model_validate(obj)
109
+
110
+ _obj = cls.model_validate({
111
+ "competitors": [TweetSportsCompetitor.from_dict(_item) for _item in obj["competitors"]] if obj.get("competitors") is not None else None,
112
+ "game_id": TweetSportsRestId.from_dict(obj["game_id"]) if obj.get("game_id") is not None else None,
113
+ "league": obj.get("league"),
114
+ "scheduled_at_ms": obj.get("scheduled_at_ms"),
115
+ "state": obj.get("state"),
116
+ "status_text": obj.get("status_text"),
117
+ "title": obj.get("title"),
118
+ "url": obj.get("url")
119
+ })
120
+ return _obj
121
+
122
+
@@ -0,0 +1,97 @@
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, field_validator
22
+ from typing import Any, ClassVar, Dict, List
23
+ from typing_extensions import Annotated
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
27
+
28
+ class TweetSportsRestId(BaseModel):
29
+ """
30
+ TweetSportsRestId
31
+ """ # noqa: E501
32
+ rest_id: Annotated[str, Field(strict=True)]
33
+ __properties: ClassVar[List[str]] = ["rest_id"]
34
+
35
+ @field_validator('rest_id', mode="before")
36
+ def rest_id_validate_regular_expression(cls, value):
37
+ """Validates the regular expression"""
38
+ if isinstance(value, str) and not re.match(r"^[0-9]+$", value):
39
+ raise ValueError(r"must validate the regular expression /^[0-9]+$/")
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 TweetSportsRestId 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 TweetSportsRestId 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
+ "rest_id": obj.get("rest_id")
94
+ })
95
+ return _obj
96
+
97
+
@@ -33,6 +33,8 @@ class TypeName(str, Enum):
33
33
  TIMELINETWITTERLIST = 'TimelineTwitterList'
34
34
  TIMELINELABEL = 'TimelineLabel'
35
35
  TIMELINEEVENTSUMMARY = 'TimelineEventSummary'
36
+ AITREND = 'AiTrend'
37
+ TIMELINERICHTEXT = 'TimelineRichText'
36
38
  TIMELINETIMELINEITEM = 'TimelineTimelineItem'
37
39
  TIMELINEUSER = 'TimelineUser'
38
40
  TIMELINETIMELINECURSOR = 'TimelineTimelineCursor'
@@ -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 UnifiedCard(BaseModel):
31
31
  card_fetch_state: StrictStr
32
32
  __properties: ClassVar[List[str]] = ["card_fetch_state"]
33
33
 
34
- @field_validator('card_fetch_state')
35
- def card_fetch_state_validate_enum(cls, value):
36
- """Validates the enum"""
37
- if value not in set(['NoCard']):
38
- raise ValueError("must be one of enum values ('NoCard')")
39
- return value
40
-
41
34
  model_config = ConfigDict(
42
35
  validate_by_name=True,
43
36
  validate_by_alias=True,