platform-api-python-client 4.31.0__py3-none-any.whl → 4.37.1__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 (70) hide show
  1. platform_api_python_client/__init__.py +39 -10
  2. platform_api_python_client/api/external_api.py +6460 -1203
  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 +38 -9
  6. platform_api_python_client/models/ccl_dynamo_pools.py +116 -0
  7. platform_api_python_client/models/{create_c_serve_v2_deployment_response.py → ccl_main_pools.py} +12 -13
  8. platform_api_python_client/models/cluster_credential.py +2 -2
  9. platform_api_python_client/models/create_compute_deployment_request.py +27 -1
  10. platform_api_python_client/models/create_dynamo_deployment_request.py +42 -1
  11. platform_api_python_client/models/create_filesystem_volume_request.py +0 -13
  12. platform_api_python_client/models/create_inference_v3_deployment_request.py +42 -2
  13. platform_api_python_client/models/create_job_deployment_request.py +27 -1
  14. platform_api_python_client/models/create_object_volume_request.py +0 -13
  15. platform_api_python_client/models/deployment_response.py +12 -27
  16. platform_api_python_client/models/deployment_type.py +14 -0
  17. platform_api_python_client/models/dynamo_communications_input.py +0 -13
  18. platform_api_python_client/models/dynamo_communications_output.py +0 -13
  19. platform_api_python_client/models/dynamo_image.py +105 -0
  20. platform_api_python_client/models/dynamo_kv_transfer_configuration.py +0 -13
  21. platform_api_python_client/models/dynamo_weight_transfer_configuration.py +88 -0
  22. platform_api_python_client/models/dynamo_weight_transfer_policy.py +36 -0
  23. platform_api_python_client/models/dynamo_worker_pool_config.py +1 -14
  24. platform_api_python_client/models/dynamo_worker_pools.py +0 -13
  25. platform_api_python_client/models/env.py +89 -0
  26. platform_api_python_client/models/get_cluster_response.py +4 -2
  27. platform_api_python_client/models/get_compute_deployment_response.py +29 -2
  28. platform_api_python_client/models/get_deployment_usage_response.py +19 -4
  29. platform_api_python_client/models/get_dynamo_deployment_response.py +43 -1
  30. platform_api_python_client/models/get_inference_v3_deployment_response.py +43 -2
  31. platform_api_python_client/models/get_job_deployment_response.py +29 -2
  32. platform_api_python_client/models/hardware_instance_response.py +6 -2
  33. platform_api_python_client/models/image.py +112 -0
  34. platform_api_python_client/models/ingress.py +103 -0
  35. platform_api_python_client/models/insight_list_item_response.py +108 -0
  36. platform_api_python_client/models/insight_resource.py +97 -0
  37. platform_api_python_client/models/insight_resource_type.py +37 -0
  38. platform_api_python_client/models/insight_response.py +133 -0
  39. platform_api_python_client/models/insight_severity.py +40 -0
  40. platform_api_python_client/models/insight_status.py +39 -0
  41. platform_api_python_client/models/{c_serve_recipe_response.py → insight_status_change_response.py} +28 -24
  42. platform_api_python_client/models/{c_serve_recipe_perf.py → list_insights_response.py} +16 -19
  43. platform_api_python_client/models/metric.py +13 -0
  44. platform_api_python_client/models/pool.py +116 -0
  45. platform_api_python_client/models/{get_c_serve_v2_deployment_response.py → unified_get_compute_deployment_response.py} +65 -81
  46. platform_api_python_client/models/unified_get_deployment_logs_response.py +95 -0
  47. platform_api_python_client/models/{create_c_serve_v3_deployment_response.py → unified_get_deployment_pods_response.py} +8 -13
  48. platform_api_python_client/models/unified_get_deployment_response.py +164 -0
  49. platform_api_python_client/models/unified_get_deployment_revision_response.py +109 -0
  50. platform_api_python_client/models/unified_get_deployment_rollout_response.py +90 -0
  51. platform_api_python_client/models/unified_get_deployment_usage_response.py +110 -0
  52. platform_api_python_client/models/unified_get_dynamo_deployment_response.py +218 -0
  53. platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +228 -0
  54. platform_api_python_client/models/{get_c_serve_v3_deployment_response.py → unified_get_job_deployment_response.py} +85 -75
  55. platform_api_python_client/models/{list_c_serve_recipe_response.py → unified_list_deployment_revisions_response.py} +7 -7
  56. platform_api_python_client/models/unified_update_deployment_rollout_request.py +87 -0
  57. platform_api_python_client/models/unified_write_compute_deployment_request.py +154 -0
  58. platform_api_python_client/models/unified_write_deployment_request.py +164 -0
  59. platform_api_python_client/models/{c_serve_v2_recipe.py → unified_write_deployment_response.py} +27 -27
  60. platform_api_python_client/models/unified_write_dynamo_deployment_request.py +197 -0
  61. platform_api_python_client/models/{create_c_serve_v3_deployment_request.py → unified_write_inference_v3_deployment_request.py} +78 -70
  62. platform_api_python_client/models/unified_write_job_deployment_request.py +183 -0
  63. platform_api_python_client/models/update_insight_status_request.py +106 -0
  64. platform_api_python_client/models/upsert_user_vault_item_request.py +1 -1
  65. platform_api_python_client/models/usage_availability.py +40 -0
  66. platform_api_python_client/models/usage_component.py +39 -0
  67. {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/METADATA +1 -1
  68. {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/RECORD +70 -41
  69. {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/WHEEL +1 -1
  70. {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.37.1.dist-info}/top_level.txt +0 -0
@@ -20,38 +20,48 @@ import json
20
20
  from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing_extensions import Annotated
23
- from platform_api_python_client.models.c_serve_v2_recipe import CServeV2Recipe
23
+ from platform_api_python_client.models.ccl_main_pools import CclMainPools
24
+ from platform_api_python_client.models.config_file_mount import ConfigFileMount
25
+ from platform_api_python_client.models.env import Env
26
+ from platform_api_python_client.models.image import Image
27
+ from platform_api_python_client.models.ingress import Ingress
28
+ from platform_api_python_client.models.metrics_config import MetricsConfig
24
29
  from platform_api_python_client.models.volume_mount import VolumeMount
25
30
  from typing import Optional, Set
26
31
  from typing_extensions import Self
27
32
 
28
- class CreateCServeV3DeploymentRequest(BaseModel):
33
+ class UnifiedWriteInferenceV3DeploymentRequest(BaseModel):
29
34
  """
30
- CreateCServeV3DeploymentRequest
35
+ UnifiedWriteInferenceV3DeploymentRequest
31
36
  """ # noqa: E501
32
- max_surge: Optional[StrictInt] = None
33
- max_unavailable: Optional[StrictInt] = None
37
+ type: StrictStr
34
38
  name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
35
39
  cluster_id: StrictInt
36
- hardware_instance_id: StrictInt
37
40
  user_annotations: Optional[Dict[str, StrictStr]] = None
38
41
  chart_revision: Optional[StrictStr] = None
39
42
  volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
40
43
  priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
41
- recipe: CServeV2Recipe
42
- cserve_version: Optional[StrictStr] = None
43
- hf_token: Optional[StrictStr] = None
44
- endpoint_bearer_token: Optional[StrictStr] = None
45
- endpoint_certificate_authority: Optional[StrictStr] = None
46
- min_replicas: StrictInt
47
- max_replicas: StrictInt
48
- concurrency: Optional[StrictInt] = None
49
- cooldown_period: Optional[StrictInt] = None
50
- env_vars: Optional[Dict[str, StrictStr]] = None
51
- enable_logging: Optional[StrictBool] = True
52
- enable_node_model_cache: Optional[StrictBool] = False
44
+ pools: CclMainPools
45
+ env: Optional[Env] = None
46
+ image: Image
47
+ ingress: Ingress
48
+ port: Annotated[int, Field(le=65535, strict=True, ge=1)]
49
+ healthcheck: Optional[StrictStr] = None
50
+ command: Optional[StrictStr] = None
51
+ config_file: Optional[ConfigFileMount] = None
52
+ hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
53
53
  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.")
54
- __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "recipe", "cserve_version", "hf_token", "endpoint_bearer_token", "endpoint_certificate_authority", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "env_vars", "enable_logging", "enable_node_model_cache", "session_affinity"]
54
+ metrics: Optional[MetricsConfig] = None
55
+ enable_logging: Optional[StrictBool] = False
56
+ enable_node_model_cache: Optional[StrictBool] = False
57
+ __properties: ClassVar[List[str]] = ["type", "name", "cluster_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "pools", "env", "image", "ingress", "port", "healthcheck", "command", "config_file", "hf_token_ref", "session_affinity", "metrics", "enable_logging", "enable_node_model_cache"]
58
+
59
+ @field_validator('type')
60
+ def type_validate_enum(cls, value):
61
+ """Validates the enum"""
62
+ if value not in set(['ccl_inference']):
63
+ raise ValueError("must be one of enum values ('ccl_inference')")
64
+ return value
55
65
 
56
66
  @field_validator('name')
57
67
  def name_validate_regular_expression(cls, value):
@@ -78,7 +88,7 @@ class CreateCServeV3DeploymentRequest(BaseModel):
78
88
 
79
89
  @classmethod
80
90
  def from_json(cls, json_str: str) -> Optional[Self]:
81
- """Create an instance of CreateCServeV3DeploymentRequest from a JSON string"""
91
+ """Create an instance of UnifiedWriteInferenceV3DeploymentRequest from a JSON string"""
82
92
  return cls.from_dict(json.loads(json_str))
83
93
 
84
94
  def to_dict(self) -> Dict[str, Any]:
@@ -106,19 +116,24 @@ class CreateCServeV3DeploymentRequest(BaseModel):
106
116
  if _item_volume_mounts:
107
117
  _items.append(_item_volume_mounts.to_dict())
108
118
  _dict['volume_mounts'] = _items
109
- # override the default output from pydantic by calling `to_dict()` of recipe
110
- if self.recipe:
111
- _dict['recipe'] = self.recipe.to_dict()
112
- # set to None if max_surge (nullable) is None
113
- # and model_fields_set contains the field
114
- if self.max_surge is None and "max_surge" in self.model_fields_set:
115
- _dict['max_surge'] = None
116
-
117
- # set to None if max_unavailable (nullable) is None
118
- # and model_fields_set contains the field
119
- if self.max_unavailable is None and "max_unavailable" in self.model_fields_set:
120
- _dict['max_unavailable'] = None
121
-
119
+ # override the default output from pydantic by calling `to_dict()` of pools
120
+ if self.pools:
121
+ _dict['pools'] = self.pools.to_dict()
122
+ # override the default output from pydantic by calling `to_dict()` of env
123
+ if self.env:
124
+ _dict['env'] = self.env.to_dict()
125
+ # override the default output from pydantic by calling `to_dict()` of image
126
+ if self.image:
127
+ _dict['image'] = self.image.to_dict()
128
+ # override the default output from pydantic by calling `to_dict()` of ingress
129
+ if self.ingress:
130
+ _dict['ingress'] = self.ingress.to_dict()
131
+ # override the default output from pydantic by calling `to_dict()` of config_file
132
+ if self.config_file:
133
+ _dict['config_file'] = self.config_file.to_dict()
134
+ # override the default output from pydantic by calling `to_dict()` of metrics
135
+ if self.metrics:
136
+ _dict['metrics'] = self.metrics.to_dict()
122
137
  # set to None if user_annotations (nullable) is None
123
138
  # and model_fields_set contains the field
124
139
  if self.user_annotations is None and "user_annotations" in self.model_fields_set:
@@ -129,41 +144,36 @@ class CreateCServeV3DeploymentRequest(BaseModel):
129
144
  if self.priority is None and "priority" in self.model_fields_set:
130
145
  _dict['priority'] = None
131
146
 
132
- # set to None if cserve_version (nullable) is None
133
- # and model_fields_set contains the field
134
- if self.cserve_version is None and "cserve_version" in self.model_fields_set:
135
- _dict['cserve_version'] = None
136
-
137
- # set to None if hf_token (nullable) is None
147
+ # set to None if healthcheck (nullable) is None
138
148
  # and model_fields_set contains the field
139
- if self.hf_token is None and "hf_token" in self.model_fields_set:
140
- _dict['hf_token'] = None
149
+ if self.healthcheck is None and "healthcheck" in self.model_fields_set:
150
+ _dict['healthcheck'] = None
141
151
 
142
- # set to None if endpoint_bearer_token (nullable) is None
152
+ # set to None if command (nullable) is None
143
153
  # and model_fields_set contains the field
144
- if self.endpoint_bearer_token is None and "endpoint_bearer_token" in self.model_fields_set:
145
- _dict['endpoint_bearer_token'] = None
154
+ if self.command is None and "command" in self.model_fields_set:
155
+ _dict['command'] = None
146
156
 
147
- # set to None if endpoint_certificate_authority (nullable) is None
157
+ # set to None if config_file (nullable) is None
148
158
  # and model_fields_set contains the field
149
- if self.endpoint_certificate_authority is None and "endpoint_certificate_authority" in self.model_fields_set:
150
- _dict['endpoint_certificate_authority'] = None
159
+ if self.config_file is None and "config_file" in self.model_fields_set:
160
+ _dict['config_file'] = None
151
161
 
152
- # set to None if concurrency (nullable) is None
162
+ # set to None if hf_token_ref (nullable) is None
153
163
  # and model_fields_set contains the field
154
- if self.concurrency is None and "concurrency" in self.model_fields_set:
155
- _dict['concurrency'] = None
164
+ if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
165
+ _dict['hf_token_ref'] = None
156
166
 
157
- # set to None if cooldown_period (nullable) is None
167
+ # set to None if metrics (nullable) is None
158
168
  # and model_fields_set contains the field
159
- if self.cooldown_period is None and "cooldown_period" in self.model_fields_set:
160
- _dict['cooldown_period'] = None
169
+ if self.metrics is None and "metrics" in self.model_fields_set:
170
+ _dict['metrics'] = None
161
171
 
162
172
  return _dict
163
173
 
164
174
  @classmethod
165
175
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
166
- """Create an instance of CreateCServeV3DeploymentRequest from a dict"""
176
+ """Create an instance of UnifiedWriteInferenceV3DeploymentRequest from a dict"""
167
177
  if obj is None:
168
178
  return None
169
179
 
@@ -171,28 +181,26 @@ class CreateCServeV3DeploymentRequest(BaseModel):
171
181
  return cls.model_validate(obj)
172
182
 
173
183
  _obj = cls.model_validate({
174
- "max_surge": obj.get("max_surge"),
175
- "max_unavailable": obj.get("max_unavailable"),
184
+ "type": obj.get("type"),
176
185
  "name": obj.get("name"),
177
186
  "cluster_id": obj.get("cluster_id"),
178
- "hardware_instance_id": obj.get("hardware_instance_id"),
179
187
  "user_annotations": obj.get("user_annotations"),
180
188
  "chart_revision": obj.get("chart_revision"),
181
189
  "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
182
190
  "priority": obj.get("priority"),
183
- "recipe": CServeV2Recipe.from_dict(obj["recipe"]) if obj.get("recipe") is not None else None,
184
- "cserve_version": obj.get("cserve_version"),
185
- "hf_token": obj.get("hf_token"),
186
- "endpoint_bearer_token": obj.get("endpoint_bearer_token"),
187
- "endpoint_certificate_authority": obj.get("endpoint_certificate_authority"),
188
- "min_replicas": obj.get("min_replicas"),
189
- "max_replicas": obj.get("max_replicas"),
190
- "concurrency": obj.get("concurrency"),
191
- "cooldown_period": obj.get("cooldown_period"),
192
- "env_vars": obj.get("env_vars"),
193
- "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
194
- "enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
195
- "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False
191
+ "pools": CclMainPools.from_dict(obj["pools"]) if obj.get("pools") is not None else None,
192
+ "env": Env.from_dict(obj["env"]) if obj.get("env") is not None else None,
193
+ "image": Image.from_dict(obj["image"]) if obj.get("image") is not None else None,
194
+ "ingress": Ingress.from_dict(obj["ingress"]) if obj.get("ingress") is not None else None,
195
+ "port": obj.get("port"),
196
+ "healthcheck": obj.get("healthcheck"),
197
+ "command": obj.get("command"),
198
+ "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None,
199
+ "hf_token_ref": obj.get("hf_token_ref"),
200
+ "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False,
201
+ "metrics": MetricsConfig.from_dict(obj["metrics"]) if obj.get("metrics") is not None else None,
202
+ "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False,
203
+ "enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False
196
204
  })
197
205
  return _obj
198
206
 
@@ -0,0 +1,183 @@
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, Field, StrictBool, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from platform_api_python_client.models.ccl_main_pools import CclMainPools
24
+ from platform_api_python_client.models.config_file_mount import ConfigFileMount
25
+ from platform_api_python_client.models.env import Env
26
+ from platform_api_python_client.models.image import Image
27
+ from platform_api_python_client.models.volume_mount import VolumeMount
28
+ from typing import Optional, Set
29
+ from typing_extensions import Self
30
+
31
+ class UnifiedWriteJobDeploymentRequest(BaseModel):
32
+ """
33
+ UnifiedWriteJobDeploymentRequest
34
+ """ # noqa: E501
35
+ type: StrictStr
36
+ name: Annotated[str, Field(min_length=1, strict=True, max_length=20)]
37
+ cluster_id: StrictInt
38
+ user_annotations: Optional[Dict[str, StrictStr]] = None
39
+ chart_revision: Optional[StrictStr] = None
40
+ volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
41
+ priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
42
+ pools: CclMainPools
43
+ env: Optional[Env] = None
44
+ image: Image
45
+ command: Optional[StrictStr] = None
46
+ config_file: Optional[ConfigFileMount] = None
47
+ completions: Optional[Annotated[int, Field(strict=True, ge=1)]] = 1
48
+ parallelism: Optional[Annotated[int, Field(strict=True, ge=1)]] = 1
49
+ backoff_limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = 3
50
+ active_deadline_seconds: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
51
+ enable_logging: Optional[StrictBool] = True
52
+ __properties: ClassVar[List[str]] = ["type", "name", "cluster_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "pools", "env", "image", "command", "config_file", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging"]
53
+
54
+ @field_validator('type')
55
+ def type_validate_enum(cls, value):
56
+ """Validates the enum"""
57
+ if value not in set(['ccl_job']):
58
+ raise ValueError("must be one of enum values ('ccl_job')")
59
+ return value
60
+
61
+ @field_validator('name')
62
+ def name_validate_regular_expression(cls, value):
63
+ """Validates the regular expression"""
64
+ if not re.match(r"^[a-z][a-z0-9-]*$", value):
65
+ raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
66
+ return value
67
+
68
+ model_config = ConfigDict(
69
+ populate_by_name=True,
70
+ validate_assignment=True,
71
+ protected_namespaces=(),
72
+ )
73
+
74
+
75
+ def to_str(self) -> str:
76
+ """Returns the string representation of the model using alias"""
77
+ return pprint.pformat(self.model_dump(by_alias=True))
78
+
79
+ def to_json(self) -> str:
80
+ """Returns the JSON representation of the model using alias"""
81
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
82
+ return json.dumps(self.to_dict())
83
+
84
+ @classmethod
85
+ def from_json(cls, json_str: str) -> Optional[Self]:
86
+ """Create an instance of UnifiedWriteJobDeploymentRequest from a JSON string"""
87
+ return cls.from_dict(json.loads(json_str))
88
+
89
+ def to_dict(self) -> Dict[str, Any]:
90
+ """Return the dictionary representation of the model using alias.
91
+
92
+ This has the following differences from calling pydantic's
93
+ `self.model_dump(by_alias=True)`:
94
+
95
+ * `None` is only added to the output dict for nullable fields that
96
+ were set at model initialization. Other fields with value `None`
97
+ are ignored.
98
+ """
99
+ excluded_fields: Set[str] = set([
100
+ ])
101
+
102
+ _dict = self.model_dump(
103
+ by_alias=True,
104
+ exclude=excluded_fields,
105
+ exclude_none=True,
106
+ )
107
+ # override the default output from pydantic by calling `to_dict()` of each item in volume_mounts (list)
108
+ _items = []
109
+ if self.volume_mounts:
110
+ for _item_volume_mounts in self.volume_mounts:
111
+ if _item_volume_mounts:
112
+ _items.append(_item_volume_mounts.to_dict())
113
+ _dict['volume_mounts'] = _items
114
+ # override the default output from pydantic by calling `to_dict()` of pools
115
+ if self.pools:
116
+ _dict['pools'] = self.pools.to_dict()
117
+ # override the default output from pydantic by calling `to_dict()` of env
118
+ if self.env:
119
+ _dict['env'] = self.env.to_dict()
120
+ # override the default output from pydantic by calling `to_dict()` of image
121
+ if self.image:
122
+ _dict['image'] = self.image.to_dict()
123
+ # override the default output from pydantic by calling `to_dict()` of config_file
124
+ if self.config_file:
125
+ _dict['config_file'] = self.config_file.to_dict()
126
+ # set to None if user_annotations (nullable) is None
127
+ # and model_fields_set contains the field
128
+ if self.user_annotations is None and "user_annotations" in self.model_fields_set:
129
+ _dict['user_annotations'] = None
130
+
131
+ # set to None if priority (nullable) is None
132
+ # and model_fields_set contains the field
133
+ if self.priority is None and "priority" in self.model_fields_set:
134
+ _dict['priority'] = None
135
+
136
+ # set to None if command (nullable) is None
137
+ # and model_fields_set contains the field
138
+ if self.command is None and "command" in self.model_fields_set:
139
+ _dict['command'] = None
140
+
141
+ # set to None if config_file (nullable) is None
142
+ # and model_fields_set contains the field
143
+ if self.config_file is None and "config_file" in self.model_fields_set:
144
+ _dict['config_file'] = None
145
+
146
+ # set to None if active_deadline_seconds (nullable) is None
147
+ # and model_fields_set contains the field
148
+ if self.active_deadline_seconds is None and "active_deadline_seconds" in self.model_fields_set:
149
+ _dict['active_deadline_seconds'] = None
150
+
151
+ return _dict
152
+
153
+ @classmethod
154
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
155
+ """Create an instance of UnifiedWriteJobDeploymentRequest from a dict"""
156
+ if obj is None:
157
+ return None
158
+
159
+ if not isinstance(obj, dict):
160
+ return cls.model_validate(obj)
161
+
162
+ _obj = cls.model_validate({
163
+ "type": obj.get("type"),
164
+ "name": obj.get("name"),
165
+ "cluster_id": obj.get("cluster_id"),
166
+ "user_annotations": obj.get("user_annotations"),
167
+ "chart_revision": obj.get("chart_revision"),
168
+ "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
169
+ "priority": obj.get("priority"),
170
+ "pools": CclMainPools.from_dict(obj["pools"]) if obj.get("pools") is not None else None,
171
+ "env": Env.from_dict(obj["env"]) if obj.get("env") is not None else None,
172
+ "image": Image.from_dict(obj["image"]) if obj.get("image") is not None else None,
173
+ "command": obj.get("command"),
174
+ "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None,
175
+ "completions": obj.get("completions") if obj.get("completions") is not None else 1,
176
+ "parallelism": obj.get("parallelism") if obj.get("parallelism") is not None else 1,
177
+ "backoff_limit": obj.get("backoff_limit") if obj.get("backoff_limit") is not None else 3,
178
+ "active_deadline_seconds": obj.get("active_deadline_seconds"),
179
+ "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True
180
+ })
181
+ return _obj
182
+
183
+
@@ -0,0 +1,106 @@
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, Field, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from platform_api_python_client.models.insight_status import InsightStatus
24
+ from typing import Optional, Set
25
+ from typing_extensions import Self
26
+
27
+ class UpdateInsightStatusRequest(BaseModel):
28
+ """
29
+ UpdateInsightStatusRequest
30
+ """ # noqa: E501
31
+ status: InsightStatus
32
+ comment: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2000)]] = None
33
+ __properties: ClassVar[List[str]] = ["status", "comment"]
34
+
35
+ @field_validator('comment')
36
+ def comment_validate_regular_expression(cls, value):
37
+ """Validates the regular expression"""
38
+ if value is None:
39
+ return value
40
+
41
+ if not re.match(r"^[^\x00]*$", value):
42
+ raise ValueError(r"must validate the regular expression /^[^\x00]*$/")
43
+ return value
44
+
45
+ model_config = ConfigDict(
46
+ populate_by_name=True,
47
+ validate_assignment=True,
48
+ protected_namespaces=(),
49
+ )
50
+
51
+
52
+ def to_str(self) -> str:
53
+ """Returns the string representation of the model using alias"""
54
+ return pprint.pformat(self.model_dump(by_alias=True))
55
+
56
+ def to_json(self) -> str:
57
+ """Returns the JSON representation of the model using alias"""
58
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
59
+ return json.dumps(self.to_dict())
60
+
61
+ @classmethod
62
+ def from_json(cls, json_str: str) -> Optional[Self]:
63
+ """Create an instance of UpdateInsightStatusRequest from a JSON string"""
64
+ return cls.from_dict(json.loads(json_str))
65
+
66
+ def to_dict(self) -> Dict[str, Any]:
67
+ """Return the dictionary representation of the model using alias.
68
+
69
+ This has the following differences from calling pydantic's
70
+ `self.model_dump(by_alias=True)`:
71
+
72
+ * `None` is only added to the output dict for nullable fields that
73
+ were set at model initialization. Other fields with value `None`
74
+ are ignored.
75
+ """
76
+ excluded_fields: Set[str] = set([
77
+ ])
78
+
79
+ _dict = self.model_dump(
80
+ by_alias=True,
81
+ exclude=excluded_fields,
82
+ exclude_none=True,
83
+ )
84
+ # set to None if comment (nullable) is None
85
+ # and model_fields_set contains the field
86
+ if self.comment is None and "comment" in self.model_fields_set:
87
+ _dict['comment'] = None
88
+
89
+ return _dict
90
+
91
+ @classmethod
92
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
93
+ """Create an instance of UpdateInsightStatusRequest from a dict"""
94
+ if obj is None:
95
+ return None
96
+
97
+ if not isinstance(obj, dict):
98
+ return cls.model_validate(obj)
99
+
100
+ _obj = cls.model_validate({
101
+ "status": obj.get("status"),
102
+ "comment": obj.get("comment")
103
+ })
104
+ return _obj
105
+
106
+
@@ -27,7 +27,7 @@ from typing_extensions import Self
27
27
 
