hyperstack 0.1.23__py3-none-any.whl → 1.41.0a0__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 +79 -131
- hyperstack/api/__init__.py +2 -0
- hyperstack/api/alive_api.py +240 -0
- hyperstack/api/api_key_api.py +16 -20
- hyperstack/api/assigning_member_role_api.py +15 -17
- hyperstack/api/auth_api.py +1050 -5
- hyperstack/api/beta_access_api.py +856 -0
- hyperstack/api/billing_api.py +6461 -673
- hyperstack/api/calculate_api.py +8 -9
- hyperstack/api/callbacks_api.py +120 -126
- hyperstack/api/cluster_events_api.py +1 -2
- hyperstack/api/clusters_api.py +2492 -146
- hyperstack/api/compliance_api.py +14 -18
- hyperstack/api/credit_api.py +17 -15
- hyperstack/api/customer_contract_api.py +30 -33
- hyperstack/api/dashboard_api.py +4 -5
- hyperstack/api/deployment_api.py +4 -8
- hyperstack/api/environment_api.py +285 -16
- hyperstack/api/firewall_attachment_api.py +11 -9
- hyperstack/api/firewalls_api.py +341 -347
- hyperstack/api/flavor_api.py +4 -5
- hyperstack/api/floating_ip_api.py +50 -49
- hyperstack/api/gpu_api.py +1 -2
- hyperstack/api/image_api.py +35 -39
- hyperstack/api/invite_api.py +288 -18
- hyperstack/api/keypair_api.py +22 -26
- hyperstack/api/organization_api.py +12 -15
- hyperstack/api/partner_config_api.py +564 -0
- hyperstack/api/payment_api.py +299 -18
- hyperstack/api/permission_api.py +4 -5
- hyperstack/api/policy_api.py +4 -5
- hyperstack/api/pricebook_api.py +14 -12
- hyperstack/api/profile_api.py +13 -17
- hyperstack/api/rbac_role_api.py +20 -25
- hyperstack/api/region_api.py +7 -8
- hyperstack/api/security_rules_api.py +1 -2
- hyperstack/api/snapshot_events_api.py +1 -2
- hyperstack/api/snapshots_api.py +166 -172
- hyperstack/api/stock_api.py +4 -5
- hyperstack/api/template_api.py +14 -19
- hyperstack/api/user_api.py +55 -49
- hyperstack/api/user_detail_choice_api.py +1 -2
- hyperstack/api/user_permission_api.py +8 -10
- hyperstack/api/virtual_machine_api.py +1529 -929
- hyperstack/api/virtual_machine_events_api.py +21 -22
- hyperstack/api/vnc_url_api.py +54 -50
- hyperstack/api/volume_api.py +340 -40
- hyperstack/api/volume_attachment_api.py +342 -42
- hyperstack/api_client.py +1 -1
- hyperstack/configuration.py +154 -47
- hyperstack/models/__init__.py +76 -130
- hyperstack/models/{environment_fieldsfor_volume.py → access_token_field.py} +7 -7
- hyperstack/models/attach_volume_fields.py +6 -2
- hyperstack/models/attach_volumes_payload.py +4 -2
- hyperstack/models/{virtual_machine_usage.py → attachments_fields_for_volume.py} +13 -11
- hyperstack/models/{flavor_vm_fields.py → attributes.py} +15 -18
- hyperstack/models/auth_get_token_response_model.py +4 -6
- hyperstack/models/{future_node_model.py → beta_access_request_fields.py} +27 -25
- hyperstack/models/{create_gpu.py → beta_access_request_payload.py} +9 -11
- hyperstack/models/{create_discount_response.py → beta_access_request_response_model.py} +11 -11
- hyperstack/models/{export_billing_data_request.py → beta_access_status_item.py} +20 -23
- hyperstack/models/{get_all_discount_for_all_organization_response.py → beta_access_status_response_model.py} +15 -15
- hyperstack/models/{exclude_billing_post_response.py → billing_history.py} +13 -11
- hyperstack/models/billing_history_data_synthesis_details.py +105 -0
- hyperstack/models/{vm_usage_response.py → billing_history_fine_tuning.py} +23 -19
- hyperstack/models/billing_history_model_evalutation_details.py +105 -0
- hyperstack/models/{get_all_discounts_fields.py → billing_history_serverless_inference.py} +23 -24
- hyperstack/models/billing_history_serverless_inference_details.py +105 -0
- hyperstack/models/{billingmetricesfields.py → billing_metrices_fields.py} +4 -4
- hyperstack/models/{billingmetricesresponse.py → billing_metrices_response.py} +7 -7
- hyperstack/models/cluster_fields.py +27 -9
- hyperstack/models/{add_update_flavor_organization_payload.py → cluster_flavor_fields.py} +28 -26
- hyperstack/models/{historical_instances_fields.py → cluster_node_fields.py} +24 -22
- hyperstack/models/{internal_instance_flavor_fields.py → cluster_node_group_fields.py} +17 -17
- hyperstack/models/{create_update_policy_response_model.py → cluster_node_groups_create_response.py} +21 -11
- hyperstack/models/{create_update_permission_response_model.py → cluster_node_groups_get_response.py} +11 -11
- hyperstack/models/{auth_request_login_response_model.py → cluster_node_groups_list_response.py} +15 -11
- hyperstack/models/{contract_eligible_instance_fields.py → cluster_node_instance_fields.py} +13 -11
- hyperstack/models/{image_logos.py → cluster_nodes_list_response.py} +14 -14
- hyperstack/models/{internal_environment_fields.py → cluster_version.py} +13 -9
- hyperstack/models/cluster_versions.py +10 -2
- hyperstack/models/{future_nodes_stock_model.py → colors.py} +17 -15
- hyperstack/models/contract_discount_plan_fields.py +3 -1
- hyperstack/models/contract_instance_fields.py +7 -1
- hyperstack/models/{future_node_response_model.py → create_cluster_node_fields.py} +23 -18
- hyperstack/models/{update_gpu.py → create_cluster_node_group_payload.py} +12 -11
- hyperstack/models/create_cluster_payload.py +31 -8
- hyperstack/models/create_environment.py +1 -1
- hyperstack/models/create_instances_payload.py +10 -8
- hyperstack/models/create_profile_payload.py +1 -1
- hyperstack/models/create_snapshot_payload.py +2 -4
- hyperstack/models/create_volume_payload.py +1 -1
- hyperstack/models/data_synthesis_billing_history_details_response_schema.py +95 -0
- hyperstack/models/{deployment_fieldsforstartdeployments.py → deployment_fields_for_start_deployments.py} +4 -4
- hyperstack/models/{editlabelofanexisting_vm_payload.py → edit_label_of_an_existing_vm_payload.py} +4 -4
- hyperstack/models/environment_features.py +14 -2
- hyperstack/models/{node_stocks_payload.py → environment_fields_for_volume.py} +10 -12
- hyperstack/models/flavor_fields.py +3 -1
- hyperstack/models/{customer_fields.py → flavor_label_fields.py} +7 -7
- hyperstack/models/{getcreditandthresholdinfo.py → get_credit_and_threshold_info.py} +4 -4
- hyperstack/models/{getcreditandthresholdinfoinresponse.py → get_credit_and_threshold_info_in_response.py} +7 -7
- hyperstack/models/{region_payload.py → get_instance_logs_response.py} +7 -9
- hyperstack/models/instance_fields.py +14 -4
- hyperstack/models/instance_flavor_fields.py +13 -1
- hyperstack/models/{flavor_response.py → keypair_environment_features.py} +20 -16
- hyperstack/models/{internal_instance_keypair_fields.py → keypair_environment_fields.py} +13 -11
- hyperstack/models/keypair_fields.py +6 -2
- hyperstack/models/{lastdaycostfields.py → last_day_cost_fields.py} +4 -4
- hyperstack/models/{lastdaycostresponse.py → last_day_cost_response.py} +7 -7
- hyperstack/models/{export_billing_data_response.py → logos.py} +13 -9
- hyperstack/models/{creditrequestresponse.py → master_flavors_response.py} +14 -14
- hyperstack/models/{customer_payload.py → mfa_status_fields.py} +8 -10
- hyperstack/models/{gpu.py → mfa_status_response.py} +11 -11
- hyperstack/models/model_evaluation_billing_history_details_response_schema.py +95 -0
- hyperstack/models/{organization_thresholdfields.py → organization_threshold_fields.py} +4 -4
- hyperstack/models/{organizationthresholdupdateresponse.py → organization_threshold_update_response.py} +7 -7
- hyperstack/models/{organizationthresholdsresponse.py → organization_thresholds_response.py} +7 -7
- hyperstack/models/{logo_get_response.py → pagination.py} +12 -12
- hyperstack/models/{billing_response.py → partner_config.py} +31 -20
- hyperstack/models/payment_details_fields.py +5 -1
- hyperstack/models/{logout_payload.py → primary_color.py} +10 -8
- hyperstack/models/region_fields.py +16 -2
- hyperstack/models/{vm_usage_request_payload.py → request_instance_logs_payload.py} +8 -8
- hyperstack/models/{stock_visibility_user_payload.py → request_instance_logs_response.py} +8 -8
- hyperstack/models/{contract_billing_history.py → resource_level_billing_bucket_details_resources.py} +10 -10
- hyperstack/models/{node_response_model.py → resource_level_billing_history_resources_cluster.py} +21 -11
- hyperstack/models/resource_level_billing_history_response_attributes.py +3 -1
- hyperstack/models/{get_all_contracts_response_model.py → resource_level_bucket_billing_details_response_model.py} +11 -15
- hyperstack/models/{contract_billing_history_response_model.py → resource_level_bucket_billing_history_response_model.py} +11 -11
- hyperstack/models/resource_level_cluster_billing_details_response_model.py +95 -0
- hyperstack/models/resource_level_cluster_billing_history_response_model.py +95 -0
- hyperstack/models/{get_discount_detail_response.py → resource_level_cluster_graph_billing_details_response_model.py} +11 -11
- hyperstack/models/{organization_object_response.py → resource_level_graph_billing_details_bucket.py} +18 -14
- hyperstack/models/{update_discounts_status_payload.py → secondary_color.py} +10 -8
- hyperstack/models/{security_rules_fieldsfor_instance.py → security_rules_fields_for_instance.py} +4 -4
- hyperstack/models/serverless_inferenced_billing_history_details_response_schema.py +95 -0
- hyperstack/models/snapshot_fields.py +6 -1
- hyperstack/models/snapshot_retrieve_fields.py +29 -2
- hyperstack/models/start_deployment.py +3 -3
- hyperstack/models/{subscribeorunsubscribeupdatepayload.py → subscribe_or_unsubscribe_update_payload.py} +4 -4
- hyperstack/models/token_based_billing_history_response.py +95 -0
- hyperstack/models/{update_keypairnameresponse.py → update_keypair_name_response.py} +4 -4
- hyperstack/models/update_volume_attachment_payload.py +87 -0
- hyperstack/models/{verify_api_key_payload.py → update_volume_payload.py} +7 -7
- hyperstack/models/{stock_visibility_user_list_response.py → update_volume_response.py} +14 -16
- hyperstack/models/{auth_request_login_fields.py → uris.py} +19 -9
- hyperstack/models/{userinfopostpayload.py → user_info_post_payload.py} +4 -4
- hyperstack/models/{node_stock_response_model.py → user_organizations_response.py} +14 -14
- hyperstack/models/users_info_fields.py +3 -1
- hyperstack/models/volume_attachment_fields.py +9 -5
- hyperstack/models/volume_fields.py +14 -4
- hyperstack/models/{volume_fieldsfor_instance.py → volume_fields_for_instance.py} +4 -4
- hyperstack/models/volumes.py +17 -11
- hyperstack/models/{instances_summary_fields.py → volumes_fields.py} +33 -29
- hyperstack/models/workload_billing_history_response.py +95 -0
- {hyperstack-0.1.23.dist-info → hyperstack-1.41.0a0.dist-info}/METADATA +9 -2
- hyperstack-1.41.0a0.dist-info/RECORD +349 -0
- {hyperstack-0.1.23.dist-info → hyperstack-1.41.0a0.dist-info}/WHEEL +1 -1
- hyperstack/models/api_key_verify_fields.py +0 -93
- hyperstack/models/billing_immune_resources_response.py +0 -95
- hyperstack/models/contract_billing_history_response_attributes.py +0 -99
- hyperstack/models/contract_change_payload.py +0 -101
- hyperstack/models/contract_eligible_instances_response.py +0 -101
- hyperstack/models/contract_event_create_model.py +0 -91
- hyperstack/models/contract_resource_payload.py +0 -95
- hyperstack/models/contractl_billing_history_response_metrics.py +0 -87
- hyperstack/models/create_contract_fields.py +0 -110
- hyperstack/models/create_contract_payload.py +0 -106
- hyperstack/models/create_discounts_payload.py +0 -112
- hyperstack/models/create_update_permission_payload.py +0 -93
- hyperstack/models/create_update_policy_payload.py +0 -93
- hyperstack/models/creditrechargelimitfield.py +0 -93
- hyperstack/models/creditrechargelimitresponse.py +0 -99
- hyperstack/models/creditrequests.py +0 -96
- hyperstack/models/data.py +0 -91
- hyperstack/models/discount_entity_model.py +0 -97
- hyperstack/models/discount_fields.py +0 -100
- hyperstack/models/discount_plan_fields.py +0 -108
- hyperstack/models/discount_resource_fields.py +0 -93
- hyperstack/models/discount_resource_payload.py +0 -93
- hyperstack/models/exclude_billing_post_payload.py +0 -91
- hyperstack/models/field_change.py +0 -91
- hyperstack/models/flavor_payload.py +0 -101
- hyperstack/models/flavor_vms_response.py +0 -99
- hyperstack/models/future_node_stock_model.py +0 -93
- hyperstack/models/future_node_update_model.py +0 -98
- hyperstack/models/get_all_contract_fields.py +0 -100
- hyperstack/models/get_discount_response.py +0 -99
- hyperstack/models/get_entity_discount_detail_response.py +0 -108
- hyperstack/models/get_token_payload.py +0 -89
- hyperstack/models/get_version_response.py +0 -91
- hyperstack/models/historical_instance.py +0 -101
- hyperstack/models/infrahub_resource_object_response.py +0 -119
- hyperstack/models/insert_discount_plan_fields.py +0 -112
- hyperstack/models/internal_instance_fields.py +0 -156
- hyperstack/models/internal_instance_image_fields.py +0 -95
- hyperstack/models/internal_instances_response.py +0 -99
- hyperstack/models/internal_security_rules_fields_for_instance.py +0 -104
- hyperstack/models/internal_volume_attachment_fields.py +0 -98
- hyperstack/models/internal_volume_fields.py +0 -95
- hyperstack/models/internal_volumes_response.py +0 -99
- hyperstack/models/new_stock_update_response_model.py +0 -89
- hyperstack/models/node_model.py +0 -114
- hyperstack/models/node_payload_model.py +0 -97
- hyperstack/models/node_power_usage_model.py +0 -120
- hyperstack/models/node_stock_payload_model.py +0 -95
- hyperstack/models/organizationcreditrechargelimitresponse.py +0 -95
- hyperstack/models/power_usage_model.py +0 -89
- hyperstack/models/pricebook_resource_object_response.py +0 -107
- hyperstack/models/refresh_token_payload.py +0 -89
- hyperstack/models/region_response.py +0 -95
- hyperstack/models/set_defaults_payload.py +0 -89
- hyperstack/models/single_visibility_user_response.py +0 -91
- hyperstack/models/success_response_model.py +0 -89
- hyperstack/models/token_fields.py +0 -91
- hyperstack/models/update_contract_payload.py +0 -104
- hyperstack/models/update_discounts_payload.py +0 -102
- hyperstack/models/user_transfer_payload.py +0 -89
- hyperstack/models/verify_api_key_response_model.py +0 -95
- hyperstack/models/volume_status_change_fields.py +0 -96
- hyperstack/models/volumes_last_status_change_response.py +0 -99
- hyperstack/models/warning_mail_log_fields.py +0 -99
- hyperstack/models/warning_mail_log_response.py +0 -101
- hyperstack-0.1.23.dist-info/RECORD +0 -401
- {hyperstack-0.1.23.dist-info → hyperstack-1.41.0a0.dist-info}/top_level.txt +0 -0
|
@@ -20,23 +20,22 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from ..models.cluster_flavor_fields import ClusterFlavorFields
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
26
|
-
class
|
|
27
|
+
class ClusterNodeGroupFields(BaseModel):
|
|
27
28
|
"""
|
|
28
|
-
|
|
29
|
+
ClusterNodeGroupFields
|
|
29
30
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
+
count: Optional[StrictInt] = None
|
|
31
32
|
created_at: Optional[datetime] = None
|
|
32
|
-
|
|
33
|
-
gpu: Optional[StrictStr] = None
|
|
34
|
-
gpu_count: Optional[StrictInt] = None
|
|
33
|
+
flavor: Optional[ClusterFlavorFields] = None
|
|
35
34
|
id: Optional[StrictInt] = None
|
|
36
35
|
name: Optional[StrictStr] = None
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
__properties: ClassVar[List[str]] = ["
|
|
36
|
+
role: Optional[StrictStr] = None
|
|
37
|
+
updated_at: Optional[datetime] = None
|
|
38
|
+
__properties: ClassVar[List[str]] = ["count", "created_at", "flavor", "id", "name", "role", "updated_at"]
|
|
40
39
|
|
|
41
40
|
model_config = ConfigDict(
|
|
42
41
|
populate_by_name=True,
|
|
@@ -56,7 +55,7 @@ class InternalInstanceFlavorFields(BaseModel):
|
|
|
56
55
|
|
|
57
56
|
@classmethod
|
|
58
57
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
59
|
-
"""Create an instance of
|
|
58
|
+
"""Create an instance of ClusterNodeGroupFields from a JSON string"""
|
|
60
59
|
return cls.from_dict(json.loads(json_str))
|
|
61
60
|
|
|
62
61
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -77,11 +76,14 @@ class InternalInstanceFlavorFields(BaseModel):
|
|
|
77
76
|
exclude=excluded_fields,
|
|
78
77
|
exclude_none=True,
|
|
79
78
|
)
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of flavor
|
|
80
|
+
if self.flavor:
|
|
81
|
+
_dict['flavor'] = self.flavor.to_dict()
|
|
80
82
|
return _dict
|
|
81
83
|
|
|
82
84
|
@classmethod
|
|
83
85
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
-
"""Create an instance of
|
|
86
|
+
"""Create an instance of ClusterNodeGroupFields from a dict"""
|
|
85
87
|
if obj is None:
|
|
86
88
|
return None
|
|
87
89
|
|
|
@@ -89,15 +91,13 @@ class InternalInstanceFlavorFields(BaseModel):
|
|
|
89
91
|
return cls.model_validate(obj)
|
|
90
92
|
|
|
91
93
|
_obj = cls.model_validate({
|
|
92
|
-
"
|
|
94
|
+
"count": obj.get("count"),
|
|
93
95
|
"created_at": obj.get("created_at"),
|
|
94
|
-
"
|
|
95
|
-
"gpu": obj.get("gpu"),
|
|
96
|
-
"gpu_count": obj.get("gpu_count"),
|
|
96
|
+
"flavor": ClusterFlavorFields.from_dict(obj["flavor"]) if obj.get("flavor") is not None else None,
|
|
97
97
|
"id": obj.get("id"),
|
|
98
98
|
"name": obj.get("name"),
|
|
99
|
-
"
|
|
100
|
-
"
|
|
99
|
+
"role": obj.get("role"),
|
|
100
|
+
"updated_at": obj.get("updated_at")
|
|
101
101
|
})
|
|
102
102
|
return _obj
|
|
103
103
|
|
hyperstack/models/{create_update_policy_response_model.py → cluster_node_groups_create_response.py}
RENAMED
|
@@ -19,18 +19,20 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from ..models.
|
|
22
|
+
from ..models.cluster_node_fields import ClusterNodeFields
|
|
23
|
+
from ..models.cluster_node_group_fields import ClusterNodeGroupFields
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
26
|
-
class
|
|
27
|
+
class ClusterNodeGroupsCreateResponse(BaseModel):
|
|
27
28
|
"""
|
|
28
|
-
|
|
29
|
+
ClusterNodeGroupsCreateResponse
|
|
29
30
|
""" # noqa: E501
|
|
30
31
|
message: Optional[StrictStr] = None
|
|
31
|
-
|
|
32
|
+
node_group: Optional[ClusterNodeGroupFields] = None
|
|
33
|
+
nodes: Optional[List[ClusterNodeFields]] = None
|
|
32
34
|
status: Optional[StrictBool] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["message", "
|
|
35
|
+
__properties: ClassVar[List[str]] = ["message", "node_group", "nodes", "status"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
38
|
populate_by_name=True,
|
|
@@ -50,7 +52,7 @@ class CreateUpdatePolicyResponseModel(BaseModel):
|
|
|
50
52
|
|
|
51
53
|
@classmethod
|
|
52
54
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
55
|
+
"""Create an instance of ClusterNodeGroupsCreateResponse from a JSON string"""
|
|
54
56
|
return cls.from_dict(json.loads(json_str))
|
|
55
57
|
|
|
56
58
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -71,14 +73,21 @@ class CreateUpdatePolicyResponseModel(BaseModel):
|
|
|
71
73
|
exclude=excluded_fields,
|
|
72
74
|
exclude_none=True,
|
|
73
75
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
75
|
-
if self.
|
|
76
|
-
_dict['
|
|
76
|
+
# override the default output from pydantic by calling `to_dict()` of node_group
|
|
77
|
+
if self.node_group:
|
|
78
|
+
_dict['node_group'] = self.node_group.to_dict()
|
|
79
|
+
# override the default output from pydantic by calling `to_dict()` of each item in nodes (list)
|
|
80
|
+
_items = []
|
|
81
|
+
if self.nodes:
|
|
82
|
+
for _item_nodes in self.nodes:
|
|
83
|
+
if _item_nodes:
|
|
84
|
+
_items.append(_item_nodes.to_dict())
|
|
85
|
+
_dict['nodes'] = _items
|
|
77
86
|
return _dict
|
|
78
87
|
|
|
79
88
|
@classmethod
|
|
80
89
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
-
"""Create an instance of
|
|
90
|
+
"""Create an instance of ClusterNodeGroupsCreateResponse from a dict"""
|
|
82
91
|
if obj is None:
|
|
83
92
|
return None
|
|
84
93
|
|
|
@@ -87,7 +96,8 @@ class CreateUpdatePolicyResponseModel(BaseModel):
|
|
|
87
96
|
|
|
88
97
|
_obj = cls.model_validate({
|
|
89
98
|
"message": obj.get("message"),
|
|
90
|
-
"
|
|
99
|
+
"node_group": ClusterNodeGroupFields.from_dict(obj["node_group"]) if obj.get("node_group") is not None else None,
|
|
100
|
+
"nodes": [ClusterNodeFields.from_dict(_item) for _item in obj["nodes"]] if obj.get("nodes") is not None else None,
|
|
91
101
|
"status": obj.get("status")
|
|
92
102
|
})
|
|
93
103
|
return _obj
|
hyperstack/models/{create_update_permission_response_model.py → cluster_node_groups_get_response.py}
RENAMED
|
@@ -19,18 +19,18 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from ..models.
|
|
22
|
+
from ..models.cluster_node_group_fields import ClusterNodeGroupFields
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class ClusterNodeGroupsGetResponse(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
ClusterNodeGroupsGetResponse
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
message: Optional[StrictStr] = None
|
|
31
|
-
|
|
31
|
+
node_group: Optional[ClusterNodeGroupFields] = None
|
|
32
32
|
status: Optional[StrictBool] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["message", "
|
|
33
|
+
__properties: ClassVar[List[str]] = ["message", "node_group", "status"]
|
|
34
34
|
|
|
35
35
|
model_config = ConfigDict(
|
|
36
36
|
populate_by_name=True,
|
|
@@ -50,7 +50,7 @@ class CreateUpdatePermissionResponseModel(BaseModel):
|
|
|
50
50
|
|
|
51
51
|
@classmethod
|
|
52
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of ClusterNodeGroupsGetResponse from a JSON string"""
|
|
54
54
|
return cls.from_dict(json.loads(json_str))
|
|
55
55
|
|
|
56
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -71,14 +71,14 @@ class CreateUpdatePermissionResponseModel(BaseModel):
|
|
|
71
71
|
exclude=excluded_fields,
|
|
72
72
|
exclude_none=True,
|
|
73
73
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
75
|
-
if self.
|
|
76
|
-
_dict['
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of node_group
|
|
75
|
+
if self.node_group:
|
|
76
|
+
_dict['node_group'] = self.node_group.to_dict()
|
|
77
77
|
return _dict
|
|
78
78
|
|
|
79
79
|
@classmethod
|
|
80
80
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
-
"""Create an instance of
|
|
81
|
+
"""Create an instance of ClusterNodeGroupsGetResponse from a dict"""
|
|
82
82
|
if obj is None:
|
|
83
83
|
return None
|
|
84
84
|
|
|
@@ -87,7 +87,7 @@ class CreateUpdatePermissionResponseModel(BaseModel):
|
|
|
87
87
|
|
|
88
88
|
_obj = cls.model_validate({
|
|
89
89
|
"message": obj.get("message"),
|
|
90
|
-
"
|
|
90
|
+
"node_group": ClusterNodeGroupFields.from_dict(obj["node_group"]) if obj.get("node_group") is not None else None,
|
|
91
91
|
"status": obj.get("status")
|
|
92
92
|
})
|
|
93
93
|
return _obj
|
hyperstack/models/{auth_request_login_response_model.py → cluster_node_groups_list_response.py}
RENAMED
|
@@ -19,18 +19,18 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from ..models.
|
|
22
|
+
from ..models.cluster_node_group_fields import ClusterNodeGroupFields
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class ClusterNodeGroupsListResponse(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
ClusterNodeGroupsListResponse
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
data: Optional[AuthRequestLoginFields] = None
|
|
31
30
|
message: Optional[StrictStr] = None
|
|
31
|
+
node_groups: Optional[List[ClusterNodeGroupFields]] = None
|
|
32
32
|
status: Optional[StrictBool] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["
|
|
33
|
+
__properties: ClassVar[List[str]] = ["message", "node_groups", "status"]
|
|
34
34
|
|
|
35
35
|
model_config = ConfigDict(
|
|
36
36
|
populate_by_name=True,
|
|
@@ -50,7 +50,7 @@ class AuthRequestLoginResponseModel(BaseModel):
|
|
|
50
50
|
|
|
51
51
|
@classmethod
|
|
52
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of ClusterNodeGroupsListResponse from a JSON string"""
|
|
54
54
|
return cls.from_dict(json.loads(json_str))
|
|
55
55
|
|
|
56
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -71,14 +71,18 @@ class AuthRequestLoginResponseModel(BaseModel):
|
|
|
71
71
|
exclude=excluded_fields,
|
|
72
72
|
exclude_none=True,
|
|
73
73
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in node_groups (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.node_groups:
|
|
77
|
+
for _item_node_groups in self.node_groups:
|
|
78
|
+
if _item_node_groups:
|
|
79
|
+
_items.append(_item_node_groups.to_dict())
|
|
80
|
+
_dict['node_groups'] = _items
|
|
77
81
|
return _dict
|
|
78
82
|
|
|
79
83
|
@classmethod
|
|
80
84
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
-
"""Create an instance of
|
|
85
|
+
"""Create an instance of ClusterNodeGroupsListResponse from a dict"""
|
|
82
86
|
if obj is None:
|
|
83
87
|
return None
|
|
84
88
|
|
|
@@ -86,8 +90,8 @@ class AuthRequestLoginResponseModel(BaseModel):
|
|
|
86
90
|
return cls.model_validate(obj)
|
|
87
91
|
|
|
88
92
|
_obj = cls.model_validate({
|
|
89
|
-
"data": AuthRequestLoginFields.from_dict(obj["data"]) if obj.get("data") is not None else None,
|
|
90
93
|
"message": obj.get("message"),
|
|
94
|
+
"node_groups": [ClusterNodeGroupFields.from_dict(_item) for _item in obj["node_groups"]] if obj.get("node_groups") is not None else None,
|
|
91
95
|
"status": obj.get("status")
|
|
92
96
|
})
|
|
93
97
|
return _obj
|
|
@@ -22,18 +22,19 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
24
24
|
|
|
25
|
-
class
|
|
25
|
+
class ClusterNodeInstanceFields(BaseModel):
|
|
26
26
|
"""
|
|
27
|
-
|
|
27
|
+
ClusterNodeInstanceFields
|
|
28
28
|
""" # noqa: E501
|
|
29
29
|
contract_id: Optional[StrictInt] = None
|
|
30
|
-
|
|
30
|
+
fixed_ip: Optional[StrictStr] = None
|
|
31
|
+
floating_ip: Optional[StrictStr] = None
|
|
32
|
+
floating_ip_status: Optional[StrictStr] = None
|
|
31
33
|
id: Optional[StrictInt] = None
|
|
34
|
+
image_id: Optional[StrictInt] = None
|
|
32
35
|
name: Optional[StrictStr] = None
|
|
33
|
-
openstack_id: Optional[StrictStr] = None
|
|
34
|
-
public_ip: Optional[StrictStr] = None
|
|
35
36
|
status: Optional[StrictStr] = None
|
|
36
|
-
__properties: ClassVar[List[str]] = ["contract_id", "
|
|
37
|
+
__properties: ClassVar[List[str]] = ["contract_id", "fixed_ip", "floating_ip", "floating_ip_status", "id", "image_id", "name", "status"]
|
|
37
38
|
|
|
38
39
|
model_config = ConfigDict(
|
|
39
40
|
populate_by_name=True,
|
|
@@ -53,7 +54,7 @@ class ContractEligibleInstanceFields(BaseModel):
|
|
|
53
54
|
|
|
54
55
|
@classmethod
|
|
55
56
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
-
"""Create an instance of
|
|
57
|
+
"""Create an instance of ClusterNodeInstanceFields from a JSON string"""
|
|
57
58
|
return cls.from_dict(json.loads(json_str))
|
|
58
59
|
|
|
59
60
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -78,7 +79,7 @@ class ContractEligibleInstanceFields(BaseModel):
|
|
|
78
79
|
|
|
79
80
|
@classmethod
|
|
80
81
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
81
|
-
"""Create an instance of
|
|
82
|
+
"""Create an instance of ClusterNodeInstanceFields from a dict"""
|
|
82
83
|
if obj is None:
|
|
83
84
|
return None
|
|
84
85
|
|
|
@@ -87,11 +88,12 @@ class ContractEligibleInstanceFields(BaseModel):
|
|
|
87
88
|
|
|
88
89
|
_obj = cls.model_validate({
|
|
89
90
|
"contract_id": obj.get("contract_id"),
|
|
90
|
-
"
|
|
91
|
+
"fixed_ip": obj.get("fixed_ip"),
|
|
92
|
+
"floating_ip": obj.get("floating_ip"),
|
|
93
|
+
"floating_ip_status": obj.get("floating_ip_status"),
|
|
91
94
|
"id": obj.get("id"),
|
|
95
|
+
"image_id": obj.get("image_id"),
|
|
92
96
|
"name": obj.get("name"),
|
|
93
|
-
"openstack_id": obj.get("openstack_id"),
|
|
94
|
-
"public_ip": obj.get("public_ip"),
|
|
95
97
|
"status": obj.get("status")
|
|
96
98
|
})
|
|
97
99
|
return _obj
|
|
@@ -19,18 +19,18 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from ..models.
|
|
22
|
+
from ..models.cluster_node_fields import ClusterNodeFields
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class ClusterNodesListResponse(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
ClusterNodesListResponse
|
|
29
29
|
""" # noqa: E501
|
|
30
|
-
logos: Optional[List[LogoGetResponse]] = None
|
|
31
30
|
message: Optional[StrictStr] = None
|
|
31
|
+
nodes: Optional[List[ClusterNodeFields]] = None
|
|
32
32
|
status: Optional[StrictBool] = None
|
|
33
|
-
__properties: ClassVar[List[str]] = ["
|
|
33
|
+
__properties: ClassVar[List[str]] = ["message", "nodes", "status"]
|
|
34
34
|
|
|
35
35
|
model_config = ConfigDict(
|
|
36
36
|
populate_by_name=True,
|
|
@@ -50,7 +50,7 @@ class ImageLogos(BaseModel):
|
|
|
50
50
|
|
|
51
51
|
@classmethod
|
|
52
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of ClusterNodesListResponse from a JSON string"""
|
|
54
54
|
return cls.from_dict(json.loads(json_str))
|
|
55
55
|
|
|
56
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -71,18 +71,18 @@ class ImageLogos(BaseModel):
|
|
|
71
71
|
exclude=excluded_fields,
|
|
72
72
|
exclude_none=True,
|
|
73
73
|
)
|
|
74
|
-
# override the default output from pydantic by calling `to_dict()` of each item in
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in nodes (list)
|
|
75
75
|
_items = []
|
|
76
|
-
if self.
|
|
77
|
-
for
|
|
78
|
-
if
|
|
79
|
-
_items.append(
|
|
80
|
-
_dict['
|
|
76
|
+
if self.nodes:
|
|
77
|
+
for _item_nodes in self.nodes:
|
|
78
|
+
if _item_nodes:
|
|
79
|
+
_items.append(_item_nodes.to_dict())
|
|
80
|
+
_dict['nodes'] = _items
|
|
81
81
|
return _dict
|
|
82
82
|
|
|
83
83
|
@classmethod
|
|
84
84
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
-
"""Create an instance of
|
|
85
|
+
"""Create an instance of ClusterNodesListResponse from a dict"""
|
|
86
86
|
if obj is None:
|
|
87
87
|
return None
|
|
88
88
|
|
|
@@ -90,8 +90,8 @@ class ImageLogos(BaseModel):
|
|
|
90
90
|
return cls.model_validate(obj)
|
|
91
91
|
|
|
92
92
|
_obj = cls.model_validate({
|
|
93
|
-
"logos": [LogoGetResponse.from_dict(_item) for _item in obj["logos"]] if obj.get("logos") is not None else None,
|
|
94
93
|
"message": obj.get("message"),
|
|
94
|
+
"nodes": [ClusterNodeFields.from_dict(_item) for _item in obj["nodes"]] if obj.get("nodes") is not None else None,
|
|
95
95
|
"status": obj.get("status")
|
|
96
96
|
})
|
|
97
97
|
return _obj
|
|
@@ -23,15 +23,17 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
25
|
|
|
26
|
-
class
|
|
26
|
+
class ClusterVersion(BaseModel):
|
|
27
27
|
"""
|
|
28
|
-
|
|
28
|
+
ClusterVersion
|
|
29
29
|
""" # noqa: E501
|
|
30
30
|
created_at: Optional[datetime] = None
|
|
31
31
|
id: Optional[StrictInt] = None
|
|
32
|
-
|
|
33
|
-
region: Optional[
|
|
34
|
-
|
|
32
|
+
image: Optional[Dict[str, Any]] = None
|
|
33
|
+
region: Optional[Dict[str, Any]] = None
|
|
34
|
+
updated_at: Optional[datetime] = None
|
|
35
|
+
version: Optional[StrictStr] = None
|
|
36
|
+
__properties: ClassVar[List[str]] = ["created_at", "id", "image", "region", "updated_at", "version"]
|
|
35
37
|
|
|
36
38
|
model_config = ConfigDict(
|
|
37
39
|
populate_by_name=True,
|
|
@@ -51,7 +53,7 @@ class InternalEnvironmentFields(BaseModel):
|
|
|
51
53
|
|
|
52
54
|
@classmethod
|
|
53
55
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
-
"""Create an instance of
|
|
56
|
+
"""Create an instance of ClusterVersion from a JSON string"""
|
|
55
57
|
return cls.from_dict(json.loads(json_str))
|
|
56
58
|
|
|
57
59
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -76,7 +78,7 @@ class InternalEnvironmentFields(BaseModel):
|
|
|
76
78
|
|
|
77
79
|
@classmethod
|
|
78
80
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
-
"""Create an instance of
|
|
81
|
+
"""Create an instance of ClusterVersion from a dict"""
|
|
80
82
|
if obj is None:
|
|
81
83
|
return None
|
|
82
84
|
|
|
@@ -86,8 +88,10 @@ class InternalEnvironmentFields(BaseModel):
|
|
|
86
88
|
_obj = cls.model_validate({
|
|
87
89
|
"created_at": obj.get("created_at"),
|
|
88
90
|
"id": obj.get("id"),
|
|
89
|
-
"
|
|
90
|
-
"region": obj.get("region")
|
|
91
|
+
"image": obj.get("image"),
|
|
92
|
+
"region": obj.get("region"),
|
|
93
|
+
"updated_at": obj.get("updated_at"),
|
|
94
|
+
"version": obj.get("version")
|
|
91
95
|
})
|
|
92
96
|
return _obj
|
|
93
97
|
|
|
@@ -19,6 +19,7 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from ..models.cluster_version import ClusterVersion
|
|
22
23
|
from typing import Optional, Set
|
|
23
24
|
from typing_extensions import Self
|
|
24
25
|
|
|
@@ -28,7 +29,7 @@ class ClusterVersions(BaseModel):
|
|
|
28
29
|
""" # noqa: E501
|
|
29
30
|
message: Optional[StrictStr] = None
|
|
30
31
|
status: Optional[StrictBool] = None
|
|
31
|
-
versions: Optional[List[
|
|
32
|
+
versions: Optional[List[ClusterVersion]] = None
|
|
32
33
|
__properties: ClassVar[List[str]] = ["message", "status", "versions"]
|
|
33
34
|
|
|
34
35
|
model_config = ConfigDict(
|
|
@@ -70,6 +71,13 @@ class ClusterVersions(BaseModel):
|
|
|
70
71
|
exclude=excluded_fields,
|
|
71
72
|
exclude_none=True,
|
|
72
73
|
)
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of each item in versions (list)
|
|
75
|
+
_items = []
|
|
76
|
+
if self.versions:
|
|
77
|
+
for _item_versions in self.versions:
|
|
78
|
+
if _item_versions:
|
|
79
|
+
_items.append(_item_versions.to_dict())
|
|
80
|
+
_dict['versions'] = _items
|
|
73
81
|
return _dict
|
|
74
82
|
|
|
75
83
|
@classmethod
|
|
@@ -84,7 +92,7 @@ class ClusterVersions(BaseModel):
|
|
|
84
92
|
_obj = cls.model_validate({
|
|
85
93
|
"message": obj.get("message"),
|
|
86
94
|
"status": obj.get("status"),
|
|
87
|
-
"versions": obj.get("versions")
|
|
95
|
+
"versions": [ClusterVersion.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None
|
|
88
96
|
})
|
|
89
97
|
return _obj
|
|
90
98
|
|
|
@@ -19,16 +19,18 @@ import json
|
|
|
19
19
|
|
|
20
20
|
from pydantic import BaseModel, ConfigDict
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from ..models.
|
|
22
|
+
from ..models.primary_color import PrimaryColor
|
|
23
|
+
from ..models.secondary_color import SecondaryColor
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
26
|
-
class
|
|
27
|
+
class Colors(BaseModel):
|
|
27
28
|
"""
|
|
28
|
-
|
|
29
|
+
Colors
|
|
29
30
|
""" # noqa: E501
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
primary: Optional[PrimaryColor] = None
|
|
32
|
+
secondary: Optional[SecondaryColor] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["primary", "secondary"]
|
|
32
34
|
|
|
33
35
|
model_config = ConfigDict(
|
|
34
36
|
populate_by_name=True,
|
|
@@ -48,7 +50,7 @@ class FutureNodesStockModel(BaseModel):
|
|
|
48
50
|
|
|
49
51
|
@classmethod
|
|
50
52
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
-
"""Create an instance of
|
|
53
|
+
"""Create an instance of Colors from a JSON string"""
|
|
52
54
|
return cls.from_dict(json.loads(json_str))
|
|
53
55
|
|
|
54
56
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -69,18 +71,17 @@ class FutureNodesStockModel(BaseModel):
|
|
|
69
71
|
exclude=excluded_fields,
|
|
70
72
|
exclude_none=True,
|
|
71
73
|
)
|
|
72
|
-
# override the default output from pydantic by calling `to_dict()` of
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
_dict['future_stocks'] = _items
|
|
74
|
+
# override the default output from pydantic by calling `to_dict()` of primary
|
|
75
|
+
if self.primary:
|
|
76
|
+
_dict['primary'] = self.primary.to_dict()
|
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of secondary
|
|
78
|
+
if self.secondary:
|
|
79
|
+
_dict['secondary'] = self.secondary.to_dict()
|
|
79
80
|
return _dict
|
|
80
81
|
|
|
81
82
|
@classmethod
|
|
82
83
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
-
"""Create an instance of
|
|
84
|
+
"""Create an instance of Colors from a dict"""
|
|
84
85
|
if obj is None:
|
|
85
86
|
return None
|
|
86
87
|
|
|
@@ -88,7 +89,8 @@ class FutureNodesStockModel(BaseModel):
|
|
|
88
89
|
return cls.model_validate(obj)
|
|
89
90
|
|
|
90
91
|
_obj = cls.model_validate({
|
|
91
|
-
"
|
|
92
|
+
"primary": PrimaryColor.from_dict(obj["primary"]) if obj.get("primary") is not None else None,
|
|
93
|
+
"secondary": SecondaryColor.from_dict(obj["secondary"]) if obj.get("secondary") is not None else None
|
|
92
94
|
})
|
|
93
95
|
return _obj
|
|
94
96
|
|
|
@@ -32,10 +32,11 @@ class ContractDiscountPlanFields(BaseModel):
|
|
|
32
32
|
discount_status: Optional[StrictStr] = None
|
|
33
33
|
discount_type: Optional[StrictStr] = None
|
|
34
34
|
id: Optional[StrictInt] = None
|
|
35
|
+
remaining_count: Optional[StrictInt] = None
|
|
35
36
|
resource_count: Optional[StrictInt] = None
|
|
36
37
|
resource_id: Optional[StrictInt] = None
|
|
37
38
|
resource_name: Optional[StrictStr] = None
|
|
38
|
-
__properties: ClassVar[List[str]] = ["discount_amount", "discount_code", "discount_percent", "discount_status", "discount_type", "id", "resource_count", "resource_id", "resource_name"]
|
|
39
|
+
__properties: ClassVar[List[str]] = ["discount_amount", "discount_code", "discount_percent", "discount_status", "discount_type", "id", "remaining_count", "resource_count", "resource_id", "resource_name"]
|
|
39
40
|
|
|
40
41
|
model_config = ConfigDict(
|
|
41
42
|
populate_by_name=True,
|
|
@@ -94,6 +95,7 @@ class ContractDiscountPlanFields(BaseModel):
|
|
|
94
95
|
"discount_status": obj.get("discount_status"),
|
|
95
96
|
"discount_type": obj.get("discount_type"),
|
|
96
97
|
"id": obj.get("id"),
|
|
98
|
+
"remaining_count": obj.get("remaining_count"),
|
|
97
99
|
"resource_count": obj.get("resource_count"),
|
|
98
100
|
"resource_id": obj.get("resource_id"),
|
|
99
101
|
"resource_name": obj.get("resource_name")
|
|
@@ -20,6 +20,7 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from ..models.cluster_fields import ClusterFields
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
25
26
|
|
|
@@ -27,6 +28,7 @@ class ContractInstanceFields(BaseModel):
|
|
|
27
28
|
"""
|
|
28
29
|
ContractInstanceFields
|
|
29
30
|
""" # noqa: E501
|
|
31
|
+
cluster: Optional[ClusterFields] = None
|
|
30
32
|
created_at: Optional[datetime] = None
|
|
31
33
|
flavor_name: Optional[StrictStr] = None
|
|
32
34
|
gpu_count: Optional[StrictInt] = None
|
|
@@ -35,7 +37,7 @@ class ContractInstanceFields(BaseModel):
|
|
|
35
37
|
status: Optional[StrictStr] = None
|
|
36
38
|
termination_time: Optional[datetime] = None
|
|
37
39
|
total_usage_time: Optional[StrictInt] = None
|
|
38
|
-
__properties: ClassVar[List[str]] = ["created_at", "flavor_name", "gpu_count", "id", "name", "status", "termination_time", "total_usage_time"]
|
|
40
|
+
__properties: ClassVar[List[str]] = ["cluster", "created_at", "flavor_name", "gpu_count", "id", "name", "status", "termination_time", "total_usage_time"]
|
|
39
41
|
|
|
40
42
|
model_config = ConfigDict(
|
|
41
43
|
populate_by_name=True,
|
|
@@ -76,6 +78,9 @@ class ContractInstanceFields(BaseModel):
|
|
|
76
78
|
exclude=excluded_fields,
|
|
77
79
|
exclude_none=True,
|
|
78
80
|
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of cluster
|
|
82
|
+
if self.cluster:
|
|
83
|
+
_dict['cluster'] = self.cluster.to_dict()
|
|
79
84
|
return _dict
|
|
80
85
|
|
|
81
86
|
@classmethod
|
|
@@ -88,6 +93,7 @@ class ContractInstanceFields(BaseModel):
|
|
|
88
93
|
return cls.model_validate(obj)
|
|
89
94
|
|
|
90
95
|
_obj = cls.model_validate({
|
|
96
|
+
"cluster": ClusterFields.from_dict(obj["cluster"]) if obj.get("cluster") is not None else None,
|
|
91
97
|
"created_at": obj.get("created_at"),
|
|
92
98
|
"flavor_name": obj.get("flavor_name"),
|
|
93
99
|
"gpu_count": obj.get("gpu_count"),
|