platform-api-python-client 4.37.1__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.
- platform_api_python_client/__init__.py +410 -177
- platform_api_python_client/api/external_api.py +41 -47
- platform_api_python_client/api_client.py +81 -36
- platform_api_python_client/configuration.py +262 -66
- platform_api_python_client/exceptions.py +24 -5
- platform_api_python_client/models/__init__.py +52 -26
- platform_api_python_client/models/admission.py +106 -0
- platform_api_python_client/models/autoscaling.py +120 -0
- platform_api_python_client/models/ccl_dynamo_pools.py +4 -3
- platform_api_python_client/models/ccl_main_pools.py +4 -3
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_chart_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_controller.py +106 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_argo_rollouts_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_chart_values.py +117 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_cert_manager_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_chart_values.py +152 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_gpu_operator_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_chart_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_controller.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_ingress_nginx_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_istio_values.py +143 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_chart_values.py +154 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kai_scheduler_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_chart_values.py +131 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_keda_values.py +110 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_chart_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_kube_prometheus_stack_values.py +121 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_chart_values.py +106 -0
- platform_api_python_client/models/ccluster_catalogs_cluster_base_metrics_server_values.py +110 -0
- platform_api_python_client/models/{spire_crds.py → cdi.py} +36 -12
- platform_api_python_client/models/cluster_base_components.py +187 -0
- platform_api_python_client/models/cluster_capacity_response.py +5 -5
- platform_api_python_client/models/cluster_credential.py +4 -3
- platform_api_python_client/models/cluster_registration_request.py +4 -3
- platform_api_python_client/models/cluster_registration_response.py +4 -3
- platform_api_python_client/models/{istio_cni_overrides.py → cni.py} +29 -15
- platform_api_python_client/models/config_file_mount.py +6 -5
- platform_api_python_client/models/create_compute_deployment_request.py +10 -10
- platform_api_python_client/models/create_compute_deployment_response.py +4 -3
- platform_api_python_client/models/create_dynamo_deployment_request.py +29 -23
- platform_api_python_client/models/create_dynamo_deployment_response.py +4 -3
- platform_api_python_client/models/create_filesystem_volume_request.py +8 -7
- platform_api_python_client/models/create_hardware_instance_request.py +4 -3
- platform_api_python_client/models/create_inference_deployment_response.py +4 -3
- platform_api_python_client/models/create_inference_v3_deployment_request.py +14 -12
- platform_api_python_client/models/create_job_deployment_request.py +10 -10
- platform_api_python_client/models/create_job_deployment_response.py +4 -3
- platform_api_python_client/models/create_object_volume_request.py +10 -9
- platform_api_python_client/models/create_organization_request.py +4 -3
- platform_api_python_client/models/create_organization_response.py +4 -3
- platform_api_python_client/models/create_service_account_request.py +4 -3
- platform_api_python_client/models/create_service_account_response.py +4 -3
- platform_api_python_client/models/credits_response.py +4 -3
- platform_api_python_client/models/daily_bill_response.py +4 -3
- platform_api_python_client/models/{fluent_bit.py → dashboard.py} +29 -12
- platform_api_python_client/models/{prometheus_adapter.py → default_priorities.py} +29 -12
- platform_api_python_client/models/default_queue.py +106 -0
- platform_api_python_client/models/delete_user_vault_item_request.py +4 -3
- platform_api_python_client/models/deployment_log_event_v4.py +4 -3
- platform_api_python_client/models/deployment_status_request.py +4 -3
- platform_api_python_client/models/deployment_status_response.py +4 -3
- platform_api_python_client/models/deployment_status_v3_response.py +5 -5
- platform_api_python_client/models/deployment_usage.py +5 -5
- platform_api_python_client/models/deployment_usage_value.py +4 -3
- platform_api_python_client/models/dynamo_communications_input.py +4 -3
- platform_api_python_client/models/dynamo_frontend_config.py +105 -0
- platform_api_python_client/models/dynamo_frontend_config_response.py +105 -0
- platform_api_python_client/models/dynamo_image.py +6 -5
- platform_api_python_client/models/dynamo_kv_transfer_configuration.py +4 -3
- platform_api_python_client/models/dynamo_weight_transfer_configuration.py +4 -3
- platform_api_python_client/models/dynamo_worker_pool_config.py +5 -4
- platform_api_python_client/models/dynamo_worker_pools.py +4 -3
- platform_api_python_client/models/env.py +4 -3
- platform_api_python_client/models/generate_service_account_secret_response.py +4 -3
- platform_api_python_client/models/get_cluster_response.py +4 -3
- platform_api_python_client/models/get_compute_deployment_response.py +8 -8
- platform_api_python_client/models/get_deployment_log_response.py +4 -3
- platform_api_python_client/models/get_deployment_log_v4_response.py +5 -5
- platform_api_python_client/models/get_deployment_pods_response.py +4 -3
- platform_api_python_client/models/get_deployment_response.py +7 -7
- platform_api_python_client/models/get_deployment_revision_response.py +4 -3
- platform_api_python_client/models/get_deployment_usage_response.py +5 -5
- platform_api_python_client/models/get_dynamo_deployment_response.py +23 -17
- platform_api_python_client/models/get_filesystem_volume_response.py +4 -3
- platform_api_python_client/models/get_inference_deployment_response.py +7 -7
- platform_api_python_client/models/get_inference_v3_deployment_response.py +11 -9
- platform_api_python_client/models/get_job_deployment_response.py +8 -8
- platform_api_python_client/models/get_object_volume_response.py +4 -3
- platform_api_python_client/models/gpu_type_capacity.py +4 -3
- platform_api_python_client/models/hardware_instance_response.py +4 -3
- platform_api_python_client/models/hardware_preset_response.py +4 -3
- platform_api_python_client/models/http_validation_error.py +5 -5
- platform_api_python_client/models/image.py +6 -5
- platform_api_python_client/models/image_pull_secret_credentials.py +4 -3
- platform_api_python_client/models/ingress.py +4 -3
- platform_api_python_client/models/insight_list_item_response.py +4 -3
- platform_api_python_client/models/insight_resource.py +4 -3
- platform_api_python_client/models/insight_response.py +5 -5
- platform_api_python_client/models/insight_status_change_response.py +4 -3
- platform_api_python_client/models/invite_user_request.py +4 -3
- platform_api_python_client/models/istio_base.py +106 -0
- platform_api_python_client/models/istio_cni.py +124 -0
- platform_api_python_client/models/{argo_rollouts.py → istio_gateway.py} +29 -12
- platform_api_python_client/models/{istio_cni_subchart_overrides.py → istiod.py} +31 -17
- platform_api_python_client/models/list_cluster_capacity_response.py +5 -5
- platform_api_python_client/models/list_daily_bill_response.py +5 -5
- platform_api_python_client/models/list_deployment_revisions_response.py +5 -5
- platform_api_python_client/models/list_get_cluster_response.py +5 -5
- platform_api_python_client/models/list_get_deployment_response.py +5 -5
- platform_api_python_client/models/list_hardware_instance_response.py +5 -5
- platform_api_python_client/models/list_hardware_preset_response.py +5 -5
- platform_api_python_client/models/list_insights_response.py +5 -5
- platform_api_python_client/models/list_organization_gpu_quota_response.py +5 -5
- platform_api_python_client/models/list_prebuilt_image_response.py +5 -5
- platform_api_python_client/models/list_service_accounts_response.py +5 -5
- platform_api_python_client/models/list_user_vault_items_response.py +5 -5
- platform_api_python_client/models/list_volumes_response.py +5 -5
- platform_api_python_client/models/{validation_error_loc_inner.py → location_inner.py} +6 -6
- platform_api_python_client/models/metrics.py +117 -0
- platform_api_python_client/models/metrics_config.py +6 -5
- platform_api_python_client/models/{istio_overrides.py → mig.py} +28 -18
- platform_api_python_client/models/operator.py +117 -0
- platform_api_python_client/models/organization_gpu_quota_request.py +4 -3
- platform_api_python_client/models/organization_gpu_quota_response.py +4 -3
- platform_api_python_client/models/pilot.py +106 -0
- platform_api_python_client/models/pod_details.py +4 -3
- platform_api_python_client/models/pool.py +4 -3
- platform_api_python_client/models/prebuilt_image_response.py +4 -3
- platform_api_python_client/models/prometheus.py +110 -0
- platform_api_python_client/models/prometheus_rules.py +120 -0
- platform_api_python_client/models/prometheus_spec.py +113 -0
- platform_api_python_client/models/prometheus_values.py +117 -0
- platform_api_python_client/models/quota.py +106 -0
- platform_api_python_client/models/replicas.py +106 -0
- platform_api_python_client/models/resource_list.py +113 -0
- platform_api_python_client/models/resource_requirements.py +120 -0
- platform_api_python_client/models/revision_pod_details.py +5 -5
- platform_api_python_client/models/rollout_strategy_params.py +4 -3
- platform_api_python_client/models/scheduler.py +117 -0
- platform_api_python_client/models/service_account_response.py +4 -3
- platform_api_python_client/models/{istio.py → toggle.py} +27 -19
- platform_api_python_client/models/toleration.py +134 -0
- platform_api_python_client/models/unified_get_compute_deployment_response.py +8 -8
- platform_api_python_client/models/unified_get_deployment_logs_response.py +5 -5
- platform_api_python_client/models/unified_get_deployment_pods_response.py +4 -3
- platform_api_python_client/models/unified_get_deployment_revision_response.py +4 -3
- platform_api_python_client/models/unified_get_deployment_rollout_response.py +4 -3
- platform_api_python_client/models/unified_get_deployment_usage_response.py +5 -5
- platform_api_python_client/models/unified_get_dynamo_deployment_response.py +13 -13
- platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +9 -9
- platform_api_python_client/models/unified_get_job_deployment_response.py +8 -8
- platform_api_python_client/models/unified_list_deployment_revisions_response.py +5 -5
- platform_api_python_client/models/unified_update_deployment_rollout_request.py +4 -3
- platform_api_python_client/models/unified_write_compute_deployment_request.py +8 -8
- platform_api_python_client/models/unified_write_deployment_response.py +4 -3
- platform_api_python_client/models/unified_write_dynamo_deployment_request.py +11 -11
- platform_api_python_client/models/unified_write_inference_v3_deployment_request.py +9 -9
- platform_api_python_client/models/unified_write_job_deployment_request.py +8 -8
- platform_api_python_client/models/update_cluster_metadata_request.py +4 -3
- platform_api_python_client/models/{cluster_config.py → update_cluster_request.py} +11 -10
- platform_api_python_client/models/update_deployment_response.py +4 -3
- platform_api_python_client/models/update_deployment_status_v3_request.py +4 -3
- platform_api_python_client/models/update_insight_status_request.py +7 -6
- platform_api_python_client/models/update_service_account_request.py +4 -3
- platform_api_python_client/models/upsert_user_vault_item_request.py +4 -3
- platform_api_python_client/models/user_vault_item.py +4 -3
- platform_api_python_client/models/validation_error.py +8 -8
- platform_api_python_client/models/volume_mount.py +4 -3
- platform_api_python_client/models/volume_status_response.py +4 -3
- platform_api_python_client/models/{dynamo_communications_output.py → workload.py} +34 -15
- platform_api_python_client/rest.py +87 -10
- platform_api_python_client-4.41.0.dist-info/METADATA +418 -0
- platform_api_python_client-4.41.0.dist-info/RECORD +206 -0
- platform_api_python_client/models/cert_manager.py +0 -89
- platform_api_python_client/models/cluster_components.py +0 -193
- platform_api_python_client/models/external_dns.py +0 -89
- platform_api_python_client/models/final_stack.py +0 -89
- platform_api_python_client/models/gpu_operator.py +0 -89
- platform_api_python_client/models/ingress_nginx.py +0 -89
- platform_api_python_client/models/keda.py +0 -89
- platform_api_python_client/models/kube_prometheus_stack.py +0 -89
- platform_api_python_client/models/longhorn.py +0 -89
- platform_api_python_client/models/metrics_server.py +0 -89
- platform_api_python_client/models/network_operator.py +0 -89
- platform_api_python_client/models/opentelemetry_collector.py +0 -89
- platform_api_python_client/models/spire.py +0 -89
- platform_api_python_client/models/teleport_kube_agent.py +0 -89
- platform_api_python_client-4.37.1.dist-info/METADATA +0 -23
- platform_api_python_client-4.37.1.dist-info/RECORD +0 -180
- {platform_api_python_client-4.37.1.dist-info → platform_api_python_client-4.41.0.dist-info}/WHEEL +0 -0
- {platform_api_python_client-4.37.1.dist-info → platform_api_python_client-4.41.0.dist-info}/top_level.txt +0 -0
|
@@ -27,6 +27,7 @@ from platform_api_python_client.models.metrics_config import MetricsConfig
|
|
|
27
27
|
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
28
28
|
from typing import Optional, Set
|
|
29
29
|
from typing_extensions import Self
|
|
30
|
+
from pydantic_core import to_jsonable_python
|
|
30
31
|
|
|
31
32
|
class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
32
33
|
"""
|
|
@@ -40,8 +41,8 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
40
41
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
41
42
|
chart_revision: Optional[StrictStr] = None
|
|
42
43
|
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
43
|
-
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
44
|
-
hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
44
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="Kubernetes PriorityClass name on the pod spec. Omit to leave unset.")
|
|
45
|
+
hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Access-token vault item ID for HF_TOKEN. Cannot be combined with hf_token.")
|
|
45
46
|
image_url: StrictStr
|
|
46
47
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
47
48
|
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
@@ -60,32 +61,34 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
60
61
|
hf_token: Optional[StrictStr] = None
|
|
61
62
|
env_vars_refs: Optional[Dict[str, Any]] = None
|
|
62
63
|
backend_protocol: Optional[BackendProtocol] = None
|
|
64
|
+
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.")
|
|
63
65
|
enable_logging: Optional[StrictBool] = False
|
|
64
66
|
enable_node_model_cache: Optional[StrictBool] = False
|
|
65
67
|
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
68
|
config_file: Optional[ConfigFileMount] = None
|
|
67
69
|
metrics: Optional[MetricsConfig] = None
|
|
68
|
-
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "hf_token_ref", "image_url", "image_pull_secret_credentials", "image_pull_ref", "image_pull_secret_name", "port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "bearer_token_ref", "endpoint_certificate_authority", "hf_token", "env_vars_refs", "backend_protocol", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
70
|
+
__properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "hf_token_ref", "image_url", "image_pull_secret_credentials", "image_pull_ref", "image_pull_secret_name", "port", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "healthcheck", "env_vars", "command", "endpoint_bearer_token", "bearer_token_ref", "endpoint_certificate_authority", "hf_token", "env_vars_refs", "backend_protocol", "request_body_limit_mib", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"]
|
|
69
71
|
|
|
70
|
-
@field_validator('name')
|
|
72
|
+
@field_validator('name', mode="before")
|
|
71
73
|
def name_validate_regular_expression(cls, value):
|
|
72
74
|
"""Validates the regular expression"""
|
|
73
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
75
|
+
if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
74
76
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
75
77
|
return value
|
|
76
78
|
|
|
77
|
-
@field_validator('image_pull_secret_name')
|
|
79
|
+
@field_validator('image_pull_secret_name', mode="before")
|
|
78
80
|
def image_pull_secret_name_validate_regular_expression(cls, value):
|
|
79
81
|
"""Validates the regular expression"""
|
|
80
82
|
if value is None:
|
|
81
83
|
return value
|
|
82
84
|
|
|
83
|
-
if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
85
|
+
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):
|
|
84
86
|
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])?)*$/")
|
|
85
87
|
return value
|
|
86
88
|
|
|
87
89
|
model_config = ConfigDict(
|
|
88
|
-
|
|
90
|
+
validate_by_name=True,
|
|
91
|
+
validate_by_alias=True,
|
|
89
92
|
validate_assignment=True,
|
|
90
93
|
protected_namespaces=(),
|
|
91
94
|
)
|
|
@@ -97,8 +100,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
97
100
|
|
|
98
101
|
def to_json(self) -> str:
|
|
99
102
|
"""Returns the JSON representation of the model using alias"""
|
|
100
|
-
|
|
101
|
-
return json.dumps(self.to_dict())
|
|
103
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
102
104
|
|
|
103
105
|
@classmethod
|
|
104
106
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -127,8 +129,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
127
129
|
_items = []
|
|
128
130
|
if self.volume_mounts:
|
|
129
131
|
for _item_volume_mounts in self.volume_mounts:
|
|
130
|
-
if _item_volume_mounts
|
|
131
|
-
_items.append(_item_volume_mounts.to_dict())
|
|
132
|
+
_items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None)
|
|
132
133
|
_dict['volume_mounts'] = _items
|
|
133
134
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
134
135
|
if self.image_pull_secret_credentials:
|
|
@@ -274,6 +275,7 @@ class CreateInferenceV3DeploymentRequest(BaseModel):
|
|
|
274
275
|
"hf_token": obj.get("hf_token"),
|
|
275
276
|
"env_vars_refs": obj.get("env_vars_refs"),
|
|
276
277
|
"backend_protocol": obj.get("backend_protocol"),
|
|
278
|
+
"request_body_limit_mib": obj.get("request_body_limit_mib") if obj.get("request_body_limit_mib") is not None else 15,
|
|
277
279
|
"enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else False,
|
|
278
280
|
"enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False,
|
|
279
281
|
"session_affinity": obj.get("session_affinity") if obj.get("session_affinity") is not None else False,
|
|
@@ -25,6 +25,7 @@ from platform_api_python_client.models.image_pull_secret_credentials import Imag
|
|
|
25
25
|
from platform_api_python_client.models.volume_mount import VolumeMount
|
|
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 CreateJobDeploymentRequest(BaseModel):
|
|
30
31
|
"""
|
|
@@ -36,7 +37,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
36
37
|
user_annotations: Optional[Dict[str, StrictStr]] = None
|
|
37
38
|
chart_revision: Optional[StrictStr] = None
|
|
38
39
|
volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None
|
|
39
|
-
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None
|
|
40
|
+
priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = Field(default=None, description="Kubernetes PriorityClass name on the pod spec. Omit to leave unset.")
|
|
40
41
|
image_url: StrictStr
|
|
41
42
|
image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None
|
|
42
43
|
image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None
|
|
@@ -52,25 +53,26 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
52
53
|
config_file: Optional[ConfigFileMount] = None
|
|
53
54
|
__properties: ClassVar[List[str]] = ["name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "image_url", "image_pull_secret_credentials", "image_pull_ref", "image_pull_secret_name", "env_vars", "env_vars_refs", "command", "completions", "parallelism", "backoff_limit", "active_deadline_seconds", "enable_logging", "config_file"]
|
|
54
55
|
|
|
55
|
-
@field_validator('name')
|
|
56
|
+
@field_validator('name', mode="before")
|
|
56
57
|
def name_validate_regular_expression(cls, value):
|
|
57
58
|
"""Validates the regular expression"""
|
|
58
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
59
|
+
if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
59
60
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
60
61
|
return value
|
|
61
62
|
|
|
62
|
-
@field_validator('image_pull_secret_name')
|
|
63
|
+
@field_validator('image_pull_secret_name', mode="before")
|
|
63
64
|
def image_pull_secret_name_validate_regular_expression(cls, value):
|
|
64
65
|
"""Validates the regular expression"""
|
|
65
66
|
if value is None:
|
|
66
67
|
return value
|
|
67
68
|
|
|
68
|
-
if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value):
|
|
69
|
+
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):
|
|
69
70
|
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])?)*$/")
|
|
70
71
|
return value
|
|
71
72
|
|
|
72
73
|
model_config = ConfigDict(
|
|
73
|
-
|
|
74
|
+
validate_by_name=True,
|
|
75
|
+
validate_by_alias=True,
|
|
74
76
|
validate_assignment=True,
|
|
75
77
|
protected_namespaces=(),
|
|
76
78
|
)
|
|
@@ -82,8 +84,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
82
84
|
|
|
83
85
|
def to_json(self) -> str:
|
|
84
86
|
"""Returns the JSON representation of the model using alias"""
|
|
85
|
-
|
|
86
|
-
return json.dumps(self.to_dict())
|
|
87
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
87
88
|
|
|
88
89
|
@classmethod
|
|
89
90
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -112,8 +113,7 @@ class CreateJobDeploymentRequest(BaseModel):
|
|
|
112
113
|
_items = []
|
|
113
114
|
if self.volume_mounts:
|
|
114
115
|
for _item_volume_mounts in self.volume_mounts:
|
|
115
|
-
if _item_volume_mounts
|
|
116
|
-
_items.append(_item_volume_mounts.to_dict())
|
|
116
|
+
_items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None)
|
|
117
117
|
_dict['volume_mounts'] = _items
|
|
118
118
|
# override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials
|
|
119
119
|
if self.image_pull_secret_credentials:
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List
|
|
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 CreateJobDeploymentResponse(BaseModel):
|
|
27
28
|
"""
|
|
@@ -33,7 +34,8 @@ class CreateJobDeploymentResponse(BaseModel):
|
|
|
33
34
|
__properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
|
-
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
37
39
|
validate_assignment=True,
|
|
38
40
|
protected_namespaces=(),
|
|
39
41
|
)
|
|
@@ -45,8 +47,7 @@ class CreateJobDeploymentResponse(BaseModel):
|
|
|
45
47
|
|
|
46
48
|
def to_json(self) -> str:
|
|
47
49
|
"""Returns the JSON representation of the model using alias"""
|
|
48
|
-
|
|
49
|
-
return json.dumps(self.to_dict())
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
51
|
|
|
51
52
|
@classmethod
|
|
52
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -23,6 +23,7 @@ from typing_extensions import Annotated
|
|
|
23
23
|
from platform_api_python_client.models.object_storage_provider import ObjectStorageProvider
|
|
24
24
|
from typing import Optional, Set
|
|
25
25
|
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
26
27
|
|
|
27
28
|
class CreateObjectVolumeRequest(BaseModel):
|
|
28
29
|
"""
|
|
@@ -38,10 +39,10 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
38
39
|
read_only: Optional[StrictBool] = False
|
|
39
40
|
__properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "provider", "bucket", "region", "prefix", "read_only"]
|
|
40
41
|
|
|
41
|
-
@field_validator('name')
|
|
42
|
+
@field_validator('name', mode="before")
|
|
42
43
|
def name_validate_regular_expression(cls, value):
|
|
43
44
|
"""Validates the regular expression"""
|
|
44
|
-
if not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
45
|
+
if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value):
|
|
45
46
|
raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/")
|
|
46
47
|
return value
|
|
47
48
|
|
|
@@ -52,22 +53,23 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
52
53
|
raise ValueError("must be one of enum values ('object')")
|
|
53
54
|
return value
|
|
54
55
|
|
|
55
|
-
@field_validator('bucket')
|
|
56
|
+
@field_validator('bucket', mode="before")
|
|
56
57
|
def bucket_validate_regular_expression(cls, value):
|
|
57
58
|
"""Validates the regular expression"""
|
|
58
|
-
if not re.match(r"^(?:[0-9A-Za-z._-]+|arn:[a-z0-9-]+:s3(?:-outposts|-object-lambda)?:[0-9A-Za-z._:\/+=,@-]+)$", value):
|
|
59
|
+
if isinstance(value, str) and not re.match(r"^(?:[0-9A-Za-z._-]+|arn:[a-z0-9-]+:s3(?:-outposts|-object-lambda)?:[0-9A-Za-z._:\/+=,@-]+)$", value):
|
|
59
60
|
raise ValueError(r"must validate the regular expression /^(?:[0-9A-Za-z._-]+|arn:[a-z0-9-]+:s3(?:-outposts|-object-lambda)?:[0-9A-Za-z._:\/+=,@-]+)$/")
|
|
60
61
|
return value
|
|
61
62
|
|
|
62
|
-
@field_validator('region')
|
|
63
|
+
@field_validator('region', mode="before")
|
|
63
64
|
def region_validate_regular_expression(cls, value):
|
|
64
65
|
"""Validates the regular expression"""
|
|
65
|
-
if not re.match(r"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$", value):
|
|
66
|
+
if isinstance(value, str) and not re.match(r"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$", value):
|
|
66
67
|
raise ValueError(r"must validate the regular expression /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/")
|
|
67
68
|
return value
|
|
68
69
|
|
|
69
70
|
model_config = ConfigDict(
|
|
70
|
-
|
|
71
|
+
validate_by_name=True,
|
|
72
|
+
validate_by_alias=True,
|
|
71
73
|
validate_assignment=True,
|
|
72
74
|
protected_namespaces=(),
|
|
73
75
|
)
|
|
@@ -79,8 +81,7 @@ class CreateObjectVolumeRequest(BaseModel):
|
|
|
79
81
|
|
|
80
82
|
def to_json(self) -> str:
|
|
81
83
|
"""Returns the JSON representation of the model using alias"""
|
|
82
|
-
|
|
83
|
-
return json.dumps(self.to_dict())
|
|
84
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
84
85
|
|
|
85
86
|
@classmethod
|
|
86
87
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -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 CreateOrganizationRequest(BaseModel):
|
|
26
27
|
"""
|
|
@@ -30,7 +31,8 @@ class CreateOrganizationRequest(BaseModel):
|
|
|
30
31
|
__properties: ClassVar[List[str]] = ["name"]
|
|
31
32
|
|
|
32
33
|
model_config = ConfigDict(
|
|
33
|
-
|
|
34
|
+
validate_by_name=True,
|
|
35
|
+
validate_by_alias=True,
|
|
34
36
|
validate_assignment=True,
|
|
35
37
|
protected_namespaces=(),
|
|
36
38
|
)
|
|
@@ -42,8 +44,7 @@ class CreateOrganizationRequest(BaseModel):
|
|
|
42
44
|
|
|
43
45
|
def to_json(self) -> str:
|
|
44
46
|
"""Returns the JSON representation of the model using alias"""
|
|
45
|
-
|
|
46
|
-
return json.dumps(self.to_dict())
|
|
47
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
47
48
|
|
|
48
49
|
@classmethod
|
|
49
50
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -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 CreateOrganizationResponse(BaseModel):
|
|
26
27
|
"""
|
|
@@ -31,7 +32,8 @@ class CreateOrganizationResponse(BaseModel):
|
|
|
31
32
|
__properties: ClassVar[List[str]] = ["id", "name"]
|
|
32
33
|
|
|
33
34
|
model_config = ConfigDict(
|
|
34
|
-
|
|
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 CreateOrganizationResponse(BaseModel):
|
|
|
43
45
|
|
|
44
46
|
def to_json(self) -> str:
|
|
45
47
|
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
|
|
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]:
|
|
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional
|
|
|
22
22
|
from typing_extensions import Annotated
|
|
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 CreateServiceAccountRequest(BaseModel):
|
|
27
28
|
"""
|
|
@@ -33,7 +34,8 @@ class CreateServiceAccountRequest(BaseModel):
|
|
|
33
34
|
__properties: ClassVar[List[str]] = ["name", "description", "scopes"]
|
|
34
35
|
|
|
35
36
|
model_config = ConfigDict(
|
|
36
|
-
|
|
37
|
+
validate_by_name=True,
|
|
38
|
+
validate_by_alias=True,
|
|
37
39
|
validate_assignment=True,
|
|
38
40
|
protected_namespaces=(),
|
|
39
41
|
)
|
|
@@ -45,8 +47,7 @@ class CreateServiceAccountRequest(BaseModel):
|
|
|
45
47
|
|
|
46
48
|
def to_json(self) -> str:
|
|
47
49
|
"""Returns the JSON representation of the model using alias"""
|
|
48
|
-
|
|
49
|
-
return json.dumps(self.to_dict())
|
|
50
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
51
|
|
|
51
52
|
@classmethod
|
|
52
53
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, StrictStr
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
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 CreateServiceAccountResponse(BaseModel):
|
|
27
28
|
"""
|
|
@@ -37,7 +38,8 @@ class CreateServiceAccountResponse(BaseModel):
|
|
|
37
38
|
__properties: ClassVar[List[str]] = ["workos_id", "name", "description", "scopes", "created_at", "updated_at", "client_secret"]
|
|
38
39
|
|
|
39
40
|
model_config = ConfigDict(
|
|
40
|
-
|
|
41
|
+
validate_by_name=True,
|
|
42
|
+
validate_by_alias=True,
|
|
41
43
|
validate_assignment=True,
|
|
42
44
|
protected_namespaces=(),
|
|
43
45
|
)
|
|
@@ -49,8 +51,7 @@ class CreateServiceAccountResponse(BaseModel):
|
|
|
49
51
|
|
|
50
52
|
def to_json(self) -> str:
|
|
51
53
|
"""Returns the JSON representation of the model using alias"""
|
|
52
|
-
|
|
53
|
-
return json.dumps(self.to_dict())
|
|
54
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
54
55
|
|
|
55
56
|
@classmethod
|
|
56
57
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
|
|
|
21
21
|
from typing import Any, ClassVar, Dict, List, Union
|
|
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 CreditsResponse(BaseModel):
|
|
26
27
|
"""
|
|
@@ -30,7 +31,8 @@ class CreditsResponse(BaseModel):
|
|
|
30
31
|
__properties: ClassVar[List[str]] = ["credits"]
|
|
31
32
|
|
|
32
33
|
model_config = ConfigDict(
|
|
33
|
-
|
|
34
|
+
validate_by_name=True,
|
|
35
|
+
validate_by_alias=True,
|
|
34
36
|
validate_assignment=True,
|
|
35
37
|
protected_namespaces=(),
|
|
36
38
|
)
|
|
@@ -42,8 +44,7 @@ class CreditsResponse(BaseModel):
|
|
|
42
44
|
|
|
43
45
|
def to_json(self) -> str:
|
|
44
46
|
"""Returns the JSON representation of the model using alias"""
|
|
45
|
-
|
|
46
|
-
return json.dumps(self.to_dict())
|
|
47
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
47
48
|
|
|
48
49
|
@classmethod
|
|
49
50
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt
|
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Union
|
|
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 DailyBillResponse(BaseModel):
|
|
27
28
|
"""
|
|
@@ -32,7 +33,8 @@ class DailyBillResponse(BaseModel):
|
|
|
32
33
|
__properties: ClassVar[List[str]] = ["date", "credits"]
|
|
33
34
|
|
|
34
35
|
model_config = ConfigDict(
|
|
35
|
-
|
|
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 DailyBillResponse(BaseModel):
|
|
|
44
46
|
|
|
45
47
|
def to_json(self) -> str:
|
|
46
48
|
"""Returns the JSON representation of the model using alias"""
|
|
47
|
-
|
|
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,17 +21,19 @@ from pydantic import BaseModel, ConfigDict, StrictBool
|
|
|
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
|
-
class
|
|
26
|
+
class Dashboard(BaseModel):
|
|
26
27
|
"""
|
|
27
|
-
|
|
28
|
+
Dashboard configures the rollouts dashboard.
|
|
28
29
|
""" # noqa: E501
|
|
29
|
-
enabled: Optional[StrictBool] =
|
|
30
|
-
|
|
31
|
-
__properties: ClassVar[List[str]] = ["enabled"
|
|
30
|
+
enabled: Optional[StrictBool] = None
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties: ClassVar[List[str]] = ["enabled"]
|
|
32
33
|
|
|
33
34
|
model_config = ConfigDict(
|
|
34
|
-
|
|
35
|
+
validate_by_name=True,
|
|
36
|
+
validate_by_alias=True,
|
|
35
37
|
validate_assignment=True,
|
|
36
38
|
protected_namespaces=(),
|
|
37
39
|
)
|
|
@@ -43,12 +45,11 @@ class FluentBit(BaseModel):
|
|
|
43
45
|
|
|
44
46
|
def to_json(self) -> str:
|
|
45
47
|
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
|
|
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]:
|
|
51
|
-
"""Create an instance of
|
|
52
|
+
"""Create an instance of Dashboard from a JSON string"""
|
|
52
53
|
return cls.from_dict(json.loads(json_str))
|
|
53
54
|
|
|
54
55
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -60,8 +61,10 @@ class FluentBit(BaseModel):
|
|
|
60
61
|
* `None` is only added to the output dict for nullable fields that
|
|
61
62
|
were set at model initialization. Other fields with value `None`
|
|
62
63
|
are ignored.
|
|
64
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
63
65
|
"""
|
|
64
66
|
excluded_fields: Set[str] = set([
|
|
67
|
+
"additional_properties",
|
|
65
68
|
])
|
|
66
69
|
|
|
67
70
|
_dict = self.model_dump(
|
|
@@ -69,11 +72,21 @@ class FluentBit(BaseModel):
|
|
|
69
72
|
exclude=excluded_fields,
|
|
70
73
|
exclude_none=True,
|
|
71
74
|
)
|
|
75
|
+
# puts key-value pairs in additional_properties in the top level
|
|
76
|
+
if self.additional_properties is not None:
|
|
77
|
+
for _key, _value in self.additional_properties.items():
|
|
78
|
+
_dict[_key] = _value
|
|
79
|
+
|
|
80
|
+
# set to None if enabled (nullable) is None
|
|
81
|
+
# and model_fields_set contains the field
|
|
82
|
+
if self.enabled is None and "enabled" in self.model_fields_set:
|
|
83
|
+
_dict['enabled'] = None
|
|
84
|
+
|
|
72
85
|
return _dict
|
|
73
86
|
|
|
74
87
|
@classmethod
|
|
75
88
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
-
"""Create an instance of
|
|
89
|
+
"""Create an instance of Dashboard from a dict"""
|
|
77
90
|
if obj is None:
|
|
78
91
|
return None
|
|
79
92
|
|
|
@@ -81,9 +94,13 @@ class FluentBit(BaseModel):
|
|
|
81
94
|
return cls.model_validate(obj)
|
|
82
95
|
|
|
83
96
|
_obj = cls.model_validate({
|
|
84
|
-
"enabled": obj.get("enabled")
|
|
85
|
-
"values": obj.get("values")
|
|
97
|
+
"enabled": obj.get("enabled")
|
|
86
98
|
})
|
|
99
|
+
# store additional fields in additional_properties
|
|
100
|
+
for _key in obj.keys():
|
|
101
|
+
if _key not in cls.__properties:
|
|
102
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
103
|
+
|
|
87
104
|
return _obj
|
|
88
105
|
|
|
89
106
|
|
|
@@ -21,17 +21,19 @@ from pydantic import BaseModel, ConfigDict, StrictBool
|
|
|
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
|
-
class
|
|
26
|
+
class DefaultPriorities(BaseModel):
|
|
26
27
|
"""
|
|
27
|
-
|
|
28
|
+
DefaultPriorities configures the per-kind preemptibility ConfigMap.
|
|
28
29
|
""" # noqa: E501
|
|
29
|
-
enabled: Optional[StrictBool] =
|
|
30
|
-
|
|
31
|
-
__properties: ClassVar[List[str]] = ["enabled"
|
|
30
|
+
enabled: Optional[StrictBool] = None
|
|
31
|
+
additional_properties: Dict[str, Any] = {}
|
|
32
|
+
__properties: ClassVar[List[str]] = ["enabled"]
|
|
32
33
|
|
|
33
34
|
model_config = ConfigDict(
|
|
34
|
-
|
|
35
|
+
validate_by_name=True,
|
|
36
|
+
validate_by_alias=True,
|
|
35
37
|
validate_assignment=True,
|
|
36
38
|
protected_namespaces=(),
|
|
37
39
|
)
|
|
@@ -43,12 +45,11 @@ class PrometheusAdapter(BaseModel):
|
|
|
43
45
|
|
|
44
46
|
def to_json(self) -> str:
|
|
45
47
|
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
|
|
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]:
|
|
51
|
-
"""Create an instance of
|
|
52
|
+
"""Create an instance of DefaultPriorities from a JSON string"""
|
|
52
53
|
return cls.from_dict(json.loads(json_str))
|
|
53
54
|
|
|
54
55
|
def to_dict(self) -> Dict[str, Any]:
|
|
@@ -60,8 +61,10 @@ class PrometheusAdapter(BaseModel):
|
|
|
60
61
|
* `None` is only added to the output dict for nullable fields that
|
|
61
62
|
were set at model initialization. Other fields with value `None`
|
|
62
63
|
are ignored.
|
|
64
|
+
* Fields in `self.additional_properties` are added to the output dict.
|
|
63
65
|
"""
|
|
64
66
|
excluded_fields: Set[str] = set([
|
|
67
|
+
"additional_properties",
|
|
65
68
|
])
|
|
66
69
|
|
|
67
70
|
_dict = self.model_dump(
|
|
@@ -69,11 +72,21 @@ class PrometheusAdapter(BaseModel):
|
|
|
69
72
|
exclude=excluded_fields,
|
|
70
73
|
exclude_none=True,
|
|
71
74
|
)
|
|
75
|
+
# puts key-value pairs in additional_properties in the top level
|
|
76
|
+
if self.additional_properties is not None:
|
|
77
|
+
for _key, _value in self.additional_properties.items():
|
|
78
|
+
_dict[_key] = _value
|
|
79
|
+
|
|
80
|
+
# set to None if enabled (nullable) is None
|
|
81
|
+
# and model_fields_set contains the field
|
|
82
|
+
if self.enabled is None and "enabled" in self.model_fields_set:
|
|
83
|
+
_dict['enabled'] = None
|
|
84
|
+
|
|
72
85
|
return _dict
|
|
73
86
|
|
|
74
87
|
@classmethod
|
|
75
88
|
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
-
"""Create an instance of
|
|
89
|
+
"""Create an instance of DefaultPriorities from a dict"""
|
|
77
90
|
if obj is None:
|
|
78
91
|
return None
|
|
79
92
|
|
|
@@ -81,9 +94,13 @@ class PrometheusAdapter(BaseModel):
|
|
|
81
94
|
return cls.model_validate(obj)
|
|
82
95
|
|
|
83
96
|
_obj = cls.model_validate({
|
|
84
|
-
"enabled": obj.get("enabled")
|
|
85
|
-
"values": obj.get("values")
|
|
97
|
+
"enabled": obj.get("enabled")
|
|
86
98
|
})
|
|
99
|
+
# store additional fields in additional_properties
|
|
100
|
+
for _key in obj.keys():
|
|
101
|
+
if _key not in cls.__properties:
|
|
102
|
+
_obj.additional_properties[_key] = obj.get(_key)
|
|
103
|
+
|
|
87
104
|
return _obj
|
|
88
105
|
|
|
89
106
|
|