minikai 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.

Potentially problematic release.


This version of minikai might be problematic. Click here for more details.

Files changed (87) hide show
  1. minikai/__init__.py +8 -0
  2. minikai/api/__init__.py +1 -0
  3. minikai/api/groups/__init__.py +1 -0
  4. minikai/api/groups/add_minis_to_group.py +176 -0
  5. minikai/api/groups/add_users_to_group.py +176 -0
  6. minikai/api/groups/create_group.py +160 -0
  7. minikai/api/groups/delete_group.py +95 -0
  8. minikai/api/groups/get_group.py +151 -0
  9. minikai/api/groups/get_group_minis.py +156 -0
  10. minikai/api/groups/get_group_users.py +156 -0
  11. minikai/api/groups/get_groups.py +128 -0
  12. minikai/api/groups/remove_minis_from_group.py +176 -0
  13. minikai/api/groups/remove_users_from_group.py +176 -0
  14. minikai/api/groups/update_group.py +177 -0
  15. minikai/api/minis/__init__.py +1 -0
  16. minikai/api/minis/create_mini.py +160 -0
  17. minikai/api/minis/delete_mini.py +95 -0
  18. minikai/api/minis/get_external_mini.py +164 -0
  19. minikai/api/minis/get_minis.py +128 -0
  20. minikai/api/minis/patch_mini.py +177 -0
  21. minikai/api/minis/update_mini.py +177 -0
  22. minikai/api/records/__init__.py +1 -0
  23. minikai/api/records/add_attachments.py +182 -0
  24. minikai/api/records/add_relations.py +187 -0
  25. minikai/api/records/create_record.py +162 -0
  26. minikai/api/records/delete_record.py +95 -0
  27. minikai/api/records/get_records_by_external.py +230 -0
  28. minikai/api/records/remove_attachments.py +110 -0
  29. minikai/api/records/remove_relations.py +110 -0
  30. minikai/api/records/update_attachments.py +182 -0
  31. minikai/api/records/update_record.py +179 -0
  32. minikai/api/records/update_relations.py +187 -0
  33. minikai/api/users/__init__.py +1 -0
  34. minikai/api/users/delete_api_users_minis.py +102 -0
  35. minikai/api/users/get_api_users_minis.py +156 -0
  36. minikai/api/users/get_users.py +128 -0
  37. minikai/api/users/post_api_users_minis.py +168 -0
  38. minikai/client.py +268 -0
  39. minikai/errors.py +16 -0
  40. minikai/models/__init__.py +89 -0
  41. minikai/models/add_attachments_body.py +98 -0
  42. minikai/models/create_group_command.py +102 -0
  43. minikai/models/create_mini_command.py +120 -0
  44. minikai/models/create_record_command.py +268 -0
  45. minikai/models/create_record_command_tags.py +44 -0
  46. minikai/models/document_file_dto.py +147 -0
  47. minikai/models/form_field.py +112 -0
  48. minikai/models/form_field_dto.py +149 -0
  49. minikai/models/form_field_type.py +16 -0
  50. minikai/models/group_dto.py +124 -0
  51. minikai/models/http_validation_problem_details.py +173 -0
  52. minikai/models/http_validation_problem_details_errors.py +51 -0
  53. minikai/models/json_node.py +119 -0
  54. minikai/models/json_node_options.py +42 -0
  55. minikai/models/mini_dto.py +189 -0
  56. minikai/models/mini_template_dto.py +135 -0
  57. minikai/models/paginated_list_of_record_dto.py +101 -0
  58. minikai/models/patch_mini_command.py +80 -0
  59. minikai/models/problem_details.py +151 -0
  60. minikai/models/record.py +379 -0
  61. minikai/models/record_attachment.py +236 -0
  62. minikai/models/record_attachment_dto.py +236 -0
  63. minikai/models/record_attachment_dto_metadata_type_0.py +44 -0
  64. minikai/models/record_attachment_metadata_type_0.py +44 -0
  65. minikai/models/record_authorization.py +75 -0
  66. minikai/models/record_authorization_dto.py +75 -0
  67. minikai/models/record_dto.py +377 -0
  68. minikai/models/record_dto_tags.py +44 -0
  69. minikai/models/record_relation.py +81 -0
  70. minikai/models/record_relation_dto.py +81 -0
  71. minikai/models/record_tags.py +44 -0
  72. minikai/models/slim_mini_dto.py +168 -0
  73. minikai/models/tool_dto.py +76 -0
  74. minikai/models/update_attachments_body.py +98 -0
  75. minikai/models/update_group_command.py +122 -0
  76. minikai/models/update_mini_command.py +129 -0
  77. minikai/models/update_mini_template_workspaces_command.py +51 -0
  78. minikai/models/update_record_command.py +266 -0
  79. minikai/models/update_record_command_tags.py +44 -0
  80. minikai/models/user_dto.py +182 -0
  81. minikai/models/user_to_mini_dto.py +78 -0
  82. minikai/models/workspace_dto.py +78 -0
  83. minikai/py.typed +1 -0
  84. minikai/types.py +54 -0
  85. minikai-0.1.0.dist-info/METADATA +133 -0
  86. minikai-0.1.0.dist-info/RECORD +87 -0
  87. minikai-0.1.0.dist-info/WHEEL +4 -0
