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,83 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
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
|
+
T = TypeVar("T", bound="MediaInfoPath")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class MediaInfoPath:
|
|
16
|
+
"""URLs to media resources for a segment
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
path_image (str | Unset): URL to the subtitle image snapshot Example: https://example.com/media/anime/steins-
|
|
20
|
+
gate/segments/1133.jpg.
|
|
21
|
+
path_audio (str | Unset): URL to the audio clip for this segment Example:
|
|
22
|
+
https://example.com/media/anime/steins-gate/audio/1133.mp3.
|
|
23
|
+
path_video (str | Unset): URL to the video clip for this segment Example:
|
|
24
|
+
https://example.com/media/anime/steins-gate/video/1133.mp4.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
path_image: str | Unset = UNSET
|
|
28
|
+
path_audio: str | Unset = UNSET
|
|
29
|
+
path_video: str | Unset = UNSET
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
|
33
|
+
path_image = self.path_image
|
|
34
|
+
|
|
35
|
+
path_audio = self.path_audio
|
|
36
|
+
|
|
37
|
+
path_video = self.path_video
|
|
38
|
+
|
|
39
|
+
field_dict: dict[str, Any] = {}
|
|
40
|
+
field_dict.update(self.additional_properties)
|
|
41
|
+
field_dict.update({})
|
|
42
|
+
if path_image is not UNSET:
|
|
43
|
+
field_dict["path_image"] = path_image
|
|
44
|
+
if path_audio is not UNSET:
|
|
45
|
+
field_dict["path_audio"] = path_audio
|
|
46
|
+
if path_video is not UNSET:
|
|
47
|
+
field_dict["path_video"] = path_video
|
|
48
|
+
|
|
49
|
+
return field_dict
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
path_image = d.pop("path_image", UNSET)
|
|
55
|
+
|
|
56
|
+
path_audio = d.pop("path_audio", UNSET)
|
|
57
|
+
|
|
58
|
+
path_video = d.pop("path_video", UNSET)
|
|
59
|
+
|
|
60
|
+
media_info_path = cls(
|
|
61
|
+
path_image=path_image,
|
|
62
|
+
path_audio=path_audio,
|
|
63
|
+
path_video=path_video,
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
media_info_path.additional_properties = d
|
|
67
|
+
return media_info_path
|
|
68
|
+
|
|
69
|
+
@property
|
|
70
|
+
def additional_keys(self) -> list[str]:
|
|
71
|
+
return list(self.additional_properties.keys())
|
|
72
|
+
|
|
73
|
+
def __getitem__(self, key: str) -> Any:
|
|
74
|
+
return self.additional_properties[key]
|
|
75
|
+
|
|
76
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
77
|
+
self.additional_properties[key] = value
|
|
78
|
+
|
|
79
|
+
def __delitem__(self, key: str) -> None:
|
|
80
|
+
del self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __contains__(self, key: str) -> bool:
|
|
83
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, TypeVar
|
|
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
|
+
T = TypeVar("T", bound="MediaInfoStats")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class MediaInfoStats:
|
|
16
|
+
"""Statistics about media and segments in the database
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
total_animes (int | Unset): Number of anime/media entries in the current result set Example: 15.
|
|
20
|
+
total_segments (int | Unset): Number of subtitle segments in the current result set Example: 150.
|
|
21
|
+
full_total_animes (int | Unset): Total number of anime/media entries in the entire database Example: 5234.
|
|
22
|
+
full_total_segments (int | Unset): Total number of subtitle segments in the entire database Example: 1523847.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
total_animes: int | Unset = UNSET
|
|
26
|
+
total_segments: int | Unset = UNSET
|
|
27
|
+
full_total_animes: int | Unset = UNSET
|
|
28
|
+
full_total_segments: int | Unset = UNSET
|
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
total_animes = self.total_animes
|
|
33
|
+
|
|
34
|
+
total_segments = self.total_segments
|
|
35
|
+
|
|
36
|
+
full_total_animes = self.full_total_animes
|
|
37
|
+
|
|
38
|
+
full_total_segments = self.full_total_segments
|
|
39
|
+
|
|
40
|
+
field_dict: dict[str, Any] = {}
|
|
41
|
+
field_dict.update(self.additional_properties)
|
|
42
|
+
field_dict.update({})
|
|
43
|
+
if total_animes is not UNSET:
|
|
44
|
+
field_dict["total_animes"] = total_animes
|
|
45
|
+
if total_segments is not UNSET:
|
|
46
|
+
field_dict["total_segments"] = total_segments
|
|
47
|
+
if full_total_animes is not UNSET:
|
|
48
|
+
field_dict["full_total_animes"] = full_total_animes
|
|
49
|
+
if full_total_segments is not UNSET:
|
|
50
|
+
field_dict["full_total_segments"] = full_total_segments
|
|
51
|
+
|
|
52
|
+
return field_dict
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
56
|
+
d = dict(src_dict)
|
|
57
|
+
total_animes = d.pop("total_animes", UNSET)
|
|
58
|
+
|
|
59
|
+
total_segments = d.pop("total_segments", UNSET)
|
|
60
|
+
|
|
61
|
+
full_total_animes = d.pop("full_total_animes", UNSET)
|
|
62
|
+
|
|
63
|
+
full_total_segments = d.pop("full_total_segments", UNSET)
|
|
64
|
+
|
|
65
|
+
media_info_stats = cls(
|
|
66
|
+
total_animes=total_animes,
|
|
67
|
+
total_segments=total_segments,
|
|
68
|
+
full_total_animes=full_total_animes,
|
|
69
|
+
full_total_segments=full_total_segments,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
media_info_stats.additional_properties = d
|
|
73
|
+
return media_info_stats
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def additional_keys(self) -> list[str]:
|
|
77
|
+
return list(self.additional_properties.keys())
|
|
78
|
+
|
|
79
|
+
def __getitem__(self, key: str) -> Any:
|
|
80
|
+
return self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
83
|
+
self.additional_properties[key] = value
|
|
84
|
+
|
|
85
|
+
def __delitem__(self, key: str) -> None:
|
|
86
|
+
del self.additional_properties[key]
|
|
87
|
+
|
|
88
|
+
def __contains__(self, key: str) -> bool:
|
|
89
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,94 @@
|
|
|
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
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.media import Media
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="MediaListResponse")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class MediaListResponse:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
data (list[Media]):
|
|
23
|
+
has_more_results (bool): Whether more results are available
|
|
24
|
+
cursor (int | Unset): Next cursor for pagination (undefined if no more results)
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
data: list[Media]
|
|
28
|
+
has_more_results: bool
|
|
29
|
+
cursor: int | Unset = UNSET
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
|
33
|
+
data = []
|
|
34
|
+
for data_item_data in self.data:
|
|
35
|
+
data_item = data_item_data.to_dict()
|
|
36
|
+
data.append(data_item)
|
|
37
|
+
|
|
38
|
+
has_more_results = self.has_more_results
|
|
39
|
+
|
|
40
|
+
cursor = self.cursor
|
|
41
|
+
|
|
42
|
+
field_dict: dict[str, Any] = {}
|
|
43
|
+
field_dict.update(self.additional_properties)
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"data": data,
|
|
47
|
+
"hasMoreResults": has_more_results,
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
if cursor is not UNSET:
|
|
51
|
+
field_dict["cursor"] = cursor
|
|
52
|
+
|
|
53
|
+
return field_dict
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
57
|
+
from ..models.media import Media
|
|
58
|
+
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
data = []
|
|
61
|
+
_data = d.pop("data")
|
|
62
|
+
for data_item_data in _data:
|
|
63
|
+
data_item = Media.from_dict(data_item_data)
|
|
64
|
+
|
|
65
|
+
data.append(data_item)
|
|
66
|
+
|
|
67
|
+
has_more_results = d.pop("hasMoreResults")
|
|
68
|
+
|
|
69
|
+
cursor = d.pop("cursor", UNSET)
|
|
70
|
+
|
|
71
|
+
media_list_response = cls(
|
|
72
|
+
data=data,
|
|
73
|
+
has_more_results=has_more_results,
|
|
74
|
+
cursor=cursor,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
media_list_response.additional_properties = d
|
|
78
|
+
return media_list_response
|
|
79
|
+
|
|
80
|
+
@property
|
|
81
|
+
def additional_keys(self) -> list[str]:
|
|
82
|
+
return list(self.additional_properties.keys())
|
|
83
|
+
|
|
84
|
+
def __getitem__(self, key: str) -> Any:
|
|
85
|
+
return self.additional_properties[key]
|
|
86
|
+
|
|
87
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
88
|
+
self.additional_properties[key] = value
|
|
89
|
+
|
|
90
|
+
def __delitem__(self, key: str) -> None:
|
|
91
|
+
del self.additional_properties[key]
|
|
92
|
+
|
|
93
|
+
def __contains__(self, key: str) -> bool:
|
|
94
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
6
|
+
|
|
7
|
+
from attrs import define as _attrs_define
|
|
8
|
+
from attrs import field as _attrs_field
|
|
9
|
+
from dateutil.parser import isoparse
|
|
10
|
+
|
|
11
|
+
from ..models.media_update_request_category import MediaUpdateRequestCategory
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.character_input import CharacterInput
|
|
16
|
+
from ..models.list_input import ListInput
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="MediaUpdateRequest")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class MediaUpdateRequest:
|
|
24
|
+
"""Request body for updating an existing media entry (all fields optional)
|
|
25
|
+
|
|
26
|
+
Attributes:
|
|
27
|
+
anilist_id (int | Unset): AniList database ID for the media Example: 7674.
|
|
28
|
+
japanese_name (str | Unset): Original Japanese name of the media Example: バクマン。.
|
|
29
|
+
romaji_name (str | Unset): Romaji transliteration of the media name Example: Bakuman..
|
|
30
|
+
english_name (str | Unset): English translation of the media name Example: Bakuman..
|
|
31
|
+
airing_format (str | Unset): Format of the media release (e.g., TV, OVA, Movie) Example: TV.
|
|
32
|
+
airing_status (str | Unset): Current airing status (FINISHED, RELEASING, NOT_YET_RELEASED, CANCELLED) Example:
|
|
33
|
+
FINISHED.
|
|
34
|
+
genres (list[str] | Unset): List of genres associated with the media Example: ['Comedy', 'Drama', 'Romance',
|
|
35
|
+
'Slice of Life'].
|
|
36
|
+
cover_url (str | Unset): Full URL to the cover image Example:
|
|
37
|
+
https://cdn.example.com/media/anime/bakuman/cover.webp.
|
|
38
|
+
banner_url (str | Unset): Full URL to the banner image Example:
|
|
39
|
+
https://cdn.example.com/media/anime/bakuman/banner.webp.
|
|
40
|
+
start_date (datetime.datetime | Unset): Start date of the media (first airing/release) Example: 2010-10-02
|
|
41
|
+
00:00:00+00:00.
|
|
42
|
+
end_date (datetime.datetime | Unset): End date of the media (last airing/release) Example: 2011-04-02
|
|
43
|
+
00:00:00+00:00.
|
|
44
|
+
category (MediaUpdateRequestCategory | Unset): Media category Example: ANIME.
|
|
45
|
+
num_segments (int | Unset): Total number of subtitle segments available Example: 1234.
|
|
46
|
+
version (str | Unset): Version identifier for the media entry Example: 6.
|
|
47
|
+
hash_salt (str | Unset): Hash salt for data integrity verification Example: ba0cbe173ed310528f16130273662a60.
|
|
48
|
+
studio (str | Unset): Animation studio that produced the media Example: J.C.STAFF.
|
|
49
|
+
season_name (str | Unset): Season when the media aired (WINTER, SPRING, SUMMER, FALL) Example: FALL.
|
|
50
|
+
season_year (int | Unset): Year when the media aired Example: 2010.
|
|
51
|
+
characters (list[CharacterInput] | Unset): List of characters appearing in the media with their voice actors
|
|
52
|
+
lists (list[ListInput] | Unset): Lists to add this media to (e.g., series, franchise)
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
anilist_id: int | Unset = UNSET
|
|
56
|
+
japanese_name: str | Unset = UNSET
|
|
57
|
+
romaji_name: str | Unset = UNSET
|
|
58
|
+
english_name: str | Unset = UNSET
|
|
59
|
+
airing_format: str | Unset = UNSET
|
|
60
|
+
airing_status: str | Unset = UNSET
|
|
61
|
+
genres: list[str] | Unset = UNSET
|
|
62
|
+
cover_url: str | Unset = UNSET
|
|
63
|
+
banner_url: str | Unset = UNSET
|
|
64
|
+
start_date: datetime.datetime | Unset = UNSET
|
|
65
|
+
end_date: datetime.datetime | Unset = UNSET
|
|
66
|
+
category: MediaUpdateRequestCategory | Unset = UNSET
|
|
67
|
+
num_segments: int | Unset = UNSET
|
|
68
|
+
version: str | Unset = UNSET
|
|
69
|
+
hash_salt: str | Unset = UNSET
|
|
70
|
+
studio: str | Unset = UNSET
|
|
71
|
+
season_name: str | Unset = UNSET
|
|
72
|
+
season_year: int | Unset = UNSET
|
|
73
|
+
characters: list[CharacterInput] | Unset = UNSET
|
|
74
|
+
lists: list[ListInput] | Unset = UNSET
|
|
75
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
76
|
+
|
|
77
|
+
def to_dict(self) -> dict[str, Any]:
|
|
78
|
+
anilist_id = self.anilist_id
|
|
79
|
+
|
|
80
|
+
japanese_name = self.japanese_name
|
|
81
|
+
|
|
82
|
+
romaji_name = self.romaji_name
|
|
83
|
+
|
|
84
|
+
english_name = self.english_name
|
|
85
|
+
|
|
86
|
+
airing_format = self.airing_format
|
|
87
|
+
|
|
88
|
+
airing_status = self.airing_status
|
|
89
|
+
|
|
90
|
+
genres: list[str] | Unset = UNSET
|
|
91
|
+
if not isinstance(self.genres, Unset):
|
|
92
|
+
genres = self.genres
|
|
93
|
+
|
|
94
|
+
cover_url = self.cover_url
|
|
95
|
+
|
|
96
|
+
banner_url = self.banner_url
|
|
97
|
+
|
|
98
|
+
start_date: str | Unset = UNSET
|
|
99
|
+
if not isinstance(self.start_date, Unset):
|
|
100
|
+
start_date = self.start_date.isoformat()
|
|
101
|
+
|
|
102
|
+
end_date: str | Unset = UNSET
|
|
103
|
+
if not isinstance(self.end_date, Unset):
|
|
104
|
+
end_date = self.end_date.isoformat()
|
|
105
|
+
|
|
106
|
+
category: str | Unset = UNSET
|
|
107
|
+
if not isinstance(self.category, Unset):
|
|
108
|
+
category = self.category.value
|
|
109
|
+
|
|
110
|
+
num_segments = self.num_segments
|
|
111
|
+
|
|
112
|
+
version = self.version
|
|
113
|
+
|
|
114
|
+
hash_salt = self.hash_salt
|
|
115
|
+
|
|
116
|
+
studio = self.studio
|
|
117
|
+
|
|
118
|
+
season_name = self.season_name
|
|
119
|
+
|
|
120
|
+
season_year = self.season_year
|
|
121
|
+
|
|
122
|
+
characters: list[dict[str, Any]] | Unset = UNSET
|
|
123
|
+
if not isinstance(self.characters, Unset):
|
|
124
|
+
characters = []
|
|
125
|
+
for characters_item_data in self.characters:
|
|
126
|
+
characters_item = characters_item_data.to_dict()
|
|
127
|
+
characters.append(characters_item)
|
|
128
|
+
|
|
129
|
+
lists: list[dict[str, Any]] | Unset = UNSET
|
|
130
|
+
if not isinstance(self.lists, Unset):
|
|
131
|
+
lists = []
|
|
132
|
+
for lists_item_data in self.lists:
|
|
133
|
+
lists_item = lists_item_data.to_dict()
|
|
134
|
+
lists.append(lists_item)
|
|
135
|
+
|
|
136
|
+
field_dict: dict[str, Any] = {}
|
|
137
|
+
field_dict.update(self.additional_properties)
|
|
138
|
+
field_dict.update({})
|
|
139
|
+
if anilist_id is not UNSET:
|
|
140
|
+
field_dict["anilistId"] = anilist_id
|
|
141
|
+
if japanese_name is not UNSET:
|
|
142
|
+
field_dict["japaneseName"] = japanese_name
|
|
143
|
+
if romaji_name is not UNSET:
|
|
144
|
+
field_dict["romajiName"] = romaji_name
|
|
145
|
+
if english_name is not UNSET:
|
|
146
|
+
field_dict["englishName"] = english_name
|
|
147
|
+
if airing_format is not UNSET:
|
|
148
|
+
field_dict["airingFormat"] = airing_format
|
|
149
|
+
if airing_status is not UNSET:
|
|
150
|
+
field_dict["airingStatus"] = airing_status
|
|
151
|
+
if genres is not UNSET:
|
|
152
|
+
field_dict["genres"] = genres
|
|
153
|
+
if cover_url is not UNSET:
|
|
154
|
+
field_dict["coverUrl"] = cover_url
|
|
155
|
+
if banner_url is not UNSET:
|
|
156
|
+
field_dict["bannerUrl"] = banner_url
|
|
157
|
+
if start_date is not UNSET:
|
|
158
|
+
field_dict["startDate"] = start_date
|
|
159
|
+
if end_date is not UNSET:
|
|
160
|
+
field_dict["endDate"] = end_date
|
|
161
|
+
if category is not UNSET:
|
|
162
|
+
field_dict["category"] = category
|
|
163
|
+
if num_segments is not UNSET:
|
|
164
|
+
field_dict["numSegments"] = num_segments
|
|
165
|
+
if version is not UNSET:
|
|
166
|
+
field_dict["version"] = version
|
|
167
|
+
if hash_salt is not UNSET:
|
|
168
|
+
field_dict["hashSalt"] = hash_salt
|
|
169
|
+
if studio is not UNSET:
|
|
170
|
+
field_dict["studio"] = studio
|
|
171
|
+
if season_name is not UNSET:
|
|
172
|
+
field_dict["seasonName"] = season_name
|
|
173
|
+
if season_year is not UNSET:
|
|
174
|
+
field_dict["seasonYear"] = season_year
|
|
175
|
+
if characters is not UNSET:
|
|
176
|
+
field_dict["characters"] = characters
|
|
177
|
+
if lists is not UNSET:
|
|
178
|
+
field_dict["lists"] = lists
|
|
179
|
+
|
|
180
|
+
return field_dict
|
|
181
|
+
|
|
182
|
+
@classmethod
|
|
183
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
184
|
+
from ..models.character_input import CharacterInput
|
|
185
|
+
from ..models.list_input import ListInput
|
|
186
|
+
|
|
187
|
+
d = dict(src_dict)
|
|
188
|
+
anilist_id = d.pop("anilistId", UNSET)
|
|
189
|
+
|
|
190
|
+
japanese_name = d.pop("japaneseName", UNSET)
|
|
191
|
+
|
|
192
|
+
romaji_name = d.pop("romajiName", UNSET)
|
|
193
|
+
|
|
194
|
+
english_name = d.pop("englishName", UNSET)
|
|
195
|
+
|
|
196
|
+
airing_format = d.pop("airingFormat", UNSET)
|
|
197
|
+
|
|
198
|
+
airing_status = d.pop("airingStatus", UNSET)
|
|
199
|
+
|
|
200
|
+
genres = cast(list[str], d.pop("genres", UNSET))
|
|
201
|
+
|
|
202
|
+
cover_url = d.pop("coverUrl", UNSET)
|
|
203
|
+
|
|
204
|
+
banner_url = d.pop("bannerUrl", UNSET)
|
|
205
|
+
|
|
206
|
+
_start_date = d.pop("startDate", UNSET)
|
|
207
|
+
start_date: datetime.datetime | Unset
|
|
208
|
+
if isinstance(_start_date, Unset):
|
|
209
|
+
start_date = UNSET
|
|
210
|
+
else:
|
|
211
|
+
start_date = isoparse(_start_date)
|
|
212
|
+
|
|
213
|
+
_end_date = d.pop("endDate", UNSET)
|
|
214
|
+
end_date: datetime.datetime | Unset
|
|
215
|
+
if isinstance(_end_date, Unset):
|
|
216
|
+
end_date = UNSET
|
|
217
|
+
else:
|
|
218
|
+
end_date = isoparse(_end_date)
|
|
219
|
+
|
|
220
|
+
_category = d.pop("category", UNSET)
|
|
221
|
+
category: MediaUpdateRequestCategory | Unset
|
|
222
|
+
if isinstance(_category, Unset):
|
|
223
|
+
category = UNSET
|
|
224
|
+
else:
|
|
225
|
+
category = MediaUpdateRequestCategory(_category)
|
|
226
|
+
|
|
227
|
+
num_segments = d.pop("numSegments", UNSET)
|
|
228
|
+
|
|
229
|
+
version = d.pop("version", UNSET)
|
|
230
|
+
|
|
231
|
+
hash_salt = d.pop("hashSalt", UNSET)
|
|
232
|
+
|
|
233
|
+
studio = d.pop("studio", UNSET)
|
|
234
|
+
|
|
235
|
+
season_name = d.pop("seasonName", UNSET)
|
|
236
|
+
|
|
237
|
+
season_year = d.pop("seasonYear", UNSET)
|
|
238
|
+
|
|
239
|
+
_characters = d.pop("characters", UNSET)
|
|
240
|
+
characters: list[CharacterInput] | Unset = UNSET
|
|
241
|
+
if _characters is not UNSET:
|
|
242
|
+
characters = []
|
|
243
|
+
for characters_item_data in _characters:
|
|
244
|
+
characters_item = CharacterInput.from_dict(characters_item_data)
|
|
245
|
+
|
|
246
|
+
characters.append(characters_item)
|
|
247
|
+
|
|
248
|
+
_lists = d.pop("lists", UNSET)
|
|
249
|
+
lists: list[ListInput] | Unset = UNSET
|
|
250
|
+
if _lists is not UNSET:
|
|
251
|
+
lists = []
|
|
252
|
+
for lists_item_data in _lists:
|
|
253
|
+
lists_item = ListInput.from_dict(lists_item_data)
|
|
254
|
+
|
|
255
|
+
lists.append(lists_item)
|
|
256
|
+
|
|
257
|
+
media_update_request = cls(
|
|
258
|
+
anilist_id=anilist_id,
|
|
259
|
+
japanese_name=japanese_name,
|
|
260
|
+
romaji_name=romaji_name,
|
|
261
|
+
english_name=english_name,
|
|
262
|
+
airing_format=airing_format,
|
|
263
|
+
airing_status=airing_status,
|
|
264
|
+
genres=genres,
|
|
265
|
+
cover_url=cover_url,
|
|
266
|
+
banner_url=banner_url,
|
|
267
|
+
start_date=start_date,
|
|
268
|
+
end_date=end_date,
|
|
269
|
+
category=category,
|
|
270
|
+
num_segments=num_segments,
|
|
271
|
+
version=version,
|
|
272
|
+
hash_salt=hash_salt,
|
|
273
|
+
studio=studio,
|
|
274
|
+
season_name=season_name,
|
|
275
|
+
season_year=season_year,
|
|
276
|
+
characters=characters,
|
|
277
|
+
lists=lists,
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
media_update_request.additional_properties = d
|
|
281
|
+
return media_update_request
|
|
282
|
+
|
|
283
|
+
@property
|
|
284
|
+
def additional_keys(self) -> list[str]:
|
|
285
|
+
return list(self.additional_properties.keys())
|
|
286
|
+
|
|
287
|
+
def __getitem__(self, key: str) -> Any:
|
|
288
|
+
return self.additional_properties[key]
|
|
289
|
+
|
|
290
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
291
|
+
self.additional_properties[key] = value
|
|
292
|
+
|
|
293
|
+
def __delitem__(self, key: str) -> None:
|
|
294
|
+
del self.additional_properties[key]
|
|
295
|
+
|
|
296
|
+
def __contains__(self, key: str) -> bool:
|
|
297
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
from ..models.quota_info_quota_limit_type_1 import QuotaInfoQuotaLimitType1
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="QuotaInfo")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class QuotaInfo:
|
|
16
|
+
"""User quota information
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
quota_used (int): Number of API requests used this month
|
|
20
|
+
quota_limit (int | QuotaInfoQuotaLimitType1):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
quota_used: int
|
|
24
|
+
quota_limit: int | QuotaInfoQuotaLimitType1
|
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
quota_used = self.quota_used
|
|
29
|
+
|
|
30
|
+
quota_limit: int | str
|
|
31
|
+
if isinstance(self.quota_limit, QuotaInfoQuotaLimitType1):
|
|
32
|
+
quota_limit = self.quota_limit.value
|
|
33
|
+
else:
|
|
34
|
+
quota_limit = self.quota_limit
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update(
|
|
39
|
+
{
|
|
40
|
+
"quotaUsed": quota_used,
|
|
41
|
+
"quotaLimit": quota_limit,
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
return field_dict
|
|
46
|
+
|
|
47
|
+
@classmethod
|
|
48
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
quota_used = d.pop("quotaUsed")
|
|
51
|
+
|
|
52
|
+
def _parse_quota_limit(data: object) -> int | QuotaInfoQuotaLimitType1:
|
|
53
|
+
try:
|
|
54
|
+
if not isinstance(data, str):
|
|
55
|
+
raise TypeError()
|
|
56
|
+
quota_limit_type_1 = QuotaInfoQuotaLimitType1(data)
|
|
57
|
+
|
|
58
|
+
return quota_limit_type_1
|
|
59
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
60
|
+
pass
|
|
61
|
+
return cast(int | QuotaInfoQuotaLimitType1, data)
|
|
62
|
+
|
|
63
|
+
quota_limit = _parse_quota_limit(d.pop("quotaLimit"))
|
|
64
|
+
|
|
65
|
+
quota_info = cls(
|
|
66
|
+
quota_used=quota_used,
|
|
67
|
+
quota_limit=quota_limit,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
quota_info.additional_properties = d
|
|
71
|
+
return quota_info
|
|
72
|
+
|
|
73
|
+
@property
|
|
74
|
+
def additional_keys(self) -> list[str]:
|
|
75
|
+
return list(self.additional_properties.keys())
|
|
76
|
+
|
|
77
|
+
def __getitem__(self, key: str) -> Any:
|
|
78
|
+
return self.additional_properties[key]
|
|
79
|
+
|
|
80
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
81
|
+
self.additional_properties[key] = value
|
|
82
|
+
|
|
83
|
+
def __delitem__(self, key: str) -> None:
|
|
84
|
+
del self.additional_properties[key]
|
|
85
|
+
|
|
86
|
+
def __contains__(self, key: str) -> bool:
|
|
87
|
+
return key in self.additional_properties
|