minikai 0.1.2__py3-none-any.whl → 0.1.4__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 -5
- 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 +76 -81
- 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/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 +153 -94
- 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 +104 -96
- 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 +76 -82
- 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.4.dist-info}/METADATA +1 -1
- minikai-0.1.4.dist-info/RECORD +89 -0
- minikai/models/json_node.py +0 -119
- minikai/models/json_node_options.py +0 -42
- minikai-0.1.2.dist-info/RECORD +0 -88
- {minikai-0.1.2.dist-info → minikai-0.1.4.dist-info}/WHEEL +0 -0
minikai/models/record.py
CHANGED
|
@@ -1,73 +1,92 @@
|
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
from ..models.record_relation import RecordRelation
|
|
18
|
+
from ..models.record_authorization import RecordAuthorization
|
|
19
|
+
from ..models.record_tag import RecordTag
|
|
20
|
+
from ..models.record_attachment import RecordAttachment
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
16
24
|
|
|
17
25
|
|
|
18
26
|
T = TypeVar("T", bound="Record")
|
|
19
27
|
|
|
20
28
|
|
|
29
|
+
|
|
21
30
|
@_attrs_define
|
|
22
31
|
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
|
-
|
|
32
|
+
"""
|
|
33
|
+
Attributes:
|
|
34
|
+
id (Union[Unset, str]):
|
|
35
|
+
organization_id (Union[Unset, str]):
|
|
36
|
+
title (Union[Unset, str]):
|
|
37
|
+
description (Union[None, Unset, str]):
|
|
38
|
+
created_at (Union[Unset, datetime.datetime]):
|
|
39
|
+
updated_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[Unset, Any]):
|
|
47
|
+
content (Union[Unset, Any]):
|
|
48
|
+
content_text (Union[None, Unset, str]):
|
|
49
|
+
attachments (Union[Unset, list['RecordAttachment']]):
|
|
50
|
+
authorization (Union[Unset, RecordAuthorization]):
|
|
51
|
+
relations (Union[Unset, list['RecordRelation']]):
|
|
52
|
+
external_uri (Union[None, Unset, str]):
|
|
53
|
+
labels (Union[Unset, list[str]]):
|
|
54
|
+
tags (Union[Unset, list['RecordTag']]):
|
|
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
|
|
49
60
|
title: Union[Unset, str] = UNSET
|
|
50
61
|
description: Union[None, Unset, str] = UNSET
|
|
51
62
|
created_at: Union[Unset, datetime.datetime] = UNSET
|
|
63
|
+
updated_at: Union[Unset, datetime.datetime] = UNSET
|
|
52
64
|
event_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
53
65
|
created_by: Union[Unset, str] = UNSET
|
|
54
66
|
updated_by: Union[None, Unset, str] = UNSET
|
|
55
67
|
searchable: Union[Unset, bool] = UNSET
|
|
56
68
|
ttl: Union[None, Unset, int] = UNSET
|
|
57
69
|
archived: Union[Unset, bool] = UNSET
|
|
58
|
-
schema: Union[
|
|
59
|
-
content: Union[
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
70
|
+
schema: Union[Unset, Any] = UNSET
|
|
71
|
+
content: Union[Unset, Any] = UNSET
|
|
72
|
+
content_text: Union[None, Unset, str] = UNSET
|
|
73
|
+
attachments: Union[Unset, list['RecordAttachment']] = UNSET
|
|
74
|
+
authorization: Union[Unset, 'RecordAuthorization'] = UNSET
|
|
75
|
+
relations: Union[Unset, list['RecordRelation']] = UNSET
|
|
63
76
|
external_uri: Union[None, Unset, str] = UNSET
|
|
64
77
|
labels: Union[Unset, list[str]] = UNSET
|
|
65
|
-
tags: Union[Unset, list[
|
|
66
|
-
|
|
78
|
+
tags: Union[Unset, list['RecordTag']] = UNSET
|
|
79
|
+
field_etag: Union[None, Unset, str] = UNSET
|
|
67
80
|
|
|
68
|
-
def to_dict(self) -> dict[str, Any]:
|
|
69
|
-
from ..models.json_node import JsonNode
|
|
70
81
|
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def to_dict(self) -> dict[str, Any]:
|
|
86
|
+
from ..models.record_relation import RecordRelation
|
|
87
|
+
from ..models.record_authorization import RecordAuthorization
|
|
88
|
+
from ..models.record_tag import RecordTag
|
|
89
|
+
from ..models.record_attachment import RecordAttachment
|
|
71
90
|
id = self.id
|
|
72
91
|
|
|
73
92
|
organization_id = self.organization_id
|
|
@@ -84,6 +103,10 @@ class Record:
|
|
|
84
103
|
if not isinstance(self.created_at, Unset):
|
|
85
104
|
created_at = self.created_at.isoformat()
|
|
86
105
|
|
|
106
|
+
updated_at: Union[Unset, str] = UNSET
|
|
107
|
+
if not isinstance(self.updated_at, Unset):
|
|
108
|
+
updated_at = self.updated_at.isoformat()
|
|
109
|
+
|
|
87
110
|
event_date: Union[None, Unset, str]
|
|
88
111
|
if isinstance(self.event_date, Unset):
|
|
89
112
|
event_date = UNSET
|
|
@@ -110,21 +133,15 @@ class Record:
|
|
|
110
133
|
|
|
111
134
|
archived = self.archived
|
|
112
135
|
|
|
113
|
-
schema
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
elif isinstance(self.schema, JsonNode):
|
|
117
|
-
schema = self.schema.to_dict()
|
|
118
|
-
else:
|
|
119
|
-
schema = self.schema
|
|
136
|
+
schema = self.schema
|
|
137
|
+
|
|
138
|
+
content = self.content
|
|
120
139
|
|
|
121
|
-
|
|
122
|
-
if isinstance(self.
|
|
123
|
-
|
|
124
|
-
elif isinstance(self.content, JsonNode):
|
|
125
|
-
content = self.content.to_dict()
|
|
140
|
+
content_text: Union[None, Unset, str]
|
|
141
|
+
if isinstance(self.content_text, Unset):
|
|
142
|
+
content_text = UNSET
|
|
126
143
|
else:
|
|
127
|
-
|
|
144
|
+
content_text = self.content_text
|
|
128
145
|
|
|
129
146
|
attachments: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
130
147
|
if not isinstance(self.attachments, Unset):
|
|
@@ -133,6 +150,8 @@ class Record:
|
|
|
133
150
|
attachments_item = attachments_item_data.to_dict()
|
|
134
151
|
attachments.append(attachments_item)
|
|
135
152
|
|
|
153
|
+
|
|
154
|
+
|
|
136
155
|
authorization: Union[Unset, dict[str, Any]] = UNSET
|
|
137
156
|
if not isinstance(self.authorization, Unset):
|
|
138
157
|
authorization = self.authorization.to_dict()
|
|
@@ -144,6 +163,8 @@ class Record:
|
|
|
144
163
|
relations_item = relations_item_data.to_dict()
|
|
145
164
|
relations.append(relations_item)
|
|
146
165
|
|
|
166
|
+
|
|
167
|
+
|
|
147
168
|
external_uri: Union[None, Unset, str]
|
|
148
169
|
if isinstance(self.external_uri, Unset):
|
|
149
170
|
external_uri = UNSET
|
|
@@ -154,6 +175,8 @@ class Record:
|
|
|
154
175
|
if not isinstance(self.labels, Unset):
|
|
155
176
|
labels = self.labels
|
|
156
177
|
|
|
178
|
+
|
|
179
|
+
|
|
157
180
|
tags: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
158
181
|
if not isinstance(self.tags, Unset):
|
|
159
182
|
tags = []
|
|
@@ -161,11 +184,19 @@ class Record:
|
|
|
161
184
|
tags_item = tags_item_data.to_dict()
|
|
162
185
|
tags.append(tags_item)
|
|
163
186
|
|
|
164
|
-
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
field_etag: Union[None, Unset, str]
|
|
190
|
+
if isinstance(self.field_etag, Unset):
|
|
191
|
+
field_etag = UNSET
|
|
192
|
+
else:
|
|
193
|
+
field_etag = self.field_etag
|
|
194
|
+
|
|
165
195
|
|
|
166
196
|
field_dict: dict[str, Any] = {}
|
|
167
197
|
|
|
168
|
-
field_dict.update({
|
|
198
|
+
field_dict.update({
|
|
199
|
+
})
|
|
169
200
|
if id is not UNSET:
|
|
170
201
|
field_dict["id"] = id
|
|
171
202
|
if organization_id is not UNSET:
|
|
@@ -176,6 +207,8 @@ class Record:
|
|
|
176
207
|
field_dict["description"] = description
|
|
177
208
|
if created_at is not UNSET:
|
|
178
209
|
field_dict["createdAt"] = created_at
|
|
210
|
+
if updated_at is not UNSET:
|
|
211
|
+
field_dict["updatedAt"] = updated_at
|
|
179
212
|
if event_date is not UNSET:
|
|
180
213
|
field_dict["eventDate"] = event_date
|
|
181
214
|
if created_by is not UNSET:
|
|
@@ -192,6 +225,8 @@ class Record:
|
|
|
192
225
|
field_dict["schema"] = schema
|
|
193
226
|
if content is not UNSET:
|
|
194
227
|
field_dict["content"] = content
|
|
228
|
+
if content_text is not UNSET:
|
|
229
|
+
field_dict["contentText"] = content_text
|
|
195
230
|
if attachments is not UNSET:
|
|
196
231
|
field_dict["attachments"] = attachments
|
|
197
232
|
if authorization is not UNSET:
|
|
@@ -204,19 +239,19 @@ class Record:
|
|
|
204
239
|
field_dict["labels"] = labels
|
|
205
240
|
if tags is not UNSET:
|
|
206
241
|
field_dict["tags"] = tags
|
|
207
|
-
if
|
|
208
|
-
field_dict["
|
|
242
|
+
if field_etag is not UNSET:
|
|
243
|
+
field_dict["_etag"] = field_etag
|
|
209
244
|
|
|
210
245
|
return field_dict
|
|
211
246
|
|
|
247
|
+
|
|
248
|
+
|
|
212
249
|
@classmethod
|
|
213
250
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
214
|
-
from ..models.json_node import JsonNode
|
|
215
|
-
from ..models.record_attachment import RecordAttachment
|
|
216
|
-
from ..models.record_authorization import RecordAuthorization
|
|
217
251
|
from ..models.record_relation import RecordRelation
|
|
252
|
+
from ..models.record_authorization import RecordAuthorization
|
|
218
253
|
from ..models.record_tag import RecordTag
|
|
219
|
-
|
|
254
|
+
from ..models.record_attachment import RecordAttachment
|
|
220
255
|
d = dict(src_dict)
|
|
221
256
|
id = d.pop("id", UNSET)
|
|
222
257
|
|
|
@@ -233,13 +268,27 @@ class Record:
|
|
|
233
268
|
|
|
234
269
|
description = _parse_description(d.pop("description", UNSET))
|
|
235
270
|
|
|
271
|
+
|
|
236
272
|
_created_at = d.pop("createdAt", UNSET)
|
|
237
273
|
created_at: Union[Unset, datetime.datetime]
|
|
238
|
-
if isinstance(_created_at,
|
|
274
|
+
if isinstance(_created_at, Unset):
|
|
239
275
|
created_at = UNSET
|
|
240
276
|
else:
|
|
241
277
|
created_at = isoparse(_created_at)
|
|
242
278
|
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
_updated_at = d.pop("updatedAt", UNSET)
|
|
283
|
+
updated_at: Union[Unset, datetime.datetime]
|
|
284
|
+
if isinstance(_updated_at, Unset):
|
|
285
|
+
updated_at = UNSET
|
|
286
|
+
else:
|
|
287
|
+
updated_at = isoparse(_updated_at)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
243
292
|
def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
244
293
|
if data is None:
|
|
245
294
|
return data
|
|
@@ -250,13 +299,16 @@ class Record:
|
|
|
250
299
|
raise TypeError()
|
|
251
300
|
event_date_type_0 = isoparse(data)
|
|
252
301
|
|
|
302
|
+
|
|
303
|
+
|
|
253
304
|
return event_date_type_0
|
|
254
|
-
except:
|
|
305
|
+
except: # noqa: E722
|
|
255
306
|
pass
|
|
256
307
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
257
308
|
|
|
258
309
|
event_date = _parse_event_date(d.pop("eventDate", UNSET))
|
|
259
310
|
|
|
311
|
+
|
|
260
312
|
created_by = d.pop("createdBy", UNSET)
|
|
261
313
|
|
|
262
314
|
def _parse_updated_by(data: object) -> Union[None, Unset, str]:
|
|
@@ -268,6 +320,7 @@ class Record:
|
|
|
268
320
|
|
|
269
321
|
updated_by = _parse_updated_by(d.pop("updatedBy", UNSET))
|
|
270
322
|
|
|
323
|
+
|
|
271
324
|
searchable = d.pop("searchable", UNSET)
|
|
272
325
|
|
|
273
326
|
def _parse_ttl(data: object) -> Union[None, Unset, int]:
|
|
@@ -279,63 +332,53 @@ class Record:
|
|
|
279
332
|
|
|
280
333
|
ttl = _parse_ttl(d.pop("ttl", UNSET))
|
|
281
334
|
|
|
282
|
-
archived = d.pop("archived", UNSET)
|
|
283
335
|
|
|
284
|
-
|
|
285
|
-
if data is None:
|
|
286
|
-
return data
|
|
287
|
-
if isinstance(data, Unset):
|
|
288
|
-
return data
|
|
289
|
-
try:
|
|
290
|
-
if not isinstance(data, dict):
|
|
291
|
-
raise TypeError()
|
|
292
|
-
schema_type_0 = JsonNode.from_dict(data)
|
|
336
|
+
archived = d.pop("archived", UNSET)
|
|
293
337
|
|
|
294
|
-
|
|
295
|
-
except: # noqa: E722
|
|
296
|
-
pass
|
|
297
|
-
return cast(Union["JsonNode", None, Unset], data)
|
|
338
|
+
schema = d.pop("schema", UNSET)
|
|
298
339
|
|
|
299
|
-
|
|
340
|
+
content = d.pop("content", UNSET)
|
|
300
341
|
|
|
301
|
-
def
|
|
342
|
+
def _parse_content_text(data: object) -> Union[None, Unset, str]:
|
|
302
343
|
if data is None:
|
|
303
344
|
return data
|
|
304
345
|
if isinstance(data, Unset):
|
|
305
346
|
return data
|
|
306
|
-
|
|
307
|
-
if not isinstance(data, dict):
|
|
308
|
-
raise TypeError()
|
|
309
|
-
content_type_0 = JsonNode.from_dict(data)
|
|
347
|
+
return cast(Union[None, Unset, str], data)
|
|
310
348
|
|
|
311
|
-
|
|
312
|
-
except: # noqa: E722
|
|
313
|
-
pass
|
|
314
|
-
return cast(Union["JsonNode", None, Unset], data)
|
|
349
|
+
content_text = _parse_content_text(d.pop("contentText", UNSET))
|
|
315
350
|
|
|
316
|
-
content = _parse_content(d.pop("content", UNSET))
|
|
317
351
|
|
|
318
352
|
attachments = []
|
|
319
353
|
_attachments = d.pop("attachments", UNSET)
|
|
320
|
-
for attachments_item_data in _attachments or []:
|
|
354
|
+
for attachments_item_data in (_attachments or []):
|
|
321
355
|
attachments_item = RecordAttachment.from_dict(attachments_item_data)
|
|
322
356
|
|
|
357
|
+
|
|
358
|
+
|
|
323
359
|
attachments.append(attachments_item)
|
|
324
360
|
|
|
361
|
+
|
|
325
362
|
_authorization = d.pop("authorization", UNSET)
|
|
326
363
|
authorization: Union[Unset, RecordAuthorization]
|
|
327
|
-
if isinstance(_authorization,
|
|
364
|
+
if isinstance(_authorization, Unset):
|
|
328
365
|
authorization = UNSET
|
|
329
366
|
else:
|
|
330
367
|
authorization = RecordAuthorization.from_dict(_authorization)
|
|
331
368
|
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
|
|
332
372
|
relations = []
|
|
333
373
|
_relations = d.pop("relations", UNSET)
|
|
334
|
-
for relations_item_data in _relations or []:
|
|
374
|
+
for relations_item_data in (_relations or []):
|
|
335
375
|
relations_item = RecordRelation.from_dict(relations_item_data)
|
|
336
376
|
|
|
377
|
+
|
|
378
|
+
|
|
337
379
|
relations.append(relations_item)
|
|
338
380
|
|
|
381
|
+
|
|
339
382
|
def _parse_external_uri(data: object) -> Union[None, Unset, str]:
|
|
340
383
|
if data is None:
|
|
341
384
|
return data
|
|
@@ -345,16 +388,29 @@ class Record:
|
|
|
345
388
|
|
|
346
389
|
external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
|
|
347
390
|
|
|
391
|
+
|
|
348
392
|
labels = cast(list[str], d.pop("labels", UNSET))
|
|
349
393
|
|
|
394
|
+
|
|
350
395
|
tags = []
|
|
351
396
|
_tags = d.pop("tags", UNSET)
|
|
352
|
-
for tags_item_data in _tags or []:
|
|
397
|
+
for tags_item_data in (_tags or []):
|
|
353
398
|
tags_item = RecordTag.from_dict(tags_item_data)
|
|
354
399
|
|
|
400
|
+
|
|
401
|
+
|
|
355
402
|
tags.append(tags_item)
|
|
356
403
|
|
|
357
|
-
|
|
404
|
+
|
|
405
|
+
def _parse_field_etag(data: object) -> Union[None, Unset, str]:
|
|
406
|
+
if data is None:
|
|
407
|
+
return data
|
|
408
|
+
if isinstance(data, Unset):
|
|
409
|
+
return data
|
|
410
|
+
return cast(Union[None, Unset, str], data)
|
|
411
|
+
|
|
412
|
+
field_etag = _parse_field_etag(d.pop("_etag", UNSET))
|
|
413
|
+
|
|
358
414
|
|
|
359
415
|
record = cls(
|
|
360
416
|
id=id,
|
|
@@ -362,6 +418,7 @@ class Record:
|
|
|
362
418
|
title=title,
|
|
363
419
|
description=description,
|
|
364
420
|
created_at=created_at,
|
|
421
|
+
updated_at=updated_at,
|
|
365
422
|
event_date=event_date,
|
|
366
423
|
created_by=created_by,
|
|
367
424
|
updated_by=updated_by,
|
|
@@ -370,13 +427,15 @@ class Record:
|
|
|
370
427
|
archived=archived,
|
|
371
428
|
schema=schema,
|
|
372
429
|
content=content,
|
|
430
|
+
content_text=content_text,
|
|
373
431
|
attachments=attachments,
|
|
374
432
|
authorization=authorization,
|
|
375
433
|
relations=relations,
|
|
376
434
|
external_uri=external_uri,
|
|
377
435
|
labels=labels,
|
|
378
436
|
tags=tags,
|
|
379
|
-
|
|
437
|
+
field_etag=field_etag,
|
|
380
438
|
)
|
|
381
439
|
|
|
382
440
|
return record
|
|
441
|
+
|
|
@@ -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
|
+
|