minikai 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of minikai might be problematic. Click here for more details.
- 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 +176 -0
- minikai/api/groups/add_users_to_group.py +176 -0
- minikai/api/groups/create_group.py +160 -0
- minikai/api/groups/delete_group.py +95 -0
- minikai/api/groups/get_group.py +151 -0
- minikai/api/groups/get_group_minis.py +156 -0
- minikai/api/groups/get_group_users.py +156 -0
- minikai/api/groups/get_groups.py +128 -0
- minikai/api/groups/remove_minis_from_group.py +176 -0
- minikai/api/groups/remove_users_from_group.py +176 -0
- minikai/api/groups/update_group.py +177 -0
- minikai/api/minis/__init__.py +1 -0
- minikai/api/minis/create_mini.py +160 -0
- minikai/api/minis/delete_mini.py +95 -0
- minikai/api/minis/get_external_mini.py +164 -0
- minikai/api/minis/get_minis.py +128 -0
- minikai/api/minis/patch_mini.py +177 -0
- minikai/api/minis/update_mini.py +177 -0
- minikai/api/records/__init__.py +1 -0
- minikai/api/records/add_attachments.py +182 -0
- minikai/api/records/add_relations.py +187 -0
- minikai/api/records/create_record.py +162 -0
- minikai/api/records/delete_record.py +95 -0
- minikai/api/records/get_records_by_external.py +230 -0
- minikai/api/records/remove_attachments.py +110 -0
- minikai/api/records/remove_relations.py +110 -0
- minikai/api/records/update_attachments.py +182 -0
- minikai/api/records/update_record.py +179 -0
- minikai/api/records/update_relations.py +187 -0
- minikai/api/users/__init__.py +1 -0
- minikai/api/users/delete_api_users_minis.py +102 -0
- minikai/api/users/get_api_users_minis.py +156 -0
- minikai/api/users/get_users.py +128 -0
- minikai/api/users/post_api_users_minis.py +168 -0
- minikai/client.py +268 -0
- minikai/errors.py +16 -0
- minikai/models/__init__.py +89 -0
- minikai/models/add_attachments_body.py +98 -0
- minikai/models/create_group_command.py +102 -0
- minikai/models/create_mini_command.py +120 -0
- minikai/models/create_record_command.py +268 -0
- minikai/models/create_record_command_tags.py +44 -0
- minikai/models/document_file_dto.py +147 -0
- minikai/models/form_field.py +112 -0
- minikai/models/form_field_dto.py +149 -0
- minikai/models/form_field_type.py +16 -0
- minikai/models/group_dto.py +124 -0
- minikai/models/http_validation_problem_details.py +173 -0
- minikai/models/http_validation_problem_details_errors.py +51 -0
- minikai/models/json_node.py +119 -0
- minikai/models/json_node_options.py +42 -0
- minikai/models/mini_dto.py +189 -0
- minikai/models/mini_template_dto.py +135 -0
- minikai/models/paginated_list_of_record_dto.py +101 -0
- minikai/models/patch_mini_command.py +80 -0
- minikai/models/problem_details.py +151 -0
- minikai/models/record.py +379 -0
- minikai/models/record_attachment.py +236 -0
- minikai/models/record_attachment_dto.py +236 -0
- minikai/models/record_attachment_dto_metadata_type_0.py +44 -0
- minikai/models/record_attachment_metadata_type_0.py +44 -0
- minikai/models/record_authorization.py +75 -0
- minikai/models/record_authorization_dto.py +75 -0
- minikai/models/record_dto.py +377 -0
- minikai/models/record_dto_tags.py +44 -0
- minikai/models/record_relation.py +81 -0
- minikai/models/record_relation_dto.py +81 -0
- minikai/models/record_tags.py +44 -0
- minikai/models/slim_mini_dto.py +168 -0
- minikai/models/tool_dto.py +76 -0
- minikai/models/update_attachments_body.py +98 -0
- minikai/models/update_group_command.py +122 -0
- minikai/models/update_mini_command.py +129 -0
- minikai/models/update_mini_template_workspaces_command.py +51 -0
- minikai/models/update_record_command.py +266 -0
- minikai/models/update_record_command_tags.py +44 -0
- minikai/models/user_dto.py +182 -0
- minikai/models/user_to_mini_dto.py +78 -0
- minikai/models/workspace_dto.py +78 -0
- minikai/py.typed +1 -0
- minikai/types.py +54 -0
- minikai-0.1.0.dist-info/METADATA +133 -0
- minikai-0.1.0.dist-info/RECORD +87 -0
- minikai-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from dateutil.parser import isoparse
|
|
7
|
+
|
|
8
|
+
from ..types import UNSET, Unset
|
|
9
|
+
|
|
10
|
+
if TYPE_CHECKING:
|
|
11
|
+
from ..models.json_node import JsonNode
|
|
12
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
13
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
14
|
+
from ..models.update_record_command_tags import UpdateRecordCommandTags
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
T = TypeVar("T", bound="UpdateRecordCommand")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@_attrs_define
|
|
21
|
+
class UpdateRecordCommand:
|
|
22
|
+
"""
|
|
23
|
+
Attributes:
|
|
24
|
+
id (Union[Unset, str]):
|
|
25
|
+
title (Union[Unset, str]):
|
|
26
|
+
description (Union[None, Unset, str]):
|
|
27
|
+
event_date (Union[None, Unset, datetime.datetime]):
|
|
28
|
+
schema (Union['JsonNode', None, Unset]):
|
|
29
|
+
content (Union['JsonNode', None, Unset]):
|
|
30
|
+
relations (Union[Unset, list['RecordRelationDto']]):
|
|
31
|
+
external_uri (Union[None, Unset, str]):
|
|
32
|
+
labels (Union[Unset, list[str]]):
|
|
33
|
+
tags (Union[Unset, UpdateRecordCommandTags]):
|
|
34
|
+
authorization (Union[Unset, RecordAuthorizationDto]):
|
|
35
|
+
archived (Union[Unset, bool]):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
id: Union[Unset, str] = UNSET
|
|
39
|
+
title: Union[Unset, str] = UNSET
|
|
40
|
+
description: Union[None, Unset, str] = UNSET
|
|
41
|
+
event_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
42
|
+
schema: Union["JsonNode", None, Unset] = UNSET
|
|
43
|
+
content: Union["JsonNode", None, Unset] = UNSET
|
|
44
|
+
relations: Union[Unset, list["RecordRelationDto"]] = UNSET
|
|
45
|
+
external_uri: Union[None, Unset, str] = UNSET
|
|
46
|
+
labels: Union[Unset, list[str]] = UNSET
|
|
47
|
+
tags: Union[Unset, "UpdateRecordCommandTags"] = UNSET
|
|
48
|
+
authorization: Union[Unset, "RecordAuthorizationDto"] = UNSET
|
|
49
|
+
archived: Union[Unset, bool] = UNSET
|
|
50
|
+
|
|
51
|
+
def to_dict(self) -> dict[str, Any]:
|
|
52
|
+
from ..models.json_node import JsonNode
|
|
53
|
+
|
|
54
|
+
id = self.id
|
|
55
|
+
|
|
56
|
+
title = self.title
|
|
57
|
+
|
|
58
|
+
description: Union[None, Unset, str]
|
|
59
|
+
if isinstance(self.description, Unset):
|
|
60
|
+
description = UNSET
|
|
61
|
+
else:
|
|
62
|
+
description = self.description
|
|
63
|
+
|
|
64
|
+
event_date: Union[None, Unset, str]
|
|
65
|
+
if isinstance(self.event_date, Unset):
|
|
66
|
+
event_date = UNSET
|
|
67
|
+
elif isinstance(self.event_date, datetime.datetime):
|
|
68
|
+
event_date = self.event_date.isoformat()
|
|
69
|
+
else:
|
|
70
|
+
event_date = self.event_date
|
|
71
|
+
|
|
72
|
+
schema: Union[None, Unset, dict[str, Any]]
|
|
73
|
+
if isinstance(self.schema, Unset):
|
|
74
|
+
schema = UNSET
|
|
75
|
+
elif isinstance(self.schema, JsonNode):
|
|
76
|
+
schema = self.schema.to_dict()
|
|
77
|
+
else:
|
|
78
|
+
schema = self.schema
|
|
79
|
+
|
|
80
|
+
content: Union[None, Unset, dict[str, Any]]
|
|
81
|
+
if isinstance(self.content, Unset):
|
|
82
|
+
content = UNSET
|
|
83
|
+
elif isinstance(self.content, JsonNode):
|
|
84
|
+
content = self.content.to_dict()
|
|
85
|
+
else:
|
|
86
|
+
content = self.content
|
|
87
|
+
|
|
88
|
+
relations: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
89
|
+
if not isinstance(self.relations, Unset):
|
|
90
|
+
relations = []
|
|
91
|
+
for relations_item_data in self.relations:
|
|
92
|
+
relations_item = relations_item_data.to_dict()
|
|
93
|
+
relations.append(relations_item)
|
|
94
|
+
|
|
95
|
+
external_uri: Union[None, Unset, str]
|
|
96
|
+
if isinstance(self.external_uri, Unset):
|
|
97
|
+
external_uri = UNSET
|
|
98
|
+
else:
|
|
99
|
+
external_uri = self.external_uri
|
|
100
|
+
|
|
101
|
+
labels: Union[Unset, list[str]] = UNSET
|
|
102
|
+
if not isinstance(self.labels, Unset):
|
|
103
|
+
labels = self.labels
|
|
104
|
+
|
|
105
|
+
tags: Union[Unset, dict[str, Any]] = UNSET
|
|
106
|
+
if not isinstance(self.tags, Unset):
|
|
107
|
+
tags = self.tags.to_dict()
|
|
108
|
+
|
|
109
|
+
authorization: Union[Unset, dict[str, Any]] = UNSET
|
|
110
|
+
if not isinstance(self.authorization, Unset):
|
|
111
|
+
authorization = self.authorization.to_dict()
|
|
112
|
+
|
|
113
|
+
archived = self.archived
|
|
114
|
+
|
|
115
|
+
field_dict: dict[str, Any] = {}
|
|
116
|
+
|
|
117
|
+
field_dict.update({})
|
|
118
|
+
if id is not UNSET:
|
|
119
|
+
field_dict["id"] = id
|
|
120
|
+
if title is not UNSET:
|
|
121
|
+
field_dict["title"] = title
|
|
122
|
+
if description is not UNSET:
|
|
123
|
+
field_dict["description"] = description
|
|
124
|
+
if event_date is not UNSET:
|
|
125
|
+
field_dict["eventDate"] = event_date
|
|
126
|
+
if schema is not UNSET:
|
|
127
|
+
field_dict["schema"] = schema
|
|
128
|
+
if content is not UNSET:
|
|
129
|
+
field_dict["content"] = content
|
|
130
|
+
if relations is not UNSET:
|
|
131
|
+
field_dict["relations"] = relations
|
|
132
|
+
if external_uri is not UNSET:
|
|
133
|
+
field_dict["externalUri"] = external_uri
|
|
134
|
+
if labels is not UNSET:
|
|
135
|
+
field_dict["labels"] = labels
|
|
136
|
+
if tags is not UNSET:
|
|
137
|
+
field_dict["tags"] = tags
|
|
138
|
+
if authorization is not UNSET:
|
|
139
|
+
field_dict["authorization"] = authorization
|
|
140
|
+
if archived is not UNSET:
|
|
141
|
+
field_dict["archived"] = archived
|
|
142
|
+
|
|
143
|
+
return field_dict
|
|
144
|
+
|
|
145
|
+
@classmethod
|
|
146
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
147
|
+
from ..models.json_node import JsonNode
|
|
148
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
149
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
150
|
+
from ..models.update_record_command_tags import UpdateRecordCommandTags
|
|
151
|
+
|
|
152
|
+
d = dict(src_dict)
|
|
153
|
+
id = d.pop("id", UNSET)
|
|
154
|
+
|
|
155
|
+
title = d.pop("title", UNSET)
|
|
156
|
+
|
|
157
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
158
|
+
if data is None:
|
|
159
|
+
return data
|
|
160
|
+
if isinstance(data, Unset):
|
|
161
|
+
return data
|
|
162
|
+
return cast(Union[None, Unset, str], data)
|
|
163
|
+
|
|
164
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
165
|
+
|
|
166
|
+
def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
167
|
+
if data is None:
|
|
168
|
+
return data
|
|
169
|
+
if isinstance(data, Unset):
|
|
170
|
+
return data
|
|
171
|
+
try:
|
|
172
|
+
if not isinstance(data, str):
|
|
173
|
+
raise TypeError()
|
|
174
|
+
event_date_type_0 = isoparse(data)
|
|
175
|
+
|
|
176
|
+
return event_date_type_0
|
|
177
|
+
except: # noqa: E722
|
|
178
|
+
pass
|
|
179
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
180
|
+
|
|
181
|
+
event_date = _parse_event_date(d.pop("eventDate", UNSET))
|
|
182
|
+
|
|
183
|
+
def _parse_schema(data: object) -> Union["JsonNode", None, Unset]:
|
|
184
|
+
if data is None:
|
|
185
|
+
return data
|
|
186
|
+
if isinstance(data, Unset):
|
|
187
|
+
return data
|
|
188
|
+
try:
|
|
189
|
+
if not isinstance(data, dict):
|
|
190
|
+
raise TypeError()
|
|
191
|
+
schema_type_0 = JsonNode.from_dict(data)
|
|
192
|
+
|
|
193
|
+
return schema_type_0
|
|
194
|
+
except: # noqa: E722
|
|
195
|
+
pass
|
|
196
|
+
return cast(Union["JsonNode", None, Unset], data)
|
|
197
|
+
|
|
198
|
+
schema = _parse_schema(d.pop("schema", UNSET))
|
|
199
|
+
|
|
200
|
+
def _parse_content(data: object) -> Union["JsonNode", None, Unset]:
|
|
201
|
+
if data is None:
|
|
202
|
+
return data
|
|
203
|
+
if isinstance(data, Unset):
|
|
204
|
+
return data
|
|
205
|
+
try:
|
|
206
|
+
if not isinstance(data, dict):
|
|
207
|
+
raise TypeError()
|
|
208
|
+
content_type_0 = JsonNode.from_dict(data)
|
|
209
|
+
|
|
210
|
+
return content_type_0
|
|
211
|
+
except: # noqa: E722
|
|
212
|
+
pass
|
|
213
|
+
return cast(Union["JsonNode", None, Unset], data)
|
|
214
|
+
|
|
215
|
+
content = _parse_content(d.pop("content", UNSET))
|
|
216
|
+
|
|
217
|
+
relations = []
|
|
218
|
+
_relations = d.pop("relations", UNSET)
|
|
219
|
+
for relations_item_data in _relations or []:
|
|
220
|
+
relations_item = RecordRelationDto.from_dict(relations_item_data)
|
|
221
|
+
|
|
222
|
+
relations.append(relations_item)
|
|
223
|
+
|
|
224
|
+
def _parse_external_uri(data: object) -> Union[None, Unset, str]:
|
|
225
|
+
if data is None:
|
|
226
|
+
return data
|
|
227
|
+
if isinstance(data, Unset):
|
|
228
|
+
return data
|
|
229
|
+
return cast(Union[None, Unset, str], data)
|
|
230
|
+
|
|
231
|
+
external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
|
|
232
|
+
|
|
233
|
+
labels = cast(list[str], d.pop("labels", UNSET))
|
|
234
|
+
|
|
235
|
+
_tags = d.pop("tags", UNSET)
|
|
236
|
+
tags: Union[Unset, UpdateRecordCommandTags]
|
|
237
|
+
if isinstance(_tags, Unset):
|
|
238
|
+
tags = UNSET
|
|
239
|
+
else:
|
|
240
|
+
tags = UpdateRecordCommandTags.from_dict(_tags)
|
|
241
|
+
|
|
242
|
+
_authorization = d.pop("authorization", UNSET)
|
|
243
|
+
authorization: Union[Unset, RecordAuthorizationDto]
|
|
244
|
+
if isinstance(_authorization, Unset):
|
|
245
|
+
authorization = UNSET
|
|
246
|
+
else:
|
|
247
|
+
authorization = RecordAuthorizationDto.from_dict(_authorization)
|
|
248
|
+
|
|
249
|
+
archived = d.pop("archived", UNSET)
|
|
250
|
+
|
|
251
|
+
update_record_command = cls(
|
|
252
|
+
id=id,
|
|
253
|
+
title=title,
|
|
254
|
+
description=description,
|
|
255
|
+
event_date=event_date,
|
|
256
|
+
schema=schema,
|
|
257
|
+
content=content,
|
|
258
|
+
relations=relations,
|
|
259
|
+
external_uri=external_uri,
|
|
260
|
+
labels=labels,
|
|
261
|
+
tags=tags,
|
|
262
|
+
authorization=authorization,
|
|
263
|
+
archived=archived,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
return update_record_command
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="UpdateRecordCommandTags")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class UpdateRecordCommandTags:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
15
|
+
|
|
16
|
+
def to_dict(self) -> dict[str, Any]:
|
|
17
|
+
field_dict: dict[str, Any] = {}
|
|
18
|
+
field_dict.update(self.additional_properties)
|
|
19
|
+
|
|
20
|
+
return field_dict
|
|
21
|
+
|
|
22
|
+
@classmethod
|
|
23
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
24
|
+
d = dict(src_dict)
|
|
25
|
+
update_record_command_tags = cls()
|
|
26
|
+
|
|
27
|
+
update_record_command_tags.additional_properties = d
|
|
28
|
+
return update_record_command_tags
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def additional_keys(self) -> list[str]:
|
|
32
|
+
return list(self.additional_properties.keys())
|
|
33
|
+
|
|
34
|
+
def __getitem__(self, key: str) -> Any:
|
|
35
|
+
return self.additional_properties[key]
|
|
36
|
+
|
|
37
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
38
|
+
self.additional_properties[key] = value
|
|
39
|
+
|
|
40
|
+
def __delitem__(self, key: str) -> None:
|
|
41
|
+
del self.additional_properties[key]
|
|
42
|
+
|
|
43
|
+
def __contains__(self, key: str) -> bool:
|
|
44
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from dateutil.parser import isoparse
|
|
7
|
+
|
|
8
|
+
from ..types import UNSET, Unset
|
|
9
|
+
|
|
10
|
+
T = TypeVar("T", bound="UserDto")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@_attrs_define
|
|
14
|
+
class UserDto:
|
|
15
|
+
"""
|
|
16
|
+
Attributes:
|
|
17
|
+
id (Union[Unset, str]):
|
|
18
|
+
email (Union[Unset, str]):
|
|
19
|
+
first_name (Union[None, Unset, str]):
|
|
20
|
+
last_name (Union[None, Unset, str]):
|
|
21
|
+
profile_picture_url (Union[None, Unset, str]):
|
|
22
|
+
created_at (Union[None, Unset, datetime.datetime]):
|
|
23
|
+
updated_at (Union[None, Unset, datetime.datetime]):
|
|
24
|
+
organization_ids (Union[Unset, list[str]]):
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
id: Union[Unset, str] = UNSET
|
|
28
|
+
email: Union[Unset, str] = UNSET
|
|
29
|
+
first_name: Union[None, Unset, str] = UNSET
|
|
30
|
+
last_name: Union[None, Unset, str] = UNSET
|
|
31
|
+
profile_picture_url: Union[None, Unset, str] = UNSET
|
|
32
|
+
created_at: Union[None, Unset, datetime.datetime] = UNSET
|
|
33
|
+
updated_at: Union[None, Unset, datetime.datetime] = UNSET
|
|
34
|
+
organization_ids: Union[Unset, list[str]] = UNSET
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
id = self.id
|
|
38
|
+
|
|
39
|
+
email = self.email
|
|
40
|
+
|
|
41
|
+
first_name: Union[None, Unset, str]
|
|
42
|
+
if isinstance(self.first_name, Unset):
|
|
43
|
+
first_name = UNSET
|
|
44
|
+
else:
|
|
45
|
+
first_name = self.first_name
|
|
46
|
+
|
|
47
|
+
last_name: Union[None, Unset, str]
|
|
48
|
+
if isinstance(self.last_name, Unset):
|
|
49
|
+
last_name = UNSET
|
|
50
|
+
else:
|
|
51
|
+
last_name = self.last_name
|
|
52
|
+
|
|
53
|
+
profile_picture_url: Union[None, Unset, str]
|
|
54
|
+
if isinstance(self.profile_picture_url, Unset):
|
|
55
|
+
profile_picture_url = UNSET
|
|
56
|
+
else:
|
|
57
|
+
profile_picture_url = self.profile_picture_url
|
|
58
|
+
|
|
59
|
+
created_at: Union[None, Unset, str]
|
|
60
|
+
if isinstance(self.created_at, Unset):
|
|
61
|
+
created_at = UNSET
|
|
62
|
+
elif isinstance(self.created_at, datetime.datetime):
|
|
63
|
+
created_at = self.created_at.isoformat()
|
|
64
|
+
else:
|
|
65
|
+
created_at = self.created_at
|
|
66
|
+
|
|
67
|
+
updated_at: Union[None, Unset, str]
|
|
68
|
+
if isinstance(self.updated_at, Unset):
|
|
69
|
+
updated_at = UNSET
|
|
70
|
+
elif isinstance(self.updated_at, datetime.datetime):
|
|
71
|
+
updated_at = self.updated_at.isoformat()
|
|
72
|
+
else:
|
|
73
|
+
updated_at = self.updated_at
|
|
74
|
+
|
|
75
|
+
organization_ids: Union[Unset, list[str]] = UNSET
|
|
76
|
+
if not isinstance(self.organization_ids, Unset):
|
|
77
|
+
organization_ids = self.organization_ids
|
|
78
|
+
|
|
79
|
+
field_dict: dict[str, Any] = {}
|
|
80
|
+
|
|
81
|
+
field_dict.update({})
|
|
82
|
+
if id is not UNSET:
|
|
83
|
+
field_dict["id"] = id
|
|
84
|
+
if email is not UNSET:
|
|
85
|
+
field_dict["email"] = email
|
|
86
|
+
if first_name is not UNSET:
|
|
87
|
+
field_dict["firstName"] = first_name
|
|
88
|
+
if last_name is not UNSET:
|
|
89
|
+
field_dict["lastName"] = last_name
|
|
90
|
+
if profile_picture_url is not UNSET:
|
|
91
|
+
field_dict["profilePictureUrl"] = profile_picture_url
|
|
92
|
+
if created_at is not UNSET:
|
|
93
|
+
field_dict["createdAt"] = created_at
|
|
94
|
+
if updated_at is not UNSET:
|
|
95
|
+
field_dict["updatedAt"] = updated_at
|
|
96
|
+
if organization_ids is not UNSET:
|
|
97
|
+
field_dict["organizationIds"] = organization_ids
|
|
98
|
+
|
|
99
|
+
return field_dict
|
|
100
|
+
|
|
101
|
+
@classmethod
|
|
102
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
103
|
+
d = dict(src_dict)
|
|
104
|
+
id = d.pop("id", UNSET)
|
|
105
|
+
|
|
106
|
+
email = d.pop("email", UNSET)
|
|
107
|
+
|
|
108
|
+
def _parse_first_name(data: object) -> Union[None, Unset, str]:
|
|
109
|
+
if data is None:
|
|
110
|
+
return data
|
|
111
|
+
if isinstance(data, Unset):
|
|
112
|
+
return data
|
|
113
|
+
return cast(Union[None, Unset, str], data)
|
|
114
|
+
|
|
115
|
+
first_name = _parse_first_name(d.pop("firstName", UNSET))
|
|
116
|
+
|
|
117
|
+
def _parse_last_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
|
+
last_name = _parse_last_name(d.pop("lastName", UNSET))
|
|
125
|
+
|
|
126
|
+
def _parse_profile_picture_url(data: object) -> Union[None, Unset, str]:
|
|
127
|
+
if data is None:
|
|
128
|
+
return data
|
|
129
|
+
if isinstance(data, Unset):
|
|
130
|
+
return data
|
|
131
|
+
return cast(Union[None, Unset, str], data)
|
|
132
|
+
|
|
133
|
+
profile_picture_url = _parse_profile_picture_url(d.pop("profilePictureUrl", UNSET))
|
|
134
|
+
|
|
135
|
+
def _parse_created_at(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
136
|
+
if data is None:
|
|
137
|
+
return data
|
|
138
|
+
if isinstance(data, Unset):
|
|
139
|
+
return data
|
|
140
|
+
try:
|
|
141
|
+
if not isinstance(data, str):
|
|
142
|
+
raise TypeError()
|
|
143
|
+
created_at_type_0 = isoparse(data)
|
|
144
|
+
|
|
145
|
+
return created_at_type_0
|
|
146
|
+
except: # noqa: E722
|
|
147
|
+
pass
|
|
148
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
149
|
+
|
|
150
|
+
created_at = _parse_created_at(d.pop("createdAt", UNSET))
|
|
151
|
+
|
|
152
|
+
def _parse_updated_at(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
153
|
+
if data is None:
|
|
154
|
+
return data
|
|
155
|
+
if isinstance(data, Unset):
|
|
156
|
+
return data
|
|
157
|
+
try:
|
|
158
|
+
if not isinstance(data, str):
|
|
159
|
+
raise TypeError()
|
|
160
|
+
updated_at_type_0 = isoparse(data)
|
|
161
|
+
|
|
162
|
+
return updated_at_type_0
|
|
163
|
+
except: # noqa: E722
|
|
164
|
+
pass
|
|
165
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
166
|
+
|
|
167
|
+
updated_at = _parse_updated_at(d.pop("updatedAt", UNSET))
|
|
168
|
+
|
|
169
|
+
organization_ids = cast(list[str], d.pop("organizationIds", UNSET))
|
|
170
|
+
|
|
171
|
+
user_dto = cls(
|
|
172
|
+
id=id,
|
|
173
|
+
email=email,
|
|
174
|
+
first_name=first_name,
|
|
175
|
+
last_name=last_name,
|
|
176
|
+
profile_picture_url=profile_picture_url,
|
|
177
|
+
created_at=created_at,
|
|
178
|
+
updated_at=updated_at,
|
|
179
|
+
organization_ids=organization_ids,
|
|
180
|
+
)
|
|
181
|
+
|
|
182
|
+
return user_dto
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
8
|
+
T = TypeVar("T", bound="UserToMiniDto")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@_attrs_define
|
|
12
|
+
class UserToMiniDto:
|
|
13
|
+
"""
|
|
14
|
+
Attributes:
|
|
15
|
+
user_id (Union[Unset, str]):
|
|
16
|
+
mini_id (Union[Unset, int]):
|
|
17
|
+
mini_name (Union[Unset, str]):
|
|
18
|
+
mini_description (Union[None, Unset, str]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
user_id: Union[Unset, str] = UNSET
|
|
22
|
+
mini_id: Union[Unset, int] = UNSET
|
|
23
|
+
mini_name: Union[Unset, str] = UNSET
|
|
24
|
+
mini_description: Union[None, Unset, str] = UNSET
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
user_id = self.user_id
|
|
28
|
+
|
|
29
|
+
mini_id = self.mini_id
|
|
30
|
+
|
|
31
|
+
mini_name = self.mini_name
|
|
32
|
+
|
|
33
|
+
mini_description: Union[None, Unset, str]
|
|
34
|
+
if isinstance(self.mini_description, Unset):
|
|
35
|
+
mini_description = UNSET
|
|
36
|
+
else:
|
|
37
|
+
mini_description = self.mini_description
|
|
38
|
+
|
|
39
|
+
field_dict: dict[str, Any] = {}
|
|
40
|
+
|
|
41
|
+
field_dict.update({})
|
|
42
|
+
if user_id is not UNSET:
|
|
43
|
+
field_dict["userId"] = user_id
|
|
44
|
+
if mini_id is not UNSET:
|
|
45
|
+
field_dict["miniId"] = mini_id
|
|
46
|
+
if mini_name is not UNSET:
|
|
47
|
+
field_dict["miniName"] = mini_name
|
|
48
|
+
if mini_description is not UNSET:
|
|
49
|
+
field_dict["miniDescription"] = mini_description
|
|
50
|
+
|
|
51
|
+
return field_dict
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
55
|
+
d = dict(src_dict)
|
|
56
|
+
user_id = d.pop("userId", UNSET)
|
|
57
|
+
|
|
58
|
+
mini_id = d.pop("miniId", UNSET)
|
|
59
|
+
|
|
60
|
+
mini_name = d.pop("miniName", UNSET)
|
|
61
|
+
|
|
62
|
+
def _parse_mini_description(data: object) -> Union[None, Unset, str]:
|
|
63
|
+
if data is None:
|
|
64
|
+
return data
|
|
65
|
+
if isinstance(data, Unset):
|
|
66
|
+
return data
|
|
67
|
+
return cast(Union[None, Unset, str], data)
|
|
68
|
+
|
|
69
|
+
mini_description = _parse_mini_description(d.pop("miniDescription", UNSET))
|
|
70
|
+
|
|
71
|
+
user_to_mini_dto = cls(
|
|
72
|
+
user_id=user_id,
|
|
73
|
+
mini_id=mini_id,
|
|
74
|
+
mini_name=mini_name,
|
|
75
|
+
mini_description=mini_description,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return user_to_mini_dto
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
8
|
+
T = TypeVar("T", bound="WorkspaceDto")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@_attrs_define
|
|
12
|
+
class WorkspaceDto:
|
|
13
|
+
"""
|
|
14
|
+
Attributes:
|
|
15
|
+
id (Union[Unset, int]):
|
|
16
|
+
workspace_id (Union[Unset, str]):
|
|
17
|
+
name (Union[Unset, str]):
|
|
18
|
+
organization_id (Union[None, Unset, str]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
id: Union[Unset, int] = UNSET
|
|
22
|
+
workspace_id: Union[Unset, str] = UNSET
|
|
23
|
+
name: Union[Unset, str] = UNSET
|
|
24
|
+
organization_id: Union[None, Unset, str] = UNSET
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
id = self.id
|
|
28
|
+
|
|
29
|
+
workspace_id = self.workspace_id
|
|
30
|
+
|
|
31
|
+
name = self.name
|
|
32
|
+
|
|
33
|
+
organization_id: Union[None, Unset, str]
|
|
34
|
+
if isinstance(self.organization_id, Unset):
|
|
35
|
+
organization_id = UNSET
|
|
36
|
+
else:
|
|
37
|
+
organization_id = self.organization_id
|
|
38
|
+
|
|
39
|
+
field_dict: dict[str, Any] = {}
|
|
40
|
+
|
|
41
|
+
field_dict.update({})
|
|
42
|
+
if id is not UNSET:
|
|
43
|
+
field_dict["id"] = id
|
|
44
|
+
if workspace_id is not UNSET:
|
|
45
|
+
field_dict["workspaceId"] = workspace_id
|
|
46
|
+
if name is not UNSET:
|
|
47
|
+
field_dict["name"] = name
|
|
48
|
+
if organization_id is not UNSET:
|
|
49
|
+
field_dict["organizationId"] = organization_id
|
|
50
|
+
|
|
51
|
+
return field_dict
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
55
|
+
d = dict(src_dict)
|
|
56
|
+
id = d.pop("id", UNSET)
|
|
57
|
+
|
|
58
|
+
workspace_id = d.pop("workspaceId", UNSET)
|
|
59
|
+
|
|
60
|
+
name = d.pop("name", UNSET)
|
|
61
|
+
|
|
62
|
+
def _parse_organization_id(data: object) -> Union[None, Unset, str]:
|
|
63
|
+
if data is None:
|
|
64
|
+
return data
|
|
65
|
+
if isinstance(data, Unset):
|
|
66
|
+
return data
|
|
67
|
+
return cast(Union[None, Unset, str], data)
|
|
68
|
+
|
|
69
|
+
organization_id = _parse_organization_id(d.pop("organizationId", UNSET))
|
|
70
|
+
|
|
71
|
+
workspace_dto = cls(
|
|
72
|
+
id=id,
|
|
73
|
+
workspace_id=workspace_id,
|
|
74
|
+
name=name,
|
|
75
|
+
organization_id=organization_id,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
return workspace_dto
|
minikai/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Marker file for PEP 561
|
minikai/types.py
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Contains some shared types for properties"""
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping, MutableMapping
|
|
4
|
+
from http import HTTPStatus
|
|
5
|
+
from typing import IO, BinaryIO, Generic, Literal, Optional, TypeVar, Union
|
|
6
|
+
|
|
7
|
+
from attrs import define
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Unset:
|
|
11
|
+
def __bool__(self) -> Literal[False]:
|
|
12
|
+
return False
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
UNSET: Unset = Unset()
|
|
16
|
+
|
|
17
|
+
# The types that `httpx.Client(files=)` can accept, copied from that library.
|
|
18
|
+
FileContent = Union[IO[bytes], bytes, str]
|
|
19
|
+
FileTypes = Union[
|
|
20
|
+
# (filename, file (or bytes), content_type)
|
|
21
|
+
tuple[Optional[str], FileContent, Optional[str]],
|
|
22
|
+
# (filename, file (or bytes), content_type, headers)
|
|
23
|
+
tuple[Optional[str], FileContent, Optional[str], Mapping[str, str]],
|
|
24
|
+
]
|
|
25
|
+
RequestFiles = list[tuple[str, FileTypes]]
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@define
|
|
29
|
+
class File:
|
|
30
|
+
"""Contains information for file uploads"""
|
|
31
|
+
|
|
32
|
+
payload: BinaryIO
|
|
33
|
+
file_name: Optional[str] = None
|
|
34
|
+
mime_type: Optional[str] = None
|
|
35
|
+
|
|
36
|
+
def to_tuple(self) -> FileTypes:
|
|
37
|
+
"""Return a tuple representation that httpx will accept for multipart/form-data"""
|
|
38
|
+
return self.file_name, self.payload, self.mime_type
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
T = TypeVar("T")
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@define
|
|
45
|
+
class Response(Generic[T]):
|
|
46
|
+
"""A response from an endpoint"""
|
|
47
|
+
|
|
48
|
+
status_code: HTTPStatus
|
|
49
|
+
content: bytes
|
|
50
|
+
headers: MutableMapping[str, str]
|
|
51
|
+
parsed: Optional[T]
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]
|