platform-api-python-client 4.23.1__py3-none-any.whl → 4.28.0__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.
Files changed (44) hide show
  1. platform_api_python_client/__init__.py +18 -3
  2. platform_api_python_client/api/external_api.py +4508 -1469
  3. platform_api_python_client/api_client.py +1 -1
  4. platform_api_python_client/configuration.py +1 -1
  5. platform_api_python_client/models/__init__.py +17 -2
  6. platform_api_python_client/models/create_c_serve_v3_deployment_request.py +1 -8
  7. platform_api_python_client/models/create_compute_deployment_request.py +12 -2
  8. platform_api_python_client/models/create_dynamo_deployment_request.py +22 -3
  9. platform_api_python_client/models/{create_block_volume_request.py → create_filesystem_volume_request.py} +6 -6
  10. platform_api_python_client/models/create_inference_v3_deployment_request.py +1 -8
  11. platform_api_python_client/models/create_job_deployment_request.py +12 -2
  12. platform_api_python_client/models/create_volume_request.py +16 -16
  13. platform_api_python_client/models/delete_user_vault_item_request.py +108 -0
  14. platform_api_python_client/models/deployment_component_type.py +2 -0
  15. platform_api_python_client/models/deployment_log_event_v4.py +91 -0
  16. platform_api_python_client/models/deployment_response.py +21 -6
  17. platform_api_python_client/models/dynamo_serving_mode.py +37 -0
  18. platform_api_python_client/models/dynamo_worker_pool_config.py +103 -0
  19. platform_api_python_client/models/dynamo_worker_pools.py +109 -0
  20. platform_api_python_client/models/get_c_serve_v3_deployment_response.py +1 -8
  21. platform_api_python_client/models/get_cluster_response.py +5 -3
  22. platform_api_python_client/models/get_compute_deployment_response.py +11 -1
  23. platform_api_python_client/models/get_deployment_log_v4_response.py +95 -0
  24. platform_api_python_client/models/get_deployment_pods_response.py +87 -0
  25. platform_api_python_client/models/get_dynamo_deployment_response.py +15 -1
  26. platform_api_python_client/models/{get_block_volume_response.py → get_filesystem_volume_response.py} +6 -6
  27. platform_api_python_client/models/get_inference_v3_deployment_response.py +1 -8
  28. platform_api_python_client/models/get_job_deployment_response.py +12 -2
  29. platform_api_python_client/models/get_volume_response.py +16 -16
  30. platform_api_python_client/models/hardware_preset_response.py +96 -0
  31. platform_api_python_client/models/list_hardware_preset_response.py +95 -0
  32. platform_api_python_client/models/list_organization_gpu_quota_response.py +95 -0
  33. platform_api_python_client/models/organization_gpu_quota_request.py +88 -0
  34. platform_api_python_client/models/organization_gpu_quota_response.py +91 -0
  35. platform_api_python_client/models/update_cluster_metadata_request.py +87 -0
  36. platform_api_python_client/models/upsert_user_vault_item_request.py +103 -0
  37. platform_api_python_client/models/user_vault_item.py +6 -3
  38. platform_api_python_client/models/volume_access_mode.py +0 -1
  39. platform_api_python_client/models/volume_backend.py +1 -1
  40. platform_api_python_client/models/volume_mount.py +92 -0
  41. {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/METADATA +1 -1
  42. {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/RECORD +44 -29
  43. {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/WHEEL +1 -1
  44. {platform_api_python_client-4.23.1.dist-info → platform_api_python_client-4.28.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,87 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class GetDeploymentPodsResponse(BaseModel):
26
+ """
27
+ GetDeploymentPodsResponse
28
+ """ # noqa: E501
29
+ pods: List[StrictStr]
30
+ __properties: ClassVar[List[str]] = ["pods"]
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 GetDeploymentPodsResponse 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 GetDeploymentPodsResponse 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
+ "pods": obj.get("pods")
84
+ })
85
+ return _obj
86
+
87
+
@@ -23,6 +23,8 @@ from typing import Any, ClassVar, Dict, List, Optional
23
23
  from platform_api_python_client.models.backend_protocol import BackendProtocol
24
24
  from platform_api_python_client.models.deployment_status import DeploymentStatus
25
25
  from platform_api_python_client.models.deployment_type import DeploymentType
26
+ from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode
27
+ from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools
26
28
  from typing import Optional, Set
27
29
  from typing_extensions import Self
28
30
 
@@ -42,6 +44,8 @@ class GetDynamoDeploymentResponse(BaseModel):
42
44
  hardware_instance_id: StrictInt
43
45
  revision_number: StrictInt
44
46
  user_annotations: Optional[Dict[str, StrictStr]] = None
47
+ serving_mode: Optional[DynamoServingMode] = None
48
+ worker_pools: Optional[DynamoWorkerPools] = None
45
49
  model: StrictStr
46
50
  served_model_name: Optional[StrictStr] = None
47
51
  min_replicas: StrictInt
@@ -55,7 +59,7 @@ class GetDynamoDeploymentResponse(BaseModel):
55
59
  enable_logging: Optional[StrictBool] = True
56
60
  enable_node_model_cache: Optional[StrictBool] = False
57
61
  backend_protocol: Optional[BackendProtocol] = None
58
- __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "model", "served_model_name", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "env_vars", "endpoint_certificate_authority", "endpoint_bearer_token", "enable_logging", "enable_node_model_cache", "backend_protocol"]
62
+ __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "serving_mode", "worker_pools", "model", "served_model_name", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "env_vars", "endpoint_certificate_authority", "endpoint_bearer_token", "enable_logging", "enable_node_model_cache", "backend_protocol"]
59
63
 
