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,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.episode import Episode
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="EpisodeListResponse")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class EpisodeListResponse:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
data (list[Episode]): Array of episode objects
|
|
23
|
+
has_more_results (bool): Whether more results are available Example: True.
|
|
24
|
+
cursor (int | Unset): Cursor for pagination (last episode number in current page) Example: 12.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
data: list[Episode]
|
|
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.episode import Episode
|
|
58
|
+
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
data = []
|
|
61
|
+
_data = d.pop("data")
|
|
62
|
+
for data_item_data in _data:
|
|
63
|
+
data_item = Episode.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
|
+
episode_list_response = cls(
|
|
72
|
+
data=data,
|
|
73
|
+
has_more_results=has_more_results,
|
|
74
|
+
cursor=cursor,
|
|
75
|
+
)
|
|
76
|
+
|
|
77
|
+
episode_list_response.additional_properties = d
|
|
78
|
+
return episode_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,135 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import datetime
|
|
4
|
+
from collections.abc import Mapping
|
|
5
|
+
from typing import Any, TypeVar
|
|
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 ..types import UNSET, Unset
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="EpisodeUpdateRequest")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class EpisodeUpdateRequest:
|
|
18
|
+
"""All fields are optional for partial updates
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
anilist_episode_id (int | Unset): AniList episode ID for external reference Example: 123456.
|
|
22
|
+
title_english (str | Unset): English title of the episode Example: The Beginning.
|
|
23
|
+
title_romaji (str | Unset): Romanized title of the episode Example: Hajimari.
|
|
24
|
+
title_japanese (str | Unset): Japanese title of the episode Example: 始まり.
|
|
25
|
+
description (str | Unset): Episode description or synopsis Example: The hero begins their journey.
|
|
26
|
+
aired_at (datetime.datetime | Unset): When the episode originally aired Example: 2024-01-15 09:00:00+00:00.
|
|
27
|
+
length_seconds (int | Unset): Episode duration in seconds Example: 1420.
|
|
28
|
+
thumbnail_url (str | Unset): URL to episode thumbnail image Example:
|
|
29
|
+
https://example.com/thumbnails/episode1.jpg.
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
anilist_episode_id: int | Unset = UNSET
|
|
33
|
+
title_english: str | Unset = UNSET
|
|
34
|
+
title_romaji: str | Unset = UNSET
|
|
35
|
+
title_japanese: str | Unset = UNSET
|
|
36
|
+
description: str | Unset = UNSET
|
|
37
|
+
aired_at: datetime.datetime | Unset = UNSET
|
|
38
|
+
length_seconds: int | Unset = UNSET
|
|
39
|
+
thumbnail_url: str | Unset = UNSET
|
|
40
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
41
|
+
|
|
42
|
+
def to_dict(self) -> dict[str, Any]:
|
|
43
|
+
anilist_episode_id = self.anilist_episode_id
|
|
44
|
+
|
|
45
|
+
title_english = self.title_english
|
|
46
|
+
|
|
47
|
+
title_romaji = self.title_romaji
|
|
48
|
+
|
|
49
|
+
title_japanese = self.title_japanese
|
|
50
|
+
|
|
51
|
+
description = self.description
|
|
52
|
+
|
|
53
|
+
aired_at: str | Unset = UNSET
|
|
54
|
+
if not isinstance(self.aired_at, Unset):
|
|
55
|
+
aired_at = self.aired_at.isoformat()
|
|
56
|
+
|
|
57
|
+
length_seconds = self.length_seconds
|
|
58
|
+
|
|
59
|
+
thumbnail_url = self.thumbnail_url
|
|
60
|
+
|
|
61
|
+
field_dict: dict[str, Any] = {}
|
|
62
|
+
field_dict.update(self.additional_properties)
|
|
63
|
+
field_dict.update({})
|
|
64
|
+
if anilist_episode_id is not UNSET:
|
|
65
|
+
field_dict["anilistEpisodeId"] = anilist_episode_id
|
|
66
|
+
if title_english is not UNSET:
|
|
67
|
+
field_dict["titleEnglish"] = title_english
|
|
68
|
+
if title_romaji is not UNSET:
|
|
69
|
+
field_dict["titleRomaji"] = title_romaji
|
|
70
|
+
if title_japanese is not UNSET:
|
|
71
|
+
field_dict["titleJapanese"] = title_japanese
|
|
72
|
+
if description is not UNSET:
|
|
73
|
+
field_dict["description"] = description
|
|
74
|
+
if aired_at is not UNSET:
|
|
75
|
+
field_dict["airedAt"] = aired_at
|
|
76
|
+
if length_seconds is not UNSET:
|
|
77
|
+
field_dict["lengthSeconds"] = length_seconds
|
|
78
|
+
if thumbnail_url is not UNSET:
|
|
79
|
+
field_dict["thumbnailUrl"] = thumbnail_url
|
|
80
|
+
|
|
81
|
+
return field_dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
85
|
+
d = dict(src_dict)
|
|
86
|
+
anilist_episode_id = d.pop("anilistEpisodeId", UNSET)
|
|
87
|
+
|
|
88
|
+
title_english = d.pop("titleEnglish", UNSET)
|
|
89
|
+
|
|
90
|
+
title_romaji = d.pop("titleRomaji", UNSET)
|
|
91
|
+
|
|
92
|
+
title_japanese = d.pop("titleJapanese", UNSET)
|
|
93
|
+
|
|
94
|
+
description = d.pop("description", UNSET)
|
|
95
|
+
|
|
96
|
+
_aired_at = d.pop("airedAt", UNSET)
|
|
97
|
+
aired_at: datetime.datetime | Unset
|
|
98
|
+
if isinstance(_aired_at, Unset):
|
|
99
|
+
aired_at = UNSET
|
|
100
|
+
else:
|
|
101
|
+
aired_at = isoparse(_aired_at)
|
|
102
|
+
|
|
103
|
+
length_seconds = d.pop("lengthSeconds", UNSET)
|
|
104
|
+
|
|
105
|
+
thumbnail_url = d.pop("thumbnailUrl", UNSET)
|
|
106
|
+
|
|
107
|
+
episode_update_request = cls(
|
|
108
|
+
anilist_episode_id=anilist_episode_id,
|
|
109
|
+
title_english=title_english,
|
|
110
|
+
title_romaji=title_romaji,
|
|
111
|
+
title_japanese=title_japanese,
|
|
112
|
+
description=description,
|
|
113
|
+
aired_at=aired_at,
|
|
114
|
+
length_seconds=length_seconds,
|
|
115
|
+
thumbnail_url=thumbnail_url,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
episode_update_request.additional_properties = d
|
|
119
|
+
return episode_update_request
|
|
120
|
+
|
|
121
|
+
@property
|
|
122
|
+
def additional_keys(self) -> list[str]:
|
|
123
|
+
return list(self.additional_properties.keys())
|
|
124
|
+
|
|
125
|
+
def __getitem__(self, key: str) -> Any:
|
|
126
|
+
return self.additional_properties[key]
|
|
127
|
+
|
|
128
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
129
|
+
self.additional_properties[key] = value
|
|
130
|
+
|
|
131
|
+
def __delitem__(self, key: str) -> None:
|
|
132
|
+
del self.additional_properties[key]
|
|
133
|
+
|
|
134
|
+
def __contains__(self, key: str) -> bool:
|
|
135
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,128 @@
|
|
|
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.error_errors import ErrorErrors
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="Error")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class Error:
|
|
20
|
+
"""Error Response schema for all cases
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
code (str): Specific error code for programmatic handling
|
|
24
|
+
title (str): A short, human-readable summary of the problem
|
|
25
|
+
detail (str): A human-readable explanation specific to this occurrence
|
|
26
|
+
status (int): The HTTP status code
|
|
27
|
+
type_ (str | Unset): A URI reference that identifies the problem type (e.g., GitHub issues link)
|
|
28
|
+
instance (str | Unset): A URI reference that identifies the specific occurrence (e.g., trace ID)
|
|
29
|
+
errors (ErrorErrors | Unset): Optional map of field names to their error messages (for validation errors)
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
code: str
|
|
33
|
+
title: str
|
|
34
|
+
detail: str
|
|
35
|
+
status: int
|
|
36
|
+
type_: str | Unset = UNSET
|
|
37
|
+
instance: str | Unset = UNSET
|
|
38
|
+
errors: ErrorErrors | Unset = UNSET
|
|
39
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
40
|
+
|
|
41
|
+
def to_dict(self) -> dict[str, Any]:
|
|
42
|
+
code = self.code
|
|
43
|
+
|
|
44
|
+
title = self.title
|
|
45
|
+
|
|
46
|
+
detail = self.detail
|
|
47
|
+
|
|
48
|
+
status = self.status
|
|
49
|
+
|
|
50
|
+
type_ = self.type_
|
|
51
|
+
|
|
52
|
+
instance = self.instance
|
|
53
|
+
|
|
54
|
+
errors: dict[str, Any] | Unset = UNSET
|
|
55
|
+
if not isinstance(self.errors, Unset):
|
|
56
|
+
errors = self.errors.to_dict()
|
|
57
|
+
|
|
58
|
+
field_dict: dict[str, Any] = {}
|
|
59
|
+
field_dict.update(self.additional_properties)
|
|
60
|
+
field_dict.update(
|
|
61
|
+
{
|
|
62
|
+
"code": code,
|
|
63
|
+
"title": title,
|
|
64
|
+
"detail": detail,
|
|
65
|
+
"status": status,
|
|
66
|
+
}
|
|
67
|
+
)
|
|
68
|
+
if type_ is not UNSET:
|
|
69
|
+
field_dict["type"] = type_
|
|
70
|
+
if instance is not UNSET:
|
|
71
|
+
field_dict["instance"] = instance
|
|
72
|
+
if errors is not UNSET:
|
|
73
|
+
field_dict["errors"] = errors
|
|
74
|
+
|
|
75
|
+
return field_dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
79
|
+
from ..models.error_errors import ErrorErrors
|
|
80
|
+
|
|
81
|
+
d = dict(src_dict)
|
|
82
|
+
code = d.pop("code")
|
|
83
|
+
|
|
84
|
+
title = d.pop("title")
|
|
85
|
+
|
|
86
|
+
detail = d.pop("detail")
|
|
87
|
+
|
|
88
|
+
status = d.pop("status")
|
|
89
|
+
|
|
90
|
+
type_ = d.pop("type", UNSET)
|
|
91
|
+
|
|
92
|
+
instance = d.pop("instance", UNSET)
|
|
93
|
+
|
|
94
|
+
_errors = d.pop("errors", UNSET)
|
|
95
|
+
errors: ErrorErrors | Unset
|
|
96
|
+
if isinstance(_errors, Unset):
|
|
97
|
+
errors = UNSET
|
|
98
|
+
else:
|
|
99
|
+
errors = ErrorErrors.from_dict(_errors)
|
|
100
|
+
|
|
101
|
+
error = cls(
|
|
102
|
+
code=code,
|
|
103
|
+
title=title,
|
|
104
|
+
detail=detail,
|
|
105
|
+
status=status,
|
|
106
|
+
type_=type_,
|
|
107
|
+
instance=instance,
|
|
108
|
+
errors=errors,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
error.additional_properties = d
|
|
112
|
+
return error
|
|
113
|
+
|
|
114
|
+
@property
|
|
115
|
+
def additional_keys(self) -> list[str]:
|
|
116
|
+
return list(self.additional_properties.keys())
|
|
117
|
+
|
|
118
|
+
def __getitem__(self, key: str) -> Any:
|
|
119
|
+
return self.additional_properties[key]
|
|
120
|
+
|
|
121
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
122
|
+
self.additional_properties[key] = value
|
|
123
|
+
|
|
124
|
+
def __delitem__(self, key: str) -> None:
|
|
125
|
+
del self.additional_properties[key]
|
|
126
|
+
|
|
127
|
+
def __contains__(self, key: str) -> bool:
|
|
128
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
T = TypeVar("T", bound="ErrorErrors")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ErrorErrors:
|
|
14
|
+
"""Optional map of field names to their error messages (for validation errors)"""
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> dict[str, Any]:
|
|
19
|
+
field_dict: dict[str, Any] = {}
|
|
20
|
+
field_dict.update(self.additional_properties)
|
|
21
|
+
|
|
22
|
+
return field_dict
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
26
|
+
d = dict(src_dict)
|
|
27
|
+
error_errors = cls()
|
|
28
|
+
|
|
29
|
+
error_errors.additional_properties = d
|
|
30
|
+
return error_errors
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def additional_keys(self) -> list[str]:
|
|
34
|
+
return list(self.additional_properties.keys())
|
|
35
|
+
|
|
36
|
+
def __getitem__(self, key: str) -> str:
|
|
37
|
+
return self.additional_properties[key]
|
|
38
|
+
|
|
39
|
+
def __setitem__(self, key: str, value: str) -> None:
|
|
40
|
+
self.additional_properties[key] = value
|
|
41
|
+
|
|
42
|
+
def __delitem__(self, key: str) -> None:
|
|
43
|
+
del self.additional_properties[key]
|
|
44
|
+
|
|
45
|
+
def __contains__(self, key: str) -> bool:
|
|
46
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,115 @@
|
|
|
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_info_data import MediaInfoData
|
|
13
|
+
from ..models.media_info_stats import MediaInfoStats
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="FetchMediaInfoResponse")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class FetchMediaInfoResponse:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
stats (MediaInfoStats | Unset): Statistics about media and segments in the database
|
|
24
|
+
results (list[MediaInfoData] | Unset):
|
|
25
|
+
cursor (int | Unset): Next cursor for pagination
|
|
26
|
+
has_more_results (bool | Unset): Whether more results are available
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
stats: MediaInfoStats | Unset = UNSET
|
|
30
|
+
results: list[MediaInfoData] | Unset = UNSET
|
|
31
|
+
cursor: int | Unset = UNSET
|
|
32
|
+
has_more_results: bool | Unset = UNSET
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
stats: dict[str, Any] | Unset = UNSET
|
|
37
|
+
if not isinstance(self.stats, Unset):
|
|
38
|
+
stats = self.stats.to_dict()
|
|
39
|
+
|
|
40
|
+
results: list[dict[str, Any]] | Unset = UNSET
|
|
41
|
+
if not isinstance(self.results, Unset):
|
|
42
|
+
results = []
|
|
43
|
+
for results_item_data in self.results:
|
|
44
|
+
results_item = results_item_data.to_dict()
|
|
45
|
+
results.append(results_item)
|
|
46
|
+
|
|
47
|
+
cursor = self.cursor
|
|
48
|
+
|
|
49
|
+
has_more_results = self.has_more_results
|
|
50
|
+
|
|
51
|
+
field_dict: dict[str, Any] = {}
|
|
52
|
+
field_dict.update(self.additional_properties)
|
|
53
|
+
field_dict.update({})
|
|
54
|
+
if stats is not UNSET:
|
|
55
|
+
field_dict["stats"] = stats
|
|
56
|
+
if results is not UNSET:
|
|
57
|
+
field_dict["results"] = results
|
|
58
|
+
if cursor is not UNSET:
|
|
59
|
+
field_dict["cursor"] = cursor
|
|
60
|
+
if has_more_results is not UNSET:
|
|
61
|
+
field_dict["hasMoreResults"] = has_more_results
|
|
62
|
+
|
|
63
|
+
return field_dict
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
67
|
+
from ..models.media_info_data import MediaInfoData
|
|
68
|
+
from ..models.media_info_stats import MediaInfoStats
|
|
69
|
+
|
|
70
|
+
d = dict(src_dict)
|
|
71
|
+
_stats = d.pop("stats", UNSET)
|
|
72
|
+
stats: MediaInfoStats | Unset
|
|
73
|
+
if isinstance(_stats, Unset):
|
|
74
|
+
stats = UNSET
|
|
75
|
+
else:
|
|
76
|
+
stats = MediaInfoStats.from_dict(_stats)
|
|
77
|
+
|
|
78
|
+
_results = d.pop("results", UNSET)
|
|
79
|
+
results: list[MediaInfoData] | Unset = UNSET
|
|
80
|
+
if _results is not UNSET:
|
|
81
|
+
results = []
|
|
82
|
+
for results_item_data in _results:
|
|
83
|
+
results_item = MediaInfoData.from_dict(results_item_data)
|
|
84
|
+
|
|
85
|
+
results.append(results_item)
|
|
86
|
+
|
|
87
|
+
cursor = d.pop("cursor", UNSET)
|
|
88
|
+
|
|
89
|
+
has_more_results = d.pop("hasMoreResults", UNSET)
|
|
90
|
+
|
|
91
|
+
fetch_media_info_response = cls(
|
|
92
|
+
stats=stats,
|
|
93
|
+
results=results,
|
|
94
|
+
cursor=cursor,
|
|
95
|
+
has_more_results=has_more_results,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
fetch_media_info_response.additional_properties = d
|
|
99
|
+
return fetch_media_info_response
|
|
100
|
+
|
|
101
|
+
@property
|
|
102
|
+
def additional_keys(self) -> list[str]:
|
|
103
|
+
return list(self.additional_properties.keys())
|
|
104
|
+
|
|
105
|
+
def __getitem__(self, key: str) -> Any:
|
|
106
|
+
return self.additional_properties[key]
|
|
107
|
+
|
|
108
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
109
|
+
self.additional_properties[key] = value
|
|
110
|
+
|
|
111
|
+
def __delitem__(self, key: str) -> None:
|
|
112
|
+
del self.additional_properties[key]
|
|
113
|
+
|
|
114
|
+
def __contains__(self, key: str) -> bool:
|
|
115
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,96 @@
|
|
|
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="FetchSentenceContextRequest")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class FetchSentenceContextRequest:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
media_id (int): Media ID Example: 110316.
|
|
19
|
+
season (int): Season number Example: 1.
|
|
20
|
+
episode (int): Episode number Example: 5.
|
|
21
|
+
segment_position (int): Segment position in the episode Example: 1133.
|
|
22
|
+
limit (int | Unset): Number of surrounding segments to retrieve Default: 5. Example: 5.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
media_id: int
|
|
26
|
+
season: int
|
|
27
|
+
episode: int
|
|
28
|
+
segment_position: int
|
|
29
|
+
limit: int | Unset = 5
|
|
30
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
31
|
+
|
|
32
|
+
def to_dict(self) -> dict[str, Any]:
|
|
33
|
+
media_id = self.media_id
|
|
34
|
+
|
|
35
|
+
season = self.season
|
|
36
|
+
|
|
37
|
+
episode = self.episode
|
|
38
|
+
|
|
39
|
+
segment_position = self.segment_position
|
|
40
|
+
|
|
41
|
+
limit = self.limit
|
|
42
|
+
|
|
43
|
+
field_dict: dict[str, Any] = {}
|
|
44
|
+
field_dict.update(self.additional_properties)
|
|
45
|
+
field_dict.update(
|
|
46
|
+
{
|
|
47
|
+
"media_id": media_id,
|
|
48
|
+
"season": season,
|
|
49
|
+
"episode": episode,
|
|
50
|
+
"segment_position": segment_position,
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
if limit is not UNSET:
|
|
54
|
+
field_dict["limit"] = limit
|
|
55
|
+
|
|
56
|
+
return field_dict
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
60
|
+
d = dict(src_dict)
|
|
61
|
+
media_id = d.pop("media_id")
|
|
62
|
+
|
|
63
|
+
season = d.pop("season")
|
|
64
|
+
|
|
65
|
+
episode = d.pop("episode")
|
|
66
|
+
|
|
67
|
+
segment_position = d.pop("segment_position")
|
|
68
|
+
|
|
69
|
+
limit = d.pop("limit", UNSET)
|
|
70
|
+
|
|
71
|
+
fetch_sentence_context_request = cls(
|
|
72
|
+
media_id=media_id,
|
|
73
|
+
season=season,
|
|
74
|
+
episode=episode,
|
|
75
|
+
segment_position=segment_position,
|
|
76
|
+
limit=limit,
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
fetch_sentence_context_request.additional_properties = d
|
|
80
|
+
return fetch_sentence_context_request
|
|
81
|
+
|
|
82
|
+
@property
|
|
83
|
+
def additional_keys(self) -> list[str]:
|
|
84
|
+
return list(self.additional_properties.keys())
|
|
85
|
+
|
|
86
|
+
def __getitem__(self, key: str) -> Any:
|
|
87
|
+
return self.additional_properties[key]
|
|
88
|
+
|
|
89
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
90
|
+
self.additional_properties[key] = value
|
|
91
|
+
|
|
92
|
+
def __delitem__(self, key: str) -> None:
|
|
93
|
+
del self.additional_properties[key]
|
|
94
|
+
|
|
95
|
+
def __contains__(self, key: str) -> bool:
|
|
96
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,75 @@
|
|
|
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.sentence import Sentence
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="FetchSentenceContextResponse")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class FetchSentenceContextResponse:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
sentences (list[Sentence]):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
sentences: list[Sentence]
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
sentences = []
|
|
28
|
+
for sentences_item_data in self.sentences:
|
|
29
|
+
sentences_item = sentences_item_data.to_dict()
|
|
30
|
+
sentences.append(sentences_item)
|
|
31
|
+
|
|
32
|
+
field_dict: dict[str, Any] = {}
|
|
33
|
+
field_dict.update(self.additional_properties)
|
|
34
|
+
field_dict.update(
|
|
35
|
+
{
|
|
36
|
+
"sentences": sentences,
|
|
37
|
+
}
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
return field_dict
|
|
41
|
+
|
|
42
|
+
@classmethod
|
|
43
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
44
|
+
from ..models.sentence import Sentence
|
|
45
|
+
|
|
46
|
+
d = dict(src_dict)
|
|
47
|
+
sentences = []
|
|
48
|
+
_sentences = d.pop("sentences")
|
|
49
|
+
for sentences_item_data in _sentences:
|
|
50
|
+
sentences_item = Sentence.from_dict(sentences_item_data)
|
|
51
|
+
|
|
52
|
+
sentences.append(sentences_item)
|
|
53
|
+
|
|
54
|
+
fetch_sentence_context_response = cls(
|
|
55
|
+
sentences=sentences,
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
fetch_sentence_context_response.additional_properties = d
|
|
59
|
+
return fetch_sentence_context_response
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def additional_keys(self) -> list[str]:
|
|
63
|
+
return list(self.additional_properties.keys())
|
|
64
|
+
|
|
65
|
+
def __getitem__(self, key: str) -> Any:
|
|
66
|
+
return self.additional_properties[key]
|
|
67
|
+
|
|
68
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
69
|
+
self.additional_properties[key] = value
|
|
70
|
+
|
|
71
|
+
def __delitem__(self, key: str) -> None:
|
|
72
|
+
del self.additional_properties[key]
|
|
73
|
+
|
|
74
|
+
def __contains__(self, key: str) -> bool:
|
|
75
|
+
return key in self.additional_properties
|