platform-api-python-client 4.31.0__py3-none-any.whl → 4.41.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 (200) hide show
  1. platform_api_python_client/__init__.py +410 -148
  2. platform_api_python_client/api/external_api.py +6466 -1215
  3. platform_api_python_client/api_client.py +81 -36
  4. platform_api_python_client/configuration.py +262 -66
  5. platform_api_python_client/exceptions.py +24 -5
  6. platform_api_python_client/models/__init__.py +90 -35
  7. platform_api_python_client/models/admission.py +106 -0
  8. platform_api_python_client/models/autoscaling.py +120 -0
  9. platform_api_python_client/models/ccl_dynamo_pools.py +117 -0
  10. platform_api_python_client/models/{create_c_serve_v2_deployment_response.py → ccl_main_pools.py} +16 -16
  11. platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_chart_values.py +121 -0
  12. platform_api_python_client/models/{c_serve_v2_recipe.py → ccluster_catalogs_cluster_base_argo_rollouts_controller.py} +15 -18
  13. platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_values.py +110 -0
  14. platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_chart_values.py +117 -0
  15. platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_values.py +110 -0
  16. platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_chart_values.py +152 -0
  17. platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_values.py +121 -0
  18. platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_chart_values.py +110 -0
  19. platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_controller.py +121 -0
  20. platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_values.py +110 -0
  21. platform_api_python_client/models/ccluster_catalogs_cluster_base_istio_values.py +143 -0
  22. platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_chart_values.py +154 -0
  23. platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_values.py +121 -0
  24. platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_chart_values.py +131 -0
  25. platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_values.py +110 -0
  26. platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_chart_values.py +121 -0
  27. platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_values.py +121 -0
  28. platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_chart_values.py +106 -0
  29. platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_values.py +110 -0
  30. platform_api_python_client/models/cdi.py +113 -0
  31. platform_api_python_client/models/cluster_base_components.py +187 -0
  32. platform_api_python_client/models/cluster_capacity_response.py +5 -5
  33. platform_api_python_client/models/cluster_credential.py +6 -5
  34. platform_api_python_client/models/cluster_registration_request.py +4 -3
  35. platform_api_python_client/models/cluster_registration_response.py +4 -3
  36. platform_api_python_client/models/{istio_cni_overrides.py → cni.py} +29 -15
  37. platform_api_python_client/models/config_file_mount.py +6 -5
  38. platform_api_python_client/models/create_compute_deployment_request.py +35 -9
  39. platform_api_python_client/models/create_compute_deployment_response.py +4 -3
  40. platform_api_python_client/models/create_dynamo_deployment_request.py +67 -20
  41. platform_api_python_client/models/create_dynamo_deployment_response.py +4 -3
  42. platform_api_python_client/models/create_filesystem_volume_request.py +8 -20
  43. platform_api_python_client/models/create_hardware_instance_request.py +4 -3
  44. platform_api_python_client/models/create_inference_deployment_response.py +4 -3
  45. platform_api_python_client/models/create_inference_v3_deployment_request.py +52 -10
  46. platform_api_python_client/models/create_job_deployment_request.py +35 -9
  47. platform_api_python_client/models/create_job_deployment_response.py +4 -3
  48. platform_api_python_client/models/create_object_volume_request.py +10 -22
  49. platform_api_python_client/models/create_organization_request.py +4 -3
  50. platform_api_python_client/models/create_organization_response.py +4 -3
  51. platform_api_python_client/models/create_service_account_request.py +4 -3
  52. platform_api_python_client/models/create_service_account_response.py +4 -3
  53. platform_api_python_client/models/credits_response.py +4 -3
  54. platform_api_python_client/models/daily_bill_response.py +4 -3
  55. platform_api_python_client/models/{fluent_bit.py → dashboard.py} +29 -12
  56. platform_api_python_client/models/{prometheus_adapter.py → default_priorities.py} +29 -12
  57. platform_api_python_client/models/default_queue.py +106 -0
  58. platform_api_python_client/models/delete_user_vault_item_request.py +4 -3
  59. platform_api_python_client/models/deployment_log_event_v4.py +4 -3
  60. platform_api_python_client/models/deployment_response.py +12 -27
  61. platform_api_python_client/models/deployment_status_request.py +4 -3
  62. platform_api_python_client/models/deployment_status_response.py +4 -3
  63. platform_api_python_client/models/deployment_status_v3_response.py +5 -5
  64. platform_api_python_client/models/deployment_type.py +14 -0
  65. platform_api_python_client/models/deployment_usage.py +5 -5
  66. platform_api_python_client/models/deployment_usage_value.py +4 -3
  67. platform_api_python_client/models/dynamo_communications_input.py +4 -16
  68. platform_api_python_client/models/dynamo_frontend_config.py +105 -0
  69. platform_api_python_client/models/dynamo_frontend_config_response.py +105 -0
  70. platform_api_python_client/models/dynamo_image.py +106 -0
  71. platform_api_python_client/models/dynamo_kv_transfer_configuration.py +4 -16
  72. platform_api_python_client/models/{external_dns.py → dynamo_weight_transfer_configuration.py} +13 -13
  73. platform_api_python_client/models/dynamo_weight_transfer_policy.py +36 -0
  74. platform_api_python_client/models/dynamo_worker_pool_config.py +6 -18
  75. platform_api_python_client/models/dynamo_worker_pools.py +4 -16
  76. platform_api_python_client/models/{keda.py → env.py} +14 -13
  77. platform_api_python_client/models/generate_service_account_secret_response.py +4 -3
  78. platform_api_python_client/models/get_cluster_response.py +8 -5
  79. platform_api_python_client/models/get_compute_deployment_response.py +35 -8
  80. platform_api_python_client/models/get_deployment_log_response.py +4 -3
  81. platform_api_python_client/models/get_deployment_log_v4_response.py +5 -5
  82. platform_api_python_client/models/get_deployment_pods_response.py +4 -3
  83. platform_api_python_client/models/get_deployment_response.py +7 -7
  84. platform_api_python_client/models/get_deployment_revision_response.py +4 -3
  85. platform_api_python_client/models/get_deployment_usage_response.py +24 -9
  86. platform_api_python_client/models/get_dynamo_deployment_response.py +63 -15
  87. platform_api_python_client/models/get_filesystem_volume_response.py +4 -3
  88. platform_api_python_client/models/get_inference_deployment_response.py +7 -7
  89. platform_api_python_client/models/get_inference_v3_deployment_response.py +51 -8
  90. platform_api_python_client/models/get_job_deployment_response.py +35 -8
  91. platform_api_python_client/models/get_object_volume_response.py +4 -3
  92. platform_api_python_client/models/gpu_type_capacity.py +4 -3
  93. platform_api_python_client/models/hardware_instance_response.py +10 -5
  94. platform_api_python_client/models/hardware_preset_response.py +4 -3
  95. platform_api_python_client/models/http_validation_error.py +5 -5
  96. platform_api_python_client/models/image.py +113 -0
  97. platform_api_python_client/models/image_pull_secret_credentials.py +4 -3
  98. platform_api_python_client/models/{istio_cni_subchart_overrides.py → ingress.py} +26 -18
  99. platform_api_python_client/models/{c_serve_recipe_response.py → insight_list_item_response.py} +33 -27
  100. platform_api_python_client/models/{create_c_serve_v3_deployment_response.py → insight_resource.py} +20 -14
  101. platform_api_python_client/models/insight_resource_type.py +37 -0
  102. platform_api_python_client/models/insight_response.py +133 -0
  103. platform_api_python_client/models/insight_severity.py +40 -0
  104. platform_api_python_client/models/insight_status.py +39 -0
  105. platform_api_python_client/models/insight_status_change_response.py +108 -0
  106. platform_api_python_client/models/invite_user_request.py +4 -3
  107. platform_api_python_client/models/istio_base.py +106 -0
  108. platform_api_python_client/models/istio_cni.py +124 -0
  109. platform_api_python_client/models/{ingress_nginx.py → istio_gateway.py} +29 -12
  110. platform_api_python_client/models/{dynamo_communications_output.py → istiod.py} +21 -15
  111. platform_api_python_client/models/list_cluster_capacity_response.py +5 -5
  112. platform_api_python_client/models/list_daily_bill_response.py +5 -5
  113. platform_api_python_client/models/list_deployment_revisions_response.py +5 -5
  114. platform_api_python_client/models/list_get_cluster_response.py +5 -5
  115. platform_api_python_client/models/list_get_deployment_response.py +5 -5
  116. platform_api_python_client/models/list_hardware_instance_response.py +5 -5
  117. platform_api_python_client/models/list_hardware_preset_response.py +5 -5
  118. platform_api_python_client/models/{istio_overrides.py → list_insights_response.py} +19 -20
  119. platform_api_python_client/models/list_organization_gpu_quota_response.py +5 -5
  120. platform_api_python_client/models/list_prebuilt_image_response.py +5 -5
  121. platform_api_python_client/models/list_service_accounts_response.py +5 -5
  122. platform_api_python_client/models/list_user_vault_items_response.py +5 -5
  123. platform_api_python_client/models/list_volumes_response.py +5 -5
  124. platform_api_python_client/models/{validation_error_loc_inner.py → location_inner.py} +6 -6
  125. platform_api_python_client/models/metric.py +13 -0
  126. platform_api_python_client/models/metrics.py +117 -0
  127. platform_api_python_client/models/metrics_config.py +6 -5
  128. platform_api_python_client/models/mig.py +106 -0
  129. platform_api_python_client/models/operator.py +117 -0
  130. platform_api_python_client/models/organization_gpu_quota_request.py +4 -3
  131. platform_api_python_client/models/organization_gpu_quota_response.py +4 -3
  132. platform_api_python_client/models/pilot.py +106 -0
  133. platform_api_python_client/models/pod_details.py +4 -3
  134. platform_api_python_client/models/pool.py +117 -0
  135. platform_api_python_client/models/prebuilt_image_response.py +4 -3
  136. platform_api_python_client/models/prometheus.py +110 -0
  137. platform_api_python_client/models/prometheus_rules.py +120 -0
  138. platform_api_python_client/models/prometheus_spec.py +113 -0
  139. platform_api_python_client/models/prometheus_values.py +117 -0
  140. platform_api_python_client/models/quota.py +106 -0
  141. platform_api_python_client/models/replicas.py +106 -0
  142. platform_api_python_client/models/resource_list.py +113 -0
  143. platform_api_python_client/models/resource_requirements.py +120 -0
  144. platform_api_python_client/models/revision_pod_details.py +5 -5
  145. platform_api_python_client/models/rollout_strategy_params.py +4 -3
  146. platform_api_python_client/models/scheduler.py +117 -0
  147. platform_api_python_client/models/service_account_response.py +4 -3
  148. platform_api_python_client/models/{istio.py → toggle.py} +27 -19
  149. platform_api_python_client/models/toleration.py +134 -0
  150. platform_api_python_client/models/unified_get_compute_deployment_response.py +177 -0
  151. platform_api_python_client/models/{c_serve_recipe_perf.py → unified_get_deployment_logs_response.py} +19 -22
  152. platform_api_python_client/models/{longhorn.py → unified_get_deployment_pods_response.py} +13 -14
  153. platform_api_python_client/models/unified_get_deployment_response.py +164 -0
  154. platform_api_python_client/models/unified_get_deployment_revision_response.py +110 -0
  155. platform_api_python_client/models/{argo_rollouts.py → unified_get_deployment_rollout_response.py} +15 -13
  156. platform_api_python_client/models/unified_get_deployment_usage_response.py +110 -0
  157. platform_api_python_client/models/unified_get_dynamo_deployment_response.py +218 -0
  158. platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +228 -0
  159. platform_api_python_client/models/unified_get_job_deployment_response.py +204 -0
  160. platform_api_python_client/models/{list_c_serve_recipe_response.py → unified_list_deployment_revisions_response.py} +12 -12
  161. platform_api_python_client/models/{spire.py → unified_update_deployment_rollout_request.py} +12 -13
  162. platform_api_python_client/models/unified_write_compute_deployment_request.py +154 -0
  163. platform_api_python_client/models/unified_write_deployment_request.py +164 -0
  164. platform_api_python_client/models/unified_write_deployment_response.py +110 -0
  165. platform_api_python_client/models/unified_write_dynamo_deployment_request.py +197 -0
  166. platform_api_python_client/models/{create_c_serve_v3_deployment_request.py → unified_write_inference_v3_deployment_request.py} +86 -78
  167. platform_api_python_client/models/unified_write_job_deployment_request.py +183 -0
  168. platform_api_python_client/models/update_cluster_metadata_request.py +4 -3
  169. platform_api_python_client/models/{cluster_config.py → update_cluster_request.py} +11 -10
  170. platform_api_python_client/models/update_deployment_response.py +4 -3
  171. platform_api_python_client/models/update_deployment_status_v3_request.py +4 -3
  172. platform_api_python_client/models/update_insight_status_request.py +107 -0
  173. platform_api_python_client/models/update_service_account_request.py +4 -3
  174. platform_api_python_client/models/upsert_user_vault_item_request.py +5 -4
  175. platform_api_python_client/models/usage_availability.py +40 -0
  176. platform_api_python_client/models/usage_component.py +39 -0
  177. platform_api_python_client/models/user_vault_item.py +4 -3
  178. platform_api_python_client/models/validation_error.py +8 -8
  179. platform_api_python_client/models/volume_mount.py +4 -3
  180. platform_api_python_client/models/volume_status_response.py +4 -3
  181. platform_api_python_client/models/workload.py +110 -0
  182. platform_api_python_client/rest.py +87 -10
  183. platform_api_python_client-4.41.0.dist-info/METADATA +418 -0
  184. platform_api_python_client-4.41.0.dist-info/RECORD +206 -0
  185. {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.41.0.dist-info}/WHEEL +1 -1
  186. platform_api_python_client/models/cert_manager.py +0 -89
  187. platform_api_python_client/models/cluster_components.py +0 -193
  188. platform_api_python_client/models/final_stack.py +0 -89
  189. platform_api_python_client/models/get_c_serve_v2_deployment_response.py +0 -193
  190. platform_api_python_client/models/get_c_serve_v3_deployment_response.py +0 -194
  191. platform_api_python_client/models/gpu_operator.py +0 -89
  192. platform_api_python_client/models/kube_prometheus_stack.py +0 -89
  193. platform_api_python_client/models/metrics_server.py +0 -89
  194. platform_api_python_client/models/network_operator.py +0 -89
  195. platform_api_python_client/models/opentelemetry_collector.py +0 -89
  196. platform_api_python_client/models/spire_crds.py +0 -89
  197. platform_api_python_client/models/teleport_kube_agent.py +0 -89
  198. platform_api_python_client-4.31.0.dist-info/METADATA +0 -23
  199. platform_api_python_client-4.31.0.dist-info/RECORD +0 -151
  200. {platform_api_python_client-4.31.0.dist-info → platform_api_python_client-4.41.0.dist-info}/top_level.txt +0 -0
