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,78 @@
|
|
|
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="RegisterRequest")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class RegisterRequest:
|
|
14
|
+
"""Registration request body
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
username (str): User's display name Example: newuser.
|
|
18
|
+
email (str): User's email address Example: newuser@example.com.
|
|
19
|
+
password (str): User's password Example: securepassword123.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
username: str
|
|
23
|
+
email: str
|
|
24
|
+
password: str
|
|
25
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
26
|
+
|
|
27
|
+
def to_dict(self) -> dict[str, Any]:
|
|
28
|
+
username = self.username
|
|
29
|
+
|
|
30
|
+
email = self.email
|
|
31
|
+
|
|
32
|
+
password = self.password
|
|
33
|
+
|
|
34
|
+
field_dict: dict[str, Any] = {}
|
|
35
|
+
field_dict.update(self.additional_properties)
|
|
36
|
+
field_dict.update(
|
|
37
|
+
{
|
|
38
|
+
"username": username,
|
|
39
|
+
"email": email,
|
|
40
|
+
"password": password,
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
return field_dict
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
username = d.pop("username")
|
|
50
|
+
|
|
51
|
+
email = d.pop("email")
|
|
52
|
+
|
|
53
|
+
password = d.pop("password")
|
|
54
|
+
|
|
55
|
+
register_request = cls(
|
|
56
|
+
username=username,
|
|
57
|
+
email=email,
|
|
58
|
+
password=password,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
register_request.additional_properties = d
|
|
62
|
+
return register_request
|
|
63
|
+
|
|
64
|
+
@property
|
|
65
|
+
def additional_keys(self) -> list[str]:
|
|
66
|
+
return list(self.additional_properties.keys())
|
|
67
|
+
|
|
68
|
+
def __getitem__(self, key: str) -> Any:
|
|
69
|
+
return self.additional_properties[key]
|
|
70
|
+
|
|
71
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
72
|
+
self.additional_properties[key] = value
|
|
73
|
+
|
|
74
|
+
def __delitem__(self, key: str) -> None:
|
|
75
|
+
del self.additional_properties[key]
|
|
76
|
+
|
|
77
|
+
def __contains__(self, key: str) -> bool:
|
|
78
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,76 @@
|
|
|
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.register_response_user import RegisterResponseUser
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="RegisterResponse")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class RegisterResponse:
|
|
18
|
+
"""Registration response
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
message (str): Success message
|
|
22
|
+
user (RegisterResponseUser): Created user object
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
message: str
|
|
26
|
+
user: RegisterResponseUser
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
message = self.message
|
|
31
|
+
|
|
32
|
+
user = self.user.to_dict()
|
|
33
|
+
|
|
34
|
+
field_dict: dict[str, Any] = {}
|
|
35
|
+
field_dict.update(self.additional_properties)
|
|
36
|
+
field_dict.update(
|
|
37
|
+
{
|
|
38
|
+
"message": message,
|
|
39
|
+
"user": user,
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return field_dict
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
47
|
+
from ..models.register_response_user import RegisterResponseUser
|
|
48
|
+
|
|
49
|
+
d = dict(src_dict)
|
|
50
|
+
message = d.pop("message")
|
|
51
|
+
|
|
52
|
+
user = RegisterResponseUser.from_dict(d.pop("user"))
|
|
53
|
+
|
|
54
|
+
register_response = cls(
|
|
55
|
+
message=message,
|
|
56
|
+
user=user,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
register_response.additional_properties = d
|
|
60
|
+
return register_response
|
|
61
|
+
|
|
62
|
+
@property
|
|
63
|
+
def additional_keys(self) -> list[str]:
|
|
64
|
+
return list(self.additional_properties.keys())
|
|
65
|
+
|
|
66
|
+
def __getitem__(self, key: str) -> Any:
|
|
67
|
+
return self.additional_properties[key]
|
|
68
|
+
|
|
69
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
70
|
+
self.additional_properties[key] = value
|
|
71
|
+
|
|
72
|
+
def __delitem__(self, key: str) -> None:
|
|
73
|
+
del self.additional_properties[key]
|
|
74
|
+
|
|
75
|
+
def __contains__(self, key: str) -> bool:
|
|
76
|
+
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="RegisterResponseUser")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class RegisterResponseUser:
|
|
14
|
+
"""Created user object"""
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, Any] = _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
|
+
register_response_user = cls()
|
|
28
|
+
|
|
29
|
+
register_response_user.additional_properties = d
|
|
30
|
+
return register_response_user
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def additional_keys(self) -> list[str]:
|
|
34
|
+
return list(self.additional_properties.keys())
|
|
35
|
+
|
|
36
|
+
def __getitem__(self, key: str) -> Any:
|
|
37
|
+
return self.additional_properties[key]
|
|
38
|
+
|
|
39
|
+
def __setitem__(self, key: str, value: Any) -> 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,138 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.category_statistic import CategoryStatistic
|
|
13
|
+
from ..models.sentence import Sentence
|
|
14
|
+
from ..models.statistic import Statistic
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="SearchHealthCheckResponse")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class SearchHealthCheckResponse:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
statistics (list[Statistic] | Unset):
|
|
25
|
+
category_statistics (list[CategoryStatistic] | Unset):
|
|
26
|
+
sentences (list[Sentence] | Unset):
|
|
27
|
+
cursor (list[float] | Unset): Cursor for pagination
|
|
28
|
+
"""
|
|
29
|
+
|
|
30
|
+
statistics: list[Statistic] | Unset = UNSET
|
|
31
|
+
category_statistics: list[CategoryStatistic] | Unset = UNSET
|
|
32
|
+
sentences: list[Sentence] | Unset = UNSET
|
|
33
|
+
cursor: list[float] | Unset = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
statistics: list[dict[str, Any]] | Unset = UNSET
|
|
38
|
+
if not isinstance(self.statistics, Unset):
|
|
39
|
+
statistics = []
|
|
40
|
+
for statistics_item_data in self.statistics:
|
|
41
|
+
statistics_item = statistics_item_data.to_dict()
|
|
42
|
+
statistics.append(statistics_item)
|
|
43
|
+
|
|
44
|
+
category_statistics: list[dict[str, Any]] | Unset = UNSET
|
|
45
|
+
if not isinstance(self.category_statistics, Unset):
|
|
46
|
+
category_statistics = []
|
|
47
|
+
for category_statistics_item_data in self.category_statistics:
|
|
48
|
+
category_statistics_item = category_statistics_item_data.to_dict()
|
|
49
|
+
category_statistics.append(category_statistics_item)
|
|
50
|
+
|
|
51
|
+
sentences: list[dict[str, Any]] | Unset = UNSET
|
|
52
|
+
if not isinstance(self.sentences, Unset):
|
|
53
|
+
sentences = []
|
|
54
|
+
for sentences_item_data in self.sentences:
|
|
55
|
+
sentences_item = sentences_item_data.to_dict()
|
|
56
|
+
sentences.append(sentences_item)
|
|
57
|
+
|
|
58
|
+
cursor: list[float] | Unset = UNSET
|
|
59
|
+
if not isinstance(self.cursor, Unset):
|
|
60
|
+
cursor = self.cursor
|
|
61
|
+
|
|
62
|
+
field_dict: dict[str, Any] = {}
|
|
63
|
+
field_dict.update(self.additional_properties)
|
|
64
|
+
field_dict.update({})
|
|
65
|
+
if statistics is not UNSET:
|
|
66
|
+
field_dict["statistics"] = statistics
|
|
67
|
+
if category_statistics is not UNSET:
|
|
68
|
+
field_dict["categoryStatistics"] = category_statistics
|
|
69
|
+
if sentences is not UNSET:
|
|
70
|
+
field_dict["sentences"] = sentences
|
|
71
|
+
if cursor is not UNSET:
|
|
72
|
+
field_dict["cursor"] = cursor
|
|
73
|
+
|
|
74
|
+
return field_dict
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
78
|
+
from ..models.category_statistic import CategoryStatistic
|
|
79
|
+
from ..models.sentence import Sentence
|
|
80
|
+
from ..models.statistic import Statistic
|
|
81
|
+
|
|
82
|
+
d = dict(src_dict)
|
|
83
|
+
_statistics = d.pop("statistics", UNSET)
|
|
84
|
+
statistics: list[Statistic] | Unset = UNSET
|
|
85
|
+
if _statistics is not UNSET:
|
|
86
|
+
statistics = []
|
|
87
|
+
for statistics_item_data in _statistics:
|
|
88
|
+
statistics_item = Statistic.from_dict(statistics_item_data)
|
|
89
|
+
|
|
90
|
+
statistics.append(statistics_item)
|
|
91
|
+
|
|
92
|
+
_category_statistics = d.pop("categoryStatistics", UNSET)
|
|
93
|
+
category_statistics: list[CategoryStatistic] | Unset = UNSET
|
|
94
|
+
if _category_statistics is not UNSET:
|
|
95
|
+
category_statistics = []
|
|
96
|
+
for category_statistics_item_data in _category_statistics:
|
|
97
|
+
category_statistics_item = CategoryStatistic.from_dict(
|
|
98
|
+
category_statistics_item_data
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
category_statistics.append(category_statistics_item)
|
|
102
|
+
|
|
103
|
+
_sentences = d.pop("sentences", UNSET)
|
|
104
|
+
sentences: list[Sentence] | Unset = UNSET
|
|
105
|
+
if _sentences is not UNSET:
|
|
106
|
+
sentences = []
|
|
107
|
+
for sentences_item_data in _sentences:
|
|
108
|
+
sentences_item = Sentence.from_dict(sentences_item_data)
|
|
109
|
+
|
|
110
|
+
sentences.append(sentences_item)
|
|
111
|
+
|
|
112
|
+
cursor = cast(list[float], d.pop("cursor", UNSET))
|
|
113
|
+
|
|
114
|
+
search_health_check_response = cls(
|
|
115
|
+
statistics=statistics,
|
|
116
|
+
category_statistics=category_statistics,
|
|
117
|
+
sentences=sentences,
|
|
118
|
+
cursor=cursor,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
search_health_check_response.additional_properties = d
|
|
122
|
+
return search_health_check_response
|
|
123
|
+
|
|
124
|
+
@property
|
|
125
|
+
def additional_keys(self) -> list[str]:
|
|
126
|
+
return list(self.additional_properties.keys())
|
|
127
|
+
|
|
128
|
+
def __getitem__(self, key: str) -> Any:
|
|
129
|
+
return self.additional_properties[key]
|
|
130
|
+
|
|
131
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
132
|
+
self.additional_properties[key] = value
|
|
133
|
+
|
|
134
|
+
def __delitem__(self, key: str) -> None:
|
|
135
|
+
del self.additional_properties[key]
|
|
136
|
+
|
|
137
|
+
def __contains__(self, key: str) -> bool:
|
|
138
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,72 @@
|
|
|
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 ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="SearchMultipleRequest")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class SearchMultipleRequest:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
words (list[str]): List of words to search for Example: ['彼女', '私'].
|
|
19
|
+
exact_match (bool | Unset): Whether to use exact matching Default: False.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
words: list[str]
|
|
23
|
+
exact_match: bool | Unset = False
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
words = self.words
|
|
28
|
+
|
|
29
|
+
exact_match = self.exact_match
|
|
30
|
+
|
|
31
|
+
field_dict: dict[str, Any] = {}
|
|
32
|
+
field_dict.update(self.additional_properties)
|
|
33
|
+
field_dict.update(
|
|
34
|
+
{
|
|
35
|
+
"words": words,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
if exact_match is not UNSET:
|
|
39
|
+
field_dict["exact_match"] = exact_match
|
|
40
|
+
|
|
41
|
+
return field_dict
|
|
42
|
+
|
|
43
|
+
@classmethod
|
|
44
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
45
|
+
d = dict(src_dict)
|
|
46
|
+
words = cast(list[str], d.pop("words"))
|
|
47
|
+
|
|
48
|
+
exact_match = d.pop("exact_match", UNSET)
|
|
49
|
+
|
|
50
|
+
search_multiple_request = cls(
|
|
51
|
+
words=words,
|
|
52
|
+
exact_match=exact_match,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
search_multiple_request.additional_properties = d
|
|
56
|
+
return search_multiple_request
|
|
57
|
+
|
|
58
|
+
@property
|
|
59
|
+
def additional_keys(self) -> list[str]:
|
|
60
|
+
return list(self.additional_properties.keys())
|
|
61
|
+
|
|
62
|
+
def __getitem__(self, key: str) -> Any:
|
|
63
|
+
return self.additional_properties[key]
|
|
64
|
+
|
|
65
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
66
|
+
self.additional_properties[key] = value
|
|
67
|
+
|
|
68
|
+
def __delitem__(self, key: str) -> None:
|
|
69
|
+
del self.additional_properties[key]
|
|
70
|
+
|
|
71
|
+
def __contains__(self, key: str) -> bool:
|
|
72
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,79 @@
|
|
|
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.word_match import WordMatch
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="SearchMultipleResponse")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class SearchMultipleResponse:
|
|
20
|
+
"""
|
|
21
|
+
Attributes:
|
|
22
|
+
results (list[WordMatch] | Unset):
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
results: list[WordMatch] | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
results: list[dict[str, Any]] | Unset = UNSET
|
|
30
|
+
if not isinstance(self.results, Unset):
|
|
31
|
+
results = []
|
|
32
|
+
for results_item_data in self.results:
|
|
33
|
+
results_item = results_item_data.to_dict()
|
|
34
|
+
results.append(results_item)
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update({})
|
|
39
|
+
if results is not UNSET:
|
|
40
|
+
field_dict["results"] = results
|
|
41
|
+
|
|
42
|
+
return field_dict
|
|
43
|
+
|
|
44
|
+
@classmethod
|
|
45
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
46
|
+
from ..models.word_match import WordMatch
|
|
47
|
+
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
_results = d.pop("results", UNSET)
|
|
50
|
+
results: list[WordMatch] | Unset = UNSET
|
|
51
|
+
if _results is not UNSET:
|
|
52
|
+
results = []
|
|
53
|
+
for results_item_data in _results:
|
|
54
|
+
results_item = WordMatch.from_dict(results_item_data)
|
|
55
|
+
|
|
56
|
+
results.append(results_item)
|
|
57
|
+
|
|
58
|
+
search_multiple_response = cls(
|
|
59
|
+
results=results,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
search_multiple_response.additional_properties = d
|
|
63
|
+
return search_multiple_response
|
|
64
|
+
|
|
65
|
+
@property
|
|
66
|
+
def additional_keys(self) -> list[str]:
|
|
67
|
+
return list(self.additional_properties.keys())
|
|
68
|
+
|
|
69
|
+
def __getitem__(self, key: str) -> Any:
|
|
70
|
+
return self.additional_properties[key]
|
|
71
|
+
|
|
72
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
73
|
+
self.additional_properties[key] = value
|
|
74
|
+
|
|
75
|
+
def __delitem__(self, key: str) -> None:
|
|
76
|
+
del self.additional_properties[key]
|
|
77
|
+
|
|
78
|
+
def __contains__(self, key: str) -> bool:
|
|
79
|
+
return key in self.additional_properties
|