minikai 0.1.1__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 +7 -3
- 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 +143 -61
- 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 +159 -0
- 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.1.dist-info → minikai-0.1.3.dist-info}/METADATA +1 -1
- minikai-0.1.3.dist-info/RECORD +91 -0
- minikai/models/record_tags.py +0 -44
- minikai-0.1.1.dist-info/RECORD +0 -88
- {minikai-0.1.1.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,
|
|
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,15 +177,30 @@ class Record:
|
|
|
154
177
|
if not isinstance(self.labels, Unset):
|
|
155
178
|
labels = self.labels
|
|
156
179
|
|
|
157
|
-
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
tags: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
158
183
|
if not isinstance(self.tags, Unset):
|
|
159
|
-
tags =
|
|
184
|
+
tags = []
|
|
185
|
+
for tags_item_data in self.tags:
|
|
186
|
+
tags_item = tags_item_data.to_dict()
|
|
187
|
+
tags.append(tags_item)
|
|
188
|
+
|
|
189
|
+
|
|
160
190
|
|
|
161
191
|
field_ts = self.field_ts
|
|
162
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
|
+
|
|
163
200
|
field_dict: dict[str, Any] = {}
|
|
164
201
|
|
|
165
|
-
field_dict.update({
|
|
202
|
+
field_dict.update({
|
|
203
|
+
})
|
|
166
204
|
if id is not UNSET:
|
|
167
205
|
field_dict["id"] = id
|
|
168
206
|
if organization_id is not UNSET:
|
|
@@ -203,17 +241,20 @@ class Record:
|
|
|
203
241
|
field_dict["tags"] = tags
|
|
204
242
|
if field_ts is not UNSET:
|
|
205
243
|
field_dict["_ts"] = field_ts
|
|
244
|
+
if field_etag is not UNSET:
|
|
245
|
+
field_dict["_etag"] = field_etag
|
|
206
246
|
|
|
207
247
|
return field_dict
|
|
208
248
|
|
|
249
|
+
|
|
250
|
+
|
|
209
251
|
@classmethod
|
|
210
252
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
211
|
-
from ..models.
|
|
212
|
-
from ..models.record_attachment import RecordAttachment
|
|
253
|
+
from ..models.record_tag import RecordTag
|
|
213
254
|
from ..models.record_authorization import RecordAuthorization
|
|
214
255
|
from ..models.record_relation import RecordRelation
|
|
215
|
-
from ..models.
|
|
216
|
-
|
|
256
|
+
from ..models.record_attachment import RecordAttachment
|
|
257
|
+
from ..models.json_node import JsonNode
|
|
217
258
|
d = dict(src_dict)
|
|
218
259
|
id = d.pop("id", UNSET)
|
|
219
260
|
|
|
@@ -230,13 +271,17 @@ class Record:
|
|
|
230
271
|
|
|
231
272
|
description = _parse_description(d.pop("description", UNSET))
|
|
232
273
|
|
|
274
|
+
|
|
233
275
|
_created_at = d.pop("createdAt", UNSET)
|
|
234
276
|
created_at: Union[Unset, datetime.datetime]
|
|
235
|
-
if isinstance(_created_at,
|
|
277
|
+
if isinstance(_created_at, Unset):
|
|
236
278
|
created_at = UNSET
|
|
237
279
|
else:
|
|
238
280
|
created_at = isoparse(_created_at)
|
|
239
281
|
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
240
285
|
def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
241
286
|
if data is None:
|
|
242
287
|
return data
|
|
@@ -247,13 +292,16 @@ class Record:
|
|
|
247
292
|
raise TypeError()
|
|
248
293
|
event_date_type_0 = isoparse(data)
|
|
249
294
|
|
|
295
|
+
|
|
296
|
+
|
|
250
297
|
return event_date_type_0
|
|
251
|
-
except:
|
|
298
|
+
except: # noqa: E722
|
|
252
299
|
pass
|
|
253
300
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
254
301
|
|
|
255
302
|
event_date = _parse_event_date(d.pop("eventDate", UNSET))
|
|
256
303
|
|
|
304
|
+
|
|
257
305
|
created_by = d.pop("createdBy", UNSET)
|
|
258
306
|
|
|
259
307
|
def _parse_updated_by(data: object) -> Union[None, Unset, str]:
|
|
@@ -265,6 +313,7 @@ class Record:
|
|
|
265
313
|
|
|
266
314
|
updated_by = _parse_updated_by(d.pop("updatedBy", UNSET))
|
|
267
315
|
|
|
316
|
+
|
|
268
317
|
searchable = d.pop("searchable", UNSET)
|
|
269
318
|
|
|
270
319
|
def _parse_ttl(data: object) -> Union[None, Unset, int]:
|
|
@@ -276,9 +325,10 @@ class Record:
|
|
|
276
325
|
|
|
277
326
|
ttl = _parse_ttl(d.pop("ttl", UNSET))
|
|
278
327
|
|
|
328
|
+
|
|
279
329
|
archived = d.pop("archived", UNSET)
|
|
280
330
|
|
|
281
|
-
def _parse_schema(data: object) -> Union[
|
|
331
|
+
def _parse_schema(data: object) -> Union['JsonNode', None, Unset]:
|
|
282
332
|
if data is None:
|
|
283
333
|
return data
|
|
284
334
|
if isinstance(data, Unset):
|
|
@@ -288,14 +338,17 @@ class Record:
|
|
|
288
338
|
raise TypeError()
|
|
289
339
|
schema_type_0 = JsonNode.from_dict(data)
|
|
290
340
|
|
|
341
|
+
|
|
342
|
+
|
|
291
343
|
return schema_type_0
|
|
292
|
-
except:
|
|
344
|
+
except: # noqa: E722
|
|
293
345
|
pass
|
|
294
|
-
return cast(Union[
|
|
346
|
+
return cast(Union['JsonNode', None, Unset], data)
|
|
295
347
|
|
|
296
348
|
schema = _parse_schema(d.pop("schema", UNSET))
|
|
297
349
|
|
|
298
|
-
|
|
350
|
+
|
|
351
|
+
def _parse_content(data: object) -> Union['JsonNode', None, Unset]:
|
|
299
352
|
if data is None:
|
|
300
353
|
return data
|
|
301
354
|
if isinstance(data, Unset):
|
|
@@ -305,34 +358,46 @@ class Record:
|
|
|
305
358
|
raise TypeError()
|
|
306
359
|
content_type_0 = JsonNode.from_dict(data)
|
|
307
360
|
|
|
361
|
+
|
|
362
|
+
|
|
308
363
|
return content_type_0
|
|
309
|
-
except:
|
|
364
|
+
except: # noqa: E722
|
|
310
365
|
pass
|
|
311
|
-
return cast(Union[
|
|
366
|
+
return cast(Union['JsonNode', None, Unset], data)
|
|
312
367
|
|
|
313
368
|
content = _parse_content(d.pop("content", UNSET))
|
|
314
369
|
|
|
370
|
+
|
|
315
371
|
attachments = []
|
|
316
372
|
_attachments = d.pop("attachments", UNSET)
|
|
317
|
-
for attachments_item_data in _attachments or []:
|
|
373
|
+
for attachments_item_data in (_attachments or []):
|
|
318
374
|
attachments_item = RecordAttachment.from_dict(attachments_item_data)
|
|
319
375
|
|
|
376
|
+
|
|
377
|
+
|
|
320
378
|
attachments.append(attachments_item)
|
|
321
379
|
|
|
380
|
+
|
|
322
381
|
_authorization = d.pop("authorization", UNSET)
|
|
323
382
|
authorization: Union[Unset, RecordAuthorization]
|
|
324
|
-
if isinstance(_authorization,
|
|
383
|
+
if isinstance(_authorization, Unset):
|
|
325
384
|
authorization = UNSET
|
|
326
385
|
else:
|
|
327
386
|
authorization = RecordAuthorization.from_dict(_authorization)
|
|
328
387
|
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
329
391
|
relations = []
|
|
330
392
|
_relations = d.pop("relations", UNSET)
|
|
331
|
-
for relations_item_data in _relations or []:
|
|
393
|
+
for relations_item_data in (_relations or []):
|
|
332
394
|
relations_item = RecordRelation.from_dict(relations_item_data)
|
|
333
395
|
|
|
396
|
+
|
|
397
|
+
|
|
334
398
|
relations.append(relations_item)
|
|
335
399
|
|
|
400
|
+
|
|
336
401
|
def _parse_external_uri(data: object) -> Union[None, Unset, str]:
|
|
337
402
|
if data is None:
|
|
338
403
|
return data
|
|
@@ -342,17 +407,32 @@ class Record:
|
|
|
342
407
|
|
|
343
408
|
external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
|
|
344
409
|
|
|
410
|
+
|
|
345
411
|
labels = cast(list[str], d.pop("labels", UNSET))
|
|
346
412
|
|
|
413
|
+
|
|
414
|
+
tags = []
|
|
347
415
|
_tags = d.pop("tags", UNSET)
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
416
|
+
for tags_item_data in (_tags or []):
|
|
417
|
+
tags_item = RecordTag.from_dict(tags_item_data)
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
tags.append(tags_item)
|
|
422
|
+
|
|
353
423
|
|
|
354
424
|
field_ts = d.pop("_ts", UNSET)
|
|
355
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
|
+
|
|
356
436
|
record = cls(
|
|
357
437
|
id=id,
|
|
358
438
|
organization_id=organization_id,
|
|
@@ -374,6 +454,8 @@ class Record:
|
|
|
374
454
|
labels=labels,
|
|
375
455
|
tags=tags,
|
|
376
456
|
field_ts=field_ts,
|
|
457
|
+
field_etag=field_etag,
|
|
377
458
|
)
|
|
378
459
|
|
|
379
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
|
+
|