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,140 @@
|
|
|
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
|
+
import json
|
|
7
|
+
from .. import types
|
|
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
|
+
|
|
22
|
+
|
|
23
|
+
T = TypeVar("T", bound="AddAttachmentsBody")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
@_attrs_define
|
|
28
|
+
class AddAttachmentsBody:
|
|
29
|
+
"""
|
|
30
|
+
Attributes:
|
|
31
|
+
files (Union[None, Unset, list[File]]):
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
files: Union[None, Unset, list[File]] = UNSET
|
|
35
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_dict(self) -> dict[str, Any]:
|
|
42
|
+
files: Union[None, Unset, list[FileTypes]]
|
|
43
|
+
if isinstance(self.files, Unset):
|
|
44
|
+
files = UNSET
|
|
45
|
+
elif isinstance(self.files, list):
|
|
46
|
+
files = []
|
|
47
|
+
for files_type_0_item_data in self.files:
|
|
48
|
+
files_type_0_item = files_type_0_item_data.to_tuple()
|
|
49
|
+
|
|
50
|
+
files.append(files_type_0_item)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
else:
|
|
54
|
+
files = self.files
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
field_dict: dict[str, Any] = {}
|
|
58
|
+
field_dict.update(self.additional_properties)
|
|
59
|
+
field_dict.update({
|
|
60
|
+
})
|
|
61
|
+
if files is not UNSET:
|
|
62
|
+
field_dict["files"] = files
|
|
63
|
+
|
|
64
|
+
return field_dict
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def to_multipart(self) -> types.RequestFiles:
|
|
68
|
+
files: types.RequestFiles = []
|
|
69
|
+
|
|
70
|
+
if not isinstance(self.files, Unset):
|
|
71
|
+
if isinstance(self.files, list):
|
|
72
|
+
|
|
73
|
+
for files_type_0_item_element in self.files:
|
|
74
|
+
files.append(("files", files_type_0_item_element.to_tuple()))
|
|
75
|
+
else:
|
|
76
|
+
files.append(("files", (None, str(self.files).encode(), "text/plain")))
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
for prop_name, prop in self.additional_properties.items():
|
|
81
|
+
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
return files
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
@classmethod
|
|
89
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
90
|
+
d = dict(src_dict)
|
|
91
|
+
def _parse_files(data: object) -> Union[None, Unset, list[File]]:
|
|
92
|
+
if data is None:
|
|
93
|
+
return data
|
|
94
|
+
if isinstance(data, Unset):
|
|
95
|
+
return data
|
|
96
|
+
try:
|
|
97
|
+
if not isinstance(data, list):
|
|
98
|
+
raise TypeError()
|
|
99
|
+
files_type_0 = []
|
|
100
|
+
_files_type_0 = data
|
|
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
|
+
|
|
107
|
+
|
|
108
|
+
files_type_0.append(files_type_0_item)
|
|
109
|
+
|
|
110
|
+
return files_type_0
|
|
111
|
+
except: # noqa: E722
|
|
112
|
+
pass
|
|
113
|
+
return cast(Union[None, Unset, list[File]], data)
|
|
114
|
+
|
|
115
|
+
files = _parse_files(d.pop("files", UNSET))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
add_attachments_body = cls(
|
|
119
|
+
files=files,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
add_attachments_body.additional_properties = d
|
|
124
|
+
return add_attachments_body
|
|
125
|
+
|
|
126
|
+
@property
|
|
127
|
+
def additional_keys(self) -> list[str]:
|
|
128
|
+
return list(self.additional_properties.keys())
|
|
129
|
+
|
|
130
|
+
def __getitem__(self, key: str) -> Any:
|
|
131
|
+
return self.additional_properties[key]
|
|
132
|
+
|
|
133
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
134
|
+
self.additional_properties[key] = value
|
|
135
|
+
|
|
136
|
+
def __delitem__(self, key: str) -> None:
|
|
137
|
+
del self.additional_properties[key]
|
|
138
|
+
|
|
139
|
+
def __contains__(self, key: str) -> bool:
|
|
140
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,124 @@
|
|
|
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.failed_upsert_item import FailedUpsertItem
|
|
15
|
+
from ..models.record import Record
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
T = TypeVar("T", bound="BatchUpsertResult")
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
@_attrs_define
|
|
26
|
+
class BatchUpsertResult:
|
|
27
|
+
"""
|
|
28
|
+
Attributes:
|
|
29
|
+
successful (Union[Unset, list['Record']]):
|
|
30
|
+
failed (Union[Unset, list['FailedUpsertItem']]):
|
|
31
|
+
success_count (Union[Unset, int]):
|
|
32
|
+
failure_count (Union[Unset, int]):
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
successful: Union[Unset, list['Record']] = UNSET
|
|
36
|
+
failed: Union[Unset, list['FailedUpsertItem']] = UNSET
|
|
37
|
+
success_count: Union[Unset, int] = UNSET
|
|
38
|
+
failure_count: Union[Unset, int] = UNSET
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_dict(self) -> dict[str, Any]:
|
|
45
|
+
from ..models.failed_upsert_item import FailedUpsertItem
|
|
46
|
+
from ..models.record import Record
|
|
47
|
+
successful: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
48
|
+
if not isinstance(self.successful, Unset):
|
|
49
|
+
successful = []
|
|
50
|
+
for successful_item_data in self.successful:
|
|
51
|
+
successful_item = successful_item_data.to_dict()
|
|
52
|
+
successful.append(successful_item)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
failed: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
57
|
+
if not isinstance(self.failed, Unset):
|
|
58
|
+
failed = []
|
|
59
|
+
for failed_item_data in self.failed:
|
|
60
|
+
failed_item = failed_item_data.to_dict()
|
|
61
|
+
failed.append(failed_item)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
success_count = self.success_count
|
|
66
|
+
|
|
67
|
+
failure_count = self.failure_count
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
field_dict: dict[str, Any] = {}
|
|
71
|
+
|
|
72
|
+
field_dict.update({
|
|
73
|
+
})
|
|
74
|
+
if successful is not UNSET:
|
|
75
|
+
field_dict["successful"] = successful
|
|
76
|
+
if failed is not UNSET:
|
|
77
|
+
field_dict["failed"] = failed
|
|
78
|
+
if success_count is not UNSET:
|
|
79
|
+
field_dict["successCount"] = success_count
|
|
80
|
+
if failure_count is not UNSET:
|
|
81
|
+
field_dict["failureCount"] = failure_count
|
|
82
|
+
|
|
83
|
+
return field_dict
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
89
|
+
from ..models.failed_upsert_item import FailedUpsertItem
|
|
90
|
+
from ..models.record import Record
|
|
91
|
+
d = dict(src_dict)
|
|
92
|
+
successful = []
|
|
93
|
+
_successful = d.pop("successful", UNSET)
|
|
94
|
+
for successful_item_data in (_successful or []):
|
|
95
|
+
successful_item = Record.from_dict(successful_item_data)
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
successful.append(successful_item)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
failed = []
|
|
103
|
+
_failed = d.pop("failed", UNSET)
|
|
104
|
+
for failed_item_data in (_failed or []):
|
|
105
|
+
failed_item = FailedUpsertItem.from_dict(failed_item_data)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
failed.append(failed_item)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
success_count = d.pop("successCount", UNSET)
|
|
113
|
+
|
|
114
|
+
failure_count = d.pop("failureCount", UNSET)
|
|
115
|
+
|
|
116
|
+
batch_upsert_result = cls(
|
|
117
|
+
successful=successful,
|
|
118
|
+
failed=failed,
|
|
119
|
+
success_count=success_count,
|
|
120
|
+
failure_count=failure_count,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
return batch_upsert_result
|
|
124
|
+
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
T = TypeVar("T", bound="CreateGroupCommand")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@_attrs_define
|
|
24
|
+
class CreateGroupCommand:
|
|
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
|
+
"""
|
|
31
|
+
|
|
32
|
+
name: Union[Unset, str] = UNSET
|
|
33
|
+
user_ids: Union[None, Unset, list[str]] = UNSET
|
|
34
|
+
mini_ids: Union[None, Unset, list[int]] = UNSET
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_dict(self) -> dict[str, Any]:
|
|
41
|
+
name = self.name
|
|
42
|
+
|
|
43
|
+
user_ids: Union[None, Unset, list[str]]
|
|
44
|
+
if isinstance(self.user_ids, Unset):
|
|
45
|
+
user_ids = UNSET
|
|
46
|
+
elif isinstance(self.user_ids, list):
|
|
47
|
+
user_ids = self.user_ids
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
else:
|
|
51
|
+
user_ids = self.user_ids
|
|
52
|
+
|
|
53
|
+
mini_ids: Union[None, Unset, list[int]]
|
|
54
|
+
if isinstance(self.mini_ids, Unset):
|
|
55
|
+
mini_ids = UNSET
|
|
56
|
+
elif isinstance(self.mini_ids, list):
|
|
57
|
+
mini_ids = self.mini_ids
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
else:
|
|
61
|
+
mini_ids = self.mini_ids
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
field_dict: dict[str, Any] = {}
|
|
65
|
+
|
|
66
|
+
field_dict.update({
|
|
67
|
+
})
|
|
68
|
+
if name is not UNSET:
|
|
69
|
+
field_dict["name"] = name
|
|
70
|
+
if user_ids is not UNSET:
|
|
71
|
+
field_dict["userIds"] = user_ids
|
|
72
|
+
if mini_ids is not UNSET:
|
|
73
|
+
field_dict["miniIds"] = mini_ids
|
|
74
|
+
|
|
75
|
+
return field_dict
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
81
|
+
d = dict(src_dict)
|
|
82
|
+
name = d.pop("name", UNSET)
|
|
83
|
+
|
|
84
|
+
def _parse_user_ids(data: object) -> Union[None, Unset, list[str]]:
|
|
85
|
+
if data is None:
|
|
86
|
+
return data
|
|
87
|
+
if isinstance(data, Unset):
|
|
88
|
+
return data
|
|
89
|
+
try:
|
|
90
|
+
if not isinstance(data, list):
|
|
91
|
+
raise TypeError()
|
|
92
|
+
user_ids_type_0 = cast(list[str], data)
|
|
93
|
+
|
|
94
|
+
return user_ids_type_0
|
|
95
|
+
except: # noqa: E722
|
|
96
|
+
pass
|
|
97
|
+
return cast(Union[None, Unset, list[str]], data)
|
|
98
|
+
|
|
99
|
+
user_ids = _parse_user_ids(d.pop("userIds", UNSET))
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def _parse_mini_ids(data: object) -> Union[None, Unset, list[int]]:
|
|
103
|
+
if data is None:
|
|
104
|
+
return data
|
|
105
|
+
if isinstance(data, Unset):
|
|
106
|
+
return data
|
|
107
|
+
try:
|
|
108
|
+
if not isinstance(data, list):
|
|
109
|
+
raise TypeError()
|
|
110
|
+
mini_ids_type_0 = cast(list[int], data)
|
|
111
|
+
|
|
112
|
+
return mini_ids_type_0
|
|
113
|
+
except: # noqa: E722
|
|
114
|
+
pass
|
|
115
|
+
return cast(Union[None, Unset, list[int]], data)
|
|
116
|
+
|
|
117
|
+
mini_ids = _parse_mini_ids(d.pop("miniIds", UNSET))
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
create_group_command = cls(
|
|
121
|
+
name=name,
|
|
122
|
+
user_ids=user_ids,
|
|
123
|
+
mini_ids=mini_ids,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
return create_group_command
|
|
127
|
+
|
|
@@ -0,0 +1,144 @@
|
|
|
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, Union
|
|
11
|
+
from typing import Union
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
T = TypeVar("T", bound="CreateMiniCommand")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@_attrs_define
|
|
23
|
+
class CreateMiniCommand:
|
|
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
|
+
"""
|
|
32
|
+
|
|
33
|
+
name: Union[Unset, str] = UNSET
|
|
34
|
+
description: Union[None, Unset, str] = UNSET
|
|
35
|
+
template_id: Union[None, Unset, str] = UNSET
|
|
36
|
+
external_id: Union[None, Unset, str] = UNSET
|
|
37
|
+
external_source: Union[None, Unset, str] = UNSET
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_dict(self) -> dict[str, Any]:
|
|
44
|
+
name = self.name
|
|
45
|
+
|
|
46
|
+
description: Union[None, Unset, str]
|
|
47
|
+
if isinstance(self.description, Unset):
|
|
48
|
+
description = UNSET
|
|
49
|
+
else:
|
|
50
|
+
description = self.description
|
|
51
|
+
|
|
52
|
+
template_id: Union[None, Unset, str]
|
|
53
|
+
if isinstance(self.template_id, Unset):
|
|
54
|
+
template_id = UNSET
|
|
55
|
+
else:
|
|
56
|
+
template_id = self.template_id
|
|
57
|
+
|
|
58
|
+
external_id: Union[None, Unset, str]
|
|
59
|
+
if isinstance(self.external_id, Unset):
|
|
60
|
+
external_id = UNSET
|
|
61
|
+
else:
|
|
62
|
+
external_id = self.external_id
|
|
63
|
+
|
|
64
|
+
external_source: Union[None, Unset, str]
|
|
65
|
+
if isinstance(self.external_source, Unset):
|
|
66
|
+
external_source = UNSET
|
|
67
|
+
else:
|
|
68
|
+
external_source = self.external_source
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
field_dict: dict[str, Any] = {}
|
|
72
|
+
|
|
73
|
+
field_dict.update({
|
|
74
|
+
})
|
|
75
|
+
if name is not UNSET:
|
|
76
|
+
field_dict["name"] = name
|
|
77
|
+
if description is not UNSET:
|
|
78
|
+
field_dict["description"] = description
|
|
79
|
+
if template_id is not UNSET:
|
|
80
|
+
field_dict["templateId"] = template_id
|
|
81
|
+
if external_id is not UNSET:
|
|
82
|
+
field_dict["externalId"] = external_id
|
|
83
|
+
if external_source is not UNSET:
|
|
84
|
+
field_dict["externalSource"] = external_source
|
|
85
|
+
|
|
86
|
+
return field_dict
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@classmethod
|
|
91
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
92
|
+
d = dict(src_dict)
|
|
93
|
+
name = d.pop("name", UNSET)
|
|
94
|
+
|
|
95
|
+
def _parse_description(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
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _parse_template_id(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
|
+
template_id = _parse_template_id(d.pop("templateId", UNSET))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
def _parse_external_id(data: object) -> Union[None, Unset, str]:
|
|
116
|
+
if data is None:
|
|
117
|
+
return data
|
|
118
|
+
if isinstance(data, Unset):
|
|
119
|
+
return data
|
|
120
|
+
return cast(Union[None, Unset, str], data)
|
|
121
|
+
|
|
122
|
+
external_id = _parse_external_id(d.pop("externalId", UNSET))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
def _parse_external_source(data: object) -> Union[None, Unset, str]:
|
|
126
|
+
if data is None:
|
|
127
|
+
return data
|
|
128
|
+
if isinstance(data, Unset):
|
|
129
|
+
return data
|
|
130
|
+
return cast(Union[None, Unset, str], data)
|
|
131
|
+
|
|
132
|
+
external_source = _parse_external_source(d.pop("externalSource", UNSET))
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
create_mini_command = cls(
|
|
136
|
+
name=name,
|
|
137
|
+
description=description,
|
|
138
|
+
template_id=template_id,
|
|
139
|
+
external_id=external_id,
|
|
140
|
+
external_source=external_source,
|
|
141
|
+
)
|
|
142
|
+
|
|
143
|
+
return create_mini_command
|
|
144
|
+
|