@@ -18,8 +18,9 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
23
24
  from platform_api_python_client.models.backend_protocol import BackendProtocol
24
25
  from platform_api_python_client.models.config_file_mount import ConfigFileMount
25
26
  from platform_api_python_client.models.deployment_status import DeploymentStatus
@@ -29,6 +30,7 @@ from platform_api_python_client.models.metrics_config import MetricsConfig
29
30
  from platform_api_python_client.models.volume_mount import VolumeMount
30
31
  from typing import Optional, Set
31
32
  from typing_extensions import Self
33
+ from pydantic_core import to_jsonable_python
32
34
 
33
35
  class GetInferenceV3DeploymentResponse(BaseModel):
34
36
  """
@@ -45,10 +47,11 @@ class GetInferenceV3DeploymentResponse(BaseModel):
45
47
  created_at: datetime
46
48
  hardware_instance_id: StrictInt
47
49
  revision_number: StrictInt
48
- chart_revision: Optional[StrictStr] = None
50
+ chart_revision: Optional[StrictStr] = Field(default=None, description="Saved catalog Git reference for this revision; null if not recorded. Informational: omit chart_revision from edit or clone requests to use the current platform default.")
49
51
  user_annotations: Optional[Dict[str, StrictStr]] = None
50
52
  priority: Optional[StrictStr] = None
51
53
  volume_mounts: Optional[List[VolumeMount]] = None
54
+ hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
52
55
  container_port: StrictInt
53
56
  min_replicas: StrictInt
54
57
  max_replicas: StrictInt
@@ -62,16 +65,32 @@ class GetInferenceV3DeploymentResponse(BaseModel):
62
65
  command_args: Optional[List[StrictStr]] = None
63
66
  original_command: Optional[StrictStr] = None
64
67
  image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
68
+ env_vars_refs: Optional[Dict[str, Any]] = None
69
+ bearer_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
70
+ image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
71
+ image_pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
65
72
  backend_protocol: Optional[BackendProtocol] = None
73
+ request_body_limit_mib: Optional[Annotated[int, Field(le=1024, strict=True, ge=1)]] = Field(default=15, description="Maximum request-body size in MiB, including encoding and multipart overhead. Defaults to 15 MiB; must be between 1 and 1024 MiB.")
66
74
  enable_logging: Optional[StrictBool] = True
67
75
  enable_node_model_cache: Optional[StrictBool] = False
68
76
  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.")
69
77
  config_file: Optional[ConfigFileMount] = None
70
78
  metrics: Optional[MetricsConfig] = None
71
- __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "chart_revision", "user_annotations", "priority", "volume_mounts", "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"]
79
+ __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "chart_revision", "user_annotations", "priority", "volume_mounts", "hf_token_ref", "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", "env_vars_refs", "bearer_token_ref", "image_pull_ref", "image_pull_secret_name", "backend_protocol", "request_body_limit_mib", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
80
+
81
+ @field_validator('image_pull_secret_name', mode="before")
82
+ def image_pull_secret_name_validate_regular_expression(cls, value):
83
+ """Validates the regular expression"""
84
+ if value is None:
85
+ return value
86
+
87
+ if isinstance(value, str) and not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
88
+ raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
89
+ return value
72
90
 
73
91
  model_config = ConfigDict(
74
- populate_by_name=True,
92
+ validate_by_name=True,
93
+ validate_by_alias=True,
75
94
  validate_assignment=True,
76
95
  protected_namespaces=(),
77
96
  )
@@ -83,8 +102,7 @@ class GetInferenceV3DeploymentResponse(BaseModel):
83
102
 
84
103
  def to_json(self) -> str:
85
104
  """Returns the JSON representation of the model using alias"""
86
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
87
- return json.dumps(self.to_dict())
105
+ return json.dumps(to_jsonable_python(self.to_dict()))
88
106
 
89
107
  @classmethod
90
108
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -113,8 +131,7 @@ class GetInferenceV3DeploymentResponse(BaseModel):
113
131
  _items = []
114
132
  if self.volume_mounts:
115
133
  for _item_volume_mounts in self.volume_mounts:
116
- if _item_volume_mounts:
117
- _items.append(_item_volume_mounts.to_dict())
134
+ _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None)
118
135
  _dict['volume_mounts'] = _items
119
136
  # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
120
137
  if self.image_pull_secret_credentials:
@@ -145,6 +162,11 @@ class GetInferenceV3DeploymentResponse(BaseModel):
145
162
  if self.priority is None and "priority" in self.model_fields_set:
146
163
  _dict['priority'] = None
147
164
 
165
+ # set to None if hf_token_ref (nullable) is None
166
+ # and model_fields_set contains the field
167
+ if self.hf_token_ref is None and "hf_token_ref" in self.model_fields_set:
168
+ _dict['hf_token_ref'] = None
169
+
148
170
  # set to None if concurrency (nullable) is None
149
171
  # and model_fields_set contains the field
150
172
  if self.concurrency is None and "concurrency" in self.model_fields_set:
@@ -190,6 +212,21 @@ class GetInferenceV3DeploymentResponse(BaseModel):
190
212
  if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
191
213
  _dict['image_pull_secret_credentials'] = None
192
214
 
215
+ # set to None if bearer_token_ref (nullable) is None
216
+ # and model_fields_set contains the field
217
+ if self.bearer_token_ref is None and "bearer_token_ref" in self.model_fields_set:
218
+ _dict['bearer_token_ref'] = None
219
+
220
+ # set to None if image_pull_ref (nullable) is None
221
+ # and model_fields_set contains the field
222
+ if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
223
+ _dict['image_pull_ref'] = None
224
+
225
+ # set to None if image_pull_secret_name (nullable) is None
226
+ # and model_fields_set contains the field
227
+ if self.image_pull_secret_name is None and "image_pull_secret_name" in self.model_fields_set:
228
+ _dict['image_pull_secret_name'] = None
229
+
193
230
  # set to None if config_file (nullable) is None
194
231
  # and model_fields_set contains the field
195
232
  if self.config_file is None and "config_file" in self.model_fields_set:
@@ -227,6 +264,7 @@ class GetInferenceV3DeploymentResponse(BaseModel):
227
264
  "user_annotations": obj.get("user_annotations"),
228
265
  "priority": obj.get("priority"),
229
266
  "volume_mounts": [VolumeMount.from_dict(_item) for _item in obj["volume_mounts"]] if obj.get("volume_mounts") is not None else None,
267
+ "hf_token_ref": obj.get("hf_token_ref"),
230
268
  "container_port": obj.get("container_port"),
231
269
  "min_replicas": obj.get("min_replicas"),
232
270
  "max_replicas": obj.get("max_replicas"),
@@ -240,7 +278,12 @@ class GetInferenceV3DeploymentResponse(BaseModel):
240
278
  "command_args": obj.get("command_args"),
241
279
  "original_command": obj.get("original_command"),
242
280
  "image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
281
+ "env_vars_refs": obj.get("env_vars_refs"),
282
+ "bearer_token_ref": obj.get("bearer_token_ref"),
283
+ "image_pull_ref": obj.get("image_pull_ref"),
284
+ "image_pull_secret_name": obj.get("image_pull_secret_name"),
243
285
  "backend_protocol": obj.get("backend_protocol"),
286
+ "request_body_limit_mib": obj.get("request_body_limit_mib") if obj.get("request_body_limit_mib") is not None else 15,
244
287
  "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
245
288
  "enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
246
289
  "session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False,
@@ -18,8 +18,9 @@ import re # noqa: F401
18
18
  import json
19
19
 
20
20
  from datetime import datetime
21
- from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
21
+ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing_extensions import Annotated
23
24
  from platform_api_python_client.models.config_file_mount import ConfigFileMount
24
25
  from platform_api_python_client.models.deployment_status import DeploymentStatus
25
26
  from platform_api_python_client.models.deployment_type import DeploymentType
@@ -27,6 +28,7 @@ from platform_api_python_client.models.image_pull_secret_credentials import Imag
27
28
  from platform_api_python_client.models.volume_mount import VolumeMount
28
29
  from typing import Optional, Set
29
30
  from typing_extensions import Self
31
+ from pydantic_core import to_jsonable_python
30
32
 
31
33
  class GetJobDeploymentResponse(BaseModel):
32
34
  """