60
64
  model_config = ConfigDict(
61
65
  populate_by_name=True,
@@ -96,6 +100,9 @@ class GetDynamoDeploymentResponse(BaseModel):
96
100
  exclude=excluded_fields,
97
101
  exclude_none=True,
98
102
  )
103
+ # override the default output from pydantic by calling `to_dict()` of worker_pools
104
+ if self.worker_pools:
105
+ _dict['worker_pools'] = self.worker_pools.to_dict()
99
106
  # set to None if image_url (nullable) is None
100
107
  # and model_fields_set contains the field
101
108
  if self.image_url is None and "image_url" in self.model_fields_set:
@@ -106,6 +113,11 @@ class GetDynamoDeploymentResponse(BaseModel):
106
113
  if self.user_annotations is None and "user_annotations" in self.model_fields_set:
107
114
  _dict['user_annotations'] = None
108
115
 
116
+ # set to None if worker_pools (nullable) is None
117
+ # and model_fields_set contains the field
118
+ if self.worker_pools is None and "worker_pools" in self.model_fields_set:
119
+ _dict['worker_pools'] = None
120
+
109
121
  # set to None if served_model_name (nullable) is None
110
122
  # and model_fields_set contains the field
111
123
  if self.served_model_name is None and "served_model_name" in self.model_fields_set:
@@ -160,6 +172,8 @@ class GetDynamoDeploymentResponse(BaseModel):
160
172
  "hardware_instance_id": obj.get("hardware_instance_id"),
161
173
  "revision_number": obj.get("revision_number"),
162
174
  "user_annotations": obj.get("user_annotations"),
175
+ "serving_mode": obj.get("serving_mode"),
176
+ "worker_pools": DynamoWorkerPools.from_dict(obj["worker_pools"]) if obj.get("worker_pools") is not None else None,
163
177
  "model": obj.get("model"),
164
178
  "served_model_name": obj.get("served_model_name"),
165
179
  "min_replicas": obj.get("min_replicas"),
@@ -25,9 +25,9 @@ from platform_api_python_client.models.volume_status import VolumeStatus
25
25
  from typing import Optional, Set
26
26
  from typing_extensions import Self
27
27
 
28
- class GetBlockVolumeResponse(BaseModel):
28
+ class GetFilesystemVolumeResponse(BaseModel):
29
29
  """
30
- GetBlockVolumeResponse
30
+ GetFilesystemVolumeResponse
31
31
  """ # noqa: E501
32
32
  id: StrictInt
33
33
  name: StrictStr
@@ -44,8 +44,8 @@ class GetBlockVolumeResponse(BaseModel):
44
44
  @field_validator('backend')
45
45
  def backend_validate_enum(cls, value):
46
46
  """Validates the enum"""
47
- if value not in set(['block']):
48
- raise ValueError("must be one of enum values ('block')")
47
+ if value not in set(['filesystem']):
48
+ raise ValueError("must be one of enum values ('filesystem')")
49
49
  return value
50
50
 
