cyberdesk 1.11.0__py3-none-any.whl → 2.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 cyberdesk might be problematic. Click here for more details.
- cyberdesk/__init__.py +1 -1
- cyberdesk/client.py +358 -6
- {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/METADATA +1 -1
- {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/RECORD +66 -49
- openapi_client/cyberdesk_cloud_client/api/connections/create_connection_v1_connections_post.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/connections/delete_connection_v1_connections_connection_id_delete.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/connections/get_connection_v1_connections_connection_id_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/connections/list_connections_v1_connections_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/connections/update_connection_v1_connections_connection_id_patch.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/machines/create_machine_v1_machines_post.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/machines/delete_machine_v1_machines_machine_id_delete.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/machines/get_machine_pools_v1_machines_machine_id_pools_get.py +169 -0
- openapi_client/cyberdesk_cloud_client/api/machines/get_machine_v1_machines_machine_id_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/machines/list_machines_v1_machines_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/machines/update_machine_pools_v1_machines_machine_id_pools_put.py +190 -0
- openapi_client/cyberdesk_cloud_client/api/machines/update_machine_v1_machines_machine_id_patch.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/pools/__init__.py +1 -0
- openapi_client/cyberdesk_cloud_client/api/pools/add_machines_to_pool_v1_pools_pool_id_machines_post.py +186 -0
- openapi_client/cyberdesk_cloud_client/api/pools/create_pool_v1_pools_post.py +172 -0
- openapi_client/cyberdesk_cloud_client/api/pools/delete_pool_v1_pools_pool_id_delete.py +162 -0
- openapi_client/cyberdesk_cloud_client/api/pools/get_pool_v1_pools_pool_id_get.py +185 -0
- openapi_client/cyberdesk_cloud_client/api/pools/list_pools_v1_pools_get.py +186 -0
- openapi_client/cyberdesk_cloud_client/api/pools/remove_machines_from_pool_v1_pools_pool_id_machines_delete.py +184 -0
- openapi_client/cyberdesk_cloud_client/api/pools/update_pool_v1_pools_pool_id_patch.py +186 -0
- openapi_client/cyberdesk_cloud_client/api/request_logs/create_request_log_v1_request_logs_post.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/request_logs/delete_request_log_v1_request_logs_log_id_delete.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/request_logs/get_request_log_v1_request_logs_log_id_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/request_logs/list_request_logs_v1_request_logs_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/request_logs/update_request_log_v1_request_logs_log_id_patch.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/run_attachments/list_run_attachments_v1_run_attachments_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/runs/create_run_v1_runs_post.py +12 -8
- openapi_client/cyberdesk_cloud_client/api/runs/delete_run_v1_runs_run_id_delete.py +8 -4
- openapi_client/cyberdesk_cloud_client/api/runs/get_run_v1_runs_run_id_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/runs/list_runs_v1_runs_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/runs/update_run_v1_runs_run_id_patch.py +8 -12
- openapi_client/cyberdesk_cloud_client/api/trajectories/create_trajectory_v1_trajectories_post.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/trajectories/delete_trajectory_v1_trajectories_trajectory_id_delete.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/trajectories/get_latest_trajectory_for_workflow_v1_workflows_workflow_id_latest_trajectory_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/trajectories/get_trajectory_v1_trajectories_trajectory_id_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/trajectories/list_trajectories_v1_trajectories_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/trajectories/update_trajectory_v1_trajectories_trajectory_id_patch.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/workflows/create_workflow_v1_workflows_post.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/workflows/delete_workflow_v1_workflows_workflow_id_delete.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_v1_workflows_workflow_id_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/workflows/get_workflow_versions_v1_workflows_workflow_id_versions_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/workflows/list_workflows_v1_workflows_get.py +4 -4
- openapi_client/cyberdesk_cloud_client/api/workflows/update_workflow_v1_workflows_workflow_id_patch.py +4 -4
- openapi_client/cyberdesk_cloud_client/models/__init__.py +14 -0
- openapi_client/cyberdesk_cloud_client/models/machine_pool_assignment.py +69 -0
- openapi_client/cyberdesk_cloud_client/models/machine_pool_update.py +69 -0
- openapi_client/cyberdesk_cloud_client/models/machine_response.py +96 -9
- openapi_client/cyberdesk_cloud_client/models/paginated_response_pool_response.py +97 -0
- openapi_client/cyberdesk_cloud_client/models/pool_create.py +82 -0
- openapi_client/cyberdesk_cloud_client/models/pool_response.py +137 -0
- openapi_client/cyberdesk_cloud_client/models/pool_update.py +92 -0
- openapi_client/cyberdesk_cloud_client/models/pool_with_machines.py +162 -0
- openapi_client/cyberdesk_cloud_client/models/request_log_response.py +20 -0
- openapi_client/cyberdesk_cloud_client/models/run_attachment_response.py +50 -8
- openapi_client/cyberdesk_cloud_client/models/run_bulk_create.py +40 -0
- openapi_client/cyberdesk_cloud_client/models/run_create.py +40 -0
- openapi_client/cyberdesk_cloud_client/models/run_response.py +90 -8
- openapi_client/cyberdesk_cloud_client/models/trajectory_response.py +50 -8
- openapi_client/cyberdesk_cloud_client/models/workflow_response.py +50 -8
- {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/WHEEL +0 -0
- {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/licenses/LICENSE +0 -0
- {cyberdesk-1.11.0.dist-info → cyberdesk-2.1.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import datetime
|
|
2
2
|
from collections.abc import Mapping
|
|
3
|
-
from typing import Any, TypeVar, Union, cast
|
|
3
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
4
4
|
from uuid import UUID
|
|
5
5
|
|
|
6
6
|
from attrs import define as _attrs_define
|
|
@@ -10,6 +10,10 @@ from dateutil.parser import isoparse
|
|
|
10
10
|
from ..models.machine_status import MachineStatus
|
|
11
11
|
from ..types import UNSET, Unset
|
|
12
12
|
|
|
13
|
+
if TYPE_CHECKING:
|
|
14
|
+
from ..models.pool_response import PoolResponse
|
|
15
|
+
|
|
16
|
+
|
|
13
17
|
T = TypeVar("T", bound="MachineResponse")
|
|
14
18
|
|
|
15
19
|
|
|
@@ -20,7 +24,6 @@ class MachineResponse:
|
|
|
20
24
|
Attributes:
|
|
21
25
|
fingerprint (str):
|
|
22
26
|
id (UUID):
|
|
23
|
-
user_id (UUID):
|
|
24
27
|
unkey_key_id (str):
|
|
25
28
|
status (MachineStatus):
|
|
26
29
|
is_available (bool):
|
|
@@ -30,11 +33,13 @@ class MachineResponse:
|
|
|
30
33
|
version (Union[None, Unset, str]):
|
|
31
34
|
hostname (Union[None, Unset, str]):
|
|
32
35
|
os_info (Union[None, Unset, str]):
|
|
36
|
+
user_id (Union[None, UUID, Unset]):
|
|
37
|
+
organization_id (Union[None, Unset, str]):
|
|
38
|
+
pools (Union[None, Unset, list['PoolResponse']]):
|
|
33
39
|
"""
|
|
34
40
|
|
|
35
41
|
fingerprint: str
|
|
36
42
|
id: UUID
|
|
37
|
-
user_id: UUID
|
|
38
43
|
unkey_key_id: str
|
|
39
44
|
status: MachineStatus
|
|
40
45
|
is_available: bool
|
|
@@ -44,6 +49,9 @@ class MachineResponse:
|
|
|
44
49
|
version: Union[None, Unset, str] = UNSET
|
|
45
50
|
hostname: Union[None, Unset, str] = UNSET
|
|
46
51
|
os_info: Union[None, Unset, str] = UNSET
|
|
52
|
+
user_id: Union[None, UUID, Unset] = UNSET
|
|
53
|
+
organization_id: Union[None, Unset, str] = UNSET
|
|
54
|
+
pools: Union[None, Unset, list["PoolResponse"]] = UNSET
|
|
47
55
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
48
56
|
|
|
49
57
|
def to_dict(self) -> dict[str, Any]:
|
|
@@ -51,8 +59,6 @@ class MachineResponse:
|
|
|
51
59
|
|
|
52
60
|
id = str(self.id)
|
|
53
61
|
|
|
54
|
-
user_id = str(self.user_id)
|
|
55
|
-
|
|
56
62
|
unkey_key_id = self.unkey_key_id
|
|
57
63
|
|
|
58
64
|
status = self.status.value
|
|
@@ -87,13 +93,38 @@ class MachineResponse:
|
|
|
87
93
|
else:
|
|
88
94
|
os_info = self.os_info
|
|
89
95
|
|
|
96
|
+
user_id: Union[None, Unset, str]
|
|
97
|
+
if isinstance(self.user_id, Unset):
|
|
98
|
+
user_id = UNSET
|
|
99
|
+
elif isinstance(self.user_id, UUID):
|
|
100
|
+
user_id = str(self.user_id)
|
|
101
|
+
else:
|
|
102
|
+
user_id = self.user_id
|
|
103
|
+
|
|
104
|
+
organization_id: Union[None, Unset, str]
|
|
105
|
+
if isinstance(self.organization_id, Unset):
|
|
106
|
+
organization_id = UNSET
|
|
107
|
+
else:
|
|
108
|
+
organization_id = self.organization_id
|
|
109
|
+
|
|
110
|
+
pools: Union[None, Unset, list[dict[str, Any]]]
|
|
111
|
+
if isinstance(self.pools, Unset):
|
|
112
|
+
pools = UNSET
|
|
113
|
+
elif isinstance(self.pools, list):
|
|
114
|
+
pools = []
|
|
115
|
+
for pools_type_0_item_data in self.pools:
|
|
116
|
+
pools_type_0_item = pools_type_0_item_data.to_dict()
|
|
117
|
+
pools.append(pools_type_0_item)
|
|
118
|
+
|
|
119
|
+
else:
|
|
120
|
+
pools = self.pools
|
|
121
|
+
|
|
90
122
|
field_dict: dict[str, Any] = {}
|
|
91
123
|
field_dict.update(self.additional_properties)
|
|
92
124
|
field_dict.update(
|
|
93
125
|
{
|
|
94
126
|
"fingerprint": fingerprint,
|
|
95
127
|
"id": id,
|
|
96
|
-
"user_id": user_id,
|
|
97
128
|
"unkey_key_id": unkey_key_id,
|
|
98
129
|
"status": status,
|
|
99
130
|
"is_available": is_available,
|
|
@@ -109,18 +140,24 @@ class MachineResponse:
|
|
|
109
140
|
field_dict["hostname"] = hostname
|
|
110
141
|
if os_info is not UNSET:
|
|
111
142
|
field_dict["os_info"] = os_info
|
|
143
|
+
if user_id is not UNSET:
|
|
144
|
+
field_dict["user_id"] = user_id
|
|
145
|
+
if organization_id is not UNSET:
|
|
146
|
+
field_dict["organization_id"] = organization_id
|
|
147
|
+
if pools is not UNSET:
|
|
148
|
+
field_dict["pools"] = pools
|
|
112
149
|
|
|
113
150
|
return field_dict
|
|
114
151
|
|
|
115
152
|
@classmethod
|
|
116
153
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
154
|
+
from ..models.pool_response import PoolResponse
|
|
155
|
+
|
|
117
156
|
d = dict(src_dict)
|
|
118
157
|
fingerprint = d.pop("fingerprint")
|
|
119
158
|
|
|
120
159
|
id = UUID(d.pop("id"))
|
|
121
160
|
|
|
122
|
-
user_id = UUID(d.pop("user_id"))
|
|
123
|
-
|
|
124
161
|
unkey_key_id = d.pop("unkey_key_id")
|
|
125
162
|
|
|
126
163
|
status = MachineStatus(d.pop("status"))
|
|
@@ -167,10 +204,57 @@ class MachineResponse:
|
|
|
167
204
|
|
|
168
205
|
os_info = _parse_os_info(d.pop("os_info", UNSET))
|
|
169
206
|
|
|
207
|
+
def _parse_user_id(data: object) -> Union[None, UUID, Unset]:
|
|
208
|
+
if data is None:
|
|
209
|
+
return data
|
|
210
|
+
if isinstance(data, Unset):
|
|
211
|
+
return data
|
|
212
|
+
try:
|
|
213
|
+
if not isinstance(data, str):
|
|
214
|
+
raise TypeError()
|
|
215
|
+
user_id_type_0 = UUID(data)
|
|
216
|
+
|
|
217
|
+
return user_id_type_0
|
|
218
|
+
except: # noqa: E722
|
|
219
|
+
pass
|
|
220
|
+
return cast(Union[None, UUID, Unset], data)
|
|
221
|
+
|
|
222
|
+
user_id = _parse_user_id(d.pop("user_id", UNSET))
|
|
223
|
+
|
|
224
|
+
def _parse_organization_id(data: object) -> Union[None, Unset, str]:
|
|
225
|
+
if data is None:
|
|
226
|
+
return data
|
|
227
|
+
if isinstance(data, Unset):
|
|
228
|
+
return data
|
|
229
|
+
return cast(Union[None, Unset, str], data)
|
|
230
|
+
|
|
231
|
+
organization_id = _parse_organization_id(d.pop("organization_id", UNSET))
|
|
232
|
+
|
|
233
|
+
def _parse_pools(data: object) -> Union[None, Unset, list["PoolResponse"]]:
|
|
234
|
+
if data is None:
|
|
235
|
+
return data
|
|
236
|
+
if isinstance(data, Unset):
|
|
237
|
+
return data
|
|
238
|
+
try:
|
|
239
|
+
if not isinstance(data, list):
|
|
240
|
+
raise TypeError()
|
|
241
|
+
pools_type_0 = []
|
|
242
|
+
_pools_type_0 = data
|
|
243
|
+
for pools_type_0_item_data in _pools_type_0:
|
|
244
|
+
pools_type_0_item = PoolResponse.from_dict(pools_type_0_item_data)
|
|
245
|
+
|
|
246
|
+
pools_type_0.append(pools_type_0_item)
|
|
247
|
+
|
|
248
|
+
return pools_type_0
|
|
249
|
+
except: # noqa: E722
|
|
250
|
+
pass
|
|
251
|
+
return cast(Union[None, Unset, list["PoolResponse"]], data)
|
|
252
|
+
|
|
253
|
+
pools = _parse_pools(d.pop("pools", UNSET))
|
|
254
|
+
|
|
170
255
|
machine_response = cls(
|
|
171
256
|
fingerprint=fingerprint,
|
|
172
257
|
id=id,
|
|
173
|
-
user_id=user_id,
|
|
174
258
|
unkey_key_id=unkey_key_id,
|
|
175
259
|
status=status,
|
|
176
260
|
is_available=is_available,
|
|
@@ -180,6 +264,9 @@ class MachineResponse:
|
|
|
180
264
|
version=version,
|
|
181
265
|
hostname=hostname,
|
|
182
266
|
os_info=os_info,
|
|
267
|
+
user_id=user_id,
|
|
268
|
+
organization_id=organization_id,
|
|
269
|
+
pools=pools,
|
|
183
270
|
)
|
|
184
271
|
|
|
185
272
|
machine_response.additional_properties = d
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
from ..models.pool_response import PoolResponse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="PaginatedResponsePoolResponse")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class PaginatedResponsePoolResponse:
|
|
16
|
+
"""
|
|
17
|
+
Attributes:
|
|
18
|
+
items (list['PoolResponse']):
|
|
19
|
+
total (int):
|
|
20
|
+
skip (int):
|
|
21
|
+
limit (int):
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
items: list["PoolResponse"]
|
|
25
|
+
total: int
|
|
26
|
+
skip: int
|
|
27
|
+
limit: int
|
|
28
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
29
|
+
|
|
30
|
+
def to_dict(self) -> dict[str, Any]:
|
|
31
|
+
items = []
|
|
32
|
+
for items_item_data in self.items:
|
|
33
|
+
items_item = items_item_data.to_dict()
|
|
34
|
+
items.append(items_item)
|
|
35
|
+
|
|
36
|
+
total = self.total
|
|
37
|
+
|
|
38
|
+
skip = self.skip
|
|
39
|
+
|
|
40
|
+
limit = self.limit
|
|
41
|
+
|
|
42
|
+
field_dict: dict[str, Any] = {}
|
|
43
|
+
field_dict.update(self.additional_properties)
|
|
44
|
+
field_dict.update(
|
|
45
|
+
{
|
|
46
|
+
"items": items,
|
|
47
|
+
"total": total,
|
|
48
|
+
"skip": skip,
|
|
49
|
+
"limit": limit,
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
return field_dict
|
|
54
|
+
|
|
55
|
+
@classmethod
|
|
56
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
57
|
+
from ..models.pool_response import PoolResponse
|
|
58
|
+
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
items = []
|
|
61
|
+
_items = d.pop("items")
|
|
62
|
+
for items_item_data in _items:
|
|
63
|
+
items_item = PoolResponse.from_dict(items_item_data)
|
|
64
|
+
|
|
65
|
+
items.append(items_item)
|
|
66
|
+
|
|
67
|
+
total = d.pop("total")
|
|
68
|
+
|
|
69
|
+
skip = d.pop("skip")
|
|
70
|
+
|
|
71
|
+
limit = d.pop("limit")
|
|
72
|
+
|
|
73
|
+
paginated_response_pool_response = cls(
|
|
74
|
+
items=items,
|
|
75
|
+
total=total,
|
|
76
|
+
skip=skip,
|
|
77
|
+
limit=limit,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
paginated_response_pool_response.additional_properties = d
|
|
81
|
+
return paginated_response_pool_response
|
|
82
|
+
|
|
83
|
+
@property
|
|
84
|
+
def additional_keys(self) -> list[str]:
|
|
85
|
+
return list(self.additional_properties.keys())
|
|
86
|
+
|
|
87
|
+
def __getitem__(self, key: str) -> Any:
|
|
88
|
+
return self.additional_properties[key]
|
|
89
|
+
|
|
90
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
91
|
+
self.additional_properties[key] = value
|
|
92
|
+
|
|
93
|
+
def __delitem__(self, key: str) -> None:
|
|
94
|
+
del self.additional_properties[key]
|
|
95
|
+
|
|
96
|
+
def __contains__(self, key: str) -> bool:
|
|
97
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import 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
|
+
T = TypeVar("T", bound="PoolCreate")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class PoolCreate:
|
|
14
|
+
"""Schema for creating a pool
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
name (str):
|
|
18
|
+
description (Union[None, Unset, str]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: str
|
|
22
|
+
description: Union[None, Unset, str] = UNSET
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
name = self.name
|
|
27
|
+
|
|
28
|
+
description: Union[None, Unset, str]
|
|
29
|
+
if isinstance(self.description, Unset):
|
|
30
|
+
description = UNSET
|
|
31
|
+
else:
|
|
32
|
+
description = self.description
|
|
33
|
+
|
|
34
|
+
field_dict: dict[str, Any] = {}
|
|
35
|
+
field_dict.update(self.additional_properties)
|
|
36
|
+
field_dict.update(
|
|
37
|
+
{
|
|
38
|
+
"name": name,
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
if description is not UNSET:
|
|
42
|
+
field_dict["description"] = description
|
|
43
|
+
|
|
44
|
+
return field_dict
|
|
45
|
+
|
|
46
|
+
@classmethod
|
|
47
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
48
|
+
d = dict(src_dict)
|
|
49
|
+
name = d.pop("name")
|
|
50
|
+
|
|
51
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
52
|
+
if data is None:
|
|
53
|
+
return data
|
|
54
|
+
if isinstance(data, Unset):
|
|
55
|
+
return data
|
|
56
|
+
return cast(Union[None, Unset, str], data)
|
|
57
|
+
|
|
58
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
59
|
+
|
|
60
|
+
pool_create = cls(
|
|
61
|
+
name=name,
|
|
62
|
+
description=description,
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
pool_create.additional_properties = d
|
|
66
|
+
return pool_create
|
|
67
|
+
|
|
68
|
+
@property
|
|
69
|
+
def additional_keys(self) -> list[str]:
|
|
70
|
+
return list(self.additional_properties.keys())
|
|
71
|
+
|
|
72
|
+
def __getitem__(self, key: str) -> Any:
|
|
73
|
+
return self.additional_properties[key]
|
|
74
|
+
|
|
75
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
76
|
+
self.additional_properties[key] = value
|
|
77
|
+
|
|
78
|
+
def __delitem__(self, key: str) -> None:
|
|
79
|
+
del self.additional_properties[key]
|
|
80
|
+
|
|
81
|
+
def __contains__(self, key: str) -> bool:
|
|
82
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from typing import Any, TypeVar, Union, cast
|
|
4
|
+
from uuid import UUID
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
from dateutil.parser import isoparse
|
|
9
|
+
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="PoolResponse")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class PoolResponse:
|
|
17
|
+
"""Pool response schema
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
name (str):
|
|
21
|
+
id (UUID):
|
|
22
|
+
organization_id (str):
|
|
23
|
+
created_at (datetime.datetime):
|
|
24
|
+
updated_at (datetime.datetime):
|
|
25
|
+
description (Union[None, Unset, str]):
|
|
26
|
+
machine_count (Union[None, Unset, int]): Number of machines in this pool Default: 0.
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
name: str
|
|
30
|
+
id: UUID
|
|
31
|
+
organization_id: str
|
|
32
|
+
created_at: datetime.datetime
|
|
33
|
+
updated_at: datetime.datetime
|
|
34
|
+
description: Union[None, Unset, str] = UNSET
|
|
35
|
+
machine_count: Union[None, Unset, int] = 0
|
|
36
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
37
|
+
|
|
38
|
+
def to_dict(self) -> dict[str, Any]:
|
|
39
|
+
name = self.name
|
|
40
|
+
|
|
41
|
+
id = str(self.id)
|
|
42
|
+
|
|
43
|
+
organization_id = self.organization_id
|
|
44
|
+
|
|
45
|
+
created_at = self.created_at.isoformat()
|
|
46
|
+
|
|
47
|
+
updated_at = self.updated_at.isoformat()
|
|
48
|
+
|
|
49
|
+
description: Union[None, Unset, str]
|
|
50
|
+
if isinstance(self.description, Unset):
|
|
51
|
+
description = UNSET
|
|
52
|
+
else:
|
|
53
|
+
description = self.description
|
|
54
|
+
|
|
55
|
+
machine_count: Union[None, Unset, int]
|
|
56
|
+
if isinstance(self.machine_count, Unset):
|
|
57
|
+
machine_count = UNSET
|
|
58
|
+
else:
|
|
59
|
+
machine_count = self.machine_count
|
|
60
|
+
|
|
61
|
+
field_dict: dict[str, Any] = {}
|
|
62
|
+
field_dict.update(self.additional_properties)
|
|
63
|
+
field_dict.update(
|
|
64
|
+
{
|
|
65
|
+
"name": name,
|
|
66
|
+
"id": id,
|
|
67
|
+
"organization_id": organization_id,
|
|
68
|
+
"created_at": created_at,
|
|
69
|
+
"updated_at": updated_at,
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
if description is not UNSET:
|
|
73
|
+
field_dict["description"] = description
|
|
74
|
+
if machine_count is not UNSET:
|
|
75
|
+
field_dict["machine_count"] = machine_count
|
|
76
|
+
|
|
77
|
+
return field_dict
|
|
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")
|
|
83
|
+
|
|
84
|
+
id = UUID(d.pop("id"))
|
|
85
|
+
|
|
86
|
+
organization_id = d.pop("organization_id")
|
|
87
|
+
|
|
88
|
+
created_at = isoparse(d.pop("created_at"))
|
|
89
|
+
|
|
90
|
+
updated_at = isoparse(d.pop("updated_at"))
|
|
91
|
+
|
|
92
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
93
|
+
if data is None:
|
|
94
|
+
return data
|
|
95
|
+
if isinstance(data, Unset):
|
|
96
|
+
return data
|
|
97
|
+
return cast(Union[None, Unset, str], data)
|
|
98
|
+
|
|
99
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
100
|
+
|
|
101
|
+
def _parse_machine_count(data: object) -> Union[None, Unset, int]:
|
|
102
|
+
if data is None:
|
|
103
|
+
return data
|
|
104
|
+
if isinstance(data, Unset):
|
|
105
|
+
return data
|
|
106
|
+
return cast(Union[None, Unset, int], data)
|
|
107
|
+
|
|
108
|
+
machine_count = _parse_machine_count(d.pop("machine_count", UNSET))
|
|
109
|
+
|
|
110
|
+
pool_response = cls(
|
|
111
|
+
name=name,
|
|
112
|
+
id=id,
|
|
113
|
+
organization_id=organization_id,
|
|
114
|
+
created_at=created_at,
|
|
115
|
+
updated_at=updated_at,
|
|
116
|
+
description=description,
|
|
117
|
+
machine_count=machine_count,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
pool_response.additional_properties = d
|
|
121
|
+
return pool_response
|
|
122
|
+
|
|
123
|
+
@property
|
|
124
|
+
def additional_keys(self) -> list[str]:
|
|
125
|
+
return list(self.additional_properties.keys())
|
|
126
|
+
|
|
127
|
+
def __getitem__(self, key: str) -> Any:
|
|
128
|
+
return self.additional_properties[key]
|
|
129
|
+
|
|
130
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
131
|
+
self.additional_properties[key] = value
|
|
132
|
+
|
|
133
|
+
def __delitem__(self, key: str) -> None:
|
|
134
|
+
del self.additional_properties[key]
|
|
135
|
+
|
|
136
|
+
def __contains__(self, key: str) -> bool:
|
|
137
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import 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
|
+
T = TypeVar("T", bound="PoolUpdate")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class PoolUpdate:
|
|
14
|
+
"""Schema for updating a pool
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
name (Union[None, Unset, str]):
|
|
18
|
+
description (Union[None, Unset, str]):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
name: Union[None, Unset, str] = UNSET
|
|
22
|
+
description: Union[None, Unset, str] = UNSET
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
name: Union[None, Unset, str]
|
|
27
|
+
if isinstance(self.name, Unset):
|
|
28
|
+
name = UNSET
|
|
29
|
+
else:
|
|
30
|
+
name = self.name
|
|
31
|
+
|
|
32
|
+
description: Union[None, Unset, str]
|
|
33
|
+
if isinstance(self.description, Unset):
|
|
34
|
+
description = UNSET
|
|
35
|
+
else:
|
|
36
|
+
description = self.description
|
|
37
|
+
|
|
38
|
+
field_dict: dict[str, Any] = {}
|
|
39
|
+
field_dict.update(self.additional_properties)
|
|
40
|
+
field_dict.update({})
|
|
41
|
+
if name is not UNSET:
|
|
42
|
+
field_dict["name"] = name
|
|
43
|
+
if description is not UNSET:
|
|
44
|
+
field_dict["description"] = description
|
|
45
|
+
|
|
46
|
+
return field_dict
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
50
|
+
d = dict(src_dict)
|
|
51
|
+
|
|
52
|
+
def _parse_name(data: object) -> Union[None, Unset, str]:
|
|
53
|
+
if data is None:
|
|
54
|
+
return data
|
|
55
|
+
if isinstance(data, Unset):
|
|
56
|
+
return data
|
|
57
|
+
return cast(Union[None, Unset, str], data)
|
|
58
|
+
|
|
59
|
+
name = _parse_name(d.pop("name", UNSET))
|
|
60
|
+
|
|
61
|
+
def _parse_description(data: object) -> Union[None, Unset, str]:
|
|
62
|
+
if data is None:
|
|
63
|
+
return data
|
|
64
|
+
if isinstance(data, Unset):
|
|
65
|
+
return data
|
|
66
|
+
return cast(Union[None, Unset, str], data)
|
|
67
|
+
|
|
68
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
69
|
+
|
|
70
|
+
pool_update = cls(
|
|
71
|
+
name=name,
|
|
72
|
+
description=description,
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
pool_update.additional_properties = d
|
|
76
|
+
return pool_update
|
|
77
|
+
|
|
78
|
+
@property
|
|
79
|
+
def additional_keys(self) -> list[str]:
|
|
80
|
+
return list(self.additional_properties.keys())
|
|
81
|
+
|
|
82
|
+
def __getitem__(self, key: str) -> Any:
|
|
83
|
+
return self.additional_properties[key]
|
|
84
|
+
|
|
85
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
86
|
+
self.additional_properties[key] = value
|
|
87
|
+
|
|
88
|
+
def __delitem__(self, key: str) -> None:
|
|
89
|
+
del self.additional_properties[key]
|
|
90
|
+
|
|
91
|
+
def __contains__(self, key: str) -> bool:
|
|
92
|
+
return key in self.additional_properties
|