mithril-client 0.1.0a1__cp314-cp314-macosx_11_0_arm64.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.
- mithril/__init__.py +7 -0
- mithril/_mcli.cpython-314-darwin.so +0 -0
- mithril/_mcli.pyi +7 -0
- mithril/_mcli_entry.py +75 -0
- mithril/api/__init__.py +7 -0
- mithril/api/bindings/.gitattributes +2 -0
- mithril/api/bindings/__init__.py +10 -0
- mithril/api/bindings/api/__init__.py +1 -0
- mithril/api/bindings/api/api_keys/__init__.py +1 -0
- mithril/api/bindings/api/api_keys/create_api_key_v2_api_keys_post.py +179 -0
- mithril/api/bindings/api/api_keys/get_api_keys_v2_api_keys_get.py +141 -0
- mithril/api/bindings/api/api_keys/revoke_api_key_v2_api_keys_key_fid_delete.py +173 -0
- mithril/api/bindings/api/image_versions/__init__.py +1 -0
- mithril/api/bindings/api/image_versions/get_image_versions_v2_image_versions_get.py +141 -0
- mithril/api/bindings/api/image_versions/get_mcc_image_versions_v2_mcc_image_versions_get.py +179 -0
- mithril/api/bindings/api/instance_types/__init__.py +1 -0
- mithril/api/bindings/api/instance_types/get_instance_types_v2_instance_types_get.py +137 -0
- mithril/api/bindings/api/instances/__init__.py +1 -0
- mithril/api/bindings/api/instances/get_instance_status_v2_instances_instance_id_status_get.py +165 -0
- mithril/api/bindings/api/instances/get_instances_v2_instances_get.py +409 -0
- mithril/api/bindings/api/kubernetes_clusters/__init__.py +1 -0
- mithril/api/bindings/api/kubernetes_clusters/create_kubernetes_cluster_v2_kubernetes_clusters_post.py +171 -0
- mithril/api/bindings/api/kubernetes_clusters/delete_kubernetes_cluster_v2_kubernetes_clusters_cluster_fid_delete.py +163 -0
- mithril/api/bindings/api/kubernetes_clusters/get_kubernetes_cluster_v2_kubernetes_clusters_cluster_fid_get.py +165 -0
- mithril/api/bindings/api/kubernetes_clusters/get_kubernetes_clusters_v2_kubernetes_clusters_get.py +175 -0
- mithril/api/bindings/api/lifecycle_scripts/__init__.py +1 -0
- mithril/api/bindings/api/lifecycle_scripts/create_lifecycle_script_v2_lifecycle_scripts_post.py +171 -0
- mithril/api/bindings/api/lifecycle_scripts/delete_lifecycle_script_v2_lifecycle_scripts_ls_fid_delete.py +155 -0
- mithril/api/bindings/api/lifecycle_scripts/get_lifecycle_script_content_v2_lifecycle_scripts_ls_fid_content_get.py +155 -0
- mithril/api/bindings/api/lifecycle_scripts/list_lifecycle_scripts_v2_lifecycle_scripts_get.py +247 -0
- mithril/api/bindings/api/lifecycle_scripts/update_lifecycle_script_v2_lifecycle_scripts_ls_fid_patch.py +179 -0
- mithril/api/bindings/api/pricing/__init__.py +1 -0
- mithril/api/bindings/api/pricing/get_current_prices_v2_v2_pricing_current_get.py +217 -0
- mithril/api/bindings/api/pricing/get_historical_prices_v2_v2_pricing_history_get.py +222 -0
- mithril/api/bindings/api/profile/__init__.py +1 -0
- mithril/api/bindings/api/profile/get_me_v2_me_get.py +132 -0
- mithril/api/bindings/api/profile/get_my_teammates_v2_me_teammates_get.py +153 -0
- mithril/api/bindings/api/projects/__init__.py +1 -0
- mithril/api/bindings/api/projects/get_projects_v2_projects_get.py +137 -0
- mithril/api/bindings/api/quotas/__init__.py +1 -0
- mithril/api/bindings/api/quotas/get_quotas_v2_quotas_get.py +175 -0
- mithril/api/bindings/api/reservations/__init__.py +1 -0
- mithril/api/bindings/api/reservations/create_reservation_v2_reservation_post.py +171 -0
- mithril/api/bindings/api/reservations/extend_reservation_v2_reservation_reservation_fid_extend_post.py +187 -0
- mithril/api/bindings/api/reservations/get_availability_v2_reservation_availability_get.py +664 -0
- mithril/api/bindings/api/reservations/get_extension_availability_v2_reservation_reservation_fid_extension_availability_get.py +165 -0
- mithril/api/bindings/api/reservations/get_reservations_v2_reservation_get.py +309 -0
- mithril/api/bindings/api/reservations/update_reservation_v2_reservation_reservation_fid_patch.py +187 -0
- mithril/api/bindings/api/spot/__init__.py +1 -0
- mithril/api/bindings/api/spot/cancel_bid_v2_spot_bids_bid_fid_delete.py +161 -0
- mithril/api/bindings/api/spot/create_bid_v2_spot_bids_post.py +171 -0
- mithril/api/bindings/api/spot/get_auctions_v2_spot_availability_get.py +137 -0
- mithril/api/bindings/api/spot/get_bid_history_v2_spot_bids_bid_fid_history_get.py +193 -0
- mithril/api/bindings/api/spot/get_bid_status_v2_spot_bids_bid_fid_status_get.py +189 -0
- mithril/api/bindings/api/spot/get_bid_v2_spot_bids_bid_fid_get.py +163 -0
- mithril/api/bindings/api/spot/get_bids_v2_spot_bids_get.py +330 -0
- mithril/api/bindings/api/spot/update_bid_v2_spot_bids_bid_fid_patch.py +185 -0
- mithril/api/bindings/api/ssh_keys/__init__.py +1 -0
- mithril/api/bindings/api/ssh_keys/create_ssh_key_v2_ssh_keys_post.py +175 -0
- mithril/api/bindings/api/ssh_keys/delete_ssh_key_v2_ssh_keys_ssh_key_fid_delete.py +167 -0
- mithril/api/bindings/api/ssh_keys/get_ssh_keys_v2_ssh_keys_get.py +175 -0
- mithril/api/bindings/api/ssh_keys/update_ssh_key_v2_ssh_keys_ssh_key_fid_patch.py +187 -0
- mithril/api/bindings/api/volumes/__init__.py +1 -0
- mithril/api/bindings/api/volumes/create_volume_v2_volumes_post.py +211 -0
- mithril/api/bindings/api/volumes/delete_volume_v2_volumes_volume_fid_delete.py +199 -0
- mithril/api/bindings/api/volumes/get_volumes_v2_volumes_get.py +239 -0
- mithril/api/bindings/api/volumes/update_volume_v2_volumes_volume_fid_patch.py +243 -0
- mithril/api/bindings/client.py +284 -0
- mithril/api/bindings/errors.py +18 -0
- mithril/api/bindings/models/__init__.py +169 -0
- mithril/api/bindings/models/api_key_model.py +114 -0
- mithril/api/bindings/models/auction_model.py +146 -0
- mithril/api/bindings/models/availability_slot_model.py +76 -0
- mithril/api/bindings/models/bid_history_event_model.py +157 -0
- mithril/api/bindings/models/bid_history_event_model_event_type.py +19 -0
- mithril/api/bindings/models/bid_history_response.py +84 -0
- mithril/api/bindings/models/bid_model.py +191 -0
- mithril/api/bindings/models/bid_model_status.py +14 -0
- mithril/api/bindings/models/bid_status_response.py +72 -0
- mithril/api/bindings/models/bid_status_response_status.py +15 -0
- mithril/api/bindings/models/check_availability_response.py +60 -0
- mithril/api/bindings/models/create_api_key_request.py +68 -0
- mithril/api/bindings/models/create_api_key_response.py +122 -0
- mithril/api/bindings/models/create_bid_request.py +116 -0
- mithril/api/bindings/models/create_kubernetes_cluster_request.py +136 -0
- mithril/api/bindings/models/create_kubernetes_cluster_request_k8s_version.py +11 -0
- mithril/api/bindings/models/create_lifecycle_script_request.py +115 -0
- mithril/api/bindings/models/create_reservation_request.py +124 -0
- mithril/api/bindings/models/create_ssh_key_request.py +99 -0
- mithril/api/bindings/models/create_volume_request.py +98 -0
- mithril/api/bindings/models/create_volume_request_disk_interface.py +11 -0
- mithril/api/bindings/models/created_ssh_key_model.py +122 -0
- mithril/api/bindings/models/current_prices_response.py +202 -0
- mithril/api/bindings/models/extend_reservation_request.py +60 -0
- mithril/api/bindings/models/extension_availability_response.py +68 -0
- mithril/api/bindings/models/get_availability_v2_reservation_availability_get_mode.py +12 -0
- mithril/api/bindings/models/get_bids_response.py +96 -0
- mithril/api/bindings/models/get_bids_v2_spot_bids_get_sort_by.py +11 -0
- mithril/api/bindings/models/get_bids_v2_spot_bids_get_status.py +14 -0
- mithril/api/bindings/models/get_instances_response.py +96 -0
- mithril/api/bindings/models/get_instances_v2_instances_get_order_type_in_type_0_item.py +11 -0
- mithril/api/bindings/models/get_instances_v2_instances_get_sort_by.py +12 -0
- mithril/api/bindings/models/get_instances_v2_instances_get_status_in_type_0_item.py +24 -0
- mithril/api/bindings/models/get_latest_end_time_response.py +68 -0
- mithril/api/bindings/models/get_reservations_response.py +96 -0
- mithril/api/bindings/models/get_reservations_v2_reservation_get_sort_by.py +11 -0
- mithril/api/bindings/models/get_reservations_v2_reservation_get_status.py +14 -0
- mithril/api/bindings/models/historical_price_point_model.py +94 -0
- mithril/api/bindings/models/historical_prices_response_model.py +76 -0
- mithril/api/bindings/models/http_validation_error.py +78 -0
- mithril/api/bindings/models/image_version_model.py +224 -0
- mithril/api/bindings/models/instance_model.py +211 -0
- mithril/api/bindings/models/instance_model_status.py +24 -0
- mithril/api/bindings/models/instance_status_response.py +141 -0
- mithril/api/bindings/models/instance_status_response_status.py +24 -0
- mithril/api/bindings/models/instance_type_model.py +170 -0
- mithril/api/bindings/models/kubernetes_cluster_model.py +207 -0
- mithril/api/bindings/models/kubernetes_cluster_model_status.py +12 -0
- mithril/api/bindings/models/launch_specification_model.py +152 -0
- mithril/api/bindings/models/lifecycle_script_model.py +134 -0
- mithril/api/bindings/models/lifecycle_script_scope.py +12 -0
- mithril/api/bindings/models/list_lifecycle_scripts_response.py +96 -0
- mithril/api/bindings/models/list_lifecycle_scripts_v2_lifecycle_scripts_get_sort_by.py +11 -0
- mithril/api/bindings/models/me_response.py +126 -0
- mithril/api/bindings/models/new_ssh_key_model.py +100 -0
- mithril/api/bindings/models/persistent_disk_change.py +92 -0
- mithril/api/bindings/models/project_model.py +76 -0
- mithril/api/bindings/models/public_lifecycle_script_scope.py +11 -0
- mithril/api/bindings/models/quota_model.py +132 -0
- mithril/api/bindings/models/reservation_model.py +215 -0
- mithril/api/bindings/models/reservation_model_status.py +14 -0
- mithril/api/bindings/models/size.py +70 -0
- mithril/api/bindings/models/size_unit.py +18 -0
- mithril/api/bindings/models/sort_direction.py +11 -0
- mithril/api/bindings/models/teammate_response.py +158 -0
- mithril/api/bindings/models/update_bid_request.py +143 -0
- mithril/api/bindings/models/update_lifecycle_script_request.py +109 -0
- mithril/api/bindings/models/update_reservation_request.py +103 -0
- mithril/api/bindings/models/update_ssh_key_request.py +60 -0
- mithril/api/bindings/models/update_volume_request.py +65 -0
- mithril/api/bindings/models/validation_error.py +89 -0
- mithril/api/bindings/models/volume_model.py +140 -0
- mithril/api/bindings/models/volume_model_attachments.py +46 -0
- mithril/api/bindings/models/volume_model_interface.py +11 -0
- mithril/api/bindings/types.py +56 -0
- mithril/api/client.py +138 -0
- mithril/cli/__init__.py +7 -0
- mithril/cli/commands/__init__.py +15 -0
- mithril/cli/commands/help.py +88 -0
- mithril/cli/commands/launch.py +353 -0
- mithril/cli/main.py +68 -0
- mithril/cli/utils/__init__.py +1 -0
- mithril/cli/utils/skypilot_passthrough.py +38 -0
- mithril/cli/utils/streaming.py +235 -0
- mithril/cli/utils/volumes.py +110 -0
- mithril/config.py +47 -0
- mithril/py.typed +0 -0
- mithril/sky/__init__.py +141 -0
- mithril/sky/client.py +176 -0
- mithril_client-0.1.0a1.dist-info/METADATA +56 -0
- mithril_client-0.1.0a1.dist-info/RECORD +163 -0
- mithril_client-0.1.0a1.dist-info/WHEEL +4 -0
- mithril_client-0.1.0a1.dist-info/entry_points.txt +3 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.public_lifecycle_script_scope import PublicLifecycleScriptScope
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
T = TypeVar("T", bound="UpdateLifecycleScriptRequest")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
@_attrs_define
|
|
16
|
+
class UpdateLifecycleScriptRequest:
|
|
17
|
+
"""Attributes:
|
|
18
|
+
name (None | str | Unset):
|
|
19
|
+
description (None | str | Unset):
|
|
20
|
+
scope (PublicLifecycleScriptScope | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
name: None | str | Unset = UNSET
|
|
24
|
+
description: None | str | Unset = UNSET
|
|
25
|
+
scope: PublicLifecycleScriptScope | Unset = UNSET
|
|
26
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
27
|
+
|
|
28
|
+
def to_dict(self) -> dict[str, Any]:
|
|
29
|
+
name: None | str | Unset
|
|
30
|
+
if isinstance(self.name, Unset):
|
|
31
|
+
name = UNSET
|
|
32
|
+
else:
|
|
33
|
+
name = self.name
|
|
34
|
+
|
|
35
|
+
description: None | str | Unset
|
|
36
|
+
if isinstance(self.description, Unset):
|
|
37
|
+
description = UNSET
|
|
38
|
+
else:
|
|
39
|
+
description = self.description
|
|
40
|
+
|
|
41
|
+
scope: str | Unset = UNSET
|
|
42
|
+
if not isinstance(self.scope, Unset):
|
|
43
|
+
scope = self.scope.value
|
|
44
|
+
|
|
45
|
+
field_dict: dict[str, Any] = {}
|
|
46
|
+
field_dict.update(self.additional_properties)
|
|
47
|
+
field_dict.update({})
|
|
48
|
+
if name is not UNSET:
|
|
49
|
+
field_dict["name"] = name
|
|
50
|
+
if description is not UNSET:
|
|
51
|
+
field_dict["description"] = description
|
|
52
|
+
if scope is not UNSET:
|
|
53
|
+
field_dict["scope"] = scope
|
|
54
|
+
|
|
55
|
+
return field_dict
|
|
56
|
+
|
|
57
|
+
@classmethod
|
|
58
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
59
|
+
d = dict(src_dict)
|
|
60
|
+
|
|
61
|
+
def _parse_name(data: object) -> None | str | Unset:
|
|
62
|
+
if data is None:
|
|
63
|
+
return data
|
|
64
|
+
if isinstance(data, Unset):
|
|
65
|
+
return data
|
|
66
|
+
return cast(None | str | Unset, data)
|
|
67
|
+
|
|
68
|
+
name = _parse_name(d.pop("name", UNSET))
|
|
69
|
+
|
|
70
|
+
def _parse_description(data: object) -> None | str | Unset:
|
|
71
|
+
if data is None:
|
|
72
|
+
return data
|
|
73
|
+
if isinstance(data, Unset):
|
|
74
|
+
return data
|
|
75
|
+
return cast(None | str | Unset, data)
|
|
76
|
+
|
|
77
|
+
description = _parse_description(d.pop("description", UNSET))
|
|
78
|
+
|
|
79
|
+
_scope = d.pop("scope", UNSET)
|
|
80
|
+
scope: PublicLifecycleScriptScope | Unset
|
|
81
|
+
if isinstance(_scope, Unset):
|
|
82
|
+
scope = UNSET
|
|
83
|
+
else:
|
|
84
|
+
scope = PublicLifecycleScriptScope(_scope)
|
|
85
|
+
|
|
86
|
+
update_lifecycle_script_request = cls(
|
|
87
|
+
name=name,
|
|
88
|
+
description=description,
|
|
89
|
+
scope=scope,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
update_lifecycle_script_request.additional_properties = d
|
|
93
|
+
return update_lifecycle_script_request
|
|
94
|
+
|
|
95
|
+
@property
|
|
96
|
+
def additional_keys(self) -> list[str]:
|
|
97
|
+
return list(self.additional_properties.keys())
|
|
98
|
+
|
|
99
|
+
def __getitem__(self, key: str) -> Any:
|
|
100
|
+
return self.additional_properties[key]
|
|
101
|
+
|
|
102
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
103
|
+
self.additional_properties[key] = value
|
|
104
|
+
|
|
105
|
+
def __delitem__(self, key: str) -> None:
|
|
106
|
+
del self.additional_properties[key]
|
|
107
|
+
|
|
108
|
+
def __contains__(self, key: str) -> bool:
|
|
109
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..types import UNSET, Unset
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="UpdateReservationRequest")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class UpdateReservationRequest:
|
|
16
|
+
"""Attributes:
|
|
17
|
+
paused (bool | None | Unset):
|
|
18
|
+
volumes (list[str] | None | Unset):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
paused: bool | None | Unset = UNSET
|
|
22
|
+
volumes: list[str] | None | Unset = UNSET
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
paused: bool | None | Unset
|
|
27
|
+
if isinstance(self.paused, Unset):
|
|
28
|
+
paused = UNSET
|
|
29
|
+
else:
|
|
30
|
+
paused = self.paused
|
|
31
|
+
|
|
32
|
+
volumes: list[str] | None | Unset
|
|
33
|
+
if isinstance(self.volumes, Unset):
|
|
34
|
+
volumes = UNSET
|
|
35
|
+
elif isinstance(self.volumes, list):
|
|
36
|
+
volumes = self.volumes
|
|
37
|
+
|
|
38
|
+
else:
|
|
39
|
+
volumes = self.volumes
|
|
40
|
+
|
|
41
|
+
field_dict: dict[str, Any] = {}
|
|
42
|
+
field_dict.update(self.additional_properties)
|
|
43
|
+
field_dict.update({})
|
|
44
|
+
if paused is not UNSET:
|
|
45
|
+
field_dict["paused"] = paused
|
|
46
|
+
if volumes is not UNSET:
|
|
47
|
+
field_dict["volumes"] = volumes
|
|
48
|
+
|
|
49
|
+
return field_dict
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
53
|
+
d = dict(src_dict)
|
|
54
|
+
|
|
55
|
+
def _parse_paused(data: object) -> bool | None | Unset:
|
|
56
|
+
if data is None:
|
|
57
|
+
return data
|
|
58
|
+
if isinstance(data, Unset):
|
|
59
|
+
return data
|
|
60
|
+
return cast(bool | None | Unset, data)
|
|
61
|
+
|
|
62
|
+
paused = _parse_paused(d.pop("paused", UNSET))
|
|
63
|
+
|
|
64
|
+
def _parse_volumes(data: object) -> list[str] | None | Unset:
|
|
65
|
+
if data is None:
|
|
66
|
+
return data
|
|
67
|
+
if isinstance(data, Unset):
|
|
68
|
+
return data
|
|
69
|
+
try:
|
|
70
|
+
if not isinstance(data, list):
|
|
71
|
+
raise TypeError
|
|
72
|
+
volumes_type_0 = cast(list[str], data)
|
|
73
|
+
|
|
74
|
+
return volumes_type_0
|
|
75
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
76
|
+
pass
|
|
77
|
+
return cast(list[str] | None | Unset, data)
|
|
78
|
+
|
|
79
|
+
volumes = _parse_volumes(d.pop("volumes", UNSET))
|
|
80
|
+
|
|
81
|
+
update_reservation_request = cls(
|
|
82
|
+
paused=paused,
|
|
83
|
+
volumes=volumes,
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
update_reservation_request.additional_properties = d
|
|
87
|
+
return update_reservation_request
|
|
88
|
+
|
|
89
|
+
@property
|
|
90
|
+
def additional_keys(self) -> list[str]:
|
|
91
|
+
return list(self.additional_properties.keys())
|
|
92
|
+
|
|
93
|
+
def __getitem__(self, key: str) -> Any:
|
|
94
|
+
return self.additional_properties[key]
|
|
95
|
+
|
|
96
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
97
|
+
self.additional_properties[key] = value
|
|
98
|
+
|
|
99
|
+
def __delitem__(self, key: str) -> None:
|
|
100
|
+
del self.additional_properties[key]
|
|
101
|
+
|
|
102
|
+
def __contains__(self, key: str) -> bool:
|
|
103
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="UpdateSshKeyRequest")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class UpdateSshKeyRequest:
|
|
14
|
+
"""Attributes:
|
|
15
|
+
required (bool):
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
required: bool
|
|
19
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
20
|
+
|
|
21
|
+
def to_dict(self) -> dict[str, Any]:
|
|
22
|
+
required = self.required
|
|
23
|
+
|
|
24
|
+
field_dict: dict[str, Any] = {}
|
|
25
|
+
field_dict.update(self.additional_properties)
|
|
26
|
+
field_dict.update(
|
|
27
|
+
{
|
|
28
|
+
"required": required,
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return field_dict
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
36
|
+
d = dict(src_dict)
|
|
37
|
+
required = d.pop("required")
|
|
38
|
+
|
|
39
|
+
update_ssh_key_request = cls(
|
|
40
|
+
required=required,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
update_ssh_key_request.additional_properties = d
|
|
44
|
+
return update_ssh_key_request
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
def additional_keys(self) -> list[str]:
|
|
48
|
+
return list(self.additional_properties.keys())
|
|
49
|
+
|
|
50
|
+
def __getitem__(self, key: str) -> Any:
|
|
51
|
+
return self.additional_properties[key]
|
|
52
|
+
|
|
53
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
54
|
+
self.additional_properties[key] = value
|
|
55
|
+
|
|
56
|
+
def __delitem__(self, key: str) -> None:
|
|
57
|
+
del self.additional_properties[key]
|
|
58
|
+
|
|
59
|
+
def __contains__(self, key: str) -> bool:
|
|
60
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="UpdateVolumeRequest")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class UpdateVolumeRequest:
|
|
14
|
+
"""Request model for updating an existing storage volume.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
name: New name for the volume. Must follow naming conventions.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
name (str):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
name: str
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
name = self.name
|
|
28
|
+
|
|
29
|
+
field_dict: dict[str, Any] = {}
|
|
30
|
+
field_dict.update(self.additional_properties)
|
|
31
|
+
field_dict.update(
|
|
32
|
+
{
|
|
33
|
+
"name": name,
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
return field_dict
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
41
|
+
d = dict(src_dict)
|
|
42
|
+
name = d.pop("name")
|
|
43
|
+
|
|
44
|
+
update_volume_request = cls(
|
|
45
|
+
name=name,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
update_volume_request.additional_properties = d
|
|
49
|
+
return update_volume_request
|
|
50
|
+
|
|
51
|
+
@property
|
|
52
|
+
def additional_keys(self) -> list[str]:
|
|
53
|
+
return list(self.additional_properties.keys())
|
|
54
|
+
|
|
55
|
+
def __getitem__(self, key: str) -> Any:
|
|
56
|
+
return self.additional_properties[key]
|
|
57
|
+
|
|
58
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
59
|
+
self.additional_properties[key] = value
|
|
60
|
+
|
|
61
|
+
def __delitem__(self, key: str) -> None:
|
|
62
|
+
del self.additional_properties[key]
|
|
63
|
+
|
|
64
|
+
def __contains__(self, key: str) -> bool:
|
|
65
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="ValidationError")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class ValidationError:
|
|
14
|
+
"""Attributes:
|
|
15
|
+
loc (list[int | str]):
|
|
16
|
+
msg (str):
|
|
17
|
+
type_ (str):
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
loc: list[int | str]
|
|
21
|
+
msg: str
|
|
22
|
+
type_: str
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
loc = []
|
|
27
|
+
for loc_item_data in self.loc:
|
|
28
|
+
loc_item: int | str
|
|
29
|
+
loc_item = loc_item_data
|
|
30
|
+
loc.append(loc_item)
|
|
31
|
+
|
|
32
|
+
msg = self.msg
|
|
33
|
+
|
|
34
|
+
type_ = self.type_
|
|
35
|
+
|
|
36
|
+
field_dict: dict[str, Any] = {}
|
|
37
|
+
field_dict.update(self.additional_properties)
|
|
38
|
+
field_dict.update(
|
|
39
|
+
{
|
|
40
|
+
"loc": loc,
|
|
41
|
+
"msg": msg,
|
|
42
|
+
"type": type_,
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
return field_dict
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
50
|
+
d = dict(src_dict)
|
|
51
|
+
loc = []
|
|
52
|
+
_loc = d.pop("loc")
|
|
53
|
+
for loc_item_data in _loc:
|
|
54
|
+
|
|
55
|
+
def _parse_loc_item(data: object) -> int | str:
|
|
56
|
+
return cast(int | str, data)
|
|
57
|
+
|
|
58
|
+
loc_item = _parse_loc_item(loc_item_data)
|
|
59
|
+
|
|
60
|
+
loc.append(loc_item)
|
|
61
|
+
|
|
62
|
+
msg = d.pop("msg")
|
|
63
|
+
|
|
64
|
+
type_ = d.pop("type")
|
|
65
|
+
|
|
66
|
+
validation_error = cls(
|
|
67
|
+
loc=loc,
|
|
68
|
+
msg=msg,
|
|
69
|
+
type_=type_,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
validation_error.additional_properties = d
|
|
73
|
+
return validation_error
|
|
74
|
+
|
|
75
|
+
@property
|
|
76
|
+
def additional_keys(self) -> list[str]:
|
|
77
|
+
return list(self.additional_properties.keys())
|
|
78
|
+
|
|
79
|
+
def __getitem__(self, key: str) -> Any:
|
|
80
|
+
return self.additional_properties[key]
|
|
81
|
+
|
|
82
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
83
|
+
self.additional_properties[key] = value
|
|
84
|
+
|
|
85
|
+
def __delitem__(self, key: str) -> None:
|
|
86
|
+
del self.additional_properties[key]
|
|
87
|
+
|
|
88
|
+
def __contains__(self, key: str) -> bool:
|
|
89
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import TYPE_CHECKING, Any, Self, TypeVar, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
from ..models.volume_model_interface import VolumeModelInterface
|
|
10
|
+
|
|
11
|
+
if TYPE_CHECKING:
|
|
12
|
+
from ..models.volume_model_attachments import VolumeModelAttachments
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
T = TypeVar("T", bound="VolumeModel")
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@_attrs_define
|
|
19
|
+
class VolumeModel:
|
|
20
|
+
"""Attributes:
|
|
21
|
+
fid (str):
|
|
22
|
+
name (str):
|
|
23
|
+
region (str):
|
|
24
|
+
created_at (str):
|
|
25
|
+
capacity_gb (int):
|
|
26
|
+
project (str):
|
|
27
|
+
interface (VolumeModelInterface):
|
|
28
|
+
bids (list[str]):
|
|
29
|
+
reservations (list[str]):
|
|
30
|
+
attachments (VolumeModelAttachments):
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
fid: str
|
|
34
|
+
name: str
|
|
35
|
+
region: str
|
|
36
|
+
created_at: str
|
|
37
|
+
capacity_gb: int
|
|
38
|
+
project: str
|
|
39
|
+
interface: VolumeModelInterface
|
|
40
|
+
bids: list[str]
|
|
41
|
+
reservations: list[str]
|
|
42
|
+
attachments: VolumeModelAttachments
|
|
43
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
44
|
+
|
|
45
|
+
def to_dict(self) -> dict[str, Any]:
|
|
46
|
+
fid = self.fid
|
|
47
|
+
|
|
48
|
+
name = self.name
|
|
49
|
+
|
|
50
|
+
region = self.region
|
|
51
|
+
|
|
52
|
+
created_at = self.created_at
|
|
53
|
+
|
|
54
|
+
capacity_gb = self.capacity_gb
|
|
55
|
+
|
|
56
|
+
project = self.project
|
|
57
|
+
|
|
58
|
+
interface = self.interface.value
|
|
59
|
+
|
|
60
|
+
bids = self.bids
|
|
61
|
+
|
|
62
|
+
reservations = self.reservations
|
|
63
|
+
|
|
64
|
+
attachments = self.attachments.to_dict()
|
|
65
|
+
|
|
66
|
+
field_dict: dict[str, Any] = {}
|
|
67
|
+
field_dict.update(self.additional_properties)
|
|
68
|
+
field_dict.update(
|
|
69
|
+
{
|
|
70
|
+
"fid": fid,
|
|
71
|
+
"name": name,
|
|
72
|
+
"region": region,
|
|
73
|
+
"created_at": created_at,
|
|
74
|
+
"capacity_gb": capacity_gb,
|
|
75
|
+
"project": project,
|
|
76
|
+
"interface": interface,
|
|
77
|
+
"bids": bids,
|
|
78
|
+
"reservations": reservations,
|
|
79
|
+
"attachments": attachments,
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
return field_dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
87
|
+
from ..models.volume_model_attachments import VolumeModelAttachments
|
|
88
|
+
|
|
89
|
+
d = dict(src_dict)
|
|
90
|
+
fid = d.pop("fid")
|
|
91
|
+
|
|
92
|
+
name = d.pop("name")
|
|
93
|
+
|
|
94
|
+
region = d.pop("region")
|
|
95
|
+
|
|
96
|
+
created_at = d.pop("created_at")
|
|
97
|
+
|
|
98
|
+
capacity_gb = d.pop("capacity_gb")
|
|
99
|
+
|
|
100
|
+
project = d.pop("project")
|
|
101
|
+
|
|
102
|
+
interface = VolumeModelInterface(d.pop("interface"))
|
|
103
|
+
|
|
104
|
+
bids = cast(list[str], d.pop("bids"))
|
|
105
|
+
|
|
106
|
+
reservations = cast(list[str], d.pop("reservations"))
|
|
107
|
+
|
|
108
|
+
attachments = VolumeModelAttachments.from_dict(d.pop("attachments"))
|
|
109
|
+
|
|
110
|
+
volume_model = cls(
|
|
111
|
+
fid=fid,
|
|
112
|
+
name=name,
|
|
113
|
+
region=region,
|
|
114
|
+
created_at=created_at,
|
|
115
|
+
capacity_gb=capacity_gb,
|
|
116
|
+
project=project,
|
|
117
|
+
interface=interface,
|
|
118
|
+
bids=bids,
|
|
119
|
+
reservations=reservations,
|
|
120
|
+
attachments=attachments,
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
volume_model.additional_properties = d
|
|
124
|
+
return volume_model
|
|
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,46 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from collections.abc import Mapping
|
|
4
|
+
from typing import Any, Self, TypeVar
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="VolumeModelAttachments")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class VolumeModelAttachments:
|
|
14
|
+
""" """
|
|
15
|
+
|
|
16
|
+
additional_properties: dict[str, str] = _attrs_field(init=False, factory=dict)
|
|
17
|
+
|
|
18
|
+
def to_dict(self) -> dict[str, Any]:
|
|
19
|
+
field_dict: dict[str, Any] = {}
|
|
20
|
+
field_dict.update(self.additional_properties)
|
|
21
|
+
|
|
22
|
+
return field_dict
|
|
23
|
+
|
|
24
|
+
@classmethod
|
|
25
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
26
|
+
d = dict(src_dict)
|
|
27
|
+
volume_model_attachments = cls()
|
|
28
|
+
|
|
29
|
+
volume_model_attachments.additional_properties = d
|
|
30
|
+
return volume_model_attachments
|
|
31
|
+
|
|
32
|
+
@property
|
|
33
|
+
def additional_keys(self) -> list[str]:
|
|
34
|
+
return list(self.additional_properties.keys())
|
|
35
|
+
|
|
36
|
+
def __getitem__(self, key: str) -> str:
|
|
37
|
+
return self.additional_properties[key]
|
|
38
|
+
|
|
39
|
+
def __setitem__(self, key: str, value: str) -> None:
|
|
40
|
+
self.additional_properties[key] = value
|
|
41
|
+
|
|
42
|
+
def __delitem__(self, key: str) -> None:
|
|
43
|
+
del self.additional_properties[key]
|
|
44
|
+
|
|
45
|
+
def __contains__(self, key: str) -> bool:
|
|
46
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"""Contains some shared types for properties"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from collections.abc import Mapping, MutableMapping
|
|
6
|
+
from http import HTTPStatus
|
|
7
|
+
from typing import IO, BinaryIO, Generic, Literal, TypeVar
|
|
8
|
+
|
|
9
|
+
from attrs import define
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Unset:
|
|
13
|
+
def __bool__(self) -> Literal[False]:
|
|
14
|
+
return False
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
UNSET: Unset = Unset()
|
|
18
|
+
|
|
19
|
+
# The types that `httpx.Client(files=)` can accept, copied from that library.
|
|
20
|
+
FileContent = IO[bytes] | bytes | str
|
|
21
|
+
FileTypes = (
|
|
22
|
+
# (filename, file (or bytes), content_type)
|
|
23
|
+
tuple[str | None, FileContent, str | None]
|
|
24
|
+
# (filename, file (or bytes), content_type, headers)
|
|
25
|
+
| tuple[str | None, FileContent, str | None, Mapping[str, str]]
|
|
26
|
+
)
|
|
27
|
+
RequestFiles = list[tuple[str, FileTypes]]
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
@define
|
|
31
|
+
class File:
|
|
32
|
+
"""Contains information for file uploads"""
|
|
33
|
+
|
|
34
|
+
payload: BinaryIO
|
|
35
|
+
file_name: str | None = None
|
|
36
|
+
mime_type: str | None = None
|
|
37
|
+
|
|
38
|
+
def to_tuple(self) -> FileTypes:
|
|
39
|
+
"""Return a tuple representation that httpx will accept for multipart/form-data"""
|
|
40
|
+
return self.file_name, self.payload, self.mime_type
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
T = TypeVar("T")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@define
|
|
47
|
+
class Response(Generic[T]):
|
|
48
|
+
"""A response from an endpoint"""
|
|
49
|
+
|
|
50
|
+
status_code: HTTPStatus
|
|
51
|
+
content: bytes
|
|
52
|
+
headers: MutableMapping[str, str]
|
|
53
|
+
parsed: T | None
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
__all__ = ["UNSET", "File", "FileTypes", "RequestFiles", "Response", "Unset"]
|