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.
Files changed (167) hide show
  1. nadeshiko/__init__.py +10 -0
  2. nadeshiko/_version.py +1 -0
  3. nadeshiko/api/__init__.py +1 -0
  4. nadeshiko/api/auth/__init__.py +3 -0
  5. nadeshiko/api/auth/internal/__init__.py +11 -0
  6. nadeshiko/api/auth/internal/get_discord_auth_url.py +176 -0
  7. nadeshiko/api/auth/internal/login.py +213 -0
  8. nadeshiko/api/auth/internal/login_discord.py +204 -0
  9. nadeshiko/api/auth/internal/login_google.py +204 -0
  10. nadeshiko/api/auth/internal/register.py +212 -0
  11. nadeshiko/api/auth_jwt/__init__.py +3 -0
  12. nadeshiko/api/auth_jwt/internal/__init__.py +7 -0
  13. nadeshiko/api/auth_jwt/internal/logout.py +151 -0
  14. nadeshiko/api/lists/__init__.py +8 -0
  15. nadeshiko/api/lists/internal/__init__.py +12 -0
  16. nadeshiko/api/lists/internal/list_add_item.py +215 -0
  17. nadeshiko/api/lists/internal/list_create.py +194 -0
  18. nadeshiko/api/lists/internal/list_destroy.py +193 -0
  19. nadeshiko/api/lists/internal/list_remove_item.py +207 -0
  20. nadeshiko/api/lists/internal/list_update.py +215 -0
  21. nadeshiko/api/lists/internal/list_update_item.py +229 -0
  22. nadeshiko/api/lists/list_index.py +257 -0
  23. nadeshiko/api/lists/list_show.py +193 -0
  24. nadeshiko/api/media/__init__.py +14 -0
  25. nadeshiko/api/media/character_show.py +193 -0
  26. nadeshiko/api/media/episode_index.py +229 -0
  27. nadeshiko/api/media/episode_show.py +207 -0
  28. nadeshiko/api/media/internal/__init__.py +16 -0
  29. nadeshiko/api/media/internal/episode_create.py +215 -0
  30. nadeshiko/api/media/internal/episode_destroy.py +205 -0
  31. nadeshiko/api/media/internal/episode_update.py +229 -0
  32. nadeshiko/api/media/internal/media_create.py +194 -0
  33. nadeshiko/api/media/internal/media_destroy.py +197 -0
  34. nadeshiko/api/media/internal/media_update.py +219 -0
  35. nadeshiko/api/media/internal/segment_create.py +229 -0
  36. nadeshiko/api/media/internal/segment_destroy.py +219 -0
  37. nadeshiko/api/media/internal/segment_index.py +243 -0
  38. nadeshiko/api/media/internal/segment_update.py +243 -0
  39. nadeshiko/api/media/media_index.py +232 -0
  40. nadeshiko/api/media/media_show.py +193 -0
  41. nadeshiko/api/media/segment_show.py +221 -0
  42. nadeshiko/api/media/segment_show_by_uuid.py +193 -0
  43. nadeshiko/api/media/seiyuu_show.py +193 -0
  44. nadeshiko/api/search/__init__.py +11 -0
  45. nadeshiko/api/search/fetch_media_info.py +278 -0
  46. nadeshiko/api/search/fetch_sentence_context.py +219 -0
  47. nadeshiko/api/search/internal/__init__.py +6 -0
  48. nadeshiko/api/search/search.py +295 -0
  49. nadeshiko/api/search/search_health_check.py +168 -0
  50. nadeshiko/api/search/search_multiple.py +238 -0
  51. nadeshiko/api/user/__init__.py +3 -0
  52. nadeshiko/api/user/internal/__init__.py +11 -0
  53. nadeshiko/api/user/internal/create_api_key.py +199 -0
  54. nadeshiko/api/user/internal/deactivate_api_key.py +194 -0
  55. nadeshiko/api/user/internal/get_api_keys.py +151 -0
  56. nadeshiko/api/user/internal/get_identity_me.py +156 -0
  57. nadeshiko/api/user/internal/get_user_info.py +156 -0
  58. nadeshiko/client.py +138 -0
  59. nadeshiko/errors.py +16 -0
  60. nadeshiko/models/__init__.py +215 -0
  61. nadeshiko/models/api_key.py +118 -0
  62. nadeshiko/models/api_key_permission.py +70 -0
  63. nadeshiko/models/auth_user.py +107 -0
  64. nadeshiko/models/basic_info.py +132 -0
  65. nadeshiko/models/category_statistic.py +71 -0
  66. nadeshiko/models/character.py +100 -0
  67. nadeshiko/models/character_input.py +130 -0
  68. nadeshiko/models/character_input_character_role.py +10 -0
  69. nadeshiko/models/character_with_media.py +124 -0
  70. nadeshiko/models/character_with_media_media_appearances_item.py +93 -0
  71. nadeshiko/models/character_with_media_media_appearances_item_role.py +10 -0
  72. nadeshiko/models/create_api_key_request.py +75 -0
  73. nadeshiko/models/create_api_key_response.py +70 -0
  74. nadeshiko/models/deactivate_api_key_request.py +62 -0
  75. nadeshiko/models/deactivate_api_key_response.py +62 -0
  76. nadeshiko/models/discord_auth_url_response.py +62 -0
  77. nadeshiko/models/discord_login_request.py +62 -0
  78. nadeshiko/models/episode.py +253 -0
  79. nadeshiko/models/episode_create_request.py +145 -0
  80. nadeshiko/models/episode_list_response.py +94 -0
  81. nadeshiko/models/episode_update_request.py +135 -0
  82. nadeshiko/models/error.py +128 -0
  83. nadeshiko/models/error_errors.py +46 -0
  84. nadeshiko/models/fetch_media_info_response.py +115 -0
  85. nadeshiko/models/fetch_media_info_type.py +10 -0
  86. nadeshiko/models/fetch_sentence_context_request.py +96 -0
  87. nadeshiko/models/fetch_sentence_context_response.py +75 -0
  88. nadeshiko/models/get_api_keys_response.py +86 -0
  89. nadeshiko/models/google_login_request.py +62 -0
  90. nadeshiko/models/list_.py +97 -0
  91. nadeshiko/models/list_add_item_body.py +69 -0
  92. nadeshiko/models/list_add_item_response_201.py +61 -0
  93. nadeshiko/models/list_create_request.py +107 -0
  94. nadeshiko/models/list_create_request_type.py +9 -0
  95. nadeshiko/models/list_create_request_visibility.py +9 -0
  96. nadeshiko/models/list_destroy_response_200.py +70 -0
  97. nadeshiko/models/list_index_type.py +9 -0
  98. nadeshiko/models/list_index_visibility.py +9 -0
  99. nadeshiko/models/list_input.py +138 -0
  100. nadeshiko/models/list_input_list_type.py +9 -0
  101. nadeshiko/models/list_input_list_visibility.py +9 -0
  102. nadeshiko/models/list_remove_item_response_200.py +61 -0
  103. nadeshiko/models/list_type.py +9 -0
  104. nadeshiko/models/list_update_body.py +78 -0
  105. nadeshiko/models/list_update_body_visibility.py +9 -0
  106. nadeshiko/models/list_update_item_body.py +61 -0
  107. nadeshiko/models/list_update_item_response_200.py +61 -0
  108. nadeshiko/models/list_visibility.py +9 -0
  109. nadeshiko/models/list_with_media.py +119 -0
  110. nadeshiko/models/list_with_media_media_item.py +83 -0
  111. nadeshiko/models/list_with_media_type.py +9 -0
  112. nadeshiko/models/list_with_media_visibility.py +9 -0
  113. nadeshiko/models/login_request.py +70 -0
  114. nadeshiko/models/login_response.py +84 -0
  115. nadeshiko/models/logout_response.py +73 -0
  116. nadeshiko/models/media.py +288 -0
  117. nadeshiko/models/media_category.py +11 -0
  118. nadeshiko/models/media_character.py +78 -0
  119. nadeshiko/models/media_character_role.py +10 -0
  120. nadeshiko/models/media_create_request.py +270 -0
  121. nadeshiko/models/media_create_request_category.py +11 -0
  122. nadeshiko/models/media_destroy_response_200.py +70 -0
  123. nadeshiko/models/media_index_category.py +9 -0
  124. nadeshiko/models/media_info_data.py +307 -0
  125. nadeshiko/models/media_info_path.py +83 -0
  126. nadeshiko/models/media_info_stats.py +89 -0
  127. nadeshiko/models/media_list_response.py +94 -0
  128. nadeshiko/models/media_update_request.py +297 -0
  129. nadeshiko/models/media_update_request_category.py +9 -0
  130. nadeshiko/models/quota_info.py +87 -0
  131. nadeshiko/models/quota_info_quota_limit_type_1.py +8 -0
  132. nadeshiko/models/register_request.py +78 -0
  133. nadeshiko/models/register_response.py +76 -0
  134. nadeshiko/models/register_response_user.py +46 -0
  135. nadeshiko/models/search_health_check_response.py +138 -0
  136. nadeshiko/models/search_multiple_request.py +72 -0
  137. nadeshiko/models/search_multiple_response.py +79 -0
  138. nadeshiko/models/search_request.py +253 -0
  139. nadeshiko/models/search_request_content_sort.py +13 -0
  140. nadeshiko/models/search_request_media_item.py +85 -0
  141. nadeshiko/models/search_request_media_item_seasons_item.py +69 -0
  142. nadeshiko/models/search_response.py +158 -0
  143. nadeshiko/models/segment.py +303 -0
  144. nadeshiko/models/segment_create_request.py +203 -0
  145. nadeshiko/models/segment_create_request_status.py +13 -0
  146. nadeshiko/models/segment_info.py +207 -0
  147. nadeshiko/models/segment_list_response.py +94 -0
  148. nadeshiko/models/segment_status.py +13 -0
  149. nadeshiko/models/segment_update_request.py +198 -0
  150. nadeshiko/models/segment_update_request_status.py +13 -0
  151. nadeshiko/models/seiyuu.py +86 -0
  152. nadeshiko/models/seiyuu_with_roles.py +108 -0
  153. nadeshiko/models/seiyuu_with_roles_roles_item.py +109 -0
  154. nadeshiko/models/seiyuu_with_roles_roles_item_role.py +10 -0
  155. nadeshiko/models/sentence.py +88 -0
  156. nadeshiko/models/statistic.py +132 -0
  157. nadeshiko/models/statistic_season_with_episode_hits.py +74 -0
  158. nadeshiko/models/statistic_season_with_episode_hits_additional_property.py +46 -0
  159. nadeshiko/models/user_info_response.py +79 -0
  160. nadeshiko/models/user_info_response_user.py +91 -0
  161. nadeshiko/models/user_role.py +71 -0
  162. nadeshiko/models/word_match.py +107 -0
  163. nadeshiko/models/word_match_media.py +98 -0
  164. nadeshiko/types.py +54 -0
  165. nadeshiko_sdk-0.1.0.dist-info/METADATA +147 -0
  166. nadeshiko_sdk-0.1.0.dist-info/RECORD +167 -0
  167. nadeshiko_sdk-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,108 @@
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.seiyuu_with_roles_roles_item import SeiyuuWithRolesRolesItem
11
+
12
+
13
+ T = TypeVar("T", bound="SeiyuuWithRoles")
14
+
15
+
16
+ @_attrs_define
17
+ class SeiyuuWithRoles:
18
+ """Seiyuu with all voice acting roles
19
+
20
+ Attributes:
21
+ id (int): AniList staff ID Example: 95991.
22
+ name_japanese (str): Japanese name of the voice actor Example: 阿部敦.
23
+ name_english (str): English name of the voice actor Example: Atsushi Abe.
24
+ image_url (str): Profile image URL Example: https://s4.anilist.co/file/anilistcdn/staff/large/n95991.jpg.
25
+ roles (list[SeiyuuWithRolesRolesItem]): All characters voiced by this seiyuu with their media appearances
26
+ """
27
+
28
+ id: int
29
+ name_japanese: str
30
+ name_english: str
31
+ image_url: str
32
+ roles: list[SeiyuuWithRolesRolesItem]
33
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
34
+
35
+ def to_dict(self) -> dict[str, Any]:
36
+ id = self.id
37
+
38
+ name_japanese = self.name_japanese
39
+
40
+ name_english = self.name_english
41
+
42
+ image_url = self.image_url
43
+
44
+ roles = []
45
+ for roles_item_data in self.roles:
46
+ roles_item = roles_item_data.to_dict()
47
+ roles.append(roles_item)
48
+
49
+ field_dict: dict[str, Any] = {}
50
+ field_dict.update(self.additional_properties)
51
+ field_dict.update(
52
+ {
53
+ "id": id,
54
+ "nameJapanese": name_japanese,
55
+ "nameEnglish": name_english,
56
+ "imageUrl": image_url,
57
+ "roles": roles,
58
+ }
59
+ )
60
+
61
+ return field_dict
62
+
63
+ @classmethod
64
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
65
+ from ..models.seiyuu_with_roles_roles_item import SeiyuuWithRolesRolesItem
66
+
67
+ d = dict(src_dict)
68
+ id = d.pop("id")
69
+
70
+ name_japanese = d.pop("nameJapanese")
71
+
72
+ name_english = d.pop("nameEnglish")
73
+
74
+ image_url = d.pop("imageUrl")
75
+
76
+ roles = []
77
+ _roles = d.pop("roles")
78
+ for roles_item_data in _roles:
79
+ roles_item = SeiyuuWithRolesRolesItem.from_dict(roles_item_data)
80
+
81
+ roles.append(roles_item)
82
+
83
+ seiyuu_with_roles = cls(
84
+ id=id,
85
+ name_japanese=name_japanese,
86
+ name_english=name_english,
87
+ image_url=image_url,
88
+ roles=roles,
89
+ )
90
+
91
+ seiyuu_with_roles.additional_properties = d
92
+ return seiyuu_with_roles
93
+
94
+ @property
95
+ def additional_keys(self) -> list[str]:
96
+ return list(self.additional_properties.keys())
97
+
98
+ def __getitem__(self, key: str) -> Any:
99
+ return self.additional_properties[key]
100
+
101
+ def __setitem__(self, key: str, value: Any) -> None:
102
+ self.additional_properties[key] = value
103
+
104
+ def __delitem__(self, key: str) -> None:
105
+ del self.additional_properties[key]
106
+
107
+ def __contains__(self, key: str) -> bool:
108
+ return key in self.additional_properties
@@ -0,0 +1,109 @@
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 ..models.seiyuu_with_roles_roles_item_role import SeiyuuWithRolesRolesItemRole
10
+ from ..types import UNSET, Unset
11
+
12
+ if TYPE_CHECKING:
13
+ from ..models.character import Character
14
+ from ..models.media import Media
15
+
16
+
17
+ T = TypeVar("T", bound="SeiyuuWithRolesRolesItem")
18
+
19
+
20
+ @_attrs_define
21
+ class SeiyuuWithRolesRolesItem:
22
+ """
23
+ Attributes:
24
+ character (Character | Unset): Anime character
25
+ media (Media | Unset): Media entry with full metadata
26
+ role (SeiyuuWithRolesRolesItemRole | Unset): Character role in this media Example: MAIN.
27
+ """
28
+
29
+ character: Character | Unset = UNSET
30
+ media: Media | Unset = UNSET
31
+ role: SeiyuuWithRolesRolesItemRole | Unset = UNSET
32
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ character: dict[str, Any] | Unset = UNSET
36
+ if not isinstance(self.character, Unset):
37
+ character = self.character.to_dict()
38
+
39
+ media: dict[str, Any] | Unset = UNSET
40
+ if not isinstance(self.media, Unset):
41
+ media = self.media.to_dict()
42
+
43
+ role: str | Unset = UNSET
44
+ if not isinstance(self.role, Unset):
45
+ role = self.role.value
46
+
47
+ field_dict: dict[str, Any] = {}
48
+ field_dict.update(self.additional_properties)
49
+ field_dict.update({})
50
+ if character is not UNSET:
51
+ field_dict["character"] = character
52
+ if media is not UNSET:
53
+ field_dict["media"] = media
54
+ if role is not UNSET:
55
+ field_dict["role"] = role
56
+
57
+ return field_dict
58
+
59
+ @classmethod
60
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
61
+ from ..models.character import Character
62
+ from ..models.media import Media
63
+
64
+ d = dict(src_dict)
65
+ _character = d.pop("character", UNSET)
66
+ character: Character | Unset
67
+ if isinstance(_character, Unset):
68
+ character = UNSET
69
+ else:
70
+ character = Character.from_dict(_character)
71
+
72
+ _media = d.pop("media", UNSET)
73
+ media: Media | Unset
74
+ if isinstance(_media, Unset):
75
+ media = UNSET
76
+ else:
77
+ media = Media.from_dict(_media)
78
+
79
+ _role = d.pop("role", UNSET)
80
+ role: SeiyuuWithRolesRolesItemRole | Unset
81
+ if isinstance(_role, Unset):
82
+ role = UNSET
83
+ else:
84
+ role = SeiyuuWithRolesRolesItemRole(_role)
85
+
86
+ seiyuu_with_roles_roles_item = cls(
87
+ character=character,
88
+ media=media,
89
+ role=role,
90
+ )
91
+
92
+ seiyuu_with_roles_roles_item.additional_properties = d
93
+ return seiyuu_with_roles_roles_item
94
+
95
+ @property
96
+ def additional_keys(self) -> list[str]:
97
+ return list(self.additional_properties.keys())
98
+
99
+ def __getitem__(self, key: str) -> Any:
100
+ return self.additional_properties[key]
101
+
102
+ def __setitem__(self, key: str, value: Any) -> None:
103
+ self.additional_properties[key] = value
104
+
105
+ def __delitem__(self, key: str) -> None:
106
+ del self.additional_properties[key]
107
+
108
+ def __contains__(self, key: str) -> bool:
109
+ return key in self.additional_properties
@@ -0,0 +1,10 @@
1
+ from enum import Enum
2
+
3
+
4
+ class SeiyuuWithRolesRolesItemRole(str, Enum):
5
+ BACKGROUND = "BACKGROUND"
6
+ MAIN = "MAIN"
7
+ SUPPORTING = "SUPPORTING"
8
+
9
+ def __str__(self) -> str:
10
+ return str(self.value)
@@ -0,0 +1,88 @@
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.basic_info import BasicInfo
11
+ from ..models.media_info_path import MediaInfoPath
12
+ from ..models.segment_info import SegmentInfo
13
+
14
+
15
+ T = TypeVar("T", bound="Sentence")
16
+
17
+
18
+ @_attrs_define
19
+ class Sentence:
20
+ """A complete sentence result combining basic info, segment details, and media paths
21
+
22
+ Attributes:
23
+ basic_info (BasicInfo): Basic anime/media information included in search results
24
+ segment_info (SegmentInfo): Detailed information about a subtitle segment
25
+ media_info (MediaInfoPath): URLs to media resources for a segment
26
+ """
27
+
28
+ basic_info: BasicInfo
29
+ segment_info: SegmentInfo
30
+ media_info: MediaInfoPath
31
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
32
+
33
+ def to_dict(self) -> dict[str, Any]:
34
+ basic_info = self.basic_info.to_dict()
35
+
36
+ segment_info = self.segment_info.to_dict()
37
+
38
+ media_info = self.media_info.to_dict()
39
+
40
+ field_dict: dict[str, Any] = {}
41
+ field_dict.update(self.additional_properties)
42
+ field_dict.update(
43
+ {
44
+ "basic_info": basic_info,
45
+ "segment_info": segment_info,
46
+ "media_info": media_info,
47
+ }
48
+ )
49
+
50
+ return field_dict
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ from ..models.basic_info import BasicInfo
55
+ from ..models.media_info_path import MediaInfoPath
56
+ from ..models.segment_info import SegmentInfo
57
+
58
+ d = dict(src_dict)
59
+ basic_info = BasicInfo.from_dict(d.pop("basic_info"))
60
+
61
+ segment_info = SegmentInfo.from_dict(d.pop("segment_info"))
62
+
63
+ media_info = MediaInfoPath.from_dict(d.pop("media_info"))
64
+
65
+ sentence = cls(
66
+ basic_info=basic_info,
67
+ segment_info=segment_info,
68
+ media_info=media_info,
69
+ )
70
+
71
+ sentence.additional_properties = d
72
+ return sentence
73
+
74
+ @property
75
+ def additional_keys(self) -> list[str]:
76
+ return list(self.additional_properties.keys())
77
+
78
+ def __getitem__(self, key: str) -> Any:
79
+ return self.additional_properties[key]
80
+
81
+ def __setitem__(self, key: str, value: Any) -> None:
82
+ self.additional_properties[key] = value
83
+
84
+ def __delitem__(self, key: str) -> None:
85
+ del self.additional_properties[key]
86
+
87
+ def __contains__(self, key: str) -> bool:
88
+ return key in self.additional_properties
@@ -0,0 +1,132 @@
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.statistic_season_with_episode_hits import StatisticSeasonWithEpisodeHits
13
+
14
+
15
+ T = TypeVar("T", bound="Statistic")
16
+
17
+
18
+ @_attrs_define
19
+ class Statistic:
20
+ """Search result statistics grouped by anime/media
21
+
22
+ Attributes:
23
+ anime_id (int | Unset): Unique identifier for the anime/media Example: 110316.
24
+ category (int | Unset): Media category (1=Anime, 2=Unknown, 3=J-Drama, 4=Audiobook) Example: 1.
25
+ name_anime_romaji (str | Unset): Romaji transliteration of the anime name Example: Steins;Gate.
26
+ name_anime_en (str | Unset): English translation of the anime name Example: Steins;Gate.
27
+ name_anime_jp (str | Unset): Original Japanese name of the anime Example: シュタインズ・ゲート.
28
+ amount_sentences_found (int | Unset): Total number of sentences found for this anime Example: 42.
29
+ season_with_episode_hits (StatisticSeasonWithEpisodeHits | Unset): Nested object mapping seasons to episodes
30
+ with hit counts Example: {'1': {'1': 5, '2': 8, '3': 3}}.
31
+ """
32
+
33
+ anime_id: int | Unset = UNSET
34
+ category: int | Unset = UNSET
35
+ name_anime_romaji: str | Unset = UNSET
36
+ name_anime_en: str | Unset = UNSET
37
+ name_anime_jp: str | Unset = UNSET
38
+ amount_sentences_found: int | Unset = UNSET
39
+ season_with_episode_hits: StatisticSeasonWithEpisodeHits | Unset = UNSET
40
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
41
+
42
+ def to_dict(self) -> dict[str, Any]:
43
+ anime_id = self.anime_id
44
+
45
+ category = self.category
46
+
47
+ name_anime_romaji = self.name_anime_romaji
48
+
49
+ name_anime_en = self.name_anime_en
50
+
51
+ name_anime_jp = self.name_anime_jp
52
+
53
+ amount_sentences_found = self.amount_sentences_found
54
+
55
+ season_with_episode_hits: dict[str, Any] | Unset = UNSET
56
+ if not isinstance(self.season_with_episode_hits, Unset):
57
+ season_with_episode_hits = self.season_with_episode_hits.to_dict()
58
+
59
+ field_dict: dict[str, Any] = {}
60
+ field_dict.update(self.additional_properties)
61
+ field_dict.update({})
62
+ if anime_id is not UNSET:
63
+ field_dict["anime_id"] = anime_id
64
+ if category is not UNSET:
65
+ field_dict["category"] = category
66
+ if name_anime_romaji is not UNSET:
67
+ field_dict["name_anime_romaji"] = name_anime_romaji
68
+ if name_anime_en is not UNSET:
69
+ field_dict["name_anime_en"] = name_anime_en
70
+ if name_anime_jp is not UNSET:
71
+ field_dict["name_anime_jp"] = name_anime_jp
72
+ if amount_sentences_found is not UNSET:
73
+ field_dict["amount_sentences_found"] = amount_sentences_found
74
+ if season_with_episode_hits is not UNSET:
75
+ field_dict["season_with_episode_hits"] = season_with_episode_hits
76
+
77
+ return field_dict
78
+
79
+ @classmethod
80
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
81
+ from ..models.statistic_season_with_episode_hits import StatisticSeasonWithEpisodeHits
82
+
83
+ d = dict(src_dict)
84
+ anime_id = d.pop("anime_id", UNSET)
85
+
86
+ category = d.pop("category", UNSET)
87
+
88
+ name_anime_romaji = d.pop("name_anime_romaji", UNSET)
89
+
90
+ name_anime_en = d.pop("name_anime_en", UNSET)
91
+
92
+ name_anime_jp = d.pop("name_anime_jp", UNSET)
93
+
94
+ amount_sentences_found = d.pop("amount_sentences_found", UNSET)
95
+
96
+ _season_with_episode_hits = d.pop("season_with_episode_hits", UNSET)
97
+ season_with_episode_hits: StatisticSeasonWithEpisodeHits | Unset
98
+ if isinstance(_season_with_episode_hits, Unset):
99
+ season_with_episode_hits = UNSET
100
+ else:
101
+ season_with_episode_hits = StatisticSeasonWithEpisodeHits.from_dict(
102
+ _season_with_episode_hits
103
+ )
104
+
105
+ statistic = cls(
106
+ anime_id=anime_id,
107
+ category=category,
108
+ name_anime_romaji=name_anime_romaji,
109
+ name_anime_en=name_anime_en,
110
+ name_anime_jp=name_anime_jp,
111
+ amount_sentences_found=amount_sentences_found,
112
+ season_with_episode_hits=season_with_episode_hits,
113
+ )
114
+
115
+ statistic.additional_properties = d
116
+ return statistic
117
+
118
+ @property
119
+ def additional_keys(self) -> list[str]:
120
+ return list(self.additional_properties.keys())
121
+
122
+ def __getitem__(self, key: str) -> Any:
123
+ return self.additional_properties[key]
124
+
125
+ def __setitem__(self, key: str, value: Any) -> None:
126
+ self.additional_properties[key] = value
127
+
128
+ def __delitem__(self, key: str) -> None:
129
+ del self.additional_properties[key]
130
+
131
+ def __contains__(self, key: str) -> bool:
132
+ return key in self.additional_properties
@@ -0,0 +1,74 @@
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.statistic_season_with_episode_hits_additional_property import (
11
+ StatisticSeasonWithEpisodeHitsAdditionalProperty,
12
+ )
13
+
14
+
15
+ T = TypeVar("T", bound="StatisticSeasonWithEpisodeHits")
16
+
17
+
18
+ @_attrs_define
19
+ class StatisticSeasonWithEpisodeHits:
20
+ """Nested object mapping seasons to episodes with hit counts
21
+
22
+ Example:
23
+ {'1': {'1': 5, '2': 8, '3': 3}}
24
+
25
+ """
26
+
27
+ additional_properties: dict[str, StatisticSeasonWithEpisodeHitsAdditionalProperty] = (
28
+ _attrs_field(init=False, factory=dict)
29
+ )
30
+
31
+ def to_dict(self) -> dict[str, Any]:
32
+ field_dict: dict[str, Any] = {}
33
+ for prop_name, prop in self.additional_properties.items():
34
+ field_dict[prop_name] = prop.to_dict()
35
+
36
+ return field_dict
37
+
38
+ @classmethod
39
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
40
+ from ..models.statistic_season_with_episode_hits_additional_property import (
41
+ StatisticSeasonWithEpisodeHitsAdditionalProperty,
42
+ )
43
+
44
+ d = dict(src_dict)
45
+ statistic_season_with_episode_hits = cls()
46
+
47
+ additional_properties = {}
48
+ for prop_name, prop_dict in d.items():
49
+ additional_property = StatisticSeasonWithEpisodeHitsAdditionalProperty.from_dict(
50
+ prop_dict
51
+ )
52
+
53
+ additional_properties[prop_name] = additional_property
54
+
55
+ statistic_season_with_episode_hits.additional_properties = additional_properties
56
+ return statistic_season_with_episode_hits
57
+
58
+ @property
59
+ def additional_keys(self) -> list[str]:
60
+ return list(self.additional_properties.keys())
61
+
62
+ def __getitem__(self, key: str) -> StatisticSeasonWithEpisodeHitsAdditionalProperty:
63
+ return self.additional_properties[key]
64
+
65
+ def __setitem__(
66
+ self, key: str, value: StatisticSeasonWithEpisodeHitsAdditionalProperty
67
+ ) -> None:
68
+ self.additional_properties[key] = value
69
+
70
+ def __delitem__(self, key: str) -> None:
71
+ del self.additional_properties[key]
72
+
73
+ def __contains__(self, key: str) -> bool:
74
+ 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="StatisticSeasonWithEpisodeHitsAdditionalProperty")
10
+
11
+
12
+ @_attrs_define
13
+ class StatisticSeasonWithEpisodeHitsAdditionalProperty:
14
+ """ """
15
+
16
+ additional_properties: dict[str, int] = _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
+ statistic_season_with_episode_hits_additional_property = cls()
28
+
29
+ statistic_season_with_episode_hits_additional_property.additional_properties = d
30
+ return statistic_season_with_episode_hits_additional_property
31
+
32
+ @property
33
+ def additional_keys(self) -> list[str]:
34
+ return list(self.additional_properties.keys())
35
+
36
+ def __getitem__(self, key: str) -> int:
37
+ return self.additional_properties[key]
38
+
39
+ def __setitem__(self, key: str, value: int) -> 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,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.user_info_response_user import UserInfoResponseUser
13
+
14
+
15
+ T = TypeVar("T", bound="UserInfoResponse")
16
+
17
+
18
+ @_attrs_define
19
+ class UserInfoResponse:
20
+ """User info response
21
+
22
+ Attributes:
23
+ user (UserInfoResponseUser):
24
+ status (int | Unset): HTTP status code
25
+ """
26
+
27
+ user: UserInfoResponseUser
28
+ status: 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
+ user = self.user.to_dict()
33
+
34
+ status = self.status
35
+
36
+ field_dict: dict[str, Any] = {}
37
+ field_dict.update(self.additional_properties)
38
+ field_dict.update(
39
+ {
40
+ "user": user,
41
+ }
42
+ )
43
+ if status is not UNSET:
44
+ field_dict["status"] = status
45
+
46
+ return field_dict
47
+
48
+ @classmethod
49
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
50
+ from ..models.user_info_response_user import UserInfoResponseUser
51
+
52
+ d = dict(src_dict)
53
+ user = UserInfoResponseUser.from_dict(d.pop("user"))
54
+
55
+ status = d.pop("status", UNSET)
56
+
57
+ user_info_response = cls(
58
+ user=user,
59
+ status=status,
60
+ )
61
+
62
+ user_info_response.additional_properties = d
63
+ return user_info_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