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
@@ -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, StrictBool
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 BroadcastEditedReplay(BaseModel):
28
+ """
29
+ BroadcastEditedReplay
30
+ """ # noqa: E501
31
+ title_edited: StrictBool
32
+ __properties: ClassVar[List[str]] = ["title_edited"]
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 BroadcastEditedReplay 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 BroadcastEditedReplay 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
+ "title_edited": obj.get("title_edited")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,95 @@
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 BroadcastPeriscopeUser(BaseModel):
28
+ """
29
+ BroadcastPeriscopeUser
30
+ """ # noqa: E501
31
+ display_name: StrictStr
32
+ profile_image_url: StrictStr
33
+ rest_id: StrictStr
34
+ username: StrictStr
35
+ __properties: ClassVar[List[str]] = ["display_name", "profile_image_url", "rest_id", "username"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of BroadcastPeriscopeUser from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of BroadcastPeriscopeUser from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "display_name": obj.get("display_name"),
89
+ "profile_image_url": obj.get("profile_image_url"),
90
+ "rest_id": obj.get("rest_id"),
91
+ "username": obj.get("username")
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,102 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Twitter OpenAPI
5
+
6
+ Twitter OpenAPI(Swagger) specification
7
+
8
+ The version of the OpenAPI document: 0.0.1
9
+ Contact: yuki@yuki0311.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from twitter_openapi_python_generated.models.broadcast_data import BroadcastData
24
+ from twitter_openapi_python_generated.models.error_response import ErrorResponse
25
+ from typing import Optional, Set
26
+ from typing_extensions import Self
27
+ from pydantic_core import to_jsonable_python
28
+
29
+ class BroadcastResponse(BaseModel):
30
+ """
31
+ BroadcastResponse
32
+ """ # noqa: E501
33
+ data: BroadcastData
34
+ errors: Optional[List[ErrorResponse]] = None
35
+ __properties: ClassVar[List[str]] = ["data", "errors"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of BroadcastResponse from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of data
77
+ if self.data:
78
+ _dict['data'] = self.data.to_dict()
79
+ # override the default output from pydantic by calling `to_dict()` of each item in errors (list)
80
+ _items = []
81
+ if self.errors:
82
+ for _item_errors in self.errors:
83
+ _items.append(_item_errors.to_dict() if _item_errors is not None else None)
84
+ _dict['errors'] = _items
85
+ return _dict
86
+
87
+ @classmethod
88
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
89
+ """Create an instance of BroadcastResponse from a dict"""
90
+ if obj is None:
91
+ return None
92
+
93
+ if not isinstance(obj, dict):
94
+ return cls.model_validate(obj)
95
+
96
+ _obj = cls.model_validate({
97
+ "data": BroadcastData.from_dict(obj["data"]) if obj.get("data") is not None else None,
98
+ "errors": [ErrorResponse.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None
99
+ })
100
+ return _obj
101
+
102
+
@@ -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, StrictInt, StrictStr
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,7 +29,8 @@ class CashtagAttachment(BaseModel):
29
29
  CashtagAttachment
30
30
  """ # noqa: E501
31
31
  rest_id: StrictStr
32
- __properties: ClassVar[List[str]] = ["rest_id"]
32
+ size_variant: Optional[StrictInt] = None
33
+ __properties: ClassVar[List[str]] = ["rest_id", "size_variant"]
33
34
 
34
35
  model_config = ConfigDict(
35
36
  validate_by_name=True,
@@ -82,7 +83,8 @@ class CashtagAttachment(BaseModel):
82
83
  return cls.model_validate(obj)
83
84
 
84
85
  _obj = cls.model_validate({
85
- "rest_id": obj.get("rest_id")
86
+ "rest_id": obj.get("rest_id"),
87
+ "size_variant": obj.get("size_variant")
86
88
  })
87
89
  return _obj
88
90
 
@@ -104,8 +104,8 @@ class Community(BaseModel):
104
104
  if value is None:
105
105
  return value
106
106
 
107
- if value not in set(['NonMember']):
108
- raise ValueError("must be one of enum values ('NonMember')")
107
+ if value not in set(['Member', 'Moderator', 'Admin', 'NonMember']):
108
+ raise ValueError("must be one of enum values ('Member', 'Moderator', 'Admin', 'NonMember')")
109
109
  return value
110
110
 
111
111
  model_config = ConfigDict(
@@ -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.type_name import TypeName
24
24
  from typing import Optional, Set
@@ -33,13 +33,6 @@ class CommunityDeleteActionResult(BaseModel):
33
33
  reason: StrictStr
34
34
  __properties: ClassVar[List[str]] = ["__typename", "reason"]
35
35
 
36
- @field_validator('reason')
37
- def reason_validate_enum(cls, value):
38
- """Validates the enum"""
39
- if value not in set(['Unavailable']):
40
- raise ValueError("must be one of enum values ('Unavailable')")
41
- return value
42
-
43
36
  model_config = ConfigDict(
44
37
  validate_by_name=True,
45
38
  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.type_name import TypeName
24
24
  from typing import Optional, Set
@@ -34,13 +34,6 @@ class CommunityInvitesResult(BaseModel):
34
34
  reason: StrictStr
35
35
  __properties: ClassVar[List[str]] = ["__typename", "message", "reason"]
36
36
 
37
- @field_validator('reason')
38
- def reason_validate_enum(cls, value):
39
- """Validates the enum"""
40
- if value not in set(['Unavailable']):
41
- raise ValueError("must be one of enum values ('Unavailable')")
42
- return value
43
-
44
37
  model_config = ConfigDict(
45
38
  validate_by_name=True,
46
39
  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.type_name import TypeName
24
24
  from typing import Optional, Set
@@ -34,13 +34,6 @@ class CommunityJoinActionUnavailable(BaseModel):
34
34
  reason: StrictStr
35
35
  __properties: ClassVar[List[str]] = ["__typename", "message", "reason"]
36
36
 
37
- @field_validator('reason')
38
- def reason_validate_enum(cls, value):
39
- """Validates the enum"""
40
- if value not in set(['ViewerRequestRequired']):
41
- raise ValueError("must be one of enum values ('ViewerRequestRequired')")
42
- return value
43
-
44
37
  model_config = ConfigDict(
45
38
  validate_by_name=True,
46
39
  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.type_name import TypeName
24
24
  from typing import Optional, Set
@@ -34,13 +34,6 @@ class CommunityLeaveActionResult(BaseModel):
34
34
  reason: StrictStr
35
35
  __properties: ClassVar[List[str]] = ["__typename", "message", "reason"]
36
36
 
37
- @field_validator('reason')
38
- def reason_validate_enum(cls, value):
39
- """Validates the enum"""
40
- if value not in set(['ViewerNotMember']):
41
- raise ValueError("must be one of enum values ('ViewerNotMember')")
42
- return value
43
-
44
37
  model_config = ConfigDict(
45
38
  validate_by_name=True,
46
39
  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
21
+ from pydantic import BaseModel, ConfigDict, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List
23
23
  from twitter_openapi_python_generated.models.conversation_owner_results import ConversationOwnerResults
24
24
  from typing import Optional, Set
@@ -33,6 +33,13 @@ class ConversationControl(BaseModel):
33
33
  policy: StrictStr
34
34
  __properties: ClassVar[List[str]] = ["conversation_owner_results", "policy"]
35
35
 
36
+ @field_validator('policy')
37
+ def policy_validate_enum(cls, value):
38
+ """Validates the enum"""
39
+ if value not in set(['ByInvitation', 'Community', 'Co', 'Subscribers', 'Verified', 'MyNetwork']):
40
+ raise ValueError("must be one of enum values ('ByInvitation', 'Community', 'Co', 'Subscribers', 'Verified', 'MyNetwork')")
41
+ return value
42
+
36
43
  model_config = ConfigDict(
37
44
  validate_by_name=True,
38
45
  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 typing import Optional, Set
24
24
  from typing_extensions import Self
@@ -31,13 +31,6 @@ class ConversationDetails(BaseModel):
31
31
  conversation_section: StrictStr = Field(alias="conversationSection")
32
32
  __properties: ClassVar[List[str]] = ["conversationSection"]
33
33
 
34
- @field_validator('conversation_section')
35
- def conversation_section_validate_enum(cls, value):
36
- """Validates the enum"""
37
- if value not in set(['HighQuality']):
38
- raise ValueError("must be one of enum values ('HighQuality')")
39
- return value
40
-
41
34
  model_config = ConfigDict(
42
35
  validate_by_name=True,
43
36
  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.callback import Callback
24
24
  from twitter_openapi_python_generated.models.cta_client_event_info import CtaClientEventInfo
@@ -31,22 +31,12 @@ class CoverCta(BaseModel):
31
31
  """
32
32
  CoverCta
33
33
  """ # noqa: E501
34
- text: Optional[StrictStr] = Field(default=None, alias="Text")
35
34
  button_style: Optional[StrictStr] = Field(default=None, alias="buttonStyle")
36
35
  callbacks: List[Callback]
37
36
  client_event_info: CtaClientEventInfo = Field(alias="clientEventInfo")
38
37
  cta_behavior: TimelineCoverBehavior = Field(alias="ctaBehavior")
39
- __properties: ClassVar[List[str]] = ["Text", "buttonStyle", "callbacks", "clientEventInfo", "ctaBehavior"]
40
-
41
- @field_validator('button_style')
42
- def button_style_validate_enum(cls, value):
43
- """Validates the enum"""
44
- if value is None:
45
- return value
46
-
47
- if value not in set(['Primary']):
48
- raise ValueError("must be one of enum values ('Primary')")
49
- return value
38
+ text: StrictStr
39
+ __properties: ClassVar[List[str]] = ["buttonStyle", "callbacks", "clientEventInfo", "ctaBehavior", "text"]
50
40
 
51
41
  model_config = ConfigDict(
52
42
  validate_by_name=True,
@@ -111,11 +101,11 @@ class CoverCta(BaseModel):
111
101
  return cls.model_validate(obj)
112
102
 
113
103
  _obj = cls.model_validate({
114
- "Text": obj.get("Text"),
115
104
  "buttonStyle": obj.get("buttonStyle"),
116
105
  "callbacks": [Callback.from_dict(_item) for _item in obj["callbacks"]] if obj.get("callbacks") is not None else None,
117
106
  "clientEventInfo": CtaClientEventInfo.from_dict(obj["clientEventInfo"]) if obj.get("clientEventInfo") is not None else None,
118
- "ctaBehavior": TimelineCoverBehavior.from_dict(obj["ctaBehavior"]) if obj.get("ctaBehavior") is not None else None
107
+ "ctaBehavior": TimelineCoverBehavior.from_dict(obj["ctaBehavior"]) if obj.get("ctaBehavior") is not None else None,
108
+ "text": obj.get("text")
119
109
  })
120
110
  return _obj
121
111
 
@@ -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 CtaClientEventInfo(BaseModel):
31
31
  action: StrictStr
32
32
  __properties: ClassVar[List[str]] = ["action"]
33
33
 
34
- @field_validator('action')
35
- def action_validate_enum(cls, value):
36
- """Validates the enum"""
37
- if value not in set(['primary_cta']):
38
- raise ValueError("must be one of enum values ('primary_cta')")
39
- return value
40
-
41
34
  model_config = ConfigDict(
42
35
  validate_by_name=True,
43
36
  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.cta_limited_action_prompt_text import CtaLimitedActionPromptText
24
24
  from twitter_openapi_python_generated.models.type_name import TypeName
@@ -36,13 +36,6 @@ class CtaLimitedActionPrompt(BaseModel):
36
36
  subtext: CtaLimitedActionPromptText
37
37
  __properties: ClassVar[List[str]] = ["__typename", "cta_type", "headline", "subtext"]
38
38
 
39
- @field_validator('cta_type')
40
- def cta_type_validate_enum(cls, value):
41
- """Validates the enum"""
42
- if value not in set(['SeeConversation']):
43
- raise ValueError("must be one of enum values ('SeeConversation')")
44
- return value
45
-
46
39
  model_config = ConfigDict(
47
40
  validate_by_name=True,
48
41
  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, StrictBool, StrictStr, field_validator
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from twitter_openapi_python_generated.models.feedback_client_event_info import FeedbackClientEventInfo
24
24
  from typing import Optional, Set
@@ -40,26 +40,6 @@ class FeedbackAction(BaseModel):
40
40
  prompt: StrictStr
41
41
  __properties: ClassVar[List[str]] = ["childKeys", "clientEventInfo", "confirmation", "confirmationDisplayType", "feedbackType", "feedbackUrl", "hasUndoAction", "icon", "prompt"]
42
42
 
43
- @field_validator('confirmation_display_type')
44
- def confirmation_display_type_validate_enum(cls, value):
45
- """Validates the enum"""
46
- if value is None:
47
- return value
48
-
49
- if value not in set(['BottomSheet', 'Inline']):
50
- raise ValueError("must be one of enum values ('BottomSheet', 'Inline')")
51
- return value
52
-
53
- @field_validator('icon')
54
- def icon_validate_enum(cls, value):
55
- """Validates the enum"""
56
- if value is None:
57
- return value
58
-
59
- if value not in set(['Frown']):
60
- raise ValueError("must be one of enum values ('Frown')")
61
- return value
62
-
63
43
  model_config = ConfigDict(
64
44
  validate_by_name=True,
65
45
  validate_by_alias=True,