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/__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
|
|
@@ -13,8 +14,6 @@ from .form_field_type import FormFieldType
|
|
|
13
14
|
from .group_dto import GroupDto
|
|
14
15
|
from .http_validation_problem_details import HttpValidationProblemDetails
|
|
15
16
|
from .http_validation_problem_details_errors import HttpValidationProblemDetailsErrors
|
|
16
|
-
from .json_node import JsonNode
|
|
17
|
-
from .json_node_options import JsonNodeOptions
|
|
18
17
|
from .mini_dto import MiniDto
|
|
19
18
|
from .mini_template_dto import MiniTemplateDto
|
|
20
19
|
from .paginated_list_of_record_dto import PaginatedListOfRecordDto
|
|
@@ -32,6 +31,7 @@ from .record_dto_tags import RecordDtoTags
|
|
|
32
31
|
from .record_relation import RecordRelation
|
|
33
32
|
from .record_relation_dto import RecordRelationDto
|
|
34
33
|
from .record_tag import RecordTag
|
|
34
|
+
from .record_tag_dto import RecordTagDto
|
|
35
35
|
from .slim_mini_dto import SlimMiniDto
|
|
36
36
|
from .tool_dto import ToolDto
|
|
37
37
|
from .update_attachments_body import UpdateAttachmentsBody
|
|
@@ -50,6 +50,7 @@ __all__ = (
|
|
|
50
50
|
"CreateMiniCommand",
|
|
51
51
|
"CreateRecordCommand",
|
|
52
52
|
"CreateRecordCommandTags",
|
|
53
|
+
"CursorPaginatedListOfRecordDto",
|
|
53
54
|
"DocumentFileDto",
|
|
54
55
|
"DocumentFileMetadataDto",
|
|
55
56
|
"FormField",
|
|
@@ -58,8 +59,6 @@ __all__ = (
|
|
|
58
59
|
"GroupDto",
|
|
59
60
|
"HttpValidationProblemDetails",
|
|
60
61
|
"HttpValidationProblemDetailsErrors",
|
|
61
|
-
"JsonNode",
|
|
62
|
-
"JsonNodeOptions",
|
|
63
62
|
"MiniDto",
|
|
64
63
|
"MiniTemplateDto",
|
|
65
64
|
"PaginatedListOfRecordDto",
|
|
@@ -77,6 +76,7 @@ __all__ = (
|
|
|
77
76
|
"RecordRelation",
|
|
78
77
|
"RecordRelationDto",
|
|
79
78
|
"RecordTag",
|
|
79
|
+
"RecordTagDto",
|
|
80
80
|
"SlimMiniDto",
|
|
81
81
|
"ToolDto",
|
|
82
82
|
"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,68 @@
|
|
|
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
|
-
|
|
17
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
18
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
19
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
15
23
|
|
|
16
24
|
|
|
17
25
|
T = TypeVar("T", bound="CreateRecordCommand")
|
|
18
26
|
|
|
19
27
|
|
|
28
|
+
|
|
20
29
|
@_attrs_define
|
|
21
30
|
class CreateRecordCommand:
|
|
22
|
-
"""
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
+
"""
|
|
36
45
|
|
|
37
46
|
title: Union[Unset, str] = UNSET
|
|
38
47
|
description: Union[None, Unset, str] = UNSET
|
|
39
48
|
mini_id: Union[None, Unset, str] = UNSET
|
|
40
49
|
event_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
41
|
-
schema: Union[
|
|
42
|
-
content: Union[
|
|
43
|
-
relations: Union[Unset, list[
|
|
50
|
+
schema: Union[Unset, Any] = UNSET
|
|
51
|
+
content: Union[Unset, Any] = UNSET
|
|
52
|
+
relations: Union[Unset, list['RecordRelationDto']] = UNSET
|
|
44
53
|
external_uri: Union[None, Unset, str] = UNSET
|
|
45
54
|
labels: Union[Unset, list[str]] = UNSET
|
|
46
|
-
tags: Union[Unset,
|
|
47
|
-
authorization: Union[Unset,
|
|
55
|
+
tags: Union[Unset, 'CreateRecordCommandTags'] = UNSET
|
|
56
|
+
authorization: Union[Unset, 'RecordAuthorizationDto'] = UNSET
|
|
57
|
+
|
|
48
58
|
|
|
49
|
-
def to_dict(self) -> dict[str, Any]:
|
|
50
|
-
from ..models.json_node import JsonNode
|
|
51
59
|
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def to_dict(self) -> dict[str, Any]:
|
|
63
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
64
|
+
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
65
|
+
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
52
66
|
title = self.title
|
|
53
67
|
|
|
54
68
|
description: Union[None, Unset, str]
|
|
@@ -71,21 +85,9 @@ class CreateRecordCommand:
|
|
|
71
85
|
else:
|
|
72
86
|
event_date = self.event_date
|
|
73
87
|
|
|
74
|
-
schema
|
|
75
|
-
if isinstance(self.schema, Unset):
|
|
76
|
-
schema = UNSET
|
|
77
|
-
elif isinstance(self.schema, JsonNode):
|
|
78
|
-
schema = self.schema.to_dict()
|
|
79
|
-
else:
|
|
80
|
-
schema = self.schema
|
|
88
|
+
schema = self.schema
|
|
81
89
|
|
|
82
|
-
content
|
|
83
|
-
if isinstance(self.content, Unset):
|
|
84
|
-
content = UNSET
|
|
85
|
-
elif isinstance(self.content, JsonNode):
|
|
86
|
-
content = self.content.to_dict()
|
|
87
|
-
else:
|
|
88
|
-
content = self.content
|
|
90
|
+
content = self.content
|
|
89
91
|
|
|
90
92
|
relations: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
91
93
|
if not isinstance(self.relations, Unset):
|
|
@@ -94,6 +96,8 @@ class CreateRecordCommand:
|
|
|
94
96
|
relations_item = relations_item_data.to_dict()
|
|
95
97
|
relations.append(relations_item)
|
|
96
98
|
|
|
99
|
+
|
|
100
|
+
|
|
97
101
|
external_uri: Union[None, Unset, str]
|
|
98
102
|
if isinstance(self.external_uri, Unset):
|
|
99
103
|
external_uri = UNSET
|
|
@@ -104,6 +108,8 @@ class CreateRecordCommand:
|
|
|
104
108
|
if not isinstance(self.labels, Unset):
|
|
105
109
|
labels = self.labels
|
|
106
110
|
|
|
111
|
+
|
|
112
|
+
|
|
107
113
|
tags: Union[Unset, dict[str, Any]] = UNSET
|
|
108
114
|
if not isinstance(self.tags, Unset):
|
|
109
115
|
tags = self.tags.to_dict()
|
|
@@ -112,9 +118,11 @@ class CreateRecordCommand:
|
|
|
112
118
|
if not isinstance(self.authorization, Unset):
|
|
113
119
|
authorization = self.authorization.to_dict()
|
|
114
120
|
|
|
121
|
+
|
|
115
122
|
field_dict: dict[str, Any] = {}
|
|
116
123
|
|
|
117
|
-
field_dict.update({
|
|
124
|
+
field_dict.update({
|
|
125
|
+
})
|
|
118
126
|
if title is not UNSET:
|
|
119
127
|
field_dict["title"] = title
|
|
120
128
|
if description is not UNSET:
|
|
@@ -140,13 +148,13 @@ class CreateRecordCommand:
|
|
|
140
148
|
|
|
141
149
|
return field_dict
|
|
142
150
|
|
|
151
|
+
|
|
152
|
+
|
|
143
153
|
@classmethod
|
|
144
154
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
155
|
+
from ..models.record_relation_dto import RecordRelationDto
|
|
145
156
|
from ..models.create_record_command_tags import CreateRecordCommandTags
|
|
146
|
-
from ..models.json_node import JsonNode
|
|
147
157
|
from ..models.record_authorization_dto import RecordAuthorizationDto
|
|
148
|
-
from ..models.record_relation_dto import RecordRelationDto
|
|
149
|
-
|
|
150
158
|
d = dict(src_dict)
|
|
151
159
|
title = d.pop("title", UNSET)
|
|
152
160
|
|
|
@@ -159,6 +167,7 @@ class CreateRecordCommand:
|
|
|
159
167
|
|
|
160
168
|
description = _parse_description(d.pop("description", UNSET))
|
|
161
169
|
|
|
170
|
+
|
|
162
171
|
def _parse_mini_id(data: object) -> Union[None, Unset, str]:
|
|
163
172
|
if data is None:
|
|
164
173
|
return data
|
|
@@ -168,6 +177,7 @@ class CreateRecordCommand:
|
|
|
168
177
|
|
|
169
178
|
mini_id = _parse_mini_id(d.pop("miniId", UNSET))
|
|
170
179
|
|
|
180
|
+
|
|
171
181
|
def _parse_event_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
172
182
|
if data is None:
|
|
173
183
|
return data
|
|
@@ -178,54 +188,30 @@ class CreateRecordCommand:
|
|
|
178
188
|
raise TypeError()
|
|
179
189
|
event_date_type_0 = isoparse(data)
|
|
180
190
|
|
|
191
|
+
|
|
192
|
+
|
|
181
193
|
return event_date_type_0
|
|
182
|
-
except:
|
|
194
|
+
except: # noqa: E722
|
|
183
195
|
pass
|
|
184
196
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
185
197
|
|
|
186
198
|
event_date = _parse_event_date(d.pop("eventDate", UNSET))
|
|
187
199
|
|
|
188
|
-
def _parse_schema(data: object) -> Union["JsonNode", None, Unset]:
|
|
189
|
-
if data is None:
|
|
190
|
-
return data
|
|
191
|
-
if isinstance(data, Unset):
|
|
192
|
-
return data
|
|
193
|
-
try:
|
|
194
|
-
if not isinstance(data, dict):
|
|
195
|
-
raise TypeError()
|
|
196
|
-
schema_type_0 = JsonNode.from_dict(data)
|
|
197
|
-
|
|
198
|
-
return schema_type_0
|
|
199
|
-
except: # noqa: E722
|
|
200
|
-
pass
|
|
201
|
-
return cast(Union["JsonNode", None, Unset], data)
|
|
202
200
|
|
|
203
|
-
schema =
|
|
201
|
+
schema = d.pop("schema", UNSET)
|
|
204
202
|
|
|
205
|
-
|
|
206
|
-
if data is None:
|
|
207
|
-
return data
|
|
208
|
-
if isinstance(data, Unset):
|
|
209
|
-
return data
|
|
210
|
-
try:
|
|
211
|
-
if not isinstance(data, dict):
|
|
212
|
-
raise TypeError()
|
|
213
|
-
content_type_0 = JsonNode.from_dict(data)
|
|
214
|
-
|
|
215
|
-
return content_type_0
|
|
216
|
-
except: # noqa: E722
|
|
217
|
-
pass
|
|
218
|
-
return cast(Union["JsonNode", None, Unset], data)
|
|
219
|
-
|
|
220
|
-
content = _parse_content(d.pop("content", UNSET))
|
|
203
|
+
content = d.pop("content", UNSET)
|
|
221
204
|
|
|
222
205
|
relations = []
|
|
223
206
|
_relations = d.pop("relations", UNSET)
|
|
224
|
-
for relations_item_data in _relations or []:
|
|
207
|
+
for relations_item_data in (_relations or []):
|
|
225
208
|
relations_item = RecordRelationDto.from_dict(relations_item_data)
|
|
226
209
|
|
|
210
|
+
|
|
211
|
+
|
|
227
212
|
relations.append(relations_item)
|
|
228
213
|
|
|
214
|
+
|
|
229
215
|
def _parse_external_uri(data: object) -> Union[None, Unset, str]:
|
|
230
216
|
if data is None:
|
|
231
217
|
return data
|
|
@@ -235,22 +221,30 @@ class CreateRecordCommand:
|
|
|
235
221
|
|
|
236
222
|
external_uri = _parse_external_uri(d.pop("externalUri", UNSET))
|
|
237
223
|
|
|
224
|
+
|
|
238
225
|
labels = cast(list[str], d.pop("labels", UNSET))
|
|
239
226
|
|
|
227
|
+
|
|
240
228
|
_tags = d.pop("tags", UNSET)
|
|
241
229
|
tags: Union[Unset, CreateRecordCommandTags]
|
|
242
|
-
if isinstance(_tags,
|
|
230
|
+
if isinstance(_tags, Unset):
|
|
243
231
|
tags = UNSET
|
|
244
232
|
else:
|
|
245
233
|
tags = CreateRecordCommandTags.from_dict(_tags)
|
|
246
234
|
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
247
238
|
_authorization = d.pop("authorization", UNSET)
|
|
248
239
|
authorization: Union[Unset, RecordAuthorizationDto]
|
|
249
|
-
if isinstance(_authorization,
|
|
240
|
+
if isinstance(_authorization, Unset):
|
|
250
241
|
authorization = UNSET
|
|
251
242
|
else:
|
|
252
243
|
authorization = RecordAuthorizationDto.from_dict(_authorization)
|
|
253
244
|
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
254
248
|
create_record_command = cls(
|
|
255
249
|
title=title,
|
|
256
250
|
description=description,
|
|
@@ -266,3 +260,4 @@ class CreateRecordCommand:
|
|
|
266
260
|
)
|
|
267
261
|
|
|
268
262
|
return create_record_command
|
|
263
|
+
|