@@ -43,7 +45,7 @@ class GetJobDeploymentResponse(BaseModel):
43
45
  created_at: datetime
44
46
  hardware_instance_id: StrictInt
45
47
  revision_number: StrictInt
46
- chart_revision: Optional[StrictStr] = None
48
+ chart_revision: Optional[StrictStr] = Field(default=None, description="Saved catalog Git reference for this revision; null if not recorded. Informational: omit chart_revision from edit or clone requests to use the current platform default.")
47
49
  user_annotations: Optional[Dict[str, StrictStr]] = None
48
50
  priority: Optional[StrictStr] = None
49
51
  volume_mounts: Optional[List[VolumeMount]] = None
@@ -56,12 +58,26 @@ class GetJobDeploymentResponse(BaseModel):
56
58
  backoff_limit: Optional[StrictInt] = 3
57
59
  active_deadline_seconds: Optional[StrictInt] = None
58
60
  image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
61
+ env_vars_refs: Optional[Dict[str, Any]] = None
62
+ image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
63
+ image_pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
59
64
  enable_logging: Optional[StrictBool] = True
60
65
  config_file: Optional[ConfigFileMount] = None
61
- __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "chart_revision", "user_annotations", "priority", "volume_mounts", "env_vars", "command", "args", "original_command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "image_pull_secret_credentials", "enable_logging", "config_file"]
66
+ __properties: ClassVar[List[str]] = ["creator_email", "cluster_id", "id", "name", "endpoint_url", "image_url", "type", "status", "created_at", "hardware_instance_id", "revision_number", "chart_revision", "user_annotations", "priority", "volume_mounts", "env_vars", "command", "args", "original_command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "image_pull_secret_credentials", "env_vars_refs", "image_pull_ref", "image_pull_secret_name", "enable_logging", "config_file"]
67
+
68
+ @field_validator('image_pull_secret_name', mode="before")
69
+ def image_pull_secret_name_validate_regular_expression(cls, value):
70
+ """Validates the regular expression"""
71
+ if value is None:
72
+ return value
73
+
74
+ if isinstance(value, str) and not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
75
+ raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
76
+ return value
62
77
 
63
78
  model_config = ConfigDict(
64
- populate_by_name=True,
79
+ validate_by_name=True,
80
+ validate_by_alias=True,
65
81
  validate_assignment=True,
66
82
  protected_namespaces=(),
67
83
  )
@@ -73,8 +89,7 @@ class GetJobDeploymentResponse(BaseModel):
73
89
 
74
90
  def to_json(self) -> str:
75
91
  """Returns the JSON representation of the model using alias"""
76
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
77
- return json.dumps(self.to_dict())
92
+ return json.dumps(to_jsonable_python(self.to_dict()))
78
93
 
79
94
  @classmethod
80
95
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -103,8 +118,7 @@ class GetJobDeploymentResponse(BaseModel):
103
118
  _items = []
104
119
  if self.volume_mounts:
105
120
  for _item_volume_mounts in self.volume_mounts:
106
- if _item_volume_mounts:
107
- _items.append(_item_volume_mounts.to_dict())
121
+ _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None)
108
122
  _dict['volume_mounts'] = _items
