minikai 0.1.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of minikai might be problematic. Click here for more details.
- minikai/__init__.py +8 -0
- minikai/api/__init__.py +1 -0
- minikai/api/groups/__init__.py +1 -0
- minikai/api/groups/add_minis_to_group.py +196 -0
- minikai/api/groups/add_users_to_group.py +196 -0
- minikai/api/groups/create_group.py +178 -0
- minikai/api/groups/delete_group.py +115 -0
- minikai/api/groups/get_group.py +170 -0
- minikai/api/groups/get_group_minis.py +175 -0
- minikai/api/groups/get_group_users.py +175 -0
- minikai/api/groups/get_groups.py +150 -0
- minikai/api/groups/remove_minis_from_group.py +196 -0
- minikai/api/groups/remove_users_from_group.py +196 -0
- minikai/api/groups/update_group.py +195 -0
- minikai/api/minis/__init__.py +1 -0
- minikai/api/minis/create_mini.py +178 -0
- minikai/api/minis/delete_mini.py +115 -0
- minikai/api/minis/get_external_mini.py +183 -0
- minikai/api/minis/get_minis.py +150 -0
- minikai/api/minis/patch_mini.py +195 -0
- minikai/api/minis/update_mini.py +195 -0
- minikai/api/records/__init__.py +1 -0
- minikai/api/records/add_attachments.py +203 -0
- minikai/api/records/add_relations.py +209 -0
- minikai/api/records/create_record.py +182 -0
- minikai/api/records/delete_record.py +115 -0
- minikai/api/records/download_attachment.py +119 -0
- minikai/api/records/get_created_by.py +202 -0
- minikai/api/records/get_labels.py +194 -0
- minikai/api/records/get_records_by_external.py +248 -0
- minikai/api/records/get_states.py +194 -0
- minikai/api/records/get_updated_by.py +202 -0
- minikai/api/records/remove_attachments.py +132 -0
- minikai/api/records/remove_relations.py +132 -0
- minikai/api/records/update_attachments.py +203 -0
- minikai/api/records/update_record.py +199 -0
- minikai/api/records/update_relations.py +209 -0
- minikai/api/records/upsert_records_by_external_uri.py +182 -0
- minikai/api/users/__init__.py +1 -0
- minikai/api/users/delete_api_users_minis.py +122 -0
- minikai/api/users/get_api_users_minis.py +175 -0
- minikai/api/users/get_users.py +150 -0
- minikai/api/users/post_api_users_minis.py +187 -0
- minikai/client.py +271 -0
- minikai/errors.py +14 -0
- minikai/models/__init__.py +103 -0
- minikai/models/add_attachments_body.py +140 -0
- minikai/models/batch_upsert_result.py +124 -0
- minikai/models/create_group_command.py +127 -0
- minikai/models/create_mini_command.py +144 -0
- minikai/models/create_record_command.py +263 -0
- minikai/models/create_record_command_tags.py +63 -0
- minikai/models/cursor_paginated_list_of_record_dto.py +122 -0
- minikai/models/document_file_dto.py +171 -0
- minikai/models/document_file_metadata_dto.py +72 -0
- minikai/models/failed_upsert_item.py +83 -0
- minikai/models/form_field.py +138 -0
- minikai/models/form_field_dto.py +181 -0
- minikai/models/form_field_type.py +10 -0
- minikai/models/group_dto.py +155 -0
- minikai/models/http_validation_problem_details.py +198 -0
- minikai/models/http_validation_problem_details_errors.py +74 -0
- minikai/models/mini_dto.py +224 -0
- minikai/models/mini_template_dto.py +167 -0
- minikai/models/paginated_list_of_record_dto.py +124 -0
- minikai/models/patch_mini_command.py +102 -0
- minikai/models/problem_details.py +174 -0
- minikai/models/record.py +441 -0
- minikai/models/record_attachment.py +265 -0
- minikai/models/record_attachment_dto.py +265 -0
- minikai/models/record_attachment_dto_metadata_type_0.py +63 -0
- minikai/models/record_attachment_metadata_type_0.py +63 -0
- minikai/models/record_authorization.py +107 -0
- minikai/models/record_authorization_dto.py +107 -0
- minikai/models/record_dto.py +385 -0
- minikai/models/record_dto_tags.py +63 -0
- minikai/models/record_relation.py +105 -0
- minikai/models/record_relation_dto.py +105 -0
- minikai/models/record_state.py +10 -0
- minikai/models/record_tag.py +159 -0
- minikai/models/record_tag_dto.py +68 -0
- minikai/models/slim_mini_dto.py +197 -0
- minikai/models/tool_dto.py +95 -0
- minikai/models/update_attachments_body.py +140 -0
- minikai/models/update_group_command.py +148 -0
- minikai/models/update_mini_command.py +153 -0
- minikai/models/update_mini_template_workspaces_command.py +74 -0
- minikai/models/update_record_command.py +274 -0
- minikai/models/update_record_command_tags.py +63 -0
- minikai/models/upsert_record_dto.py +275 -0
- minikai/models/upsert_record_dto_tags.py +63 -0
- minikai/models/upsert_records_by_external_uri_command.py +79 -0
- minikai/models/user_dto.py +215 -0
- minikai/models/user_to_mini_dto.py +99 -0
- minikai/models/workspace_dto.py +99 -0
- minikai/py.typed +1 -0
- minikai/types.py +53 -0
- minikai-0.1.7.dist-info/METADATA +133 -0
- minikai-0.1.7.dist-info/RECORD +100 -0
- minikai-0.1.7.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,83 @@
|
|
|
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 Union
|
|
12
|
+
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.upsert_record_dto import UpsertRecordDto
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
T = TypeVar("T", bound="FailedUpsertItem")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
@_attrs_define
|
|
25
|
+
class FailedUpsertItem:
|
|
26
|
+
"""
|
|
27
|
+
Attributes:
|
|
28
|
+
item (Union[Unset, UpsertRecordDto]):
|
|
29
|
+
error (Union[Unset, str]):
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
item: Union[Unset, 'UpsertRecordDto'] = UNSET
|
|
33
|
+
error: Union[Unset, str] = UNSET
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_dict(self) -> dict[str, Any]:
|
|
40
|
+
from ..models.upsert_record_dto import UpsertRecordDto
|
|
41
|
+
item: Union[Unset, dict[str, Any]] = UNSET
|
|
42
|
+
if not isinstance(self.item, Unset):
|
|
43
|
+
item = self.item.to_dict()
|
|
44
|
+
|
|
45
|
+
error = self.error
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
field_dict: dict[str, Any] = {}
|
|
49
|
+
|
|
50
|
+
field_dict.update({
|
|
51
|
+
})
|
|
52
|
+
if item is not UNSET:
|
|
53
|
+
field_dict["item"] = item
|
|
54
|
+
if error is not UNSET:
|
|
55
|
+
field_dict["error"] = error
|
|
56
|
+
|
|
57
|
+
return field_dict
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
63
|
+
from ..models.upsert_record_dto import UpsertRecordDto
|
|
64
|
+
d = dict(src_dict)
|
|
65
|
+
_item = d.pop("item", UNSET)
|
|
66
|
+
item: Union[Unset, UpsertRecordDto]
|
|
67
|
+
if isinstance(_item, Unset):
|
|
68
|
+
item = UNSET
|
|
69
|
+
else:
|
|
70
|
+
item = UpsertRecordDto.from_dict(_item)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
error = d.pop("error", UNSET)
|
|
76
|
+
|
|
77
|
+
failed_upsert_item = cls(
|
|
78
|
+
item=item,
|
|
79
|
+
error=error,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return failed_upsert_item
|
|
83
|
+
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Optional, BinaryIO, TextIO, TYPE_CHECKING, Generator
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
from dateutil.parser import isoparse
|
|
11
|
+
from typing import cast
|
|
12
|
+
from typing import cast, Union
|
|
13
|
+
from typing import Union
|
|
14
|
+
import datetime
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="FormField")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class FormField:
|
|
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
|
+
"""
|
|
34
|
+
|
|
35
|
+
key: Union[Unset, str] = UNSET
|
|
36
|
+
value_string: Union[None, Unset, str] = UNSET
|
|
37
|
+
value_number: Union[None, Unset, float] = UNSET
|
|
38
|
+
value_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
key = self.key
|
|
46
|
+
|
|
47
|
+
value_string: Union[None, Unset, str]
|
|
48
|
+
if isinstance(self.value_string, Unset):
|
|
49
|
+
value_string = UNSET
|
|
50
|
+
else:
|
|
51
|
+
value_string = self.value_string
|
|
52
|
+
|
|
53
|
+
value_number: Union[None, Unset, float]
|
|
54
|
+
if isinstance(self.value_number, Unset):
|
|
55
|
+
value_number = UNSET
|
|
56
|
+
else:
|
|
57
|
+
value_number = self.value_number
|
|
58
|
+
|
|
59
|
+
value_date: Union[None, Unset, str]
|
|
60
|
+
if isinstance(self.value_date, Unset):
|
|
61
|
+
value_date = UNSET
|
|
62
|
+
elif isinstance(self.value_date, datetime.datetime):
|
|
63
|
+
value_date = self.value_date.isoformat()
|
|
64
|
+
else:
|
|
65
|
+
value_date = self.value_date
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
field_dict: dict[str, Any] = {}
|
|
69
|
+
|
|
70
|
+
field_dict.update({
|
|
71
|
+
})
|
|
72
|
+
if key is not UNSET:
|
|
73
|
+
field_dict["key"] = key
|
|
74
|
+
if value_string is not UNSET:
|
|
75
|
+
field_dict["valueString"] = value_string
|
|
76
|
+
if value_number is not UNSET:
|
|
77
|
+
field_dict["valueNumber"] = value_number
|
|
78
|
+
if value_date is not UNSET:
|
|
79
|
+
field_dict["valueDate"] = value_date
|
|
80
|
+
|
|
81
|
+
return field_dict
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
87
|
+
d = dict(src_dict)
|
|
88
|
+
key = d.pop("key", UNSET)
|
|
89
|
+
|
|
90
|
+
def _parse_value_string(data: object) -> Union[None, Unset, str]:
|
|
91
|
+
if data is None:
|
|
92
|
+
return data
|
|
93
|
+
if isinstance(data, Unset):
|
|
94
|
+
return data
|
|
95
|
+
return cast(Union[None, Unset, str], data)
|
|
96
|
+
|
|
97
|
+
value_string = _parse_value_string(d.pop("valueString", UNSET))
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
def _parse_value_number(data: object) -> Union[None, Unset, float]:
|
|
101
|
+
if data is None:
|
|
102
|
+
return data
|
|
103
|
+
if isinstance(data, Unset):
|
|
104
|
+
return data
|
|
105
|
+
return cast(Union[None, Unset, float], data)
|
|
106
|
+
|
|
107
|
+
value_number = _parse_value_number(d.pop("valueNumber", UNSET))
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def _parse_value_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
111
|
+
if data is None:
|
|
112
|
+
return data
|
|
113
|
+
if isinstance(data, Unset):
|
|
114
|
+
return data
|
|
115
|
+
try:
|
|
116
|
+
if not isinstance(data, str):
|
|
117
|
+
raise TypeError()
|
|
118
|
+
value_date_type_0 = isoparse(data)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
return value_date_type_0
|
|
123
|
+
except: # noqa: E722
|
|
124
|
+
pass
|
|
125
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
126
|
+
|
|
127
|
+
value_date = _parse_value_date(d.pop("valueDate", UNSET))
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
form_field = cls(
|
|
131
|
+
key=key,
|
|
132
|
+
value_string=value_string,
|
|
133
|
+
value_number=value_number,
|
|
134
|
+
value_date=value_date,
|
|
135
|
+
)
|
|
136
|
+
|
|
137
|
+
return form_field
|
|
138
|
+
|
|
@@ -0,0 +1,181 @@
|
|
|
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 ..models.form_field_type import check_form_field_type
|
|
10
|
+
from ..models.form_field_type import FormFieldType
|
|
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
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="FormFieldDto")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class FormFieldDto:
|
|
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
|
+
"""
|
|
38
|
+
|
|
39
|
+
key: Union[Unset, str] = UNSET
|
|
40
|
+
value_string: Union[None, Unset, str] = UNSET
|
|
41
|
+
value_number: Union[None, Unset, float] = UNSET
|
|
42
|
+
value_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
43
|
+
value: Union[None, Unset, str] = UNSET
|
|
44
|
+
type_: Union[Unset, FormFieldType] = UNSET
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def to_dict(self) -> dict[str, Any]:
|
|
51
|
+
key = self.key
|
|
52
|
+
|
|
53
|
+
value_string: Union[None, Unset, str]
|
|
54
|
+
if isinstance(self.value_string, Unset):
|
|
55
|
+
value_string = UNSET
|
|
56
|
+
else:
|
|
57
|
+
value_string = self.value_string
|
|
58
|
+
|
|
59
|
+
value_number: Union[None, Unset, float]
|
|
60
|
+
if isinstance(self.value_number, Unset):
|
|
61
|
+
value_number = UNSET
|
|
62
|
+
else:
|
|
63
|
+
value_number = self.value_number
|
|
64
|
+
|
|
65
|
+
value_date: Union[None, Unset, str]
|
|
66
|
+
if isinstance(self.value_date, Unset):
|
|
67
|
+
value_date = UNSET
|
|
68
|
+
elif isinstance(self.value_date, datetime.datetime):
|
|
69
|
+
value_date = self.value_date.isoformat()
|
|
70
|
+
else:
|
|
71
|
+
value_date = self.value_date
|
|
72
|
+
|
|
73
|
+
value: Union[None, Unset, str]
|
|
74
|
+
if isinstance(self.value, Unset):
|
|
75
|
+
value = UNSET
|
|
76
|
+
else:
|
|
77
|
+
value = self.value
|
|
78
|
+
|
|
79
|
+
type_: Union[Unset, str] = UNSET
|
|
80
|
+
if not isinstance(self.type_, Unset):
|
|
81
|
+
type_ = self.type_
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
field_dict: dict[str, Any] = {}
|
|
86
|
+
|
|
87
|
+
field_dict.update({
|
|
88
|
+
})
|
|
89
|
+
if key is not UNSET:
|
|
90
|
+
field_dict["key"] = key
|
|
91
|
+
if value_string is not UNSET:
|
|
92
|
+
field_dict["valueString"] = value_string
|
|
93
|
+
if value_number is not UNSET:
|
|
94
|
+
field_dict["valueNumber"] = value_number
|
|
95
|
+
if value_date is not UNSET:
|
|
96
|
+
field_dict["valueDate"] = value_date
|
|
97
|
+
if value is not UNSET:
|
|
98
|
+
field_dict["value"] = value
|
|
99
|
+
if type_ is not UNSET:
|
|
100
|
+
field_dict["type"] = type_
|
|
101
|
+
|
|
102
|
+
return field_dict
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
@classmethod
|
|
107
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
108
|
+
d = dict(src_dict)
|
|
109
|
+
key = d.pop("key", UNSET)
|
|
110
|
+
|
|
111
|
+
def _parse_value_string(data: object) -> Union[None, Unset, str]:
|
|
112
|
+
if data is None:
|
|
113
|
+
return data
|
|
114
|
+
if isinstance(data, Unset):
|
|
115
|
+
return data
|
|
116
|
+
return cast(Union[None, Unset, str], data)
|
|
117
|
+
|
|
118
|
+
value_string = _parse_value_string(d.pop("valueString", UNSET))
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
def _parse_value_number(data: object) -> Union[None, Unset, float]:
|
|
122
|
+
if data is None:
|
|
123
|
+
return data
|
|
124
|
+
if isinstance(data, Unset):
|
|
125
|
+
return data
|
|
126
|
+
return cast(Union[None, Unset, float], data)
|
|
127
|
+
|
|
128
|
+
value_number = _parse_value_number(d.pop("valueNumber", UNSET))
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def _parse_value_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
132
|
+
if data is None:
|
|
133
|
+
return data
|
|
134
|
+
if isinstance(data, Unset):
|
|
135
|
+
return data
|
|
136
|
+
try:
|
|
137
|
+
if not isinstance(data, str):
|
|
138
|
+
raise TypeError()
|
|
139
|
+
value_date_type_0 = isoparse(data)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
return value_date_type_0
|
|
144
|
+
except: # noqa: E722
|
|
145
|
+
pass
|
|
146
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
147
|
+
|
|
148
|
+
value_date = _parse_value_date(d.pop("valueDate", UNSET))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def _parse_value(data: object) -> Union[None, Unset, str]:
|
|
152
|
+
if data is None:
|
|
153
|
+
return data
|
|
154
|
+
if isinstance(data, Unset):
|
|
155
|
+
return data
|
|
156
|
+
return cast(Union[None, Unset, str], data)
|
|
157
|
+
|
|
158
|
+
value = _parse_value(d.pop("value", UNSET))
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
_type_ = d.pop("type", UNSET)
|
|
162
|
+
type_: Union[Unset, FormFieldType]
|
|
163
|
+
if isinstance(_type_, Unset):
|
|
164
|
+
type_ = UNSET
|
|
165
|
+
else:
|
|
166
|
+
type_ = check_form_field_type(_type_)
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
form_field_dto = cls(
|
|
172
|
+
key=key,
|
|
173
|
+
value_string=value_string,
|
|
174
|
+
value_number=value_number,
|
|
175
|
+
value_date=value_date,
|
|
176
|
+
value=value,
|
|
177
|
+
type_=type_,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
return form_field_dto
|
|
181
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from typing import Literal, cast
|
|
2
|
+
|
|
3
|
+
FormFieldType = Literal['checkbox', 'dateTime', 'radio', 'text']
|
|
4
|
+
|
|
5
|
+
FORM_FIELD_TYPE_VALUES: set[FormFieldType] = { 'checkbox', 'dateTime', 'radio', 'text', }
|
|
6
|
+
|
|
7
|
+
def check_form_field_type(value: str) -> FormFieldType:
|
|
8
|
+
if value in FORM_FIELD_TYPE_VALUES:
|
|
9
|
+
return cast(FormFieldType, value)
|
|
10
|
+
raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_TYPE_VALUES!r}")
|
|
@@ -0,0 +1,155 @@
|
|
|
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.slim_mini_dto import SlimMiniDto
|
|
16
|
+
from ..models.user_dto import UserDto
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
T = TypeVar("T", bound="GroupDto")
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@_attrs_define
|
|
27
|
+
class GroupDto:
|
|
28
|
+
"""
|
|
29
|
+
Attributes:
|
|
30
|
+
id (Union[Unset, str]):
|
|
31
|
+
name (Union[Unset, str]):
|
|
32
|
+
description (Union[None, Unset, str]):
|
|
33
|
+
workspace_id (Union[Unset, str]):
|
|
34
|
+
users (Union[Unset, list['UserDto']]):
|
|
35
|
+
minis (Union[Unset, list['SlimMiniDto']]):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
id: Union[Unset, str] = UNSET
|
|
39
|
+
name: Union[Unset, str] = UNSET
|
|
40
|
+
description: Union[None, Unset, str] = UNSET
|
|
41
|
+
workspace_id: Union[Unset, str] = UNSET
|
|
42
|
+
users: Union[Unset, list['UserDto']] = UNSET
|
|
43
|
+
minis: Union[Unset, list['SlimMiniDto']] = UNSET
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_dict(self) -> dict[str, Any]:
|
|
50
|
+
from ..models.slim_mini_dto import SlimMiniDto
|
|
51
|
+
from ..models.user_dto import UserDto
|
|
52
|
+
id = self.id
|
|
53
|
+
|
|
54
|
+
name = self.name
|
|
55
|
+
|
|
56
|
+
description: Union[None, Unset, str]
|
|
57
|
+
if isinstance(self.description, Unset):
|
|
58
|
+
description = UNSET
|
|
59
|
+
else:
|
|
60
|
+
description = self.description
|
|
61
|
+
|
|
62
|
+
workspace_id = self.workspace_id
|
|
63
|
+
|
|
64
|
+
users: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
65
|
+
if not isinstance(self.users, Unset):
|
|
66
|
+
users = []
|
|
67
|
+
for users_item_data in self.users:
|
|
68
|
+
users_item = users_item_data.to_dict()
|
|
69
|
+
users.append(users_item)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
minis: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
74
|
+
if not isinstance(self.minis, Unset):
|
|
75
|
+
minis = []
|
|
76
|
+
for minis_item_data in self.minis:
|
|
77
|
+
minis_item = minis_item_data.to_dict()
|
|
78
|
+
minis.append(minis_item)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
field_dict: dict[str, Any] = {}
|
|
84
|
+
|
|
85
|
+
field_dict.update({
|
|
86
|
+
})
|
|
87
|
+
if id is not UNSET:
|
|
88
|
+
field_dict["id"] = id
|
|
89
|
+
if name is not UNSET:
|
|
90
|
+
field_dict["name"] = name
|
|
91
|
+
if description is not UNSET:
|
|
92
|
+
field_dict["description"] = description
|
|
93
|
+
if workspace_id is not UNSET:
|
|
94
|
+
field_dict["workspaceId"] = workspace_id
|
|
95
|
+
if users is not UNSET:
|
|
96
|
+
field_dict["users"] = users
|
|
97
|
+
if minis is not UNSET:
|
|
98
|
+
field_dict["minis"] = minis
|
|
99
|
+
|
|
100
|
+
return field_dict
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
@classmethod
|
|
105
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
106
|
+
from ..models.slim_mini_dto import SlimMiniDto
|
|
107
|
+
from ..models.user_dto import UserDto
|
|
108
|
+
d = dict(src_dict)
|
|
109
|
+
id = d.pop("id", UNSET)
|
|
110
|
+
|
|
111
|
+
name = d.pop("name", UNSET)
|
|
112
|
+
|
|
113
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
114
|
+
if data is None:
|
|
115
|
+
return data
|
|
116
|
+
if isinstance(data, Unset):
|
|
117
|
+
return data
|
|
118
|
+
return cast(Union[None, Unset, str], data)
|
|
119
|
+
|
|
120
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
workspace_id = d.pop("workspaceId", UNSET)
|
|
124
|
+
|
|
125
|
+
users = []
|
|
126
|
+
_users = d.pop("users", UNSET)
|
|
127
|
+
for users_item_data in (_users or []):
|
|
128
|
+
users_item = UserDto.from_dict(users_item_data)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
users.append(users_item)
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
minis = []
|
|
136
|
+
_minis = d.pop("minis", UNSET)
|
|
137
|
+
for minis_item_data in (_minis or []):
|
|
138
|
+
minis_item = SlimMiniDto.from_dict(minis_item_data)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
minis.append(minis_item)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
group_dto = cls(
|
|
146
|
+
id=id,
|
|
147
|
+
name=name,
|
|
148
|
+
description=description,
|
|
149
|
+
workspace_id=workspace_id,
|
|
150
|
+
users=users,
|
|
151
|
+
minis=minis,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
return group_dto
|
|
155
|
+
|