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,215 @@
|
|
|
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.reservation_model_status import ReservationModelStatus
|
|
10
|
+
from ..types import UNSET, Unset
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from ..models.launch_specification_model import LaunchSpecificationModel
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="ReservationModel")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class ReservationModel:
|
|
21
|
+
"""Attributes:
|
|
22
|
+
fid (str):
|
|
23
|
+
name (str):
|
|
24
|
+
project (str):
|
|
25
|
+
created_by (str):
|
|
26
|
+
created_at (str):
|
|
27
|
+
instance_quantity (int):
|
|
28
|
+
instance_type (str):
|
|
29
|
+
instances (list[str]):
|
|
30
|
+
launch_specification (LaunchSpecificationModel):
|
|
31
|
+
status (ReservationModelStatus):
|
|
32
|
+
start_time (str):
|
|
33
|
+
end_time (str):
|
|
34
|
+
total_price (str):
|
|
35
|
+
unit_price (str):
|
|
36
|
+
deactivated_at (None | str | Unset):
|
|
37
|
+
region (None | str | Unset):
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
fid: str
|
|
41
|
+
name: str
|
|
42
|
+
project: str
|
|
43
|
+
created_by: str
|
|
44
|
+
created_at: str
|
|
45
|
+
instance_quantity: int
|
|
46
|
+
instance_type: str
|
|
47
|
+
instances: list[str]
|
|
48
|
+
launch_specification: LaunchSpecificationModel
|
|
49
|
+
status: ReservationModelStatus
|
|
50
|
+
start_time: str
|
|
51
|
+
end_time: str
|
|
52
|
+
total_price: str
|
|
53
|
+
unit_price: str
|
|
54
|
+
deactivated_at: None | str | Unset = UNSET
|
|
55
|
+
region: None | str | Unset = UNSET
|
|
56
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> dict[str, Any]:
|
|
59
|
+
fid = self.fid
|
|
60
|
+
|
|
61
|
+
name = self.name
|
|
62
|
+
|
|
63
|
+
project = self.project
|
|
64
|
+
|
|
65
|
+
created_by = self.created_by
|
|
66
|
+
|
|
67
|
+
created_at = self.created_at
|
|
68
|
+
|
|
69
|
+
instance_quantity = self.instance_quantity
|
|
70
|
+
|
|
71
|
+
instance_type = self.instance_type
|
|
72
|
+
|
|
73
|
+
instances = self.instances
|
|
74
|
+
|
|
75
|
+
launch_specification = self.launch_specification.to_dict()
|
|
76
|
+
|
|
77
|
+
status = self.status.value
|
|
78
|
+
|
|
79
|
+
start_time = self.start_time
|
|
80
|
+
|
|
81
|
+
end_time = self.end_time
|
|
82
|
+
|
|
83
|
+
total_price = self.total_price
|
|
84
|
+
|
|
85
|
+
unit_price = self.unit_price
|
|
86
|
+
|
|
87
|
+
deactivated_at: None | str | Unset
|
|
88
|
+
if isinstance(self.deactivated_at, Unset):
|
|
89
|
+
deactivated_at = UNSET
|
|
90
|
+
else:
|
|
91
|
+
deactivated_at = self.deactivated_at
|
|
92
|
+
|
|
93
|
+
region: None | str | Unset
|
|
94
|
+
if isinstance(self.region, Unset):
|
|
95
|
+
region = UNSET
|
|
96
|
+
else:
|
|
97
|
+
region = self.region
|
|
98
|
+
|
|
99
|
+
field_dict: dict[str, Any] = {}
|
|
100
|
+
field_dict.update(self.additional_properties)
|
|
101
|
+
field_dict.update(
|
|
102
|
+
{
|
|
103
|
+
"fid": fid,
|
|
104
|
+
"name": name,
|
|
105
|
+
"project": project,
|
|
106
|
+
"created_by": created_by,
|
|
107
|
+
"created_at": created_at,
|
|
108
|
+
"instance_quantity": instance_quantity,
|
|
109
|
+
"instance_type": instance_type,
|
|
110
|
+
"instances": instances,
|
|
111
|
+
"launch_specification": launch_specification,
|
|
112
|
+
"status": status,
|
|
113
|
+
"start_time": start_time,
|
|
114
|
+
"end_time": end_time,
|
|
115
|
+
"total_price": total_price,
|
|
116
|
+
"unit_price": unit_price,
|
|
117
|
+
}
|
|
118
|
+
)
|
|
119
|
+
if deactivated_at is not UNSET:
|
|
120
|
+
field_dict["deactivated_at"] = deactivated_at
|
|
121
|
+
if region is not UNSET:
|
|
122
|
+
field_dict["region"] = region
|
|
123
|
+
|
|
124
|
+
return field_dict
|
|
125
|
+
|
|
126
|
+
@classmethod
|
|
127
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
128
|
+
from ..models.launch_specification_model import LaunchSpecificationModel
|
|
129
|
+
|
|
130
|
+
d = dict(src_dict)
|
|
131
|
+
fid = d.pop("fid")
|
|
132
|
+
|
|
133
|
+
name = d.pop("name")
|
|
134
|
+
|
|
135
|
+
project = d.pop("project")
|
|
136
|
+
|
|
137
|
+
created_by = d.pop("created_by")
|
|
138
|
+
|
|
139
|
+
created_at = d.pop("created_at")
|
|
140
|
+
|
|
141
|
+
instance_quantity = d.pop("instance_quantity")
|
|
142
|
+
|
|
143
|
+
instance_type = d.pop("instance_type")
|
|
144
|
+
|
|
145
|
+
instances = cast(list[str], d.pop("instances"))
|
|
146
|
+
|
|
147
|
+
launch_specification = LaunchSpecificationModel.from_dict(
|
|
148
|
+
d.pop("launch_specification")
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
status = ReservationModelStatus(d.pop("status"))
|
|
152
|
+
|
|
153
|
+
start_time = d.pop("start_time")
|
|
154
|
+
|
|
155
|
+
end_time = d.pop("end_time")
|
|
156
|
+
|
|
157
|
+
total_price = d.pop("total_price")
|
|
158
|
+
|
|
159
|
+
unit_price = d.pop("unit_price")
|
|
160
|
+
|
|
161
|
+
def _parse_deactivated_at(data: object) -> None | str | Unset:
|
|
162
|
+
if data is None:
|
|
163
|
+
return data
|
|
164
|
+
if isinstance(data, Unset):
|
|
165
|
+
return data
|
|
166
|
+
return cast(None | str | Unset, data)
|
|
167
|
+
|
|
168
|
+
deactivated_at = _parse_deactivated_at(d.pop("deactivated_at", UNSET))
|
|
169
|
+
|
|
170
|
+
def _parse_region(data: object) -> None | str | Unset:
|
|
171
|
+
if data is None:
|
|
172
|
+
return data
|
|
173
|
+
if isinstance(data, Unset):
|
|
174
|
+
return data
|
|
175
|
+
return cast(None | str | Unset, data)
|
|
176
|
+
|
|
177
|
+
region = _parse_region(d.pop("region", UNSET))
|
|
178
|
+
|
|
179
|
+
reservation_model = cls(
|
|
180
|
+
fid=fid,
|
|
181
|
+
name=name,
|
|
182
|
+
project=project,
|
|
183
|
+
created_by=created_by,
|
|
184
|
+
created_at=created_at,
|
|
185
|
+
instance_quantity=instance_quantity,
|
|
186
|
+
instance_type=instance_type,
|
|
187
|
+
instances=instances,
|
|
188
|
+
launch_specification=launch_specification,
|
|
189
|
+
status=status,
|
|
190
|
+
start_time=start_time,
|
|
191
|
+
end_time=end_time,
|
|
192
|
+
total_price=total_price,
|
|
193
|
+
unit_price=unit_price,
|
|
194
|
+
deactivated_at=deactivated_at,
|
|
195
|
+
region=region,
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
reservation_model.additional_properties = d
|
|
199
|
+
return reservation_model
|
|
200
|
+
|
|
201
|
+
@property
|
|
202
|
+
def additional_keys(self) -> list[str]:
|
|
203
|
+
return list(self.additional_properties.keys())
|
|
204
|
+
|
|
205
|
+
def __getitem__(self, key: str) -> Any:
|
|
206
|
+
return self.additional_properties[key]
|
|
207
|
+
|
|
208
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
209
|
+
self.additional_properties[key] = value
|
|
210
|
+
|
|
211
|
+
def __delitem__(self, key: str) -> None:
|
|
212
|
+
del self.additional_properties[key]
|
|
213
|
+
|
|
214
|
+
def __contains__(self, key: str) -> bool:
|
|
215
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ReservationModelStatus(str, Enum):
|
|
7
|
+
ACTIVE = "Active"
|
|
8
|
+
CANCELED = "Canceled"
|
|
9
|
+
ENDED = "Ended"
|
|
10
|
+
PAUSED = "Paused"
|
|
11
|
+
PENDING = "Pending"
|
|
12
|
+
|
|
13
|
+
def __str__(self) -> str:
|
|
14
|
+
return str(self.value)
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
from ..models.size_unit import SizeUnit
|
|
10
|
+
|
|
11
|
+
T = TypeVar("T", bound="Size")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class Size:
|
|
16
|
+
"""Attributes:
|
|
17
|
+
field_value (int):
|
|
18
|
+
field_unit (SizeUnit):
|
|
19
|
+
"""
|
|
20
|
+
|
|
21
|
+
field_value: int
|
|
22
|
+
field_unit: SizeUnit
|
|
23
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
24
|
+
|
|
25
|
+
def to_dict(self) -> dict[str, Any]:
|
|
26
|
+
field_value = self.field_value
|
|
27
|
+
|
|
28
|
+
field_unit = self.field_unit.value
|
|
29
|
+
|
|
30
|
+
field_dict: dict[str, Any] = {}
|
|
31
|
+
field_dict.update(self.additional_properties)
|
|
32
|
+
field_dict.update(
|
|
33
|
+
{
|
|
34
|
+
"_value": field_value,
|
|
35
|
+
"_unit": field_unit,
|
|
36
|
+
}
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
return field_dict
|
|
40
|
+
|
|
41
|
+
@classmethod
|
|
42
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
43
|
+
d = dict(src_dict)
|
|
44
|
+
field_value = d.pop("_value")
|
|
45
|
+
|
|
46
|
+
field_unit = SizeUnit(d.pop("_unit"))
|
|
47
|
+
|
|
48
|
+
size = cls(
|
|
49
|
+
field_value=field_value,
|
|
50
|
+
field_unit=field_unit,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
size.additional_properties = d
|
|
54
|
+
return size
|
|
55
|
+
|
|
56
|
+
@property
|
|
57
|
+
def additional_keys(self) -> list[str]:
|
|
58
|
+
return list(self.additional_properties.keys())
|
|
59
|
+
|
|
60
|
+
def __getitem__(self, key: str) -> Any:
|
|
61
|
+
return self.additional_properties[key]
|
|
62
|
+
|
|
63
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
64
|
+
self.additional_properties[key] = value
|
|
65
|
+
|
|
66
|
+
def __delitem__(self, key: str) -> None:
|
|
67
|
+
del self.additional_properties[key]
|
|
68
|
+
|
|
69
|
+
def __contains__(self, key: str) -> bool:
|
|
70
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SizeUnit(str, Enum):
|
|
7
|
+
B = "b"
|
|
8
|
+
EB = "eb"
|
|
9
|
+
GB = "gb"
|
|
10
|
+
GIB = "gib"
|
|
11
|
+
KB = "kb"
|
|
12
|
+
MB = "mb"
|
|
13
|
+
PB = "pb"
|
|
14
|
+
TB = "tb"
|
|
15
|
+
TIB = "tib"
|
|
16
|
+
|
|
17
|
+
def __str__(self) -> str:
|
|
18
|
+
return str(self.value)
|
|
@@ -0,0 +1,158 @@
|
|
|
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="TeammateResponse")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class TeammateResponse:
|
|
16
|
+
"""Attributes:
|
|
17
|
+
id (str):
|
|
18
|
+
fid (str):
|
|
19
|
+
project_ids (list[str]):
|
|
20
|
+
user_name (None | str | Unset):
|
|
21
|
+
email (None | str | Unset):
|
|
22
|
+
organization_role (None | str | Unset):
|
|
23
|
+
deactivated_at (None | str | Unset):
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
id: str
|
|
27
|
+
fid: str
|
|
28
|
+
project_ids: list[str]
|
|
29
|
+
user_name: None | str | Unset = UNSET
|
|
30
|
+
email: None | str | Unset = UNSET
|
|
31
|
+
organization_role: None | str | Unset = UNSET
|
|
32
|
+
deactivated_at: None | str | Unset = UNSET
|
|
33
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
34
|
+
|
|
35
|
+
def to_dict(self) -> dict[str, Any]:
|
|
36
|
+
id = self.id
|
|
37
|
+
|
|
38
|
+
fid = self.fid
|
|
39
|
+
|
|
40
|
+
project_ids = self.project_ids
|
|
41
|
+
|
|
42
|
+
user_name: None | str | Unset
|
|
43
|
+
if isinstance(self.user_name, Unset):
|
|
44
|
+
user_name = UNSET
|
|
45
|
+
else:
|
|
46
|
+
user_name = self.user_name
|
|
47
|
+
|
|
48
|
+
email: None | str | Unset
|
|
49
|
+
if isinstance(self.email, Unset):
|
|
50
|
+
email = UNSET
|
|
51
|
+
else:
|
|
52
|
+
email = self.email
|
|
53
|
+
|
|
54
|
+
organization_role: None | str | Unset
|
|
55
|
+
if isinstance(self.organization_role, Unset):
|
|
56
|
+
organization_role = UNSET
|
|
57
|
+
else:
|
|
58
|
+
organization_role = self.organization_role
|
|
59
|
+
|
|
60
|
+
deactivated_at: None | str | Unset
|
|
61
|
+
if isinstance(self.deactivated_at, Unset):
|
|
62
|
+
deactivated_at = UNSET
|
|
63
|
+
else:
|
|
64
|
+
deactivated_at = self.deactivated_at
|
|
65
|
+
|
|
66
|
+
field_dict: dict[str, Any] = {}
|
|
67
|
+
field_dict.update(self.additional_properties)
|
|
68
|
+
field_dict.update(
|
|
69
|
+
{
|
|
70
|
+
"id": id,
|
|
71
|
+
"fid": fid,
|
|
72
|
+
"project_ids": project_ids,
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
if user_name is not UNSET:
|
|
76
|
+
field_dict["user_name"] = user_name
|
|
77
|
+
if email is not UNSET:
|
|
78
|
+
field_dict["email"] = email
|
|
79
|
+
if organization_role is not UNSET:
|
|
80
|
+
field_dict["organization_role"] = organization_role
|
|
81
|
+
if deactivated_at is not UNSET:
|
|
82
|
+
field_dict["deactivated_at"] = deactivated_at
|
|
83
|
+
|
|
84
|
+
return field_dict
|
|
85
|
+
|
|
86
|
+
@classmethod
|
|
87
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
88
|
+
d = dict(src_dict)
|
|
89
|
+
id = d.pop("id")
|
|
90
|
+
|
|
91
|
+
fid = d.pop("fid")
|
|
92
|
+
|
|
93
|
+
project_ids = cast(list[str], d.pop("project_ids"))
|
|
94
|
+
|
|
95
|
+
def _parse_user_name(data: object) -> None | str | Unset:
|
|
96
|
+
if data is None:
|
|
97
|
+
return data
|
|
98
|
+
if isinstance(data, Unset):
|
|
99
|
+
return data
|
|
100
|
+
return cast(None | str | Unset, data)
|
|
101
|
+
|
|
102
|
+
user_name = _parse_user_name(d.pop("user_name", UNSET))
|
|
103
|
+
|
|
104
|
+
def _parse_email(data: object) -> None | str | Unset:
|
|
105
|
+
if data is None:
|
|
106
|
+
return data
|
|
107
|
+
if isinstance(data, Unset):
|
|
108
|
+
return data
|
|
109
|
+
return cast(None | str | Unset, data)
|
|
110
|
+
|
|
111
|
+
email = _parse_email(d.pop("email", UNSET))
|
|
112
|
+
|
|
113
|
+
def _parse_organization_role(data: object) -> None | str | Unset:
|
|
114
|
+
if data is None:
|
|
115
|
+
return data
|
|
116
|
+
if isinstance(data, Unset):
|
|
117
|
+
return data
|
|
118
|
+
return cast(None | str | Unset, data)
|
|
119
|
+
|
|
120
|
+
organization_role = _parse_organization_role(d.pop("organization_role", UNSET))
|
|
121
|
+
|
|
122
|
+
def _parse_deactivated_at(data: object) -> None | str | Unset:
|
|
123
|
+
if data is None:
|
|
124
|
+
return data
|
|
125
|
+
if isinstance(data, Unset):
|
|
126
|
+
return data
|
|
127
|
+
return cast(None | str | Unset, data)
|
|
128
|
+
|
|
129
|
+
deactivated_at = _parse_deactivated_at(d.pop("deactivated_at", UNSET))
|
|
130
|
+
|
|
131
|
+
teammate_response = cls(
|
|
132
|
+
id=id,
|
|
133
|
+
fid=fid,
|
|
134
|
+
project_ids=project_ids,
|
|
135
|
+
user_name=user_name,
|
|
136
|
+
email=email,
|
|
137
|
+
organization_role=organization_role,
|
|
138
|
+
deactivated_at=deactivated_at,
|
|
139
|
+
)
|
|
140
|
+
|
|
141
|
+
teammate_response.additional_properties = d
|
|
142
|
+
return teammate_response
|
|
143
|
+
|
|
144
|
+
@property
|
|
145
|
+
def additional_keys(self) -> list[str]:
|
|
146
|
+
return list(self.additional_properties.keys())
|
|
147
|
+
|
|
148
|
+
def __getitem__(self, key: str) -> Any:
|
|
149
|
+
return self.additional_properties[key]
|
|
150
|
+
|
|
151
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
152
|
+
self.additional_properties[key] = value
|
|
153
|
+
|
|
154
|
+
def __delitem__(self, key: str) -> None:
|
|
155
|
+
del self.additional_properties[key]
|
|
156
|
+
|
|
157
|
+
def __contains__(self, key: str) -> bool:
|
|
158
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,143 @@
|
|
|
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="UpdateBidRequest")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@_attrs_define
|
|
15
|
+
class UpdateBidRequest:
|
|
16
|
+
"""Attributes:
|
|
17
|
+
limit_price (None | str | Unset):
|
|
18
|
+
paused (bool | None | Unset):
|
|
19
|
+
volumes (list[str] | None | Unset):
|
|
20
|
+
memory_gb (int | None | Unset):
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
limit_price: None | str | Unset = UNSET
|
|
24
|
+
paused: bool | None | Unset = UNSET
|
|
25
|
+
volumes: list[str] | None | Unset = UNSET
|
|
26
|
+
memory_gb: int | None | Unset = UNSET
|
|
27
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
28
|
+
|
|
29
|
+
def to_dict(self) -> dict[str, Any]:
|
|
30
|
+
limit_price: None | str | Unset
|
|
31
|
+
if isinstance(self.limit_price, Unset):
|
|
32
|
+
limit_price = UNSET
|
|
33
|
+
else:
|
|
34
|
+
limit_price = self.limit_price
|
|
35
|
+
|
|
36
|
+
paused: bool | None | Unset
|
|
37
|
+
if isinstance(self.paused, Unset):
|
|
38
|
+
paused = UNSET
|
|
39
|
+
else:
|
|
40
|
+
paused = self.paused
|
|
41
|
+
|
|
42
|
+
volumes: list[str] | None | Unset
|
|
43
|
+
if isinstance(self.volumes, Unset):
|
|
44
|
+
volumes = UNSET
|
|
45
|
+
elif isinstance(self.volumes, list):
|
|
46
|
+
volumes = self.volumes
|
|
47
|
+
|
|
48
|
+
else:
|
|
49
|
+
volumes = self.volumes
|
|
50
|
+
|
|
51
|
+
memory_gb: int | None | Unset
|
|
52
|
+
if isinstance(self.memory_gb, Unset):
|
|
53
|
+
memory_gb = UNSET
|
|
54
|
+
else:
|
|
55
|
+
memory_gb = self.memory_gb
|
|
56
|
+
|
|
57
|
+
field_dict: dict[str, Any] = {}
|
|
58
|
+
field_dict.update(self.additional_properties)
|
|
59
|
+
field_dict.update({})
|
|
60
|
+
if limit_price is not UNSET:
|
|
61
|
+
field_dict["limit_price"] = limit_price
|
|
62
|
+
if paused is not UNSET:
|
|
63
|
+
field_dict["paused"] = paused
|
|
64
|
+
if volumes is not UNSET:
|
|
65
|
+
field_dict["volumes"] = volumes
|
|
66
|
+
if memory_gb is not UNSET:
|
|
67
|
+
field_dict["memory_gb"] = memory_gb
|
|
68
|
+
|
|
69
|
+
return field_dict
|
|
70
|
+
|
|
71
|
+
@classmethod
|
|
72
|
+
def from_dict(cls, src_dict: Mapping[str, Any]) -> Self:
|
|
73
|
+
d = dict(src_dict)
|
|
74
|
+
|
|
75
|
+
def _parse_limit_price(data: object) -> None | str | Unset:
|
|
76
|
+
if data is None:
|
|
77
|
+
return data
|
|
78
|
+
if isinstance(data, Unset):
|
|
79
|
+
return data
|
|
80
|
+
return cast(None | str | Unset, data)
|
|
81
|
+
|
|
82
|
+
limit_price = _parse_limit_price(d.pop("limit_price", UNSET))
|
|
83
|
+
|
|
84
|
+
def _parse_paused(data: object) -> bool | None | Unset:
|
|
85
|
+
if data is None:
|
|
86
|
+
return data
|
|
87
|
+
if isinstance(data, Unset):
|
|
88
|
+
return data
|
|
89
|
+
return cast(bool | None | Unset, data)
|
|
90
|
+
|
|
91
|
+
paused = _parse_paused(d.pop("paused", UNSET))
|
|
92
|
+
|
|
93
|
+
def _parse_volumes(data: object) -> list[str] | None | Unset:
|
|
94
|
+
if data is None:
|
|
95
|
+
return data
|
|
96
|
+
if isinstance(data, Unset):
|
|
97
|
+
return data
|
|
98
|
+
try:
|
|
99
|
+
if not isinstance(data, list):
|
|
100
|
+
raise TypeError
|
|
101
|
+
volumes_type_0 = cast(list[str], data)
|
|
102
|
+
|
|
103
|
+
return volumes_type_0
|
|
104
|
+
except (TypeError, ValueError, AttributeError, KeyError):
|
|
105
|
+
pass
|
|
106
|
+
return cast(list[str] | None | Unset, data)
|
|
107
|
+
|
|
108
|
+
volumes = _parse_volumes(d.pop("volumes", UNSET))
|
|
109
|
+
|
|
110
|
+
def _parse_memory_gb(data: object) -> int | None | Unset:
|
|
111
|
+
if data is None:
|
|
112
|
+
return data
|
|
113
|
+
if isinstance(data, Unset):
|
|
114
|
+
return data
|
|
115
|
+
return cast(int | None | Unset, data)
|
|
116
|
+
|
|
117
|
+
memory_gb = _parse_memory_gb(d.pop("memory_gb", UNSET))
|
|
118
|
+
|
|
119
|
+
update_bid_request = cls(
|
|
120
|
+
limit_price=limit_price,
|
|
121
|
+
paused=paused,
|
|
122
|
+
volumes=volumes,
|
|
123
|
+
memory_gb=memory_gb,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
update_bid_request.additional_properties = d
|
|
127
|
+
return update_bid_request
|
|
128
|
+
|
|
129
|
+
@property
|
|
130
|
+
def additional_keys(self) -> list[str]:
|
|
131
|
+
return list(self.additional_properties.keys())
|
|
132
|
+
|
|
133
|
+
def __getitem__(self, key: str) -> Any:
|
|
134
|
+
return self.additional_properties[key]
|
|
135
|
+
|
|
136
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
137
|
+
self.additional_properties[key] = value
|
|
138
|
+
|
|
139
|
+
def __delitem__(self, key: str) -> None:
|
|
140
|
+
del self.additional_properties[key]
|
|
141
|
+
|
|
142
|
+
def __contains__(self, key: str) -> bool:
|
|
143
|
+
return key in self.additional_properties
|