109
123
  # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
110
124
  if self.image_pull_secret_credentials:
@@ -162,6 +176,16 @@ class GetJobDeploymentResponse(BaseModel):
162
176
  if self.image_pull_secret_credentials is None and "image_pull_secret_credentials" in self.model_fields_set:
163
177
  _dict['image_pull_secret_credentials'] = None
164
178
 
179
+ # set to None if image_pull_ref (nullable) is None
180
+ # and model_fields_set contains the field
181
+ if self.image_pull_ref is None and "image_pull_ref" in self.model_fields_set:
182
+ _dict['image_pull_ref'] = None
183
+
184
+ # set to None if image_pull_secret_name (nullable) is None
185
+ # and model_fields_set contains the field
186
+ if self.image_pull_secret_name is None and "image_pull_secret_name" in self.model_fields_set:
187
+ _dict['image_pull_secret_name'] = None
188
+
165
189
  # set to None if config_file (nullable) is None
166
190
  # and model_fields_set contains the field
167
191
  if self.config_file is None and "config_file" in self.model_fields_set:
@@ -203,6 +227,9 @@ class GetJobDeploymentResponse(BaseModel):
203
227
  "backoff_limit": obj.get("backoff_limit") if obj.get("backoff_limit") is not None else 3,
204
228
  "active_deadline_seconds": obj.get("active_deadline_seconds"),
