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
|
@@ -1,28 +1,47 @@
|
|
|
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
5
|
from attrs import field as _attrs_field
|
|
6
6
|
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
7
15
|
T = TypeVar("T", bound="CreateRecordCommandTags")
|
|
8
16
|
|
|
9
17
|
|
|
18
|
+
|
|
10
19
|
@_attrs_define
|
|
11
20
|
class CreateRecordCommandTags:
|
|
12
|
-
"""
|
|
21
|
+
"""
|
|
22
|
+
"""
|
|
13
23
|
|
|
14
24
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
15
25
|
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
16
30
|
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
|
|
17
32
|
field_dict: dict[str, Any] = {}
|
|
18
33
|
field_dict.update(self.additional_properties)
|
|
19
34
|
|
|
20
35
|
return field_dict
|
|
21
36
|
|
|
37
|
+
|
|
38
|
+
|
|
22
39
|
@classmethod
|
|
23
40
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
24
41
|
d = dict(src_dict)
|
|
25
|
-
create_record_command_tags = cls(
|
|
42
|
+
create_record_command_tags = cls(
|
|
43
|
+
)
|
|
44
|
+
|
|
26
45
|
|
|
27
46
|
create_record_command_tags.additional_properties = d
|
|
28
47
|
return create_record_command_tags
|
|
@@ -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
|
+
|
|
@@ -1,26 +1,37 @@
|
|
|
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="DocumentFileDto")
|
|
9
19
|
|
|
10
20
|
|
|
21
|
+
|
|
11
22
|
@_attrs_define
|
|
12
23
|
class DocumentFileDto:
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
+
"""
|
|
24
35
|
|
|
25
36
|
id: Union[Unset, int] = UNSET
|
|
26
37
|
file_id: Union[Unset, str] = UNSET
|
|
@@ -31,6 +42,10 @@ class DocumentFileDto:
|
|
|
31
42
|
size: Union[Unset, int] = UNSET
|
|
32
43
|
workspace_id: Union[None, Unset, str] = UNSET
|
|
33
44
|
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
34
49
|
def to_dict(self) -> dict[str, Any]:
|
|
35
50
|
id = self.id
|
|
36
51
|
|
|
@@ -64,9 +79,11 @@ class DocumentFileDto:
|
|
|
64
79
|
else:
|
|
65
80
|
workspace_id = self.workspace_id
|
|
66
81
|
|
|
82
|
+
|
|
67
83
|
field_dict: dict[str, Any] = {}
|
|
68
84
|
|
|
69
|
-
field_dict.update({
|
|
85
|
+
field_dict.update({
|
|
86
|
+
})
|
|
70
87
|
if id is not UNSET:
|
|
71
88
|
field_dict["id"] = id
|
|
72
89
|
if file_id is not UNSET:
|
|
@@ -86,6 +103,8 @@ class DocumentFileDto:
|
|
|
86
103
|
|
|
87
104
|
return field_dict
|
|
88
105
|
|
|
106
|
+
|
|
107
|
+
|
|
89
108
|
@classmethod
|
|
90
109
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
91
110
|
d = dict(src_dict)
|
|
@@ -104,6 +123,7 @@ class DocumentFileDto:
|
|
|
104
123
|
|
|
105
124
|
name = _parse_name(d.pop("name", UNSET))
|
|
106
125
|
|
|
126
|
+
|
|
107
127
|
def _parse_content_type(data: object) -> Union[None, Unset, str]:
|
|
108
128
|
if data is None:
|
|
109
129
|
return data
|
|
@@ -113,6 +133,7 @@ class DocumentFileDto:
|
|
|
113
133
|
|
|
114
134
|
content_type = _parse_content_type(d.pop("contentType", UNSET))
|
|
115
135
|
|
|
136
|
+
|
|
116
137
|
def _parse_file_extension(data: object) -> Union[None, Unset, str]:
|
|
117
138
|
if data is None:
|
|
118
139
|
return data
|
|
@@ -122,6 +143,7 @@ class DocumentFileDto:
|
|
|
122
143
|
|
|
123
144
|
file_extension = _parse_file_extension(d.pop("fileExtension", UNSET))
|
|
124
145
|
|
|
146
|
+
|
|
125
147
|
size = d.pop("size", UNSET)
|
|
126
148
|
|
|
127
149
|
def _parse_workspace_id(data: object) -> Union[None, Unset, str]:
|
|
@@ -133,6 +155,7 @@ class DocumentFileDto:
|
|
|
133
155
|
|
|
134
156
|
workspace_id = _parse_workspace_id(d.pop("workspaceId", UNSET))
|
|
135
157
|
|
|
158
|
+
|
|
136
159
|
document_file_dto = cls(
|
|
137
160
|
id=id,
|
|
138
161
|
file_id=file_id,
|
|
@@ -145,3 +168,4 @@ class DocumentFileDto:
|
|
|
145
168
|
)
|
|
146
169
|
|
|
147
170
|
return document_file_dto
|
|
171
|
+
|
|
@@ -1,22 +1,37 @@
|
|
|
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="DocumentFileMetadataDto")
|
|
9
19
|
|
|
10
20
|
|
|
21
|
+
|
|
11
22
|
@_attrs_define
|
|
12
23
|
class DocumentFileMetadataDto:
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
"""
|
|
25
|
+
Attributes:
|
|
26
|
+
content_hash (Union[None, Unset, str]):
|
|
27
|
+
"""
|
|
17
28
|
|
|
18
29
|
content_hash: Union[None, Unset, str] = UNSET
|
|
19
30
|
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
20
35
|
def to_dict(self) -> dict[str, Any]:
|
|
21
36
|
content_hash: Union[None, Unset, str]
|
|
22
37
|
if isinstance(self.content_hash, Unset):
|
|
@@ -24,18 +39,21 @@ class DocumentFileMetadataDto:
|
|
|
24
39
|
else:
|
|
25
40
|
content_hash = self.content_hash
|
|
26
41
|
|
|
42
|
+
|
|
27
43
|
field_dict: dict[str, Any] = {}
|
|
28
44
|
|
|
29
|
-
field_dict.update({
|
|
45
|
+
field_dict.update({
|
|
46
|
+
})
|
|
30
47
|
if content_hash is not UNSET:
|
|
31
48
|
field_dict["contentHash"] = content_hash
|
|
32
49
|
|
|
33
50
|
return field_dict
|
|
34
51
|
|
|
52
|
+
|
|
53
|
+
|
|
35
54
|
@classmethod
|
|
36
55
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
37
56
|
d = dict(src_dict)
|
|
38
|
-
|
|
39
57
|
def _parse_content_hash(data: object) -> Union[None, Unset, str]:
|
|
40
58
|
if data is None:
|
|
41
59
|
return data
|
|
@@ -45,8 +63,10 @@ class DocumentFileMetadataDto:
|
|
|
45
63
|
|
|
46
64
|
content_hash = _parse_content_hash(d.pop("contentHash", UNSET))
|
|
47
65
|
|
|
66
|
+
|
|
48
67
|
document_file_metadata_dto = cls(
|
|
49
68
|
content_hash=content_hash,
|
|
50
69
|
)
|
|
51
70
|
|
|
52
71
|
return document_file_metadata_dto
|
|
72
|
+
|
minikai/models/form_field.py
CHANGED
|
@@ -1,30 +1,46 @@
|
|
|
1
|
-
import datetime
|
|
2
1
|
from collections.abc import Mapping
|
|
3
|
-
from typing import Any, TypeVar,
|
|
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
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
9
20
|
|
|
10
21
|
T = TypeVar("T", bound="FormField")
|
|
11
22
|
|
|
12
23
|
|
|
24
|
+
|
|
13
25
|
@_attrs_define
|
|
14
26
|
class FormField:
|
|
15
|
-
"""
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
key (Union[Unset, str]):
|
|
30
|
+
value_string (Union[None, Unset, str]):
|
|
31
|
+
value_number (Union[None, Unset, float]):
|
|
32
|
+
value_date (Union[None, Unset, datetime.datetime]):
|
|
33
|
+
"""
|
|
22
34
|
|
|
23
35
|
key: Union[Unset, str] = UNSET
|
|
24
36
|
value_string: Union[None, Unset, str] = UNSET
|
|
25
37
|
value_number: Union[None, Unset, float] = UNSET
|
|
26
38
|
value_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
27
39
|
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
28
44
|
def to_dict(self) -> dict[str, Any]:
|
|
29
45
|
key = self.key
|
|
30
46
|
|
|
@@ -48,9 +64,11 @@ class FormField:
|
|
|
48
64
|
else:
|
|
49
65
|
value_date = self.value_date
|
|
50
66
|
|
|
67
|
+
|
|
51
68
|
field_dict: dict[str, Any] = {}
|
|
52
69
|
|
|
53
|
-
field_dict.update({
|
|
70
|
+
field_dict.update({
|
|
71
|
+
})
|
|
54
72
|
if key is not UNSET:
|
|
55
73
|
field_dict["key"] = key
|
|
56
74
|
if value_string is not UNSET:
|
|
@@ -62,6 +80,8 @@ class FormField:
|
|
|
62
80
|
|
|
63
81
|
return field_dict
|
|
64
82
|
|
|
83
|
+
|
|
84
|
+
|
|
65
85
|
@classmethod
|
|
66
86
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
67
87
|
d = dict(src_dict)
|
|
@@ -76,6 +96,7 @@ class FormField:
|
|
|
76
96
|
|
|
77
97
|
value_string = _parse_value_string(d.pop("valueString", UNSET))
|
|
78
98
|
|
|
99
|
+
|
|
79
100
|
def _parse_value_number(data: object) -> Union[None, Unset, float]:
|
|
80
101
|
if data is None:
|
|
81
102
|
return data
|
|
@@ -85,6 +106,7 @@ class FormField:
|
|
|
85
106
|
|
|
86
107
|
value_number = _parse_value_number(d.pop("valueNumber", UNSET))
|
|
87
108
|
|
|
109
|
+
|
|
88
110
|
def _parse_value_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
89
111
|
if data is None:
|
|
90
112
|
return data
|
|
@@ -95,13 +117,16 @@ class FormField:
|
|
|
95
117
|
raise TypeError()
|
|
96
118
|
value_date_type_0 = isoparse(data)
|
|
97
119
|
|
|
120
|
+
|
|
121
|
+
|
|
98
122
|
return value_date_type_0
|
|
99
|
-
except:
|
|
123
|
+
except: # noqa: E722
|
|
100
124
|
pass
|
|
101
125
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
102
126
|
|
|
103
127
|
value_date = _parse_value_date(d.pop("valueDate", UNSET))
|
|
104
128
|
|
|
129
|
+
|
|
105
130
|
form_field = cls(
|
|
106
131
|
key=key,
|
|
107
132
|
value_string=value_string,
|
|
@@ -110,3 +135,4 @@ class FormField:
|
|
|
110
135
|
)
|
|
111
136
|
|
|
112
137
|
return form_field
|
|
138
|
+
|
minikai/models/form_field_dto.py
CHANGED
|
@@ -1,27 +1,40 @@
|
|
|
1
|
-
import datetime
|
|
2
1
|
from collections.abc import Mapping
|
|
3
|
-
from typing import Any, TypeVar,
|
|
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
|
-
from ..models.form_field_type import
|
|
9
|
+
from ..models.form_field_type import check_form_field_type
|
|
10
|
+
from ..models.form_field_type import FormFieldType
|
|
9
11
|
from ..types import UNSET, Unset
|
|
12
|
+
from dateutil.parser import isoparse
|
|
13
|
+
from typing import cast
|
|
14
|
+
from typing import cast, Union
|
|
15
|
+
from typing import Union
|
|
16
|
+
import datetime
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
10
22
|
|
|
11
23
|
T = TypeVar("T", bound="FormFieldDto")
|
|
12
24
|
|
|
13
25
|
|
|
26
|
+
|
|
14
27
|
@_attrs_define
|
|
15
28
|
class FormFieldDto:
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
key (Union[Unset, str]):
|
|
32
|
+
value_string (Union[None, Unset, str]):
|
|
33
|
+
value_number (Union[None, Unset, float]):
|
|
34
|
+
value_date (Union[None, Unset, datetime.datetime]):
|
|
35
|
+
value (Union[None, Unset, str]):
|
|
36
|
+
type_ (Union[Unset, FormFieldType]):
|
|
37
|
+
"""
|
|
25
38
|
|
|
26
39
|
key: Union[Unset, str] = UNSET
|
|
27
40
|
value_string: Union[None, Unset, str] = UNSET
|
|
@@ -30,6 +43,10 @@ class FormFieldDto:
|
|
|
30
43
|
value: Union[None, Unset, str] = UNSET
|
|
31
44
|
type_: Union[Unset, FormFieldType] = UNSET
|
|
32
45
|
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
33
50
|
def to_dict(self) -> dict[str, Any]:
|
|
34
51
|
key = self.key
|
|
35
52
|
|
|
@@ -63,9 +80,12 @@ class FormFieldDto:
|
|
|
63
80
|
if not isinstance(self.type_, Unset):
|
|
64
81
|
type_ = self.type_
|
|
65
82
|
|
|
83
|
+
|
|
84
|
+
|
|
66
85
|
field_dict: dict[str, Any] = {}
|
|
67
86
|
|
|
68
|
-
field_dict.update({
|
|
87
|
+
field_dict.update({
|
|
88
|
+
})
|
|
69
89
|
if key is not UNSET:
|
|
70
90
|
field_dict["key"] = key
|
|
71
91
|
if value_string is not UNSET:
|
|
@@ -81,6 +101,8 @@ class FormFieldDto:
|
|
|
81
101
|
|
|
82
102
|
return field_dict
|
|
83
103
|
|
|
104
|
+
|
|
105
|
+
|
|
84
106
|
@classmethod
|
|
85
107
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
86
108
|
d = dict(src_dict)
|
|
@@ -95,6 +117,7 @@ class FormFieldDto:
|
|
|
95
117
|
|
|
96
118
|
value_string = _parse_value_string(d.pop("valueString", UNSET))
|
|
97
119
|
|
|
120
|
+
|
|
98
121
|
def _parse_value_number(data: object) -> Union[None, Unset, float]:
|
|
99
122
|
if data is None:
|
|
100
123
|
return data
|
|
@@ -104,6 +127,7 @@ class FormFieldDto:
|
|
|
104
127
|
|
|
105
128
|
value_number = _parse_value_number(d.pop("valueNumber", UNSET))
|
|
106
129
|
|
|
130
|
+
|
|
107
131
|
def _parse_value_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
108
132
|
if data is None:
|
|
109
133
|
return data
|
|
@@ -114,13 +138,16 @@ class FormFieldDto:
|
|
|
114
138
|
raise TypeError()
|
|
115
139
|
value_date_type_0 = isoparse(data)
|
|
116
140
|
|
|
141
|
+
|
|
142
|
+
|
|
117
143
|
return value_date_type_0
|
|
118
|
-
except:
|
|
144
|
+
except: # noqa: E722
|
|
119
145
|
pass
|
|
120
146
|
return cast(Union[None, Unset, datetime.datetime], data)
|
|
121
147
|
|
|
122
148
|
value_date = _parse_value_date(d.pop("valueDate", UNSET))
|
|
123
149
|
|
|
150
|
+
|
|
124
151
|
def _parse_value(data: object) -> Union[None, Unset, str]:
|
|
125
152
|
if data is None:
|
|
126
153
|
return data
|
|
@@ -130,13 +157,17 @@ class FormFieldDto:
|
|
|
130
157
|
|
|
131
158
|
value = _parse_value(d.pop("value", UNSET))
|
|
132
159
|
|
|
160
|
+
|
|
133
161
|
_type_ = d.pop("type", UNSET)
|
|
134
162
|
type_: Union[Unset, FormFieldType]
|
|
135
|
-
if isinstance(_type_,
|
|
163
|
+
if isinstance(_type_, Unset):
|
|
136
164
|
type_ = UNSET
|
|
137
165
|
else:
|
|
138
166
|
type_ = check_form_field_type(_type_)
|
|
139
167
|
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
140
171
|
form_field_dto = cls(
|
|
141
172
|
key=key,
|
|
142
173
|
value_string=value_string,
|
|
@@ -147,3 +178,4 @@ class FormFieldDto:
|
|
|
147
178
|
)
|
|
148
179
|
|
|
149
180
|
return form_field_dto
|
|
181
|
+
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
from typing import Literal, cast
|
|
2
2
|
|
|
3
|
-
FormFieldType = Literal[
|
|
4
|
-
|
|
5
|
-
FORM_FIELD_TYPE_VALUES: set[FormFieldType] = {
|
|
6
|
-
"checkbox",
|
|
7
|
-
"dateTime",
|
|
8
|
-
"radio",
|
|
9
|
-
"text",
|
|
10
|
-
}
|
|
3
|
+
FormFieldType = Literal['checkbox', 'dateTime', 'radio', 'text']
|
|
11
4
|
|
|
5
|
+
FORM_FIELD_TYPE_VALUES: set[FormFieldType] = { 'checkbox', 'dateTime', 'radio', 'text', }
|
|
12
6
|
|
|
13
7
|
def check_form_field_type(value: str) -> FormFieldType:
|
|
14
8
|
if value in FORM_FIELD_TYPE_VALUES:
|