hyperstack 1.42.1a0__py3-none-any.whl → 1.45.2a0__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.
- hyperstack/__init__.py +7 -2
- hyperstack/api/__init__.py +1 -1
- hyperstack/api/clusters_api.py +873 -257
- hyperstack/api/{admin_api.py → vouchers_api.py} +56 -27
- hyperstack/api_client.py +1 -1
- hyperstack/configuration.py +1 -1
- hyperstack/models/__init__.py +5 -0
- hyperstack/models/cluster_fields.py +4 -2
- hyperstack/models/cluster_node_group_fields.py +5 -1
- hyperstack/models/create_cluster_node_group_payload.py +16 -3
- hyperstack/models/delete_cluster_nodes_fields.py +87 -0
- hyperstack/models/redeem_voucher_payload.py +87 -0
- hyperstack/models/update_cluster_node_group_payload.py +90 -0
- hyperstack/models/voucher.py +91 -0
- hyperstack/models/voucher_redeem_response_schema.py +95 -0
- {hyperstack-1.42.1a0.dist-info → hyperstack-1.45.2a0.dist-info}/METADATA +1 -1
- {hyperstack-1.42.1a0.dist-info → hyperstack-1.45.2a0.dist-info}/RECORD +19 -14
- {hyperstack-1.42.1a0.dist-info → hyperstack-1.45.2a0.dist-info}/WHEEL +0 -0
- {hyperstack-1.42.1a0.dist-info → hyperstack-1.45.2a0.dist-info}/top_level.txt +0 -0
|
@@ -16,14 +16,15 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
|
18
18
|
|
|
19
|
-
from ..models.
|
|
19
|
+
from ..models.redeem_voucher_payload import RedeemVoucherPayload
|
|
20
|
+
from ..models.voucher_redeem_response_schema import VoucherRedeemResponseSchema
|
|
20
21
|
|
|
21
22
|
from ..api_client import ApiClient, RequestSerialized
|
|
22
23
|
from ..api_response import ApiResponse
|
|
23
24
|
from ..rest import RESTResponseType
|
|
24
25
|
|
|
25
26
|
|
|
26
|
-
class
|
|
27
|
+
class VouchersApi:
|
|
27
28
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
28
29
|
Ref: https://openapi-generator.tech
|
|
29
30
|
|
|
@@ -37,8 +38,9 @@ class AdminApi:
|
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
@validate_call
|
|
40
|
-
def
|
|
41
|
+
def redeem_a_voucher(
|
|
41
42
|
self,
|
|
43
|
+
payload: RedeemVoucherPayload,
|
|
42
44
|
_request_timeout: Union[
|
|
43
45
|
None,
|
|
44
46
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -51,11 +53,13 @@ class AdminApi:
|
|
|
51
53
|
_content_type: Optional[StrictStr] = None,
|
|
52
54
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
53
55
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
54
|
-
) ->
|
|
55
|
-
"""
|
|
56
|
+
) -> VoucherRedeemResponseSchema:
|
|
57
|
+
"""Redeem a voucher with a voucher_code
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
Request to redeem a voucher with a voucher code.
|
|
58
60
|
|
|
61
|
+
:param payload: (required)
|
|
62
|
+
:type payload: RedeemVoucherPayload
|
|
59
63
|
:param _request_timeout: timeout setting for this request. If one
|
|
60
64
|
number provided, it will be total request
|
|
61
65
|
timeout. It can also be a pair (tuple) of
|
|
@@ -78,7 +82,8 @@ class AdminApi:
|
|
|
78
82
|
:return: Returns the result object.
|
|
79
83
|
""" # noqa: E501
|
|
80
84
|
|
|
81
|
-
_param = self.
|
|
85
|
+
_param = self._redeem_a_voucher_serialize(
|
|
86
|
+
payload=payload,
|
|
82
87
|
_request_auth=_request_auth,
|
|
83
88
|
_content_type=_content_type,
|
|
84
89
|
_headers=_headers,
|
|
@@ -86,12 +91,12 @@ class AdminApi:
|
|
|
86
91
|
)
|
|
87
92
|
|
|
88
93
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
89
|
-
'200': "
|
|
94
|
+
'200': "VoucherRedeemResponseSchema",
|
|
90
95
|
'400': "ErrorResponseModel",
|
|
91
96
|
'401': "ErrorResponseModel",
|
|
97
|
+
'403': "ErrorResponseModel",
|
|
92
98
|
'404': "ErrorResponseModel",
|
|
93
|
-
'
|
|
94
|
-
'500': "ErrorResponseModel",
|
|
99
|
+
'500': None,
|
|
95
100
|
}
|
|
96
101
|
response_data = self.api_client.call_api(
|
|
97
102
|
*_param,
|
|
@@ -105,8 +110,9 @@ class AdminApi:
|
|
|
105
110
|
|
|
106
111
|
|
|
107
112
|
@validate_call
|
|
108
|
-
def
|
|
113
|
+
def redeem_a_voucher_with_http_info(
|
|
109
114
|
self,
|
|
115
|
+
payload: RedeemVoucherPayload,
|
|
110
116
|
_request_timeout: Union[
|
|
111
117
|
None,
|
|
112
118
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -119,11 +125,13 @@ class AdminApi:
|
|
|
119
125
|
_content_type: Optional[StrictStr] = None,
|
|
120
126
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
121
127
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
122
|
-
) -> ApiResponse[
|
|
123
|
-
"""
|
|
128
|
+
) -> ApiResponse[VoucherRedeemResponseSchema]:
|
|
129
|
+
"""Redeem a voucher with a voucher_code
|
|
124
130
|
|
|
125
|
-
|
|
131
|
+
Request to redeem a voucher with a voucher code.
|
|
126
132
|
|
|
133
|
+
:param payload: (required)
|
|
134
|
+
:type payload: RedeemVoucherPayload
|
|
127
135
|
:param _request_timeout: timeout setting for this request. If one
|
|
128
136
|
number provided, it will be total request
|
|
129
137
|
timeout. It can also be a pair (tuple) of
|
|
@@ -146,7 +154,8 @@ class AdminApi:
|
|
|
146
154
|
:return: Returns the result object.
|
|
147
155
|
""" # noqa: E501
|
|
148
156
|
|
|
149
|
-
_param = self.
|
|
157
|
+
_param = self._redeem_a_voucher_serialize(
|
|
158
|
+
payload=payload,
|
|
150
159
|
_request_auth=_request_auth,
|
|
151
160
|
_content_type=_content_type,
|
|
152
161
|
_headers=_headers,
|
|
@@ -154,12 +163,12 @@ class AdminApi:
|
|
|
154
163
|
)
|
|
155
164
|
|
|
156
165
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
157
|
-
'200': "
|
|
166
|
+
'200': "VoucherRedeemResponseSchema",
|
|
158
167
|
'400': "ErrorResponseModel",
|
|
159
168
|
'401': "ErrorResponseModel",
|
|
169
|
+
'403': "ErrorResponseModel",
|
|
160
170
|
'404': "ErrorResponseModel",
|
|
161
|
-
'
|
|
162
|
-
'500': "ErrorResponseModel",
|
|
171
|
+
'500': None,
|
|
163
172
|
}
|
|
164
173
|
response_data = self.api_client.call_api(
|
|
165
174
|
*_param,
|
|
@@ -173,8 +182,9 @@ class AdminApi:
|
|
|
173
182
|
|
|
174
183
|
|
|
175
184
|
@validate_call
|
|
176
|
-
def
|
|
185
|
+
def redeem_a_voucher_without_preload_content(
|
|
177
186
|
self,
|
|
187
|
+
payload: RedeemVoucherPayload,
|
|
178
188
|
_request_timeout: Union[
|
|
179
189
|
None,
|
|
180
190
|
Annotated[StrictFloat, Field(gt=0)],
|
|
@@ -188,10 +198,12 @@ class AdminApi:
|
|
|
188
198
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
189
199
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
190
200
|
) -> RESTResponseType:
|
|
191
|
-
"""
|
|
201
|
+
"""Redeem a voucher with a voucher_code
|
|
192
202
|
|
|
193
|
-
|
|
203
|
+
Request to redeem a voucher with a voucher code.
|
|
194
204
|
|
|
205
|
+
:param payload: (required)
|
|
206
|
+
:type payload: RedeemVoucherPayload
|
|
195
207
|
:param _request_timeout: timeout setting for this request. If one
|
|
196
208
|
number provided, it will be total request
|
|
197
209
|
timeout. It can also be a pair (tuple) of
|
|
@@ -214,7 +226,8 @@ class AdminApi:
|
|
|
214
226
|
:return: Returns the result object.
|
|
215
227
|
""" # noqa: E501
|
|
216
228
|
|
|
217
|
-
_param = self.
|
|
229
|
+
_param = self._redeem_a_voucher_serialize(
|
|
230
|
+
payload=payload,
|
|
218
231
|
_request_auth=_request_auth,
|
|
219
232
|
_content_type=_content_type,
|
|
220
233
|
_headers=_headers,
|
|
@@ -222,12 +235,12 @@ class AdminApi:
|
|
|
222
235
|
)
|
|
223
236
|
|
|
224
237
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
225
|
-
'200': "
|
|
238
|
+
'200': "VoucherRedeemResponseSchema",
|
|
226
239
|
'400': "ErrorResponseModel",
|
|
227
240
|
'401': "ErrorResponseModel",
|
|
241
|
+
'403': "ErrorResponseModel",
|
|
228
242
|
'404': "ErrorResponseModel",
|
|
229
|
-
'
|
|
230
|
-
'500': "ErrorResponseModel",
|
|
243
|
+
'500': None,
|
|
231
244
|
}
|
|
232
245
|
response_data = self.api_client.call_api(
|
|
233
246
|
*_param,
|
|
@@ -236,8 +249,9 @@ class AdminApi:
|
|
|
236
249
|
return response_data.response
|
|
237
250
|
|
|
238
251
|
|
|
239
|
-
def
|
|
252
|
+
def _redeem_a_voucher_serialize(
|
|
240
253
|
self,
|
|
254
|
+
payload,
|
|
241
255
|
_request_auth,
|
|
242
256
|
_content_type,
|
|
243
257
|
_headers,
|
|
@@ -263,6 +277,8 @@ class AdminApi:
|
|
|
263
277
|
# process the header parameters
|
|
264
278
|
# process the form parameters
|
|
265
279
|
# process the body parameter
|
|
280
|
+
if payload is not None:
|
|
281
|
+
_body_params = payload
|
|
266
282
|
|
|
267
283
|
|
|
268
284
|
# set the HTTP header `Accept`
|
|
@@ -273,6 +289,19 @@ class AdminApi:
|
|
|
273
289
|
]
|
|
274
290
|
)
|
|
275
291
|
|
|
292
|
+
# set the HTTP header `Content-Type`
|
|
293
|
+
if _content_type:
|
|
294
|
+
_header_params['Content-Type'] = _content_type
|
|
295
|
+
else:
|
|
296
|
+
_default_content_type = (
|
|
297
|
+
self.api_client.select_header_content_type(
|
|
298
|
+
[
|
|
299
|
+
'application/json'
|
|
300
|
+
]
|
|
301
|
+
)
|
|
302
|
+
)
|
|
303
|
+
if _default_content_type is not None:
|
|
304
|
+
_header_params['Content-Type'] = _default_content_type
|
|
276
305
|
|
|
277
306
|
# authentication setting
|
|
278
307
|
_auth_settings: List[str] = [
|
|
@@ -281,7 +310,7 @@ class AdminApi:
|
|
|
281
310
|
|
|
282
311
|
return self.api_client.param_serialize(
|
|
283
312
|
method='POST',
|
|
284
|
-
resource_path='/
|
|
313
|
+
resource_path='/billing/billing/vouchers/redeem',
|
|
285
314
|
path_params=_path_params,
|
|
286
315
|
query_params=_query_params,
|
|
287
316
|
header_params=_header_params,
|
hyperstack/api_client.py
CHANGED
|
@@ -90,7 +90,7 @@ class ApiClient:
|
|
|
90
90
|
self.default_headers[header_name] = header_value
|
|
91
91
|
self.cookie = cookie
|
|
92
92
|
# Set default User-Agent.
|
|
93
|
-
self.user_agent = 'OpenAPI-Generator/v1.
|
|
93
|
+
self.user_agent = 'OpenAPI-Generator/v1.45.2-alpha/python'
|
|
94
94
|
self.client_side_validation = configuration.client_side_validation
|
|
95
95
|
|
|
96
96
|
def __enter__(self):
|
hyperstack/configuration.py
CHANGED
|
@@ -524,7 +524,7 @@ conf = hyperstack.Configuration(
|
|
|
524
524
|
"OS: {env}\n"\
|
|
525
525
|
"Python Version: {pyversion}\n"\
|
|
526
526
|
"Version of the API: 1.0\n"\
|
|
527
|
-
"SDK Package Version: v1.
|
|
527
|
+
"SDK Package Version: v1.45.2-alpha".\
|
|
528
528
|
format(env=sys.platform, pyversion=sys.version)
|
|
529
529
|
|
|
530
530
|
def get_host_settings(self) -> List[HostSetting]:
|
hyperstack/models/__init__.py
CHANGED
|
@@ -93,6 +93,7 @@ from .customer_contract_detail_response_model import CustomerContractDetailRespo
|
|
|
93
93
|
from .customer_contract_fields import CustomerContractFields
|
|
94
94
|
from .dashboard_info_response import DashboardInfoResponse
|
|
95
95
|
from .data_synthesis_billing_history_details_response_schema import DataSynthesisBillingHistoryDetailsResponseSchema
|
|
96
|
+
from .delete_cluster_nodes_fields import DeleteClusterNodesFields
|
|
96
97
|
from .deployment_fields import DeploymentFields
|
|
97
98
|
from .deployment_fields_for_start_deployments import DeploymentFieldsForStartDeployments
|
|
98
99
|
from .deployments import Deployments
|
|
@@ -209,6 +210,7 @@ from .rbac_role_detail_response_model import RbacRoleDetailResponseModel
|
|
|
209
210
|
from .rbac_role_detail_response_model_fixed import RbacRoleDetailResponseModelFixed
|
|
210
211
|
from .rbac_role_field import RbacRoleField
|
|
211
212
|
from .rbac_role_fields import RbacRoleFields
|
|
213
|
+
from .redeem_voucher_payload import RedeemVoucherPayload
|
|
212
214
|
from .region_fields import RegionFields
|
|
213
215
|
from .regions import Regions
|
|
214
216
|
from .remove_member_from_organization_response_model import RemoveMemberFromOrganizationResponseModel
|
|
@@ -278,6 +280,7 @@ from .template_fields import TemplateFields
|
|
|
278
280
|
from .templates import Templates
|
|
279
281
|
from .token_based_billing_history_response import TokenBasedBillingHistoryResponse
|
|
280
282
|
from .uris import URIs
|
|
283
|
+
from .update_cluster_node_group_payload import UpdateClusterNodeGroupPayload
|
|
281
284
|
from .update_environment import UpdateEnvironment
|
|
282
285
|
from .update_keypair_name import UpdateKeypairName
|
|
283
286
|
from .update_keypair_name_response import UpdateKeypairNameResponse
|
|
@@ -304,4 +307,6 @@ from .volume_overview_fields import VolumeOverviewFields
|
|
|
304
307
|
from .volume_types import VolumeTypes
|
|
305
308
|
from .volumes import Volumes
|
|
306
309
|
from .volumes_fields import VolumesFields
|
|
310
|
+
from .voucher import Voucher
|
|
311
|
+
from .voucher_redeem_response_schema import VoucherRedeemResponseSchema
|
|
307
312
|
from .workload_billing_history_response import WorkloadBillingHistoryResponse
|
|
@@ -18,7 +18,7 @@ import re # noqa: F401
|
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
20
|
from datetime import datetime
|
|
21
|
-
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
23
|
from ..models.cluster_flavor_fields import ClusterFlavorFields
|
|
24
24
|
from ..models.cluster_node_fields import ClusterNodeFields
|
|
@@ -34,6 +34,7 @@ class ClusterFields(BaseModel):
|
|
|
34
34
|
created_at: Optional[datetime] = None
|
|
35
35
|
environment_name: Optional[StrictStr] = None
|
|
36
36
|
id: Optional[StrictInt] = None
|
|
37
|
+
is_reconciling: Optional[StrictBool] = None
|
|
37
38
|
keypair_name: Optional[StrictStr] = None
|
|
38
39
|
kube_config: Optional[StrictStr] = None
|
|
39
40
|
kubernetes_version: Optional[StrictStr] = None
|
|
@@ -43,7 +44,7 @@ class ClusterFields(BaseModel):
|
|
|
43
44
|
nodes: Optional[List[ClusterNodeFields]] = None
|
|
44
45
|
status: Optional[StrictStr] = None
|
|
45
46
|
status_reason: Optional[StrictStr] = None
|
|
46
|
-
__properties: ClassVar[List[str]] = ["api_address", "created_at", "environment_name", "id", "keypair_name", "kube_config", "kubernetes_version", "master_flavor", "name", "node_groups", "nodes", "status", "status_reason"]
|
|
47
|
+
__properties: ClassVar[List[str]] = ["api_address", "created_at", "environment_name", "id", "is_reconciling", "keypair_name", "kube_config", "kubernetes_version", "master_flavor", "name", "node_groups", "nodes", "status", "status_reason"]
|
|
47
48
|
|
|
48
49
|
model_config = ConfigDict(
|
|
49
50
|
populate_by_name=True,
|
|
@@ -117,6 +118,7 @@ class ClusterFields(BaseModel):
|
|
|
117
118
|
"created_at": obj.get("created_at"),
|
|
118
119
|
"environment_name": obj.get("environment_name"),
|
|
119
120
|
"id": obj.get("id"),
|
|
121
|
+
"is_reconciling": obj.get("is_reconciling"),
|
|
120
122
|
"keypair_name": obj.get("keypair_name"),
|
|
121
123
|
"kube_config": obj.get("kube_config"),
|
|
122
124
|
"kubernetes_version": obj.get("kubernetes_version"),
|
|
@@ -32,10 +32,12 @@ class ClusterNodeGroupFields(BaseModel):
|
|
|
32
32
|
created_at: Optional[datetime] = None
|
|
33
33
|
flavor: Optional[ClusterFlavorFields] = None
|
|
34
34
|
id: Optional[StrictInt] = None
|
|
35
|
+
max_count: Optional[StrictInt] = None
|
|
36
|
+
min_count: Optional[StrictInt] = None
|
|
35
37
|
name: Optional[StrictStr] = None
|
|
36
38
|
role: Optional[StrictStr] = None
|
|
37
39
|
updated_at: Optional[datetime] = None
|
|
38
|
-
__properties: ClassVar[List[str]] = ["count", "created_at", "flavor", "id", "name", "role", "updated_at"]
|
|
40
|
+
__properties: ClassVar[List[str]] = ["count", "created_at", "flavor", "id", "max_count", "min_count", "name", "role", "updated_at"]
|
|
39
41
|
|
|
40
42
|
model_config = ConfigDict(
|
|
41
43
|
populate_by_name=True,
|
|
@@ -95,6 +97,8 @@ class ClusterNodeGroupFields(BaseModel):
|
|
|
95
97
|
"created_at": obj.get("created_at"),
|
|
96
98
|
"flavor": ClusterFlavorFields.from_dict(obj["flavor"]) if obj.get("flavor") is not None else None,
|
|
97
99
|
"id": obj.get("id"),
|
|
100
|
+
"max_count": obj.get("max_count"),
|
|
101
|
+
"min_count": obj.get("min_count"),
|
|
98
102
|
"name": obj.get("name"),
|
|
99
103
|
"role": obj.get("role"),
|
|
100
104
|
"updated_at": obj.get("updated_at")
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
22
|
from typing_extensions import Annotated
|
|
23
23
|
from typing import Optional, Set
|
|
@@ -29,8 +29,18 @@ class CreateClusterNodeGroupPayload(BaseModel):
|
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
count: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
31
31
|
flavor_name: StrictStr
|
|
32
|
+
max_count: Optional[Annotated[int, Field(le=20, strict=True)]] = None
|
|
33
|
+
min_count: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
32
34
|
name: Annotated[str, Field(strict=True, max_length=20)]
|
|
33
|
-
|
|
35
|
+
role: StrictStr
|
|
36
|
+
__properties: ClassVar[List[str]] = ["count", "flavor_name", "max_count", "min_count", "name", "role"]
|
|
37
|
+
|
|
38
|
+
@field_validator('role')
|
|
39
|
+
def role_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value not in set(['worker']):
|
|
42
|
+
raise ValueError("must be one of enum values ('worker')")
|
|
43
|
+
return value
|
|
34
44
|
|
|
35
45
|
model_config = ConfigDict(
|
|
36
46
|
populate_by_name=True,
|
|
@@ -85,7 +95,10 @@ class CreateClusterNodeGroupPayload(BaseModel):
|
|
|
85
95
|
_obj = cls.model_validate({
|
|
86
96
|
"count": obj.get("count"),
|
|
87
97
|
"flavor_name": obj.get("flavor_name"),
|
|
88
|
-
"
|
|
98
|
+
"max_count": obj.get("max_count"),
|
|
99
|
+
"min_count": obj.get("min_count"),
|
|
100
|
+
"name": obj.get("name"),
|
|
101
|
+
"role": obj.get("role") if obj.get("role") is not None else 'worker'
|
|
89
102
|
})
|
|
90
103
|
return _obj
|
|
91
104
|
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Infrahub-API
|
|
5
|
+
|
|
6
|
+
Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources. Access this SDK to automate the deployment of your workloads and streamline your infrastructure management. To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class DeleteClusterNodesFields(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
DeleteClusterNodesFields
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
ids: Optional[List[StrictInt]] = None
|
|
30
|
+
__properties: ClassVar[List[str]] = ["ids"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of DeleteClusterNodesFields from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of DeleteClusterNodesFields from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"ids": obj.get("ids")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Infrahub-API
|
|
5
|
+
|
|
6
|
+
Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources. Access this SDK to automate the deployment of your workloads and streamline your infrastructure management. To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class RedeemVoucherPayload(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
RedeemVoucherPayload
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
voucher_code: StrictStr = Field(description="The code of the voucher you want to redeem.")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["voucher_code"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of RedeemVoucherPayload from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of RedeemVoucherPayload from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"voucher_code": obj.get("voucher_code")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Infrahub-API
|
|
5
|
+
|
|
6
|
+
Leverage the Infrahub API and Hyperstack platform to easily create, manage, and scale powerful GPU virtual machines and their associated resources. Access this SDK to automate the deployment of your workloads and streamline your infrastructure management. To contribute, please raise an issue with a bug report, feature request, feedback, or general inquiry.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 1.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class UpdateClusterNodeGroupPayload(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
UpdateClusterNodeGroupPayload
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
max_count: Optional[Annotated[int, Field(le=20, strict=True)]] = None
|
|
31
|
+
min_count: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
32
|
+
__properties: ClassVar[List[str]] = ["max_count", "min_count"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""Returns the JSON representation of the model using alias"""
|
|
47
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
48
|
+
return json.dumps(self.to_dict())
|
|
49
|
+
|
|
50
|
+
@classmethod
|
|
51
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
52
|
+
"""Create an instance of UpdateClusterNodeGroupPayload from a JSON string"""
|
|
53
|
+
return cls.from_dict(json.loads(json_str))
|
|
54
|
+
|
|
55
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
56
|
+
"""Return the dictionary representation of the model using alias.
|
|
57
|
+
|
|
58
|
+
This has the following differences from calling pydantic's
|
|
59
|
+
`self.model_dump(by_alias=True)`:
|
|
60
|
+
|
|
61
|
+
* `None` is only added to the output dict for nullable fields that
|
|
62
|
+
were set at model initialization. Other fields with value `None`
|
|
63
|
+
are ignored.
|
|
64
|
+
"""
|
|
65
|
+
excluded_fields: Set[str] = set([
|
|
66
|
+
])
|
|
67
|
+
|
|
68
|
+
_dict = self.model_dump(
|
|
69
|
+
by_alias=True,
|
|
70
|
+
exclude=excluded_fields,
|
|
71
|
+
exclude_none=True,
|
|
72
|
+
)
|
|
73
|
+
return _dict
|
|
74
|
+
|
|
75
|
+
@classmethod
|
|
76
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
77
|
+
"""Create an instance of UpdateClusterNodeGroupPayload from a dict"""
|
|
78
|
+
if obj is None:
|
|
79
|
+
return None
|
|
80
|
+
|
|
81
|
+
if not isinstance(obj, dict):
|
|
82
|
+
return cls.model_validate(obj)
|
|
83
|
+
|
|
84
|
+
_obj = cls.model_validate({
|
|
85
|
+
"max_count": obj.get("max_count"),
|
|
86
|
+
"min_count": obj.get("min_count")
|
|
87
|
+
})
|
|
88
|
+
return _obj
|
|
89
|
+
|
|
90
|
+
|