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/__init__.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
"""Contains all the data models used in inputs/outputs"""
|
|
1
|
+
""" Contains all the data models used in inputs/outputs """
|
|
2
2
|
|
|
3
3
|
from .add_attachments_body import AddAttachmentsBody
|
|
4
4
|
from .create_group_command import CreateGroupCommand
|
|
5
5
|
from .create_mini_command import CreateMiniCommand
|
|
6
6
|
from .create_record_command import CreateRecordCommand
|
|
7
7
|
from .create_record_command_tags import CreateRecordCommandTags
|
|
8
|
+
from .cursor_paginated_list_of_record_dto import CursorPaginatedListOfRecordDto
|
|
8
9
|
from .document_file_dto import DocumentFileDto
|
|
9
10
|
from .document_file_metadata_dto import DocumentFileMetadataDto
|
|
10
11
|
from .form_field import FormField
|
|
@@ -31,7 +32,8 @@ from .record_dto import RecordDto
|
|
|
31
32
|
from .record_dto_tags import RecordDtoTags
|
|
32
33
|
from .record_relation import RecordRelation
|
|
33
34
|
from .record_relation_dto import RecordRelationDto
|
|
34
|
-
from .
|
|
35
|
+
from .record_tag import RecordTag
|
|
36
|
+
from .record_tag_dto import RecordTagDto
|
|
35
37
|
from .slim_mini_dto import SlimMiniDto
|
|
36
38
|
from .tool_dto import ToolDto
|
|
37
39
|
from .update_attachments_body import UpdateAttachmentsBody
|
|
@@ -50,6 +52,7 @@ __all__ = (
|
|
|
50
52
|
"CreateMiniCommand",
|
|
51
53
|
"CreateRecordCommand",
|
|
52
54
|
"CreateRecordCommandTags",
|
|
55
|
+
"CursorPaginatedListOfRecordDto",
|
|
53
56
|
"DocumentFileDto",
|
|
54
57
|
"DocumentFileMetadataDto",
|
|
55
58
|
"FormField",
|
|
@@ -76,7 +79,8 @@ __all__ = (
|
|
|
76
79
|
"RecordDtoTags",
|
|
77
80
|
"RecordRelation",
|
|
78
81
|
"RecordRelationDto",
|
|
79
|
-
"
|
|
82
|
+
"RecordTag",
|
|
83
|
+
"RecordTagDto",
|
|
80
84
|
"SlimMiniDto",
|
|
81
85
|
"ToolDto",
|
|
82
86
|
"UpdateAttachmentsBody",
|
|
@@ -1,26 +1,43 @@
|
|
|
1
1
|
from collections.abc import Mapping
|
|
2
|
-
from
|
|
3
|
-
from typing import Any, TypeVar, Union, cast
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
4
3
|
|
|
5
4
|
from attrs import define as _attrs_define
|
|
6
5
|
from attrs import field as _attrs_field
|
|
7
|
-
|
|
6
|
+
import json
|
|
8
7
|
from .. import types
|
|
9
|
-
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
from ..types import File, FileTypes
|
|
12
|
+
from ..types import UNSET, Unset
|
|
13
|
+
from io import BytesIO
|
|
14
|
+
from typing import cast
|
|
15
|
+
from typing import cast, Union
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
10
22
|
|
|
11
23
|
T = TypeVar("T", bound="AddAttachmentsBody")
|
|
12
24
|
|
|
13
25
|
|
|
26
|
+
|
|
14
27
|
@_attrs_define
|
|
15
28
|
class AddAttachmentsBody:
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
files (Union[None, Unset, list[File]]):
|
|
32
|
+
"""
|
|
20
33
|
|
|
21
34
|
files: Union[None, Unset, list[File]] = UNSET
|
|
22
35
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
23
36
|
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
24
41
|
def to_dict(self) -> dict[str, Any]:
|
|
25
42
|
files: Union[None, Unset, list[FileTypes]]
|
|
26
43
|
if isinstance(self.files, Unset):
|
|
@@ -32,36 +49,45 @@ class AddAttachmentsBody:
|
|
|
32
49
|
|
|
33
50
|
files.append(files_type_0_item)
|
|
34
51
|
|
|
52
|
+
|
|
35
53
|
else:
|
|
36
54
|
files = self.files
|
|
37
55
|
|
|
56
|
+
|
|
38
57
|
field_dict: dict[str, Any] = {}
|
|
39
58
|
field_dict.update(self.additional_properties)
|
|
40
|
-
field_dict.update({
|
|
59
|
+
field_dict.update({
|
|
60
|
+
})
|
|
41
61
|
if files is not UNSET:
|
|
42
62
|
field_dict["files"] = files
|
|
43
63
|
|
|
44
64
|
return field_dict
|
|
45
65
|
|
|
66
|
+
|
|
46
67
|
def to_multipart(self) -> types.RequestFiles:
|
|
47
68
|
files: types.RequestFiles = []
|
|
48
69
|
|
|
49
70
|
if not isinstance(self.files, Unset):
|
|
50
71
|
if isinstance(self.files, list):
|
|
72
|
+
|
|
51
73
|
for files_type_0_item_element in self.files:
|
|
52
74
|
files.append(("files", files_type_0_item_element.to_tuple()))
|
|
53
75
|
else:
|
|
54
76
|
files.append(("files", (None, str(self.files).encode(), "text/plain")))
|
|
55
77
|
|
|
78
|
+
|
|
79
|
+
|
|
56
80
|
for prop_name, prop in self.additional_properties.items():
|
|
57
81
|
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
58
82
|
|
|
83
|
+
|
|
84
|
+
|
|
59
85
|
return files
|
|
60
86
|
|
|
87
|
+
|
|
61
88
|
@classmethod
|
|
62
89
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
63
90
|
d = dict(src_dict)
|
|
64
|
-
|
|
65
91
|
def _parse_files(data: object) -> Union[None, Unset, list[File]]:
|
|
66
92
|
if data is None:
|
|
67
93
|
return data
|
|
@@ -72,22 +98,28 @@ class AddAttachmentsBody:
|
|
|
72
98
|
raise TypeError()
|
|
73
99
|
files_type_0 = []
|
|
74
100
|
_files_type_0 = data
|
|
75
|
-
for files_type_0_item_data in _files_type_0:
|
|
76
|
-
files_type_0_item = File(
|
|
101
|
+
for files_type_0_item_data in (_files_type_0):
|
|
102
|
+
files_type_0_item = File(
|
|
103
|
+
payload = BytesIO(files_type_0_item_data)
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
|
|
77
107
|
|
|
78
108
|
files_type_0.append(files_type_0_item)
|
|
79
109
|
|
|
80
110
|
return files_type_0
|
|
81
|
-
except:
|
|
111
|
+
except: # noqa: E722
|
|
82
112
|
pass
|
|
83
113
|
return cast(Union[None, Unset, list[File]], data)
|
|
84
114
|
|
|
85
115
|
files = _parse_files(d.pop("files", UNSET))
|
|
86
116
|
|
|
117
|
+
|
|
87
118
|
add_attachments_body = cls(
|
|
88
119
|
files=files,
|
|
89
120
|
)
|
|
90
121
|
|
|
122
|
+
|
|
91
123
|
add_attachments_body.additional_properties = d
|
|
92
124
|
return add_attachments_body
|
|
93
125
|
|
|
@@ -1,26 +1,42 @@
|
|
|
1
1
|
from collections.abc import Mapping
|
|
2
|
-
from typing import Any, TypeVar,
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
3
|
|
|
4
4
|
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
5
6
|
|
|
6
7
|
from ..types import UNSET, Unset
|
|
7
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
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
8
19
|
T = TypeVar("T", bound="CreateGroupCommand")
|
|
9
20
|
|
|
10
21
|
|
|
22
|
+
|
|
11
23
|
@_attrs_define
|
|
12
24
|
class CreateGroupCommand:
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
"""
|
|
26
|
+
Attributes:
|
|
27
|
+
name (Union[Unset, str]):
|
|
28
|
+
user_ids (Union[None, Unset, list[str]]):
|
|
29
|
+
mini_ids (Union[None, Unset, list[int]]):
|
|
30
|
+
"""
|
|
19
31
|
|
|
20
32
|
name: Union[Unset, str] = UNSET
|
|
21
33
|
user_ids: Union[None, Unset, list[str]] = UNSET
|
|
22
34
|
mini_ids: Union[None, Unset, list[int]] = UNSET
|
|
23
35
|
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
24
40
|
def to_dict(self) -> dict[str, Any]:
|
|
25
41
|
name = self.name
|
|
26
42
|
|
|
@@ -30,6 +46,7 @@ class CreateGroupCommand:
|
|
|
30
46
|
elif isinstance(self.user_ids, list):
|
|
31
47
|
user_ids = self.user_ids
|
|
32
48
|
|
|
49
|
+
|
|
33
50
|
else:
|
|
34
51
|
user_ids = self.user_ids
|
|
35
52
|
|
|
@@ -39,12 +56,15 @@ class CreateGroupCommand:
|
|
|
39
56
|
elif isinstance(self.mini_ids, list):
|
|
40
57
|
mini_ids = self.mini_ids
|
|
41
58
|
|
|
59
|
+
|
|
42
60
|
else:
|
|
43
61
|
mini_ids = self.mini_ids
|
|
44
62
|
|
|
63
|
+
|
|
45
64
|
field_dict: dict[str, Any] = {}
|
|
46
65
|
|
|
47
|
-
field_dict.update({
|
|
66
|
+
field_dict.update({
|
|
67
|
+
})
|
|
48
68
|
if name is not UNSET:
|
|
49
69
|
field_dict["name"] = name
|
|
50
70
|
if user_ids is not UNSET:
|
|
@@ -54,6 +74,8 @@ class CreateGroupCommand:
|
|
|
54
74
|
|
|
55
75
|
return field_dict
|
|
56
76
|
|
|
77
|
+
|
|
78
|
+
|
|
57
79
|
@classmethod
|
|
58
80
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
59
81
|
d = dict(src_dict)
|
|
@@ -70,12 +92,13 @@ class CreateGroupCommand:
|
|
|
70
92
|
user_ids_type_0 = cast(list[str], data)
|
|
71
93
|
|
|
72
94
|
return user_ids_type_0
|
|
73
|
-
except:
|
|
95
|
+
except: # noqa: E722
|
|
74
96
|
pass
|
|
75
97
|
return cast(Union[None, Unset, list[str]], data)
|
|
76
98
|
|
|
77
99
|
user_ids = _parse_user_ids(d.pop("userIds", UNSET))
|
|
78
100
|
|
|
101
|
+
|
|
79
102
|
def _parse_mini_ids(data: object) -> Union[None, Unset, list[int]]:
|
|
80
103
|
if data is None:
|
|
81
104
|
return data
|
|
@@ -87,12 +110,13 @@ class CreateGroupCommand:
|
|
|
87
110
|
mini_ids_type_0 = cast(list[int], data)
|
|
88
111
|
|
|
89
112
|
return mini_ids_type_0
|
|
90
|
-
except:
|
|
113
|
+
except: # noqa: E722
|
|
91
114
|
pass
|
|
92
115
|
return cast(Union[None, Unset, list[int]], data)
|
|
93
116
|
|
|
94
117
|
mini_ids = _parse_mini_ids(d.pop("miniIds", UNSET))
|
|
95
118
|
|
|
119
|
+
|
|
96
120
|
create_group_command = cls(
|
|
97
121
|
name=name,
|
|
98
122
|
user_ids=user_ids,
|
|
@@ -100,3 +124,4 @@ class CreateGroupCommand:
|
|
|
100
124
|
)
|
|
101
125
|
|
|
102
126
|
return create_group_command
|
|
127
|
+
|
|
@@ -1,23 +1,34 @@
|
|
|
1
1
|
from collections.abc import Mapping
|
|
2
|
-
from typing import Any, TypeVar,
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
3
|
|
|
4
4
|
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
5
6
|
|
|
6
7
|
from ..types import UNSET, Unset
|
|
7
8
|
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
from typing import cast, Union
|
|
11
|
+
from typing import Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
8
18
|
T = TypeVar("T", bound="CreateMiniCommand")
|
|
9
19
|
|
|
10
20
|
|
|
21
|
+
|
|
11
22
|
@_attrs_define
|
|
12
23
|
class CreateMiniCommand:
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
name (Union[Unset, str]):
|
|
27
|
+
description (Union[None, Unset, str]):
|
|
28
|
+
template_id (Union[None, Unset, str]):
|
|
29
|
+
external_id (Union[None, Unset, str]):
|
|
30
|
+
external_source (Union[None, Unset, str]):
|
|
31
|
+
"""
|
|
21
32
|
|
|
22
33
|
name: Union[Unset, str] = UNSET
|
|
23
34
|
description: Union[None, Unset, str] = UNSET
|
|
@@ -25,6 +36,10 @@ class CreateMiniCommand:
|
|
|
25
36
|
external_id: Union[None, Unset, str] = UNSET
|
|
26
37
|
external_source: Union[None, Unset, str] = UNSET
|
|
27
38
|
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
28
43
|
def to_dict(self) -> dict[str, Any]:
|
|
29
44
|
name = self.name
|
|
30
45
|
|
|
@@ -52,9 +67,11 @@ class CreateMiniCommand:
|
|
|
52
67
|
else:
|
|
53
68
|
external_source = self.external_source
|
|
54
69
|
|
|
70
|
+
|
|
55
71
|
field_dict: dict[str, Any] = {}
|
|
56
72
|
|
|
57
|
-
field_dict.update({
|
|
73
|
+
field_dict.update({
|
|
74
|
+
})
|
|
58
75
|
if name is not UNSET:
|
|
59
76
|
field_dict["name"] = name
|
|
60
77
|
if description is not UNSET:
|
|
@@ -68,6 +85,8 @@ class CreateMiniCommand:
|
|
|
68
85
|
|
|
69
86
|
return field_dict
|
|
70
87
|
|
|
88
|
+
|
|
89
|
+
|
|
71
90
|
@classmethod
|
|
72
91
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
73
92
|
d = dict(src_dict)
|
|
@@ -82,6 +101,7 @@ class CreateMiniCommand:
|
|
|
82
101
|
|
|
83
102
|
description = _parse_description(d.pop("description", UNSET))
|
|
84
103
|
|
|
104
|
+
|
|
85
105
|
def _parse_template_id(data: object) -> Union[None, Unset, str]:
|
|
86
106
|
if data is None:
|
|
87
107
|
return data
|
|
@@ -91,6 +111,7 @@ class CreateMiniCommand:
|
|
|
91
111
|
|
|
92
112
|
template_id = _parse_template_id(d.pop("templateId", UNSET))
|
|
93
113
|
|
|
114
|
+
|
|
94
115
|
def _parse_external_id(data: object) -> Union[None, Unset, str]:
|
|
95
116
|
if data is None:
|
|
96
117
|
return data
|
|
@@ -100,6 +121,7 @@ class CreateMiniCommand:
|
|
|
100
121
|
|
|
101
122
|
external_id = _parse_external_id(d.pop("externalId", UNSET))
|
|
102
123
|
|
|
124
|
+
|
|
103
125
|
def _parse_external_source(data: object) -> Union[None, Unset, str]:
|
|
104
126
|
if data is None:
|
|
105
127
|
return data
|
|
@@ -109,6 +131,7 @@ class CreateMiniCommand:
|
|
|
109
131
|
|
|
110
132
|
external_source = _parse_external_source(d.pop("externalSource", UNSET))
|
|
111
133
|
|
|
134
|
+
|
|
112
135
|
create_mini_command = cls(
|
|
113
136
|
name=name,
|
|
114
137
|
description=description,
|
|
@@ -118,3 +141,4 @@ class CreateMiniCommand:
|
|
|
118
141
|
)
|
|
119
142
|
|
|
120
143
|
return create_mini_command
|
|
144
|
+
|
|
@@ -1,54 +1,70 @@
|
|
|
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
|
-
|
|
17
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
18
|
+
from ..models.json_node import JsonNode
|
|
19
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
20
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
15
24
|
|
|
16
25
|
|
|
17
26
|
T = TypeVar("T", bound="CreateRecordCommand")
|
|
18
27
|
|
|
19
28
|
|
|
29
|
+
|
|
20
30
|
@_attrs_define
|
|
21
31
|
class CreateRecordCommand:
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
"""
|
|
33
|
+
Attributes:
|
|
34
|
+
title (Union[Unset, str]):
|
|
35
|
+
description (Union[None, Unset, str]):
|
|
36
|
+
mini_id (Union[None, Unset, str]):
|
|
37
|
+
event_date (Union[None, Unset, datetime.datetime]):
|
|
38
|
+
schema (Union['JsonNode', None, Unset]):
|
|
39
|
+
content (Union['JsonNode', None, Unset]):
|
|
40
|
+
relations (Union[Unset, list['RecordRelationDto']]):
|
|
41
|
+
external_uri (Union[None, Unset, str]):
|
|
42
|
+
labels (Union[Unset, list[str]]):
|
|
43
|
+
tags (Union[Unset, CreateRecordCommandTags]):
|
|
44
|
+
authorization (Union[Unset, RecordAuthorizationDto]):
|
|
45
|
+
"""
|
|
36
46
|
|
|
37
47
|
title: Union[Unset, str] = UNSET
|
|
38
48
|
description: Union[None, Unset, str] = UNSET
|
|
39
49
|
mini_id: Union[None, Unset, str] = UNSET
|
|
40
50
|
event_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
41
|
-
schema: Union[
|
|
42
|
-
content: Union[
|
|
43
|
-
relations: Union[Unset, list[
|
|
51
|
+
schema: Union['JsonNode', None, Unset] = UNSET
|
|
52
|
+
content: Union['JsonNode', None, Unset] = UNSET
|
|
53
|
+
relations: Union[Unset, list['RecordRelationDto']] = UNSET
|
|
44
54
|
external_uri: Union[None, Unset, str] = UNSET
|
|
45
55
|
labels: Union[Unset, list[str]] = UNSET
|
|
46
|
-
tags: Union[Unset,
|
|
47
|
-
authorization: Union[Unset,
|
|
56
|
+
tags: Union[Unset, 'CreateRecordCommandTags'] = UNSET
|
|
57
|
+
authorization: Union[Unset, 'RecordAuthorizationDto'] = UNSET
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
48
62
|
|
|
49
63
|
def to_dict(self) -> dict[str, Any]:
|
|
64
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
50
65
|
from ..models.json_node import JsonNode
|
|
51
|
-
|
|
66
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
67
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
52
68
|
title = self.title
|
|
53
69
|
|
|
54
70
|
description: Union[None, Unset, str]
|
|
@@ -94,6 +110,8 @@ class CreateRecordCommand:
|
|
|
94
110
|
relations_item = relations_item_data.to_dict()
|
|
95
111
|
relations.append(relations_item)
|
|
96
112
|
|
|
113
|
+
|
|
114
|
+
|
|
97
115
|
external_uri: Union[None, Unset, str]
|
|
98
116
|
if isinstance(self.external_uri, Unset):
|
|
99
117
|
external_uri = UNSET
|
|
@@ -104,6 +122,8 @@ class CreateRecordCommand:
|
|
|
104
122
|
if not isinstance(self.labels, Unset):
|
|
105
123
|
labels = self.labels
|
|
106
124
|
|
|
125
|
+
|
|
126
|
+
|
|
107
127
|
tags: Union[Unset, dict[str, Any]] = UNSET
|
|
108
128
|
if not isinstance(self.tags, Unset):
|
|
109
129
|
tags = self.tags.to_dict()
|
|
@@ -112,9 +132,11 @@ class CreateRecordCommand:
|
|
|
112
132
|
if not isinstance(self.authorization, Unset):
|
|
113
133
|
authorization = self.authorization.to_dict()
|
|
114
134
|
|
|
135
|
+
|
|
115
136
|
field_dict: dict[str, Any] = {}
|
|
116
137
|
|
|
117
|
-
field_dict.update({
|
|
138
|
+
field_dict.update({
|
|
139
|
+
})
|
|
118
140
|
if title is not UNSET:
|
|
119
141
|
field_dict["title"] = title
|
|
120
142
|
if description is not UNSET:
|
|
@@ -140,13 +162,14 @@ class CreateRecordCommand:
|
|
|
140
162
|
|
|
141
163
|
return field_dict
|
|
142
164
|
|
|
165
|
+
|
|
166
|
+
|
|
143
167
|
@classmethod
|
|
144
168
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
145
|
-
from ..models.
|
|
169
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
146
170
|
from ..models.json_node import JsonNode
|
|
171
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
147
172
|
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
148
|
-
from ..models.record_relation_dto import RecordRelationDto
|
|
149
|
-
|
|
150
173
|
d = dict(src_dict)
|
|
151
174
|
title = d.pop("title", UNSET)
|
|
152
175
|
|
|
@@ -159,6 +182,7 @@ class CreateRecordCommand:
|
|
|
159
182
|
|
|
160
183
|
description = _parse_description(d.pop("description", UNSET))
|
|
161
184
|
|
|
185
|
+
|
|
162
186
|
def _parse_mini_id(data: object) -> Union[None, Unset, str]:
|
|
163
187
|
if data is None:
|
|
164
188
|
return data
|
|
@@ -168,6 +192,7 @@ class CreateRecordCommand:
|
|
|
168
192
|
|
|
169
193
|
mini_id = _parse_mini_id(d.pop("miniId", UNSET))
|
|
170
194
|
|
|
195
|
+
|
|
171
196
|
def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
172
197
|
if data is None:
|
|
173
198
|
return data
|
|
@@ -178,14 +203,17 @@ class CreateRecordCommand:
|
|
|
178
203
|
raise TypeError()
|
|
179
204
|
event_date_type_0 = isoparse(data)
|
|
180
205
|
|
|
206
|
+
|
|
207
|
+
|
|
181
208
|
return event_date_type_0
|
|
182
|
-
except:
|
|
209
|
+
except: # noqa: E722
|
|
183
210
|
pass
|
|
184
211
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
185
212
|
|
|
186
213
|
event_date = _parse_event_date(d.pop("eventDate", UNSET))
|
|
187
214
|
|
|
188
|
-
|
|
215
|
+
|
|
216
|
+
def _parse_schema(data: object) -> Union['JsonNode', None, Unset]:
|
|
189
217
|
if data is None:
|
|
190
218
|
return data
|
|
191
219
|
if isinstance(data, Unset):
|
|
@@ -195,14 +223,17 @@ class CreateRecordCommand:
|
|
|
195
223
|
raise TypeError()
|
|
196
224
|
schema_type_0 = JsonNode.from_dict(data)
|
|
197
225
|
|
|
226
|
+
|
|
227
|
+
|
|
198
228
|
return schema_type_0
|
|
199
|
-
except:
|
|
229
|
+
except: # noqa: E722
|
|
200
230
|
pass
|
|
201
|
-
return cast(Union[
|
|
231
|
+
return cast(Union['JsonNode', None, Unset], data)
|
|
202
232
|
|
|
203
233
|
schema = _parse_schema(d.pop("schema", UNSET))
|
|
204
234
|
|
|
205
|
-
|
|
235
|
+
|
|
236
|
+
def _parse_content(data: object) -> Union['JsonNode', None, Unset]:
|
|
206
237
|
if data is None:
|
|
207
238
|
return data
|
|
208
239
|
if isinstance(data, Unset):
|
|
@@ -212,20 +243,26 @@ class CreateRecordCommand:
|
|
|
212
243
|
raise TypeError()
|
|
213
244
|
content_type_0 = JsonNode.from_dict(data)
|
|
214
245
|
|
|
246
|
+
|
|
247
|
+
|
|
215
248
|
return content_type_0
|
|
216
|
-
except:
|
|
249
|
+
except: # noqa: E722
|
|
217
250
|
pass
|
|
218
|
-
return cast(Union[
|
|
251
|
+
return cast(Union['JsonNode', None, Unset], data)
|
|
219
252
|
|
|
220
253
|
content = _parse_content(d.pop("content", UNSET))
|
|
221
254
|
|
|
255
|
+
|
|
222
256
|
relations = []
|
|
223
257
|
_relations = d.pop("relations", UNSET)
|
|
224
|
-
for relations_item_data in _relations or []:
|
|
258
|
+
for relations_item_data in (_relations or []):
|
|
225
259
|
relations_item = RecordRelationDto.from_dict(relations_item_data)
|
|
226
260
|
|
|
261
|
+
|
|
262
|
+
|
|
227
263
|
relations.append(relations_item)
|
|
228
264
|
|
|
265
|
+
|
|
229
266
|
def _parse_external_uri(data: object) -> Union[None, Unset, str]:
|
|
230
267
|
if data is None:
|
|
231
268
|
return data
|
|
@@ -235,22 +272,30 @@ class CreateRecordCommand:
|
|
|
235
272
|
|
|
236
273
|
external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
|
|
237
274
|
|
|
275
|
+
|
|
238
276
|
labels = cast(list[str], d.pop("labels", UNSET))
|
|
239
277
|
|
|
278
|
+
|
|
240
279
|
_tags = d.pop("tags", UNSET)
|
|
241
280
|
tags: Union[Unset, CreateRecordCommandTags]
|
|
242
|
-
if isinstance(_tags,
|
|
281
|
+
if isinstance(_tags, Unset):
|
|
243
282
|
tags = UNSET
|
|
244
283
|
else:
|
|
245
284
|
tags = CreateRecordCommandTags.from_dict(_tags)
|
|
246
285
|
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
247
289
|
_authorization = d.pop("authorization", UNSET)
|
|
248
290
|
authorization: Union[Unset, RecordAuthorizationDto]
|
|
249
|
-
if isinstance(_authorization,
|
|
291
|
+
if isinstance(_authorization, Unset):
|
|
250
292
|
authorization = UNSET
|
|
251
293
|
else:
|
|
252
294
|
authorization = RecordAuthorizationDto.from_dict(_authorization)
|
|
253
295
|
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
254
299
|
create_record_command = cls(
|
|
255
300
|
title=title,
|
|
256
301
|
description=description,
|
|
@@ -266,3 +311,4 @@ class CreateRecordCommand:
|
|
|
266
311
|
)
|
|
267
312
|
|
|
268
313
|
return create_record_command
|
|
314
|
+
|