nadeshiko-sdk 0.1.0__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.
- nadeshiko/__init__.py +10 -0
- nadeshiko/_version.py +1 -0
- nadeshiko/api/__init__.py +1 -0
- nadeshiko/api/auth/__init__.py +3 -0
- nadeshiko/api/auth/internal/__init__.py +11 -0
- nadeshiko/api/auth/internal/get_discord_auth_url.py +176 -0
- nadeshiko/api/auth/internal/login.py +213 -0
- nadeshiko/api/auth/internal/login_discord.py +204 -0
- nadeshiko/api/auth/internal/login_google.py +204 -0
- nadeshiko/api/auth/internal/register.py +212 -0
- nadeshiko/api/auth_jwt/__init__.py +3 -0
- nadeshiko/api/auth_jwt/internal/__init__.py +7 -0
- nadeshiko/api/auth_jwt/internal/logout.py +151 -0
- nadeshiko/api/lists/__init__.py +8 -0
- nadeshiko/api/lists/internal/__init__.py +12 -0
- nadeshiko/api/lists/internal/list_add_item.py +215 -0
- nadeshiko/api/lists/internal/list_create.py +194 -0
- nadeshiko/api/lists/internal/list_destroy.py +193 -0
- nadeshiko/api/lists/internal/list_remove_item.py +207 -0
- nadeshiko/api/lists/internal/list_update.py +215 -0
- nadeshiko/api/lists/internal/list_update_item.py +229 -0
- nadeshiko/api/lists/list_index.py +257 -0
- nadeshiko/api/lists/list_show.py +193 -0
- nadeshiko/api/media/__init__.py +14 -0
- nadeshiko/api/media/character_show.py +193 -0
- nadeshiko/api/media/episode_index.py +229 -0
- nadeshiko/api/media/episode_show.py +207 -0
- nadeshiko/api/media/internal/__init__.py +16 -0
- nadeshiko/api/media/internal/episode_create.py +215 -0
- nadeshiko/api/media/internal/episode_destroy.py +205 -0
- nadeshiko/api/media/internal/episode_update.py +229 -0
- nadeshiko/api/media/internal/media_create.py +194 -0
- nadeshiko/api/media/internal/media_destroy.py +197 -0
- nadeshiko/api/media/internal/media_update.py +219 -0
- nadeshiko/api/media/internal/segment_create.py +229 -0
- nadeshiko/api/media/internal/segment_destroy.py +219 -0
- nadeshiko/api/media/internal/segment_index.py +243 -0
- nadeshiko/api/media/internal/segment_update.py +243 -0
- nadeshiko/api/media/media_index.py +232 -0
- nadeshiko/api/media/media_show.py +193 -0
- nadeshiko/api/media/segment_show.py +221 -0
- nadeshiko/api/media/segment_show_by_uuid.py +193 -0
- nadeshiko/api/media/seiyuu_show.py +193 -0
- nadeshiko/api/search/__init__.py +11 -0
- nadeshiko/api/search/fetch_media_info.py +278 -0
- nadeshiko/api/search/fetch_sentence_context.py +219 -0
- nadeshiko/api/search/internal/__init__.py +6 -0
- nadeshiko/api/search/search.py +295 -0
- nadeshiko/api/search/search_health_check.py +168 -0
- nadeshiko/api/search/search_multiple.py +238 -0
- nadeshiko/api/user/__init__.py +3 -0
- nadeshiko/api/user/internal/__init__.py +11 -0
- nadeshiko/api/user/internal/create_api_key.py +199 -0
- nadeshiko/api/user/internal/deactivate_api_key.py +194 -0
- nadeshiko/api/user/internal/get_api_keys.py +151 -0
- nadeshiko/api/user/internal/get_identity_me.py +156 -0
- nadeshiko/api/user/internal/get_user_info.py +156 -0
- nadeshiko/client.py +138 -0
- nadeshiko/errors.py +16 -0
- nadeshiko/models/__init__.py +215 -0
- nadeshiko/models/api_key.py +118 -0
- nadeshiko/models/api_key_permission.py +70 -0
- nadeshiko/models/auth_user.py +107 -0
- nadeshiko/models/basic_info.py +132 -0
- nadeshiko/models/category_statistic.py +71 -0
- nadeshiko/models/character.py +100 -0
- nadeshiko/models/character_input.py +130 -0
- nadeshiko/models/character_input_character_role.py +10 -0
- nadeshiko/models/character_with_media.py +124 -0
- nadeshiko/models/character_with_media_media_appearances_item.py +93 -0
- nadeshiko/models/character_with_media_media_appearances_item_role.py +10 -0
- nadeshiko/models/create_api_key_request.py +75 -0
- nadeshiko/models/create_api_key_response.py +70 -0
- nadeshiko/models/deactivate_api_key_request.py +62 -0
- nadeshiko/models/deactivate_api_key_response.py +62 -0
- nadeshiko/models/discord_auth_url_response.py +62 -0
- nadeshiko/models/discord_login_request.py +62 -0
- nadeshiko/models/episode.py +253 -0
- nadeshiko/models/episode_create_request.py +145 -0
- nadeshiko/models/episode_list_response.py +94 -0
- nadeshiko/models/episode_update_request.py +135 -0
- nadeshiko/models/error.py +128 -0
- nadeshiko/models/error_errors.py +46 -0
- nadeshiko/models/fetch_media_info_response.py +115 -0
- nadeshiko/models/fetch_media_info_type.py +10 -0
- nadeshiko/models/fetch_sentence_context_request.py +96 -0
- nadeshiko/models/fetch_sentence_context_response.py +75 -0
- nadeshiko/models/get_api_keys_response.py +86 -0
- nadeshiko/models/google_login_request.py +62 -0
- nadeshiko/models/list_.py +97 -0
- nadeshiko/models/list_add_item_body.py +69 -0
- nadeshiko/models/list_add_item_response_201.py +61 -0
- nadeshiko/models/list_create_request.py +107 -0
- nadeshiko/models/list_create_request_type.py +9 -0
- nadeshiko/models/list_create_request_visibility.py +9 -0
- nadeshiko/models/list_destroy_response_200.py +70 -0
- nadeshiko/models/list_index_type.py +9 -0
- nadeshiko/models/list_index_visibility.py +9 -0
- nadeshiko/models/list_input.py +138 -0
- nadeshiko/models/list_input_list_type.py +9 -0
- nadeshiko/models/list_input_list_visibility.py +9 -0
- nadeshiko/models/list_remove_item_response_200.py +61 -0
- nadeshiko/models/list_type.py +9 -0
- nadeshiko/models/list_update_body.py +78 -0
- nadeshiko/models/list_update_body_visibility.py +9 -0
- nadeshiko/models/list_update_item_body.py +61 -0
- nadeshiko/models/list_update_item_response_200.py +61 -0
- nadeshiko/models/list_visibility.py +9 -0
- nadeshiko/models/list_with_media.py +119 -0
- nadeshiko/models/list_with_media_media_item.py +83 -0
- nadeshiko/models/list_with_media_type.py +9 -0
- nadeshiko/models/list_with_media_visibility.py +9 -0
- nadeshiko/models/login_request.py +70 -0
- nadeshiko/models/login_response.py +84 -0
- nadeshiko/models/logout_response.py +73 -0
- nadeshiko/models/media.py +288 -0
- nadeshiko/models/media_category.py +11 -0
- nadeshiko/models/media_character.py +78 -0
- nadeshiko/models/media_character_role.py +10 -0
- nadeshiko/models/media_create_request.py +270 -0
- nadeshiko/models/media_create_request_category.py +11 -0
- nadeshiko/models/media_destroy_response_200.py +70 -0
- nadeshiko/models/media_index_category.py +9 -0
- nadeshiko/models/media_info_data.py +307 -0
- nadeshiko/models/media_info_path.py +83 -0
- nadeshiko/models/media_info_stats.py +89 -0
- nadeshiko/models/media_list_response.py +94 -0
- nadeshiko/models/media_update_request.py +297 -0
- nadeshiko/models/media_update_request_category.py +9 -0
- nadeshiko/models/quota_info.py +87 -0
- nadeshiko/models/quota_info_quota_limit_type_1.py +8 -0
- nadeshiko/models/register_request.py +78 -0
- nadeshiko/models/register_response.py +76 -0
- nadeshiko/models/register_response_user.py +46 -0
- nadeshiko/models/search_health_check_response.py +138 -0
- nadeshiko/models/search_multiple_request.py +72 -0
- nadeshiko/models/search_multiple_response.py +79 -0
- nadeshiko/models/search_request.py +253 -0
- nadeshiko/models/search_request_content_sort.py +13 -0
- nadeshiko/models/search_request_media_item.py +85 -0
- nadeshiko/models/search_request_media_item_seasons_item.py +69 -0
- nadeshiko/models/search_response.py +158 -0
- nadeshiko/models/segment.py +303 -0
- nadeshiko/models/segment_create_request.py +203 -0
- nadeshiko/models/segment_create_request_status.py +13 -0
- nadeshiko/models/segment_info.py +207 -0
- nadeshiko/models/segment_list_response.py +94 -0
- nadeshiko/models/segment_status.py +13 -0
- nadeshiko/models/segment_update_request.py +198 -0
- nadeshiko/models/segment_update_request_status.py +13 -0
- nadeshiko/models/seiyuu.py +86 -0
- nadeshiko/models/seiyuu_with_roles.py +108 -0
- nadeshiko/models/seiyuu_with_roles_roles_item.py +109 -0
- nadeshiko/models/seiyuu_with_roles_roles_item_role.py +10 -0
- nadeshiko/models/sentence.py +88 -0
- nadeshiko/models/statistic.py +132 -0
- nadeshiko/models/statistic_season_with_episode_hits.py +74 -0
- nadeshiko/models/statistic_season_with_episode_hits_additional_property.py +46 -0
- nadeshiko/models/user_info_response.py +79 -0
- nadeshiko/models/user_info_response_user.py +91 -0
- nadeshiko/models/user_role.py +71 -0
- nadeshiko/models/word_match.py +107 -0
- nadeshiko/models/word_match_media.py +98 -0
- nadeshiko/types.py +54 -0
- nadeshiko_sdk-0.1.0.dist-info/METADATA +147 -0
- nadeshiko_sdk-0.1.0.dist-info/RECORD +167 -0
- nadeshiko_sdk-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
5
|
+
from uuid import UUID
|
|
6
|
+
|
|
7
|
+
from attrs import define as _attrs_define
|
|
8
|
+
from attrs import field as _attrs_field
|
|
9
|
+
|
|
10
|
+
from ..models.search_request_content_sort import SearchRequestContentSort
|
|
11
|
+
from ..types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.search_request_media_item import SearchRequestMediaItem
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="SearchRequest")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class SearchRequest:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
query (str | Unset): Text or sentence to search (null to search without query) Example: 彼女.
|
|
25
|
+
limit (int | Unset): Max amount of entries by response Default: 10.
|
|
26
|
+
uuid (UUID | Unset): Unique ID from sentence (Useful to get a specific sentence) Example: 3fd94cef-a3e1-31ae-
|
|
27
|
+
bc8d-e743f03e9c7e.
|
|
28
|
+
category (list[int] | Unset): Media category filter (1=Anime, 2=Unknown, 3=J-Drama, 4=Audiobook)
|
|
29
|
+
anime_id (int | Unset): Unique ID from media Example: 5.
|
|
30
|
+
season (list[int] | Unset): Array of seasons to get Example: [1].
|
|
31
|
+
episode (list[int] | Unset): Array of episodes to get Example: [5, 8].
|
|
32
|
+
random_seed (float | Unset): A value from 0 to 1 for random sorting Example: 0.5.
|
|
33
|
+
content_sort (SearchRequestContentSort | Unset): Order by amount of characters Default:
|
|
34
|
+
SearchRequestContentSort.NONE. Example: none.
|
|
35
|
+
cursor (list[float] | Unset): Current page of search Example: [23.31727, 7].
|
|
36
|
+
exact_match (bool | Unset): Whether to use exact phrase matching Default: False.
|
|
37
|
+
extra (bool | Unset): Include extra content Default: False.
|
|
38
|
+
min_length (int | Unset): Minimum content length Example: 10.
|
|
39
|
+
max_length (int | Unset): Maximum content length Example: 50.
|
|
40
|
+
excluded_anime_ids (list[int] | Unset): Anime IDs to exclude from results
|
|
41
|
+
status (list[int] | Unset): Segment status filter
|
|
42
|
+
media (list[SearchRequestMediaItem] | Unset): Media filter with seasons and episodes
|
|
43
|
+
"""
|
|
44
|
+
|
|
45
|
+
query: str | Unset = UNSET
|
|
46
|
+
limit: int | Unset = 10
|
|
47
|
+
uuid: UUID | Unset = UNSET
|
|
48
|
+
category: list[int] | Unset = UNSET
|
|
49
|
+
anime_id: int | Unset = UNSET
|
|
50
|
+
season: list[int] | Unset = UNSET
|
|
51
|
+
episode: list[int] | Unset = UNSET
|
|
52
|
+
random_seed: float | Unset = UNSET
|
|
53
|
+
content_sort: SearchRequestContentSort | Unset = SearchRequestContentSort.NONE
|
|
54
|
+
cursor: list[float] | Unset = UNSET
|
|
55
|
+
exact_match: bool | Unset = False
|
|
56
|
+
extra: bool | Unset = False
|
|
57
|
+
min_length: int | Unset = UNSET
|
|
58
|
+
max_length: int | Unset = UNSET
|
|
59
|
+
excluded_anime_ids: list[int] | Unset = UNSET
|
|
60
|
+
status: list[int] | Unset = UNSET
|
|
61
|
+
media: list[SearchRequestMediaItem] | Unset = UNSET
|
|
62
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
63
|
+
|
|
64
|
+
def to_dict(self) -> dict[str, Any]:
|
|
65
|
+
query = self.query
|
|
66
|
+
|
|
67
|
+
limit = self.limit
|
|
68
|
+
|
|
69
|
+
uuid: str | Unset = UNSET
|
|
70
|
+
if not isinstance(self.uuid, Unset):
|
|
71
|
+
uuid = str(self.uuid)
|
|
72
|
+
|
|
73
|
+
category: list[int] | Unset = UNSET
|
|
74
|
+
if not isinstance(self.category, Unset):
|
|
75
|
+
category = self.category
|
|
76
|
+
|
|
77
|
+
anime_id = self.anime_id
|
|
78
|
+
|
|
79
|
+
season: list[int] | Unset = UNSET
|
|
80
|
+
if not isinstance(self.season, Unset):
|
|
81
|
+
season = self.season
|
|
82
|
+
|
|
83
|
+
episode: list[int] | Unset = UNSET
|
|
84
|
+
if not isinstance(self.episode, Unset):
|
|
85
|
+
episode = self.episode
|
|
86
|
+
|
|
87
|
+
random_seed = self.random_seed
|
|
88
|
+
|
|
89
|
+
content_sort: str | Unset = UNSET
|
|
90
|
+
if not isinstance(self.content_sort, Unset):
|
|
91
|
+
content_sort = self.content_sort.value
|
|
92
|
+
|
|
93
|
+
cursor: list[float] | Unset = UNSET
|
|
94
|
+
if not isinstance(self.cursor, Unset):
|
|
95
|
+
cursor = self.cursor
|
|
96
|
+
|
|
97
|
+
exact_match = self.exact_match
|
|
98
|
+
|
|
99
|
+
extra = self.extra
|
|
100
|
+
|
|
101
|
+
min_length = self.min_length
|
|
102
|
+
|
|
103
|
+
max_length = self.max_length
|
|
104
|
+
|
|
105
|
+
excluded_anime_ids: list[int] | Unset = UNSET
|
|
106
|
+
if not isinstance(self.excluded_anime_ids, Unset):
|
|
107
|
+
excluded_anime_ids = self.excluded_anime_ids
|
|
108
|
+
|
|
109
|
+
status: list[int] | Unset = UNSET
|
|
110
|
+
if not isinstance(self.status, Unset):
|
|
111
|
+
status = self.status
|
|
112
|
+
|
|
113
|
+
media: list[dict[str, Any]] | Unset = UNSET
|
|
114
|
+
if not isinstance(self.media, Unset):
|
|
115
|
+
media = []
|
|
116
|
+
for media_item_data in self.media:
|
|
117
|
+
media_item = media_item_data.to_dict()
|
|
118
|
+
media.append(media_item)
|
|
119
|
+
|
|
120
|
+
field_dict: dict[str, Any] = {}
|
|
121
|
+
field_dict.update(self.additional_properties)
|
|
122
|
+
field_dict.update({})
|
|
123
|
+
if query is not UNSET:
|
|
124
|
+
field_dict["query"] = query
|
|
125
|
+
if limit is not UNSET:
|
|
126
|
+
field_dict["limit"] = limit
|
|
127
|
+
if uuid is not UNSET:
|
|
128
|
+
field_dict["uuid"] = uuid
|
|
129
|
+
if category is not UNSET:
|
|
130
|
+
field_dict["category"] = category
|
|
131
|
+
if anime_id is not UNSET:
|
|
132
|
+
field_dict["anime_id"] = anime_id
|
|
133
|
+
if season is not UNSET:
|
|
134
|
+
field_dict["season"] = season
|
|
135
|
+
if episode is not UNSET:
|
|
136
|
+
field_dict["episode"] = episode
|
|
137
|
+
if random_seed is not UNSET:
|
|
138
|
+
field_dict["random_seed"] = random_seed
|
|
139
|
+
if content_sort is not UNSET:
|
|
140
|
+
field_dict["content_sort"] = content_sort
|
|
141
|
+
if cursor is not UNSET:
|
|
142
|
+
field_dict["cursor"] = cursor
|
|
143
|
+
if exact_match is not UNSET:
|
|
144
|
+
field_dict["exact_match"] = exact_match
|
|
145
|
+
if extra is not UNSET:
|
|
146
|
+
field_dict["extra"] = extra
|
|
147
|
+
if min_length is not UNSET:
|
|
148
|
+
field_dict["min_length"] = min_length
|
|
149
|
+
if max_length is not UNSET:
|
|
150
|
+
field_dict["max_length"] = max_length
|
|
151
|
+
if excluded_anime_ids is not UNSET:
|
|
152
|
+
field_dict["excluded_anime_ids"] = excluded_anime_ids
|
|
153
|
+
if status is not UNSET:
|
|
154
|
+
field_dict["status"] = status
|
|
155
|
+
if media is not UNSET:
|
|
156
|
+
field_dict["media"] = media
|
|
157
|
+
|
|
158
|
+
return field_dict
|
|
159
|
+
|
|
160
|
+
@classmethod
|
|
161
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
162
|
+
from ..models.search_request_media_item import SearchRequestMediaItem
|
|
163
|
+
|
|
164
|
+
d = dict(src_dict)
|
|
165
|
+
query = d.pop("query", UNSET)
|
|
166
|
+
|
|
167
|
+
limit = d.pop("limit", UNSET)
|
|
168
|
+
|
|
169
|
+
_uuid = d.pop("uuid", UNSET)
|
|
170
|
+
uuid: UUID | Unset
|
|
171
|
+
if isinstance(_uuid, Unset):
|
|
172
|
+
uuid = UNSET
|
|
173
|
+
else:
|
|
174
|
+
uuid = UUID(_uuid)
|
|
175
|
+
|
|
176
|
+
category = cast(list[int], d.pop("category", UNSET))
|
|
177
|
+
|
|
178
|
+
anime_id = d.pop("anime_id", UNSET)
|
|
179
|
+
|
|
180
|
+
season = cast(list[int], d.pop("season", UNSET))
|
|
181
|
+
|
|
182
|
+
episode = cast(list[int], d.pop("episode", UNSET))
|
|
183
|
+
|
|
184
|
+
random_seed = d.pop("random_seed", UNSET)
|
|
185
|
+
|
|
186
|
+
_content_sort = d.pop("content_sort", UNSET)
|
|
187
|
+
content_sort: SearchRequestContentSort | Unset
|
|
188
|
+
if isinstance(_content_sort, Unset):
|
|
189
|
+
content_sort = UNSET
|
|
190
|
+
else:
|
|
191
|
+
content_sort = SearchRequestContentSort(_content_sort)
|
|
192
|
+
|
|
193
|
+
cursor = cast(list[float], d.pop("cursor", UNSET))
|
|
194
|
+
|
|
195
|
+
exact_match = d.pop("exact_match", UNSET)
|
|
196
|
+
|
|
197
|
+
extra = d.pop("extra", UNSET)
|
|
198
|
+
|
|
199
|
+
min_length = d.pop("min_length", UNSET)
|
|
200
|
+
|
|
201
|
+
max_length = d.pop("max_length", UNSET)
|
|
202
|
+
|
|
203
|
+
excluded_anime_ids = cast(list[int], d.pop("excluded_anime_ids", UNSET))
|
|
204
|
+
|
|
205
|
+
status = cast(list[int], d.pop("status", UNSET))
|
|
206
|
+
|
|
207
|
+
_media = d.pop("media", UNSET)
|
|
208
|
+
media: list[SearchRequestMediaItem] | Unset = UNSET
|
|
209
|
+
if _media is not UNSET:
|
|
210
|
+
media = []
|
|
211
|
+
for media_item_data in _media:
|
|
212
|
+
media_item = SearchRequestMediaItem.from_dict(media_item_data)
|
|
213
|
+
|
|
214
|
+
media.append(media_item)
|
|
215
|
+
|
|
216
|
+
search_request = cls(
|
|
217
|
+
query=query,
|
|
218
|
+
limit=limit,
|
|
219
|
+
uuid=uuid,
|
|
220
|
+
category=category,
|
|
221
|
+
anime_id=anime_id,
|
|
222
|
+
season=season,
|
|
223
|
+
episode=episode,
|
|
224
|
+
random_seed=random_seed,
|
|
225
|
+
content_sort=content_sort,
|
|
226
|
+
cursor=cursor,
|
|
227
|
+
exact_match=exact_match,
|
|
228
|
+
extra=extra,
|
|
229
|
+
min_length=min_length,
|
|
230
|
+
max_length=max_length,
|
|
231
|
+
excluded_anime_ids=excluded_anime_ids,
|
|
232
|
+
status=status,
|
|
233
|
+
media=media,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
search_request.additional_properties = d
|
|
237
|
+
return search_request
|
|
238
|
+
|
|
239
|
+
@property
|
|
240
|
+
def additional_keys(self) -> list[str]:
|
|
241
|
+
return list(self.additional_properties.keys())
|
|
242
|
+
|
|
243
|
+
def __getitem__(self, key: str) -> Any:
|
|
244
|
+
return self.additional_properties[key]
|
|
245
|
+
|
|
246
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
247
|
+
self.additional_properties[key] = value
|
|
248
|
+
|
|
249
|
+
def __delitem__(self, key: str) -> None:
|
|
250
|
+
del self.additional_properties[key]
|
|
251
|
+
|
|
252
|
+
def __contains__(self, key: str) -> bool:
|
|
253
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.search_request_media_item_seasons_item import SearchRequestMediaItemSeasonsItem
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="SearchRequestMediaItem")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class SearchRequestMediaItem:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
media_id (str): Example: 123.
|
|
21
|
+
seasons (list[SearchRequestMediaItemSeasonsItem]):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
media_id: str
|
|
25
|
+
seasons: list[SearchRequestMediaItemSeasonsItem]
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
media_id = self.media_id
|
|
30
|
+
|
|
31
|
+
seasons = []
|
|
32
|
+
for seasons_item_data in self.seasons:
|
|
33
|
+
seasons_item = seasons_item_data.to_dict()
|
|
34
|
+
seasons.append(seasons_item)
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update(
|
|
39
|
+
{
|
|
40
|
+
"media_id": media_id,
|
|
41
|
+
"seasons": seasons,
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
return field_dict
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
49
|
+
from ..models.search_request_media_item_seasons_item import (
|
|
50
|
+
SearchRequestMediaItemSeasonsItem,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
media_id = d.pop("media_id")
|
|
55
|
+
|
|
56
|
+
seasons = []
|
|
57
|
+
_seasons = d.pop("seasons")
|
|
58
|
+
for seasons_item_data in _seasons:
|
|
59
|
+
seasons_item = SearchRequestMediaItemSeasonsItem.from_dict(seasons_item_data)
|
|
60
|
+
|
|
61
|
+
seasons.append(seasons_item)
|
|
62
|
+
|
|
63
|
+
search_request_media_item = cls(
|
|
64
|
+
media_id=media_id,
|
|
65
|
+
seasons=seasons,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
search_request_media_item.additional_properties = d
|
|
69
|
+
return search_request_media_item
|
|
70
|
+
|
|
71
|
+
@property
|
|
72
|
+
def additional_keys(self) -> list[str]:
|
|
73
|
+
return list(self.additional_properties.keys())
|
|
74
|
+
|
|
75
|
+
def __getitem__(self, key: str) -> Any:
|
|
76
|
+
return self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
79
|
+
self.additional_properties[key] = value
|
|
80
|
+
|
|
81
|
+
def __delitem__(self, key: str) -> None:
|
|
82
|
+
del self.additional_properties[key]
|
|
83
|
+
|
|
84
|
+
def __contains__(self, key: str) -> bool:
|
|
85
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="SearchRequestMediaItemSeasonsItem")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class SearchRequestMediaItemSeasonsItem:
|
|
14
|
+
"""
|
|
15
|
+
Attributes:
|
|
16
|
+
season (float): Example: 1.
|
|
17
|
+
episodes (list[float]): Example: [1, 2].
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
season: float
|
|
21
|
+
episodes: list[float]
|
|
22
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
|
+
|
|
24
|
+
def to_dict(self) -> dict[str, Any]:
|
|
25
|
+
season = self.season
|
|
26
|
+
|
|
27
|
+
episodes = self.episodes
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"season": season,
|
|
34
|
+
"episodes": episodes,
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
return field_dict
|
|
39
|
+
|
|
40
|
+
@classmethod
|
|
41
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
42
|
+
d = dict(src_dict)
|
|
43
|
+
season = d.pop("season")
|
|
44
|
+
|
|
45
|
+
episodes = cast(list[float], d.pop("episodes"))
|
|
46
|
+
|
|
47
|
+
search_request_media_item_seasons_item = cls(
|
|
48
|
+
season=season,
|
|
49
|
+
episodes=episodes,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
search_request_media_item_seasons_item.additional_properties = d
|
|
53
|
+
return search_request_media_item_seasons_item
|
|
54
|
+
|
|
55
|
+
@property
|
|
56
|
+
def additional_keys(self) -> list[str]:
|
|
57
|
+
return list(self.additional_properties.keys())
|
|
58
|
+
|
|
59
|
+
def __getitem__(self, key: str) -> Any:
|
|
60
|
+
return self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
63
|
+
self.additional_properties[key] = value
|
|
64
|
+
|
|
65
|
+
def __delitem__(self, key: str) -> None:
|
|
66
|
+
del self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __contains__(self, key: str) -> bool:
|
|
69
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.category_statistic import CategoryStatistic
|
|
13
|
+
from ..models.sentence import Sentence
|
|
14
|
+
from ..models.statistic import Statistic
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="SearchResponse")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class SearchResponse:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
statistics (list[Statistic] | Unset):
|
|
25
|
+
category_statistics (list[CategoryStatistic] | Unset):
|
|
26
|
+
sentences (list[Sentence] | Unset):
|
|
27
|
+
cursor (list[float] | None | Unset): Cursor for pagination
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
statistics: list[Statistic] | Unset = UNSET
|
|
31
|
+
category_statistics: list[CategoryStatistic] | Unset = UNSET
|
|
32
|
+
sentences: list[Sentence] | Unset = UNSET
|
|
33
|
+
cursor: list[float] | None | Unset = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
statistics: list[dict[str, Any]] | Unset = UNSET
|
|
38
|
+
if not isinstance(self.statistics, Unset):
|
|
39
|
+
statistics = []
|
|
40
|
+
for statistics_item_data in self.statistics:
|
|
41
|
+
statistics_item = statistics_item_data.to_dict()
|
|
42
|
+
statistics.append(statistics_item)
|
|
43
|
+
|
|
44
|
+
category_statistics: list[dict[str, Any]] | Unset = UNSET
|
|
45
|
+
if not isinstance(self.category_statistics, Unset):
|
|
46
|
+
category_statistics = []
|
|
47
|
+
for category_statistics_item_data in self.category_statistics:
|
|
48
|
+
category_statistics_item = category_statistics_item_data.to_dict()
|
|
49
|
+
category_statistics.append(category_statistics_item)
|
|
50
|
+
|
|
51
|
+
sentences: list[dict[str, Any]] | Unset = UNSET
|
|
52
|
+
if not isinstance(self.sentences, Unset):
|
|
53
|
+
sentences = []
|
|
54
|
+
for sentences_item_data in self.sentences:
|
|
55
|
+
sentences_item = sentences_item_data.to_dict()
|
|
56
|
+
sentences.append(sentences_item)
|
|
57
|
+
|
|
58
|
+
cursor: list[float] | None | Unset
|
|
59
|
+
if isinstance(self.cursor, Unset):
|
|
60
|
+
cursor = UNSET
|
|
61
|
+
elif isinstance(self.cursor, list):
|
|
62
|
+
cursor = self.cursor
|
|
63
|
+
|
|
64
|
+
else:
|
|
65
|
+
cursor = self.cursor
|
|
66
|
+
|
|
67
|
+
field_dict: dict[str, Any] = {}
|
|
68
|
+
field_dict.update(self.additional_properties)
|
|
69
|
+
field_dict.update({})
|
|
70
|
+
if statistics is not UNSET:
|
|
71
|
+
field_dict["statistics"] = statistics
|
|
72
|
+
if category_statistics is not UNSET:
|
|
73
|
+
field_dict["categoryStatistics"] = category_statistics
|
|
74
|
+
if sentences is not UNSET:
|
|
75
|
+
field_dict["sentences"] = sentences
|
|
76
|
+
if cursor is not UNSET:
|
|
77
|
+
field_dict["cursor"] = cursor
|
|
78
|
+
|
|
79
|
+
return field_dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
83
|
+
from ..models.category_statistic import CategoryStatistic
|
|
84
|
+
from ..models.sentence import Sentence
|
|
85
|
+
from ..models.statistic import Statistic
|
|
86
|
+
|
|
87
|
+
d = dict(src_dict)
|
|
88
|
+
_statistics = d.pop("statistics", UNSET)
|
|
89
|
+
statistics: list[Statistic] | Unset = UNSET
|
|
90
|
+
if _statistics is not UNSET:
|
|
91
|
+
statistics = []
|
|
92
|
+
for statistics_item_data in _statistics:
|
|
93
|
+
statistics_item = Statistic.from_dict(statistics_item_data)
|
|
94
|
+
|
|
95
|
+
statistics.append(statistics_item)
|
|
96
|
+
|
|
97
|
+
_category_statistics = d.pop("categoryStatistics", UNSET)
|
|
98
|
+
category_statistics: list[CategoryStatistic] | Unset = UNSET
|
|
99
|
+
if _category_statistics is not UNSET:
|
|
100
|
+
category_statistics = []
|
|
101
|
+
for category_statistics_item_data in _category_statistics:
|
|
102
|
+
category_statistics_item = CategoryStatistic.from_dict(
|
|
103
|
+
category_statistics_item_data
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
category_statistics.append(category_statistics_item)
|
|
107
|
+
|
|
108
|
+
_sentences = d.pop("sentences", UNSET)
|
|
109
|
+
sentences: list[Sentence] | Unset = UNSET
|
|
110
|
+
if _sentences is not UNSET:
|
|
111
|
+
sentences = []
|
|
112
|
+
for sentences_item_data in _sentences:
|
|
113
|
+
sentences_item = Sentence.from_dict(sentences_item_data)
|
|
114
|
+
|
|
115
|
+
sentences.append(sentences_item)
|
|
116
|
+
|
|
117
|
+
def _parse_cursor(data: object) -> list[float] | None | Unset:
|
|
118
|
+
if data is None:
|
|
119
|
+
return data
|
|
120
|
+
if isinstance(data, Unset):
|
|
121
|
+
return data
|
|
122
|
+
try:
|
|
123
|
+
if not isinstance(data, list):
|
|
124
|
+
raise TypeError()
|
|
125
|
+
cursor_type_0 = cast(list[float], data)
|
|
126
|
+
|
|
127
|
+
return cursor_type_0
|
|
128
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
129
|
+
pass
|
|
130
|
+
return cast(list[float] | None | Unset, data)
|
|
131
|
+
|
|
132
|
+
cursor = _parse_cursor(d.pop("cursor", UNSET))
|
|
133
|
+
|
|
134
|
+
search_response = cls(
|
|
135
|
+
statistics=statistics,
|
|
136
|
+
category_statistics=category_statistics,
|
|
137
|
+
sentences=sentences,
|
|
138
|
+
cursor=cursor,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
search_response.additional_properties = d
|
|
142
|
+
return search_response
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def additional_keys(self) -> list[str]:
|
|
146
|
+
return list(self.additional_properties.keys())
|
|
147
|
+
|
|
148
|
+
def __getitem__(self, key: str) -> Any:
|
|
149
|
+
return self.additional_properties[key]
|
|
150
|
+
|
|
151
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
152
|
+
self.additional_properties[key] = value
|
|
153
|
+
|
|
154
|
+
def __delitem__(self, key: str) -> None:
|
|
155
|
+
del self.additional_properties[key]
|
|
156
|
+
|
|
157
|
+
def __contains__(self, key: str) -> bool:
|
|
158
|
+
return key in self.additional_properties
|