minikai 0.1.2__py3-none-any.whl → 0.1.3__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.
- minikai/__init__.py +1 -1
- minikai/api/__init__.py +1 -1
- minikai/api/groups/__init__.py +1 -1
- minikai/api/groups/add_minis_to_group.py +53 -33
- minikai/api/groups/add_users_to_group.py +53 -33
- minikai/api/groups/create_group.py +45 -27
- minikai/api/groups/delete_group.py +29 -9
- minikai/api/groups/get_group.py +47 -28
- minikai/api/groups/get_group_minis.py +52 -33
- minikai/api/groups/get_group_users.py +52 -33
- minikai/api/groups/get_groups.py +56 -34
- minikai/api/groups/remove_minis_from_group.py +53 -33
- minikai/api/groups/remove_users_from_group.py +53 -33
- minikai/api/groups/update_group.py +51 -33
- minikai/api/minis/__init__.py +1 -1
- minikai/api/minis/create_mini.py +45 -27
- minikai/api/minis/delete_mini.py +29 -9
- minikai/api/minis/get_external_mini.py +52 -33
- minikai/api/minis/get_minis.py +56 -34
- minikai/api/minis/patch_mini.py +51 -33
- minikai/api/minis/update_mini.py +51 -33
- minikai/api/records/__init__.py +1 -1
- minikai/api/records/add_attachments.py +59 -38
- minikai/api/records/add_relations.py +65 -43
- minikai/api/records/create_record.py +48 -28
- minikai/api/records/delete_record.py +29 -9
- minikai/api/records/download_attachment.py +119 -0
- minikai/api/records/get_records_by_external.py +68 -45
- minikai/api/records/remove_attachments.py +33 -11
- minikai/api/records/remove_relations.py +33 -11
- minikai/api/records/update_attachments.py +59 -38
- minikai/api/records/update_record.py +53 -33
- minikai/api/records/update_relations.py +65 -43
- minikai/api/users/__init__.py +1 -1
- minikai/api/users/delete_api_users_minis.py +31 -11
- minikai/api/users/get_api_users_minis.py +52 -33
- minikai/api/users/get_users.py +56 -34
- minikai/api/users/post_api_users_minis.py +52 -33
- minikai/client.py +6 -3
- minikai/errors.py +1 -3
- minikai/models/__init__.py +5 -1
- minikai/models/add_attachments_body.py +45 -13
- minikai/models/create_group_command.py +35 -10
- minikai/models/create_mini_command.py +34 -10
- minikai/models/create_record_command.py +87 -41
- minikai/models/create_record_command_tags.py +22 -3
- minikai/models/cursor_paginated_list_of_record_dto.py +122 -0
- minikai/models/document_file_dto.py +37 -13
- minikai/models/document_file_metadata_dto.py +27 -7
- minikai/models/form_field.py +38 -12
- minikai/models/form_field_dto.py +48 -16
- minikai/models/form_field_type.py +2 -8
- minikai/models/group_dto.py +50 -19
- minikai/models/http_validation_problem_details.py +41 -16
- minikai/models/http_validation_problem_details_errors.py +26 -3
- minikai/models/json_node.py +49 -24
- minikai/models/json_node_options.py +26 -7
- minikai/models/mini_dto.py +62 -27
- minikai/models/mini_template_dto.py +50 -18
- minikai/models/paginated_list_of_record_dto.py +39 -16
- minikai/models/patch_mini_command.py +30 -8
- minikai/models/problem_details.py +34 -11
- minikai/models/record.py +134 -55
- minikai/models/record_attachment.py +56 -27
- minikai/models/record_attachment_dto.py +56 -27
- minikai/models/record_attachment_dto_metadata_type_0.py +22 -3
- minikai/models/record_attachment_metadata_type_0.py +22 -3
- minikai/models/record_authorization.py +41 -9
- minikai/models/record_authorization_dto.py +41 -9
- minikai/models/record_dto.py +113 -54
- minikai/models/record_dto_tags.py +22 -3
- minikai/models/record_relation.py +35 -11
- minikai/models/record_relation_dto.py +35 -11
- minikai/models/record_tag.py +40 -13
- minikai/models/record_tag_dto.py +68 -0
- minikai/models/slim_mini_dto.py +51 -22
- minikai/models/tool_dto.py +29 -10
- minikai/models/update_attachments_body.py +45 -13
- minikai/models/update_group_command.py +37 -11
- minikai/models/update_mini_command.py +35 -11
- minikai/models/update_mini_template_workspaces_command.py +30 -7
- minikai/models/update_record_command.py +87 -42
- minikai/models/update_record_command_tags.py +22 -3
- minikai/models/user_dto.py +50 -17
- minikai/models/user_to_mini_dto.py +30 -9
- minikai/models/workspace_dto.py +30 -9
- minikai/types.py +5 -6
- {minikai-0.1.2.dist-info → minikai-0.1.3.dist-info}/METADATA +1 -1
- minikai-0.1.3.dist-info/RECORD +91 -0
- minikai-0.1.2.dist-info/RECORD +0 -88
- {minikai-0.1.2.dist-info → minikai-0.1.3.dist-info}/WHEEL +0 -0
minikai/models/record.py
CHANGED
|
@@ -1,48 +1,59 @@
|
|
|
1
|
-
import datetime
|
|
2
1
|
from collections.abc import Mapping
|
|
3
|
-
from typing import
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
4
3
|
|
|
5
4
|
from attrs import define as _attrs_define
|
|
6
|
-
from
|
|
5
|
+
from attrs import field as _attrs_field
|
|
7
6
|
|
|
8
7
|
from ..types import UNSET, Unset
|
|
9
8
|
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
from dateutil.parser import isoparse
|
|
11
|
+
from typing import cast
|
|
12
|
+
from typing import cast, Union
|
|
13
|
+
from typing import Union
|
|
14
|
+
import datetime
|
|
15
|
+
|
|
10
16
|
if TYPE_CHECKING:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
from ..models.record_tag import RecordTag
|
|
18
|
+
from ..models.record_authorization import RecordAuthorization
|
|
19
|
+
from ..models.record_relation import RecordRelation
|
|
20
|
+
from ..models.record_attachment import RecordAttachment
|
|
21
|
+
from ..models.json_node import JsonNode
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
16
25
|
|
|
17
26
|
|
|
18
27
|
T = TypeVar("T", bound="Record")
|
|
19
28
|
|
|
20
29
|
|
|
30
|
+
|
|
21
31
|
@_attrs_define
|
|
22
32
|
class Record:
|
|
23
|
-
"""
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
33
|
+
"""
|
|
34
|
+
Attributes:
|
|
35
|
+
id (Union[Unset, str]):
|
|
36
|
+
organization_id (Union[Unset, str]):
|
|
37
|
+
title (Union[Unset, str]):
|
|
38
|
+
description (Union[None, Unset, str]):
|
|
39
|
+
created_at (Union[Unset, datetime.datetime]):
|
|
40
|
+
event_date (Union[None, Unset, datetime.datetime]):
|
|
41
|
+
created_by (Union[Unset, str]):
|
|
42
|
+
updated_by (Union[None, Unset, str]):
|
|
43
|
+
searchable (Union[Unset, bool]):
|
|
44
|
+
ttl (Union[None, Unset, int]):
|
|
45
|
+
archived (Union[Unset, bool]):
|
|
46
|
+
schema (Union['JsonNode', None, Unset]):
|
|
47
|
+
content (Union['JsonNode', None, Unset]):
|
|
48
|
+
attachments (Union[Unset, list['RecordAttachment']]):
|
|
49
|
+
authorization (Union[Unset, RecordAuthorization]):
|
|
50
|
+
relations (Union[Unset, list['RecordRelation']]):
|
|
51
|
+
external_uri (Union[None, Unset, str]):
|
|
52
|
+
labels (Union[Unset, list[str]]):
|
|
53
|
+
tags (Union[Unset, list['RecordTag']]):
|
|
54
|
+
field_ts (Union[Unset, int]):
|
|
55
|
+
field_etag (Union[None, Unset, str]):
|
|
56
|
+
"""
|
|
46
57
|
|
|
47
58
|
id: Union[Unset, str] = UNSET
|
|
48
59
|
organization_id: Union[Unset, str] = UNSET
|
|
@@ -55,19 +66,27 @@ class Record:
|
|
|
55
66
|
searchable: Union[Unset, bool] = UNSET
|
|
56
67
|
ttl: Union[None, Unset, int] = UNSET
|
|
57
68
|
archived: Union[Unset, bool] = UNSET
|
|
58
|
-
schema: Union[
|
|
59
|
-
content: Union[
|
|
60
|
-
attachments: Union[Unset, list[
|
|
61
|
-
authorization: Union[Unset,
|
|
62
|
-
relations: Union[Unset, list[
|
|
69
|
+
schema: Union['JsonNode', None, Unset] = UNSET
|
|
70
|
+
content: Union['JsonNode', None, Unset] = UNSET
|
|
71
|
+
attachments: Union[Unset, list['RecordAttachment']] = UNSET
|
|
72
|
+
authorization: Union[Unset, 'RecordAuthorization'] = UNSET
|
|
73
|
+
relations: Union[Unset, list['RecordRelation']] = UNSET
|
|
63
74
|
external_uri: Union[None, Unset, str] = UNSET
|
|
64
75
|
labels: Union[Unset, list[str]] = UNSET
|
|
65
|
-
tags: Union[Unset, list[
|
|
76
|
+
tags: Union[Unset, list['RecordTag']] = UNSET
|
|
66
77
|
field_ts: Union[Unset, int] = UNSET
|
|
78
|
+
field_etag: Union[None, Unset, str] = UNSET
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
67
83
|
|
|
68
84
|
def to_dict(self) -> dict[str, Any]:
|
|
85
|
+
from ..models.record_tag import RecordTag
|
|
86
|
+
from ..models.record_authorization import RecordAuthorization
|
|
87
|
+
from ..models.record_relation import RecordRelation
|
|
88
|
+
from ..models.record_attachment import RecordAttachment
|
|
69
89
|
from ..models.json_node import JsonNode
|
|
70
|
-
|
|
71
90
|
id = self.id
|
|
72
91
|
|
|
73
92
|
organization_id = self.organization_id
|
|
@@ -133,6 +152,8 @@ class Record:
|
|
|
133
152
|
attachments_item = attachments_item_data.to_dict()
|
|
134
153
|
attachments.append(attachments_item)
|
|
135
154
|
|
|
155
|
+
|
|
156
|
+
|
|
136
157
|
authorization: Union[Unset, dict[str, Any]] = UNSET
|
|
137
158
|
if not isinstance(self.authorization, Unset):
|
|
138
159
|
authorization = self.authorization.to_dict()
|
|
@@ -144,6 +165,8 @@ class Record:
|
|
|
144
165
|
relations_item = relations_item_data.to_dict()
|
|
145
166
|
relations.append(relations_item)
|
|
146
167
|
|
|
168
|
+
|
|
169
|
+
|
|
147
170
|
external_uri: Union[None, Unset, str]
|
|
148
171
|
if isinstance(self.external_uri, Unset):
|
|
149
172
|
external_uri = UNSET
|
|
@@ -154,6 +177,8 @@ class Record:
|
|
|
154
177
|
if not isinstance(self.labels, Unset):
|
|
155
178
|
labels = self.labels
|
|
156
179
|
|
|
180
|
+
|
|
181
|
+
|
|
157
182
|
tags: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
158
183
|
if not isinstance(self.tags, Unset):
|
|
159
184
|
tags = []
|
|
@@ -161,11 +186,21 @@ class Record:
|
|
|
161
186
|
tags_item = tags_item_data.to_dict()
|
|
162
187
|
tags.append(tags_item)
|
|
163
188
|
|
|
189
|
+
|
|
190
|
+
|
|
164
191
|
field_ts = self.field_ts
|
|
165
192
|
|
|
193
|
+
field_etag: Union[None, Unset, str]
|
|
194
|
+
if isinstance(self.field_etag, Unset):
|
|
195
|
+
field_etag = UNSET
|
|
196
|
+
else:
|
|
197
|
+
field_etag = self.field_etag
|
|
198
|
+
|
|
199
|
+
|
|
166
200
|
field_dict: dict[str, Any] = {}
|
|
167
201
|
|
|
168
|
-
field_dict.update({
|
|
202
|
+
field_dict.update({
|
|
203
|
+
})
|
|
169
204
|
if id is not UNSET:
|
|
170
205
|
field_dict["id"] = id
|
|
171
206
|
if organization_id is not UNSET:
|
|
@@ -206,17 +241,20 @@ class Record:
|
|
|
206
241
|
field_dict["tags"] = tags
|
|
207
242
|
if field_ts is not UNSET:
|
|
208
243
|
field_dict["_ts"] = field_ts
|
|
244
|
+
if field_etag is not UNSET:
|
|
245
|
+
field_dict["_etag"] = field_etag
|
|
209
246
|
|
|
210
247
|
return field_dict
|
|
211
248
|
|
|
249
|
+
|
|
250
|
+
|
|
212
251
|
@classmethod
|
|
213
252
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
214
|
-
from ..models.
|
|
215
|
-
from ..models.record_attachment import RecordAttachment
|
|
253
|
+
from ..models.record_tag import RecordTag
|
|
216
254
|
from ..models.record_authorization import RecordAuthorization
|
|
217
255
|
from ..models.record_relation import RecordRelation
|
|
218
|
-
from ..models.
|
|
219
|
-
|
|
256
|
+
from ..models.record_attachment import RecordAttachment
|
|
257
|
+
from ..models.json_node import JsonNode
|
|
220
258
|
d = dict(src_dict)
|
|
221
259
|
id = d.pop("id", UNSET)
|
|
222
260
|
|
|
@@ -233,13 +271,17 @@ class Record:
|
|
|
233
271
|
|
|
234
272
|
description = _parse_description(d.pop("description", UNSET))
|
|
235
273
|
|
|
274
|
+
|
|
236
275
|
_created_at = d.pop("createdAt", UNSET)
|
|
237
276
|
created_at: Union[Unset, datetime.datetime]
|
|
238
|
-
if isinstance(_created_at,
|
|
277
|
+
if isinstance(_created_at, Unset):
|
|
239
278
|
created_at = UNSET
|
|
240
279
|
else:
|
|
241
280
|
created_at = isoparse(_created_at)
|
|
242
281
|
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
243
285
|
def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
244
286
|
if data is None:
|
|
245
287
|
return data
|
|
@@ -250,13 +292,16 @@ class Record:
|
|
|
250
292
|
raise TypeError()
|
|
251
293
|
event_date_type_0 = isoparse(data)
|
|
252
294
|
|
|
295
|
+
|
|
296
|
+
|
|
253
297
|
return event_date_type_0
|
|
254
|
-
except:
|
|
298
|
+
except: # noqa: E722
|
|
255
299
|
pass
|
|
256
300
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
257
301
|
|
|
258
302
|
event_date = _parse_event_date(d.pop("eventDate", UNSET))
|
|
259
303
|
|
|
304
|
+
|
|
260
305
|
created_by = d.pop("createdBy", UNSET)
|
|
261
306
|
|
|
262
307
|
def _parse_updated_by(data: object) -> Union[None, Unset, str]:
|
|
@@ -268,6 +313,7 @@ class Record:
|
|
|
268
313
|
|
|
269
314
|
updated_by = _parse_updated_by(d.pop("updatedBy", UNSET))
|
|
270
315
|
|
|
316
|
+
|
|
271
317
|
searchable = d.pop("searchable", UNSET)
|
|
272
318
|
|
|
273
319
|
def _parse_ttl(data: object) -> Union[None, Unset, int]:
|
|
@@ -279,9 +325,10 @@ class Record:
|
|
|
279
325
|
|
|
280
326
|
ttl = _parse_ttl(d.pop("ttl", UNSET))
|
|
281
327
|
|
|
328
|
+
|
|
282
329
|
archived = d.pop("archived", UNSET)
|
|
283
330
|
|
|
284
|
-
def _parse_schema(data: object) -> Union[
|
|
331
|
+
def _parse_schema(data: object) -> Union['JsonNode', None, Unset]:
|
|
285
332
|
if data is None:
|
|
286
333
|
return data
|
|
287
334
|
if isinstance(data, Unset):
|
|
@@ -291,14 +338,17 @@ class Record:
|
|
|
291
338
|
raise TypeError()
|
|
292
339
|
schema_type_0 = JsonNode.from_dict(data)
|
|
293
340
|
|
|
341
|
+
|
|
342
|
+
|
|
294
343
|
return schema_type_0
|
|
295
|
-
except:
|
|
344
|
+
except: # noqa: E722
|
|
296
345
|
pass
|
|
297
|
-
return cast(Union[
|
|
346
|
+
return cast(Union['JsonNode', None, Unset], data)
|
|
298
347
|
|
|
299
348
|
schema = _parse_schema(d.pop("schema", UNSET))
|
|
300
349
|
|
|
301
|
-
|
|
350
|
+
|
|
351
|
+
def _parse_content(data: object) -> Union['JsonNode', None, Unset]:
|
|
302
352
|
if data is None:
|
|
303
353
|
return data
|
|
304
354
|
if isinstance(data, Unset):
|
|
@@ -308,34 +358,46 @@ class Record:
|
|
|
308
358
|
raise TypeError()
|
|
309
359
|
content_type_0 = JsonNode.from_dict(data)
|
|
310
360
|
|
|
361
|
+
|
|
362
|
+
|
|
311
363
|
return content_type_0
|
|
312
|
-
except:
|
|
364
|
+
except: # noqa: E722
|
|
313
365
|
pass
|
|
314
|
-
return cast(Union[
|
|
366
|
+
return cast(Union['JsonNode', None, Unset], data)
|
|
315
367
|
|
|
316
368
|
content = _parse_content(d.pop("content", UNSET))
|
|
317
369
|
|
|
370
|
+
|
|
318
371
|
attachments = []
|
|
319
372
|
_attachments = d.pop("attachments", UNSET)
|
|
320
|
-
for attachments_item_data in _attachments or []:
|
|
373
|
+
for attachments_item_data in (_attachments or []):
|
|
321
374
|
attachments_item = RecordAttachment.from_dict(attachments_item_data)
|
|
322
375
|
|
|
376
|
+
|
|
377
|
+
|
|
323
378
|
attachments.append(attachments_item)
|
|
324
379
|
|
|
380
|
+
|
|
325
381
|
_authorization = d.pop("authorization", UNSET)
|
|
326
382
|
authorization: Union[Unset, RecordAuthorization]
|
|
327
|
-
if isinstance(_authorization,
|
|
383
|
+
if isinstance(_authorization, Unset):
|
|
328
384
|
authorization = UNSET
|
|
329
385
|
else:
|
|
330
386
|
authorization = RecordAuthorization.from_dict(_authorization)
|
|
331
387
|
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
332
391
|
relations = []
|
|
333
392
|
_relations = d.pop("relations", UNSET)
|
|
334
|
-
for relations_item_data in _relations or []:
|
|
393
|
+
for relations_item_data in (_relations or []):
|
|
335
394
|
relations_item = RecordRelation.from_dict(relations_item_data)
|
|
336
395
|
|
|
396
|
+
|
|
397
|
+
|
|
337
398
|
relations.append(relations_item)
|
|
338
399
|
|
|
400
|
+
|
|
339
401
|
def _parse_external_uri(data: object) -> Union[None, Unset, str]:
|
|
340
402
|
if data is None:
|
|
341
403
|
return data
|
|
@@ -345,17 +407,32 @@ class Record:
|
|
|
345
407
|
|
|
346
408
|
external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
|
|
347
409
|
|
|
410
|
+
|
|
348
411
|
labels = cast(list[str], d.pop("labels", UNSET))
|
|
349
412
|
|
|
413
|
+
|
|
350
414
|
tags = []
|
|
351
415
|
_tags = d.pop("tags", UNSET)
|
|
352
|
-
for tags_item_data in _tags or []:
|
|
416
|
+
for tags_item_data in (_tags or []):
|
|
353
417
|
tags_item = RecordTag.from_dict(tags_item_data)
|
|
354
418
|
|
|
419
|
+
|
|
420
|
+
|
|
355
421
|
tags.append(tags_item)
|
|
356
422
|
|
|
423
|
+
|
|
357
424
|
field_ts = d.pop("_ts", UNSET)
|
|
358
425
|
|
|
426
|
+
def _parse_field_etag(data: object) -> Union[None, Unset, str]:
|
|
427
|
+
if data is None:
|
|
428
|
+
return data
|
|
429
|
+
if isinstance(data, Unset):
|
|
430
|
+
return data
|
|
431
|
+
return cast(Union[None, Unset, str], data)
|
|
432
|
+
|
|
433
|
+
field_etag = _parse_field_etag(d.pop("_etag", UNSET))
|
|
434
|
+
|
|
435
|
+
|
|
359
436
|
record = cls(
|
|
360
437
|
id=id,
|
|
361
438
|
organization_id=organization_id,
|
|
@@ -377,6 +454,8 @@ class Record:
|
|
|
377
454
|
labels=labels,
|
|
378
455
|
tags=tags,
|
|
379
456
|
field_ts=field_ts,
|
|
457
|
+
field_etag=field_etag,
|
|
380
458
|
)
|
|
381
459
|
|
|
382
460
|
return record
|
|
461
|
+
|
|
@@ -1,35 +1,45 @@
|
|
|
1
|
-
import datetime
|
|
2
1
|
from collections.abc import Mapping
|
|
3
|
-
from typing import
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
4
3
|
|
|
5
4
|
from attrs import define as _attrs_define
|
|
6
|
-
from
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
7
8
|
|
|
8
9
|
from ..types import UNSET, Unset
|
|
10
|
+
from dateutil.parser import isoparse
|
|
11
|
+
from typing import cast
|
|
12
|
+
from typing import cast, Union
|
|
13
|
+
from typing import Union
|
|
14
|
+
import datetime
|
|
9
15
|
|
|
10
16
|
if TYPE_CHECKING:
|
|
11
|
-
|
|
17
|
+
from ..models.record_attachment_metadata_type_0 import RecordAttachmentMetadataType0
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
12
21
|
|
|
13
22
|
|
|
14
23
|
T = TypeVar("T", bound="RecordAttachment")
|
|
15
24
|
|
|
16
25
|
|
|
26
|
+
|
|
17
27
|
@_attrs_define
|
|
18
28
|
class RecordAttachment:
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
id (Union[Unset, str]):
|
|
32
|
+
file_name (Union[Unset, str]):
|
|
33
|
+
content_type (Union[Unset, str]):
|
|
34
|
+
size (Union[Unset, int]):
|
|
35
|
+
checksum (Union[None, Unset, str]):
|
|
36
|
+
uri (Union[Unset, str]):
|
|
37
|
+
created_at (Union[None, Unset, datetime.datetime]):
|
|
38
|
+
updated_at (Union[None, Unset, datetime.datetime]):
|
|
39
|
+
created_by (Union[None, Unset, str]):
|
|
40
|
+
updated_by (Union[None, Unset, str]):
|
|
41
|
+
metadata (Union['RecordAttachmentMetadataType0', None, Unset]):
|
|
42
|
+
"""
|
|
33
43
|
|
|
34
44
|
id: Union[Unset, str] = UNSET
|
|
35
45
|
file_name: Union[Unset, str] = UNSET
|
|
@@ -41,11 +51,14 @@ class RecordAttachment:
|
|
|
41
51
|
updated_at: Union[None, Unset, datetime.datetime] = UNSET
|
|
42
52
|
created_by: Union[None, Unset, str] = UNSET
|
|
43
53
|
updated_by: Union[None, Unset, str] = UNSET
|
|
44
|
-
metadata: Union[
|
|
54
|
+
metadata: Union['RecordAttachmentMetadataType0', None, Unset] = UNSET
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
45
59
|
|
|
46
60
|
def to_dict(self) -> dict[str, Any]:
|
|
47
61
|
from ..models.record_attachment_metadata_type_0 import RecordAttachmentMetadataType0
|
|
48
|
-
|
|
49
62
|
id = self.id
|
|
50
63
|
|
|
51
64
|
file_name = self.file_name
|
|
@@ -98,9 +111,11 @@ class RecordAttachment:
|
|
|
98
111
|
else:
|
|
99
112
|
metadata = self.metadata
|
|
100
113
|
|
|
114
|
+
|
|
101
115
|
field_dict: dict[str, Any] = {}
|
|
102
116
|
|
|
103
|
-
field_dict.update({
|
|
117
|
+
field_dict.update({
|
|
118
|
+
})
|
|
104
119
|
if id is not UNSET:
|
|
105
120
|
field_dict["id"] = id
|
|
106
121
|
if file_name is not UNSET:
|
|
@@ -126,10 +141,11 @@ class RecordAttachment:
|
|
|
126
141
|
|
|
127
142
|
return field_dict
|
|
128
143
|
|
|
144
|
+
|
|
145
|
+
|
|
129
146
|
@classmethod
|
|
130
147
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
131
148
|
from ..models.record_attachment_metadata_type_0 import RecordAttachmentMetadataType0
|
|
132
|
-
|
|
133
149
|
d = dict(src_dict)
|
|
134
150
|
id = d.pop("id", UNSET)
|
|
135
151
|
|
|
@@ -148,6 +164,7 @@ class RecordAttachment:
|
|
|
148
164
|
|
|
149
165
|
checksum = _parse_checksum(d.pop("checksum", UNSET))
|
|
150
166
|
|
|
167
|
+
|
|
151
168
|
uri = d.pop("uri", UNSET)
|
|
152
169
|
|
|
153
170
|
def _parse_created_at(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
@@ -160,13 +177,16 @@ class RecordAttachment:
|
|
|
160
177
|
raise TypeError()
|
|
161
178
|
created_at_type_0 = isoparse(data)
|
|
162
179
|
|
|
180
|
+
|
|
181
|
+
|
|
163
182
|
return created_at_type_0
|
|
164
|
-
except:
|
|
183
|
+
except: # noqa: E722
|
|
165
184
|
pass
|
|
166
185
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
167
186
|
|
|
168
187
|
created_at = _parse_created_at(d.pop("createdAt", UNSET))
|
|
169
188
|
|
|
189
|
+
|
|
170
190
|
def _parse_updated_at(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
171
191
|
if data is None:
|
|
172
192
|
return data
|
|
@@ -177,13 +197,16 @@ class RecordAttachment:
|
|
|
177
197
|
raise TypeError()
|
|
178
198
|
updated_at_type_0 = isoparse(data)
|
|
179
199
|
|
|
200
|
+
|
|
201
|
+
|
|
180
202
|
return updated_at_type_0
|
|
181
|
-
except:
|
|
203
|
+
except: # noqa: E722
|
|
182
204
|
pass
|
|
183
205
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
184
206
|
|
|
185
207
|
updated_at = _parse_updated_at(d.pop("updatedAt", UNSET))
|
|
186
208
|
|
|
209
|
+
|
|
187
210
|
def _parse_created_by(data: object) -> Union[None, Unset, str]:
|
|
188
211
|
if data is None:
|
|
189
212
|
return data
|
|
@@ -193,6 +216,7 @@ class RecordAttachment:
|
|
|
193
216
|
|
|
194
217
|
created_by = _parse_created_by(d.pop("createdBy", UNSET))
|
|
195
218
|
|
|
219
|
+
|
|
196
220
|
def _parse_updated_by(data: object) -> Union[None, Unset, str]:
|
|
197
221
|
if data is None:
|
|
198
222
|
return data
|
|
@@ -202,7 +226,8 @@ class RecordAttachment:
|
|
|
202
226
|
|
|
203
227
|
updated_by = _parse_updated_by(d.pop("updatedBy", UNSET))
|
|
204
228
|
|
|
205
|
-
|
|
229
|
+
|
|
230
|
+
def _parse_metadata(data: object) -> Union['RecordAttachmentMetadataType0', None, Unset]:
|
|
206
231
|
if data is None:
|
|
207
232
|
return data
|
|
208
233
|
if isinstance(data, Unset):
|
|
@@ -212,13 +237,16 @@ class RecordAttachment:
|
|
|
212
237
|
raise TypeError()
|
|
213
238
|
metadata_type_0 = RecordAttachmentMetadataType0.from_dict(data)
|
|
214
239
|
|
|
240
|
+
|
|
241
|
+
|
|
215
242
|
return metadata_type_0
|
|
216
|
-
except:
|
|
243
|
+
except: # noqa: E722
|
|
217
244
|
pass
|
|
218
|
-
return cast(Union[
|
|
245
|
+
return cast(Union['RecordAttachmentMetadataType0', None, Unset], data)
|
|
219
246
|
|
|
220
247
|
metadata = _parse_metadata(d.pop("metadata", UNSET))
|
|
221
248
|
|
|
249
|
+
|
|
222
250
|
record_attachment = cls(
|
|
223
251
|
id=id,
|
|
224
252
|
file_name=file_name,
|
|
@@ -234,3 +262,4 @@ class RecordAttachment:
|
|
|
234
262
|
)
|
|
235
263
|
|
|
236
264
|
return record_attachment
|
|
265
|
+
|