minikai 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of minikai might be problematic. Click here for more details.
- minikai/__init__.py +8 -0
- minikai/api/__init__.py +1 -0
- minikai/api/groups/__init__.py +1 -0
- minikai/api/groups/add_minis_to_group.py +176 -0
- minikai/api/groups/add_users_to_group.py +176 -0
- minikai/api/groups/create_group.py +160 -0
- minikai/api/groups/delete_group.py +95 -0
- minikai/api/groups/get_group.py +151 -0
- minikai/api/groups/get_group_minis.py +156 -0
- minikai/api/groups/get_group_users.py +156 -0
- minikai/api/groups/get_groups.py +128 -0
- minikai/api/groups/remove_minis_from_group.py +176 -0
- minikai/api/groups/remove_users_from_group.py +176 -0
- minikai/api/groups/update_group.py +177 -0
- minikai/api/minis/__init__.py +1 -0
- minikai/api/minis/create_mini.py +160 -0
- minikai/api/minis/delete_mini.py +95 -0
- minikai/api/minis/get_external_mini.py +164 -0
- minikai/api/minis/get_minis.py +128 -0
- minikai/api/minis/patch_mini.py +177 -0
- minikai/api/minis/update_mini.py +177 -0
- minikai/api/records/__init__.py +1 -0
- minikai/api/records/add_attachments.py +182 -0
- minikai/api/records/add_relations.py +187 -0
- minikai/api/records/create_record.py +162 -0
- minikai/api/records/delete_record.py +95 -0
- minikai/api/records/get_records_by_external.py +230 -0
- minikai/api/records/remove_attachments.py +110 -0
- minikai/api/records/remove_relations.py +110 -0
- minikai/api/records/update_attachments.py +182 -0
- minikai/api/records/update_record.py +179 -0
- minikai/api/records/update_relations.py +187 -0
- minikai/api/users/__init__.py +1 -0
- minikai/api/users/delete_api_users_minis.py +102 -0
- minikai/api/users/get_api_users_minis.py +156 -0
- minikai/api/users/get_users.py +128 -0
- minikai/api/users/post_api_users_minis.py +168 -0
- minikai/client.py +268 -0
- minikai/errors.py +16 -0
- minikai/models/__init__.py +89 -0
- minikai/models/add_attachments_body.py +98 -0
- minikai/models/create_group_command.py +102 -0
- minikai/models/create_mini_command.py +120 -0
- minikai/models/create_record_command.py +268 -0
- minikai/models/create_record_command_tags.py +44 -0
- minikai/models/document_file_dto.py +147 -0
- minikai/models/form_field.py +112 -0
- minikai/models/form_field_dto.py +149 -0
- minikai/models/form_field_type.py +16 -0
- minikai/models/group_dto.py +124 -0
- minikai/models/http_validation_problem_details.py +173 -0
- minikai/models/http_validation_problem_details_errors.py +51 -0
- minikai/models/json_node.py +119 -0
- minikai/models/json_node_options.py +42 -0
- minikai/models/mini_dto.py +189 -0
- minikai/models/mini_template_dto.py +135 -0
- minikai/models/paginated_list_of_record_dto.py +101 -0
- minikai/models/patch_mini_command.py +80 -0
- minikai/models/problem_details.py +151 -0
- minikai/models/record.py +379 -0
- minikai/models/record_attachment.py +236 -0
- minikai/models/record_attachment_dto.py +236 -0
- minikai/models/record_attachment_dto_metadata_type_0.py +44 -0
- minikai/models/record_attachment_metadata_type_0.py +44 -0
- minikai/models/record_authorization.py +75 -0
- minikai/models/record_authorization_dto.py +75 -0
- minikai/models/record_dto.py +377 -0
- minikai/models/record_dto_tags.py +44 -0
- minikai/models/record_relation.py +81 -0
- minikai/models/record_relation_dto.py +81 -0
- minikai/models/record_tags.py +44 -0
- minikai/models/slim_mini_dto.py +168 -0
- minikai/models/tool_dto.py +76 -0
- minikai/models/update_attachments_body.py +98 -0
- minikai/models/update_group_command.py +122 -0
- minikai/models/update_mini_command.py +129 -0
- minikai/models/update_mini_template_workspaces_command.py +51 -0
- minikai/models/update_record_command.py +266 -0
- minikai/models/update_record_command_tags.py +44 -0
- minikai/models/user_dto.py +182 -0
- minikai/models/user_to_mini_dto.py +78 -0
- minikai/models/workspace_dto.py +78 -0
- minikai/py.typed +1 -0
- minikai/types.py +54 -0
- minikai-0.1.0.dist-info/METADATA +133 -0
- minikai-0.1.0.dist-info/RECORD +87 -0
- minikai-0.1.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
|
|
5
|
+
from attrs import define as _attrs_define
|
|
6
|
+
from dateutil.parser import isoparse
|
|
7
|
+
|
|
8
|
+
from ..models.form_field_type import FormFieldType, check_form_field_type
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="FormFieldDto")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class FormFieldDto:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
key (Union[Unset, str]):
|
|
19
|
+
value_string (Union[None, Unset, str]):
|
|
20
|
+
value_number (Union[None, Unset, float]):
|
|
21
|
+
value_date (Union[None, Unset, datetime.datetime]):
|
|
22
|
+
value (Union[None, Unset, str]):
|
|
23
|
+
type_ (Union[Unset, FormFieldType]):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
key: Union[Unset, str] = UNSET
|
|
27
|
+
value_string: Union[None, Unset, str] = UNSET
|
|
28
|
+
value_number: Union[None, Unset, float] = UNSET
|
|
29
|
+
value_date: Union[None, Unset, datetime.datetime] = UNSET
|
|
30
|
+
value: Union[None, Unset, str] = UNSET
|
|
31
|
+
type_: Union[Unset, FormFieldType] = UNSET
|
|
32
|
+
|
|
33
|
+
def to_dict(self) -> dict[str, Any]:
|
|
34
|
+
key = self.key
|
|
35
|
+
|
|
36
|
+
value_string: Union[None, Unset, str]
|
|
37
|
+
if isinstance(self.value_string, Unset):
|
|
38
|
+
value_string = UNSET
|
|
39
|
+
else:
|
|
40
|
+
value_string = self.value_string
|
|
41
|
+
|
|
42
|
+
value_number: Union[None, Unset, float]
|
|
43
|
+
if isinstance(self.value_number, Unset):
|
|
44
|
+
value_number = UNSET
|
|
45
|
+
else:
|
|
46
|
+
value_number = self.value_number
|
|
47
|
+
|
|
48
|
+
value_date: Union[None, Unset, str]
|
|
49
|
+
if isinstance(self.value_date, Unset):
|
|
50
|
+
value_date = UNSET
|
|
51
|
+
elif isinstance(self.value_date, datetime.datetime):
|
|
52
|
+
value_date = self.value_date.isoformat()
|
|
53
|
+
else:
|
|
54
|
+
value_date = self.value_date
|
|
55
|
+
|
|
56
|
+
value: Union[None, Unset, str]
|
|
57
|
+
if isinstance(self.value, Unset):
|
|
58
|
+
value = UNSET
|
|
59
|
+
else:
|
|
60
|
+
value = self.value
|
|
61
|
+
|
|
62
|
+
type_: Union[Unset, str] = UNSET
|
|
63
|
+
if not isinstance(self.type_, Unset):
|
|
64
|
+
type_ = self.type_
|
|
65
|
+
|
|
66
|
+
field_dict: dict[str, Any] = {}
|
|
67
|
+
|
|
68
|
+
field_dict.update({})
|
|
69
|
+
if key is not UNSET:
|
|
70
|
+
field_dict["key"] = key
|
|
71
|
+
if value_string is not UNSET:
|
|
72
|
+
field_dict["valueString"] = value_string
|
|
73
|
+
if value_number is not UNSET:
|
|
74
|
+
field_dict["valueNumber"] = value_number
|
|
75
|
+
if value_date is not UNSET:
|
|
76
|
+
field_dict["valueDate"] = value_date
|
|
77
|
+
if value is not UNSET:
|
|
78
|
+
field_dict["value"] = value
|
|
79
|
+
if type_ is not UNSET:
|
|
80
|
+
field_dict["type"] = type_
|
|
81
|
+
|
|
82
|
+
return field_dict
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
86
|
+
d = dict(src_dict)
|
|
87
|
+
key = d.pop("key", UNSET)
|
|
88
|
+
|
|
89
|
+
def _parse_value_string(data: object) -> Union[None, Unset, str]:
|
|
90
|
+
if data is None:
|
|
91
|
+
return data
|
|
92
|
+
if isinstance(data, Unset):
|
|
93
|
+
return data
|
|
94
|
+
return cast(Union[None, Unset, str], data)
|
|
95
|
+
|
|
96
|
+
value_string = _parse_value_string(d.pop("valueString", UNSET))
|
|
97
|
+
|
|
98
|
+
def _parse_value_number(data: object) -> Union[None, Unset, float]:
|
|
99
|
+
if data is None:
|
|
100
|
+
return data
|
|
101
|
+
if isinstance(data, Unset):
|
|
102
|
+
return data
|
|
103
|
+
return cast(Union[None, Unset, float], data)
|
|
104
|
+
|
|
105
|
+
value_number = _parse_value_number(d.pop("valueNumber", UNSET))
|
|
106
|
+
|
|
107
|
+
def _parse_value_date(data: object) -> Union[None, Unset, datetime.datetime]:
|
|
108
|
+
if data is None:
|
|
109
|
+
return data
|
|
110
|
+
if isinstance(data, Unset):
|
|
111
|
+
return data
|
|
112
|
+
try:
|
|
113
|
+
if not isinstance(data, str):
|
|
114
|
+
raise TypeError()
|
|
115
|
+
value_date_type_0 = isoparse(data)
|
|
116
|
+
|
|
117
|
+
return value_date_type_0
|
|
118
|
+
except: # noqa: E722
|
|
119
|
+
pass
|
|
120
|
+
return cast(Union[None, Unset, datetime.datetime], data)
|
|
121
|
+
|
|
122
|
+
value_date = _parse_value_date(d.pop("valueDate", UNSET))
|
|
123
|
+
|
|
124
|
+
def _parse_value(data: object) -> Union[None, Unset, str]:
|
|
125
|
+
if data is None:
|
|
126
|
+
return data
|
|
127
|
+
if isinstance(data, Unset):
|
|
128
|
+
return data
|
|
129
|
+
return cast(Union[None, Unset, str], data)
|
|
130
|
+
|
|
131
|
+
value = _parse_value(d.pop("value", UNSET))
|
|
132
|
+
|
|
133
|
+
_type_ = d.pop("type", UNSET)
|
|
134
|
+
type_: Union[Unset, FormFieldType]
|
|
135
|
+
if isinstance(_type_, Unset):
|
|
136
|
+
type_ = UNSET
|
|
137
|
+
else:
|
|
138
|
+
type_ = check_form_field_type(_type_)
|
|
139
|
+
|
|
140
|
+
form_field_dto = cls(
|
|
141
|
+
key=key,
|
|
142
|
+
value_string=value_string,
|
|
143
|
+
value_number=value_number,
|
|
144
|
+
value_date=value_date,
|
|
145
|
+
value=value,
|
|
146
|
+
type_=type_,
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
return form_field_dto
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import Literal, cast
|
|
2
|
+
|
|
3
|
+
FormFieldType = Literal["checkbox", "dateTime", "radio", "text"]
|
|
4
|
+
|
|
5
|
+
FORM_FIELD_TYPE_VALUES: set[FormFieldType] = {
|
|
6
|
+
"checkbox",
|
|
7
|
+
"dateTime",
|
|
8
|
+
"radio",
|
|
9
|
+
"text",
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def check_form_field_type(value: str) -> FormFieldType:
|
|
14
|
+
if value in FORM_FIELD_TYPE_VALUES:
|
|
15
|
+
return cast(FormFieldType, value)
|
|
16
|
+
raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_TYPE_VALUES!r}")
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from ..models.slim_mini_dto import SlimMiniDto
|
|
10
|
+
from ..models.user_dto import UserDto
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="GroupDto")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class GroupDto:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
id (Union[Unset, str]):
|
|
21
|
+
name (Union[Unset, str]):
|
|
22
|
+
description (Union[None, Unset, str]):
|
|
23
|
+
workspace_id (Union[Unset, str]):
|
|
24
|
+
users (Union[Unset, list['UserDto']]):
|
|
25
|
+
minis (Union[Unset, list['SlimMiniDto']]):
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
id: Union[Unset, str] = UNSET
|
|
29
|
+
name: Union[Unset, str] = UNSET
|
|
30
|
+
description: Union[None, Unset, str] = UNSET
|
|
31
|
+
workspace_id: Union[Unset, str] = UNSET
|
|
32
|
+
users: Union[Unset, list["UserDto"]] = UNSET
|
|
33
|
+
minis: Union[Unset, list["SlimMiniDto"]] = UNSET
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
id = self.id
|
|
37
|
+
|
|
38
|
+
name = self.name
|
|
39
|
+
|
|
40
|
+
description: Union[None, Unset, str]
|
|
41
|
+
if isinstance(self.description, Unset):
|
|
42
|
+
description = UNSET
|
|
43
|
+
else:
|
|
44
|
+
description = self.description
|
|
45
|
+
|
|
46
|
+
workspace_id = self.workspace_id
|
|
47
|
+
|
|
48
|
+
users: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
49
|
+
if not isinstance(self.users, Unset):
|
|
50
|
+
users = []
|
|
51
|
+
for users_item_data in self.users:
|
|
52
|
+
users_item = users_item_data.to_dict()
|
|
53
|
+
users.append(users_item)
|
|
54
|
+
|
|
55
|
+
minis: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
56
|
+
if not isinstance(self.minis, Unset):
|
|
57
|
+
minis = []
|
|
58
|
+
for minis_item_data in self.minis:
|
|
59
|
+
minis_item = minis_item_data.to_dict()
|
|
60
|
+
minis.append(minis_item)
|
|
61
|
+
|
|
62
|
+
field_dict: dict[str, Any] = {}
|
|
63
|
+
|
|
64
|
+
field_dict.update({})
|
|
65
|
+
if id is not UNSET:
|
|
66
|
+
field_dict["id"] = id
|
|
67
|
+
if name is not UNSET:
|
|
68
|
+
field_dict["name"] = name
|
|
69
|
+
if description is not UNSET:
|
|
70
|
+
field_dict["description"] = description
|
|
71
|
+
if workspace_id is not UNSET:
|
|
72
|
+
field_dict["workspaceId"] = workspace_id
|
|
73
|
+
if users is not UNSET:
|
|
74
|
+
field_dict["users"] = users
|
|
75
|
+
if minis is not UNSET:
|
|
76
|
+
field_dict["minis"] = minis
|
|
77
|
+
|
|
78
|
+
return field_dict
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
82
|
+
from ..models.slim_mini_dto import SlimMiniDto
|
|
83
|
+
from ..models.user_dto import UserDto
|
|
84
|
+
|
|
85
|
+
d = dict(src_dict)
|
|
86
|
+
id = d.pop("id", UNSET)
|
|
87
|
+
|
|
88
|
+
name = d.pop("name", UNSET)
|
|
89
|
+
|
|
90
|
+
def _parse_description(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
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
98
|
+
|
|
99
|
+
workspace_id = d.pop("workspaceId", UNSET)
|
|
100
|
+
|
|
101
|
+
users = []
|
|
102
|
+
_users = d.pop("users", UNSET)
|
|
103
|
+
for users_item_data in _users or []:
|
|
104
|
+
users_item = UserDto.from_dict(users_item_data)
|
|
105
|
+
|
|
106
|
+
users.append(users_item)
|
|
107
|
+
|
|
108
|
+
minis = []
|
|
109
|
+
_minis = d.pop("minis", UNSET)
|
|
110
|
+
for minis_item_data in _minis or []:
|
|
111
|
+
minis_item = SlimMiniDto.from_dict(minis_item_data)
|
|
112
|
+
|
|
113
|
+
minis.append(minis_item)
|
|
114
|
+
|
|
115
|
+
group_dto = cls(
|
|
116
|
+
id=id,
|
|
117
|
+
name=name,
|
|
118
|
+
description=description,
|
|
119
|
+
workspace_id=workspace_id,
|
|
120
|
+
users=users,
|
|
121
|
+
minis=minis,
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
return group_dto
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
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
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.http_validation_problem_details_errors import HttpValidationProblemDetailsErrors
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="HttpValidationProblemDetails")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class HttpValidationProblemDetails:
|
|
18
|
+
"""
|
|
19
|
+
Attributes:
|
|
20
|
+
type_ (Union[None, Unset, str]):
|
|
21
|
+
title (Union[None, Unset, str]):
|
|
22
|
+
status (Union[None, Unset, int]):
|
|
23
|
+
detail (Union[None, Unset, str]):
|
|
24
|
+
instance (Union[None, Unset, str]):
|
|
25
|
+
errors (Union[Unset, HttpValidationProblemDetailsErrors]):
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
type_: Union[None, Unset, str] = UNSET
|
|
29
|
+
title: Union[None, Unset, str] = UNSET
|
|
30
|
+
status: Union[None, Unset, int] = UNSET
|
|
31
|
+
detail: Union[None, Unset, str] = UNSET
|
|
32
|
+
instance: Union[None, Unset, str] = UNSET
|
|
33
|
+
errors: Union[Unset, "HttpValidationProblemDetailsErrors"] = UNSET
|
|
34
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
35
|
+
|
|
36
|
+
def to_dict(self) -> dict[str, Any]:
|
|
37
|
+
type_: Union[None, Unset, str]
|
|
38
|
+
if isinstance(self.type_, Unset):
|
|
39
|
+
type_ = UNSET
|
|
40
|
+
else:
|
|
41
|
+
type_ = self.type_
|
|
42
|
+
|
|
43
|
+
title: Union[None, Unset, str]
|
|
44
|
+
if isinstance(self.title, Unset):
|
|
45
|
+
title = UNSET
|
|
46
|
+
else:
|
|
47
|
+
title = self.title
|
|
48
|
+
|
|
49
|
+
status: Union[None, Unset, int]
|
|
50
|
+
if isinstance(self.status, Unset):
|
|
51
|
+
status = UNSET
|
|
52
|
+
else:
|
|
53
|
+
status = self.status
|
|
54
|
+
|
|
55
|
+
detail: Union[None, Unset, str]
|
|
56
|
+
if isinstance(self.detail, Unset):
|
|
57
|
+
detail = UNSET
|
|
58
|
+
else:
|
|
59
|
+
detail = self.detail
|
|
60
|
+
|
|
61
|
+
instance: Union[None, Unset, str]
|
|
62
|
+
if isinstance(self.instance, Unset):
|
|
63
|
+
instance = UNSET
|
|
64
|
+
else:
|
|
65
|
+
instance = self.instance
|
|
66
|
+
|
|
67
|
+
errors: Union[Unset, dict[str, Any]] = UNSET
|
|
68
|
+
if not isinstance(self.errors, Unset):
|
|
69
|
+
errors = self.errors.to_dict()
|
|
70
|
+
|
|
71
|
+
field_dict: dict[str, Any] = {}
|
|
72
|
+
field_dict.update(self.additional_properties)
|
|
73
|
+
field_dict.update({})
|
|
74
|
+
if type_ is not UNSET:
|
|
75
|
+
field_dict["type"] = type_
|
|
76
|
+
if title is not UNSET:
|
|
77
|
+
field_dict["title"] = title
|
|
78
|
+
if status is not UNSET:
|
|
79
|
+
field_dict["status"] = status
|
|
80
|
+
if detail is not UNSET:
|
|
81
|
+
field_dict["detail"] = detail
|
|
82
|
+
if instance is not UNSET:
|
|
83
|
+
field_dict["instance"] = instance
|
|
84
|
+
if errors is not UNSET:
|
|
85
|
+
field_dict["errors"] = errors
|
|
86
|
+
|
|
87
|
+
return field_dict
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
91
|
+
from ..models.http_validation_problem_details_errors import HttpValidationProblemDetailsErrors
|
|
92
|
+
|
|
93
|
+
d = dict(src_dict)
|
|
94
|
+
|
|
95
|
+
def _parse_type_(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
|
+
type_ = _parse_type_(d.pop("type", UNSET))
|
|
103
|
+
|
|
104
|
+
def _parse_title(data: object) -> Union[None, Unset, str]:
|
|
105
|
+
if data is None:
|
|
106
|
+
return data
|
|
107
|
+
if isinstance(data, Unset):
|
|
108
|
+
return data
|
|
109
|
+
return cast(Union[None, Unset, str], data)
|
|
110
|
+
|
|
111
|
+
title = _parse_title(d.pop("title", UNSET))
|
|
112
|
+
|
|
113
|
+
def _parse_status(data: object) -> Union[None, Unset, int]:
|
|
114
|
+
if data is None:
|
|
115
|
+
return data
|
|
116
|
+
if isinstance(data, Unset):
|
|
117
|
+
return data
|
|
118
|
+
return cast(Union[None, Unset, int], data)
|
|
119
|
+
|
|
120
|
+
status = _parse_status(d.pop("status", UNSET))
|
|
121
|
+
|
|
122
|
+
def _parse_detail(data: object) -> Union[None, Unset, str]:
|
|
123
|
+
if data is None:
|
|
124
|
+
return data
|
|
125
|
+
if isinstance(data, Unset):
|
|
126
|
+
return data
|
|
127
|
+
return cast(Union[None, Unset, str], data)
|
|
128
|
+
|
|
129
|
+
detail = _parse_detail(d.pop("detail", UNSET))
|
|
130
|
+
|
|
131
|
+
def _parse_instance(data: object) -> Union[None, Unset, str]:
|
|
132
|
+
if data is None:
|
|
133
|
+
return data
|
|
134
|
+
if isinstance(data, Unset):
|
|
135
|
+
return data
|
|
136
|
+
return cast(Union[None, Unset, str], data)
|
|
137
|
+
|
|
138
|
+
instance = _parse_instance(d.pop("instance", UNSET))
|
|
139
|
+
|
|
140
|
+
_errors = d.pop("errors", UNSET)
|
|
141
|
+
errors: Union[Unset, HttpValidationProblemDetailsErrors]
|
|
142
|
+
if isinstance(_errors, Unset):
|
|
143
|
+
errors = UNSET
|
|
144
|
+
else:
|
|
145
|
+
errors = HttpValidationProblemDetailsErrors.from_dict(_errors)
|
|
146
|
+
|
|
147
|
+
http_validation_problem_details = cls(
|
|
148
|
+
type_=type_,
|
|
149
|
+
title=title,
|
|
150
|
+
status=status,
|
|
151
|
+
detail=detail,
|
|
152
|
+
instance=instance,
|
|
153
|
+
errors=errors,
|
|
154
|
+
)
|
|
155
|
+
|
|
156
|
+
http_validation_problem_details.additional_properties = d
|
|
157
|
+
return http_validation_problem_details
|
|
158
|
+
|
|
159
|
+
@property
|
|
160
|
+
def additional_keys(self) -> list[str]:
|
|
161
|
+
return list(self.additional_properties.keys())
|
|
162
|
+
|
|
163
|
+
def __getitem__(self, key: str) -> Any:
|
|
164
|
+
return self.additional_properties[key]
|
|
165
|
+
|
|
166
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
167
|
+
self.additional_properties[key] = value
|
|
168
|
+
|
|
169
|
+
def __delitem__(self, key: str) -> None:
|
|
170
|
+
del self.additional_properties[key]
|
|
171
|
+
|
|
172
|
+
def __contains__(self, key: str) -> bool:
|
|
173
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
T = TypeVar("T", bound="HttpValidationProblemDetailsErrors")
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
@_attrs_define
|
|
11
|
+
class HttpValidationProblemDetailsErrors:
|
|
12
|
+
""" """
|
|
13
|
+
|
|
14
|
+
additional_properties: dict[str, list[str]] = _attrs_field(init=False, factory=dict)
|
|
15
|
+
|
|
16
|
+
def to_dict(self) -> dict[str, Any]:
|
|
17
|
+
field_dict: dict[str, Any] = {}
|
|
18
|
+
for prop_name, prop in self.additional_properties.items():
|
|
19
|
+
field_dict[prop_name] = prop
|
|
20
|
+
|
|
21
|
+
return field_dict
|
|
22
|
+
|
|
23
|
+
@classmethod
|
|
24
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
25
|
+
d = dict(src_dict)
|
|
26
|
+
http_validation_problem_details_errors = cls()
|
|
27
|
+
|
|
28
|
+
additional_properties = {}
|
|
29
|
+
for prop_name, prop_dict in d.items():
|
|
30
|
+
additional_property = cast(list[str], prop_dict)
|
|
31
|
+
|
|
32
|
+
additional_properties[prop_name] = additional_property
|
|
33
|
+
|
|
34
|
+
http_validation_problem_details_errors.additional_properties = additional_properties
|
|
35
|
+
return http_validation_problem_details_errors
|
|
36
|
+
|
|
37
|
+
@property
|
|
38
|
+
def additional_keys(self) -> list[str]:
|
|
39
|
+
return list(self.additional_properties.keys())
|
|
40
|
+
|
|
41
|
+
def __getitem__(self, key: str) -> list[str]:
|
|
42
|
+
return self.additional_properties[key]
|
|
43
|
+
|
|
44
|
+
def __setitem__(self, key: str, value: list[str]) -> None:
|
|
45
|
+
self.additional_properties[key] = value
|
|
46
|
+
|
|
47
|
+
def __delitem__(self, key: str) -> None:
|
|
48
|
+
del self.additional_properties[key]
|
|
49
|
+
|
|
50
|
+
def __contains__(self, key: str) -> bool:
|
|
51
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
8
|
+
if TYPE_CHECKING:
|
|
9
|
+
from ..models.json_node_options import JsonNodeOptions
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="JsonNode")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class JsonNode:
|
|
17
|
+
"""The base class that represents a single node within a mutable JSON document.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
options (Union['JsonNodeOptions', None, Unset]): Gets the options to control the behavior.
|
|
21
|
+
parent (Union['JsonNode', None, Unset]): Gets the parent JsonNode.
|
|
22
|
+
If there is no parent, null is returned.
|
|
23
|
+
A parent can either be a JsonObject or a JsonArray.
|
|
24
|
+
root (Union[Unset, JsonNode]): The base class that represents a single node within a mutable JSON document.
|
|
25
|
+
"""
|
|
26
|
+
|
|
27
|
+
options: Union["JsonNodeOptions", None, Unset] = UNSET
|
|
28
|
+
parent: Union["JsonNode", None, Unset] = UNSET
|
|
29
|
+
root: Union[Unset, "JsonNode"] = UNSET
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
from ..models.json_node_options import JsonNodeOptions
|
|
33
|
+
|
|
34
|
+
options: Union[None, Unset, dict[str, Any]]
|
|
35
|
+
if isinstance(self.options, Unset):
|
|
36
|
+
options = UNSET
|
|
37
|
+
elif isinstance(self.options, JsonNodeOptions):
|
|
38
|
+
options = self.options.to_dict()
|
|
39
|
+
else:
|
|
40
|
+
options = self.options
|
|
41
|
+
|
|
42
|
+
parent: Union[None, Unset, dict[str, Any]]
|
|
43
|
+
if isinstance(self.parent, Unset):
|
|
44
|
+
parent = UNSET
|
|
45
|
+
elif isinstance(self.parent, JsonNode):
|
|
46
|
+
parent = self.parent.to_dict()
|
|
47
|
+
else:
|
|
48
|
+
parent = self.parent
|
|
49
|
+
|
|
50
|
+
root: Union[Unset, dict[str, Any]] = UNSET
|
|
51
|
+
if not isinstance(self.root, Unset):
|
|
52
|
+
root = self.root.to_dict()
|
|
53
|
+
|
|
54
|
+
field_dict: dict[str, Any] = {}
|
|
55
|
+
|
|
56
|
+
field_dict.update({})
|
|
57
|
+
if options is not UNSET:
|
|
58
|
+
field_dict["options"] = options
|
|
59
|
+
if parent is not UNSET:
|
|
60
|
+
field_dict["parent"] = parent
|
|
61
|
+
if root is not UNSET:
|
|
62
|
+
field_dict["root"] = root
|
|
63
|
+
|
|
64
|
+
return field_dict
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
68
|
+
from ..models.json_node_options import JsonNodeOptions
|
|
69
|
+
|
|
70
|
+
d = dict(src_dict)
|
|
71
|
+
|
|
72
|
+
def _parse_options(data: object) -> Union["JsonNodeOptions", None, Unset]:
|
|
73
|
+
if data is None:
|
|
74
|
+
return data
|
|
75
|
+
if isinstance(data, Unset):
|
|
76
|
+
return data
|
|
77
|
+
try:
|
|
78
|
+
if not isinstance(data, dict):
|
|
79
|
+
raise TypeError()
|
|
80
|
+
options_type_0 = JsonNodeOptions.from_dict(data)
|
|
81
|
+
|
|
82
|
+
return options_type_0
|
|
83
|
+
except: # noqa: E722
|
|
84
|
+
pass
|
|
85
|
+
return cast(Union["JsonNodeOptions", None, Unset], data)
|
|
86
|
+
|
|
87
|
+
options = _parse_options(d.pop("options", UNSET))
|
|
88
|
+
|
|
89
|
+
def _parse_parent(data: object) -> Union["JsonNode", None, Unset]:
|
|
90
|
+
if data is None:
|
|
91
|
+
return data
|
|
92
|
+
if isinstance(data, Unset):
|
|
93
|
+
return data
|
|
94
|
+
try:
|
|
95
|
+
if not isinstance(data, dict):
|
|
96
|
+
raise TypeError()
|
|
97
|
+
parent_type_0 = JsonNode.from_dict(data)
|
|
98
|
+
|
|
99
|
+
return parent_type_0
|
|
100
|
+
except: # noqa: E722
|
|
101
|
+
pass
|
|
102
|
+
return cast(Union["JsonNode", None, Unset], data)
|
|
103
|
+
|
|
104
|
+
parent = _parse_parent(d.pop("parent", UNSET))
|
|
105
|
+
|
|
106
|
+
_root = d.pop("root", UNSET)
|
|
107
|
+
root: Union[Unset, JsonNode]
|
|
108
|
+
if isinstance(_root, Unset):
|
|
109
|
+
root = UNSET
|
|
110
|
+
else:
|
|
111
|
+
root = JsonNode.from_dict(_root)
|
|
112
|
+
|
|
113
|
+
json_node = cls(
|
|
114
|
+
options=options,
|
|
115
|
+
parent=parent,
|
|
116
|
+
root=root,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
return json_node
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
|
|
6
|
+
from ..types import UNSET, Unset
|
|
7
|
+
|
|
8
|
+
T = TypeVar("T", bound="JsonNodeOptions")
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@_attrs_define
|
|
12
|
+
class JsonNodeOptions:
|
|
13
|
+
"""Options to control JsonNode behavior.
|
|
14
|
+
|
|
15
|
+
Attributes:
|
|
16
|
+
property_name_case_insensitive (Union[Unset, bool]): Gets or sets a value that indicates whether property names
|
|
17
|
+
on JsonObject are case insensitive.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
property_name_case_insensitive: Union[Unset, bool] = UNSET
|
|
21
|
+
|
|
22
|
+
def to_dict(self) -> dict[str, Any]:
|
|
23
|
+
property_name_case_insensitive = self.property_name_case_insensitive
|
|
24
|
+
|
|
25
|
+
field_dict: dict[str, Any] = {}
|
|
26
|
+
|
|
27
|
+
field_dict.update({})
|
|
28
|
+
if property_name_case_insensitive is not UNSET:
|
|
29
|
+
field_dict["propertyNameCaseInsensitive"] = property_name_case_insensitive
|
|
30
|
+
|
|
31
|
+
return field_dict
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
35
|
+
d = dict(src_dict)
|
|
36
|
+
property_name_case_insensitive = d.pop("propertyNameCaseInsensitive", UNSET)
|
|
37
|
+
|
|
38
|
+
json_node_options = cls(
|
|
39
|
+
property_name_case_insensitive=property_name_case_insensitive,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
return json_node_options
|