205
229
  "image_pull_secret_credentials": ImagePullSecretCredentials.from_dict(obj["image_pull_secret_credentials"]) if obj.get("image_pull_secret_credentials") is not None else None,
230
+ "env_vars_refs": obj.get("env_vars_refs"),
231
+ "image_pull_ref": obj.get("image_pull_ref"),
232
+ "image_pull_secret_name": obj.get("image_pull_secret_name"),
206
233
  "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True,
207
234
  "config_file": ConfigFileMount.from_dict(obj["config_file"]) if obj.get("config_file") is not None else None
208
235
  })
@@ -25,6 +25,7 @@ from platform_api_python_client.models.volume_access_mode import VolumeAccessMod
25
25
  from platform_api_python_client.models.volume_status import VolumeStatus
26
26
  from typing import Optional, Set
27
27
  from typing_extensions import Self
28
+ from pydantic_core import to_jsonable_python
28
29
 
29
30
  class GetObjectVolumeResponse(BaseModel):
30
31
  """
@@ -53,7 +54,8 @@ class GetObjectVolumeResponse(BaseModel):
53
54
  return value
54
55
 
55
56
  model_config = ConfigDict(
56
- populate_by_name=True,
57
+ validate_by_name=True,
58
+ validate_by_alias=True,
57
59
  validate_assignment=True,
58
60
  protected_namespaces=(),
59
61
  )
@@ -65,8 +67,7 @@ class GetObjectVolumeResponse(BaseModel):
65
67
 
66
68
  def to_json(self) -> str:
67
69
  """Returns the JSON representation of the model using alias"""
68
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
69
- return json.dumps(self.to_dict())
70
+ return json.dumps(to_jsonable_python(self.to_dict()))
70
71
 
71
72
  @classmethod
72
73
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
24
25
 
25
26
  class GpuTypeCapacity(BaseModel):
26
27
  """