51
51
  model_config = ConfigDict(
@@ -66,7 +66,7 @@ class GetBlockVolumeResponse(BaseModel):
66
66
 
67
67
  @classmethod
68
68
  def from_json(cls, json_str: str) -> Optional[Self]:
69
- """Create an instance of GetBlockVolumeResponse from a JSON string"""
69
+ """Create an instance of GetFilesystemVolumeResponse from a JSON string"""
70
70
  return cls.from_dict(json.loads(json_str))
71
71
 
72
72
  def to_dict(self) -> Dict[str, Any]:
@@ -91,7 +91,7 @@ class GetBlockVolumeResponse(BaseModel):
91
91
 
92
92
  @classmethod
93
93
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
94
- """Create an instance of GetBlockVolumeResponse from a dict"""
94
+ """Create an instance of GetFilesystemVolumeResponse from a dict"""
95
95
  if obj is None:
96
96
  return None
97
97
 
@@ -48,7 +48,6 @@ class GetInferenceV3DeploymentResponse(BaseModel):
48
48
  container_port: StrictInt
49
49
  min_replicas: StrictInt
50
50
  max_replicas: StrictInt
51
- initial_replicas: Optional[StrictInt] = None
52
51
  concurrency: Optional[StrictInt] = None
53
52
  cooldown_period: Optional[StrictInt] = 1800
54
53
  healthcheck: Optional[StrictStr] = None
@@ -65,7 +64,7 @@ class GetInferenceV3DeploymentResponse(BaseModel):
65
64
  session_affinity: Optional[StrictBool] = Field(default=False, description="Enable best-effort sticky routing via the `X-Session-Id` request header. Requests carrying the same header value land on the same pod, improving KV cache reuse for agentic workloads. Requests without the header are routed at random. Affinity is NOT durable: scaling, rollouts, restarts, or readiness-probe transitions will remap sessions to different pods. Do not use for irreplaceable in-pod state.")
66
65
  config_file: Optional[ConfigFileMount] = None
67
66
  metrics: Optional[MetricsConfig] = None
68
- __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "container_port", "min_replicas", "max_replicas", "initial_replicas", "concurrency", "cooldown_period", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args", "original_command", "image_pull_secret_credentials", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
67
+ __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "container_port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args", "original_command", "image_pull_secret_credentials", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
69
68
 
70
69
  model_config = ConfigDict(
71
70
  populate_by_name=True,
@@ -125,11 +124,6 @@ class GetInferenceV3DeploymentResponse(BaseModel):
125
124
  if self.user_annotations is None and "user_annotations" in self.model_fields_set:
126
125
  _dict['user_annotations'] = None
127
126
 
128
- # set to None if initial_replicas (nullable) is None
129
- # and model_fields_set contains the field
130
- if self.initial_replicas is None and "initial_replicas" in self.model_fields_set:
131
- _dict['initial_replicas'] = None
132
-
133
127
  # set to None if concurrency (nullable) is None
134
128
  # and model_fields_set contains the field
135
129
  if self.concurrency is None and "concurrency" in self.model_fields_set:
@@ -212,7 +206,6 @@ class GetInferenceV3DeploymentResponse(BaseModel):
212
206
  "container_port": obj.get("container_port"),
213
207
  "min_replicas": obj.get("min_replicas"),
214
208
  "max_replicas": obj.get("max_replicas"),
215
- "initial_replicas": obj.get("initial_replicas"),
216
209
  "concurrency": obj.get("concurrency"),
217
210
  "cooldown_period": obj.get("cooldown_period") if obj.get("cooldown_period") is not None else 1800,
218
211
  "healthcheck": obj.get("healthcheck"),
@@ -24,6 +24,7 @@ from platform_api_python_client.models.config_file_mount import ConfigFileMount
24
24
  from platform_api_python_client.models.deployment_status import DeploymentStatus
25
25
  from platform_api_python_client.models.deployment_type import DeploymentType
26
26
  from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials
27
+ from platform_api_python_client.models.volume_mount import VolumeMount
27
28
  from typing import Optional, Set
28
29
  from typing_extensions import Self
29
30
 
@@ -54,7 +55,8 @@ class GetJobDeploymentResponse(BaseModel):
54
55
  image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
55
56
  enable_logging: Optional[StrictBool] = True
56
57
  config_file: Optional[ConfigFileMount] = None
57
- __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "env_vars", "command", "args", "original_command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "image_pull_secret_credentials", "enable_logging", "config_file"]
58
+ volume_mounts: Optional[List[VolumeMount]] = None
59
+ __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "user_annotations", "env_vars", "command", "args", "original_command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "image_pull_secret_credentials", "enable_logging", "config_file", "volume_mounts"]
58
60
 
59
61
  model_config = ConfigDict(
60
62
  populate_by_name=True,
@@ -101,6 +103,13 @@ class GetJobDeploymentResponse(BaseModel):
101
103
  # override the default output from pydantic by calling `to_dict()` of config_file
102
104
  if self.config_file:
103
105
  _dict['config_file'] = self.config_file.to_dict()
106
+ # override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
107
+ _items = []
108
+ if self.volume_mounts:
109
+ for _item_volume_mounts in self.volume_mounts:
110
+ if _item_volume_mounts:
111
+ _items.append(_item_volume_mounts.to_dict())
112
+ _dict['volume_mounts'] = _items
104
113
  # set to None if image_url (nullable) is None
105
114
  # and model_fields_set contains the field
106
115
  if self.image_url is None and "image_url" in self.model_fields_set:
@@ -180,7 +189,8 @@ class GetJobDeploymentResponse(BaseModel):
180
189
  "active_deadline_seconds": obj.get("active_deadline_seconds"),
181
190
  "image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
182
191
  "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
183
- "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None
192
+ "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None,
193
+ "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None
184
194
  })
185
195
  return _obj
186
196
 
@@ -17,24 +17,24 @@ import json
17
17
  import pprint
18
18
  from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
19
  from typing import Any, List, Optional
20
- from platform_api_python_client.models.get_block_volume_response import GetBlockVolumeResponse
20
+ from platform_api_python_client.models.get_filesystem_volume_response import GetFilesystemVolumeResponse
21
21
  from platform_api_python_client.models.get_object_volume_response import GetObjectVolumeResponse
22
22
  from pydantic import StrictStr, Field
23
23
  from typing import Union, List, Set, Optional, Dict
24
24
  from typing_extensions import Literal, Self
25
25
 
26
- GETVOLUMERESPONSE_ONE_OF_SCHEMAS = ["GetBlockVolumeResponse", "GetObjectVolumeResponse"]
26
+ GETVOLUMERESPONSE_ONE_OF_SCHEMAS = ["GetFilesystemVolumeResponse", "GetObjectVolumeResponse"]
27
27
 
28
28
  class GetVolumeResponse(BaseModel):
29
29
  """
30
30
  GetVolumeResponse
31
31
  """
32
- # data type: GetBlockVolumeResponse
33
- oneof_schema_1_validator: Optional[GetBlockVolumeResponse] = None
32
+ # data type: GetFilesystemVolumeResponse
33
+ oneof_schema_1_validator: Optional[GetFilesystemVolumeResponse] = None
34
34
  # data type: GetObjectVolumeResponse
35
35
  oneof_schema_2_validator: Optional[GetObjectVolumeResponse] = None
36
- actual_instance: Optional[Union[GetBlockVolumeResponse, GetObjectVolumeResponse]] = None
37
- one_of_schemas: Set[str] = { "GetBlockVolumeResponse", "GetObjectVolumeResponse" }
36
+ actual_instance: Optional[Union[GetFilesystemVolumeResponse, GetObjectVolumeResponse]] = None
37
+ one_of_schemas: Set[str] = { "GetFilesystemVolumeResponse", "GetObjectVolumeResponse" }
38
38
 
39
39
  model_config = ConfigDict(
40
40
  validate_assignment=True,
@@ -60,9 +60,9 @@ class GetVolumeResponse(BaseModel):
60
60
  instance = GetVolumeResponse.model_construct()
61
61
  error_messages = []
62
62
  match = 0
63
- # validate data type: GetBlockVolumeResponse
64
- if not isinstance(v, GetBlockVolumeResponse):
65
- error_messages.append(f"Error! Input type `{type(v)}` is not `GetBlockVolumeResponse`")
63
+ # validate data type: GetFilesystemVolumeResponse
64
+ if not isinstance(v, GetFilesystemVolumeResponse):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `GetFilesystemVolumeResponse`")
66
66
  else:
67
67
  match += 1
68
68
  # validate data type: GetObjectVolumeResponse
@@ -72,10 +72,10 @@ class GetVolumeResponse(BaseModel):
72
72
  match += 1
73
73
  if match > 1:
74
74
  # more than 1 match
75
- raise ValueError("Multiple matches found when setting `actual_instance` in GetVolumeResponse with oneOf schemas: GetBlockVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
75
+ raise ValueError("Multiple matches found when setting `actual_instance` in GetVolumeResponse with oneOf schemas: GetFilesystemVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
76
76
  elif match == 0:
77
77
  # no match
78
- raise ValueError("No match found when setting `actual_instance` in GetVolumeResponse with oneOf schemas: GetBlockVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
78
+ raise ValueError("No match found when setting `actual_instance` in GetVolumeResponse with oneOf schemas: GetFilesystemVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
79
79
  else:
80
80
  return v
81
81
 
@@ -90,9 +90,9 @@ class GetVolumeResponse(BaseModel):
90
90
  error_messages = []
91
91
  match = 0
92
92
 
93
- # deserialize data into GetBlockVolumeResponse
93
+ # deserialize data into GetFilesystemVolumeResponse
94
94
  try:
95
- instance.actual_instance = GetBlockVolumeResponse.from_json(json_str)
95
+ instance.actual_instance = GetFilesystemVolumeResponse.from_json(json_str)
96
96
  match += 1
97
97
  except (ValidationError, ValueError) as e:
98
98
  error_messages.append(str(e))
@@ -105,10 +105,10 @@ class GetVolumeResponse(BaseModel):
105
105
 
106
106
  if match > 1:
107
107
  # more than 1 match
108
- raise ValueError("Multiple matches found when deserializing the JSON string into GetVolumeResponse with oneOf schemas: GetBlockVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
108
+ raise ValueError("Multiple matches found when deserializing the JSON string into GetVolumeResponse with oneOf schemas: GetFilesystemVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
109
109
  elif match == 0:
110
110
  # no match
111
- raise ValueError("No match found when deserializing the JSON string into GetVolumeResponse with oneOf schemas: GetBlockVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
111
+ raise ValueError("No match found when deserializing the JSON string into GetVolumeResponse with oneOf schemas: GetFilesystemVolumeResponse, GetObjectVolumeResponse. Details: " + ", ".join(error_messages))
112
112
  else:
113
113
  return instance
114
114
 
@@ -122,7 +122,7 @@ class GetVolumeResponse(BaseModel):
122
122
  else:
123
123
  return json.dumps(self.actual_instance)
124
124
 
125
- def to_dict(self) -> Optional[Union[Dict[str, Any], GetBlockVolumeResponse, GetObjectVolumeResponse]]:
125
+ def to_dict(self) -> Optional[Union[Dict[str, Any], GetFilesystemVolumeResponse, GetObjectVolumeResponse]]:
126
126
  """Returns the dict representation of the actual instance"""
127
127
  if self.actual_instance is None:
128
128
  return None
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.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, StrictBool, StrictInt, StrictStr
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class HardwarePresetResponse(BaseModel):
26
+ """
27
+ HardwarePresetResponse
28
+ """ # noqa: E501
29
+ gpu_type: StrictStr
30
+ accelerator_memory: Optional[StrictInt] = None
31
+ is_mig: StrictBool
32
+ __properties: ClassVar[List[str]] = ["gpu_type", "accelerator_memory", "is_mig"]
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 HardwarePresetResponse 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
+ # set to None if accelerator_memory (nullable) is None
74
+ # and model_fields_set contains the field
75
+ if self.accelerator_memory is None and "accelerator_memory" in self.model_fields_set:
76
+ _dict['accelerator_memory'] = None
77
+
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of HardwarePresetResponse from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "gpu_type": obj.get("gpu_type"),
91
+ "accelerator_memory": obj.get("accelerator_memory"),
92
+ "is_mig": obj.get("is_mig")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ListHardwarePresetResponse(BaseModel):
27
+ """
28
+ ListHardwarePresetResponse
29
+ """ # noqa: E501
30
+ results: List[HardwarePresetResponse]
31
+ __properties: ClassVar[List[str]] = ["results"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ListHardwarePresetResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
73
+ _items = []
74
+ if self.results:
75
+ for _item_results in self.results:
76
+ if _item_results:
77
+ _items.append(_item_results.to_dict())
78
+ _dict['results'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListHardwarePresetResponse from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "results": [HardwarePresetResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Platform External API
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: 0.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
21
+ from typing import Any, ClassVar, Dict, List
22
+ from platform_api_python_client.models.organization_gpu_quota_response import OrganizationGpuQuotaResponse
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class ListOrganizationGpuQuotaResponse(BaseModel):
27
+ """
28
+ ListOrganizationGpuQuotaResponse
29
+ """ # noqa: E501
30
+ results: List[OrganizationGpuQuotaResponse]
31
+ __properties: ClassVar[List[str]] = ["results"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of ListOrganizationGpuQuotaResponse from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in results (list)
73
+ _items = []
74
+ if self.results:
75
+ for _item_results in self.results:
76
+ if _item_results:
77
+ _items.append(_item_results.to_dict())
78
+ _dict['results'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of ListOrganizationGpuQuotaResponse from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "results": [OrganizationGpuQuotaResponse.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None
92
+ })
93
+ return _obj
94
+
95
+