twitter-openapi-python-generated 0.0.24__py3-none-any.whl → 0.0.26__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- twitter_openapi_python_generated/__init__.py +7 -29
- twitter_openapi_python_generated/api/default_api.py +14 -12
- twitter_openapi_python_generated/api/other_api.py +7 -6
- twitter_openapi_python_generated/api/post_api.py +56 -48
- twitter_openapi_python_generated/api/tweet_api.py +73 -62
- twitter_openapi_python_generated/api/user_api.py +13 -11
- twitter_openapi_python_generated/api/user_list_api.py +33 -28
- twitter_openapi_python_generated/api/users_api.py +7 -6
- twitter_openapi_python_generated/api/v11_get_api.py +2 -0
- twitter_openapi_python_generated/api/v11_post_api.py +2 -0
- twitter_openapi_python_generated/api/v20_get_api.py +1 -0
- twitter_openapi_python_generated/api_client.py +1 -1
- twitter_openapi_python_generated/configuration.py +185 -38
- twitter_openapi_python_generated/models/__init__.py +6 -28
- twitter_openapi_python_generated/models/author_community_relationship.py +2 -2
- twitter_openapi_python_generated/models/birdwatch_pivot.py +6 -6
- twitter_openapi_python_generated/models/bookmarks_response.py +14 -4
- twitter_openapi_python_generated/models/community_actions.py +3 -3
- twitter_openapi_python_generated/models/community_data.py +4 -4
- twitter_openapi_python_generated/models/{favorite_tweet_response_data.py → community_join_action_unavailable.py} +20 -12
- twitter_openapi_python_generated/models/{post_favorite_tweet200_response.py → community_join_action_union.py} +50 -27
- twitter_openapi_python_generated/models/create_bookmark_response.py +13 -3
- twitter_openapi_python_generated/models/create_bookmark_response_data.py +2 -2
- twitter_openapi_python_generated/models/create_retweet_response.py +13 -3
- twitter_openapi_python_generated/models/create_retweet_response_data.py +2 -2
- twitter_openapi_python_generated/models/create_tweet_response.py +13 -3
- twitter_openapi_python_generated/models/create_tweet_response_data.py +2 -2
- twitter_openapi_python_generated/models/delete_bookmark_response.py +13 -3
- twitter_openapi_python_generated/models/delete_bookmark_response_data.py +2 -2
- twitter_openapi_python_generated/models/delete_retweet_response.py +13 -3
- twitter_openapi_python_generated/models/delete_retweet_response_data.py +3 -3
- twitter_openapi_python_generated/models/delete_tweet_response.py +13 -3
- twitter_openapi_python_generated/models/{error.py → error_response.py} +5 -5
- twitter_openapi_python_generated/models/favorite_tweet.py +2 -2
- twitter_openapi_python_generated/models/{errors.py → favorite_tweet_response.py} +10 -10
- twitter_openapi_python_generated/models/follow_response.py +13 -3
- twitter_openapi_python_generated/models/follow_response_data.py +2 -2
- twitter_openapi_python_generated/models/home_timeline_response_data.py +2 -2
- twitter_openapi_python_generated/models/list_latest_tweets_timeline_response.py +13 -3
- twitter_openapi_python_generated/models/list_tweets_timeline_data.py +2 -2
- twitter_openapi_python_generated/models/{other_response.py → other_object_all.py} +4 -4
- twitter_openapi_python_generated/models/profile_response.py +13 -3
- twitter_openapi_python_generated/models/profile_response_data.py +2 -2
- twitter_openapi_python_generated/models/search_timeline_data.py +2 -2
- twitter_openapi_python_generated/models/search_timeline_response.py +13 -3
- twitter_openapi_python_generated/models/sensitive_media_warning.py +4 -4
- twitter_openapi_python_generated/models/timeline_response.py +13 -3
- twitter_openapi_python_generated/models/tweet_detail_response.py +13 -3
- twitter_openapi_python_generated/models/tweet_detail_response_data.py +2 -2
- twitter_openapi_python_generated/models/tweet_favoriters_response.py +13 -3
- twitter_openapi_python_generated/models/tweet_favoriters_response_data.py +2 -2
- twitter_openapi_python_generated/models/tweet_legacy.py +2 -2
- twitter_openapi_python_generated/models/tweet_result_by_rest_id_data.py +2 -2
- twitter_openapi_python_generated/models/tweet_result_by_rest_id_response.py +13 -3
- twitter_openapi_python_generated/models/tweet_retweeters_response.py +13 -3
- twitter_openapi_python_generated/models/tweet_retweeters_response_data.py +2 -2
- twitter_openapi_python_generated/models/type_name.py +1 -0
- twitter_openapi_python_generated/models/unfavorite_tweet.py +2 -2
- twitter_openapi_python_generated/models/{unfavorite_tweet_response_data.py → unfavorite_tweet_response.py} +17 -7
- twitter_openapi_python_generated/models/user.py +1 -1
- twitter_openapi_python_generated/models/user_highlights_tweets_data.py +2 -2
- twitter_openapi_python_generated/models/user_highlights_tweets_response.py +13 -3
- twitter_openapi_python_generated/models/user_legacy_extended_profile_birthdate.py +2 -2
- twitter_openapi_python_generated/models/user_response.py +13 -3
- twitter_openapi_python_generated/models/user_tip_jar_settings.py +3 -1
- twitter_openapi_python_generated/models/user_tweets_data.py +2 -2
- twitter_openapi_python_generated/models/user_tweets_response.py +13 -3
- twitter_openapi_python_generated/models/user_verification_info_reason.py +2 -2
- twitter_openapi_python_generated/models/users_response.py +13 -3
- twitter_openapi_python_generated/models/users_response_data.py +2 -2
- {twitter_openapi_python_generated-0.0.24.dist-info → twitter_openapi_python_generated-0.0.26.dist-info}/METADATA +6 -6
- {twitter_openapi_python_generated-0.0.24.dist-info → twitter_openapi_python_generated-0.0.26.dist-info}/RECORD +76 -98
- {twitter_openapi_python_generated-0.0.24.dist-info → twitter_openapi_python_generated-0.0.26.dist-info}/WHEEL +1 -1
- twitter_openapi_python_generated/models/errors_data.py +0 -99
- twitter_openapi_python_generated/models/get_bookmarks200_response.py +0 -138
- twitter_openapi_python_generated/models/get_favoriters200_response.py +0 -138
- twitter_openapi_python_generated/models/get_followers200_response.py +0 -138
- twitter_openapi_python_generated/models/get_home_latest_timeline200_response.py +0 -138
- twitter_openapi_python_generated/models/get_likes200_response.py +0 -138
- twitter_openapi_python_generated/models/get_list_latest_tweets_timeline200_response.py +0 -138
- twitter_openapi_python_generated/models/get_profile_spotlights_query200_response.py +0 -138
- twitter_openapi_python_generated/models/get_retweeters200_response.py +0 -138
- twitter_openapi_python_generated/models/get_search_timeline200_response.py +0 -138
- twitter_openapi_python_generated/models/get_tweet_detail200_response.py +0 -138
- twitter_openapi_python_generated/models/get_tweet_result_by_rest_id200_response.py +0 -138
- twitter_openapi_python_generated/models/get_user_by_rest_id200_response.py +0 -138
- twitter_openapi_python_generated/models/get_user_highlights_tweets200_response.py +0 -138
- twitter_openapi_python_generated/models/get_users_by_rest_ids200_response.py +0 -138
- twitter_openapi_python_generated/models/post_create_bookmark200_response.py +0 -138
- twitter_openapi_python_generated/models/post_create_retweet200_response.py +0 -138
- twitter_openapi_python_generated/models/post_create_tweet200_response.py +0 -138
- twitter_openapi_python_generated/models/post_delete_bookmark200_response.py +0 -138
- twitter_openapi_python_generated/models/post_delete_retweet200_response.py +0 -138
- twitter_openapi_python_generated/models/post_delete_tweet200_response.py +0 -138
- twitter_openapi_python_generated/models/post_unfavorite_tweet200_response.py +0 -138
- {twitter_openapi_python_generated-0.0.24.dist-info → twitter_openapi_python_generated-0.0.26.dist-info}/LICENSE +0 -0
- {twitter_openapi_python_generated-0.0.24.dist-info → twitter_openapi_python_generated-0.0.26.dist-info}/LICENSE.AGPL +0 -0
- {twitter_openapi_python_generated-0.0.24.dist-info → twitter_openapi_python_generated-0.0.26.dist-info}/top_level.txt +0 -0
|
@@ -1,138 +0,0 @@
|
|
|
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 json
|
|
18
|
-
import pprint
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
-
from typing import Any, List, Optional
|
|
21
|
-
from twitter_openapi_python_generated.models.errors import Errors
|
|
22
|
-
from twitter_openapi_python_generated.models.tweet_favoriters_response import TweetFavoritersResponse
|
|
23
|
-
from pydantic import StrictStr, Field
|
|
24
|
-
from typing import Union, List, Set, Optional, Dict
|
|
25
|
-
from typing_extensions import Literal, Self
|
|
26
|
-
|
|
27
|
-
GETFAVORITERS200RESPONSE_ONE_OF_SCHEMAS = ["Errors", "TweetFavoritersResponse"]
|
|
28
|
-
|
|
29
|
-
class GetFavoriters200Response(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
GetFavoriters200Response
|
|
32
|
-
"""
|
|
33
|
-
# data type: TweetFavoritersResponse
|
|
34
|
-
oneof_schema_1_validator: Optional[TweetFavoritersResponse] = None
|
|
35
|
-
# data type: Errors
|
|
36
|
-
oneof_schema_2_validator: Optional[Errors] = None
|
|
37
|
-
actual_instance: Optional[Union[Errors, TweetFavoritersResponse]] = None
|
|
38
|
-
one_of_schemas: Set[str] = { "Errors", "TweetFavoritersResponse" }
|
|
39
|
-
|
|
40
|
-
model_config = ConfigDict(
|
|
41
|
-
validate_assignment=True,
|
|
42
|
-
protected_namespaces=(),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
47
|
-
if args:
|
|
48
|
-
if len(args) > 1:
|
|
49
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
50
|
-
if kwargs:
|
|
51
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
52
|
-
super().__init__(actual_instance=args[0])
|
|
53
|
-
else:
|
|
54
|
-
super().__init__(**kwargs)
|
|
55
|
-
|
|
56
|
-
@field_validator('actual_instance')
|
|
57
|
-
def actual_instance_must_validate_oneof(cls, v):
|
|
58
|
-
instance = GetFavoriters200Response.model_construct()
|
|
59
|
-
error_messages = []
|
|
60
|
-
match = 0
|
|
61
|
-
# validate data type: TweetFavoritersResponse
|
|
62
|
-
if not isinstance(v, TweetFavoritersResponse):
|
|
63
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `TweetFavoritersResponse`")
|
|
64
|
-
else:
|
|
65
|
-
match += 1
|
|
66
|
-
# validate data type: Errors
|
|
67
|
-
if not isinstance(v, Errors):
|
|
68
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `Errors`")
|
|
69
|
-
else:
|
|
70
|
-
match += 1
|
|
71
|
-
if match > 1:
|
|
72
|
-
# more than 1 match
|
|
73
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in GetFavoriters200Response with oneOf schemas: Errors, TweetFavoritersResponse. Details: " + ", ".join(error_messages))
|
|
74
|
-
elif match == 0:
|
|
75
|
-
# no match
|
|
76
|
-
raise ValueError("No match found when setting `actual_instance` in GetFavoriters200Response with oneOf schemas: Errors, TweetFavoritersResponse. Details: " + ", ".join(error_messages))
|
|
77
|
-
else:
|
|
78
|
-
return v
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
82
|
-
return cls.from_json(json.dumps(obj))
|
|
83
|
-
|
|
84
|
-
@classmethod
|
|
85
|
-
def from_json(cls, json_str: str) -> Self:
|
|
86
|
-
"""Returns the object represented by the json string"""
|
|
87
|
-
instance = cls.model_construct()
|
|
88
|
-
error_messages = []
|
|
89
|
-
match = 0
|
|
90
|
-
|
|
91
|
-
# deserialize data into TweetFavoritersResponse
|
|
92
|
-
try:
|
|
93
|
-
instance.actual_instance = TweetFavoritersResponse.from_json(json_str)
|
|
94
|
-
match += 1
|
|
95
|
-
except (ValidationError, ValueError) as e:
|
|
96
|
-
error_messages.append(str(e))
|
|
97
|
-
# deserialize data into Errors
|
|
98
|
-
try:
|
|
99
|
-
instance.actual_instance = Errors.from_json(json_str)
|
|
100
|
-
match += 1
|
|
101
|
-
except (ValidationError, ValueError) as e:
|
|
102
|
-
error_messages.append(str(e))
|
|
103
|
-
|
|
104
|
-
if match > 1:
|
|
105
|
-
# more than 1 match
|
|
106
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into GetFavoriters200Response with oneOf schemas: Errors, TweetFavoritersResponse. Details: " + ", ".join(error_messages))
|
|
107
|
-
elif match == 0:
|
|
108
|
-
# no match
|
|
109
|
-
raise ValueError("No match found when deserializing the JSON string into GetFavoriters200Response with oneOf schemas: Errors, TweetFavoritersResponse. Details: " + ", ".join(error_messages))
|
|
110
|
-
else:
|
|
111
|
-
return instance
|
|
112
|
-
|
|
113
|
-
def to_json(self) -> str:
|
|
114
|
-
"""Returns the JSON representation of the actual instance"""
|
|
115
|
-
if self.actual_instance is None:
|
|
116
|
-
return "null"
|
|
117
|
-
|
|
118
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
119
|
-
return self.actual_instance.to_json()
|
|
120
|
-
else:
|
|
121
|
-
return json.dumps(self.actual_instance)
|
|
122
|
-
|
|
123
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], Errors, TweetFavoritersResponse]]:
|
|
124
|
-
"""Returns the dict representation of the actual instance"""
|
|
125
|
-
if self.actual_instance is None:
|
|
126
|
-
return None
|
|
127
|
-
|
|
128
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
129
|
-
return self.actual_instance.to_dict()
|
|
130
|
-
else:
|
|
131
|
-
# primitive type
|
|
132
|
-
return self.actual_instance
|
|
133
|
-
|
|
134
|
-
def to_str(self) -> str:
|
|
135
|
-
"""Returns the string representation of the actual instance"""
|
|
136
|
-
return pprint.pformat(self.model_dump())
|
|
137
|
-
|
|
138
|
-
|
|
@@ -1,138 +0,0 @@
|
|
|
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 json
|
|
18
|
-
import pprint
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
-
from typing import Any, List, Optional
|
|
21
|
-
from twitter_openapi_python_generated.models.errors import Errors
|
|
22
|
-
from twitter_openapi_python_generated.models.follow_response import FollowResponse
|
|
23
|
-
from pydantic import StrictStr, Field
|
|
24
|
-
from typing import Union, List, Set, Optional, Dict
|
|
25
|
-
from typing_extensions import Literal, Self
|
|
26
|
-
|
|
27
|
-
GETFOLLOWERS200RESPONSE_ONE_OF_SCHEMAS = ["Errors", "FollowResponse"]
|
|
28
|
-
|
|
29
|
-
class GetFollowers200Response(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
GetFollowers200Response
|
|
32
|
-
"""
|
|
33
|
-
# data type: FollowResponse
|
|
34
|
-
oneof_schema_1_validator: Optional[FollowResponse] = None
|
|
35
|
-
# data type: Errors
|
|
36
|
-
oneof_schema_2_validator: Optional[Errors] = None
|
|
37
|
-
actual_instance: Optional[Union[Errors, FollowResponse]] = None
|
|
38
|
-
one_of_schemas: Set[str] = { "Errors", "FollowResponse" }
|
|
39
|
-
|
|
40
|
-
model_config = ConfigDict(
|
|
41
|
-
validate_assignment=True,
|
|
42
|
-
protected_namespaces=(),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
47
|
-
if args:
|
|
48
|
-
if len(args) > 1:
|
|
49
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
50
|
-
if kwargs:
|
|
51
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
52
|
-
super().__init__(actual_instance=args[0])
|
|
53
|
-
else:
|
|
54
|
-
super().__init__(**kwargs)
|
|
55
|
-
|
|
56
|
-
@field_validator('actual_instance')
|
|
57
|
-
def actual_instance_must_validate_oneof(cls, v):
|
|
58
|
-
instance = GetFollowers200Response.model_construct()
|
|
59
|
-
error_messages = []
|
|
60
|
-
match = 0
|
|
61
|
-
# validate data type: FollowResponse
|
|
62
|
-
if not isinstance(v, FollowResponse):
|
|
63
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `FollowResponse`")
|
|
64
|
-
else:
|
|
65
|
-
match += 1
|
|
66
|
-
# validate data type: Errors
|
|
67
|
-
if not isinstance(v, Errors):
|
|
68
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `Errors`")
|
|
69
|
-
else:
|
|
70
|
-
match += 1
|
|
71
|
-
if match > 1:
|
|
72
|
-
# more than 1 match
|
|
73
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in GetFollowers200Response with oneOf schemas: Errors, FollowResponse. Details: " + ", ".join(error_messages))
|
|
74
|
-
elif match == 0:
|
|
75
|
-
# no match
|
|
76
|
-
raise ValueError("No match found when setting `actual_instance` in GetFollowers200Response with oneOf schemas: Errors, FollowResponse. Details: " + ", ".join(error_messages))
|
|
77
|
-
else:
|
|
78
|
-
return v
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
82
|
-
return cls.from_json(json.dumps(obj))
|
|
83
|
-
|
|
84
|
-
@classmethod
|
|
85
|
-
def from_json(cls, json_str: str) -> Self:
|
|
86
|
-
"""Returns the object represented by the json string"""
|
|
87
|
-
instance = cls.model_construct()
|
|
88
|
-
error_messages = []
|
|
89
|
-
match = 0
|
|
90
|
-
|
|
91
|
-
# deserialize data into FollowResponse
|
|
92
|
-
try:
|
|
93
|
-
instance.actual_instance = FollowResponse.from_json(json_str)
|
|
94
|
-
match += 1
|
|
95
|
-
except (ValidationError, ValueError) as e:
|
|
96
|
-
error_messages.append(str(e))
|
|
97
|
-
# deserialize data into Errors
|
|
98
|
-
try:
|
|
99
|
-
instance.actual_instance = Errors.from_json(json_str)
|
|
100
|
-
match += 1
|
|
101
|
-
except (ValidationError, ValueError) as e:
|
|
102
|
-
error_messages.append(str(e))
|
|
103
|
-
|
|
104
|
-
if match > 1:
|
|
105
|
-
# more than 1 match
|
|
106
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into GetFollowers200Response with oneOf schemas: Errors, FollowResponse. Details: " + ", ".join(error_messages))
|
|
107
|
-
elif match == 0:
|
|
108
|
-
# no match
|
|
109
|
-
raise ValueError("No match found when deserializing the JSON string into GetFollowers200Response with oneOf schemas: Errors, FollowResponse. Details: " + ", ".join(error_messages))
|
|
110
|
-
else:
|
|
111
|
-
return instance
|
|
112
|
-
|
|
113
|
-
def to_json(self) -> str:
|
|
114
|
-
"""Returns the JSON representation of the actual instance"""
|
|
115
|
-
if self.actual_instance is None:
|
|
116
|
-
return "null"
|
|
117
|
-
|
|
118
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
119
|
-
return self.actual_instance.to_json()
|
|
120
|
-
else:
|
|
121
|
-
return json.dumps(self.actual_instance)
|
|
122
|
-
|
|
123
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], Errors, FollowResponse]]:
|
|
124
|
-
"""Returns the dict representation of the actual instance"""
|
|
125
|
-
if self.actual_instance is None:
|
|
126
|
-
return None
|
|
127
|
-
|
|
128
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
129
|
-
return self.actual_instance.to_dict()
|
|
130
|
-
else:
|
|
131
|
-
# primitive type
|
|
132
|
-
return self.actual_instance
|
|
133
|
-
|
|
134
|
-
def to_str(self) -> str:
|
|
135
|
-
"""Returns the string representation of the actual instance"""
|
|
136
|
-
return pprint.pformat(self.model_dump())
|
|
137
|
-
|
|
138
|
-
|
|
@@ -1,138 +0,0 @@
|
|
|
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 json
|
|
18
|
-
import pprint
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
-
from typing import Any, List, Optional
|
|
21
|
-
from twitter_openapi_python_generated.models.errors import Errors
|
|
22
|
-
from twitter_openapi_python_generated.models.timeline_response import TimelineResponse
|
|
23
|
-
from pydantic import StrictStr, Field
|
|
24
|
-
from typing import Union, List, Set, Optional, Dict
|
|
25
|
-
from typing_extensions import Literal, Self
|
|
26
|
-
|
|
27
|
-
GETHOMELATESTTIMELINE200RESPONSE_ONE_OF_SCHEMAS = ["Errors", "TimelineResponse"]
|
|
28
|
-
|
|
29
|
-
class GetHomeLatestTimeline200Response(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
GetHomeLatestTimeline200Response
|
|
32
|
-
"""
|
|
33
|
-
# data type: TimelineResponse
|
|
34
|
-
oneof_schema_1_validator: Optional[TimelineResponse] = None
|
|
35
|
-
# data type: Errors
|
|
36
|
-
oneof_schema_2_validator: Optional[Errors] = None
|
|
37
|
-
actual_instance: Optional[Union[Errors, TimelineResponse]] = None
|
|
38
|
-
one_of_schemas: Set[str] = { "Errors", "TimelineResponse" }
|
|
39
|
-
|
|
40
|
-
model_config = ConfigDict(
|
|
41
|
-
validate_assignment=True,
|
|
42
|
-
protected_namespaces=(),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
47
|
-
if args:
|
|
48
|
-
if len(args) > 1:
|
|
49
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
50
|
-
if kwargs:
|
|
51
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
52
|
-
super().__init__(actual_instance=args[0])
|
|
53
|
-
else:
|
|
54
|
-
super().__init__(**kwargs)
|
|
55
|
-
|
|
56
|
-
@field_validator('actual_instance')
|
|
57
|
-
def actual_instance_must_validate_oneof(cls, v):
|
|
58
|
-
instance = GetHomeLatestTimeline200Response.model_construct()
|
|
59
|
-
error_messages = []
|
|
60
|
-
match = 0
|
|
61
|
-
# validate data type: TimelineResponse
|
|
62
|
-
if not isinstance(v, TimelineResponse):
|
|
63
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `TimelineResponse`")
|
|
64
|
-
else:
|
|
65
|
-
match += 1
|
|
66
|
-
# validate data type: Errors
|
|
67
|
-
if not isinstance(v, Errors):
|
|
68
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `Errors`")
|
|
69
|
-
else:
|
|
70
|
-
match += 1
|
|
71
|
-
if match > 1:
|
|
72
|
-
# more than 1 match
|
|
73
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in GetHomeLatestTimeline200Response with oneOf schemas: Errors, TimelineResponse. Details: " + ", ".join(error_messages))
|
|
74
|
-
elif match == 0:
|
|
75
|
-
# no match
|
|
76
|
-
raise ValueError("No match found when setting `actual_instance` in GetHomeLatestTimeline200Response with oneOf schemas: Errors, TimelineResponse. Details: " + ", ".join(error_messages))
|
|
77
|
-
else:
|
|
78
|
-
return v
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
82
|
-
return cls.from_json(json.dumps(obj))
|
|
83
|
-
|
|
84
|
-
@classmethod
|
|
85
|
-
def from_json(cls, json_str: str) -> Self:
|
|
86
|
-
"""Returns the object represented by the json string"""
|
|
87
|
-
instance = cls.model_construct()
|
|
88
|
-
error_messages = []
|
|
89
|
-
match = 0
|
|
90
|
-
|
|
91
|
-
# deserialize data into TimelineResponse
|
|
92
|
-
try:
|
|
93
|
-
instance.actual_instance = TimelineResponse.from_json(json_str)
|
|
94
|
-
match += 1
|
|
95
|
-
except (ValidationError, ValueError) as e:
|
|
96
|
-
error_messages.append(str(e))
|
|
97
|
-
# deserialize data into Errors
|
|
98
|
-
try:
|
|
99
|
-
instance.actual_instance = Errors.from_json(json_str)
|
|
100
|
-
match += 1
|
|
101
|
-
except (ValidationError, ValueError) as e:
|
|
102
|
-
error_messages.append(str(e))
|
|
103
|
-
|
|
104
|
-
if match > 1:
|
|
105
|
-
# more than 1 match
|
|
106
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into GetHomeLatestTimeline200Response with oneOf schemas: Errors, TimelineResponse. Details: " + ", ".join(error_messages))
|
|
107
|
-
elif match == 0:
|
|
108
|
-
# no match
|
|
109
|
-
raise ValueError("No match found when deserializing the JSON string into GetHomeLatestTimeline200Response with oneOf schemas: Errors, TimelineResponse. Details: " + ", ".join(error_messages))
|
|
110
|
-
else:
|
|
111
|
-
return instance
|
|
112
|
-
|
|
113
|
-
def to_json(self) -> str:
|
|
114
|
-
"""Returns the JSON representation of the actual instance"""
|
|
115
|
-
if self.actual_instance is None:
|
|
116
|
-
return "null"
|
|
117
|
-
|
|
118
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
119
|
-
return self.actual_instance.to_json()
|
|
120
|
-
else:
|
|
121
|
-
return json.dumps(self.actual_instance)
|
|
122
|
-
|
|
123
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], Errors, TimelineResponse]]:
|
|
124
|
-
"""Returns the dict representation of the actual instance"""
|
|
125
|
-
if self.actual_instance is None:
|
|
126
|
-
return None
|
|
127
|
-
|
|
128
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
129
|
-
return self.actual_instance.to_dict()
|
|
130
|
-
else:
|
|
131
|
-
# primitive type
|
|
132
|
-
return self.actual_instance
|
|
133
|
-
|
|
134
|
-
def to_str(self) -> str:
|
|
135
|
-
"""Returns the string representation of the actual instance"""
|
|
136
|
-
return pprint.pformat(self.model_dump())
|
|
137
|
-
|
|
138
|
-
|
|
@@ -1,138 +0,0 @@
|
|
|
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 json
|
|
18
|
-
import pprint
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
-
from typing import Any, List, Optional
|
|
21
|
-
from twitter_openapi_python_generated.models.errors import Errors
|
|
22
|
-
from twitter_openapi_python_generated.models.user_tweets_response import UserTweetsResponse
|
|
23
|
-
from pydantic import StrictStr, Field
|
|
24
|
-
from typing import Union, List, Set, Optional, Dict
|
|
25
|
-
from typing_extensions import Literal, Self
|
|
26
|
-
|
|
27
|
-
GETLIKES200RESPONSE_ONE_OF_SCHEMAS = ["Errors", "UserTweetsResponse"]
|
|
28
|
-
|
|
29
|
-
class GetLikes200Response(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
GetLikes200Response
|
|
32
|
-
"""
|
|
33
|
-
# data type: UserTweetsResponse
|
|
34
|
-
oneof_schema_1_validator: Optional[UserTweetsResponse] = None
|
|
35
|
-
# data type: Errors
|
|
36
|
-
oneof_schema_2_validator: Optional[Errors] = None
|
|
37
|
-
actual_instance: Optional[Union[Errors, UserTweetsResponse]] = None
|
|
38
|
-
one_of_schemas: Set[str] = { "Errors", "UserTweetsResponse" }
|
|
39
|
-
|
|
40
|
-
model_config = ConfigDict(
|
|
41
|
-
validate_assignment=True,
|
|
42
|
-
protected_namespaces=(),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
47
|
-
if args:
|
|
48
|
-
if len(args) > 1:
|
|
49
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
50
|
-
if kwargs:
|
|
51
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
52
|
-
super().__init__(actual_instance=args[0])
|
|
53
|
-
else:
|
|
54
|
-
super().__init__(**kwargs)
|
|
55
|
-
|
|
56
|
-
@field_validator('actual_instance')
|
|
57
|
-
def actual_instance_must_validate_oneof(cls, v):
|
|
58
|
-
instance = GetLikes200Response.model_construct()
|
|
59
|
-
error_messages = []
|
|
60
|
-
match = 0
|
|
61
|
-
# validate data type: UserTweetsResponse
|
|
62
|
-
if not isinstance(v, UserTweetsResponse):
|
|
63
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `UserTweetsResponse`")
|
|
64
|
-
else:
|
|
65
|
-
match += 1
|
|
66
|
-
# validate data type: Errors
|
|
67
|
-
if not isinstance(v, Errors):
|
|
68
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `Errors`")
|
|
69
|
-
else:
|
|
70
|
-
match += 1
|
|
71
|
-
if match > 1:
|
|
72
|
-
# more than 1 match
|
|
73
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in GetLikes200Response with oneOf schemas: Errors, UserTweetsResponse. Details: " + ", ".join(error_messages))
|
|
74
|
-
elif match == 0:
|
|
75
|
-
# no match
|
|
76
|
-
raise ValueError("No match found when setting `actual_instance` in GetLikes200Response with oneOf schemas: Errors, UserTweetsResponse. Details: " + ", ".join(error_messages))
|
|
77
|
-
else:
|
|
78
|
-
return v
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
82
|
-
return cls.from_json(json.dumps(obj))
|
|
83
|
-
|
|
84
|
-
@classmethod
|
|
85
|
-
def from_json(cls, json_str: str) -> Self:
|
|
86
|
-
"""Returns the object represented by the json string"""
|
|
87
|
-
instance = cls.model_construct()
|
|
88
|
-
error_messages = []
|
|
89
|
-
match = 0
|
|
90
|
-
|
|
91
|
-
# deserialize data into UserTweetsResponse
|
|
92
|
-
try:
|
|
93
|
-
instance.actual_instance = UserTweetsResponse.from_json(json_str)
|
|
94
|
-
match += 1
|
|
95
|
-
except (ValidationError, ValueError) as e:
|
|
96
|
-
error_messages.append(str(e))
|
|
97
|
-
# deserialize data into Errors
|
|
98
|
-
try:
|
|
99
|
-
instance.actual_instance = Errors.from_json(json_str)
|
|
100
|
-
match += 1
|
|
101
|
-
except (ValidationError, ValueError) as e:
|
|
102
|
-
error_messages.append(str(e))
|
|
103
|
-
|
|
104
|
-
if match > 1:
|
|
105
|
-
# more than 1 match
|
|
106
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into GetLikes200Response with oneOf schemas: Errors, UserTweetsResponse. Details: " + ", ".join(error_messages))
|
|
107
|
-
elif match == 0:
|
|
108
|
-
# no match
|
|
109
|
-
raise ValueError("No match found when deserializing the JSON string into GetLikes200Response with oneOf schemas: Errors, UserTweetsResponse. Details: " + ", ".join(error_messages))
|
|
110
|
-
else:
|
|
111
|
-
return instance
|
|
112
|
-
|
|
113
|
-
def to_json(self) -> str:
|
|
114
|
-
"""Returns the JSON representation of the actual instance"""
|
|
115
|
-
if self.actual_instance is None:
|
|
116
|
-
return "null"
|
|
117
|
-
|
|
118
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
119
|
-
return self.actual_instance.to_json()
|
|
120
|
-
else:
|
|
121
|
-
return json.dumps(self.actual_instance)
|
|
122
|
-
|
|
123
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], Errors, UserTweetsResponse]]:
|
|
124
|
-
"""Returns the dict representation of the actual instance"""
|
|
125
|
-
if self.actual_instance is None:
|
|
126
|
-
return None
|
|
127
|
-
|
|
128
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
129
|
-
return self.actual_instance.to_dict()
|
|
130
|
-
else:
|
|
131
|
-
# primitive type
|
|
132
|
-
return self.actual_instance
|
|
133
|
-
|
|
134
|
-
def to_str(self) -> str:
|
|
135
|
-
"""Returns the string representation of the actual instance"""
|
|
136
|
-
return pprint.pformat(self.model_dump())
|
|
137
|
-
|
|
138
|
-
|
|
@@ -1,138 +0,0 @@
|
|
|
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 json
|
|
18
|
-
import pprint
|
|
19
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
20
|
-
from typing import Any, List, Optional
|
|
21
|
-
from twitter_openapi_python_generated.models.errors import Errors
|
|
22
|
-
from twitter_openapi_python_generated.models.list_latest_tweets_timeline_response import ListLatestTweetsTimelineResponse
|
|
23
|
-
from pydantic import StrictStr, Field
|
|
24
|
-
from typing import Union, List, Set, Optional, Dict
|
|
25
|
-
from typing_extensions import Literal, Self
|
|
26
|
-
|
|
27
|
-
GETLISTLATESTTWEETSTIMELINE200RESPONSE_ONE_OF_SCHEMAS = ["Errors", "ListLatestTweetsTimelineResponse"]
|
|
28
|
-
|
|
29
|
-
class GetListLatestTweetsTimeline200Response(BaseModel):
|
|
30
|
-
"""
|
|
31
|
-
GetListLatestTweetsTimeline200Response
|
|
32
|
-
"""
|
|
33
|
-
# data type: ListLatestTweetsTimelineResponse
|
|
34
|
-
oneof_schema_1_validator: Optional[ListLatestTweetsTimelineResponse] = None
|
|
35
|
-
# data type: Errors
|
|
36
|
-
oneof_schema_2_validator: Optional[Errors] = None
|
|
37
|
-
actual_instance: Optional[Union[Errors, ListLatestTweetsTimelineResponse]] = None
|
|
38
|
-
one_of_schemas: Set[str] = { "Errors", "ListLatestTweetsTimelineResponse" }
|
|
39
|
-
|
|
40
|
-
model_config = ConfigDict(
|
|
41
|
-
validate_assignment=True,
|
|
42
|
-
protected_namespaces=(),
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
def __init__(self, *args, **kwargs) -> None:
|
|
47
|
-
if args:
|
|
48
|
-
if len(args) > 1:
|
|
49
|
-
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
50
|
-
if kwargs:
|
|
51
|
-
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
52
|
-
super().__init__(actual_instance=args[0])
|
|
53
|
-
else:
|
|
54
|
-
super().__init__(**kwargs)
|
|
55
|
-
|
|
56
|
-
@field_validator('actual_instance')
|
|
57
|
-
def actual_instance_must_validate_oneof(cls, v):
|
|
58
|
-
instance = GetListLatestTweetsTimeline200Response.model_construct()
|
|
59
|
-
error_messages = []
|
|
60
|
-
match = 0
|
|
61
|
-
# validate data type: ListLatestTweetsTimelineResponse
|
|
62
|
-
if not isinstance(v, ListLatestTweetsTimelineResponse):
|
|
63
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `ListLatestTweetsTimelineResponse`")
|
|
64
|
-
else:
|
|
65
|
-
match += 1
|
|
66
|
-
# validate data type: Errors
|
|
67
|
-
if not isinstance(v, Errors):
|
|
68
|
-
error_messages.append(f"Error! Input type `{type(v)}` is not `Errors`")
|
|
69
|
-
else:
|
|
70
|
-
match += 1
|
|
71
|
-
if match > 1:
|
|
72
|
-
# more than 1 match
|
|
73
|
-
raise ValueError("Multiple matches found when setting `actual_instance` in GetListLatestTweetsTimeline200Response with oneOf schemas: Errors, ListLatestTweetsTimelineResponse. Details: " + ", ".join(error_messages))
|
|
74
|
-
elif match == 0:
|
|
75
|
-
# no match
|
|
76
|
-
raise ValueError("No match found when setting `actual_instance` in GetListLatestTweetsTimeline200Response with oneOf schemas: Errors, ListLatestTweetsTimelineResponse. Details: " + ", ".join(error_messages))
|
|
77
|
-
else:
|
|
78
|
-
return v
|
|
79
|
-
|
|
80
|
-
@classmethod
|
|
81
|
-
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
82
|
-
return cls.from_json(json.dumps(obj))
|
|
83
|
-
|
|
84
|
-
@classmethod
|
|
85
|
-
def from_json(cls, json_str: str) -> Self:
|
|
86
|
-
"""Returns the object represented by the json string"""
|
|
87
|
-
instance = cls.model_construct()
|
|
88
|
-
error_messages = []
|
|
89
|
-
match = 0
|
|
90
|
-
|
|
91
|
-
# deserialize data into ListLatestTweetsTimelineResponse
|
|
92
|
-
try:
|
|
93
|
-
instance.actual_instance = ListLatestTweetsTimelineResponse.from_json(json_str)
|
|
94
|
-
match += 1
|
|
95
|
-
except (ValidationError, ValueError) as e:
|
|
96
|
-
error_messages.append(str(e))
|
|
97
|
-
# deserialize data into Errors
|
|
98
|
-
try:
|
|
99
|
-
instance.actual_instance = Errors.from_json(json_str)
|
|
100
|
-
match += 1
|
|
101
|
-
except (ValidationError, ValueError) as e:
|
|
102
|
-
error_messages.append(str(e))
|
|
103
|
-
|
|
104
|
-
if match > 1:
|
|
105
|
-
# more than 1 match
|
|
106
|
-
raise ValueError("Multiple matches found when deserializing the JSON string into GetListLatestTweetsTimeline200Response with oneOf schemas: Errors, ListLatestTweetsTimelineResponse. Details: " + ", ".join(error_messages))
|
|
107
|
-
elif match == 0:
|
|
108
|
-
# no match
|
|
109
|
-
raise ValueError("No match found when deserializing the JSON string into GetListLatestTweetsTimeline200Response with oneOf schemas: Errors, ListLatestTweetsTimelineResponse. Details: " + ", ".join(error_messages))
|
|
110
|
-
else:
|
|
111
|
-
return instance
|
|
112
|
-
|
|
113
|
-
def to_json(self) -> str:
|
|
114
|
-
"""Returns the JSON representation of the actual instance"""
|
|
115
|
-
if self.actual_instance is None:
|
|
116
|
-
return "null"
|
|
117
|
-
|
|
118
|
-
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
119
|
-
return self.actual_instance.to_json()
|
|
120
|
-
else:
|
|
121
|
-
return json.dumps(self.actual_instance)
|
|
122
|
-
|
|
123
|
-
def to_dict(self) -> Optional[Union[Dict[str, Any], Errors, ListLatestTweetsTimelineResponse]]:
|
|
124
|
-
"""Returns the dict representation of the actual instance"""
|
|
125
|
-
if self.actual_instance is None:
|
|
126
|
-
return None
|
|
127
|
-
|
|
128
|
-
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
129
|
-
return self.actual_instance.to_dict()
|
|
130
|
-
else:
|
|
131
|
-
# primitive type
|
|
132
|
-
return self.actual_instance
|
|
133
|
-
|
|
134
|
-
def to_str(self) -> str:
|
|
135
|
-
"""Returns the string representation of the actual instance"""
|
|
136
|
-
return pprint.pformat(self.model_dump())
|
|
137
|
-
|
|
138
|
-
|