@@ -0,0 +1,189 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.document_file_dto import DocumentFileDto
10
+ from ..models.mini_template_dto import MiniTemplateDto
11
+ from ..models.workspace_dto import WorkspaceDto
12
+
13
+
14
+ T = TypeVar("T", bound="MiniDto")
15
+
16
+
17
+ @_attrs_define
18
+ class MiniDto:
19
+ """
20
+ Attributes:
21
+ id (Union[Unset, int]):
22
+ name (Union[Unset, str]):
23
+ description (Union[None, Unset, str]):
24
+ instructions (Union[None, Unset, str]):
25
+ template_id (Union[None, Unset, str]):
26
+ template (Union['MiniTemplateDto', None, Unset]):
27
+ workspaces (Union[Unset, list['WorkspaceDto']]):
28
+ document_files (Union[Unset, list['DocumentFileDto']]):
29
+ """
30
+
31
+ id: Union[Unset, int] = UNSET
32
+ name: Union[Unset, str] = UNSET
33
+ description: Union[None, Unset, str] = UNSET
34
+ instructions: Union[None, Unset, str] = UNSET
35
+ template_id: Union[None, Unset, str] = UNSET
36
+ template: Union["MiniTemplateDto", None, Unset] = UNSET
37
+ workspaces: Union[Unset, list["WorkspaceDto"]] = UNSET
38
+ document_files: Union[Unset, list["DocumentFileDto"]] = UNSET
39
+
40
+ def to_dict(self) -> dict[str, Any]:
41
+ from ..models.mini_template_dto import MiniTemplateDto
42
+
43
+ id = self.id
44
+
45
+ name = self.name
46
+
47
+ description: Union[None, Unset, str]
48
+ if isinstance(self.description, Unset):
49
+ description = UNSET
50
+ else:
51
+ description = self.description
52
+
53
+ instructions: Union[None, Unset, str]
54
+ if isinstance(self.instructions, Unset):
55
+ instructions = UNSET
56
+ else:
57
+ instructions = self.instructions
58
+
59
+ template_id: Union[None, Unset, str]
60
+ if isinstance(self.template_id, Unset):
61
+ template_id = UNSET
62
+ else:
63
+ template_id = self.template_id
64
+
65
+ template: Union[None, Unset, dict[str, Any]]
66
+ if isinstance(self.template, Unset):
67
+ template = UNSET
68
+ elif isinstance(self.template, MiniTemplateDto):
69
+ template = self.template.to_dict()
70
+ else:
71
+ template = self.template
72
+
73
+ workspaces: Union[Unset, list[dict[str, Any]]] = UNSET
74
+ if not isinstance(self.workspaces, Unset):
75
+ workspaces = []
76
+ for workspaces_item_data in self.workspaces:
77
+ workspaces_item = workspaces_item_data.to_dict()
78
+ workspaces.append(workspaces_item)
79
+
80
+ document_files: Union[Unset, list[dict[str, Any]]] = UNSET
81
+ if not isinstance(self.document_files, Unset):
82
+ document_files = []
83
+ for document_files_item_data in self.document_files:
84
+ document_files_item = document_files_item_data.to_dict()
85
+ document_files.append(document_files_item)
86
+
87
+ field_dict: dict[str, Any] = {}
88
+
89
+ field_dict.update({})
90
+ if id is not UNSET:
91
+ field_dict["id"] = id
92
+ if name is not UNSET:
93
+ field_dict["name"] = name
94
+ if description is not UNSET:
95
+ field_dict["description"] = description
96
+ if instructions is not UNSET:
97
+ field_dict["instructions"] = instructions
98
+ if template_id is not UNSET:
99
+ field_dict["templateId"] = template_id
100
+ if template is not UNSET:
101
+ field_dict["template"] = template
102
+ if workspaces is not UNSET:
103
+ field_dict["workspaces"] = workspaces
104
+ if document_files is not UNSET:
105
+ field_dict["documentFiles"] = document_files
106
+
107
+ return field_dict
108
+
109
+ @classmethod
110
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
111
+ from ..models.document_file_dto import DocumentFileDto
112
+ from ..models.mini_template_dto import MiniTemplateDto
113
+ from ..models.workspace_dto import WorkspaceDto
114
+
115
+ d = dict(src_dict)
116
+ id = d.pop("id", UNSET)
117
+
118
+ name = d.pop("name", UNSET)
119
+
120
+ def _parse_description(data: object) -> Union[None, Unset, str]:
121
+ if data is None:
122
+ return data
123
+ if isinstance(data, Unset):
124
+ return data
125
+ return cast(Union[None, Unset, str], data)
126
+
127
+ description = _parse_description(d.pop("description", UNSET))
128
+
129
+ def _parse_instructions(data: object) -> Union[None, Unset, str]:
130
+ if data is None:
131
+ return data
132
+ if isinstance(data, Unset):
133
+ return data
134
+ return cast(Union[None, Unset, str], data)
135
+
136
+ instructions = _parse_instructions(d.pop("instructions", UNSET))
137
+
138
+ def _parse_template_id(data: object) -> Union[None, Unset, str]:
139
+ if data is None:
140
+ return data
141
+ if isinstance(data, Unset):
142
+ return data
143
+ return cast(Union[None, Unset, str], data)
144
+
145
+ template_id = _parse_template_id(d.pop("templateId", UNSET))
146
+
147
+ def _parse_template(data: object) -> Union["MiniTemplateDto", None, Unset]:
148
+ if data is None:
149
+ return data
150
+ if isinstance(data, Unset):
151
+ return data
152
+ try:
153
+ if not isinstance(data, dict):
154
+ raise TypeError()
155
+ template_type_0 = MiniTemplateDto.from_dict(data)
156
+
157
+ return template_type_0
158
+ except: # noqa: E722
159
+ pass
160
+ return cast(Union["MiniTemplateDto", None, Unset], data)
161
+
162
+ template = _parse_template(d.pop("template", UNSET))
163
+
164
+ workspaces = []
165
+ _workspaces = d.pop("workspaces", UNSET)
166
+ for workspaces_item_data in _workspaces or []:
167
+ workspaces_item = WorkspaceDto.from_dict(workspaces_item_data)
168
+
169
+ workspaces.append(workspaces_item)
170
+
171
+ document_files = []
172
+ _document_files = d.pop("documentFiles", UNSET)
173
+ for document_files_item_data in _document_files or []:
174
+ document_files_item = DocumentFileDto.from_dict(document_files_item_data)
175
+
176
+ document_files.append(document_files_item)
177
+
178
+ mini_dto = cls(
179
+ id=id,
180
+ name=name,
181
+ description=description,
182
+ instructions=instructions,
183
+ template_id=template_id,
184
+ template=template,
185
+ workspaces=workspaces,
186
+ document_files=document_files,
187
+ )
188
+
189
+ return mini_dto
@@ -0,0 +1,135 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.tool_dto import ToolDto
10
+ from ..models.workspace_dto import WorkspaceDto
11
+
12
+
13
+ T = TypeVar("T", bound="MiniTemplateDto")
14
+
15
+
16
+ @_attrs_define
17
+ class MiniTemplateDto:
18
+ """
19
+ Attributes:
20
+ id (Union[Unset, str]):
21
+ name (Union[Unset, str]):
22
+ description (Union[None, Unset, str]):
23
+ instructions (Union[None, Unset, str]):
24
+ workspaces (Union[Unset, list['WorkspaceDto']]):
25
+ tools (Union[Unset, list['ToolDto']]):
26
+ """
27
+
28
+ id: Union[Unset, str] = UNSET
29
+ name: Union[Unset, str] = UNSET
30
+ description: Union[None, Unset, str] = UNSET
31
+ instructions: Union[None, Unset, str] = UNSET
32
+ workspaces: Union[Unset, list["WorkspaceDto"]] = UNSET
33
+ tools: Union[Unset, list["ToolDto"]] = UNSET
34
+
35
+ def to_dict(self) -> dict[str, Any]:
36
+ id = self.id
37
+
38
+ name = self.name
39
+
40
+ description: Union[None, Unset, str]
41
+ if isinstance(self.description, Unset):
42
+ description = UNSET
43
+ else:
44
+ description = self.description
45
+
46
+ instructions: Union[None, Unset, str]
47
+ if isinstance(self.instructions, Unset):
48
+ instructions = UNSET
49
+ else:
50
+ instructions = self.instructions
51
+
52
+ workspaces: Union[Unset, list[dict[str, Any]]] = UNSET
53
+ if not isinstance(self.workspaces, Unset):
54
+ workspaces = []
55
+ for workspaces_item_data in self.workspaces:
56
+ workspaces_item = workspaces_item_data.to_dict()
57
+ workspaces.append(workspaces_item)
58
+
59
+ tools: Union[Unset, list[dict[str, Any]]] = UNSET
60
+ if not isinstance(self.tools, Unset):
61
+ tools = []
62
+ for tools_item_data in self.tools:
63
+ tools_item = tools_item_data.to_dict()
64
+ tools.append(tools_item)
65
+
66
+ field_dict: dict[str, Any] = {}
67
+
68
+ field_dict.update({})
69
+ if id is not UNSET:
70
+ field_dict["id"] = id
71
+ if name is not UNSET:
72
+ field_dict["name"] = name
73
+ if description is not UNSET:
74
+ field_dict["description"] = description
75
+ if instructions is not UNSET:
76
+ field_dict["instructions"] = instructions
77
+ if workspaces is not UNSET:
78
+ field_dict["workspaces"] = workspaces
79
+ if tools is not UNSET:
80
+ field_dict["tools"] = tools
81
+
82
+ return field_dict
83
+
84
+ @classmethod
85
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
86
+ from ..models.tool_dto import ToolDto
87
+ from ..models.workspace_dto import WorkspaceDto
88
+
89
+ d = dict(src_dict)
90
+ id = d.pop("id", UNSET)
91
+
92
+ name = d.pop("name", UNSET)
93
+
94
+ def _parse_description(data: object) -> Union[None, Unset, str]:
95
+ if data is None:
96
+ return data
97
+ if isinstance(data, Unset):
98
+ return data
99
+ return cast(Union[None, Unset, str], data)
100
+
101
+ description = _parse_description(d.pop("description", UNSET))
102
+
103
+ def _parse_instructions(data: object) -> Union[None, Unset, str]:
104
+ if data is None:
105
+ return data
106
+ if isinstance(data, Unset):
107
+ return data
108
+ return cast(Union[None, Unset, str], data)
109
+
110
+ instructions = _parse_instructions(d.pop("instructions", UNSET))
111
+
112
+ workspaces = []
113
+ _workspaces = d.pop("workspaces", UNSET)
114
+ for workspaces_item_data in _workspaces or []:
115
+ workspaces_item = WorkspaceDto.from_dict(workspaces_item_data)
116
+
117
+ workspaces.append(workspaces_item)
118
+
119
+ tools = []
120
+ _tools = d.pop("tools", UNSET)
121
+ for tools_item_data in _tools or []:
122
+ tools_item = ToolDto.from_dict(tools_item_data)
123
+
124
+ tools.append(tools_item)
125
+
126
+ mini_template_dto = cls(
127
+ id=id,
128
+ name=name,
129
+ description=description,
130
+ instructions=instructions,
131
+ workspaces=workspaces,
132
+ tools=tools,
133
+ )
134
+
135
+ return mini_template_dto
@@ -0,0 +1,101 @@
1
+ from collections.abc import Mapping
2
+ from typing import TYPE_CHECKING, Any, TypeVar, Union
3
+
4
+ from attrs import define as _attrs_define
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ if TYPE_CHECKING:
9
+ from ..models.record_dto import RecordDto
10
+
11
+
12
+ T = TypeVar("T", bound="PaginatedListOfRecordDto")
13
+
14
+
15
+ @_attrs_define
16
+ class PaginatedListOfRecordDto:
17
+ """
18
+ Attributes:
19
+ items (Union[Unset, list['RecordDto']]):
20
+ page_number (Union[Unset, int]):
21
+ total_pages (Union[Unset, int]):
22
+ total_count (Union[Unset, int]):
23
+ has_previous_page (Union[Unset, bool]):
24
+ has_next_page (Union[Unset, bool]):
25
+ """
26
+
27
+ items: Union[Unset, list["RecordDto"]] = UNSET
28
+ page_number: Union[Unset, int] = UNSET
29
+ total_pages: Union[Unset, int] = UNSET
30
+ total_count: Union[Unset, int] = UNSET
31
+ has_previous_page: Union[Unset, bool] = UNSET
32
+ has_next_page: Union[Unset, bool] = UNSET
33
+
34
+ def to_dict(self) -> dict[str, Any]:
35
+ items: Union[Unset, list[dict[str, Any]]] = UNSET
36
+ if not isinstance(self.items, Unset):
37
+ items = []
38
+ for items_item_data in self.items:
39
+ items_item = items_item_data.to_dict()
40
+ items.append(items_item)
41
+
42
+ page_number = self.page_number
43
+
44
+ total_pages = self.total_pages
45
+
46
+ total_count = self.total_count
47
+
48
+ has_previous_page = self.has_previous_page
49
+
50
+ has_next_page = self.has_next_page
51
+
52
+ field_dict: dict[str, Any] = {}
53
+
54
+ field_dict.update({})
55
+ if items is not UNSET:
56
+ field_dict["items"] = items
57
+ if page_number is not UNSET:
58
+ field_dict["pageNumber"] = page_number
59
+ if total_pages is not UNSET:
60
+ field_dict["totalPages"] = total_pages
61
+ if total_count is not UNSET:
62
+ field_dict["totalCount"] = total_count
63
+ if has_previous_page is not UNSET:
64
+ field_dict["hasPreviousPage"] = has_previous_page
65
+ if has_next_page is not UNSET:
66
+ field_dict["hasNextPage"] = has_next_page
67
+
68
+ return field_dict
69
+
70
+ @classmethod
71
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
72
+ from ..models.record_dto import RecordDto
73
+
74
+ d = dict(src_dict)
75
+ items = []
76
+ _items = d.pop("items", UNSET)
77
+ for items_item_data in _items or []:
78
+ items_item = RecordDto.from_dict(items_item_data)
79
+
80
+ items.append(items_item)
81
+
82
+ page_number = d.pop("pageNumber", UNSET)
83
+
84
+ total_pages = d.pop("totalPages", UNSET)
85
+
86
+ total_count = d.pop("totalCount", UNSET)
87
+
88
+ has_previous_page = d.pop("hasPreviousPage", UNSET)
89
+
90
+ has_next_page = d.pop("hasNextPage", UNSET)
91
+
92
+ paginated_list_of_record_dto = cls(
93
+ items=items,
94
+ page_number=page_number,
95
+ total_pages=total_pages,
96
+ total_count=total_count,
97
+ has_previous_page=has_previous_page,
98
+ has_next_page=has_next_page,
99
+ )
100
+
101
+ return paginated_list_of_record_dto
@@ -0,0 +1,80 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+
6
+ from ..types import UNSET, Unset
7
+
8
+ T = TypeVar("T", bound="PatchMiniCommand")
9
+
10
+
11
+ @_attrs_define
12
+ class PatchMiniCommand:
13
+ """
14
+ Attributes:
15
+ id (Union[Unset, int]):
16
+ name (Union[None, Unset, str]):
17
+ description (Union[None, Unset, str]):
18
+ """
19
+
20
+ id: Union[Unset, int] = UNSET
21
+ name: Union[None, Unset, str] = UNSET
22
+ description: Union[None, Unset, str] = UNSET
23
+
24
+ def to_dict(self) -> dict[str, Any]:
25
+ id = self.id
26
+
27
+ name: Union[None, Unset, str]
28
+ if isinstance(self.name, Unset):
29
+ name = UNSET
30
+ else:
31
+ name = self.name
32
+
33
+ description: Union[None, Unset, str]
34
+ if isinstance(self.description, Unset):
35
+ description = UNSET
36
+ else:
37
+ description = self.description
38
+
39
+ field_dict: dict[str, Any] = {}
40
+
41
+ field_dict.update({})
42
+ if id is not UNSET:
43
+ field_dict["id"] = id
44
+ if name is not UNSET:
45
+ field_dict["name"] = name
46
+ if description is not UNSET:
47
+ field_dict["description"] = description
48
+
49
+ return field_dict
50
+
51
+ @classmethod
52
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
53
+ d = dict(src_dict)
54
+ id = d.pop("id", UNSET)
55
+
56
+ def _parse_name(data: object) -> Union[None, Unset, str]:
57
+ if data is None:
58
+ return data
59
+ if isinstance(data, Unset):
60
+ return data
61
+ return cast(Union[None, Unset, str], data)
62
+
63
+ name = _parse_name(d.pop("name", UNSET))
64
+
65
+ def _parse_description(data: object) -> Union[None, Unset, str]:
66
+ if data is None:
67
+ return data
68
+ if isinstance(data, Unset):
69
+ return data
70
+ return cast(Union[None, Unset, str], data)
71
+
72
+ description = _parse_description(d.pop("description", UNSET))
73
+
74
+ patch_mini_command = cls(
75
+ id=id,
76
+ name=name,
77
+ description=description,
78
+ )
79
+
80
+ return patch_mini_command
@@ -0,0 +1,151 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar, Union, cast
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ from ..types import UNSET, Unset
8
+
9
+ T = TypeVar("T", bound="ProblemDetails")
10
+
11
+
12
+ @_attrs_define
13
+ class ProblemDetails:
14
+ """
15
+ Attributes:
16
+ type_ (Union[None, Unset, str]):
17
+ title (Union[None, Unset, str]):
18
+ status (Union[None, Unset, int]):
19
+ detail (Union[None, Unset, str]):
20
+ instance (Union[None, Unset, str]):
21
+ """
22
+
23
+ type_: Union[None, Unset, str] = UNSET
24
+ title: Union[None, Unset, str] = UNSET
25
+ status: Union[None, Unset, int] = UNSET
26
+ detail: Union[None, Unset, str] = UNSET
27
+ instance: Union[None, Unset, str] = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ type_: Union[None, Unset, str]
32
+ if isinstance(self.type_, Unset):
33
+ type_ = UNSET
34
+ else:
35
+ type_ = self.type_
36
+
37
+ title: Union[None, Unset, str]
38
+ if isinstance(self.title, Unset):
39
+ title = UNSET
40
+ else:
41
+ title = self.title
42
+
43
+ status: Union[None, Unset, int]
44
+ if isinstance(self.status, Unset):
45
+ status = UNSET
46
+ else:
47
+ status = self.status
48
+
49
+ detail: Union[None, Unset, str]
50
+ if isinstance(self.detail, Unset):
51
+ detail = UNSET
52
+ else:
53
+ detail = self.detail
54
+
55
+ instance: Union[None, Unset, str]
56
+ if isinstance(self.instance, Unset):
57
+ instance = UNSET
58
+ else:
59
+ instance = self.instance
60
+
61
+ field_dict: dict[str, Any] = {}
62
+ field_dict.update(self.additional_properties)
63
+ field_dict.update({})
64
+ if type_ is not UNSET:
65
+ field_dict["type"] = type_
66
+ if title is not UNSET:
67
+ field_dict["title"] = title
68
+ if status is not UNSET:
69
+ field_dict["status"] = status
70
+ if detail is not UNSET:
71
+ field_dict["detail"] = detail
72
+ if instance is not UNSET:
73
+ field_dict["instance"] = instance
74
+
75
+ return field_dict
76
+
77
+ @classmethod
78
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
79
+ d = dict(src_dict)
80
+
81
+ def _parse_type_(data: object) -> Union[None, Unset, str]:
82
+ if data is None:
83
+ return data
84
+ if isinstance(data, Unset):
85
+ return data
86
+ return cast(Union[None, Unset, str], data)
87
+
88
+ type_ = _parse_type_(d.pop("type", UNSET))
89
+
90
+ def _parse_title(data: object) -> Union[None, Unset, str]:
91
+ if data is None:
92
+ return data
93
+ if isinstance(data, Unset):
94
+ return data
95
+ return cast(Union[None, Unset, str], data)
96
+
97
+ title = _parse_title(d.pop("title", UNSET))
98
+
99
+ def _parse_status(data: object) -> Union[None, Unset, int]:
100
+ if data is None:
101
+ return data
102
+ if isinstance(data, Unset):
103
+ return data
104
+ return cast(Union[None, Unset, int], data)
105
+
106
+ status = _parse_status(d.pop("status", UNSET))
107
+
108
+ def _parse_detail(data: object) -> Union[None, Unset, str]:
109
+ if data is None:
110
+ return data
111
+ if isinstance(data, Unset):
112
+ return data
113
+ return cast(Union[None, Unset, str], data)
114
+
115
+ detail = _parse_detail(d.pop("detail", UNSET))
116
+
117
+ def _parse_instance(data: object) -> Union[None, Unset, str]:
118
+ if data is None:
119
+ return data
120
+ if isinstance(data, Unset):
121
+ return data
122
+ return cast(Union[None, Unset, str], data)
123
+
124
+ instance = _parse_instance(d.pop("instance", UNSET))
125
+
126
+ problem_details = cls(
127
+ type_=type_,
128
+ title=title,
129
+ status=status,
130
+ detail=detail,
131
+ instance=instance,
132
+ )
133
+
134
+ problem_details.additional_properties = d
135
+ return problem_details
136
+
137
+ @property
138
+ def additional_keys(self) -> list[str]:
139
+ return list(self.additional_properties.keys())
140
+
141
+ def __getitem__(self, key: str) -> Any:
142
+ return self.additional_properties[key]
143
+
144
+ def __setitem__(self, key: str, value: Any) -> None:
145
+ self.additional_properties[key] = value
146
+
147
+ def __delitem__(self, key: str) -> None:
148
+ del self.additional_properties[key]
149
+
150
+ def __contains__(self, key: str) -> bool:
151
+ return key in self.additional_properties