hyperstack 1.43.0a0__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 +6 -2
- hyperstack/api/__init__.py +1 -1
- hyperstack/api/clusters_api.py +299 -0
- 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 +4 -0
- hyperstack/models/delete_cluster_nodes_fields.py +87 -0
- hyperstack/models/redeem_voucher_payload.py +87 -0
- hyperstack/models/voucher.py +91 -0
- hyperstack/models/voucher_redeem_response_schema.py +95 -0
- {hyperstack-1.43.0a0.dist-info → hyperstack-1.45.2a0.dist-info}/METADATA +1 -1
- {hyperstack-1.43.0a0.dist-info → hyperstack-1.45.2a0.dist-info}/RECORD +15 -11
- {hyperstack-1.43.0a0.dist-info → hyperstack-1.45.2a0.dist-info}/WHEEL +0 -0
- {hyperstack-1.43.0a0.dist-info → hyperstack-1.45.2a0.dist-info}/top_level.txt +0 -0
hyperstack/__init__.py
CHANGED
|
@@ -14,14 +14,13 @@
|
|
|
14
14
|
""" # noqa: E501
|
|
15
15
|
|
|
16
16
|
|
|
17
|
-
__version__ = "v1.
|
|
17
|
+
__version__ = "v1.45.2-alpha"
|
|
18
18
|
|
|
19
19
|
# import apis into sdk package
|
|
20
20
|
from .api.calculate_api import CalculateApi
|
|
21
21
|
from .api.customer_contract_api import CustomerContractApi
|
|
22
22
|
from .api.pricebook_api import PricebookApi
|
|
23
23
|
from .api.snapshots_api import SnapshotsApi
|
|
24
|
-
from .api.admin_api import AdminApi
|
|
25
24
|
from .api.alive_api import AliveApi
|
|
26
25
|
from .api.api_key_api import ApiKeyApi
|
|
27
26
|
from .api.assigning_member_role_api import AssigningMemberRoleApi
|
|
@@ -64,6 +63,7 @@ from .api.virtual_machine_events_api import VirtualMachineEventsApi
|
|
|
64
63
|
from .api.vnc_url_api import VncUrlApi
|
|
65
64
|
from .api.volume_api import VolumeApi
|
|
66
65
|
from .api.volume_attachment_api import VolumeAttachmentApi
|
|
66
|
+
from .api.vouchers_api import VouchersApi
|
|
67
67
|
|
|
68
68
|
# import ApiClient
|
|
69
69
|
from .api_response import ApiResponse
|
|
@@ -156,6 +156,7 @@ from .models.customer_contract_detail_response_model import CustomerContractDeta
|
|
|
156
156
|
from .models.customer_contract_fields import CustomerContractFields
|
|
157
157
|
from .models.dashboard_info_response import DashboardInfoResponse
|
|
158
158
|
from .models.data_synthesis_billing_history_details_response_schema import DataSynthesisBillingHistoryDetailsResponseSchema
|
|
159
|
+
from .models.delete_cluster_nodes_fields import DeleteClusterNodesFields
|
|
159
160
|
from .models.deployment_fields import DeploymentFields
|
|
160
161
|
from .models.deployment_fields_for_start_deployments import DeploymentFieldsForStartDeployments
|
|
161
162
|
from .models.deployments import Deployments
|
|
@@ -272,6 +273,7 @@ from .models.rbac_role_detail_response_model import RbacRoleDetailResponseModel
|
|
|
272
273
|
from .models.rbac_role_detail_response_model_fixed import RbacRoleDetailResponseModelFixed
|
|
273
274
|
from .models.rbac_role_field import RbacRoleField
|
|
274
275
|
from .models.rbac_role_fields import RbacRoleFields
|
|
276
|
+
from .models.redeem_voucher_payload import RedeemVoucherPayload
|
|
275
277
|
from .models.region_fields import RegionFields
|
|
276
278
|
from .models.regions import Regions
|
|
277
279
|
from .models.remove_member_from_organization_response_model import RemoveMemberFromOrganizationResponseModel
|
|
@@ -368,4 +370,6 @@ from .models.volume_overview_fields import VolumeOverviewFields
|
|
|
368
370
|
from .models.volume_types import VolumeTypes
|
|
369
371
|
from .models.volumes import Volumes
|
|
370
372
|
from .models.volumes_fields import VolumesFields
|
|
373
|
+
from .models.voucher import Voucher
|
|
374
|
+
from .models.voucher_redeem_response_schema import VoucherRedeemResponseSchema
|
|
371
375
|
from .models.workload_billing_history_response import WorkloadBillingHistoryResponse
|
hyperstack/api/__init__.py
CHANGED
|
@@ -5,7 +5,6 @@ from .calculate_api import CalculateApi
|
|
|
5
5
|
from .customer_contract_api import CustomerContractApi
|
|
6
6
|
from .pricebook_api import PricebookApi
|
|
7
7
|
from .snapshots_api import SnapshotsApi
|
|
8
|
-
from .admin_api import AdminApi
|
|
9
8
|
from .alive_api import AliveApi
|
|
10
9
|
from .api_key_api import ApiKeyApi
|
|
11
10
|
from .assigning_member_role_api import AssigningMemberRoleApi
|
|
@@ -48,4 +47,5 @@ from .virtual_machine_events_api import VirtualMachineEventsApi
|
|
|
48
47
|
from .vnc_url_api import VncUrlApi
|
|
49
48
|
from .volume_api import VolumeApi
|
|
50
49
|
from .volume_attachment_api import VolumeAttachmentApi
|
|
50
|
+
from .vouchers_api import VouchersApi
|
|
51
51
|
|
hyperstack/api/clusters_api.py
CHANGED
|
@@ -29,6 +29,7 @@ from ..models.cluster_versions import ClusterVersions
|
|
|
29
29
|
from ..models.create_cluster_node_fields import CreateClusterNodeFields
|
|
30
30
|
from ..models.create_cluster_node_group_payload import CreateClusterNodeGroupPayload
|
|
31
31
|
from ..models.create_cluster_payload import CreateClusterPayload
|
|
32
|
+
from ..models.delete_cluster_nodes_fields import DeleteClusterNodesFields
|
|
32
33
|
from ..models.manual_reconciliation_model import ManualReconciliationModel
|
|
33
34
|
from ..models.master_flavors_response import MasterFlavorsResponse
|
|
34
35
|
from ..models.name_available_model import NameAvailableModel
|
|
@@ -2057,6 +2058,304 @@ class ClustersApi:
|
|
|
2057
2058
|
|
|
2058
2059
|
|
|
2059
2060
|
|
|
2061
|
+
@validate_call
|
|
2062
|
+
def delete_cluster_nodes(
|
|
2063
|
+
self,
|
|
2064
|
+
cluster_id: StrictInt,
|
|
2065
|
+
payload: DeleteClusterNodesFields,
|
|
2066
|
+
_request_timeout: Union[
|
|
2067
|
+
None,
|
|
2068
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2069
|
+
Tuple[
|
|
2070
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2071
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2072
|
+
]
|
|
2073
|
+
] = None,
|
|
2074
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2075
|
+
_content_type: Optional[StrictStr] = None,
|
|
2076
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2077
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2078
|
+
) -> ResponseModel:
|
|
2079
|
+
"""Delete Multiple Cluster Nodes
|
|
2080
|
+
|
|
2081
|
+
|
|
2082
|
+
:param cluster_id: (required)
|
|
2083
|
+
:type cluster_id: int
|
|
2084
|
+
:param payload: (required)
|
|
2085
|
+
:type payload: DeleteClusterNodesFields
|
|
2086
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2087
|
+
number provided, it will be total request
|
|
2088
|
+
timeout. It can also be a pair (tuple) of
|
|
2089
|
+
(connection, read) timeouts.
|
|
2090
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2091
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2092
|
+
request; this effectively ignores the
|
|
2093
|
+
authentication in the spec for a single request.
|
|
2094
|
+
:type _request_auth: dict, optional
|
|
2095
|
+
:param _content_type: force content-type for the request.
|
|
2096
|
+
:type _content_type: str, Optional
|
|
2097
|
+
:param _headers: set to override the headers for a single
|
|
2098
|
+
request; this effectively ignores the headers
|
|
2099
|
+
in the spec for a single request.
|
|
2100
|
+
:type _headers: dict, optional
|
|
2101
|
+
:param _host_index: set to override the host_index for a single
|
|
2102
|
+
request; this effectively ignores the host_index
|
|
2103
|
+
in the spec for a single request.
|
|
2104
|
+
:type _host_index: int, optional
|
|
2105
|
+
:return: Returns the result object.
|
|
2106
|
+
""" # noqa: E501
|
|
2107
|
+
|
|
2108
|
+
_param = self._delete_cluster_nodes_serialize(
|
|
2109
|
+
cluster_id=cluster_id,
|
|
2110
|
+
payload=payload,
|
|
2111
|
+
_request_auth=_request_auth,
|
|
2112
|
+
_content_type=_content_type,
|
|
2113
|
+
_headers=_headers,
|
|
2114
|
+
_host_index=_host_index
|
|
2115
|
+
)
|
|
2116
|
+
|
|
2117
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2118
|
+
'200': "ResponseModel",
|
|
2119
|
+
'400': "ErrorResponseModel",
|
|
2120
|
+
'401': "ErrorResponseModel",
|
|
2121
|
+
'404': "ErrorResponseModel",
|
|
2122
|
+
'500': None,
|
|
2123
|
+
}
|
|
2124
|
+
response_data = self.api_client.call_api(
|
|
2125
|
+
*_param,
|
|
2126
|
+
_request_timeout=_request_timeout
|
|
2127
|
+
)
|
|
2128
|
+
response_data.read()
|
|
2129
|
+
return self.api_client.response_deserialize(
|
|
2130
|
+
response_data=response_data,
|
|
2131
|
+
response_types_map=_response_types_map,
|
|
2132
|
+
).data
|
|
2133
|
+
|
|
2134
|
+
|
|
2135
|
+
@validate_call
|
|
2136
|
+
def delete_cluster_nodes_with_http_info(
|
|
2137
|
+
self,
|
|
2138
|
+
cluster_id: StrictInt,
|
|
2139
|
+
payload: DeleteClusterNodesFields,
|
|
2140
|
+
_request_timeout: Union[
|
|
2141
|
+
None,
|
|
2142
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2143
|
+
Tuple[
|
|
2144
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2145
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2146
|
+
]
|
|
2147
|
+
] = None,
|
|
2148
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2149
|
+
_content_type: Optional[StrictStr] = None,
|
|
2150
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2151
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2152
|
+
) -> ApiResponse[ResponseModel]:
|
|
2153
|
+
"""Delete Multiple Cluster Nodes
|
|
2154
|
+
|
|
2155
|
+
|
|
2156
|
+
:param cluster_id: (required)
|
|
2157
|
+
:type cluster_id: int
|
|
2158
|
+
:param payload: (required)
|
|
2159
|
+
:type payload: DeleteClusterNodesFields
|
|
2160
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2161
|
+
number provided, it will be total request
|
|
2162
|
+
timeout. It can also be a pair (tuple) of
|
|
2163
|
+
(connection, read) timeouts.
|
|
2164
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2165
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2166
|
+
request; this effectively ignores the
|
|
2167
|
+
authentication in the spec for a single request.
|
|
2168
|
+
:type _request_auth: dict, optional
|
|
2169
|
+
:param _content_type: force content-type for the request.
|
|
2170
|
+
:type _content_type: str, Optional
|
|
2171
|
+
:param _headers: set to override the headers for a single
|
|
2172
|
+
request; this effectively ignores the headers
|
|
2173
|
+
in the spec for a single request.
|
|
2174
|
+
:type _headers: dict, optional
|
|
2175
|
+
:param _host_index: set to override the host_index for a single
|
|
2176
|
+
request; this effectively ignores the host_index
|
|
2177
|
+
in the spec for a single request.
|
|
2178
|
+
:type _host_index: int, optional
|
|
2179
|
+
:return: Returns the result object.
|
|
2180
|
+
""" # noqa: E501
|
|
2181
|
+
|
|
2182
|
+
_param = self._delete_cluster_nodes_serialize(
|
|
2183
|
+
cluster_id=cluster_id,
|
|
2184
|
+
payload=payload,
|
|
2185
|
+
_request_auth=_request_auth,
|
|
2186
|
+
_content_type=_content_type,
|
|
2187
|
+
_headers=_headers,
|
|
2188
|
+
_host_index=_host_index
|
|
2189
|
+
)
|
|
2190
|
+
|
|
2191
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2192
|
+
'200': "ResponseModel",
|
|
2193
|
+
'400': "ErrorResponseModel",
|
|
2194
|
+
'401': "ErrorResponseModel",
|
|
2195
|
+
'404': "ErrorResponseModel",
|
|
2196
|
+
'500': None,
|
|
2197
|
+
}
|
|
2198
|
+
response_data = self.api_client.call_api(
|
|
2199
|
+
*_param,
|
|
2200
|
+
_request_timeout=_request_timeout
|
|
2201
|
+
)
|
|
2202
|
+
response_data.read()
|
|
2203
|
+
return self.api_client.response_deserialize(
|
|
2204
|
+
response_data=response_data,
|
|
2205
|
+
response_types_map=_response_types_map,
|
|
2206
|
+
)
|
|
2207
|
+
|
|
2208
|
+
|
|
2209
|
+
@validate_call
|
|
2210
|
+
def delete_cluster_nodes_without_preload_content(
|
|
2211
|
+
self,
|
|
2212
|
+
cluster_id: StrictInt,
|
|
2213
|
+
payload: DeleteClusterNodesFields,
|
|
2214
|
+
_request_timeout: Union[
|
|
2215
|
+
None,
|
|
2216
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2217
|
+
Tuple[
|
|
2218
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
2219
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
2220
|
+
]
|
|
2221
|
+
] = None,
|
|
2222
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
2223
|
+
_content_type: Optional[StrictStr] = None,
|
|
2224
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
2225
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
2226
|
+
) -> RESTResponseType:
|
|
2227
|
+
"""Delete Multiple Cluster Nodes
|
|
2228
|
+
|
|
2229
|
+
|
|
2230
|
+
:param cluster_id: (required)
|
|
2231
|
+
:type cluster_id: int
|
|
2232
|
+
:param payload: (required)
|
|
2233
|
+
:type payload: DeleteClusterNodesFields
|
|
2234
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
2235
|
+
number provided, it will be total request
|
|
2236
|
+
timeout. It can also be a pair (tuple) of
|
|
2237
|
+
(connection, read) timeouts.
|
|
2238
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
2239
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
2240
|
+
request; this effectively ignores the
|
|
2241
|
+
authentication in the spec for a single request.
|
|
2242
|
+
:type _request_auth: dict, optional
|
|
2243
|
+
:param _content_type: force content-type for the request.
|
|
2244
|
+
:type _content_type: str, Optional
|
|
2245
|
+
:param _headers: set to override the headers for a single
|
|
2246
|
+
request; this effectively ignores the headers
|
|
2247
|
+
in the spec for a single request.
|
|
2248
|
+
:type _headers: dict, optional
|
|
2249
|
+
:param _host_index: set to override the host_index for a single
|
|
2250
|
+
request; this effectively ignores the host_index
|
|
2251
|
+
in the spec for a single request.
|
|
2252
|
+
:type _host_index: int, optional
|
|
2253
|
+
:return: Returns the result object.
|
|
2254
|
+
""" # noqa: E501
|
|
2255
|
+
|
|
2256
|
+
_param = self._delete_cluster_nodes_serialize(
|
|
2257
|
+
cluster_id=cluster_id,
|
|
2258
|
+
payload=payload,
|
|
2259
|
+
_request_auth=_request_auth,
|
|
2260
|
+
_content_type=_content_type,
|
|
2261
|
+
_headers=_headers,
|
|
2262
|
+
_host_index=_host_index
|
|
2263
|
+
)
|
|
2264
|
+
|
|
2265
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
2266
|
+
'200': "ResponseModel",
|
|
2267
|
+
'400': "ErrorResponseModel",
|
|
2268
|
+
'401': "ErrorResponseModel",
|
|
2269
|
+
'404': "ErrorResponseModel",
|
|
2270
|
+
'500': None,
|
|
2271
|
+
}
|
|
2272
|
+
response_data = self.api_client.call_api(
|
|
2273
|
+
*_param,
|
|
2274
|
+
_request_timeout=_request_timeout
|
|
2275
|
+
)
|
|
2276
|
+
return response_data.response
|
|
2277
|
+
|
|
2278
|
+
|
|
2279
|
+
def _delete_cluster_nodes_serialize(
|
|
2280
|
+
self,
|
|
2281
|
+
cluster_id,
|
|
2282
|
+
payload,
|
|
2283
|
+
_request_auth,
|
|
2284
|
+
_content_type,
|
|
2285
|
+
_headers,
|
|
2286
|
+
_host_index,
|
|
2287
|
+
) -> RequestSerialized:
|
|
2288
|
+
|
|
2289
|
+
_host = None
|
|
2290
|
+
|
|
2291
|
+
_collection_formats: Dict[str, str] = {
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
_path_params: Dict[str, str] = {}
|
|
2295
|
+
_query_params: List[Tuple[str, str]] = []
|
|
2296
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
2297
|
+
_form_params: List[Tuple[str, str]] = []
|
|
2298
|
+
_files: Dict[
|
|
2299
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
2300
|
+
] = {}
|
|
2301
|
+
_body_params: Optional[bytes] = None
|
|
2302
|
+
|
|
2303
|
+
# process the path parameters
|
|
2304
|
+
if cluster_id is not None:
|
|
2305
|
+
_path_params['cluster_id'] = cluster_id
|
|
2306
|
+
# process the query parameters
|
|
2307
|
+
# process the header parameters
|
|
2308
|
+
# process the form parameters
|
|
2309
|
+
# process the body parameter
|
|
2310
|
+
if payload is not None:
|
|
2311
|
+
_body_params = payload
|
|
2312
|
+
|
|
2313
|
+
|
|
2314
|
+
# set the HTTP header `Accept`
|
|
2315
|
+
if 'Accept' not in _header_params:
|
|
2316
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
2317
|
+
[
|
|
2318
|
+
'application/json'
|
|
2319
|
+
]
|
|
2320
|
+
)
|
|
2321
|
+
|
|
2322
|
+
# set the HTTP header `Content-Type`
|
|
2323
|
+
if _content_type:
|
|
2324
|
+
_header_params['Content-Type'] = _content_type
|
|
2325
|
+
else:
|
|
2326
|
+
_default_content_type = (
|
|
2327
|
+
self.api_client.select_header_content_type(
|
|
2328
|
+
[
|
|
2329
|
+
'application/json'
|
|
2330
|
+
]
|
|
2331
|
+
)
|
|
2332
|
+
)
|
|
2333
|
+
if _default_content_type is not None:
|
|
2334
|
+
_header_params['Content-Type'] = _default_content_type
|
|
2335
|
+
|
|
2336
|
+
# authentication setting
|
|
2337
|
+
_auth_settings: List[str] = [
|
|
2338
|
+
'apiKey'
|
|
2339
|
+
]
|
|
2340
|
+
|
|
2341
|
+
return self.api_client.param_serialize(
|
|
2342
|
+
method='POST',
|
|
2343
|
+
resource_path='/core/clusters/{cluster_id}/nodes/delete',
|
|
2344
|
+
path_params=_path_params,
|
|
2345
|
+
query_params=_query_params,
|
|
2346
|
+
header_params=_header_params,
|
|
2347
|
+
body=_body_params,
|
|
2348
|
+
post_params=_form_params,
|
|
2349
|
+
files=_files,
|
|
2350
|
+
auth_settings=_auth_settings,
|
|
2351
|
+
collection_formats=_collection_formats,
|
|
2352
|
+
_host=_host,
|
|
2353
|
+
_request_auth=_request_auth
|
|
2354
|
+
)
|
|
2355
|
+
|
|
2356
|
+
|
|
2357
|
+
|
|
2358
|
+
|
|
2060
2359
|
@validate_call
|
|
2061
2360
|
def fetch_cluster_name_availability(
|
|
2062
2361
|
self,
|
|
@@ -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
|
|
@@ -305,4 +307,6 @@ from .volume_overview_fields import VolumeOverviewFields
|
|
|
305
307
|
from .volume_types import VolumeTypes
|
|
306
308
|
from .volumes import Volumes
|
|
307
309
|
from .volumes_fields import VolumesFields
|
|
310
|
+
from .voucher import Voucher
|
|
311
|
+
from .voucher_redeem_response_schema import VoucherRedeemResponseSchema
|
|
308
312
|
from .workload_billing_history_response import WorkloadBillingHistoryResponse
|
|
@@ -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,91 @@
|
|
|
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, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class Voucher(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Voucher
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
code: StrictStr = Field(description="Voucher code")
|
|
30
|
+
id: StrictInt = Field(description="Voucher ID")
|
|
31
|
+
status: StrictStr = Field(description="Voucher status")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["code", "id", "status"]
|
|
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 Voucher 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 Voucher 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
|
+
"code": obj.get("code"),
|
|
86
|
+
"id": obj.get("id"),
|
|
87
|
+
"status": obj.get("status")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,95 @@
|
|
|
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, StrictBool, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from ..models.voucher import Voucher
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class VoucherRedeemResponseSchema(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
VoucherRedeemResponseSchema
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
message: StrictStr = Field(description="Response message")
|
|
31
|
+
status: StrictBool = Field(description="Success status of the operation")
|
|
32
|
+
voucher: Optional[Voucher] = Field(default=None, description="Redeemed voucher details")
|
|
33
|
+
__properties: ClassVar[List[str]] = ["message", "status", "voucher"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
populate_by_name=True,
|
|
37
|
+
validate_assignment=True,
|
|
38
|
+
protected_namespaces=(),
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def to_str(self) -> str:
|
|
43
|
+
"""Returns the string representation of the model using alias"""
|
|
44
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
45
|
+
|
|
46
|
+
def to_json(self) -> str:
|
|
47
|
+
"""Returns the JSON representation of the model using alias"""
|
|
48
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
49
|
+
return json.dumps(self.to_dict())
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of VoucherRedeemResponseSchema from a JSON string"""
|
|
54
|
+
return cls.from_dict(json.loads(json_str))
|
|
55
|
+
|
|
56
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
57
|
+
"""Return the dictionary representation of the model using alias.
|
|
58
|
+
|
|
59
|
+
This has the following differences from calling pydantic's
|
|
60
|
+
`self.model_dump(by_alias=True)`:
|
|
61
|
+
|
|
62
|
+
* `None` is only added to the output dict for nullable fields that
|
|
63
|
+
were set at model initialization. Other fields with value `None`
|
|
64
|
+
are ignored.
|
|
65
|
+
"""
|
|
66
|
+
excluded_fields: Set[str] = set([
|
|
67
|
+
])
|
|
68
|
+
|
|
69
|
+
_dict = self.model_dump(
|
|
70
|
+
by_alias=True,
|
|
71
|
+
exclude=excluded_fields,
|
|
72
|
+
exclude_none=True,
|
|
73
|
+
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of voucher
|
|
75
|
+
if self.voucher:
|
|
76
|
+
_dict['voucher'] = self.voucher.to_dict()
|
|
77
|
+
return _dict
|
|
78
|
+
|
|
79
|
+
@classmethod
|
|
80
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
+
"""Create an instance of VoucherRedeemResponseSchema from a dict"""
|
|
82
|
+
if obj is None:
|
|
83
|
+
return None
|
|
84
|
+
|
|
85
|
+
if not isinstance(obj, dict):
|
|
86
|
+
return cls.model_validate(obj)
|
|
87
|
+
|
|
88
|
+
_obj = cls.model_validate({
|
|
89
|
+
"message": obj.get("message"),
|
|
90
|
+
"status": obj.get("status"),
|
|
91
|
+
"voucher": Voucher.from_dict(obj["voucher"]) if obj.get("voucher") is not None else None
|
|
92
|
+
})
|
|
93
|
+
return _obj
|
|
94
|
+
|
|
95
|
+
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
hyperstack/__init__.py,sha256=
|
|
2
|
-
hyperstack/api_client.py,sha256=
|
|
1
|
+
hyperstack/__init__.py,sha256=KvbTPFRvCmqsMcgv_DeM3dq3qM3MbskS0Q5AMPeEjz8,24417
|
|
2
|
+
hyperstack/api_client.py,sha256=sJDS0QGpHwvEFDOJaZ7ZN891sGwwDsZJ1hhUJoymOSw,27660
|
|
3
3
|
hyperstack/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
4
|
-
hyperstack/configuration.py,sha256=
|
|
4
|
+
hyperstack/configuration.py,sha256=Q1iypEcDRI4CK1Cu39Pc4TnXftg1xXc72i2vwX4W3FY,18804
|
|
5
5
|
hyperstack/exceptions.py,sha256=WNUju20ADFYpDuZnq5o9FKSoa9N5nsCkMPNaK_VUrNM,6230
|
|
6
6
|
hyperstack/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
hyperstack/rest.py,sha256=ewQJgH66o4QmU-YgavYnTiOvGqjLOHbd43ENkvfdsLA,9656
|
|
8
|
-
hyperstack/api/__init__.py,sha256=
|
|
9
|
-
hyperstack/api/admin_api.py,sha256=UysqdTNibJqSdIwUKb4HQdXEHPhKyrf0dczJIx0fcxc,11514
|
|
8
|
+
hyperstack/api/__init__.py,sha256=qx-xxjOEyozTFH6RuLCTxD01zZN0TXutQByOzh_KhIY,1996
|
|
10
9
|
hyperstack/api/alive_api.py,sha256=Vk_uXVNJXZcd8hz3Lk6DCy--jOu9901r5-IVAxwP1dE,19468
|
|
11
10
|
hyperstack/api/api_key_api.py,sha256=Xt0fAER5nKgAH9wH2qt6tzRyiyLQ4Ym4a7iEDjQndzo,45330
|
|
12
11
|
hyperstack/api/assigning_member_role_api.py,sha256=dqfP49KEbwcDbPjxNP2UuqGvnFQrGJTILAZynWd4Lxs,24809
|
|
@@ -16,7 +15,7 @@ hyperstack/api/billing_api.py,sha256=XWJp-fxHUiCei3p57ykxzQFkHV_X8vC5_tw_xP77SCk
|
|
|
16
15
|
hyperstack/api/calculate_api.py,sha256=CgUXhQnmEsKnQWPxL19CrKOd1IBm_8rbQC2jz2zgVg8,12390
|
|
17
16
|
hyperstack/api/callbacks_api.py,sha256=Pro34L0KYy8EFDmu43ljoL7XdVQSIxq4FdNIEzBL4fA,73369
|
|
18
17
|
hyperstack/api/cluster_events_api.py,sha256=l5ooLmF7okg0e-lePL6hgl1KESF8eqOKu1TyM24jcQI,11569
|
|
19
|
-
hyperstack/api/clusters_api.py,sha256=
|
|
18
|
+
hyperstack/api/clusters_api.py,sha256=SMR0wp_GyUttFIIDAOWvW0njhxTyqmjqQ23xQJGgpUw,185542
|
|
20
19
|
hyperstack/api/compliance_api.py,sha256=rRayiQrFHmuWh9WDw84x36919NXe-c3Kra5rb0_v_3s,45218
|
|
21
20
|
hyperstack/api/credit_api.py,sha256=3NXOb-gRVWTsA3Xdy55OGjnChfu4wfqHp-BQWiA0YfE,12641
|
|
22
21
|
hyperstack/api/customer_contract_api.py,sha256=ICk-Lv0XQzKDVR_XwPhzqFnAs-SvN771mtEsUAzuIsc,37874
|
|
@@ -53,7 +52,8 @@ hyperstack/api/virtual_machine_events_api.py,sha256=SJbKS7K8pWF1mJNP5_t5vXwMHOum
|
|
|
53
52
|
hyperstack/api/vnc_url_api.py,sha256=qsP4EfXR3OAnrg4YwL0TwFo6_3LlpmOt_IGmQCTIA1A,23480
|
|
54
53
|
hyperstack/api/volume_api.py,sha256=1W_HOK7s3R4RQHjBL49NbmylEG68gjDWVsKpEQtdmwE,79340
|
|
55
54
|
hyperstack/api/volume_attachment_api.py,sha256=daxX8YuYnNs6kJr0ft5mFWAo4Kk1hdJGWWTVSnWY9Ec,37642
|
|
56
|
-
hyperstack/
|
|
55
|
+
hyperstack/api/vouchers_api.py,sha256=VaAgkmGSz2Bnc0rrozIlJpiCGknqG6Mj4Nf5a-J3g_o,12419
|
|
56
|
+
hyperstack/models/__init__.py,sha256=Nf4kJUmUPXQnxYooY4jwtAQXaAqg-MWVPVfzh6-wsc0,19783
|
|
57
57
|
hyperstack/models/access_token_field.py,sha256=Ka4AWik_Y7Y4yv0s2-YHiP7rqItOtg18er7yUFRqbPY,2797
|
|
58
58
|
hyperstack/models/add_user_info_success_response_model.py,sha256=T2XP_tWo5rVzrbOXd8CEpa1ZDf2vz3W4Ni7dNBBx6TY,3300
|
|
59
59
|
hyperstack/models/allocated_gpu_count_graph.py,sha256=ANyWOWNFfH_caDmjfDrHA0mpD5lJjMhkoJZ9DVq-H60,2902
|
|
@@ -133,6 +133,7 @@ hyperstack/models/customer_contract_detail_response_model.py,sha256=znH1RfVTbT7s
|
|
|
133
133
|
hyperstack/models/customer_contract_fields.py,sha256=icTlqFtGYUm149Dv4h2q1o49sKveRwCDD-EPk0c1FE8,4200
|
|
134
134
|
hyperstack/models/dashboard_info_response.py,sha256=LMVN-cu-PLakZtJFiOe4GRh4oC8GNtxvRFsAO23amho,3283
|
|
135
135
|
hyperstack/models/data_synthesis_billing_history_details_response_schema.py,sha256=vbIfO8MX-DYtDSwGscw6Tj1a1HBBLIR6ID7oITLEc7U,3752
|
|
136
|
+
hyperstack/models/delete_cluster_nodes_fields.py,sha256=dbJu6OS2gxShXJ5ijCSB266fAxvcndZcleqTalCEwL8,2799
|
|
136
137
|
hyperstack/models/deployment_fields.py,sha256=rwwFtXW4R5BmiJUmcHmOjmhP08V3yGPiNVHbOYgK6Q4,3283
|
|
137
138
|
hyperstack/models/deployment_fields_for_start_deployments.py,sha256=JKgcH3Dp7n7LsqoQV-hptRNsLxmLPGdfDAYPwV77myA,3461
|
|
138
139
|
hyperstack/models/deployments.py,sha256=Ais525q1Ehi00BMt0IOO2uNLVVYUE4Lq2NLLYSioP88,3489
|
|
@@ -249,6 +250,7 @@ hyperstack/models/rbac_role_detail_response_model.py,sha256=5rxkIJmPW5Gl8f5EJlFt
|
|
|
249
250
|
hyperstack/models/rbac_role_detail_response_model_fixed.py,sha256=6kxjCFCQu5GV3sVtLvSPJ23t6fYsXAdt9cH0H_cL8-0,3309
|
|
250
251
|
hyperstack/models/rbac_role_field.py,sha256=G62jPxL8J0BnEcmGZyHLfWxGWECP3nAR1Mjw4QIWw8k,2753
|
|
251
252
|
hyperstack/models/rbac_role_fields.py,sha256=W3UGHIAK8BSXu3wy35TtAUV1UMwX7T7wpbv9rrpz6iE,4327
|
|
253
|
+
hyperstack/models/redeem_voucher_payload.py,sha256=tiILnS8wbyhaVOxDqZQU5emELlOvHhC04DkbWEd01XU,2860
|
|
252
254
|
hyperstack/models/region_fields.py,sha256=NUN2m5mb9JL91U5ak4188NPJZ0Pbld82u2KoJx0JvoU,3584
|
|
253
255
|
hyperstack/models/regions.py,sha256=mu_eOF7Q6v6bdBxNjho_BY7-tUSKhDXnME9GxBEC1pU,3409
|
|
254
256
|
hyperstack/models/remove_member_from_organization_response_model.py,sha256=7Yh0CDH2Qr_UCIZnlDgkgh1t_WiZLkRoJKjyH122PRo,2980
|
|
@@ -345,8 +347,10 @@ hyperstack/models/volume_overview_fields.py,sha256=UVTjKyRM5extob0_-M63vplcYJp4T
|
|
|
345
347
|
hyperstack/models/volume_types.py,sha256=jMN2S8p-Yv8sw_wWYRmfIXLmtXDwSC0xc3Gt_SNBCtY,2980
|
|
346
348
|
hyperstack/models/volumes.py,sha256=-zTxq9C_spyDF882oDIFcJnrTEM5A2aYQojmVUaHBq0,3694
|
|
347
349
|
hyperstack/models/volumes_fields.py,sha256=5c5YBJBmFbTSI_O00V9enZ_zEeRh4hZHtlf3hTH-Ios,4932
|
|
350
|
+
hyperstack/models/voucher.py,sha256=tAFBUSIrUHfpK2Rj5w964wfaWW6aJhoq4AjDUdC6gVU,2958
|
|
351
|
+
hyperstack/models/voucher_redeem_response_schema.py,sha256=xvfvnnR1a_CpIpgenFHrDJbbHl27Rn_AASHz-QD7TE0,3400
|
|
348
352
|
hyperstack/models/workload_billing_history_response.py,sha256=mXMmbg5JxL0oOdZ0rUuBlKxbSxPf8MhN1WluraZoyVU,3544
|
|
349
|
-
hyperstack-1.
|
|
350
|
-
hyperstack-1.
|
|
351
|
-
hyperstack-1.
|
|
352
|
-
hyperstack-1.
|
|
353
|
+
hyperstack-1.45.2a0.dist-info/METADATA,sha256=aimu0ldjRXQqMzfDE5HkPd6VNeaLYh1EflYFft5PCWk,918
|
|
354
|
+
hyperstack-1.45.2a0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
355
|
+
hyperstack-1.45.2a0.dist-info/top_level.txt,sha256=njn3-XmjCMziM6_3QadnDQbqsVh2KYw4J1IysqyY0HI,11
|
|
356
|
+
hyperstack-1.45.2a0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|