@@ -32,7 +33,8 @@ class GpuTypeCapacity(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["gpu_type", "total_gpus", "used_gpus"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -44,8 +46,7 @@ class GpuTypeCapacity(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
24
25
 
25
26
  class HardwareInstanceResponse(BaseModel):
26
27
  """
@@ -34,10 +35,12 @@ class HardwareInstanceResponse(BaseModel):
34
35
  memory: StrictInt
35
36
  cluster_id: StrictInt
36
37
  accelerator_memory: Optional[StrictInt] = None
37
- __properties: ClassVar[List[str]] = ["id", "name", "gpu_type", "num_gpu", "cpu", "memory", "cluster_id", "accelerator_memory"]
38
+ cost_per_hr: StrictInt
39
+ __properties: ClassVar[List[str]] = ["id", "name", "gpu_type", "num_gpu", "cpu", "memory", "cluster_id", "accelerator_memory", "cost_per_hr"]
38
40
 
39
41
  model_config = ConfigDict(
40
- populate_by_name=True,
42
+ validate_by_name=True,
43
+ validate_by_alias=True,
41
44
  validate_assignment=True,
42
45
  protected_namespaces=(),
43
46
  )
@@ -49,8 +52,7 @@ class HardwareInstanceResponse(BaseModel):
49
52
 
50
53
  def to_json(self) -> str:
51
54
  """Returns the JSON representation of the model using alias"""
52
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
53
- return json.dumps(self.to_dict())
55
+ return json.dumps(to_jsonable_python(self.to_dict()))
54
56
 
55
57
  @classmethod
56
58
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -66,8 +68,10 @@ class HardwareInstanceResponse(BaseModel):
66
68
  * `None` is only added to the output dict for nullable fields that
67
69
  were set at model initialization. Other fields with value `None`
68
70
  are ignored.
71
+ * OpenAPI `readOnly` fields are excluded.
69
72
  """
70
73
  excluded_fields: Set[str] = set([
74
+ "cost_per_hr",
71
75
  ])
72
76
 
73
77
  _dict = self.model_dump(
@@ -99,7 +103,8 @@ class HardwareInstanceResponse(BaseModel):
99
103
  "cpu": obj.get("cpu"),
100
104
  "memory": obj.get("memory"),
101
105
  "cluster_id": obj.get("cluster_id"),
102
- "accelerator_memory": obj.get("accelerator_memory")
106
+ "accelerator_memory": obj.get("accelerator_memory"),
107
+ "cost_per_hr": obj.get("cost_per_hr")
103
108
  })
104
109
  return _obj
105
110
 
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
24
25
 
25
26
  class HardwarePresetResponse(BaseModel):
26
27
  """
@@ -32,7 +33,8 @@ class HardwarePresetResponse(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["gpu_type", "accelerator_memory", "is_mig"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -44,8 +46,7 @@ class HardwarePresetResponse(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
22
22
  from platform_api_python_client.models.validation_error import ValidationError
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
25
26
 
26
27
  class HTTPValidationError(BaseModel):
27
28
  """
@@ -31,7 +32,8 @@ class HTTPValidationError(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["detail"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class HTTPValidationError(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -73,8 +74,7 @@ class HTTPValidationError(BaseModel):
73
74
  _items = []
74
75
  if self.detail:
75
76
  for _item_detail in self.detail:
76
- if _item_detail:
77
- _items.append(_item_detail.to_dict())
77
+ _items.append(_item_detail.to_dict() if _item_detail is not None else None)
78
78
  _dict['detail'] = _items
79
79
  return _dict
80
80
 
@@ -0,0 +1,113 @@
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, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class Image(BaseModel):
28
+ """
29
+ Image
30
+ """ # noqa: E501
31
+ url: StrictStr
32
+ pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
33
+ pull_secret_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = Field(default=None, description="Name of a pre-existing image pull Secret in the deployment namespace. Created, refreshed and deleted externally. Mutually exclusive with inline registry credentials and image_pull_ref. Include on updates to retain it; null clears it.")
34
+ __properties: ClassVar[List[str]] = ["url", "pull_ref", "pull_secret_name"]
35
+
36
+ @field_validator('pull_secret_name', mode="before")
37
+ def pull_secret_name_validate_regular_expression(cls, value):
38
+ """Validates the regular expression"""
39
+ if value is None:
40
+ return value
41
+
42
+ if isinstance(value, str) and not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
43
+ raise ValueError(r"must validate the regular expression /^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$/")
44
+ return value
45
+
46
+ model_config = ConfigDict(
47
+ validate_by_name=True,
48
+ validate_by_alias=True,
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ def to_str(self) -> str:
55
+ """Returns the string representation of the model using alias"""
56
+ return pprint.pformat(self.model_dump(by_alias=True))
57
+
58
+ def to_json(self) -> str:
59
+ """Returns the JSON representation of the model using alias"""
60
+ return json.dumps(to_jsonable_python(self.to_dict()))
61
+
62
+ @classmethod
63
+ def from_json(cls, json_str: str) -> Optional[Self]:
64
+ """Create an instance of Image from a JSON string"""
65
+ return cls.from_dict(json.loads(json_str))
66
+
67
+ def to_dict(self) -> Dict[str, Any]:
68
+ """Return the dictionary representation of the model using alias.
69
+
70
+ This has the following differences from calling pydantic's
71
+ `self.model_dump(by_alias=True)`:
72
+
73
+ * `None` is only added to the output dict for nullable fields that
74
+ were set at model initialization. Other fields with value `None`
75
+ are ignored.
76
+ """
77
+ excluded_fields: Set[str] = set([
78
+ ])
79
+
80
+ _dict = self.model_dump(
81
+ by_alias=True,
82
+ exclude=excluded_fields,
83
+ exclude_none=True,
84
+ )
85
+ # set to None if pull_ref (nullable) is None
86
+ # and model_fields_set contains the field
87
+ if self.pull_ref is None and "pull_ref" in self.model_fields_set:
88
+ _dict['pull_ref'] = None
89
+
90
+ # set to None if pull_secret_name (nullable) is None
91
+ # and model_fields_set contains the field
92
+ if self.pull_secret_name is None and "pull_secret_name" in self.model_fields_set:
93
+ _dict['pull_secret_name'] = None
94
+
95
+ return _dict
96
+
97
+ @classmethod
98
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
99
+ """Create an instance of Image from a dict"""
100
+ if obj is None:
101
+ return None
102
+
103
+ if not isinstance(obj, dict):
104
+ return cls.model_validate(obj)
105
+
106
+ _obj = cls.model_validate({
107
+ "url": obj.get("url"),
108
+ "pull_ref": obj.get("pull_ref"),
109
+ "pull_secret_name": obj.get("pull_secret_name")
110
+ })
111
+ return _obj
112
+
113
+
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
24
25
 
25
26
  class ImagePullSecretCredentials(BaseModel):
26
27
  """
@@ -31,7 +32,8 @@ class ImagePullSecretCredentials(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["username", "password"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class ImagePullSecretCredentials(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -17,21 +17,26 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict
20
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Optional
22
- from platform_api_python_client.models.istio_cni_overrides import IstioCniOverrides
22
+ from typing_extensions import Annotated
23
+ from platform_api_python_client.models.backend_protocol import BackendProtocol
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
25
27
 
26
- class IstioCniSubchartOverrides(BaseModel):
28
+ class Ingress(BaseModel):
27
29
  """
28
- IstioCniSubchartOverrides
30
+ Ingress
29
31
  """ # noqa: E501
30
- cni: Optional[IstioCniOverrides] = None
31
- __properties: ClassVar[List[str]] = ["cni"]
32
+ backend_protocol: Optional[BackendProtocol] = None
33
+ bearer_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
34
+ certificate_authority: Optional[StrictStr] = None
35
+ __properties: ClassVar[List[str]] = ["backend_protocol", "bearer_token_ref", "certificate_authority"]
32
36
 
33
37
  model_config = ConfigDict(
34
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
35
40
  validate_assignment=True,
36
41
  protected_namespaces=(),
37
42
  )
@@ -43,12 +48,11 @@ class IstioCniSubchartOverrides(BaseModel):
43
48
 
44
49
  def to_json(self) -> str:
45
50
  """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())
51
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
52
 
49
53
  @classmethod
50
54
  def from_json(cls, json_str: str) -> Optional[Self]:
51
- """Create an instance of IstioCniSubchartOverrides from a JSON string"""
55
+ """Create an instance of Ingress from a JSON string"""
52
56
  return cls.from_dict(json.loads(json_str))
53
57
 
54
58
  def to_dict(self) -> Dict[str, Any]:
@@ -69,19 +73,21 @@ class IstioCniSubchartOverrides(BaseModel):
69
73
  exclude=excluded_fields,
70
74
  exclude_none=True,
71
75
  )
72
- # override the default output from pydantic by calling `to_dict()` of cni
73
- if self.cni:
74
- _dict['cni'] = self.cni.to_dict()
75
- # set to None if cni (nullable) is None
76
+ # set to None if bearer_token_ref (nullable) is None
76
77
  # and model_fields_set contains the field
77
- if self.cni is None and "cni" in self.model_fields_set:
78
- _dict['cni'] = None
78
+ if self.bearer_token_ref is None and "bearer_token_ref" in self.model_fields_set:
79
+ _dict['bearer_token_ref'] = None
80
+
81
+ # set to None if certificate_authority (nullable) is None
82
+ # and model_fields_set contains the field
83
+ if self.certificate_authority is None and "certificate_authority" in self.model_fields_set:
84
+ _dict['certificate_authority'] = None
79
85
 
80
86
  return _dict
81
87
 
82
88
  @classmethod
83
89
  def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
84
- """Create an instance of IstioCniSubchartOverrides from a dict"""
90
+ """Create an instance of Ingress from a dict"""
85
91
  if obj is None:
86
92
  return None
87
93
 
@@ -89,7 +95,9 @@ class IstioCniSubchartOverrides(BaseModel):
89
95
  return cls.model_validate(obj)
90
96
 
91
97
  _obj = cls.model_validate({
92
- "cni": IstioCniOverrides.from_dict(obj["cni"]) if obj.get("cni") is not None else None
98
+ "backend_protocol": obj.get("backend_protocol"),
99
+ "bearer_token_ref": obj.get("bearer_token_ref"),
100
+ "certificate_authority": obj.get("certificate_authority")
93
101
  })
94
102
  return _obj
95
103