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,138 @@
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.list_input_list_type import ListInputListType
10
+ from ..models.list_input_list_visibility import ListInputListVisibility
11
+ from ..types import UNSET, Unset
12
+
13
+ T = TypeVar("T", bound="ListInput")
14
+
15
+
16
+ @_attrs_define
17
+ class ListInput:
18
+ """List data for adding media to a list
19
+
20
+ Attributes:
21
+ position (int): Position/order of media in the list (1-indexed) Example: 1.
22
+ list_id (int | None | Unset): Existing list ID (if adding to existing list) Example: 123.
23
+ list_name (None | str | Unset): Name for new list (if creating new list) Example: Bakuman Series.
24
+ list_type (ListInputListType | Unset): Type of list (if creating new list) Example: SERIES.
25
+ list_visibility (ListInputListVisibility | Unset): Visibility of list (if creating new list) Example: PUBLIC.
26
+ """
27
+
28
+ position: int
29
+ list_id: int | None | Unset = UNSET
30
+ list_name: None | str | Unset = UNSET
31
+ list_type: ListInputListType | Unset = UNSET
32
+ list_visibility: ListInputListVisibility | Unset = UNSET
33
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
34
+
35
+ def to_dict(self) -> dict[str, Any]:
36
+ position = self.position
37
+
38
+ list_id: int | None | Unset
39
+ if isinstance(self.list_id, Unset):
40
+ list_id = UNSET
41
+ else:
42
+ list_id = self.list_id
43
+
44
+ list_name: None | str | Unset
45
+ if isinstance(self.list_name, Unset):
46
+ list_name = UNSET
47
+ else:
48
+ list_name = self.list_name
49
+
50
+ list_type: str | Unset = UNSET
51
+ if not isinstance(self.list_type, Unset):
52
+ list_type = self.list_type.value
53
+
54
+ list_visibility: str | Unset = UNSET
55
+ if not isinstance(self.list_visibility, Unset):
56
+ list_visibility = self.list_visibility.value
57
+
58
+ field_dict: dict[str, Any] = {}
59
+ field_dict.update(self.additional_properties)
60
+ field_dict.update(
61
+ {
62
+ "position": position,
63
+ }
64
+ )
65
+ if list_id is not UNSET:
66
+ field_dict["listId"] = list_id
67
+ if list_name is not UNSET:
68
+ field_dict["listName"] = list_name
69
+ if list_type is not UNSET:
70
+ field_dict["listType"] = list_type
71
+ if list_visibility is not UNSET:
72
+ field_dict["listVisibility"] = list_visibility
73
+
74
+ return field_dict
75
+
76
+ @classmethod
77
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
78
+ d = dict(src_dict)
79
+ position = d.pop("position")
80
+
81
+ def _parse_list_id(data: object) -> int | None | Unset:
82
+ if data is None:
83
+ return data
84
+ if isinstance(data, Unset):
85
+ return data
86
+ return cast(int | None | Unset, data)
87
+
88
+ list_id = _parse_list_id(d.pop("listId", UNSET))
89
+
90
+ def _parse_list_name(data: object) -> None | str | Unset:
91
+ if data is None:
92
+ return data
93
+ if isinstance(data, Unset):
94
+ return data
95
+ return cast(None | str | Unset, data)
96
+
97
+ list_name = _parse_list_name(d.pop("listName", UNSET))
98
+
99
+ _list_type = d.pop("listType", UNSET)
100
+ list_type: ListInputListType | Unset
101
+ if isinstance(_list_type, Unset):
102
+ list_type = UNSET
103
+ else:
104
+ list_type = ListInputListType(_list_type)
105
+
106
+ _list_visibility = d.pop("listVisibility", UNSET)
107
+ list_visibility: ListInputListVisibility | Unset
108
+ if isinstance(_list_visibility, Unset):
109
+ list_visibility = UNSET
110
+ else:
111
+ list_visibility = ListInputListVisibility(_list_visibility)
112
+
113
+ list_input = cls(
114
+ position=position,
115
+ list_id=list_id,
116
+ list_name=list_name,
117
+ list_type=list_type,
118
+ list_visibility=list_visibility,
119
+ )
120
+
121
+ list_input.additional_properties = d
122
+ return list_input
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,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListInputListType(str, Enum):
5
+ CUSTOM = "CUSTOM"
6
+ SERIES = "SERIES"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListInputListVisibility(str, Enum):
5
+ PRIVATE = "PRIVATE"
6
+ PUBLIC = "PUBLIC"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,61 @@
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="ListRemoveItemResponse200")
12
+
13
+
14
+ @_attrs_define
15
+ class ListRemoveItemResponse200:
16
+ """
17
+ Attributes:
18
+ message (str | Unset): Example: Media removed from list.
19
+ """
20
+
21
+ message: str | Unset = UNSET
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ message = self.message
26
+
27
+ field_dict: dict[str, Any] = {}
28
+ field_dict.update(self.additional_properties)
29
+ field_dict.update({})
30
+ if message is not UNSET:
31
+ field_dict["message"] = message
32
+
33
+ return field_dict
34
+
35
+ @classmethod
36
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
37
+ d = dict(src_dict)
38
+ message = d.pop("message", UNSET)
39
+
40
+ list_remove_item_response_200 = cls(
41
+ message=message,
42
+ )
43
+
44
+ list_remove_item_response_200.additional_properties = d
45
+ return list_remove_item_response_200
46
+
47
+ @property
48
+ def additional_keys(self) -> list[str]:
49
+ return list(self.additional_properties.keys())
50
+
51
+ def __getitem__(self, key: str) -> Any:
52
+ return self.additional_properties[key]
53
+
54
+ def __setitem__(self, key: str, value: Any) -> None:
55
+ self.additional_properties[key] = value
56
+
57
+ def __delitem__(self, key: str) -> None:
58
+ del self.additional_properties[key]
59
+
60
+ def __contains__(self, key: str) -> bool:
61
+ return key in self.additional_properties
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListType(str, Enum):
5
+ CUSTOM = "CUSTOM"
6
+ SERIES = "SERIES"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -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
+ from ..models.list_update_body_visibility import ListUpdateBodyVisibility
10
+ from ..types import UNSET, Unset
11
+
12
+ T = TypeVar("T", bound="ListUpdateBody")
13
+
14
+
15
+ @_attrs_define
16
+ class ListUpdateBody:
17
+ """
18
+ Attributes:
19
+ name (str | Unset): Example: Updated List Name.
20
+ visibility (ListUpdateBodyVisibility | Unset): Example: PUBLIC.
21
+ """
22
+
23
+ name: str | Unset = UNSET
24
+ visibility: ListUpdateBodyVisibility | Unset = UNSET
25
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
26
+
27
+ def to_dict(self) -> dict[str, Any]:
28
+ name = self.name
29
+
30
+ visibility: str | Unset = UNSET
31
+ if not isinstance(self.visibility, Unset):
32
+ visibility = self.visibility.value
33
+
34
+ field_dict: dict[str, Any] = {}
35
+ field_dict.update(self.additional_properties)
36
+ field_dict.update({})
37
+ if name is not UNSET:
38
+ field_dict["name"] = name
39
+ if visibility is not UNSET:
40
+ field_dict["visibility"] = visibility
41
+
42
+ return field_dict
43
+
44
+ @classmethod
45
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
46
+ d = dict(src_dict)
47
+ name = d.pop("name", UNSET)
48
+
49
+ _visibility = d.pop("visibility", UNSET)
50
+ visibility: ListUpdateBodyVisibility | Unset
51
+ if isinstance(_visibility, Unset):
52
+ visibility = UNSET
53
+ else:
54
+ visibility = ListUpdateBodyVisibility(_visibility)
55
+
56
+ list_update_body = cls(
57
+ name=name,
58
+ visibility=visibility,
59
+ )
60
+
61
+ list_update_body.additional_properties = d
62
+ return list_update_body
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,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListUpdateBodyVisibility(str, Enum):
5
+ PRIVATE = "PRIVATE"
6
+ PUBLIC = "PUBLIC"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,61 @@
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="ListUpdateItemBody")
10
+
11
+
12
+ @_attrs_define
13
+ class ListUpdateItemBody:
14
+ """
15
+ Attributes:
16
+ position (int): New position in the list (1-indexed) Example: 2.
17
+ """
18
+
19
+ position: int
20
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
21
+
22
+ def to_dict(self) -> dict[str, Any]:
23
+ position = self.position
24
+
25
+ field_dict: dict[str, Any] = {}
26
+ field_dict.update(self.additional_properties)
27
+ field_dict.update(
28
+ {
29
+ "position": position,
30
+ }
31
+ )
32
+
33
+ return field_dict
34
+
35
+ @classmethod
36
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
37
+ d = dict(src_dict)
38
+ position = d.pop("position")
39
+
40
+ list_update_item_body = cls(
41
+ position=position,
42
+ )
43
+
44
+ list_update_item_body.additional_properties = d
45
+ return list_update_item_body
46
+
47
+ @property
48
+ def additional_keys(self) -> list[str]:
49
+ return list(self.additional_properties.keys())
50
+
51
+ def __getitem__(self, key: str) -> Any:
52
+ return self.additional_properties[key]
53
+
54
+ def __setitem__(self, key: str, value: Any) -> None:
55
+ self.additional_properties[key] = value
56
+
57
+ def __delitem__(self, key: str) -> None:
58
+ del self.additional_properties[key]
59
+
60
+ def __contains__(self, key: str) -> bool:
61
+ return key in self.additional_properties
@@ -0,0 +1,61 @@
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="ListUpdateItemResponse200")
12
+
13
+
14
+ @_attrs_define
15
+ class ListUpdateItemResponse200:
16
+ """
17
+ Attributes:
18
+ message (str | Unset): Example: Position updated.
19
+ """
20
+
21
+ message: str | Unset = UNSET
22
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ message = self.message
26
+
27
+ field_dict: dict[str, Any] = {}
28
+ field_dict.update(self.additional_properties)
29
+ field_dict.update({})
30
+ if message is not UNSET:
31
+ field_dict["message"] = message
32
+
33
+ return field_dict
34
+
35
+ @classmethod
36
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
37
+ d = dict(src_dict)
38
+ message = d.pop("message", UNSET)
39
+
40
+ list_update_item_response_200 = cls(
41
+ message=message,
42
+ )
43
+
44
+ list_update_item_response_200.additional_properties = d
45
+ return list_update_item_response_200
46
+
47
+ @property
48
+ def additional_keys(self) -> list[str]:
49
+ return list(self.additional_properties.keys())
50
+
51
+ def __getitem__(self, key: str) -> Any:
52
+ return self.additional_properties[key]
53
+
54
+ def __setitem__(self, key: str, value: Any) -> None:
55
+ self.additional_properties[key] = value
56
+
57
+ def __delitem__(self, key: str) -> None:
58
+ del self.additional_properties[key]
59
+
60
+ def __contains__(self, key: str) -> bool:
61
+ return key in self.additional_properties
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListVisibility(str, Enum):
5
+ PRIVATE = "PRIVATE"
6
+ PUBLIC = "PUBLIC"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,119 @@
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.list_with_media_type import ListWithMediaType
10
+ from ..models.list_with_media_visibility import ListWithMediaVisibility
11
+
12
+ if TYPE_CHECKING:
13
+ from ..models.list_with_media_media_item import ListWithMediaMediaItem
14
+
15
+
16
+ T = TypeVar("T", bound="ListWithMedia")
17
+
18
+
19
+ @_attrs_define
20
+ class ListWithMedia:
21
+ """List with all media in order
22
+
23
+ Attributes:
24
+ id (int): List ID Example: 123.
25
+ name (str): Name of the list Example: Bakuman Series.
26
+ type_ (ListWithMediaType): Type of list Example: SERIES.
27
+ user_id (int): User ID who owns the list (1 = admin) Example: 1.
28
+ visibility (ListWithMediaVisibility): Visibility of the list Example: PUBLIC.
29
+ media (list[ListWithMediaMediaItem]): All media in the list, sorted by position
30
+ """
31
+
32
+ id: int
33
+ name: str
34
+ type_: ListWithMediaType
35
+ user_id: int
36
+ visibility: ListWithMediaVisibility
37
+ media: list[ListWithMediaMediaItem]
38
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ id = self.id
42
+
43
+ name = self.name
44
+
45
+ type_ = self.type_.value
46
+
47
+ user_id = self.user_id
48
+
49
+ visibility = self.visibility.value
50
+
51
+ media = []
52
+ for media_item_data in self.media:
53
+ media_item = media_item_data.to_dict()
54
+ media.append(media_item)
55
+
56
+ field_dict: dict[str, Any] = {}
57
+ field_dict.update(self.additional_properties)
58
+ field_dict.update(
59
+ {
60
+ "id": id,
61
+ "name": name,
62
+ "type": type_,
63
+ "userId": user_id,
64
+ "visibility": visibility,
65
+ "media": media,
66
+ }
67
+ )
68
+
69
+ return field_dict
70
+
71
+ @classmethod
72
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
73
+ from ..models.list_with_media_media_item import ListWithMediaMediaItem
74
+
75
+ d = dict(src_dict)
76
+ id = d.pop("id")
77
+
78
+ name = d.pop("name")
79
+
80
+ type_ = ListWithMediaType(d.pop("type"))
81
+
82
+ user_id = d.pop("userId")
83
+
84
+ visibility = ListWithMediaVisibility(d.pop("visibility"))
85
+
86
+ media = []
87
+ _media = d.pop("media")
88
+ for media_item_data in _media:
89
+ media_item = ListWithMediaMediaItem.from_dict(media_item_data)
90
+
91
+ media.append(media_item)
92
+
93
+ list_with_media = cls(
94
+ id=id,
95
+ name=name,
96
+ type_=type_,
97
+ user_id=user_id,
98
+ visibility=visibility,
99
+ media=media,
100
+ )
101
+
102
+ list_with_media.additional_properties = d
103
+ return list_with_media
104
+
105
+ @property
106
+ def additional_keys(self) -> list[str]:
107
+ return list(self.additional_properties.keys())
108
+
109
+ def __getitem__(self, key: str) -> Any:
110
+ return self.additional_properties[key]
111
+
112
+ def __setitem__(self, key: str, value: Any) -> None:
113
+ self.additional_properties[key] = value
114
+
115
+ def __delitem__(self, key: str) -> None:
116
+ del self.additional_properties[key]
117
+
118
+ def __contains__(self, key: str) -> bool:
119
+ return key in self.additional_properties
@@ -0,0 +1,83 @@
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="ListWithMediaMediaItem")
16
+
17
+
18
+ @_attrs_define
19
+ class ListWithMediaMediaItem:
20
+ """
21
+ Attributes:
22
+ position (int | Unset): Position in the list (1-indexed) Example: 1.
23
+ media (Media | Unset): Media entry with full metadata
24
+ """
25
+
26
+ position: int | Unset = UNSET
27
+ media: Media | Unset = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ position = self.position
32
+
33
+ media: dict[str, Any] | Unset = UNSET
34
+ if not isinstance(self.media, Unset):
35
+ media = self.media.to_dict()
36
+
37
+ field_dict: dict[str, Any] = {}
38
+ field_dict.update(self.additional_properties)
39
+ field_dict.update({})
40
+ if position is not UNSET:
41
+ field_dict["position"] = position
42
+ if media is not UNSET:
43
+ field_dict["media"] = media
44
+
45
+ return field_dict
46
+
47
+ @classmethod
48
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
49
+ from ..models.media import Media
50
+
51
+ d = dict(src_dict)
52
+ position = d.pop("position", UNSET)
53
+
54
+ _media = d.pop("media", UNSET)
55
+ media: Media | Unset
56
+ if isinstance(_media, Unset):
57
+ media = UNSET
58
+ else:
59
+ media = Media.from_dict(_media)
60
+
61
+ list_with_media_media_item = cls(
62
+ position=position,
63
+ media=media,
64
+ )
65
+
66
+ list_with_media_media_item.additional_properties = d
67
+ return list_with_media_media_item
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,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListWithMediaType(str, Enum):
5
+ CUSTOM = "CUSTOM"
6
+ SERIES = "SERIES"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)
@@ -0,0 +1,9 @@
1
+ from enum import Enum
2
+
3
+
4
+ class ListWithMediaVisibility(str, Enum):
5
+ PRIVATE = "PRIVATE"
6
+ PUBLIC = "PUBLIC"
7
+
8
+ def __str__(self) -> str:
9
+ return str(self.value)