28
28
  class UpsertUserVaultItemRequest(BaseModel):
29
29
  """
30
- Write model for PUT /user_vault, where the key and value rules are enforced.
30
+ Create an immutable secret via PUT /user_vault; existing keys return 409. The schema name is retained for SDK compatibility. Secrets cannot be updated.
31
31
  """ # noqa: E501
32
32
  id: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
33
33
  type: UserVaultType
@@ -0,0 +1,40 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class UsageAvailability(str, Enum):
22
+ """
23
+ UsageAvailability
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ AVAILABLE = 'available'
30
+ NO_TRAFFIC = 'no_traffic'
31
+ UNAVAILABLE = 'unavailable'
32
+ STALE = 'stale'
33
+ PARTIAL = 'partial'
34
+
35
+ @classmethod
36
+ def from_json(cls, json_str: str) -> Self:
37
+ """Create an instance of UsageAvailability from a JSON string"""
38
+ return cls(json.loads(json_str))
39
+
40
+
@@ -0,0 +1,39 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class UsageComponent(str, Enum):
22
+ """
23
+ UsageComponent
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ FRONTEND = 'frontend'
30
+ WORKER = 'worker'
31
+ PREFILL = 'prefill'
32
+ DECODE = 'decode'
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of UsageComponent from a JSON string"""
37
+ return cls(json.loads(json_str))
38
+
39
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: platform-api-python-client
3
- Version: 4.31.0
3
+ Version: 4.37.1
4
4
  Summary: Platform External API
5
5
  Home-page:
6
6
  Author: OpenAPI Generator community