minikai 0.1.7__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 +8 -0
- minikai/api/__init__.py +1 -0
- minikai/api/groups/__init__.py +1 -0
- minikai/api/groups/add_minis_to_group.py +196 -0
- minikai/api/groups/add_users_to_group.py +196 -0
- minikai/api/groups/create_group.py +178 -0
- minikai/api/groups/delete_group.py +115 -0
- minikai/api/groups/get_group.py +170 -0
- minikai/api/groups/get_group_minis.py +175 -0
- minikai/api/groups/get_group_users.py +175 -0
- minikai/api/groups/get_groups.py +150 -0
- minikai/api/groups/remove_minis_from_group.py +196 -0
- minikai/api/groups/remove_users_from_group.py +196 -0
- minikai/api/groups/update_group.py +195 -0
- minikai/api/minis/__init__.py +1 -0
- minikai/api/minis/create_mini.py +178 -0
- minikai/api/minis/delete_mini.py +115 -0
- minikai/api/minis/get_external_mini.py +183 -0
- minikai/api/minis/get_minis.py +150 -0
- minikai/api/minis/patch_mini.py +195 -0
- minikai/api/minis/update_mini.py +195 -0
- minikai/api/records/__init__.py +1 -0
- minikai/api/records/add_attachments.py +203 -0
- minikai/api/records/add_relations.py +209 -0
- minikai/api/records/create_record.py +182 -0
- minikai/api/records/delete_record.py +115 -0
- minikai/api/records/download_attachment.py +119 -0
- minikai/api/records/get_created_by.py +202 -0
- minikai/api/records/get_labels.py +194 -0
- minikai/api/records/get_records_by_external.py +248 -0
- minikai/api/records/get_states.py +194 -0
- minikai/api/records/get_updated_by.py +202 -0
- minikai/api/records/remove_attachments.py +132 -0
- minikai/api/records/remove_relations.py +132 -0
- minikai/api/records/update_attachments.py +203 -0
- minikai/api/records/update_record.py +199 -0
- minikai/api/records/update_relations.py +209 -0
- minikai/api/records/upsert_records_by_external_uri.py +182 -0
- minikai/api/users/__init__.py +1 -0
- minikai/api/users/delete_api_users_minis.py +122 -0
- minikai/api/users/get_api_users_minis.py +175 -0
- minikai/api/users/get_users.py +150 -0
- minikai/api/users/post_api_users_minis.py +187 -0
- minikai/client.py +271 -0
- minikai/errors.py +14 -0
- minikai/models/__init__.py +103 -0
- minikai/models/add_attachments_body.py +140 -0
- minikai/models/batch_upsert_result.py +124 -0
- minikai/models/create_group_command.py +127 -0
- minikai/models/create_mini_command.py +144 -0
- minikai/models/create_record_command.py +263 -0
- minikai/models/create_record_command_tags.py +63 -0
- minikai/models/cursor_paginated_list_of_record_dto.py +122 -0
- minikai/models/document_file_dto.py +171 -0
- minikai/models/document_file_metadata_dto.py +72 -0
- minikai/models/failed_upsert_item.py +83 -0
- minikai/models/form_field.py +138 -0
- minikai/models/form_field_dto.py +181 -0
- minikai/models/form_field_type.py +10 -0
- minikai/models/group_dto.py +155 -0
- minikai/models/http_validation_problem_details.py +198 -0
- minikai/models/http_validation_problem_details_errors.py +74 -0
- minikai/models/mini_dto.py +224 -0
- minikai/models/mini_template_dto.py +167 -0
- minikai/models/paginated_list_of_record_dto.py +124 -0
- minikai/models/patch_mini_command.py +102 -0
- minikai/models/problem_details.py +174 -0
- minikai/models/record.py +441 -0
- minikai/models/record_attachment.py +265 -0
- minikai/models/record_attachment_dto.py +265 -0
- minikai/models/record_attachment_dto_metadata_type_0.py +63 -0
- minikai/models/record_attachment_metadata_type_0.py +63 -0
- minikai/models/record_authorization.py +107 -0
- minikai/models/record_authorization_dto.py +107 -0
- minikai/models/record_dto.py +385 -0
- minikai/models/record_dto_tags.py +63 -0
- minikai/models/record_relation.py +105 -0
- minikai/models/record_relation_dto.py +105 -0
- minikai/models/record_state.py +10 -0
- minikai/models/record_tag.py +159 -0
- minikai/models/record_tag_dto.py +68 -0
- minikai/models/slim_mini_dto.py +197 -0
- minikai/models/tool_dto.py +95 -0
- minikai/models/update_attachments_body.py +140 -0
- minikai/models/update_group_command.py +148 -0
- minikai/models/update_mini_command.py +153 -0
- minikai/models/update_mini_template_workspaces_command.py +74 -0
- minikai/models/update_record_command.py +274 -0
- minikai/models/update_record_command_tags.py +63 -0
- minikai/models/upsert_record_dto.py +275 -0
- minikai/models/upsert_record_dto_tags.py +63 -0
- minikai/models/upsert_records_by_external_uri_command.py +79 -0
- minikai/models/user_dto.py +215 -0
- minikai/models/user_to_mini_dto.py +99 -0
- minikai/models/workspace_dto.py +99 -0
- minikai/py.typed +1 -0
- minikai/types.py +53 -0
- minikai-0.1.7.dist-info/METADATA +133 -0
- minikai-0.1.7.dist-info/RECORD +100 -0
- minikai-0.1.7.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
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
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
18
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
19
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
T = TypeVar("T", bound="CreateRecordCommand")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@_attrs_define
|
|
30
|
+
class CreateRecordCommand:
|
|
31
|
+
"""
|
|
32
|
+
Attributes:
|
|
33
|
+
title (Union[Unset, str]):
|
|
34
|
+
description (Union[None, Unset, str]):
|
|
35
|
+
mini_id (Union[None, Unset, str]):
|
|
36
|
+
event_date (Union[None, Unset, datetime.datetime]):
|
|
37
|
+
schema (Union[Unset, Any]):
|
|
38
|
+
content (Union[Unset, Any]):
|
|
39
|
+
relations (Union[Unset, list['RecordRelationDto']]):
|
|
40
|
+
external_uri (Union[None, Unset, str]):
|
|
41
|
+
labels (Union[Unset, list[str]]):
|
|
42
|
+
tags (Union[Unset, CreateRecordCommandTags]):
|
|
43
|
+
authorization (Union[Unset, RecordAuthorizationDto]):
|
|
44
|
+
"""
|
|
45
|
+
|
|
46
|
+
title: Union[Unset, str] = UNSET
|
|
47
|
+
description: Union[None, Unset, str] = UNSET
|
|
48
|
+
mini_id: Union[None, Unset, str] = UNSET
|
|
49
|
+
event_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
50
|
+
schema: Union[Unset, Any] = UNSET
|
|
51
|
+
content: Union[Unset, Any] = UNSET
|
|
52
|
+
relations: Union[Unset, list['RecordRelationDto']] = UNSET
|
|
53
|
+
external_uri: Union[None, Unset, str] = UNSET
|
|
54
|
+
labels: Union[Unset, list[str]] = UNSET
|
|
55
|
+
tags: Union[Unset, 'CreateRecordCommandTags'] = UNSET
|
|
56
|
+
authorization: Union[Unset, 'RecordAuthorizationDto'] = UNSET
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> dict[str, Any]:
|
|
63
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
64
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
65
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
66
|
+
title = self.title
|
|
67
|
+
|
|
68
|
+
description: Union[None, Unset, str]
|
|
69
|
+
if isinstance(self.description, Unset):
|
|
70
|
+
description = UNSET
|
|
71
|
+
else:
|
|
72
|
+
description = self.description
|
|
73
|
+
|
|
74
|
+
mini_id: Union[None, Unset, str]
|
|
75
|
+
if isinstance(self.mini_id, Unset):
|
|
76
|
+
mini_id = UNSET
|
|
77
|
+
else:
|
|
78
|
+
mini_id = self.mini_id
|
|
79
|
+
|
|
80
|
+
event_date: Union[None, Unset, str]
|
|
81
|
+
if isinstance(self.event_date, Unset):
|
|
82
|
+
event_date = UNSET
|
|
83
|
+
elif isinstance(self.event_date, datetime.datetime):
|
|
84
|
+
event_date = self.event_date.isoformat()
|
|
85
|
+
else:
|
|
86
|
+
event_date = self.event_date
|
|
87
|
+
|
|
88
|
+
schema = self.schema
|
|
89
|
+
|
|
90
|
+
content = self.content
|
|
91
|
+
|
|
92
|
+
relations: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
93
|
+
if not isinstance(self.relations, Unset):
|
|
94
|
+
relations = []
|
|
95
|
+
for relations_item_data in self.relations:
|
|
96
|
+
relations_item = relations_item_data.to_dict()
|
|
97
|
+
relations.append(relations_item)
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
external_uri: Union[None, Unset, str]
|
|
102
|
+
if isinstance(self.external_uri, Unset):
|
|
103
|
+
external_uri = UNSET
|
|
104
|
+
else:
|
|
105
|
+
external_uri = self.external_uri
|
|
106
|
+
|
|
107
|
+
labels: Union[Unset, list[str]] = UNSET
|
|
108
|
+
if not isinstance(self.labels, Unset):
|
|
109
|
+
labels = self.labels
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
tags: Union[Unset, dict[str, Any]] = UNSET
|
|
114
|
+
if not isinstance(self.tags, Unset):
|
|
115
|
+
tags = self.tags.to_dict()
|
|
116
|
+
|
|
117
|
+
authorization: Union[Unset, dict[str, Any]] = UNSET
|
|
118
|
+
if not isinstance(self.authorization, Unset):
|
|
119
|
+
authorization = self.authorization.to_dict()
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
field_dict: dict[str, Any] = {}
|
|
123
|
+
|
|
124
|
+
field_dict.update({
|
|
125
|
+
})
|
|
126
|
+
if title is not UNSET:
|
|
127
|
+
field_dict["title"] = title
|
|
128
|
+
if description is not UNSET:
|
|
129
|
+
field_dict["description"] = description
|
|
130
|
+
if mini_id is not UNSET:
|
|
131
|
+
field_dict["miniId"] = mini_id
|
|
132
|
+
if event_date is not UNSET:
|
|
133
|
+
field_dict["eventDate"] = event_date
|
|
134
|
+
if schema is not UNSET:
|
|
135
|
+
field_dict["schema"] = schema
|
|
136
|
+
if content is not UNSET:
|
|
137
|
+
field_dict["content"] = content
|
|
138
|
+
if relations is not UNSET:
|
|
139
|
+
field_dict["relations"] = relations
|
|
140
|
+
if external_uri is not UNSET:
|
|
141
|
+
field_dict["externalUri"] = external_uri
|
|
142
|
+
if labels is not UNSET:
|
|
143
|
+
field_dict["labels"] = labels
|
|
144
|
+
if tags is not UNSET:
|
|
145
|
+
field_dict["tags"] = tags
|
|
146
|
+
if authorization is not UNSET:
|
|
147
|
+
field_dict["authorization"] = authorization
|
|
148
|
+
|
|
149
|
+
return field_dict
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
@classmethod
|
|
154
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
155
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
156
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
157
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
158
|
+
d = dict(src_dict)
|
|
159
|
+
title = d.pop("title", UNSET)
|
|
160
|
+
|
|
161
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
162
|
+
if data is None:
|
|
163
|
+
return data
|
|
164
|
+
if isinstance(data, Unset):
|
|
165
|
+
return data
|
|
166
|
+
return cast(Union[None, Unset, str], data)
|
|
167
|
+
|
|
168
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
def _parse_mini_id(data: object) -> Union[None, Unset, str]:
|
|
172
|
+
if data is None:
|
|
173
|
+
return data
|
|
174
|
+
if isinstance(data, Unset):
|
|
175
|
+
return data
|
|
176
|
+
return cast(Union[None, Unset, str], data)
|
|
177
|
+
|
|
178
|
+
mini_id = _parse_mini_id(d.pop("miniId", UNSET))
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
182
|
+
if data is None:
|
|
183
|
+
return data
|
|
184
|
+
if isinstance(data, Unset):
|
|
185
|
+
return data
|
|
186
|
+
try:
|
|
187
|
+
if not isinstance(data, str):
|
|
188
|
+
raise TypeError()
|
|
189
|
+
event_date_type_0 = isoparse(data)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
return event_date_type_0
|
|
194
|
+
except: # noqa: E722
|
|
195
|
+
pass
|
|
196
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
197
|
+
|
|
198
|
+
event_date = _parse_event_date(d.pop("eventDate", UNSET))
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
schema = d.pop("schema", UNSET)
|
|
202
|
+
|
|
203
|
+
content = d.pop("content", UNSET)
|
|
204
|
+
|
|
205
|
+
relations = []
|
|
206
|
+
_relations = d.pop("relations", UNSET)
|
|
207
|
+
for relations_item_data in (_relations or []):
|
|
208
|
+
relations_item = RecordRelationDto.from_dict(relations_item_data)
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
relations.append(relations_item)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def _parse_external_uri(data: object) -> Union[None, Unset, str]:
|
|
216
|
+
if data is None:
|
|
217
|
+
return data
|
|
218
|
+
if isinstance(data, Unset):
|
|
219
|
+
return data
|
|
220
|
+
return cast(Union[None, Unset, str], data)
|
|
221
|
+
|
|
222
|
+
external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
labels = cast(list[str], d.pop("labels", UNSET))
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
_tags = d.pop("tags", UNSET)
|
|
229
|
+
tags: Union[Unset, CreateRecordCommandTags]
|
|
230
|
+
if isinstance(_tags, Unset):
|
|
231
|
+
tags = UNSET
|
|
232
|
+
else:
|
|
233
|
+
tags = CreateRecordCommandTags.from_dict(_tags)
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
_authorization = d.pop("authorization", UNSET)
|
|
239
|
+
authorization: Union[Unset, RecordAuthorizationDto]
|
|
240
|
+
if isinstance(_authorization, Unset):
|
|
241
|
+
authorization = UNSET
|
|
242
|
+
else:
|
|
243
|
+
authorization = RecordAuthorizationDto.from_dict(_authorization)
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
create_record_command = cls(
|
|
249
|
+
title=title,
|
|
250
|
+
description=description,
|
|
251
|
+
mini_id=mini_id,
|
|
252
|
+
event_date=event_date,
|
|
253
|
+
schema=schema,
|
|
254
|
+
content=content,
|
|
255
|
+
relations=relations,
|
|
256
|
+
external_uri=external_uri,
|
|
257
|
+
labels=labels,
|
|
258
|
+
tags=tags,
|
|
259
|
+
authorization=authorization,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
return create_record_command
|
|
263
|
+
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="CreateRecordCommandTags")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class CreateRecordCommandTags:
|
|
21
|
+
"""
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
|
|
32
|
+
field_dict: dict[str, Any] = {}
|
|
33
|
+
field_dict.update(self.additional_properties)
|
|
34
|
+
|
|
35
|
+
return field_dict
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
create_record_command_tags = cls(
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
create_record_command_tags.additional_properties = d
|
|
47
|
+
return create_record_command_tags
|
|
48
|
+
|
|
49
|
+
@property
|
|
50
|
+
def additional_keys(self) -> list[str]:
|
|
51
|
+
return list(self.additional_properties.keys())
|
|
52
|
+
|
|
53
|
+
def __getitem__(self, key: str) -> Any:
|
|
54
|
+
return self.additional_properties[key]
|
|
55
|
+
|
|
56
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
57
|
+
self.additional_properties[key] = value
|
|
58
|
+
|
|
59
|
+
def __delitem__(self, key: str) -> None:
|
|
60
|
+
del self.additional_properties[key]
|
|
61
|
+
|
|
62
|
+
def __contains__(self, key: str) -> bool:
|
|
63
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
from typing import cast
|
|
11
|
+
from typing import cast, Union
|
|
12
|
+
from typing import Union
|
|
13
|
+
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from ..models.record_dto import RecordDto
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="CursorPaginatedListOfRecordDto")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class CursorPaginatedListOfRecordDto:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
items (Union[Unset, list['RecordDto']]):
|
|
30
|
+
before_cursor (Union[None, Unset, str]):
|
|
31
|
+
after_cursor (Union[None, Unset, str]):
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
items: Union[Unset, list['RecordDto']] = UNSET
|
|
35
|
+
before_cursor: Union[None, Unset, str] = UNSET
|
|
36
|
+
after_cursor: Union[None, Unset, str] = UNSET
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_dict(self) -> dict[str, Any]:
|
|
43
|
+
from ..models.record_dto import RecordDto
|
|
44
|
+
items: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
45
|
+
if not isinstance(self.items, Unset):
|
|
46
|
+
items = []
|
|
47
|
+
for items_item_data in self.items:
|
|
48
|
+
items_item = items_item_data.to_dict()
|
|
49
|
+
items.append(items_item)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
before_cursor: Union[None, Unset, str]
|
|
54
|
+
if isinstance(self.before_cursor, Unset):
|
|
55
|
+
before_cursor = UNSET
|
|
56
|
+
else:
|
|
57
|
+
before_cursor = self.before_cursor
|
|
58
|
+
|
|
59
|
+
after_cursor: Union[None, Unset, str]
|
|
60
|
+
if isinstance(self.after_cursor, Unset):
|
|
61
|
+
after_cursor = UNSET
|
|
62
|
+
else:
|
|
63
|
+
after_cursor = self.after_cursor
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
field_dict: dict[str, Any] = {}
|
|
67
|
+
|
|
68
|
+
field_dict.update({
|
|
69
|
+
})
|
|
70
|
+
if items is not UNSET:
|
|
71
|
+
field_dict["items"] = items
|
|
72
|
+
if before_cursor is not UNSET:
|
|
73
|
+
field_dict["beforeCursor"] = before_cursor
|
|
74
|
+
if after_cursor is not UNSET:
|
|
75
|
+
field_dict["afterCursor"] = after_cursor
|
|
76
|
+
|
|
77
|
+
return field_dict
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
83
|
+
from ..models.record_dto import RecordDto
|
|
84
|
+
d = dict(src_dict)
|
|
85
|
+
items = []
|
|
86
|
+
_items = d.pop("items", UNSET)
|
|
87
|
+
for items_item_data in (_items or []):
|
|
88
|
+
items_item = RecordDto.from_dict(items_item_data)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
items.append(items_item)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
def _parse_before_cursor(data: object) -> Union[None, Unset, str]:
|
|
96
|
+
if data is None:
|
|
97
|
+
return data
|
|
98
|
+
if isinstance(data, Unset):
|
|
99
|
+
return data
|
|
100
|
+
return cast(Union[None, Unset, str], data)
|
|
101
|
+
|
|
102
|
+
before_cursor = _parse_before_cursor(d.pop("beforeCursor", UNSET))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _parse_after_cursor(data: object) -> Union[None, Unset, str]:
|
|
106
|
+
if data is None:
|
|
107
|
+
return data
|
|
108
|
+
if isinstance(data, Unset):
|
|
109
|
+
return data
|
|
110
|
+
return cast(Union[None, Unset, str], data)
|
|
111
|
+
|
|
112
|
+
after_cursor = _parse_after_cursor(d.pop("afterCursor", UNSET))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
cursor_paginated_list_of_record_dto = cls(
|
|
116
|
+
items=items,
|
|
117
|
+
before_cursor=before_cursor,
|
|
118
|
+
after_cursor=after_cursor,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
return cursor_paginated_list_of_record_dto
|
|
122
|
+
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
from typing import cast, Union
|
|
11
|
+
from typing import Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="DocumentFileDto")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class DocumentFileDto:
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
id (Union[Unset, int]):
|
|
27
|
+
file_id (Union[Unset, str]):
|
|
28
|
+
doc_file_id (Union[Unset, str]):
|
|
29
|
+
name (Union[None, Unset, str]):
|
|
30
|
+
content_type (Union[None, Unset, str]):
|
|
31
|
+
file_extension (Union[None, Unset, str]):
|
|
32
|
+
size (Union[Unset, int]):
|
|
33
|
+
workspace_id (Union[None, Unset, str]):
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
id: Union[Unset, int] = UNSET
|
|
37
|
+
file_id: Union[Unset, str] = UNSET
|
|
38
|
+
doc_file_id: Union[Unset, str] = UNSET
|
|
39
|
+
name: Union[None, Unset, str] = UNSET
|
|
40
|
+
content_type: Union[None, Unset, str] = UNSET
|
|
41
|
+
file_extension: Union[None, Unset, str] = UNSET
|
|
42
|
+
size: Union[Unset, int] = UNSET
|
|
43
|
+
workspace_id: Union[None, Unset, str] = UNSET
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_dict(self) -> dict[str, Any]:
|
|
50
|
+
id = self.id
|
|
51
|
+
|
|
52
|
+
file_id = self.file_id
|
|
53
|
+
|
|
54
|
+
doc_file_id = self.doc_file_id
|
|
55
|
+
|
|
56
|
+
name: Union[None, Unset, str]
|
|
57
|
+
if isinstance(self.name, Unset):
|
|
58
|
+
name = UNSET
|
|
59
|
+
else:
|
|
60
|
+
name = self.name
|
|
61
|
+
|
|
62
|
+
content_type: Union[None, Unset, str]
|
|
63
|
+
if isinstance(self.content_type, Unset):
|
|
64
|
+
content_type = UNSET
|
|
65
|
+
else:
|
|
66
|
+
content_type = self.content_type
|
|
67
|
+
|
|
68
|
+
file_extension: Union[None, Unset, str]
|
|
69
|
+
if isinstance(self.file_extension, Unset):
|
|
70
|
+
file_extension = UNSET
|
|
71
|
+
else:
|
|
72
|
+
file_extension = self.file_extension
|
|
73
|
+
|
|
74
|
+
size = self.size
|
|
75
|
+
|
|
76
|
+
workspace_id: Union[None, Unset, str]
|
|
77
|
+
if isinstance(self.workspace_id, Unset):
|
|
78
|
+
workspace_id = UNSET
|
|
79
|
+
else:
|
|
80
|
+
workspace_id = self.workspace_id
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
field_dict: dict[str, Any] = {}
|
|
84
|
+
|
|
85
|
+
field_dict.update({
|
|
86
|
+
})
|
|
87
|
+
if id is not UNSET:
|
|
88
|
+
field_dict["id"] = id
|
|
89
|
+
if file_id is not UNSET:
|
|
90
|
+
field_dict["fileId"] = file_id
|
|
91
|
+
if doc_file_id is not UNSET:
|
|
92
|
+
field_dict["docFileId"] = doc_file_id
|
|
93
|
+
if name is not UNSET:
|
|
94
|
+
field_dict["name"] = name
|
|
95
|
+
if content_type is not UNSET:
|
|
96
|
+
field_dict["contentType"] = content_type
|
|
97
|
+
if file_extension is not UNSET:
|
|
98
|
+
field_dict["fileExtension"] = file_extension
|
|
99
|
+
if size is not UNSET:
|
|
100
|
+
field_dict["size"] = size
|
|
101
|
+
if workspace_id is not UNSET:
|
|
102
|
+
field_dict["workspaceId"] = workspace_id
|
|
103
|
+
|
|
104
|
+
return field_dict
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
@classmethod
|
|
109
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
110
|
+
d = dict(src_dict)
|
|
111
|
+
id = d.pop("id", UNSET)
|
|
112
|
+
|
|
113
|
+
file_id = d.pop("fileId", UNSET)
|
|
114
|
+
|
|
115
|
+
doc_file_id = d.pop("docFileId", UNSET)
|
|
116
|
+
|
|
117
|
+
def _parse_name(data: object) -> Union[None, Unset, str]:
|
|
118
|
+
if data is None:
|
|
119
|
+
return data
|
|
120
|
+
if isinstance(data, Unset):
|
|
121
|
+
return data
|
|
122
|
+
return cast(Union[None, Unset, str], data)
|
|
123
|
+
|
|
124
|
+
name = _parse_name(d.pop("name", UNSET))
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _parse_content_type(data: object) -> Union[None, Unset, str]:
|
|
128
|
+
if data is None:
|
|
129
|
+
return data
|
|
130
|
+
if isinstance(data, Unset):
|
|
131
|
+
return data
|
|
132
|
+
return cast(Union[None, Unset, str], data)
|
|
133
|
+
|
|
134
|
+
content_type = _parse_content_type(d.pop("contentType", UNSET))
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def _parse_file_extension(data: object) -> Union[None, Unset, str]:
|
|
138
|
+
if data is None:
|
|
139
|
+
return data
|
|
140
|
+
if isinstance(data, Unset):
|
|
141
|
+
return data
|
|
142
|
+
return cast(Union[None, Unset, str], data)
|
|
143
|
+
|
|
144
|
+
file_extension = _parse_file_extension(d.pop("fileExtension", UNSET))
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
size = d.pop("size", UNSET)
|
|
148
|
+
|
|
149
|
+
def _parse_workspace_id(data: object) -> Union[None, Unset, str]:
|
|
150
|
+
if data is None:
|
|
151
|
+
return data
|
|
152
|
+
if isinstance(data, Unset):
|
|
153
|
+
return data
|
|
154
|
+
return cast(Union[None, Unset, str], data)
|
|
155
|
+
|
|
156
|
+
workspace_id = _parse_workspace_id(d.pop("workspaceId", UNSET))
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
document_file_dto = cls(
|
|
160
|
+
id=id,
|
|
161
|
+
file_id=file_id,
|
|
162
|
+
doc_file_id=doc_file_id,
|
|
163
|
+
name=name,
|
|
164
|
+
content_type=content_type,
|
|
165
|
+
file_extension=file_extension,
|
|
166
|
+
size=size,
|
|
167
|
+
workspace_id=workspace_id,
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
return document_file_dto
|
|
171
|
+
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
from typing import cast, Union
|
|
11
|
+
from typing import Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="DocumentFileMetadataDto")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class DocumentFileMetadataDto:
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
content_hash (Union[None, Unset, str]):
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
content_hash: Union[None, Unset, str] = UNSET
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
content_hash: Union[None, Unset, str]
|
|
37
|
+
if isinstance(self.content_hash, Unset):
|
|
38
|
+
content_hash = UNSET
|
|
39
|
+
else:
|
|
40
|
+
content_hash = self.content_hash
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
field_dict: dict[str, Any] = {}
|
|
44
|
+
|
|
45
|
+
field_dict.update({
|
|
46
|
+
})
|
|
47
|
+
if content_hash is not UNSET:
|
|
48
|
+
field_dict["contentHash"] = content_hash
|
|
49
|
+
|
|
50
|
+
return field_dict
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
56
|
+
d = dict(src_dict)
|
|
57
|
+
def _parse_content_hash(data: object) -> Union[None, Unset, str]:
|
|
58
|
+
if data is None:
|
|
59
|
+
return data
|
|
60
|
+
if isinstance(data, Unset):
|
|
61
|
+
return data
|
|
62
|
+
return cast(Union[None, Unset, str], data)
|
|
63
|
+
|
|
64
|
+
content_hash = _parse_content_hash(d.pop("contentHash", UNSET))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
document_file_metadata_dto = cls(
|
|
68
|
+
content_hash=content_hash,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
return document_file_metadata_dto
|
|
72
|
+
|