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,193 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.segment import Segment
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
uuid: str,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
_kwargs: dict[str, Any] = {
|
|
18
|
+
"method": "get",
|
|
19
|
+
"url": "/v1/media/segments/{uuid}".format(
|
|
20
|
+
uuid=quote(str(uuid), safe=""),
|
|
21
|
+
),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return _kwargs
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _parse_response(
|
|
28
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
29
|
+
) -> Error | Segment | None:
|
|
30
|
+
if response.status_code == 200:
|
|
31
|
+
response_200 = Segment.from_dict(response.json())
|
|
32
|
+
|
|
33
|
+
return response_200
|
|
34
|
+
|
|
35
|
+
if response.status_code == 400:
|
|
36
|
+
response_400 = Error.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_400
|
|
39
|
+
|
|
40
|
+
if response.status_code == 401:
|
|
41
|
+
response_401 = Error.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_401
|
|
44
|
+
|
|
45
|
+
if response.status_code == 403:
|
|
46
|
+
response_403 = Error.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_403
|
|
49
|
+
|
|
50
|
+
if response.status_code == 404:
|
|
51
|
+
response_404 = Error.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
return response_404
|
|
54
|
+
|
|
55
|
+
if response.status_code == 429:
|
|
56
|
+
response_429 = Error.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
return response_429
|
|
59
|
+
|
|
60
|
+
if response.status_code == 500:
|
|
61
|
+
response_500 = Error.from_dict(response.json())
|
|
62
|
+
|
|
63
|
+
return response_500
|
|
64
|
+
|
|
65
|
+
if client.raise_on_unexpected_status:
|
|
66
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
67
|
+
else:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _build_response(
|
|
72
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
73
|
+
) -> Response[Error | Segment]:
|
|
74
|
+
return Response(
|
|
75
|
+
status_code=HTTPStatus(response.status_code),
|
|
76
|
+
content=response.content,
|
|
77
|
+
headers=response.headers,
|
|
78
|
+
parsed=_parse_response(client=client, response=response),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def sync_detailed(
|
|
83
|
+
uuid: str,
|
|
84
|
+
*,
|
|
85
|
+
client: AuthenticatedClient,
|
|
86
|
+
) -> Response[Error | Segment]:
|
|
87
|
+
"""Get segment by UUID
|
|
88
|
+
|
|
89
|
+
Get a specific segment by its UUID
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
uuid (str):
|
|
93
|
+
|
|
94
|
+
Raises:
|
|
95
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
96
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
Response[Error | Segment]
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
kwargs = _get_kwargs(
|
|
103
|
+
uuid=uuid,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
response = client.get_httpx_client().request(
|
|
107
|
+
**kwargs,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
return _build_response(client=client, response=response)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def sync(
|
|
114
|
+
uuid: str,
|
|
115
|
+
*,
|
|
116
|
+
client: AuthenticatedClient,
|
|
117
|
+
) -> Error | Segment | None:
|
|
118
|
+
"""Get segment by UUID
|
|
119
|
+
|
|
120
|
+
Get a specific segment by its UUID
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
uuid (str):
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
Error | Segment
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return sync_detailed(
|
|
134
|
+
uuid=uuid,
|
|
135
|
+
client=client,
|
|
136
|
+
).parsed
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def asyncio_detailed(
|
|
140
|
+
uuid: str,
|
|
141
|
+
*,
|
|
142
|
+
client: AuthenticatedClient,
|
|
143
|
+
) -> Response[Error | Segment]:
|
|
144
|
+
"""Get segment by UUID
|
|
145
|
+
|
|
146
|
+
Get a specific segment by its UUID
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
uuid (str):
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
153
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
Response[Error | Segment]
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
kwargs = _get_kwargs(
|
|
160
|
+
uuid=uuid,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
164
|
+
|
|
165
|
+
return _build_response(client=client, response=response)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
async def asyncio(
|
|
169
|
+
uuid: str,
|
|
170
|
+
*,
|
|
171
|
+
client: AuthenticatedClient,
|
|
172
|
+
) -> Error | Segment | None:
|
|
173
|
+
"""Get segment by UUID
|
|
174
|
+
|
|
175
|
+
Get a specific segment by its UUID
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
uuid (str):
|
|
179
|
+
|
|
180
|
+
Raises:
|
|
181
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
182
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
183
|
+
|
|
184
|
+
Returns:
|
|
185
|
+
Error | Segment
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
await asyncio_detailed(
|
|
190
|
+
uuid=uuid,
|
|
191
|
+
client=client,
|
|
192
|
+
)
|
|
193
|
+
).parsed
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
from urllib.parse import quote
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
|
|
7
|
+
from ... import errors
|
|
8
|
+
from ...client import AuthenticatedClient, Client
|
|
9
|
+
from ...models.error import Error
|
|
10
|
+
from ...models.seiyuu_with_roles import SeiyuuWithRoles
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
id: int,
|
|
16
|
+
) -> dict[str, Any]:
|
|
17
|
+
_kwargs: dict[str, Any] = {
|
|
18
|
+
"method": "get",
|
|
19
|
+
"url": "/v1/media/seiyuu/{id}".format(
|
|
20
|
+
id=quote(str(id), safe=""),
|
|
21
|
+
),
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return _kwargs
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def _parse_response(
|
|
28
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
29
|
+
) -> Error | SeiyuuWithRoles | None:
|
|
30
|
+
if response.status_code == 200:
|
|
31
|
+
response_200 = SeiyuuWithRoles.from_dict(response.json())
|
|
32
|
+
|
|
33
|
+
return response_200
|
|
34
|
+
|
|
35
|
+
if response.status_code == 400:
|
|
36
|
+
response_400 = Error.from_dict(response.json())
|
|
37
|
+
|
|
38
|
+
return response_400
|
|
39
|
+
|
|
40
|
+
if response.status_code == 401:
|
|
41
|
+
response_401 = Error.from_dict(response.json())
|
|
42
|
+
|
|
43
|
+
return response_401
|
|
44
|
+
|
|
45
|
+
if response.status_code == 403:
|
|
46
|
+
response_403 = Error.from_dict(response.json())
|
|
47
|
+
|
|
48
|
+
return response_403
|
|
49
|
+
|
|
50
|
+
if response.status_code == 404:
|
|
51
|
+
response_404 = Error.from_dict(response.json())
|
|
52
|
+
|
|
53
|
+
return response_404
|
|
54
|
+
|
|
55
|
+
if response.status_code == 429:
|
|
56
|
+
response_429 = Error.from_dict(response.json())
|
|
57
|
+
|
|
58
|
+
return response_429
|
|
59
|
+
|
|
60
|
+
if response.status_code == 500:
|
|
61
|
+
response_500 = Error.from_dict(response.json())
|
|
62
|
+
|
|
63
|
+
return response_500
|
|
64
|
+
|
|
65
|
+
if client.raise_on_unexpected_status:
|
|
66
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
67
|
+
else:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _build_response(
|
|
72
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
73
|
+
) -> Response[Error | SeiyuuWithRoles]:
|
|
74
|
+
return Response(
|
|
75
|
+
status_code=HTTPStatus(response.status_code),
|
|
76
|
+
content=response.content,
|
|
77
|
+
headers=response.headers,
|
|
78
|
+
parsed=_parse_response(client=client, response=response),
|
|
79
|
+
)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def sync_detailed(
|
|
83
|
+
id: int,
|
|
84
|
+
*,
|
|
85
|
+
client: AuthenticatedClient,
|
|
86
|
+
) -> Response[Error | SeiyuuWithRoles]:
|
|
87
|
+
"""Get seiyuu details
|
|
88
|
+
|
|
89
|
+
Returns a voice actor with all characters they voiced and media appearances.
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
id (int): Example: 95991.
|
|
93
|
+
|
|
94
|
+
Raises:
|
|
95
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
96
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
Response[Error | SeiyuuWithRoles]
|
|
100
|
+
"""
|
|
101
|
+
|
|
102
|
+
kwargs = _get_kwargs(
|
|
103
|
+
id=id,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
response = client.get_httpx_client().request(
|
|
107
|
+
**kwargs,
|
|
108
|
+
)
|
|
109
|
+
|
|
110
|
+
return _build_response(client=client, response=response)
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
def sync(
|
|
114
|
+
id: int,
|
|
115
|
+
*,
|
|
116
|
+
client: AuthenticatedClient,
|
|
117
|
+
) -> Error | SeiyuuWithRoles | None:
|
|
118
|
+
"""Get seiyuu details
|
|
119
|
+
|
|
120
|
+
Returns a voice actor with all characters they voiced and media appearances.
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
id (int): Example: 95991.
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
Error | SeiyuuWithRoles
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return sync_detailed(
|
|
134
|
+
id=id,
|
|
135
|
+
client=client,
|
|
136
|
+
).parsed
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def asyncio_detailed(
|
|
140
|
+
id: int,
|
|
141
|
+
*,
|
|
142
|
+
client: AuthenticatedClient,
|
|
143
|
+
) -> Response[Error | SeiyuuWithRoles]:
|
|
144
|
+
"""Get seiyuu details
|
|
145
|
+
|
|
146
|
+
Returns a voice actor with all characters they voiced and media appearances.
|
|
147
|
+
|
|
148
|
+
Args:
|
|
149
|
+
id (int): Example: 95991.
|
|
150
|
+
|
|
151
|
+
Raises:
|
|
152
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
153
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
Response[Error | SeiyuuWithRoles]
|
|
157
|
+
"""
|
|
158
|
+
|
|
159
|
+
kwargs = _get_kwargs(
|
|
160
|
+
id=id,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
164
|
+
|
|
165
|
+
return _build_response(client=client, response=response)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
async def asyncio(
|
|
169
|
+
id: int,
|
|
170
|
+
*,
|
|
171
|
+
client: AuthenticatedClient,
|
|
172
|
+
) -> Error | SeiyuuWithRoles | None:
|
|
173
|
+
"""Get seiyuu details
|
|
174
|
+
|
|
175
|
+
Returns a voice actor with all characters they voiced and media appearances.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
id (int): Example: 95991.
|
|
179
|
+
|
|
180
|
+
Raises:
|
|
181
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
182
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
183
|
+
|
|
184
|
+
Returns:
|
|
185
|
+
Error | SeiyuuWithRoles
|
|
186
|
+
"""
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
await asyncio_detailed(
|
|
190
|
+
id=id,
|
|
191
|
+
client=client,
|
|
192
|
+
)
|
|
193
|
+
).parsed
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
import httpx
|
|
3
|
+
from ... import errors
|
|
4
|
+
from ...client import AuthenticatedClient, Client
|
|
5
|
+
from ...types import Response
|
|
6
|
+
|
|
7
|
+
from . import fetch_media_info
|
|
8
|
+
from . import fetch_sentence_context
|
|
9
|
+
from . import search_health_check
|
|
10
|
+
from . import search_multiple
|
|
11
|
+
from . import search
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.error import Error
|
|
9
|
+
from ...models.fetch_media_info_response import FetchMediaInfoResponse
|
|
10
|
+
from ...models.fetch_media_info_type import FetchMediaInfoType
|
|
11
|
+
from ...types import UNSET, Response, Unset
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
size: int | Unset = 20,
|
|
17
|
+
cursor: int | Unset = 0,
|
|
18
|
+
query: str | Unset = UNSET,
|
|
19
|
+
type_: FetchMediaInfoType | Unset = UNSET,
|
|
20
|
+
) -> dict[str, Any]:
|
|
21
|
+
params: dict[str, Any] = {}
|
|
22
|
+
|
|
23
|
+
params["size"] = size
|
|
24
|
+
|
|
25
|
+
params["cursor"] = cursor
|
|
26
|
+
|
|
27
|
+
params["query"] = query
|
|
28
|
+
|
|
29
|
+
json_type_: str | Unset = UNSET
|
|
30
|
+
if not isinstance(type_, Unset):
|
|
31
|
+
json_type_ = type_.value
|
|
32
|
+
|
|
33
|
+
params["type"] = json_type_
|
|
34
|
+
|
|
35
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
36
|
+
|
|
37
|
+
_kwargs: dict[str, Any] = {
|
|
38
|
+
"method": "get",
|
|
39
|
+
"url": "/v1/search/media/info",
|
|
40
|
+
"params": params,
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return _kwargs
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def _parse_response(
|
|
47
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
48
|
+
) -> Error | FetchMediaInfoResponse | None:
|
|
49
|
+
if response.status_code == 200:
|
|
50
|
+
response_200 = FetchMediaInfoResponse.from_dict(response.json())
|
|
51
|
+
|
|
52
|
+
return response_200
|
|
53
|
+
|
|
54
|
+
if response.status_code == 401:
|
|
55
|
+
response_401 = Error.from_dict(response.json())
|
|
56
|
+
|
|
57
|
+
return response_401
|
|
58
|
+
|
|
59
|
+
if response.status_code == 403:
|
|
60
|
+
response_403 = Error.from_dict(response.json())
|
|
61
|
+
|
|
62
|
+
return response_403
|
|
63
|
+
|
|
64
|
+
if response.status_code == 429:
|
|
65
|
+
response_429 = Error.from_dict(response.json())
|
|
66
|
+
|
|
67
|
+
return response_429
|
|
68
|
+
|
|
69
|
+
if response.status_code == 500:
|
|
70
|
+
response_500 = Error.from_dict(response.json())
|
|
71
|
+
|
|
72
|
+
return response_500
|
|
73
|
+
|
|
74
|
+
if client.raise_on_unexpected_status:
|
|
75
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
76
|
+
else:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def _build_response(
|
|
81
|
+
*, client: AuthenticatedClient | Client, response: httpx.Response
|
|
82
|
+
) -> Response[Error | FetchMediaInfoResponse]:
|
|
83
|
+
return Response(
|
|
84
|
+
status_code=HTTPStatus(response.status_code),
|
|
85
|
+
content=response.content,
|
|
86
|
+
headers=response.headers,
|
|
87
|
+
parsed=_parse_response(client=client, response=response),
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def sync_detailed(
|
|
92
|
+
*,
|
|
93
|
+
client: AuthenticatedClient | Client,
|
|
94
|
+
size: int | Unset = 20,
|
|
95
|
+
cursor: int | Unset = 0,
|
|
96
|
+
query: str | Unset = UNSET,
|
|
97
|
+
type_: FetchMediaInfoType | Unset = UNSET,
|
|
98
|
+
) -> Response[Error | FetchMediaInfoResponse]:
|
|
99
|
+
"""Fetch media info
|
|
100
|
+
|
|
101
|
+
Lists available media with metadata and supports filtering by type and search query.
|
|
102
|
+
|
|
103
|
+
Returns paginated results with comprehensive media information including cover/banner images,
|
|
104
|
+
episode counts, and genres.
|
|
105
|
+
|
|
106
|
+
**Use Cases**
|
|
107
|
+
- Browsing the media library
|
|
108
|
+
- Getting media metadata for display
|
|
109
|
+
|
|
110
|
+
**Requirements:**
|
|
111
|
+
- Required Scopes: `READ_MEDIA`
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
size (int | Unset): Default: 20.
|
|
115
|
+
cursor (int | Unset): Default: 0.
|
|
116
|
+
query (str | Unset): Example: steins.
|
|
117
|
+
type_ (FetchMediaInfoType | Unset): Example: anime.
|
|
118
|
+
|
|
119
|
+
Raises:
|
|
120
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
121
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
122
|
+
|
|
123
|
+
Returns:
|
|
124
|
+
Response[Error | FetchMediaInfoResponse]
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
kwargs = _get_kwargs(
|
|
128
|
+
size=size,
|
|
129
|
+
cursor=cursor,
|
|
130
|
+
query=query,
|
|
131
|
+
type_=type_,
|
|
132
|
+
)
|
|
133
|
+
|
|
134
|
+
response = client.get_httpx_client().request(
|
|
135
|
+
**kwargs,
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
return _build_response(client=client, response=response)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
def sync(
|
|
142
|
+
*,
|
|
143
|
+
client: AuthenticatedClient | Client,
|
|
144
|
+
size: int | Unset = 20,
|
|
145
|
+
cursor: int | Unset = 0,
|
|
146
|
+
query: str | Unset = UNSET,
|
|
147
|
+
type_: FetchMediaInfoType | Unset = UNSET,
|
|
148
|
+
) -> Error | FetchMediaInfoResponse | None:
|
|
149
|
+
"""Fetch media info
|
|
150
|
+
|
|
151
|
+
Lists available media with metadata and supports filtering by type and search query.
|
|
152
|
+
|
|
153
|
+
Returns paginated results with comprehensive media information including cover/banner images,
|
|
154
|
+
episode counts, and genres.
|
|
155
|
+
|
|
156
|
+
**Use Cases**
|
|
157
|
+
- Browsing the media library
|
|
158
|
+
- Getting media metadata for display
|
|
159
|
+
|
|
160
|
+
**Requirements:**
|
|
161
|
+
- Required Scopes: `READ_MEDIA`
|
|
162
|
+
|
|
163
|
+
Args:
|
|
164
|
+
size (int | Unset): Default: 20.
|
|
165
|
+
cursor (int | Unset): Default: 0.
|
|
166
|
+
query (str | Unset): Example: steins.
|
|
167
|
+
type_ (FetchMediaInfoType | Unset): Example: anime.
|
|
168
|
+
|
|
169
|
+
Raises:
|
|
170
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
171
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
172
|
+
|
|
173
|
+
Returns:
|
|
174
|
+
Error | FetchMediaInfoResponse
|
|
175
|
+
"""
|
|
176
|
+
|
|
177
|
+
return sync_detailed(
|
|
178
|
+
client=client,
|
|
179
|
+
size=size,
|
|
180
|
+
cursor=cursor,
|
|
181
|
+
query=query,
|
|
182
|
+
type_=type_,
|
|
183
|
+
).parsed
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
async def asyncio_detailed(
|
|
187
|
+
*,
|
|
188
|
+
client: AuthenticatedClient | Client,
|
|
189
|
+
size: int | Unset = 20,
|
|
190
|
+
cursor: int | Unset = 0,
|
|
191
|
+
query: str | Unset = UNSET,
|
|
192
|
+
type_: FetchMediaInfoType | Unset = UNSET,
|
|
193
|
+
) -> Response[Error | FetchMediaInfoResponse]:
|
|
194
|
+
"""Fetch media info
|
|
195
|
+
|
|
196
|
+
Lists available media with metadata and supports filtering by type and search query.
|
|
197
|
+
|
|
198
|
+
Returns paginated results with comprehensive media information including cover/banner images,
|
|
199
|
+
episode counts, and genres.
|
|
200
|
+
|
|
201
|
+
**Use Cases**
|
|
202
|
+
- Browsing the media library
|
|
203
|
+
- Getting media metadata for display
|
|
204
|
+
|
|
205
|
+
**Requirements:**
|
|
206
|
+
- Required Scopes: `READ_MEDIA`
|
|
207
|
+
|
|
208
|
+
Args:
|
|
209
|
+
size (int | Unset): Default: 20.
|
|
210
|
+
cursor (int | Unset): Default: 0.
|
|
211
|
+
query (str | Unset): Example: steins.
|
|
212
|
+
type_ (FetchMediaInfoType | Unset): Example: anime.
|
|
213
|
+
|
|
214
|
+
Raises:
|
|
215
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
216
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
Response[Error | FetchMediaInfoResponse]
|
|
220
|
+
"""
|
|
221
|
+
|
|
222
|
+
kwargs = _get_kwargs(
|
|
223
|
+
size=size,
|
|
224
|
+
cursor=cursor,
|
|
225
|
+
query=query,
|
|
226
|
+
type_=type_,
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
230
|
+
|
|
231
|
+
return _build_response(client=client, response=response)
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
async def asyncio(
|
|
235
|
+
*,
|
|
236
|
+
client: AuthenticatedClient | Client,
|
|
237
|
+
size: int | Unset = 20,
|
|
238
|
+
cursor: int | Unset = 0,
|
|
239
|
+
query: str | Unset = UNSET,
|
|
240
|
+
type_: FetchMediaInfoType | Unset = UNSET,
|
|
241
|
+
) -> Error | FetchMediaInfoResponse | None:
|
|
242
|
+
"""Fetch media info
|
|
243
|
+
|
|
244
|
+
Lists available media with metadata and supports filtering by type and search query.
|
|
245
|
+
|
|
246
|
+
Returns paginated results with comprehensive media information including cover/banner images,
|
|
247
|
+
episode counts, and genres.
|
|
248
|
+
|
|
249
|
+
**Use Cases**
|
|
250
|
+
- Browsing the media library
|
|
251
|
+
- Getting media metadata for display
|
|
252
|
+
|
|
253
|
+
**Requirements:**
|
|
254
|
+
- Required Scopes: `READ_MEDIA`
|
|
255
|
+
|
|
256
|
+
Args:
|
|
257
|
+
size (int | Unset): Default: 20.
|
|
258
|
+
cursor (int | Unset): Default: 0.
|
|
259
|
+
query (str | Unset): Example: steins.
|
|
260
|
+
type_ (FetchMediaInfoType | Unset): Example: anime.
|
|
261
|
+
|
|
262
|
+
Raises:
|
|
263
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
264
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
265
|
+
|
|
266
|
+
Returns:
|
|
267
|
+
Error | FetchMediaInfoResponse
|
|
268
|
+
"""
|
|
269
|
+
|
|
270
|
+
return (
|
|
271
|
+
await asyncio_detailed(
|
|
272
|
+
client=client,
|
|
273
|
+
size=size,
|
|
274
|
+
cursor=cursor,
|
|
275
|
+
query=query,
|
|
276
|
+
type_=type_,
|
|
277
|
+
)
|
|
278
|
+
).parsed
|