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,377 @@
1
+ import datetime
2
+ from collections.abc import Mapping
3
+ from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
4
+
5
+ from attrs import define as _attrs_define
6
+ from dateutil.parser import isoparse
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ if TYPE_CHECKING:
11
+ from ..models.json_node import JsonNode
12
+ from ..models.record_attachment_dto import RecordAttachmentDto
13
+ from ..models.record_authorization_dto import RecordAuthorizationDto
14
+ from ..models.record_dto_tags import RecordDtoTags
15
+ from ..models.record_relation_dto import RecordRelationDto
16
+
17
+
18
+ T = TypeVar("T", bound="RecordDto")
19
+
20
+
21
+ @_attrs_define
22
+ class RecordDto:
23
+ """
24
+ Attributes:
25
+ id (Union[Unset, str]):
26
+ title (Union[Unset, str]):
27
+ description (Union[None, Unset, str]):
28
+ created_at (Union[Unset, datetime.datetime]):
29
+ updated_at (Union[Unset, datetime.datetime]):
30
+ event_date (Union[None, Unset, datetime.datetime]):
31
+ created_by (Union[Unset, str]):
32
+ updated_by (Union[None, Unset, str]):
33
+ searchable (Union[Unset, bool]):
34
+ ttl (Union[None, Unset, int]):
35
+ archived (Union[Unset, bool]):
36
+ schema (Union['JsonNode', None, Unset]):
37
+ content (Union['JsonNode', None, Unset]):
38
+ attachments (Union[Unset, list['RecordAttachmentDto']]):
39
+ authorization (Union[Unset, RecordAuthorizationDto]):
40
+ relations (Union[Unset, list['RecordRelationDto']]):
41
+ external_uri (Union[None, Unset, str]):
42
+ labels (Union[Unset, list[str]]):
43
+ tags (Union[Unset, RecordDtoTags]):
44
+ """
45
+
46
+ id: Union[Unset, str] = UNSET
47
+ title: Union[Unset, str] = UNSET
48
+ description: Union[None, Unset, str] = UNSET
49
+ created_at: Union[Unset, datetime.datetime] = UNSET
50
+ updated_at: Union[Unset, datetime.datetime] = UNSET
51
+ event_date: Union[None, Unset, datetime.datetime] = UNSET
52
+ created_by: Union[Unset, str] = UNSET
53
+ updated_by: Union[None, Unset, str] = UNSET
54
+ searchable: Union[Unset, bool] = UNSET
55
+ ttl: Union[None, Unset, int] = UNSET
56
+ archived: Union[Unset, bool] = UNSET
57
+ schema: Union["JsonNode", None, Unset] = UNSET
58
+ content: Union["JsonNode", None, Unset] = UNSET
59
+ attachments: Union[Unset, list["RecordAttachmentDto"]] = UNSET
60
+ authorization: Union[Unset, "RecordAuthorizationDto"] = UNSET
61
+ relations: Union[Unset, list["RecordRelationDto"]] = UNSET
62
+ external_uri: Union[None, Unset, str] = UNSET
63
+ labels: Union[Unset, list[str]] = UNSET
64
+ tags: Union[Unset, "RecordDtoTags"] = UNSET
65
+
66
+ def to_dict(self) -> dict[str, Any]:
67
+ from ..models.json_node import JsonNode
68
+
69
+ id = self.id
70
+
71
+ title = self.title
72
+
73
+ description: Union[None, Unset, str]
74
+ if isinstance(self.description, Unset):
75
+ description = UNSET
76
+ else:
77
+ description = self.description
78
+
79
+ created_at: Union[Unset, str] = UNSET
80
+ if not isinstance(self.created_at, Unset):
81
+ created_at = self.created_at.isoformat()
82
+
83
+ updated_at: Union[Unset, str] = UNSET
84
+ if not isinstance(self.updated_at, Unset):
85
+ updated_at = self.updated_at.isoformat()
86
+
87
+ event_date: Union[None, Unset, str]
88
+ if isinstance(self.event_date, Unset):
89
+ event_date = UNSET
90
+ elif isinstance(self.event_date, datetime.datetime):
91
+ event_date = self.event_date.isoformat()
92
+ else:
93
+ event_date = self.event_date
94
+
95
+ created_by = self.created_by
96
+
97
+ updated_by: Union[None, Unset, str]
98
+ if isinstance(self.updated_by, Unset):
99
+ updated_by = UNSET
100
+ else:
101
+ updated_by = self.updated_by
102
+
103
+ searchable = self.searchable
104
+
105
+ ttl: Union[None, Unset, int]
106
+ if isinstance(self.ttl, Unset):
107
+ ttl = UNSET
108
+ else:
109
+ ttl = self.ttl
110
+
111
+ archived = self.archived
112
+
113
+ schema: Union[None, Unset, dict[str, Any]]
114
+ if isinstance(self.schema, Unset):
115
+ schema = UNSET
116
+ elif isinstance(self.schema, JsonNode):
117
+ schema = self.schema.to_dict()
118
+ else:
119
+ schema = self.schema
120
+
121
+ content: Union[None, Unset, dict[str, Any]]
122
+ if isinstance(self.content, Unset):
123
+ content = UNSET
124
+ elif isinstance(self.content, JsonNode):
125
+ content = self.content.to_dict()
126
+ else:
127
+ content = self.content
128
+
129
+ attachments: Union[Unset, list[dict[str, Any]]] = UNSET
130
+ if not isinstance(self.attachments, Unset):
131
+ attachments = []
132
+ for attachments_item_data in self.attachments:
133
+ attachments_item = attachments_item_data.to_dict()
134
+ attachments.append(attachments_item)
135
+
136
+ authorization: Union[Unset, dict[str, Any]] = UNSET
137
+ if not isinstance(self.authorization, Unset):
138
+ authorization = self.authorization.to_dict()
139
+
140
+ relations: Union[Unset, list[dict[str, Any]]] = UNSET
141
+ if not isinstance(self.relations, Unset):
142
+ relations = []
143
+ for relations_item_data in self.relations:
144
+ relations_item = relations_item_data.to_dict()
145
+ relations.append(relations_item)
146
+
147
+ external_uri: Union[None, Unset, str]
148
+ if isinstance(self.external_uri, Unset):
149
+ external_uri = UNSET
150
+ else:
151
+ external_uri = self.external_uri
152
+
153
+ labels: Union[Unset, list[str]] = UNSET
154
+ if not isinstance(self.labels, Unset):
155
+ labels = self.labels
156
+
157
+ tags: Union[Unset, dict[str, Any]] = UNSET
158
+ if not isinstance(self.tags, Unset):
159
+ tags = self.tags.to_dict()
160
+
161
+ field_dict: dict[str, Any] = {}
162
+
163
+ field_dict.update({})
164
+ if id is not UNSET:
165
+ field_dict["id"] = id
166
+ if title is not UNSET:
167
+ field_dict["title"] = title
168
+ if description is not UNSET:
169
+ field_dict["description"] = description
170
+ if created_at is not UNSET:
171
+ field_dict["createdAt"] = created_at
172
+ if updated_at is not UNSET:
173
+ field_dict["updatedAt"] = updated_at
174
+ if event_date is not UNSET:
175
+ field_dict["eventDate"] = event_date
176
+ if created_by is not UNSET:
177
+ field_dict["createdBy"] = created_by
178
+ if updated_by is not UNSET:
179
+ field_dict["updatedBy"] = updated_by
180
+ if searchable is not UNSET:
181
+ field_dict["searchable"] = searchable
182
+ if ttl is not UNSET:
183
+ field_dict["ttl"] = ttl
184
+ if archived is not UNSET:
185
+ field_dict["archived"] = archived
186
+ if schema is not UNSET:
187
+ field_dict["schema"] = schema
188
+ if content is not UNSET:
189
+ field_dict["content"] = content
190
+ if attachments is not UNSET:
191
+ field_dict["attachments"] = attachments
192
+ if authorization is not UNSET:
193
+ field_dict["authorization"] = authorization
194
+ if relations is not UNSET:
195
+ field_dict["relations"] = relations
196
+ if external_uri is not UNSET:
197
+ field_dict["externalUri"] = external_uri
198
+ if labels is not UNSET:
199
+ field_dict["labels"] = labels
200
+ if tags is not UNSET:
201
+ field_dict["tags"] = tags
202
+
203
+ return field_dict
204
+
205
+ @classmethod
206
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
207
+ from ..models.json_node import JsonNode
208
+ from ..models.record_attachment_dto import RecordAttachmentDto
209
+ from ..models.record_authorization_dto import RecordAuthorizationDto
210
+ from ..models.record_dto_tags import RecordDtoTags
211
+ from ..models.record_relation_dto import RecordRelationDto
212
+
213
+ d = dict(src_dict)
214
+ id = d.pop("id", UNSET)
215
+
216
+ title = d.pop("title", UNSET)
217
+
218
+ def _parse_description(data: object) -> Union[None, Unset, str]:
219
+ if data is None:
220
+ return data
221
+ if isinstance(data, Unset):
222
+ return data
223
+ return cast(Union[None, Unset, str], data)
224
+
225
+ description = _parse_description(d.pop("description", UNSET))
226
+
227
+ _created_at = d.pop("createdAt", UNSET)
228
+ created_at: Union[Unset, datetime.datetime]
229
+ if isinstance(_created_at, Unset):
230
+ created_at = UNSET
231
+ else:
232
+ created_at = isoparse(_created_at)
233
+
234
+ _updated_at = d.pop("updatedAt", UNSET)
235
+ updated_at: Union[Unset, datetime.datetime]
236
+ if isinstance(_updated_at, Unset):
237
+ updated_at = UNSET
238
+ else:
239
+ updated_at = isoparse(_updated_at)
240
+
241
+ def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
242
+ if data is None:
243
+ return data
244
+ if isinstance(data, Unset):
245
+ return data
246
+ try:
247
+ if not isinstance(data, str):
248
+ raise TypeError()
249
+ event_date_type_0 = isoparse(data)
250
+
251
+ return event_date_type_0
252
+ except: # noqa: E722
253
+ pass
254
+ return cast(Union[None, Unset, datetime.datetime], data)
255
+
256
+ event_date = _parse_event_date(d.pop("eventDate", UNSET))
257
+
258
+ created_by = d.pop("createdBy", UNSET)
259
+
260
+ def _parse_updated_by(data: object) -> Union[None, Unset, str]:
261
+ if data is None:
262
+ return data
263
+ if isinstance(data, Unset):
264
+ return data
265
+ return cast(Union[None, Unset, str], data)
266
+
267
+ updated_by = _parse_updated_by(d.pop("updatedBy", UNSET))
268
+
269
+ searchable = d.pop("searchable", UNSET)
270
+
271
+ def _parse_ttl(data: object) -> Union[None, Unset, int]:
272
+ if data is None:
273
+ return data
274
+ if isinstance(data, Unset):
275
+ return data
276
+ return cast(Union[None, Unset, int], data)
277
+
278
+ ttl = _parse_ttl(d.pop("ttl", UNSET))
279
+
280
+ archived = d.pop("archived", UNSET)
281
+
282
+ def _parse_schema(data: object) -> Union["JsonNode", None, Unset]:
283
+ if data is None:
284
+ return data
285
+ if isinstance(data, Unset):
286
+ return data
287
+ try:
288
+ if not isinstance(data, dict):
289
+ raise TypeError()
290
+ schema_type_0 = JsonNode.from_dict(data)
291
+
292
+ return schema_type_0
293
+ except: # noqa: E722
294
+ pass
295
+ return cast(Union["JsonNode", None, Unset], data)
296
+
297
+ schema = _parse_schema(d.pop("schema", UNSET))
298
+
299
+ def _parse_content(data: object) -> Union["JsonNode", None, Unset]:
300
+ if data is None:
301
+ return data
302
+ if isinstance(data, Unset):
303
+ return data
304
+ try:
305
+ if not isinstance(data, dict):
306
+ raise TypeError()
307
+ content_type_0 = JsonNode.from_dict(data)
308
+
309
+ return content_type_0
310
+ except: # noqa: E722
311
+ pass
312
+ return cast(Union["JsonNode", None, Unset], data)
313
+
314
+ content = _parse_content(d.pop("content", UNSET))
315
+
316
+ attachments = []
317
+ _attachments = d.pop("attachments", UNSET)
318
+ for attachments_item_data in _attachments or []:
319
+ attachments_item = RecordAttachmentDto.from_dict(attachments_item_data)
320
+
321
+ attachments.append(attachments_item)
322
+
323
+ _authorization = d.pop("authorization", UNSET)
324
+ authorization: Union[Unset, RecordAuthorizationDto]
325
+ if isinstance(_authorization, Unset):
326
+ authorization = UNSET
327
+ else:
328
+ authorization = RecordAuthorizationDto.from_dict(_authorization)
329
+
330
+ relations = []
331
+ _relations = d.pop("relations", UNSET)
332
+ for relations_item_data in _relations or []:
333
+ relations_item = RecordRelationDto.from_dict(relations_item_data)
334
+
335
+ relations.append(relations_item)
336
+
337
+ def _parse_external_uri(data: object) -> Union[None, Unset, str]:
338
+ if data is None:
339
+ return data
340
+ if isinstance(data, Unset):
341
+ return data
342
+ return cast(Union[None, Unset, str], data)
343
+
344
+ external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
345
+
346
+ labels = cast(list[str], d.pop("labels", UNSET))
347
+
348
+ _tags = d.pop("tags", UNSET)
349
+ tags: Union[Unset, RecordDtoTags]
350
+ if isinstance(_tags, Unset):
351
+ tags = UNSET
352
+ else:
353
+ tags = RecordDtoTags.from_dict(_tags)
354
+
355
+ record_dto = cls(
356
+ id=id,
357
+ title=title,
358
+ description=description,
359
+ created_at=created_at,
360
+ updated_at=updated_at,
361
+ event_date=event_date,
362
+ created_by=created_by,
363
+ updated_by=updated_by,
364
+ searchable=searchable,
365
+ ttl=ttl,
366
+ archived=archived,
367
+ schema=schema,
368
+ content=content,
369
+ attachments=attachments,
370
+ authorization=authorization,
371
+ relations=relations,
372
+ external_uri=external_uri,
373
+ labels=labels,
374
+ tags=tags,
375
+ )
376
+
377
+ return record_dto
@@ -0,0 +1,44 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="RecordDtoTags")
8
+
9
+
10
+ @_attrs_define
11
+ class RecordDtoTags:
12
+ """ """
13
+
14
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
+
16
+ def to_dict(self) -> dict[str, Any]:
17
+ field_dict: dict[str, Any] = {}
18
+ field_dict.update(self.additional_properties)
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
+ d = dict(src_dict)
25
+ record_dto_tags = cls()
26
+
27
+ record_dto_tags.additional_properties = d
28
+ return record_dto_tags
29
+
30
+ @property
31
+ def additional_keys(self) -> list[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> Any:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: Any) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties
@@ -0,0 +1,81 @@
1
+ import datetime
2
+ from collections.abc import Mapping
3
+ from typing import Any, TypeVar, Union, cast
4
+
5
+ from attrs import define as _attrs_define
6
+ from dateutil.parser import isoparse
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ T = TypeVar("T", bound="RecordRelation")
11
+
12
+
13
+ @_attrs_define
14
+ class RecordRelation:
15
+ """
16
+ Attributes:
17
+ id (Union[Unset, str]):
18
+ relationship (Union[Unset, str]):
19
+ since (Union[None, Unset, datetime.datetime]):
20
+ """
21
+
22
+ id: Union[Unset, str] = UNSET
23
+ relationship: Union[Unset, str] = UNSET
24
+ since: Union[None, Unset, datetime.datetime] = UNSET
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ id = self.id
28
+
29
+ relationship = self.relationship
30
+
31
+ since: Union[None, Unset, str]
32
+ if isinstance(self.since, Unset):
33
+ since = UNSET
34
+ elif isinstance(self.since, datetime.datetime):
35
+ since = self.since.isoformat()
36
+ else:
37
+ since = self.since
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 relationship is not UNSET:
45
+ field_dict["relationship"] = relationship
46
+ if since is not UNSET:
47
+ field_dict["since"] = since
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
+ relationship = d.pop("relationship", UNSET)
57
+
58
+ def _parse_since(data: object) -> Union[None, Unset, datetime.datetime]:
59
+ if data is None:
60
+ return data
61
+ if isinstance(data, Unset):
62
+ return data
63
+ try:
64
+ if not isinstance(data, str):
65
+ raise TypeError()
66
+ since_type_0 = isoparse(data)
67
+
68
+ return since_type_0
69
+ except: # noqa: E722
70
+ pass
71
+ return cast(Union[None, Unset, datetime.datetime], data)
72
+
73
+ since = _parse_since(d.pop("since", UNSET))
74
+
75
+ record_relation = cls(
76
+ id=id,
77
+ relationship=relationship,
78
+ since=since,
79
+ )
80
+
81
+ return record_relation
@@ -0,0 +1,81 @@
1
+ import datetime
2
+ from collections.abc import Mapping
3
+ from typing import Any, TypeVar, Union, cast
4
+
5
+ from attrs import define as _attrs_define
6
+ from dateutil.parser import isoparse
7
+
8
+ from ..types import UNSET, Unset
9
+
10
+ T = TypeVar("T", bound="RecordRelationDto")
11
+
12
+
13
+ @_attrs_define
14
+ class RecordRelationDto:
15
+ """
16
+ Attributes:
17
+ id (Union[Unset, str]):
18
+ relationship (Union[Unset, str]):
19
+ since (Union[None, Unset, datetime.datetime]):
20
+ """
21
+
22
+ id: Union[Unset, str] = UNSET
23
+ relationship: Union[Unset, str] = UNSET
24
+ since: Union[None, Unset, datetime.datetime] = UNSET
25
+
26
+ def to_dict(self) -> dict[str, Any]:
27
+ id = self.id
28
+
29
+ relationship = self.relationship
30
+
31
+ since: Union[None, Unset, str]
32
+ if isinstance(self.since, Unset):
33
+ since = UNSET
34
+ elif isinstance(self.since, datetime.datetime):
35
+ since = self.since.isoformat()
36
+ else:
37
+ since = self.since
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 relationship is not UNSET:
45
+ field_dict["relationship"] = relationship
46
+ if since is not UNSET:
47
+ field_dict["since"] = since
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
+ relationship = d.pop("relationship", UNSET)
57
+
58
+ def _parse_since(data: object) -> Union[None, Unset, datetime.datetime]:
59
+ if data is None:
60
+ return data
61
+ if isinstance(data, Unset):
62
+ return data
63
+ try:
64
+ if not isinstance(data, str):
65
+ raise TypeError()
66
+ since_type_0 = isoparse(data)
67
+
68
+ return since_type_0
69
+ except: # noqa: E722
70
+ pass
71
+ return cast(Union[None, Unset, datetime.datetime], data)
72
+
73
+ since = _parse_since(d.pop("since", UNSET))
74
+
75
+ record_relation_dto = cls(
76
+ id=id,
77
+ relationship=relationship,
78
+ since=since,
79
+ )
80
+
81
+ return record_relation_dto
@@ -0,0 +1,44 @@
1
+ from collections.abc import Mapping
2
+ from typing import Any, TypeVar
3
+
4
+ from attrs import define as _attrs_define
5
+ from attrs import field as _attrs_field
6
+
7
+ T = TypeVar("T", bound="RecordTags")
8
+
9
+
10
+ @_attrs_define
11
+ class RecordTags:
12
+ """ """
13
+
14
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
15
+
16
+ def to_dict(self) -> dict[str, Any]:
17
+ field_dict: dict[str, Any] = {}
18
+ field_dict.update(self.additional_properties)
19
+
20
+ return field_dict
21
+
22
+ @classmethod
23
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
24
+ d = dict(src_dict)
25
+ record_tags = cls()
26
+
27
+ record_tags.additional_properties = d
28
+ return record_tags
29
+
30
+ @property
31
+ def additional_keys(self) -> list[str]:
32
+ return list(self.additional_properties.keys())
33
+
34
+ def __getitem__(self, key: str) -> Any:
35
+ return self.additional_properties[key]
36
+
37
+ def __setitem__(self, key: str, value: Any) -> None:
38
+ self.additional_properties[key] = value
39
+
40
+ def __delitem__(self, key: str) -> None:
41
+ del self.additional_properties[key]
42
+
43
+ def __contains__(self, key: str) -> bool:
44
+ return key in self.additional_properties