From f992ac48ddd1ed4898e1fbc22d289a57a8dd4a1b Mon Sep 17 00:00:00 2001 From: platform CI Date: Wed, 18 Nov 2026 20:09:29 +0000 Subject: [PATCH] Update clients to latest platform release (4.38.0) --- README.md | 16 +- docs/CreateComputeDeploymentRequest.md | 2 +- docs/CreateDynamoDeploymentRequest.md | 25 +- docs/CreateInferenceV3DeploymentRequest.md | 4 +- docs/CreateJobDeploymentRequest.md | 2 +- docs/DeploymentResponse.md | 13 +- docs/DynamoCommunicationsOutput.md | 29 - docs/DynamoFrontendConfig.md | 31 + docs/DynamoWorkerPoolConfig.md | 2 +- docs/EXTERNALApi.md | 129 ++++- docs/GetComputeDeploymentResponse.md | 2 +- docs/GetDeploymentLogResponse.md | 2 +- docs/GetDeploymentResponse.md | 2 +- docs/GetDynamoDeploymentResponse.md | 17 +- docs/GetInferenceDeploymentResponse.md | 2 +- docs/GetInferenceV3DeploymentResponse.md | 2 +- docs/GetJobDeploymentResponse.md | 2 +- docs/LocationInner.md | 28 + docs/UnifiedGetComputeDeploymentResponse.md | 2 +- docs/UnifiedGetDeploymentResponse.md | 8 +- docs/UnifiedGetDynamoDeploymentResponse.md | 8 +- ...UnifiedGetInferenceV3DeploymentResponse.md | 4 +- docs/UnifiedGetJobDeploymentResponse.md | 2 +- docs/UnifiedWriteComputeDeploymentRequest.md | 2 +- docs/UnifiedWriteDeploymentRequest.md | 8 +- docs/UnifiedWriteDynamoDeploymentRequest.md | 8 +- ...nifiedWriteInferenceV3DeploymentRequest.md | 4 +- docs/UnifiedWriteJobDeploymentRequest.md | 2 +- docs/UpdateInsightStatusRequest.md | 2 +- docs/ValidationError.md | 2 +- docs/ValidationErrorLocInner.md | 28 - git_push.sh | 31 +- platform_api_python_client/__init__.py | 535 ++++++++++++------ .../api/external_api.py | 50 +- platform_api_python_client/api_client.py | 117 ++-- platform_api_python_client/configuration.py | 328 ++++++++--- platform_api_python_client/exceptions.py | 29 +- platform_api_python_client/models/__init__.py | 6 +- .../models/argo_rollouts.py | 12 +- .../models/ccl_dynamo_pools.py | 7 +- .../models/ccl_main_pools.py | 7 +- .../models/cert_manager.py | 12 +- .../models/cluster_capacity_response.py | 10 +- .../models/cluster_components.py | 7 +- .../models/cluster_config.py | 7 +- .../models/cluster_credential.py | 7 +- .../models/cluster_registration_request.py | 7 +- .../models/cluster_registration_response.py | 7 +- .../models/config_file_mount.py | 11 +- .../create_compute_deployment_request.py | 20 +- .../create_compute_deployment_response.py | 7 +- .../create_dynamo_deployment_request.py | 52 +- .../create_dynamo_deployment_response.py | 7 +- .../create_filesystem_volume_request.py | 15 +- .../create_hardware_instance_request.py | 7 +- .../create_inference_deployment_response.py | 7 +- .../create_inference_v3_deployment_request.py | 22 +- .../models/create_job_deployment_request.py | 20 +- .../models/create_job_deployment_response.py | 7 +- .../models/create_object_volume_request.py | 19 +- .../models/create_organization_request.py | 7 +- .../models/create_organization_response.py | 7 +- .../models/create_service_account_request.py | 7 +- .../models/create_service_account_response.py | 7 +- .../models/credits_response.py | 7 +- .../models/daily_bill_response.py | 7 +- .../models/delete_user_vault_item_request.py | 7 +- .../models/deployment_log_event_v4.py | 7 +- .../models/deployment_status_request.py | 7 +- .../models/deployment_status_response.py | 7 +- .../models/deployment_status_v3_response.py | 10 +- .../models/deployment_usage.py | 10 +- .../models/deployment_usage_value.py | 7 +- .../models/dynamo_communications_input.py | 7 +- ...ns_output.py => dynamo_frontend_config.py} | 32 +- .../models/dynamo_image.py | 11 +- .../dynamo_kv_transfer_configuration.py | 7 +- .../dynamo_weight_transfer_configuration.py | 7 +- .../models/dynamo_worker_pool_config.py | 9 +- .../models/dynamo_worker_pools.py | 7 +- platform_api_python_client/models/env.py | 7 +- .../models/external_dns.py | 12 +- .../models/final_stack.py | 12 +- .../models/fluent_bit.py | 12 +- ...enerate_service_account_secret_response.py | 7 +- .../models/get_cluster_response.py | 7 +- .../models/get_compute_deployment_response.py | 16 +- .../models/get_deployment_log_response.py | 7 +- .../models/get_deployment_log_v4_response.py | 10 +- .../models/get_deployment_pods_response.py | 7 +- .../models/get_deployment_response.py | 14 +- .../get_deployment_revision_response.py | 7 +- .../models/get_deployment_usage_response.py | 10 +- .../models/get_dynamo_deployment_response.py | 40 +- .../models/get_filesystem_volume_response.py | 7 +- .../get_inference_deployment_response.py | 14 +- .../get_inference_v3_deployment_response.py | 16 +- .../models/get_job_deployment_response.py | 16 +- .../models/get_object_volume_response.py | 7 +- .../models/gpu_operator.py | 12 +- .../models/gpu_type_capacity.py | 7 +- .../models/hardware_instance_response.py | 7 +- .../models/hardware_preset_response.py | 7 +- .../models/http_validation_error.py | 10 +- platform_api_python_client/models/image.py | 11 +- .../models/image_pull_secret_credentials.py | 7 +- platform_api_python_client/models/ingress.py | 7 +- .../models/ingress_nginx.py | 12 +- .../models/insight_list_item_response.py | 7 +- .../models/insight_resource.py | 7 +- .../models/insight_response.py | 10 +- .../models/insight_status_change_response.py | 7 +- .../models/invite_user_request.py | 7 +- platform_api_python_client/models/istio.py | 7 +- .../models/istio_cni_overrides.py | 7 +- .../models/istio_cni_subchart_overrides.py | 7 +- .../models/istio_overrides.py | 7 +- platform_api_python_client/models/keda.py | 12 +- .../models/kube_prometheus_stack.py | 12 +- .../models/list_cluster_capacity_response.py | 10 +- .../models/list_daily_bill_response.py | 10 +- .../list_deployment_revisions_response.py | 10 +- .../models/list_get_cluster_response.py | 10 +- .../models/list_get_deployment_response.py | 10 +- .../models/list_hardware_instance_response.py | 10 +- .../models/list_hardware_preset_response.py | 10 +- .../models/list_insights_response.py | 10 +- .../list_organization_gpu_quota_response.py | 10 +- .../models/list_prebuilt_image_response.py | 10 +- .../models/list_service_accounts_response.py | 10 +- .../models/list_user_vault_items_response.py | 10 +- .../models/list_volumes_response.py | 10 +- ...n_error_loc_inner.py => location_inner.py} | 12 +- platform_api_python_client/models/longhorn.py | 12 +- .../models/metrics_config.py | 11 +- .../models/metrics_server.py | 12 +- .../models/network_operator.py | 12 +- .../models/opentelemetry_collector.py | 12 +- .../models/organization_gpu_quota_request.py | 7 +- .../models/organization_gpu_quota_response.py | 7 +- .../models/pod_details.py | 7 +- platform_api_python_client/models/pool.py | 7 +- .../models/prebuilt_image_response.py | 7 +- .../models/prometheus_adapter.py | 12 +- .../models/revision_pod_details.py | 10 +- .../models/rollout_strategy_params.py | 7 +- .../models/service_account_response.py | 7 +- platform_api_python_client/models/spire.py | 12 +- .../models/spire_crds.py | 12 +- .../models/teleport_kube_agent.py | 12 +- ...unified_get_compute_deployment_response.py | 16 +- .../unified_get_deployment_logs_response.py | 10 +- .../unified_get_deployment_pods_response.py | 7 +- ...nified_get_deployment_revision_response.py | 7 +- ...unified_get_deployment_rollout_response.py | 7 +- .../unified_get_deployment_usage_response.py | 10 +- .../unified_get_dynamo_deployment_response.py | 26 +- ...ed_get_inference_v3_deployment_response.py | 18 +- .../unified_get_job_deployment_response.py | 16 +- ...fied_list_deployment_revisions_response.py | 10 +- ...ified_update_deployment_rollout_request.py | 7 +- ...nified_write_compute_deployment_request.py | 16 +- .../unified_write_deployment_response.py | 7 +- ...unified_write_dynamo_deployment_request.py | 22 +- ...d_write_inference_v3_deployment_request.py | 18 +- .../unified_write_job_deployment_request.py | 16 +- .../models/update_cluster_metadata_request.py | 7 +- .../models/update_deployment_response.py | 7 +- .../update_deployment_status_v3_request.py | 7 +- .../models/update_insight_status_request.py | 13 +- .../models/update_service_account_request.py | 7 +- .../models/upsert_user_vault_item_request.py | 7 +- .../models/user_vault_item.py | 7 +- .../models/validation_error.py | 16 +- .../models/volume_mount.py | 7 +- .../models/volume_status_response.py | 7 +- platform_api_python_client/rest.py | 97 +++- pyproject.toml | 61 +- requirements.txt | 4 +- setup.py | 10 +- test-requirements.txt | 2 +- test/test_cluster_components.py | 40 +- test/test_cluster_config.py | 106 ++-- test/test_create_dynamo_deployment_request.py | 27 +- test/test_deployment_response.py | 25 +- test/test_deployment_status_v3_response.py | 2 +- test/test_dynamo_communications_input.py | 4 +- test/test_dynamo_communications_output.py | 54 -- test/test_dynamo_frontend_config.py | 52 ++ test/test_get_deployment_log_response.py | 4 +- test/test_get_dynamo_deployment_response.py | 27 +- test/test_istio.py | 5 +- test/test_istio_overrides.py | 4 +- test/test_list_user_vault_items_response.py | 4 +- ...or_loc_inner.py => test_location_inner.py} | 22 +- test/test_revision_pod_details.py | 2 +- test/test_unified_get_deployment_response.py | 38 +- ..._unified_get_dynamo_deployment_response.py | 38 +- ...ed_get_inference_v3_deployment_response.py | 4 +- test/test_unified_write_deployment_request.py | 38 +- ...unified_write_dynamo_deployment_request.py | 38 +- ...d_write_inference_v3_deployment_request.py | 4 +- 202 files changed, 2186 insertions(+), 1470 deletions(-) delete mode 100644 docs/DynamoCommunicationsOutput.md create mode 100644 docs/DynamoFrontendConfig.md create mode 100644 docs/LocationInner.md delete mode 100644 docs/ValidationErrorLocInner.md rename platform_api_python_client/models/{dynamo_communications_output.py => dynamo_frontend_config.py} (62%) rename platform_api_python_client/models/{validation_error_loc_inner.py => location_inner.py} (91%) delete mode 100644 test/test_dynamo_communications_output.py create mode 100644 test/test_dynamo_frontend_config.py rename test/{test_validation_error_loc_inner.py => test_location_inner.py} (59%) diff --git a/README.md b/README.md index a099312..f8781a6 100644 --- a/README.md +++ b/README.md @@ -4,13 +4,18 @@ No description provided (generated by Openapi Generator https://github.com/opena This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 0.1.0 -- Package version: 4.37.1 -- Generator version: 7.9.0 +- Package version: 4.38.0 +- Generator version: 7.26.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. -Python 3.7+ +Python 3.10+ + +Packaging uses standard `[project]` metadata and `[dependency-groups]` (PEP 621/735). +Install the package with `python -m pip install .`; install development dependencies +with Poetry 2.2 or newer using `poetry install`, or pip 25.1 or newer using +`python -m pip install --group dev`. The latter installs the group, not the package. ## Installation & Usage ### pip install @@ -228,7 +233,7 @@ Class | Method | HTTP request | Description - [DeploymentUsage](docs/DeploymentUsage.md) - [DeploymentUsageValue](docs/DeploymentUsageValue.md) - [DynamoCommunicationsInput](docs/DynamoCommunicationsInput.md) - - [DynamoCommunicationsOutput](docs/DynamoCommunicationsOutput.md) + - [DynamoFrontendConfig](docs/DynamoFrontendConfig.md) - [DynamoImage](docs/DynamoImage.md) - [DynamoKvTransferConfiguration](docs/DynamoKvTransferConfiguration.md) - [DynamoKvTransferPolicy](docs/DynamoKvTransferPolicy.md) @@ -293,6 +298,7 @@ Class | Method | HTTP request | Description - [ListServiceAccountsResponse](docs/ListServiceAccountsResponse.md) - [ListUserVaultItemsResponse](docs/ListUserVaultItemsResponse.md) - [ListVolumesResponse](docs/ListVolumesResponse.md) + - [LocationInner](docs/LocationInner.md) - [Longhorn](docs/Longhorn.md) - [Metric](docs/Metric.md) - [MetricsConfig](docs/MetricsConfig.md) @@ -344,7 +350,6 @@ Class | Method | HTTP request | Description - [UserVaultItem](docs/UserVaultItem.md) - [UserVaultType](docs/UserVaultType.md) - [ValidationError](docs/ValidationError.md) - - [ValidationErrorLocInner](docs/ValidationErrorLocInner.md) - [VaultScope](docs/VaultScope.md) - [VolumeAccessMode](docs/VolumeAccessMode.md) - [VolumeBackend](docs/VolumeBackend.md) @@ -368,4 +373,3 @@ Authentication schemes defined for the API: - diff --git a/docs/CreateComputeDeploymentRequest.md b/docs/CreateComputeDeploymentRequest.md index 72200de..40bf75c 100644 --- a/docs/CreateComputeDeploymentRequest.md +++ b/docs/CreateComputeDeploymentRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **image_url** | **str** | | **image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] **image_pull_ref** | **int** | | [optional] diff --git a/docs/CreateDynamoDeploymentRequest.md b/docs/CreateDynamoDeploymentRequest.md index a487e19..325c30b 100644 --- a/docs/CreateDynamoDeploymentRequest.md +++ b/docs/CreateDynamoDeploymentRequest.md @@ -10,26 +10,26 @@ Name | Type | Description | Notes **max_unavailable** | **int** | | [optional] **name** | **str** | | **cluster_id** | **int** | | -**hardware_instance_id** | **int** | | [optional] +**hardware_instance_id** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **serving_mode** | [**DynamoServingMode**](DynamoServingMode.md) | | [optional] -**worker_pools** | [**DynamoWorkerPools**](DynamoWorkerPools.md) | | [optional] -**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | | [optional] -**weight_transfer** | [**DynamoWeightTransferConfiguration**](DynamoWeightTransferConfiguration.md) | | [optional] +**worker_pools** | [**DynamoWorkerPools**](DynamoWorkerPools.md) | Hardware and scaling per worker role. Aggregated mode uses exactly `worker`; disaggregated mode uses exactly `prefill` and `decode`. Unused roles are null. | [optional] +**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration. | [optional] +**weight_transfer** | [**DynamoWeightTransferConfiguration**](DynamoWeightTransferConfiguration.md) | Platform-managed weight loading between the workers of a pool (ModelExpress peer transfer), in either serving mode. An empty object opts in and pins model_revision to a commit; omit or set null to keep the native loader. | [optional] **model** | **str** | | -**model_revision** | **str** | | [optional] +**model_revision** | **str** | Hugging Face branch, tag or commit of `model`. The API resolves it to a commit SHA and stores that SHA, so resume and rollback load the same weights. An update keeps the stored commit when it omits this field or sends that commit, as long as `model` is unchanged and extra_args does not set --revision; send a branch or tag to move to its newest commit. With no stored commit, weight_transfer pins the default branch's current commit, and otherwise each worker loads the default branch when it starts. | [optional] **served_model_name** | **str** | | [optional] **runtime_version** | **str** | Dynamo runtime image tag (for example 1.4.0). Defaults to the platform's current release; GET /prebuilt-images?type=dynamo lists the versions the platform has validated, but any tag may be requested. require_gpu_direct_rdma needs an EFA-capable image. Changing it restarts every component of a running deployment. | [optional] -**min_replicas** | **int** | | [optional] -**max_replicas** | **int** | | [optional] -**concurrency** | **int** | | [optional] -**cooldown_period** | **int** | | [optional] -**extra_args** | **str** | | [optional] +**min_replicas** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | [optional] +**max_replicas** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | [optional] +**concurrency** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | [optional] +**cooldown_period** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | [optional] +**extra_args** | **str** | Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected. | [optional] **hf_token** | **str** | | [optional] -**hf_token_ref** | **int** | | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. Cannot be combined with hf_token. | [optional] **env_vars** | **Dict[str, str]** | | [optional] **env_vars_refs** | **object** | | [optional] **endpoint_bearer_token** | **str** | | [optional] @@ -39,6 +39,7 @@ Name | Type | Description | Notes **enable_logging** | **bool** | | [optional] [default to True] **enable_node_model_cache** | **bool** | | [optional] [default to False] **backend_protocol** | [**BackendProtocol**](BackendProtocol.md) | | [optional] +**frontend** | [**DynamoFrontendConfig**](DynamoFrontendConfig.md) | Replica bounds for the Frontend (HTTP server and router) pods serving the endpoint, which are placed on separate nodes where possible. Two keep the endpoint serving through a node loss. min_replicas and max_replicas must be equal until Frontend autoscaling is supported. Changing them restarts every component of a running deployment. | [optional] ## Example diff --git a/docs/CreateInferenceV3DeploymentRequest.md b/docs/CreateInferenceV3DeploymentRequest.md index 1451190..2daa300 100644 --- a/docs/CreateInferenceV3DeploymentRequest.md +++ b/docs/CreateInferenceV3DeploymentRequest.md @@ -13,8 +13,8 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] -**hf_token_ref** | **int** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. Cannot be combined with hf_token. | [optional] **image_url** | **str** | | **image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] **image_pull_ref** | **int** | | [optional] diff --git a/docs/CreateJobDeploymentRequest.md b/docs/CreateJobDeploymentRequest.md index 731c221..12af83d 100644 --- a/docs/CreateJobDeploymentRequest.md +++ b/docs/CreateJobDeploymentRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **image_url** | **str** | | **image_pull_secret_credentials** | [**ImagePullSecretCredentials**](ImagePullSecretCredentials.md) | | [optional] **image_pull_ref** | **int** | | [optional] diff --git a/docs/DeploymentResponse.md b/docs/DeploymentResponse.md index 7fe11b9..cfe60d3 100644 --- a/docs/DeploymentResponse.md +++ b/docs/DeploymentResponse.md @@ -16,19 +16,19 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **hardware_instance_id** | **int** | | **revision_number** | **int** | | -**chart_revision** | **str** | | [optional] +**chart_revision** | **str** | 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. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **priority** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] **hf_token_ref** | **int** | | [optional] **serving_mode** | [**DynamoServingMode**](DynamoServingMode.md) | | [optional] -**worker_pools** | [**DynamoWorkerPools**](DynamoWorkerPools.md) | | [optional] -**communications** | [**DynamoCommunicationsOutput**](DynamoCommunicationsOutput.md) | | [optional] -**weight_transfer** | [**DynamoWeightTransferConfiguration**](DynamoWeightTransferConfiguration.md) | | [optional] +**worker_pools** | [**DynamoWorkerPools**](DynamoWorkerPools.md) | Hardware and scaling per worker role. Aggregated mode uses exactly `worker`; disaggregated mode uses exactly `prefill` and `decode`. Unused roles are null. | [optional] +**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | Requested communication policy; null for revisions using the legacy configuration. | [optional] +**weight_transfer** | [**DynamoWeightTransferConfiguration**](DynamoWeightTransferConfiguration.md) | Requested weight transfer policy; null when the workers use the native loader. | [optional] **model** | **str** | | -**model_revision** | **str** | | [optional] +**model_revision** | **str** | Commit SHA of `model` this revision loads; null when the workers load the default branch. | [optional] **served_model_name** | **str** | | [optional] -**runtime_version** | **str** | | [optional] +**runtime_version** | **str** | Dynamo runtime version tag this revision renders with. | [optional] **min_replicas** | **int** | | **max_replicas** | **int** | | **concurrency** | **int** | | [optional] @@ -43,6 +43,7 @@ Name | Type | Description | Notes **enable_logging** | **bool** | | [optional] [default to True] **enable_node_model_cache** | **bool** | | [optional] [default to False] **backend_protocol** | [**BackendProtocol**](BackendProtocol.md) | | [optional] +**frontend** | [**DynamoFrontendConfig**](DynamoFrontendConfig.md) | Frontend replica bounds this revision requests; the defaults for revisions created before the field. | [optional] **container_port** | **int** | | **healthcheck** | **str** | | [optional] **command** | **List[str]** | | [optional] diff --git a/docs/DynamoCommunicationsOutput.md b/docs/DynamoCommunicationsOutput.md deleted file mode 100644 index 1c406cf..0000000 --- a/docs/DynamoCommunicationsOutput.md +++ /dev/null @@ -1,29 +0,0 @@ -# DynamoCommunicationsOutput - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**kv_transfer** | [**DynamoKvTransferConfiguration**](DynamoKvTransferConfiguration.md) | | - -## Example - -```python -from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput - -# TODO update the JSON string below -json = "{}" -# create an instance of DynamoCommunicationsOutput from a JSON string -dynamo_communications_output_instance = DynamoCommunicationsOutput.from_json(json) -# print the JSON string representation of the object -print(DynamoCommunicationsOutput.to_json()) - -# convert the object into a dict -dynamo_communications_output_dict = dynamo_communications_output_instance.to_dict() -# create an instance of DynamoCommunicationsOutput from a dict -dynamo_communications_output_from_dict = DynamoCommunicationsOutput.from_dict(dynamo_communications_output_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/DynamoFrontendConfig.md b/docs/DynamoFrontendConfig.md new file mode 100644 index 0000000..1c44a7b --- /dev/null +++ b/docs/DynamoFrontendConfig.md @@ -0,0 +1,31 @@ +# DynamoFrontendConfig + +Replica bounds for the Dynamo Frontend, shaped like a worker pool's so that Frontend autoscaling can arrive without an API change. Until it does, the Frontend runs a fixed count: ``min_replicas`` must equal ``max_replicas``. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min_replicas** | **int** | | [optional] [default to 3] +**max_replicas** | **int** | | [optional] [default to 3] + +## Example + +```python +from platform_api_python_client.models.dynamo_frontend_config import DynamoFrontendConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of DynamoFrontendConfig from a JSON string +dynamo_frontend_config_instance = DynamoFrontendConfig.from_json(json) +# print the JSON string representation of the object +print(DynamoFrontendConfig.to_json()) + +# convert the object into a dict +dynamo_frontend_config_dict = dynamo_frontend_config_instance.to_dict() +# create an instance of DynamoFrontendConfig from a dict +dynamo_frontend_config_from_dict = DynamoFrontendConfig.from_dict(dynamo_frontend_config_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DynamoWorkerPoolConfig.md b/docs/DynamoWorkerPoolConfig.md index 3f094a4..d0b47a9 100644 --- a/docs/DynamoWorkerPoolConfig.md +++ b/docs/DynamoWorkerPoolConfig.md @@ -7,7 +7,7 @@ Hardware and scaling for one Dynamo worker role. ``min_replicas``/``max_replica Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **hardware_instance_id** | **int** | | -**replicas** | **int** | | [optional] +**replicas** | **int** | Deprecated fixed pool size, equivalent to min_replicas == max_replicas. | [optional] **min_replicas** | **int** | | [optional] **max_replicas** | **int** | | [optional] **concurrency** | **int** | | [optional] diff --git a/docs/EXTERNALApi.md b/docs/EXTERNALApi.md index 979fb34..d20fc5b 100644 --- a/docs/EXTERNALApi.md +++ b/docs/EXTERNALApi.md @@ -1347,7 +1347,9 @@ void (empty response body) Delete Unified Deployment -Delete a deployment, as PUT /deployments/status/{deployment_id} with DELETED does. Deletes ccl_compute, ccl_inference, ccl_job and ccl_dynamo deployments through ccluster, in any status. +Delete a deployment, as PUT /deployments/status/{deployment_id} with DELETED does. + +Deletes ccl_compute, ccl_inference, ccl_job and ccl_dynamo deployments through ccluster, in any status. ### Example @@ -1580,7 +1582,8 @@ Name | Type | Description | Notes Delete Volume Endpoint -Delete a volume: tear down its ArgoCD app (and PVC) if reachable, then soft-delete the row. Only the owner or an admin with admin:manage_volumes may delete. +Delete a volume: tear down its ArgoCD app (and PVC) if reachable, then soft-delete the row. +Only the owner or an admin with admin:manage_volumes may delete. ### Example @@ -1735,7 +1738,10 @@ Name | Type | Description | Notes Get All User Vault Items Endpoint -List metadata for every item the user can read, without any secret values. Values are deliberately omitted so browsing the vault never bulk-exposes secrets. Callers that need one value fetch it from the by-id endpoint below. +List metadata for every item the user can read, without any secret values. + +Values are deliberately omitted so browsing the vault never bulk-exposes +secrets. Callers that need one value fetch it from the by-id endpoint below. ### Example @@ -1744,7 +1750,6 @@ List metadata for every item the user can read, without any secret values. Valu ```python import platform_api_python_client from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse -from platform_api_python_client.models.user_vault_type import UserVaultType from platform_api_python_client.rest import ApiException from pprint import pprint @@ -2294,7 +2299,11 @@ No authorization required Get Current Org Gpu Quota -Return persisted GPU quotas for the caller's organization. Usage fields come later. ``cluster_id`` filters to that cluster when it is visible. Unknown or invisible cluster IDs return an empty list rather than 404 so this member endpoint does not leak whether a cluster exists. +Return persisted GPU quotas for the caller's organization. Usage fields come later. + +``cluster_id`` filters to that cluster when it is visible. Unknown or invisible +cluster IDs return an empty list rather than 404 so this member endpoint does +not leak whether a cluster exists. ### Example @@ -2549,7 +2558,33 @@ Name | Type | Description | Notes Get Deployment Logs V4 -Retrieve one page of a single pod's logs from Loki, oldest line first. - `pod`: which pod's logs to read; pick a name reported by `/deployments/pods/{deployment_id}/{revision_number}` — a pod unknown to the log store simply yields empty pages. - `fetch_newer`: direction. `false` (default) pages toward older logs, starting from the newest page; `true` fetches newer logs (for follow-polling). - `timestamp`: epoch-millisecond boundary (the events' `timestamp` unit), exclusive in both directions: `fetch_newer=false` returns lines strictly older than that millisecond, `fetch_newer=true` lines strictly newer. Without it both directions scan the whole log window: `fetch_newer=false` starts at the tail (the newest page), `fetch_newer=true` at the head (the oldest page) — to follow live logs, take the tail page first and pass its newest `timestamp`. There is no server-issued page token — mint the boundary from the events themselves (pages never split a millisecond, so a delivered boundary millisecond is always complete): pass the oldest event's `timestamp` to keep paging older, and the newest event `timestamp` seen on any page — history pages included — to fetch newer. An empty `fetch_newer=false` page means history is exhausted; an empty `fetch_newer=true` page means nothing new yet — poll again with the same `timestamp`. - `fetch_newer=true` with a `timestamp` also re-delivers the ~15 seconds at and before it on every poll (late-arriving lines land there), so callers must deduplicate by event `id`; re-delivered lines do not count toward `max_lines`. A span holding more than the log store's 5000-entry query ceiling re-delivers only its newest 5000 lines (the excess is dropped and logged server-side). - `max_lines`: cap on new lines per page — default 100, at most 5000 (the log store's per-query ceiling); a page may exceed it when many lines share one millisecond (such a group is never split across pages, unless it exceeds that same 5000-entry ceiling — the excess is then dropped and logged server-side) or through the re-delivered span. +Retrieve one page of a single pod's logs from Loki, oldest line first. + +- `pod`: which pod's logs to read; pick a name reported by + `/deployments/pods/{deployment_id}/{revision_number}` — a pod unknown to the log store + simply yields empty pages. +- `fetch_newer`: direction. `false` (default) pages toward older logs, starting from the + newest page; `true` fetches newer logs (for follow-polling). +- `timestamp`: epoch-millisecond boundary (the events' `timestamp` unit), exclusive in both + directions: `fetch_newer=false` returns lines strictly older than that millisecond, + `fetch_newer=true` lines strictly newer. Without it both directions scan the whole log + window: `fetch_newer=false` starts at the tail (the newest page), `fetch_newer=true` at + the head (the oldest page) — to follow live logs, take the tail page first and pass its + newest `timestamp`. There is no server-issued page token — mint the boundary from the + events themselves (pages never split a millisecond, so a delivered boundary millisecond + is always complete): pass the oldest event's `timestamp` to keep paging older, and the + newest event `timestamp` seen on any page — history pages included — to fetch newer. An + empty `fetch_newer=false` page means history is exhausted; an empty `fetch_newer=true` + page means nothing new yet — poll again with the same `timestamp`. +- `fetch_newer=true` with a `timestamp` also re-delivers the ~15 seconds at and before it on + every poll (late-arriving lines land there), so callers must deduplicate by event `id`; + re-delivered lines do not count toward `max_lines`. A span holding more than the log + store's 5000-entry query ceiling re-delivers only its newest 5000 lines (the excess is + dropped and logged server-side). +- `max_lines`: cap on new lines per page — default 100, at most 5000 (the log store's + per-query ceiling); a page may exceed it when many lines share one millisecond (such a + group is never split across pages, unless it exceeds that same 5000-entry ceiling — the + excess is then dropped and logged server-side) or through the re-delivered span. ### Example @@ -2638,7 +2673,9 @@ Name | Type | Description | Notes Get Deployment Pods -List the pod names recorded for this revision, recently terminated pods included; the history is bounded to a retention window, so the list can differ from the live pods in status_v3. +List the pod names recorded for this revision, recently terminated pods included; +the history is bounded to a retention window, so the list can differ from the live pods +in status_v3. ### Example @@ -3039,7 +3076,6 @@ Get Deployments ```python import platform_api_python_client -from platform_api_python_client.models.deployment_type import DeploymentType from platform_api_python_client.models.list_get_deployment_response import ListGetDeploymentResponse from platform_api_python_client.rest import ApiException from pprint import pprint @@ -3736,7 +3772,6 @@ Get Prebuilt Images ```python import platform_api_python_client -from platform_api_python_client.models.deployment_type import DeploymentType from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse from platform_api_python_client.rest import ApiException from pprint import pprint @@ -3808,7 +3843,9 @@ Name | Type | Description | Notes Get Unified Deployment -Get a ccl_compute, ccl_inference, ccl_job or ccl_dynamo deployment: its request and its read-only fields. env.vars values are masked unless the caller owns the deployment or may manage the organization's deployments. +Get a ccl_compute, ccl_inference, ccl_job or ccl_dynamo deployment: its request and its read-only fields. + +env.vars values are masked unless the caller owns the deployment or may manage the organization's deployments. ### Example @@ -3887,7 +3924,9 @@ Name | Type | Description | Notes Get Unified Deployment Logs -Read one page of a pod's logs from Loki, with the paging of GET /logs/{deployment_id}/{revision_number}. Take the pod from GET /deployments/{deployment_id}/revisions/{revision_number}/pods. +Read one page of a pod's logs from Loki, with the paging of GET /logs/{deployment_id}/{revision_number}. + +Take the pod from GET /deployments/{deployment_id}/revisions/{revision_number}/pods. ### Example @@ -3976,7 +4015,8 @@ Name | Type | Description | Notes Get Unified Deployment Pods -List the pods that logged under one revision, recently terminated pods included. The log store's retention bounds the history, so the list can differ from the running pods. +List the pods that logged under one revision, recently terminated pods included. The log store's retention +bounds the history, so the list can differ from the running pods. ### Example @@ -4217,7 +4257,10 @@ Name | Type | Description | Notes Get Unified Deployment Usage -Read a deployment's usage metrics, as GET /deployments/usage/{deployment_id} does. ccl_dynamo takes cpu, memory, gpu and gpu_memory with the component, revision_number and pod filters, as dynamo does; its dynamo_* metrics are not supported yet. +Read a deployment's usage metrics, as GET /deployments/usage/{deployment_id} does. + +ccl_dynamo takes cpu, memory, gpu and gpu_memory with the component, revision_number and pod filters, as dynamo +does; its dynamo_* metrics are not supported yet. ### Example @@ -4227,7 +4270,6 @@ Read a deployment's usage metrics, as GET /deployments/usage/{deployment_id} doe import platform_api_python_client from platform_api_python_client.models.metric import Metric from platform_api_python_client.models.unified_get_deployment_usage_response import UnifiedGetDeploymentUsageResponse -from platform_api_python_client.models.usage_component import UsageComponent from platform_api_python_client.rest import ApiException from pprint import pprint @@ -4382,7 +4424,6 @@ Get Usage import platform_api_python_client from platform_api_python_client.models.get_deployment_usage_response import GetDeploymentUsageResponse from platform_api_python_client.models.metric import Metric -from platform_api_python_client.models.usage_component import UsageComponent from platform_api_python_client.rest import ApiException from pprint import pprint @@ -4467,7 +4508,10 @@ Name | Type | Description | Notes Get User Vault Item By Id Endpoint -Resolve a single secret's value. This is the only endpoint that returns a vault value, so it is the single place where read access to secret material is authorized and auditable. +Resolve a single secret's value. + +This is the only endpoint that returns a vault value, so it is the single +place where read access to secret material is authorized and auditable. ### Example @@ -4625,7 +4669,8 @@ Name | Type | Description | Notes Get Volume Status Endpoint -Live volume status: status is the stored intent, service_status is computed from the volume app's health and PVC phase. +Live volume status: status is the stored intent, service_status is computed from the +volume app's health and PVC phase. ### Example @@ -4781,7 +4826,11 @@ Name | Type | Description | Notes List Cluster Capacity -Return GPU capacity breakdown for accessible clusters. When *cluster_id* is supplied only that cluster is included (if accessible). Clusters whose Prometheus data is unavailable are omitted from the results rather than failing the entire request. +Return GPU capacity breakdown for accessible clusters. + +When *cluster_id* is supplied only that cluster is included (if +accessible). Clusters whose Prometheus data is unavailable are omitted +from the results rather than failing the entire request. ### Example @@ -4943,8 +4992,6 @@ List Insights ```python import platform_api_python_client -from platform_api_python_client.models.insight_resource_type import InsightResourceType -from platform_api_python_client.models.insight_severity import InsightSeverity from platform_api_python_client.models.insight_status import InsightStatus from platform_api_python_client.models.list_insights_response import ListInsightsResponse from platform_api_python_client.rest import ApiException @@ -5103,7 +5150,8 @@ This endpoint does not need any parameter. List Unified Deployment Revisions -List a deployment's revisions, newest first, each read as GET /deployments/{deployment_id} reads the selected one. env.vars values are masked unless the caller owns the deployment or may manage the organization's deployments. +List a deployment's revisions, newest first, each read as GET /deployments/{deployment_id} reads the selected +one. env.vars values are masked unless the caller owns the deployment or may manage the organization's deployments. ### Example @@ -5182,7 +5230,14 @@ Name | Type | Description | Notes Put Org Gpu Quota On Cluster -Persist organization GPU quota on this cluster and apply KAI Queue CRs. ``gpu_quota`` of -1 is unlimited; a positive value is a hard cap. Rows are never removed. Requires ``CATALOG_TARGET_REVISION`` to contain ``catalog/src/catalog/kai_gpu_queues``. A 200 means the quota row was saved and an Argo CD sync was requested (not that Queue CRs are already healthy). A 502 means the row was saved but the Application upsert/sync request failed; re-issue this idempotent PUT to retry. +Persist organization GPU quota on this cluster and apply KAI Queue CRs. + +``gpu_quota`` of -1 is unlimited; a positive value is a hard cap. Rows are never +removed. Requires ``CATALOG_TARGET_REVISION`` to contain ``catalog/src/catalog/kai_gpu_queues``. + +A 200 means the quota row was saved and an Argo CD sync was requested (not that +Queue CRs are already healthy). A 502 means the row was saved but the Application +upsert/sync request failed; re-issue this idempotent PUT to retry. ### Example @@ -5350,7 +5405,10 @@ Name | Type | Description | Notes Rollout Unified Deployment Revision -Select a revision and roll the deployment out at it; ccl_job deployments cannot roll out a revision. An ACTIVE deployment applies the revision. A PAUSED deployment only selects it, and a resume applies it. max_surge and max_unavailable shape this rollout only, for ccl_inference and ccl_dynamo. +Select a revision and roll the deployment out at it; ccl_job deployments cannot roll out a revision. + +An ACTIVE deployment applies the revision. A PAUSED deployment only selects it, and a resume applies it. +max_surge and max_unavailable shape this rollout only, for ccl_inference and ccl_dynamo. ### Example @@ -5506,7 +5564,9 @@ This endpoint does not need any parameter. Update Cluster -Validate a cluster component configuration for an org-owned cluster. Infra provisioning is not wired yet; ``config.components`` is validated only. +Validate a cluster component configuration for an org-owned cluster. + +Infra provisioning is not wired yet; ``config.components`` is validated only. ### Example @@ -5587,7 +5647,9 @@ Name | Type | Description | Notes Update Cluster Metadata -Update DB metadata for an org-owned cluster. Global clusters (parent_id IS NULL) are not mutable here. +Update DB metadata for an org-owned cluster. + +Global clusters (parent_id IS NULL) are not mutable here. ### Example @@ -6468,7 +6530,10 @@ Name | Type | Description | Notes Update Unified Deployment -Replace a deployment's request and roll it out; ccl_job deployments cannot be updated. A PAUSED deployment stores the request without a rollout; a resume applies it. type, name, cluster_id and the pools keys cannot change. max_surge and max_unavailable shape this rollout only, for ccl_inference and ccl_dynamo. +Replace a deployment's request and roll it out; ccl_job deployments cannot be updated. + +A PAUSED deployment stores the request without a rollout; a resume applies it. type, name, cluster_id and the +pools keys cannot change. max_surge and max_unavailable shape this rollout only, for ccl_inference and ccl_dynamo. ### Example @@ -6636,7 +6701,10 @@ Name | Type | Description | Notes Update Unified Deployment Status -Pause or resume a deployment, as PUT /deployments/status/{deployment_id} does. Pauses and resumes ccl_compute, ccl_inference, ccl_job and ccl_dynamo deployments through ccluster. DELETE /deployments/{deployment_id} deletes them. +Pause or resume a deployment, as PUT /deployments/status/{deployment_id} does. + +Pauses and resumes ccl_compute, ccl_inference, ccl_job and ccl_dynamo deployments through ccluster. +DELETE /deployments/{deployment_id} deletes them. ### Example @@ -6718,7 +6786,12 @@ Name | Type | Description | Notes Update User Vault Item Endpoint -Create an immutable vault item. Existing secrets cannot be updated. Reusing an active type, key, and visibility returns 409, even for the same value. To replace a secret, create one with a new key and update its consumers before deleting the old secret. Recreating a deleted key allocates a new secret ID. The PUT route and request name are retained for existing clients. +Create an immutable vault item. Existing secrets cannot be updated. + +Reusing an active type, key, and visibility returns 409, even for the same value. +To replace a secret, create one with a new key and update its consumers before +deleting the old secret. Recreating a deleted key allocates a new secret ID. +The PUT route and request name are retained for existing clients. ### Example diff --git a/docs/GetComputeDeploymentResponse.md b/docs/GetComputeDeploymentResponse.md index 0dcde57..24f746a 100644 --- a/docs/GetComputeDeploymentResponse.md +++ b/docs/GetComputeDeploymentResponse.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **hardware_instance_id** | **int** | | **revision_number** | **int** | | -**chart_revision** | **str** | | [optional] +**chart_revision** | **str** | 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. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **priority** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] diff --git a/docs/GetDeploymentLogResponse.md b/docs/GetDeploymentLogResponse.md index ea0b847..430d646 100644 --- a/docs/GetDeploymentLogResponse.md +++ b/docs/GetDeploymentLogResponse.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**events** | **List[object]** | | +**events** | **List[Dict[str, object]]** | | **next_page_token** | **str** | | [optional] ## Example diff --git a/docs/GetDeploymentResponse.md b/docs/GetDeploymentResponse.md index 2e196fe..45cfb44 100644 --- a/docs/GetDeploymentResponse.md +++ b/docs/GetDeploymentResponse.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **hardware_instance_id** | **int** | | **revision_number** | **int** | | -**chart_revision** | **str** | | [optional] +**chart_revision** | **str** | 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. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **priority** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] diff --git a/docs/GetDynamoDeploymentResponse.md b/docs/GetDynamoDeploymentResponse.md index 5a4d003..5208cd2 100644 --- a/docs/GetDynamoDeploymentResponse.md +++ b/docs/GetDynamoDeploymentResponse.md @@ -17,23 +17,23 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **hardware_instance_id** | **int** | | **revision_number** | **int** | | -**chart_revision** | **str** | | [optional] +**chart_revision** | **str** | 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. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **priority** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] **hf_token_ref** | **int** | | [optional] **serving_mode** | [**DynamoServingMode**](DynamoServingMode.md) | | [optional] -**worker_pools** | [**DynamoWorkerPools**](DynamoWorkerPools.md) | | [optional] -**communications** | [**DynamoCommunicationsOutput**](DynamoCommunicationsOutput.md) | | [optional] -**weight_transfer** | [**DynamoWeightTransferConfiguration**](DynamoWeightTransferConfiguration.md) | | [optional] +**worker_pools** | [**DynamoWorkerPools**](DynamoWorkerPools.md) | Hardware and scaling per worker role. Aggregated mode uses exactly `worker`; disaggregated mode uses exactly `prefill` and `decode`. Unused roles are null. | [optional] +**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | Requested communication policy; null for revisions using the legacy configuration. | [optional] +**weight_transfer** | [**DynamoWeightTransferConfiguration**](DynamoWeightTransferConfiguration.md) | Requested weight transfer policy; null when the workers use the native loader. | [optional] **model** | **str** | | -**model_revision** | **str** | | [optional] +**model_revision** | **str** | Commit SHA of `model` this revision loads; null when the workers load the default branch. | [optional] **served_model_name** | **str** | | [optional] -**runtime_version** | **str** | | [optional] +**runtime_version** | **str** | Dynamo runtime version tag this revision renders with. | [optional] **min_replicas** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | **max_replicas** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | -**concurrency** | **int** | | [optional] -**cooldown_period** | **int** | | [optional] +**concurrency** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | [optional] +**cooldown_period** | **int** | Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree. | [optional] **extra_args** | **str** | | [optional] **env_vars** | **Dict[str, str]** | | [optional] **env_vars_refs** | **object** | | [optional] @@ -44,6 +44,7 @@ Name | Type | Description | Notes **enable_logging** | **bool** | | [optional] [default to True] **enable_node_model_cache** | **bool** | | [optional] [default to False] **backend_protocol** | [**BackendProtocol**](BackendProtocol.md) | | [optional] +**frontend** | [**DynamoFrontendConfig**](DynamoFrontendConfig.md) | Frontend replica bounds this revision requests; the defaults for revisions created before the field. | [optional] ## Example diff --git a/docs/GetInferenceDeploymentResponse.md b/docs/GetInferenceDeploymentResponse.md index 19bc3e2..f50b182 100644 --- a/docs/GetInferenceDeploymentResponse.md +++ b/docs/GetInferenceDeploymentResponse.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **hardware_instance_id** | **int** | | **revision_number** | **int** | | -**chart_revision** | **str** | | [optional] +**chart_revision** | **str** | 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. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **priority** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] diff --git a/docs/GetInferenceV3DeploymentResponse.md b/docs/GetInferenceV3DeploymentResponse.md index c1e66f2..e1d0060 100644 --- a/docs/GetInferenceV3DeploymentResponse.md +++ b/docs/GetInferenceV3DeploymentResponse.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **hardware_instance_id** | **int** | | **revision_number** | **int** | | -**chart_revision** | **str** | | [optional] +**chart_revision** | **str** | 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. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **priority** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] diff --git a/docs/GetJobDeploymentResponse.md b/docs/GetJobDeploymentResponse.md index 608be61..950eca7 100644 --- a/docs/GetJobDeploymentResponse.md +++ b/docs/GetJobDeploymentResponse.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **created_at** | **datetime** | | **hardware_instance_id** | **int** | | **revision_number** | **int** | | -**chart_revision** | **str** | | [optional] +**chart_revision** | **str** | 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. | [optional] **user_annotations** | **Dict[str, str]** | | [optional] **priority** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] diff --git a/docs/LocationInner.md b/docs/LocationInner.md new file mode 100644 index 0000000..6c50c97 --- /dev/null +++ b/docs/LocationInner.md @@ -0,0 +1,28 @@ +# LocationInner + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +## Example + +```python +from platform_api_python_client.models.location_inner import LocationInner + +# TODO update the JSON string below +json = "{}" +# create an instance of LocationInner from a JSON string +location_inner_instance = LocationInner.from_json(json) +# print the JSON string representation of the object +print(LocationInner.to_json()) + +# convert the object into a dict +location_inner_dict = location_inner_instance.to_dict() +# create an instance of LocationInner from a dict +location_inner_from_dict = LocationInner.from_dict(location_inner_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedGetComputeDeploymentResponse.md b/docs/UnifiedGetComputeDeploymentResponse.md index d0de4b3..4ef905a 100644 --- a/docs/UnifiedGetComputeDeploymentResponse.md +++ b/docs/UnifiedGetComputeDeploymentResponse.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclMainPools**](CclMainPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**Image**](Image.md) | | diff --git a/docs/UnifiedGetDeploymentResponse.md b/docs/UnifiedGetDeploymentResponse.md index 9c4d925..ffc8d85 100644 --- a/docs/UnifiedGetDeploymentResponse.md +++ b/docs/UnifiedGetDeploymentResponse.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclDynamoPools**](CclDynamoPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**DynamoImage**](DynamoImage.md) | | @@ -30,7 +30,7 @@ Name | Type | Description | Notes **healthcheck** | **str** | | [optional] **command** | **str** | | [optional] **config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] -**hf_token_ref** | **int** | | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. | [optional] **session_affinity** | **bool** | 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. | [optional] [default to False] **metrics** | [**MetricsConfig**](MetricsConfig.md) | | [optional] **enable_node_model_cache** | **bool** | | [optional] [default to False] @@ -39,10 +39,10 @@ Name | Type | Description | Notes **backoff_limit** | **int** | | [optional] [default to 3] **active_deadline_seconds** | **int** | | [optional] **serving_mode** | [**DynamoServingMode**](DynamoServingMode.md) | | [optional] -**communications** | [**DynamoCommunicationsOutput**](DynamoCommunicationsOutput.md) | | [optional] +**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration. | [optional] **model** | **str** | | **served_model_name** | **str** | | [optional] -**extra_args** | **str** | | [optional] +**extra_args** | **str** | Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected. | [optional] ## Example diff --git a/docs/UnifiedGetDynamoDeploymentResponse.md b/docs/UnifiedGetDynamoDeploymentResponse.md index 1066237..37a0d1c 100644 --- a/docs/UnifiedGetDynamoDeploymentResponse.md +++ b/docs/UnifiedGetDynamoDeploymentResponse.md @@ -18,17 +18,17 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclDynamoPools**](CclDynamoPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**DynamoImage**](DynamoImage.md) | | [optional] **ingress** | [**Ingress**](Ingress.md) | | **serving_mode** | [**DynamoServingMode**](DynamoServingMode.md) | | [optional] -**communications** | [**DynamoCommunicationsOutput**](DynamoCommunicationsOutput.md) | | [optional] +**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration. | [optional] **model** | **str** | | **served_model_name** | **str** | | [optional] -**extra_args** | **str** | | [optional] -**hf_token_ref** | **int** | | [optional] +**extra_args** | **str** | Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected. | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. | [optional] **enable_logging** | **bool** | | [optional] [default to True] **enable_node_model_cache** | **bool** | | [optional] [default to False] diff --git a/docs/UnifiedGetInferenceV3DeploymentResponse.md b/docs/UnifiedGetInferenceV3DeploymentResponse.md index 6b57507..7156b28 100644 --- a/docs/UnifiedGetInferenceV3DeploymentResponse.md +++ b/docs/UnifiedGetInferenceV3DeploymentResponse.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclMainPools**](CclMainPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**Image**](Image.md) | | @@ -27,7 +27,7 @@ Name | Type | Description | Notes **healthcheck** | **str** | | [optional] **command** | **str** | | [optional] **config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] -**hf_token_ref** | **int** | | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. | [optional] **session_affinity** | **bool** | 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. | [optional] [default to False] **metrics** | [**MetricsConfig**](MetricsConfig.md) | | [optional] **enable_logging** | **bool** | | [optional] [default to False] diff --git a/docs/UnifiedGetJobDeploymentResponse.md b/docs/UnifiedGetJobDeploymentResponse.md index 5ea2824..1a7150c 100644 --- a/docs/UnifiedGetJobDeploymentResponse.md +++ b/docs/UnifiedGetJobDeploymentResponse.md @@ -18,7 +18,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclMainPools**](CclMainPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**Image**](Image.md) | | diff --git a/docs/UnifiedWriteComputeDeploymentRequest.md b/docs/UnifiedWriteComputeDeploymentRequest.md index a29a11d..47c77cc 100644 --- a/docs/UnifiedWriteComputeDeploymentRequest.md +++ b/docs/UnifiedWriteComputeDeploymentRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclMainPools**](CclMainPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**Image**](Image.md) | | diff --git a/docs/UnifiedWriteDeploymentRequest.md b/docs/UnifiedWriteDeploymentRequest.md index 39e6491..3989a83 100644 --- a/docs/UnifiedWriteDeploymentRequest.md +++ b/docs/UnifiedWriteDeploymentRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclDynamoPools**](CclDynamoPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**DynamoImage**](DynamoImage.md) | | @@ -22,7 +22,7 @@ Name | Type | Description | Notes **healthcheck** | **str** | | [optional] **command** | **str** | | [optional] **config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] -**hf_token_ref** | **int** | | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. | [optional] **session_affinity** | **bool** | 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. | [optional] [default to False] **metrics** | [**MetricsConfig**](MetricsConfig.md) | | [optional] **enable_node_model_cache** | **bool** | | [optional] [default to False] @@ -31,10 +31,10 @@ Name | Type | Description | Notes **backoff_limit** | **int** | | [optional] [default to 3] **active_deadline_seconds** | **int** | | [optional] **serving_mode** | [**DynamoServingMode**](DynamoServingMode.md) | | [optional] -**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | | [optional] +**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration. | [optional] **model** | **str** | | **served_model_name** | **str** | | [optional] -**extra_args** | **str** | | [optional] +**extra_args** | **str** | Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected. | [optional] ## Example diff --git a/docs/UnifiedWriteDynamoDeploymentRequest.md b/docs/UnifiedWriteDynamoDeploymentRequest.md index d247a21..ea4efbb 100644 --- a/docs/UnifiedWriteDynamoDeploymentRequest.md +++ b/docs/UnifiedWriteDynamoDeploymentRequest.md @@ -11,17 +11,17 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclDynamoPools**](CclDynamoPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**DynamoImage**](DynamoImage.md) | | [optional] **ingress** | [**Ingress**](Ingress.md) | | **serving_mode** | [**DynamoServingMode**](DynamoServingMode.md) | | [optional] -**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | | [optional] +**communications** | [**DynamoCommunicationsInput**](DynamoCommunicationsInput.md) | Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration. | [optional] **model** | **str** | | **served_model_name** | **str** | | [optional] -**extra_args** | **str** | | [optional] -**hf_token_ref** | **int** | | [optional] +**extra_args** | **str** | Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected. | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. | [optional] **enable_logging** | **bool** | | [optional] [default to True] **enable_node_model_cache** | **bool** | | [optional] [default to False] diff --git a/docs/UnifiedWriteInferenceV3DeploymentRequest.md b/docs/UnifiedWriteInferenceV3DeploymentRequest.md index fe52616..8c3e5e3 100644 --- a/docs/UnifiedWriteInferenceV3DeploymentRequest.md +++ b/docs/UnifiedWriteInferenceV3DeploymentRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclMainPools**](CclMainPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**Image**](Image.md) | | @@ -20,7 +20,7 @@ Name | Type | Description | Notes **healthcheck** | **str** | | [optional] **command** | **str** | | [optional] **config_file** | [**ConfigFileMount**](ConfigFileMount.md) | | [optional] -**hf_token_ref** | **int** | | [optional] +**hf_token_ref** | **int** | Access-token vault item ID for HF_TOKEN. | [optional] **session_affinity** | **bool** | 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. | [optional] [default to False] **metrics** | [**MetricsConfig**](MetricsConfig.md) | | [optional] **enable_logging** | **bool** | | [optional] [default to False] diff --git a/docs/UnifiedWriteJobDeploymentRequest.md b/docs/UnifiedWriteJobDeploymentRequest.md index 7e36606..e351da4 100644 --- a/docs/UnifiedWriteJobDeploymentRequest.md +++ b/docs/UnifiedWriteJobDeploymentRequest.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **user_annotations** | **Dict[str, str]** | | [optional] **chart_revision** | **str** | | [optional] **volume_mounts** | [**List[VolumeMount]**](VolumeMount.md) | | [optional] -**priority** | **str** | | [optional] +**priority** | **str** | Kubernetes PriorityClass name on the pod spec. Omit to leave unset. | [optional] **pools** | [**CclMainPools**](CclMainPools.md) | | **env** | [**Env**](Env.md) | | [optional] **image** | [**Image**](Image.md) | | diff --git a/docs/UpdateInsightStatusRequest.md b/docs/UpdateInsightStatusRequest.md index 5730b38..79b78f2 100644 --- a/docs/UpdateInsightStatusRequest.md +++ b/docs/UpdateInsightStatusRequest.md @@ -6,7 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**InsightStatus**](InsightStatus.md) | | -**comment** | **str** | | [optional] +**comment** | **str** | Why the status changed; kept in the history and shown to reporters | [optional] ## Example diff --git a/docs/ValidationError.md b/docs/ValidationError.md index 86c31bb..384fbcc 100644 --- a/docs/ValidationError.md +++ b/docs/ValidationError.md @@ -5,7 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**loc** | [**List[ValidationErrorLocInner]**](ValidationErrorLocInner.md) | | +**loc** | [**List[LocationInner]**](LocationInner.md) | | **msg** | **str** | | **type** | **str** | | **input** | **object** | | [optional] diff --git a/docs/ValidationErrorLocInner.md b/docs/ValidationErrorLocInner.md deleted file mode 100644 index cd238f4..0000000 --- a/docs/ValidationErrorLocInner.md +++ /dev/null @@ -1,28 +0,0 @@ -# ValidationErrorLocInner - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -## Example - -```python -from platform_api_python_client.models.validation_error_loc_inner import ValidationErrorLocInner - -# TODO update the JSON string below -json = "{}" -# create an instance of ValidationErrorLocInner from a JSON string -validation_error_loc_inner_instance = ValidationErrorLocInner.from_json(json) -# print the JSON string representation of the object -print(ValidationErrorLocInner.to_json()) - -# convert the object into a dict -validation_error_loc_inner_dict = validation_error_loc_inner_instance.to_dict() -# create an instance of ValidationErrorLocInner from a dict -validation_error_loc_inner_from_dict = ValidationErrorLocInner.from_dict(validation_error_loc_inner_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/git_push.sh b/git_push.sh index 9a73e8a..0fbcfe7 100644 --- a/git_push.sh +++ b/git_push.sh @@ -8,24 +8,24 @@ git_repo_id=$2 release_note=$3 git_host=$4 -if [ "$git_host" = "" ]; then +if [ -z "${git_host}" ]; then git_host="github.com" - echo "[INFO] No command line input provided. Set \$git_host to $git_host" + echo "[INFO] No command line input provided. Set \${git_host} to ${git_host}" fi -if [ "$git_user_id" = "" ]; then +if [ -z "${git_user_id}" ]; then git_user_id="centml" - echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" + echo "[INFO] No command line input provided. Set \${git_user_id} to ${git_user_id}" fi -if [ "$git_repo_id" = "" ]; then +if [ -z "${git_repo_id}" ]; then git_repo_id="platform/client" - echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" + echo "[INFO] No command line input provided. Set \${git_repo_id} to ${git_repo_id}" fi -if [ "$release_note" = "" ]; then +if [ -z "${release_note}" ]; then release_note="Minor update" - echo "[INFO] No command line input provided. Set \$release_note to $release_note" + echo "[INFO] No command line input provided. Set \${release_note} to ${release_note}" fi # Initialize the local directory as a Git repository @@ -35,19 +35,16 @@ git init git add . # Commits the tracked changes and prepares them to be pushed to a remote repository. -git commit -m "$release_note" +git commit -m "${release_note}" # Sets the new remote -git_remote=$(git remote) -if [ "$git_remote" = "" ]; then # git remote not defined - - if [ "$GIT_TOKEN" = "" ]; then - echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." - git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git +if [ -z "$(git remote)" ]; then # git remote not defined + if [ -z "${GIT_TOKEN:-}" ]; then + echo "[INFO] \${GIT_TOKEN} (environment variable) is not set. Using the git credential in your environment." + git remote add origin "https://${git_host}/${git_user_id}/${git_repo_id}.git" else - git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + git remote add origin "https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git" fi - fi git pull origin master diff --git a/platform_api_python_client/__init__.py b/platform_api_python_client/__init__.py index 4937d56..057619a 100644 --- a/platform_api_python_client/__init__.py +++ b/platform_api_python_client/__init__.py @@ -14,186 +14,367 @@ """ # noqa: E501 -__version__ = "4.37.1" +__version__ = "4.38.0" + +# Define package exports +__all__ = [ + "EXTERNALApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "ArgoRollouts", + "BackendProtocol", + "CclDynamoPools", + "CclMainPools", + "CertManager", + "CloudProvider", + "ClusterCapacityResponse", + "ClusterComponents", + "ClusterConfig", + "ClusterCredential", + "ClusterRegistrationRequest", + "ClusterRegistrationResponse", + "ConfigFileMount", + "CreateComputeDeploymentRequest", + "CreateComputeDeploymentResponse", + "CreateDynamoDeploymentRequest", + "CreateDynamoDeploymentResponse", + "CreateFilesystemVolumeRequest", + "CreateHardwareInstanceRequest", + "CreateInferenceDeploymentResponse", + "CreateInferenceV3DeploymentRequest", + "CreateJobDeploymentRequest", + "CreateJobDeploymentResponse", + "CreateObjectVolumeRequest", + "CreateOrganizationRequest", + "CreateOrganizationResponse", + "CreateServiceAccountRequest", + "CreateServiceAccountResponse", + "CreateVolumeRequest", + "CreditsResponse", + "DailyBillResponse", + "DeleteUserVaultItemRequest", + "DeploymentComponentType", + "DeploymentLogEventV4", + "DeploymentResponse", + "DeploymentStatus", + "DeploymentStatusRequest", + "DeploymentStatusResponse", + "DeploymentStatusV3Response", + "DeploymentType", + "DeploymentUsage", + "DeploymentUsageValue", + "DynamoCommunicationsInput", + "DynamoFrontendConfig", + "DynamoImage", + "DynamoKvTransferConfiguration", + "DynamoKvTransferPolicy", + "DynamoServingMode", + "DynamoWeightTransferConfiguration", + "DynamoWeightTransferPolicy", + "DynamoWorkerPoolConfig", + "DynamoWorkerPools", + "Env", + "ExternalDns", + "FinalStack", + "FluentBit", + "GenerateServiceAccountSecretResponse", + "GetClusterResponse", + "GetComputeDeploymentResponse", + "GetDeploymentLogResponse", + "GetDeploymentLogV4Response", + "GetDeploymentPodsResponse", + "GetDeploymentResponse", + "GetDeploymentRevisionResponse", + "GetDeploymentUsageResponse", + "GetDynamoDeploymentResponse", + "GetFilesystemVolumeResponse", + "GetInferenceDeploymentResponse", + "GetInferenceV3DeploymentResponse", + "GetJobDeploymentResponse", + "GetObjectVolumeResponse", + "GetVolumeResponse", + "GpuOperator", + "GpuTypeCapacity", + "HTTPValidationError", + "HardwareInstanceResponse", + "HardwarePresetResponse", + "Image", + "ImagePullSecretCredentials", + "Ingress", + "IngressNginx", + "InsightListItemResponse", + "InsightResource", + "InsightResourceType", + "InsightResponse", + "InsightSeverity", + "InsightStatus", + "InsightStatusChangeResponse", + "InviteUserRequest", + "Istio", + "IstioCniOverrides", + "IstioCniSubchartOverrides", + "IstioOverrides", + "Keda", + "KubePrometheusStack", + "ListClusterCapacityResponse", + "ListDailyBillResponse", + "ListDeploymentRevisionsResponse", + "ListGetClusterResponse", + "ListGetDeploymentResponse", + "ListHardwareInstanceResponse", + "ListHardwarePresetResponse", + "ListInsightsResponse", + "ListOrganizationGpuQuotaResponse", + "ListPrebuiltImageResponse", + "ListServiceAccountsResponse", + "ListUserVaultItemsResponse", + "ListVolumesResponse", + "LocationInner", + "Longhorn", + "Metric", + "MetricsConfig", + "MetricsServer", + "NetworkOperator", + "ObjectStorageProvider", + "OpentelemetryCollector", + "OrganizationGpuQuotaRequest", + "OrganizationGpuQuotaResponse", + "PodDetails", + "PodStatus", + "Pool", + "PrebuiltImageResponse", + "PrometheusAdapter", + "RevisionPodDetails", + "RolloutStatus", + "RolloutStrategyParams", + "ServiceAccountResponse", + "ServiceStatus", + "Spire", + "SpireCrds", + "TeleportKubeAgent", + "UnifiedGetComputeDeploymentResponse", + "UnifiedGetDeploymentLogsResponse", + "UnifiedGetDeploymentPodsResponse", + "UnifiedGetDeploymentResponse", + "UnifiedGetDeploymentRevisionResponse", + "UnifiedGetDeploymentRolloutResponse", + "UnifiedGetDeploymentUsageResponse", + "UnifiedGetDynamoDeploymentResponse", + "UnifiedGetInferenceV3DeploymentResponse", + "UnifiedGetJobDeploymentResponse", + "UnifiedListDeploymentRevisionsResponse", + "UnifiedUpdateDeploymentRolloutRequest", + "UnifiedWriteComputeDeploymentRequest", + "UnifiedWriteDeploymentRequest", + "UnifiedWriteDeploymentResponse", + "UnifiedWriteDynamoDeploymentRequest", + "UnifiedWriteInferenceV3DeploymentRequest", + "UnifiedWriteJobDeploymentRequest", + "UpdateClusterMetadataRequest", + "UpdateDeploymentResponse", + "UpdateDeploymentStatusV3Request", + "UpdateInsightStatusRequest", + "UpdateServiceAccountRequest", + "UpsertUserVaultItemRequest", + "UsageAvailability", + "UsageComponent", + "UserVaultItem", + "UserVaultType", + "ValidationError", + "VaultScope", + "VolumeAccessMode", + "VolumeBackend", + "VolumeMount", + "VolumeStatus", + "VolumeStatusResponse", +] # import apis into sdk package -from platform_api_python_client.api.external_api import EXTERNALApi +from platform_api_python_client.api.external_api import EXTERNALApi as EXTERNALApi # import ApiClient -from platform_api_python_client.api_response import ApiResponse -from platform_api_python_client.api_client import ApiClient -from platform_api_python_client.configuration import Configuration -from platform_api_python_client.exceptions import OpenApiException -from platform_api_python_client.exceptions import ApiTypeError -from platform_api_python_client.exceptions import ApiValueError -from platform_api_python_client.exceptions import ApiKeyError -from platform_api_python_client.exceptions import ApiAttributeError -from platform_api_python_client.exceptions import ApiException +from platform_api_python_client.api_response import ApiResponse as ApiResponse +from platform_api_python_client.api_client import ApiClient as ApiClient +from platform_api_python_client.configuration import Configuration as Configuration +from platform_api_python_client.exceptions import OpenApiException as OpenApiException +from platform_api_python_client.exceptions import ApiTypeError as ApiTypeError +from platform_api_python_client.exceptions import ApiValueError as ApiValueError +from platform_api_python_client.exceptions import ApiKeyError as ApiKeyError +from platform_api_python_client.exceptions import ApiAttributeError as ApiAttributeError +from platform_api_python_client.exceptions import ApiException as ApiException # import models into sdk package -from platform_api_python_client.models.argo_rollouts import ArgoRollouts -from platform_api_python_client.models.backend_protocol import BackendProtocol -from platform_api_python_client.models.ccl_dynamo_pools import CclDynamoPools -from platform_api_python_client.models.ccl_main_pools import CclMainPools -from platform_api_python_client.models.cert_manager import CertManager -from platform_api_python_client.models.cloud_provider import CloudProvider -from platform_api_python_client.models.cluster_capacity_response import ClusterCapacityResponse -from platform_api_python_client.models.cluster_components import ClusterComponents -from platform_api_python_client.models.cluster_config import ClusterConfig -from platform_api_python_client.models.cluster_credential import ClusterCredential -from platform_api_python_client.models.cluster_registration_request import ClusterRegistrationRequest -from platform_api_python_client.models.cluster_registration_response import ClusterRegistrationResponse -from platform_api_python_client.models.config_file_mount import ConfigFileMount -from platform_api_python_client.models.create_compute_deployment_request import CreateComputeDeploymentRequest -from platform_api_python_client.models.create_compute_deployment_response import CreateComputeDeploymentResponse -from platform_api_python_client.models.create_dynamo_deployment_request import CreateDynamoDeploymentRequest -from platform_api_python_client.models.create_dynamo_deployment_response import CreateDynamoDeploymentResponse -from platform_api_python_client.models.create_filesystem_volume_request import CreateFilesystemVolumeRequest -from platform_api_python_client.models.create_hardware_instance_request import CreateHardwareInstanceRequest -from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse -from platform_api_python_client.models.create_inference_v3_deployment_request import CreateInferenceV3DeploymentRequest -from platform_api_python_client.models.create_job_deployment_request import CreateJobDeploymentRequest -from platform_api_python_client.models.create_job_deployment_response import CreateJobDeploymentResponse -from platform_api_python_client.models.create_object_volume_request import CreateObjectVolumeRequest -from platform_api_python_client.models.create_organization_request import CreateOrganizationRequest -from platform_api_python_client.models.create_organization_response import CreateOrganizationResponse -from platform_api_python_client.models.create_service_account_request import CreateServiceAccountRequest -from platform_api_python_client.models.create_service_account_response import CreateServiceAccountResponse -from platform_api_python_client.models.create_volume_request import CreateVolumeRequest -from platform_api_python_client.models.credits_response import CreditsResponse -from platform_api_python_client.models.daily_bill_response import DailyBillResponse -from platform_api_python_client.models.delete_user_vault_item_request import DeleteUserVaultItemRequest -from platform_api_python_client.models.deployment_component_type import DeploymentComponentType -from platform_api_python_client.models.deployment_log_event_v4 import DeploymentLogEventV4 -from platform_api_python_client.models.deployment_response import DeploymentResponse -from platform_api_python_client.models.deployment_status import DeploymentStatus -from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest -from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse -from platform_api_python_client.models.deployment_status_v3_response import DeploymentStatusV3Response -from platform_api_python_client.models.deployment_type import DeploymentType -from platform_api_python_client.models.deployment_usage import DeploymentUsage -from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue -from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput -from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput -from platform_api_python_client.models.dynamo_image import DynamoImage -from platform_api_python_client.models.dynamo_kv_transfer_configuration import DynamoKvTransferConfiguration -from platform_api_python_client.models.dynamo_kv_transfer_policy import DynamoKvTransferPolicy -from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode -from platform_api_python_client.models.dynamo_weight_transfer_configuration import DynamoWeightTransferConfiguration -from platform_api_python_client.models.dynamo_weight_transfer_policy import DynamoWeightTransferPolicy -from platform_api_python_client.models.dynamo_worker_pool_config import DynamoWorkerPoolConfig -from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools -from platform_api_python_client.models.env import Env -from platform_api_python_client.models.external_dns import ExternalDns -from platform_api_python_client.models.final_stack import FinalStack -from platform_api_python_client.models.fluent_bit import FluentBit -from platform_api_python_client.models.generate_service_account_secret_response import GenerateServiceAccountSecretResponse -from platform_api_python_client.models.get_cluster_response import GetClusterResponse -from platform_api_python_client.models.get_compute_deployment_response import GetComputeDeploymentResponse -from platform_api_python_client.models.get_deployment_log_response import GetDeploymentLogResponse -from platform_api_python_client.models.get_deployment_log_v4_response import GetDeploymentLogV4Response -from platform_api_python_client.models.get_deployment_pods_response import GetDeploymentPodsResponse -from platform_api_python_client.models.get_deployment_response import GetDeploymentResponse -from platform_api_python_client.models.get_deployment_revision_response import GetDeploymentRevisionResponse -from platform_api_python_client.models.get_deployment_usage_response import GetDeploymentUsageResponse -from platform_api_python_client.models.get_dynamo_deployment_response import GetDynamoDeploymentResponse -from platform_api_python_client.models.get_filesystem_volume_response import GetFilesystemVolumeResponse -from platform_api_python_client.models.get_inference_deployment_response import GetInferenceDeploymentResponse -from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse -from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse -from platform_api_python_client.models.get_object_volume_response import GetObjectVolumeResponse -from platform_api_python_client.models.get_volume_response import GetVolumeResponse -from platform_api_python_client.models.gpu_operator import GpuOperator -from platform_api_python_client.models.gpu_type_capacity import GpuTypeCapacity -from platform_api_python_client.models.http_validation_error import HTTPValidationError -from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse -from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse -from platform_api_python_client.models.image import Image -from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials -from platform_api_python_client.models.ingress import Ingress -from platform_api_python_client.models.ingress_nginx import IngressNginx -from platform_api_python_client.models.insight_list_item_response import InsightListItemResponse -from platform_api_python_client.models.insight_resource import InsightResource -from platform_api_python_client.models.insight_resource_type import InsightResourceType -from platform_api_python_client.models.insight_response import InsightResponse -from platform_api_python_client.models.insight_severity import InsightSeverity -from platform_api_python_client.models.insight_status import InsightStatus -from platform_api_python_client.models.insight_status_change_response import InsightStatusChangeResponse -from platform_api_python_client.models.invite_user_request import InviteUserRequest -from platform_api_python_client.models.istio import Istio -from platform_api_python_client.models.istio_cni_overrides import IstioCniOverrides -from platform_api_python_client.models.istio_cni_subchart_overrides import IstioCniSubchartOverrides -from platform_api_python_client.models.istio_overrides import IstioOverrides -from platform_api_python_client.models.keda import Keda -from platform_api_python_client.models.kube_prometheus_stack import KubePrometheusStack -from platform_api_python_client.models.list_cluster_capacity_response import ListClusterCapacityResponse -from platform_api_python_client.models.list_daily_bill_response import ListDailyBillResponse -from platform_api_python_client.models.list_deployment_revisions_response import ListDeploymentRevisionsResponse -from platform_api_python_client.models.list_get_cluster_response import ListGetClusterResponse -from platform_api_python_client.models.list_get_deployment_response import ListGetDeploymentResponse -from platform_api_python_client.models.list_hardware_instance_response import ListHardwareInstanceResponse -from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse -from platform_api_python_client.models.list_insights_response import ListInsightsResponse -from platform_api_python_client.models.list_organization_gpu_quota_response import ListOrganizationGpuQuotaResponse -from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse -from platform_api_python_client.models.list_service_accounts_response import ListServiceAccountsResponse -from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse -from platform_api_python_client.models.list_volumes_response import ListVolumesResponse -from platform_api_python_client.models.longhorn import Longhorn -from platform_api_python_client.models.metric import Metric -from platform_api_python_client.models.metrics_config import MetricsConfig -from platform_api_python_client.models.metrics_server import MetricsServer -from platform_api_python_client.models.network_operator import NetworkOperator -from platform_api_python_client.models.object_storage_provider import ObjectStorageProvider -from platform_api_python_client.models.opentelemetry_collector import OpentelemetryCollector -from platform_api_python_client.models.organization_gpu_quota_request import OrganizationGpuQuotaRequest -from platform_api_python_client.models.organization_gpu_quota_response import OrganizationGpuQuotaResponse -from platform_api_python_client.models.pod_details import PodDetails -from platform_api_python_client.models.pod_status import PodStatus -from platform_api_python_client.models.pool import Pool -from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse -from platform_api_python_client.models.prometheus_adapter import PrometheusAdapter -from platform_api_python_client.models.revision_pod_details import RevisionPodDetails -from platform_api_python_client.models.rollout_status import RolloutStatus -from platform_api_python_client.models.rollout_strategy_params import RolloutStrategyParams -from platform_api_python_client.models.service_account_response import ServiceAccountResponse -from platform_api_python_client.models.service_status import ServiceStatus -from platform_api_python_client.models.spire import Spire -from platform_api_python_client.models.spire_crds import SpireCrds -from platform_api_python_client.models.teleport_kube_agent import TeleportKubeAgent -from platform_api_python_client.models.unified_get_compute_deployment_response import UnifiedGetComputeDeploymentResponse -from platform_api_python_client.models.unified_get_deployment_logs_response import UnifiedGetDeploymentLogsResponse -from platform_api_python_client.models.unified_get_deployment_pods_response import UnifiedGetDeploymentPodsResponse -from platform_api_python_client.models.unified_get_deployment_response import UnifiedGetDeploymentResponse -from platform_api_python_client.models.unified_get_deployment_revision_response import UnifiedGetDeploymentRevisionResponse -from platform_api_python_client.models.unified_get_deployment_rollout_response import UnifiedGetDeploymentRolloutResponse -from platform_api_python_client.models.unified_get_deployment_usage_response import UnifiedGetDeploymentUsageResponse -from platform_api_python_client.models.unified_get_dynamo_deployment_response import UnifiedGetDynamoDeploymentResponse -from platform_api_python_client.models.unified_get_inference_v3_deployment_response import UnifiedGetInferenceV3DeploymentResponse -from platform_api_python_client.models.unified_get_job_deployment_response import UnifiedGetJobDeploymentResponse -from platform_api_python_client.models.unified_list_deployment_revisions_response import UnifiedListDeploymentRevisionsResponse -from platform_api_python_client.models.unified_update_deployment_rollout_request import UnifiedUpdateDeploymentRolloutRequest -from platform_api_python_client.models.unified_write_compute_deployment_request import UnifiedWriteComputeDeploymentRequest -from platform_api_python_client.models.unified_write_deployment_request import UnifiedWriteDeploymentRequest -from platform_api_python_client.models.unified_write_deployment_response import UnifiedWriteDeploymentResponse -from platform_api_python_client.models.unified_write_dynamo_deployment_request import UnifiedWriteDynamoDeploymentRequest -from platform_api_python_client.models.unified_write_inference_v3_deployment_request import UnifiedWriteInferenceV3DeploymentRequest -from platform_api_python_client.models.unified_write_job_deployment_request import UnifiedWriteJobDeploymentRequest -from platform_api_python_client.models.update_cluster_metadata_request import UpdateClusterMetadataRequest -from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse -from platform_api_python_client.models.update_deployment_status_v3_request import UpdateDeploymentStatusV3Request -from platform_api_python_client.models.update_insight_status_request import UpdateInsightStatusRequest -from platform_api_python_client.models.update_service_account_request import UpdateServiceAccountRequest -from platform_api_python_client.models.upsert_user_vault_item_request import UpsertUserVaultItemRequest -from platform_api_python_client.models.usage_availability import UsageAvailability -from platform_api_python_client.models.usage_component import UsageComponent -from platform_api_python_client.models.user_vault_item import UserVaultItem -from platform_api_python_client.models.user_vault_type import UserVaultType -from platform_api_python_client.models.validation_error import ValidationError -from platform_api_python_client.models.validation_error_loc_inner import ValidationErrorLocInner -from platform_api_python_client.models.vault_scope import VaultScope -from platform_api_python_client.models.volume_access_mode import VolumeAccessMode -from platform_api_python_client.models.volume_backend import VolumeBackend -from platform_api_python_client.models.volume_mount import VolumeMount -from platform_api_python_client.models.volume_status import VolumeStatus -from platform_api_python_client.models.volume_status_response import VolumeStatusResponse +from platform_api_python_client.models.argo_rollouts import ArgoRollouts as ArgoRollouts +from platform_api_python_client.models.backend_protocol import BackendProtocol as BackendProtocol +from platform_api_python_client.models.ccl_dynamo_pools import CclDynamoPools as CclDynamoPools +from platform_api_python_client.models.ccl_main_pools import CclMainPools as CclMainPools +from platform_api_python_client.models.cert_manager import CertManager as CertManager +from platform_api_python_client.models.cloud_provider import CloudProvider as CloudProvider +from platform_api_python_client.models.cluster_capacity_response import ClusterCapacityResponse as ClusterCapacityResponse +from platform_api_python_client.models.cluster_components import ClusterComponents as ClusterComponents +from platform_api_python_client.models.cluster_config import ClusterConfig as ClusterConfig +from platform_api_python_client.models.cluster_credential import ClusterCredential as ClusterCredential +from platform_api_python_client.models.cluster_registration_request import ClusterRegistrationRequest as ClusterRegistrationRequest +from platform_api_python_client.models.cluster_registration_response import ClusterRegistrationResponse as ClusterRegistrationResponse +from platform_api_python_client.models.config_file_mount import ConfigFileMount as ConfigFileMount +from platform_api_python_client.models.create_compute_deployment_request import CreateComputeDeploymentRequest as CreateComputeDeploymentRequest +from platform_api_python_client.models.create_compute_deployment_response import CreateComputeDeploymentResponse as CreateComputeDeploymentResponse +from platform_api_python_client.models.create_dynamo_deployment_request import CreateDynamoDeploymentRequest as CreateDynamoDeploymentRequest +from platform_api_python_client.models.create_dynamo_deployment_response import CreateDynamoDeploymentResponse as CreateDynamoDeploymentResponse +from platform_api_python_client.models.create_filesystem_volume_request import CreateFilesystemVolumeRequest as CreateFilesystemVolumeRequest +from platform_api_python_client.models.create_hardware_instance_request import CreateHardwareInstanceRequest as CreateHardwareInstanceRequest +from platform_api_python_client.models.create_inference_deployment_response import CreateInferenceDeploymentResponse as CreateInferenceDeploymentResponse +from platform_api_python_client.models.create_inference_v3_deployment_request import CreateInferenceV3DeploymentRequest as CreateInferenceV3DeploymentRequest +from platform_api_python_client.models.create_job_deployment_request import CreateJobDeploymentRequest as CreateJobDeploymentRequest +from platform_api_python_client.models.create_job_deployment_response import CreateJobDeploymentResponse as CreateJobDeploymentResponse +from platform_api_python_client.models.create_object_volume_request import CreateObjectVolumeRequest as CreateObjectVolumeRequest +from platform_api_python_client.models.create_organization_request import CreateOrganizationRequest as CreateOrganizationRequest +from platform_api_python_client.models.create_organization_response import CreateOrganizationResponse as CreateOrganizationResponse +from platform_api_python_client.models.create_service_account_request import CreateServiceAccountRequest as CreateServiceAccountRequest +from platform_api_python_client.models.create_service_account_response import CreateServiceAccountResponse as CreateServiceAccountResponse +from platform_api_python_client.models.create_volume_request import CreateVolumeRequest as CreateVolumeRequest +from platform_api_python_client.models.credits_response import CreditsResponse as CreditsResponse +from platform_api_python_client.models.daily_bill_response import DailyBillResponse as DailyBillResponse +from platform_api_python_client.models.delete_user_vault_item_request import DeleteUserVaultItemRequest as DeleteUserVaultItemRequest +from platform_api_python_client.models.deployment_component_type import DeploymentComponentType as DeploymentComponentType +from platform_api_python_client.models.deployment_log_event_v4 import DeploymentLogEventV4 as DeploymentLogEventV4 +from platform_api_python_client.models.deployment_response import DeploymentResponse as DeploymentResponse +from platform_api_python_client.models.deployment_status import DeploymentStatus as DeploymentStatus +from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest as DeploymentStatusRequest +from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse as DeploymentStatusResponse +from platform_api_python_client.models.deployment_status_v3_response import DeploymentStatusV3Response as DeploymentStatusV3Response +from platform_api_python_client.models.deployment_type import DeploymentType as DeploymentType +from platform_api_python_client.models.deployment_usage import DeploymentUsage as DeploymentUsage +from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue as DeploymentUsageValue +from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput as DynamoCommunicationsInput +from platform_api_python_client.models.dynamo_frontend_config import DynamoFrontendConfig as DynamoFrontendConfig +from platform_api_python_client.models.dynamo_image import DynamoImage as DynamoImage +from platform_api_python_client.models.dynamo_kv_transfer_configuration import DynamoKvTransferConfiguration as DynamoKvTransferConfiguration +from platform_api_python_client.models.dynamo_kv_transfer_policy import DynamoKvTransferPolicy as DynamoKvTransferPolicy +from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode as DynamoServingMode +from platform_api_python_client.models.dynamo_weight_transfer_configuration import DynamoWeightTransferConfiguration as DynamoWeightTransferConfiguration +from platform_api_python_client.models.dynamo_weight_transfer_policy import DynamoWeightTransferPolicy as DynamoWeightTransferPolicy +from platform_api_python_client.models.dynamo_worker_pool_config import DynamoWorkerPoolConfig as DynamoWorkerPoolConfig +from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools as DynamoWorkerPools +from platform_api_python_client.models.env import Env as Env +from platform_api_python_client.models.external_dns import ExternalDns as ExternalDns +from platform_api_python_client.models.final_stack import FinalStack as FinalStack +from platform_api_python_client.models.fluent_bit import FluentBit as FluentBit +from platform_api_python_client.models.generate_service_account_secret_response import GenerateServiceAccountSecretResponse as GenerateServiceAccountSecretResponse +from platform_api_python_client.models.get_cluster_response import GetClusterResponse as GetClusterResponse +from platform_api_python_client.models.get_compute_deployment_response import GetComputeDeploymentResponse as GetComputeDeploymentResponse +from platform_api_python_client.models.get_deployment_log_response import GetDeploymentLogResponse as GetDeploymentLogResponse +from platform_api_python_client.models.get_deployment_log_v4_response import GetDeploymentLogV4Response as GetDeploymentLogV4Response +from platform_api_python_client.models.get_deployment_pods_response import GetDeploymentPodsResponse as GetDeploymentPodsResponse +from platform_api_python_client.models.get_deployment_response import GetDeploymentResponse as GetDeploymentResponse +from platform_api_python_client.models.get_deployment_revision_response import GetDeploymentRevisionResponse as GetDeploymentRevisionResponse +from platform_api_python_client.models.get_deployment_usage_response import GetDeploymentUsageResponse as GetDeploymentUsageResponse +from platform_api_python_client.models.get_dynamo_deployment_response import GetDynamoDeploymentResponse as GetDynamoDeploymentResponse +from platform_api_python_client.models.get_filesystem_volume_response import GetFilesystemVolumeResponse as GetFilesystemVolumeResponse +from platform_api_python_client.models.get_inference_deployment_response import GetInferenceDeploymentResponse as GetInferenceDeploymentResponse +from platform_api_python_client.models.get_inference_v3_deployment_response import GetInferenceV3DeploymentResponse as GetInferenceV3DeploymentResponse +from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse as GetJobDeploymentResponse +from platform_api_python_client.models.get_object_volume_response import GetObjectVolumeResponse as GetObjectVolumeResponse +from platform_api_python_client.models.get_volume_response import GetVolumeResponse as GetVolumeResponse +from platform_api_python_client.models.gpu_operator import GpuOperator as GpuOperator +from platform_api_python_client.models.gpu_type_capacity import GpuTypeCapacity as GpuTypeCapacity +from platform_api_python_client.models.http_validation_error import HTTPValidationError as HTTPValidationError +from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse as HardwareInstanceResponse +from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse as HardwarePresetResponse +from platform_api_python_client.models.image import Image as Image +from platform_api_python_client.models.image_pull_secret_credentials import ImagePullSecretCredentials as ImagePullSecretCredentials +from platform_api_python_client.models.ingress import Ingress as Ingress +from platform_api_python_client.models.ingress_nginx import IngressNginx as IngressNginx +from platform_api_python_client.models.insight_list_item_response import InsightListItemResponse as InsightListItemResponse +from platform_api_python_client.models.insight_resource import InsightResource as InsightResource +from platform_api_python_client.models.insight_resource_type import InsightResourceType as InsightResourceType +from platform_api_python_client.models.insight_response import InsightResponse as InsightResponse +from platform_api_python_client.models.insight_severity import InsightSeverity as InsightSeverity +from platform_api_python_client.models.insight_status import InsightStatus as InsightStatus +from platform_api_python_client.models.insight_status_change_response import InsightStatusChangeResponse as InsightStatusChangeResponse +from platform_api_python_client.models.invite_user_request import InviteUserRequest as InviteUserRequest +from platform_api_python_client.models.istio import Istio as Istio +from platform_api_python_client.models.istio_cni_overrides import IstioCniOverrides as IstioCniOverrides +from platform_api_python_client.models.istio_cni_subchart_overrides import IstioCniSubchartOverrides as IstioCniSubchartOverrides +from platform_api_python_client.models.istio_overrides import IstioOverrides as IstioOverrides +from platform_api_python_client.models.keda import Keda as Keda +from platform_api_python_client.models.kube_prometheus_stack import KubePrometheusStack as KubePrometheusStack +from platform_api_python_client.models.list_cluster_capacity_response import ListClusterCapacityResponse as ListClusterCapacityResponse +from platform_api_python_client.models.list_daily_bill_response import ListDailyBillResponse as ListDailyBillResponse +from platform_api_python_client.models.list_deployment_revisions_response import ListDeploymentRevisionsResponse as ListDeploymentRevisionsResponse +from platform_api_python_client.models.list_get_cluster_response import ListGetClusterResponse as ListGetClusterResponse +from platform_api_python_client.models.list_get_deployment_response import ListGetDeploymentResponse as ListGetDeploymentResponse +from platform_api_python_client.models.list_hardware_instance_response import ListHardwareInstanceResponse as ListHardwareInstanceResponse +from platform_api_python_client.models.list_hardware_preset_response import ListHardwarePresetResponse as ListHardwarePresetResponse +from platform_api_python_client.models.list_insights_response import ListInsightsResponse as ListInsightsResponse +from platform_api_python_client.models.list_organization_gpu_quota_response import ListOrganizationGpuQuotaResponse as ListOrganizationGpuQuotaResponse +from platform_api_python_client.models.list_prebuilt_image_response import ListPrebuiltImageResponse as ListPrebuiltImageResponse +from platform_api_python_client.models.list_service_accounts_response import ListServiceAccountsResponse as ListServiceAccountsResponse +from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse as ListUserVaultItemsResponse +from platform_api_python_client.models.list_volumes_response import ListVolumesResponse as ListVolumesResponse +from platform_api_python_client.models.location_inner import LocationInner as LocationInner +from platform_api_python_client.models.longhorn import Longhorn as Longhorn +from platform_api_python_client.models.metric import Metric as Metric +from platform_api_python_client.models.metrics_config import MetricsConfig as MetricsConfig +from platform_api_python_client.models.metrics_server import MetricsServer as MetricsServer +from platform_api_python_client.models.network_operator import NetworkOperator as NetworkOperator +from platform_api_python_client.models.object_storage_provider import ObjectStorageProvider as ObjectStorageProvider +from platform_api_python_client.models.opentelemetry_collector import OpentelemetryCollector as OpentelemetryCollector +from platform_api_python_client.models.organization_gpu_quota_request import OrganizationGpuQuotaRequest as OrganizationGpuQuotaRequest +from platform_api_python_client.models.organization_gpu_quota_response import OrganizationGpuQuotaResponse as OrganizationGpuQuotaResponse +from platform_api_python_client.models.pod_details import PodDetails as PodDetails +from platform_api_python_client.models.pod_status import PodStatus as PodStatus +from platform_api_python_client.models.pool import Pool as Pool +from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse as PrebuiltImageResponse +from platform_api_python_client.models.prometheus_adapter import PrometheusAdapter as PrometheusAdapter +from platform_api_python_client.models.revision_pod_details import RevisionPodDetails as RevisionPodDetails +from platform_api_python_client.models.rollout_status import RolloutStatus as RolloutStatus +from platform_api_python_client.models.rollout_strategy_params import RolloutStrategyParams as RolloutStrategyParams +from platform_api_python_client.models.service_account_response import ServiceAccountResponse as ServiceAccountResponse +from platform_api_python_client.models.service_status import ServiceStatus as ServiceStatus +from platform_api_python_client.models.spire import Spire as Spire +from platform_api_python_client.models.spire_crds import SpireCrds as SpireCrds +from platform_api_python_client.models.teleport_kube_agent import TeleportKubeAgent as TeleportKubeAgent +from platform_api_python_client.models.unified_get_compute_deployment_response import UnifiedGetComputeDeploymentResponse as UnifiedGetComputeDeploymentResponse +from platform_api_python_client.models.unified_get_deployment_logs_response import UnifiedGetDeploymentLogsResponse as UnifiedGetDeploymentLogsResponse +from platform_api_python_client.models.unified_get_deployment_pods_response import UnifiedGetDeploymentPodsResponse as UnifiedGetDeploymentPodsResponse +from platform_api_python_client.models.unified_get_deployment_response import UnifiedGetDeploymentResponse as UnifiedGetDeploymentResponse +from platform_api_python_client.models.unified_get_deployment_revision_response import UnifiedGetDeploymentRevisionResponse as UnifiedGetDeploymentRevisionResponse +from platform_api_python_client.models.unified_get_deployment_rollout_response import UnifiedGetDeploymentRolloutResponse as UnifiedGetDeploymentRolloutResponse +from platform_api_python_client.models.unified_get_deployment_usage_response import UnifiedGetDeploymentUsageResponse as UnifiedGetDeploymentUsageResponse +from platform_api_python_client.models.unified_get_dynamo_deployment_response import UnifiedGetDynamoDeploymentResponse as UnifiedGetDynamoDeploymentResponse +from platform_api_python_client.models.unified_get_inference_v3_deployment_response import UnifiedGetInferenceV3DeploymentResponse as UnifiedGetInferenceV3DeploymentResponse +from platform_api_python_client.models.unified_get_job_deployment_response import UnifiedGetJobDeploymentResponse as UnifiedGetJobDeploymentResponse +from platform_api_python_client.models.unified_list_deployment_revisions_response import UnifiedListDeploymentRevisionsResponse as UnifiedListDeploymentRevisionsResponse +from platform_api_python_client.models.unified_update_deployment_rollout_request import UnifiedUpdateDeploymentRolloutRequest as UnifiedUpdateDeploymentRolloutRequest +from platform_api_python_client.models.unified_write_compute_deployment_request import UnifiedWriteComputeDeploymentRequest as UnifiedWriteComputeDeploymentRequest +from platform_api_python_client.models.unified_write_deployment_request import UnifiedWriteDeploymentRequest as UnifiedWriteDeploymentRequest +from platform_api_python_client.models.unified_write_deployment_response import UnifiedWriteDeploymentResponse as UnifiedWriteDeploymentResponse +from platform_api_python_client.models.unified_write_dynamo_deployment_request import UnifiedWriteDynamoDeploymentRequest as UnifiedWriteDynamoDeploymentRequest +from platform_api_python_client.models.unified_write_inference_v3_deployment_request import UnifiedWriteInferenceV3DeploymentRequest as UnifiedWriteInferenceV3DeploymentRequest +from platform_api_python_client.models.unified_write_job_deployment_request import UnifiedWriteJobDeploymentRequest as UnifiedWriteJobDeploymentRequest +from platform_api_python_client.models.update_cluster_metadata_request import UpdateClusterMetadataRequest as UpdateClusterMetadataRequest +from platform_api_python_client.models.update_deployment_response import UpdateDeploymentResponse as UpdateDeploymentResponse +from platform_api_python_client.models.update_deployment_status_v3_request import UpdateDeploymentStatusV3Request as UpdateDeploymentStatusV3Request +from platform_api_python_client.models.update_insight_status_request import UpdateInsightStatusRequest as UpdateInsightStatusRequest +from platform_api_python_client.models.update_service_account_request import UpdateServiceAccountRequest as UpdateServiceAccountRequest +from platform_api_python_client.models.upsert_user_vault_item_request import UpsertUserVaultItemRequest as UpsertUserVaultItemRequest +from platform_api_python_client.models.usage_availability import UsageAvailability as UsageAvailability +from platform_api_python_client.models.usage_component import UsageComponent as UsageComponent +from platform_api_python_client.models.user_vault_item import UserVaultItem as UserVaultItem +from platform_api_python_client.models.user_vault_type import UserVaultType as UserVaultType +from platform_api_python_client.models.validation_error import ValidationError as ValidationError +from platform_api_python_client.models.vault_scope import VaultScope as VaultScope +from platform_api_python_client.models.volume_access_mode import VolumeAccessMode as VolumeAccessMode +from platform_api_python_client.models.volume_backend import VolumeBackend as VolumeBackend +from platform_api_python_client.models.volume_mount import VolumeMount as VolumeMount +from platform_api_python_client.models.volume_status import VolumeStatus as VolumeStatus +from platform_api_python_client.models.volume_status_response import VolumeStatusResponse as VolumeStatusResponse + diff --git a/platform_api_python_client/api/external_api.py b/platform_api_python_client/api/external_api.py index f12649b..370de9c 100644 --- a/platform_api_python_client/api/external_api.py +++ b/platform_api_python_client/api/external_api.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Platform External API @@ -11,6 +9,7 @@ Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -42,7 +41,6 @@ from platform_api_python_client.models.deployment_status_request import DeploymentStatusRequest from platform_api_python_client.models.deployment_status_response import DeploymentStatusResponse from platform_api_python_client.models.deployment_status_v3_response import DeploymentStatusV3Response -from platform_api_python_client.models.deployment_type import DeploymentType from platform_api_python_client.models.generate_service_account_secret_response import GenerateServiceAccountSecretResponse from platform_api_python_client.models.get_cluster_response import GetClusterResponse from platform_api_python_client.models.get_compute_deployment_response import GetComputeDeploymentResponse @@ -57,9 +55,7 @@ from platform_api_python_client.models.get_job_deployment_response import GetJobDeploymentResponse from platform_api_python_client.models.get_volume_response import GetVolumeResponse from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse -from platform_api_python_client.models.insight_resource_type import InsightResourceType from platform_api_python_client.models.insight_response import InsightResponse -from platform_api_python_client.models.insight_severity import InsightSeverity from platform_api_python_client.models.insight_status import InsightStatus from platform_api_python_client.models.invite_user_request import InviteUserRequest from platform_api_python_client.models.list_cluster_capacity_response import ListClusterCapacityResponse @@ -96,9 +92,7 @@ from platform_api_python_client.models.update_insight_status_request import UpdateInsightStatusRequest from platform_api_python_client.models.update_service_account_request import UpdateServiceAccountRequest from platform_api_python_client.models.upsert_user_vault_item_request import UpsertUserVaultItemRequest -from platform_api_python_client.models.usage_component import UsageComponent from platform_api_python_client.models.user_vault_item import UserVaultItem -from platform_api_python_client.models.user_vault_type import UserVaultType from platform_api_python_client.models.volume_status_response import VolumeStatusResponse from platform_api_python_client.api_client import ApiClient, RequestSerialized @@ -5967,7 +5961,7 @@ def _generate_service_account_secret_service_accounts_workos_id_secrets_post_ser @validate_call def get_all_user_vault_items_endpoint_user_vault_get( self, - type: Optional[UserVaultType] = None, + type: Optional[Any] = None, search_query: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -6039,7 +6033,7 @@ def get_all_user_vault_items_endpoint_user_vault_get( @validate_call def get_all_user_vault_items_endpoint_user_vault_get_with_http_info( self, - type: Optional[UserVaultType] = None, + type: Optional[Any] = None, search_query: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -6111,7 +6105,7 @@ def get_all_user_vault_items_endpoint_user_vault_get_with_http_info( @validate_call def get_all_user_vault_items_endpoint_user_vault_get_without_preload_content( self, - type: Optional[UserVaultType] = None, + type: Optional[Any] = None, search_query: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -10706,7 +10700,7 @@ def get_deployments_deployments_get( self, offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - type: Optional[DeploymentType] = None, + type: Optional[Any] = None, search_query: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -10785,7 +10779,7 @@ def get_deployments_deployments_get_with_http_info( self, offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - type: Optional[DeploymentType] = None, + type: Optional[Any] = None, search_query: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -10864,7 +10858,7 @@ def get_deployments_deployments_get_without_preload_content( self, offset: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, limit: Optional[Annotated[int, Field(strict=True, ge=0)]] = None, - type: Optional[DeploymentType] = None, + type: Optional[Any] = None, search_query: Optional[StrictStr] = None, _request_timeout: Union[ None, @@ -13105,7 +13099,7 @@ def _get_org_gpu_quota_on_cluster_clusters_cluster_id_organizations_organization @validate_call def get_prebuilt_images_prebuilt_images_get( self, - type: Optional[DeploymentType] = None, + type: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13172,7 +13166,7 @@ def get_prebuilt_images_prebuilt_images_get( @validate_call def get_prebuilt_images_prebuilt_images_get_with_http_info( self, - type: Optional[DeploymentType] = None, + type: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -13239,7 +13233,7 @@ def get_prebuilt_images_prebuilt_images_get_with_http_info( @validate_call def get_prebuilt_images_prebuilt_images_get_without_preload_content( self, - type: Optional[DeploymentType] = None, + type: Optional[Any] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -14807,7 +14801,7 @@ def get_unified_deployment_usage_deployments_deployment_id_usage_get( end_time_in_seconds: StrictInt, step: Optional[StrictInt] = None, revision_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - component: Optional[UsageComponent] = None, + component: Optional[Any] = None, pod: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None, _request_timeout: Union[ None, @@ -14903,7 +14897,7 @@ def get_unified_deployment_usage_deployments_deployment_id_usage_get_with_http_i end_time_in_seconds: StrictInt, step: Optional[StrictInt] = None, revision_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - component: Optional[UsageComponent] = None, + component: Optional[Any] = None, pod: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None, _request_timeout: Union[ None, @@ -14999,7 +14993,7 @@ def get_unified_deployment_usage_deployments_deployment_id_usage_get_without_pre end_time_in_seconds: StrictInt, step: Optional[StrictInt] = None, revision_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - component: Optional[UsageComponent] = None, + component: Optional[Any] = None, pod: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None, _request_timeout: Union[ None, @@ -15435,7 +15429,7 @@ def get_usage_deployments_usage_deployment_id_get( end_time_in_seconds: StrictInt, step: Optional[StrictInt] = None, revision_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - component: Optional[UsageComponent] = None, + component: Optional[Any] = None, pod: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None, _request_timeout: Union[ None, @@ -15530,7 +15524,7 @@ def get_usage_deployments_usage_deployment_id_get_with_http_info( end_time_in_seconds: StrictInt, step: Optional[StrictInt] = None, revision_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - component: Optional[UsageComponent] = None, + component: Optional[Any] = None, pod: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None, _request_timeout: Union[ None, @@ -15625,7 +15619,7 @@ def get_usage_deployments_usage_deployment_id_get_without_preload_content( end_time_in_seconds: StrictInt, step: Optional[StrictInt] = None, revision_number: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, - component: Optional[UsageComponent] = None, + component: Optional[Any] = None, pod: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None, _request_timeout: Union[ None, @@ -17403,10 +17397,10 @@ def _list_cluster_org_gpu_quotas_clusters_cluster_id_gpu_quota_organizations_get def list_insights_insights_get( self, status: Annotated[Optional[List[InsightStatus]], Field(description="Repeat to list several statuses")] = None, - severity: Optional[InsightSeverity] = None, + severity: Optional[Any] = None, cluster_id: Optional[StrictInt] = None, deployment_id: Optional[StrictInt] = None, - resource_type: Optional[InsightResourceType] = None, + resource_type: Optional[Any] = None, observed_after: Optional[datetime] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, before_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, @@ -17498,10 +17492,10 @@ def list_insights_insights_get( def list_insights_insights_get_with_http_info( self, status: Annotated[Optional[List[InsightStatus]], Field(description="Repeat to list several statuses")] = None, - severity: Optional[InsightSeverity] = None, + severity: Optional[Any] = None, cluster_id: Optional[StrictInt] = None, deployment_id: Optional[StrictInt] = None, - resource_type: Optional[InsightResourceType] = None, + resource_type: Optional[Any] = None, observed_after: Optional[datetime] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, before_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, @@ -17593,10 +17587,10 @@ def list_insights_insights_get_with_http_info( def list_insights_insights_get_without_preload_content( self, status: Annotated[Optional[List[InsightStatus]], Field(description="Repeat to list several statuses")] = None, - severity: Optional[InsightSeverity] = None, + severity: Optional[Any] = None, cluster_id: Optional[StrictInt] = None, deployment_id: Optional[StrictInt] = None, - resource_type: Optional[InsightResourceType] = None, + resource_type: Optional[Any] = None, observed_after: Optional[datetime] = None, limit: Optional[Annotated[int, Field(le=100, strict=True, ge=1)]] = None, before_id: Optional[Annotated[int, Field(strict=True, ge=1)]] = None, diff --git a/platform_api_python_client/api_client.py b/platform_api_python_client/api_client.py index 4a3fc36..0c82181 100644 --- a/platform_api_python_client/api_client.py +++ b/platform_api_python_client/api_client.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Platform External API @@ -12,6 +10,7 @@ """ # noqa: E501 + import datetime from dateutil.parser import parse from enum import Enum @@ -21,6 +20,7 @@ import os import re import tempfile +import uuid from urllib.parse import quote from typing import Tuple, Optional, List, Dict, Union @@ -68,6 +68,7 @@ class ApiClient: 'date': datetime.date, 'datetime': datetime.datetime, 'decimal': decimal.Decimal, + 'UUID': uuid.UUID, 'object': object, } _pool = None @@ -90,7 +91,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/4.37.1/python' + self.user_agent = 'OpenAPI-Generator/4.38.0/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -246,7 +247,6 @@ def param_serialize( return method, url, header_params, body, post_params - def call_api( self, method, @@ -301,17 +301,23 @@ def response_deserialize( # if not found, look for '1XX', '2XX', etc. response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + # If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it. + if response_type is None and str(response_data.status) not in response_types_map \ + and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \ + and 'default' in response_types_map: + response_type = response_types_map['default'] + # deserialize response data response_text = None return_data = None try: - if response_type == "bytearray": + if response_type in ("bytearray", "bytes"): return_data = response_data.data elif response_type == "file": return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader('content-type') + content_type = response_data.headers.get('content-type') if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" @@ -328,7 +334,7 @@ def response_deserialize( return ApiResponse( status_code = response_data.status, data = return_data, - headers = response_data.getheaders(), + headers = response_data.headers, raw_data = response_data.data ) @@ -356,6 +362,8 @@ def sanitize_for_serialization(self, obj): return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj + elif isinstance(obj, uuid.UUID): + return str(obj) elif isinstance(obj, list): return [ self.sanitize_for_serialization(sub_obj) for sub_obj in obj @@ -368,24 +376,24 @@ def sanitize_for_serialization(self, obj): return obj.isoformat() elif isinstance(obj, decimal.Decimal): return str(obj) - elif isinstance(obj, dict): - obj_dict = obj + return { + key: self.sanitize_for_serialization(val) + for key, val in obj.items() + } + + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. - if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): - obj_dict = obj.to_dict() - else: - obj_dict = obj.__dict__ + obj_dict = obj.__dict__ + + return self.sanitize_for_serialization(obj_dict) - return { - key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items() - } def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. @@ -404,7 +412,7 @@ def deserialize(self, response_text: str, response_type: str, content_type: Opti data = json.loads(response_text) except ValueError: data = response_text - elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): if response_text == "": data = "" else: @@ -431,6 +439,12 @@ def __deserialize(self, data, klass): return None if isinstance(klass, str): + if klass.startswith('Optional['): + m = re.match(r'Optional\[(.*)]', klass) + assert m is not None, "Malformed Optional type definition" + # data is not None here, so the optionality is already resolved + return self.__deserialize(data, m.group(1)) + if klass.startswith('List['): m = re.match(r'List\[(.*)]', klass) assert m is not None, "Malformed List type definition" @@ -453,14 +467,16 @@ def __deserialize(self, data, klass): if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) - elif klass == object: + elif klass is object: return self.__deserialize_object(data) - elif klass == datetime.date: + elif klass is datetime.date: return self.__deserialize_date(data) - elif klass == datetime.datetime: + elif klass is datetime.datetime: return self.__deserialize_datetime(data) - elif klass == decimal.Decimal: + elif klass is decimal.Decimal: return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: @@ -477,10 +493,15 @@ def parameters_to_tuples(self, params, collection_formats): if collection_formats is None: collection_formats = {} for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, value) for value in v) + new_params.extend( + (k, str(value).lower() if isinstance(value, bool) else value) + for value in v + ) else: if collection_format == 'ssv': delimiter = ' ' @@ -491,11 +512,20 @@ def parameters_to_tuples(self, params, collection_formats): else: # csv is the default delimiter = ',' new_params.append( - (k, delimiter.join(str(value) for value in v))) + (k, delimiter.join( + str(value).lower() if isinstance(value, bool) else str(value) + for value in v))) else: new_params.append((k, v)) return new_params + def explode_query_object(self, name, obj): + """form style, explode: one query parameter per entry, keyed by the property name; a list repeats the name, None is left out""" + obj = self.sanitize_for_serialization(obj) + if not isinstance(obj, dict): + obj = {name: obj} + return [(k, item) for k, v in obj.items() for item in (v if isinstance(v, (list, tuple)) else [v]) if item is not None] + def parameters_to_url_query(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -514,10 +544,14 @@ def parameters_to_url_query(self, params, collection_formats): if isinstance(v, dict): v = json.dumps(v) - if k in collection_formats: + # a collection format applies only to a list; an exploded entry may share a declared array parameter's name + if k in collection_formats and isinstance(v, (list, tuple)): collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, str(value)) for value in v) + new_params.extend( + (quote(str(k)), quote(str(value).lower() if isinstance(value, bool) else str(value))) + for value in v + ) else: if collection_format == 'ssv': delimiter = ' ' @@ -528,10 +562,13 @@ def parameters_to_url_query(self, params, collection_formats): else: # csv is the default delimiter = ',' new_params.append( - (k, delimiter.join(quote(str(value)) for value in v)) + (quote(str(k)), delimiter.join( + quote(str(value).lower() if isinstance(value, bool) else str(value)) + for value in v)) ) else: - new_params.append((k, quote(str(v)))) + # names are quoted too: an exploded object's names are runtime data + new_params.append((quote(str(k)), quote(str(v)))) return "&".join(["=".join(map(str, item)) for item in new_params]) @@ -667,7 +704,13 @@ def _apply_auth_params( :param auth_setting: auth settings for the endpoint """ if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] + if not 'Cookie' in headers: + headers['Cookie'] = "" + else: + headers['Cookie'] += "; " + # Account for cookie value containing spaces and special characters, excluding base64 delimiters + cookie_value = quote(str(auth_setting['value']), safe="!#$%&'()*+-./:<=>?@[]^_`{|}~%+/=") + headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] @@ -694,14 +737,16 @@ def __deserialize_file(self, response): os.close(fd) os.remove(path) - content_disposition = response.getheader("Content-Disposition") + content_disposition = response.headers.get("Content-Disposition") if content_disposition: m = re.search( r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition ) assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: diff --git a/platform_api_python_client/configuration.py b/platform_api_python_client/configuration.py index 6112bbd..f925d2d 100644 --- a/platform_api_python_client/configuration.py +++ b/platform_api_python_client/configuration.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Platform External API @@ -13,14 +11,19 @@ import copy +import http.client as httplib import logging from logging import FileHandler import multiprocessing +import ssl import sys -from typing import Optional +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from urllib.parse import urlparse +from urllib.request import getproxies +from typing_extensions import NotRequired, Self + import urllib3 -import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -28,6 +31,107 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "HTTPBearer": BearerAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + class Configuration: """This class contains various settings of the API client. @@ -55,27 +159,67 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. - :param retries: Number of retries for API requests. + :param retries: int | urllib3.util.retry.Retry - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param no_proxy: Comma-separated hosts that bypass the proxy. + :param proxy_headers: Proxy headers. + :param proxy_ssl_context: SSL context used only for the TLS handshake with the proxy itself, independent of the destination TLS settings. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: """ - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ignore_operation_servers=False, - ssl_ca_cert=None, - retries=None, - *, - debug: Optional[bool] = None - ) -> None: + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, urllib3.util.retry.Retry]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + no_proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + proxy_ssl_context: Optional[ssl.SSLContext]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: """Constructor """ self._base_path = "http://localhost" if host is None else host @@ -142,7 +286,7 @@ def __init__(self, host=None, """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -150,74 +294,96 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = None + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = cert_file """client certificate file """ - self.key_file = None + self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy: Optional[str] = None - """Proxy URL - """ - self.proxy_headers = None + per pool. None in the constructor is coerced to cpu_count * 5. + """ + + # urllib3 does not read proxy environment variables itself: + # https://github.com/urllib3/urllib3/issues/1785 + # A proxy taken from the environment is re-resolved when the host is + # assigned; see the host setter. + self._proxy_from_env = proxy is None + if proxy is None or no_proxy is None: + proxies = getproxies() + if proxy is None: + proxy = self._env_proxy(proxies, self.host) + if no_proxy is None: + no_proxy = proxies.get("no") + self._proxy = proxy + self.no_proxy = no_proxy + """Hosts that bypass the proxy + """ + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.proxy_ssl_context = proxy_ssl_context + """SSL context used only for the TLS handshake with the proxy itself + (e.g. an HTTPS CONNECT tunnel), independent of the destination TLS + settings above. + """ + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ self.retries = retries - """Adding retries to override urllib3 default value 3 + """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ - def __deepcopy__(self, memo): + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result for k, v in self.__dict__.items(): + if k == 'proxy_ssl_context': + # ssl.SSLContext holds unpicklable C state and can't be deepcopied. + setattr(result, k, v) + continue if k not in ('logger', 'logger_file_handler'): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) - # use setters to configure loggers + # use setter to re-create the file handler (excluded from __dict__ copy) result.logger_file = self.logger_file - result.debug = self.debug + return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -228,7 +394,7 @@ def set_default(cls, default): cls._default = default @classmethod - def get_default_copy(cls): + def get_default_copy(cls) -> Self: """Deprecated. Please use `get_default` instead. Deprecated. Please use `get_default` instead. @@ -238,7 +404,7 @@ def get_default_copy(cls): return cls.get_default() @classmethod - def get_default(cls): + def get_default(cls) -> Self: """Return the default configuration. This method returns newly created, based on default constructor, @@ -248,11 +414,11 @@ def get_default(cls): :return: The configuration object. """ if cls._default is None: - cls._default = Configuration() + cls._default = cls() return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -264,7 +430,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -283,7 +449,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -292,7 +458,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -314,7 +480,7 @@ def debug(self, value): httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -325,7 +491,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -336,7 +502,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -347,13 +513,16 @@ def get_api_key_with_prefix(self, identifier, alias=None): self.refresh_api_key_hook(self) key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) if key: - prefix = self.api_key_prefix.get(identifier) + prefix = self.api_key_prefix.get( + identifier, self.api_key_prefix.get(alias) if alias is not None else None) if prefix: return "%s %s" % (prefix, key) else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -364,16 +533,17 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password + return urllib3.util.make_headers( basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if self.access_token is not None: auth['HTTPBearer'] = { 'type': 'bearer', @@ -383,7 +553,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -392,10 +562,10 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.1.0\n"\ - "SDK Package Version: 4.37.1".\ + "SDK Package Version: 4.38.0".\ format(env=sys.platform, pyversion=sys.version) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -407,7 +577,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -435,6 +610,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): variable_name, variable['default_value']) if 'enum_values' in variable \ + and variable['enum_values'] \ and used_value not in variable['enum_values']: raise ValueError( "The variable `{0}` in the host URL has invalid value " @@ -447,12 +623,32 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None + if self._proxy_from_env: + # the scheme-specific proxy depends on the host, which is + # commonly assigned after construction + self._proxy = self._env_proxy(getproxies(), value) + + @staticmethod + def _env_proxy(proxies: Dict[str, str], host: str) -> Optional[str]: + """Pick the environment proxy that applies to `host`.""" + return proxies.get(urlparse(host).scheme) or proxies.get("all") + + @property + def proxy(self) -> Optional[str]: + """Proxy URL + """ + return self._proxy + + @proxy.setter + def proxy(self, value: Optional[str]) -> None: + self._proxy = value + self._proxy_from_env = False diff --git a/platform_api_python_client/exceptions.py b/platform_api_python_client/exceptions.py index f84f87e..7ee907c 100644 --- a/platform_api_python_client/exceptions.py +++ b/platform_api_python_client/exceptions.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Platform External API @@ -11,6 +9,7 @@ Do not edit the class manually. """ # noqa: E501 + from typing import Any, Optional from typing_extensions import Self @@ -128,7 +127,7 @@ def __init__( self.body = http_resp.data.decode('utf-8') except Exception: pass - self.headers = http_resp.getheaders() + self.headers = http_resp.headers @classmethod def from_response( @@ -150,6 +149,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -162,8 +168,11 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) return error_message @@ -188,6 +197,16 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/platform_api_python_client/models/__init__.py b/platform_api_python_client/models/__init__.py index 5273003..2d0aea1 100644 --- a/platform_api_python_client/models/__init__.py +++ b/platform_api_python_client/models/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ # noqa: E501 - # import models into model package from platform_api_python_client.models.argo_rollouts import ArgoRollouts from platform_api_python_client.models.backend_protocol import BackendProtocol @@ -57,7 +56,7 @@ from platform_api_python_client.models.deployment_usage import DeploymentUsage from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput -from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput +from platform_api_python_client.models.dynamo_frontend_config import DynamoFrontendConfig from platform_api_python_client.models.dynamo_image import DynamoImage from platform_api_python_client.models.dynamo_kv_transfer_configuration import DynamoKvTransferConfiguration from platform_api_python_client.models.dynamo_kv_transfer_policy import DynamoKvTransferPolicy @@ -122,6 +121,7 @@ from platform_api_python_client.models.list_service_accounts_response import ListServiceAccountsResponse from platform_api_python_client.models.list_user_vault_items_response import ListUserVaultItemsResponse from platform_api_python_client.models.list_volumes_response import ListVolumesResponse +from platform_api_python_client.models.location_inner import LocationInner from platform_api_python_client.models.longhorn import Longhorn from platform_api_python_client.models.metric import Metric from platform_api_python_client.models.metrics_config import MetricsConfig @@ -173,10 +173,10 @@ from platform_api_python_client.models.user_vault_item import UserVaultItem from platform_api_python_client.models.user_vault_type import UserVaultType from platform_api_python_client.models.validation_error import ValidationError -from platform_api_python_client.models.validation_error_loc_inner import ValidationErrorLocInner from platform_api_python_client.models.vault_scope import VaultScope from platform_api_python_client.models.volume_access_mode import VolumeAccessMode from platform_api_python_client.models.volume_backend import VolumeBackend from platform_api_python_client.models.volume_mount import VolumeMount from platform_api_python_client.models.volume_status import VolumeStatus from platform_api_python_client.models.volume_status_response import VolumeStatusResponse + diff --git a/platform_api_python_client/models/argo_rollouts.py b/platform_api_python_client/models/argo_rollouts.py index 560cdce..38e9796 100644 --- a/platform_api_python_client/models/argo_rollouts.py +++ b/platform_api_python_client/models/argo_rollouts.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ArgoRollouts(BaseModel): """ @@ -31,7 +32,8 @@ class ArgoRollouts(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/ccl_dynamo_pools.py b/platform_api_python_client/models/ccl_dynamo_pools.py index 0049708..c418042 100644 --- a/platform_api_python_client/models/ccl_dynamo_pools.py +++ b/platform_api_python_client/models/ccl_dynamo_pools.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.pool import Pool from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CclDynamoPools(BaseModel): """ @@ -33,7 +34,8 @@ class CclDynamoPools(BaseModel): __properties: ClassVar[List[str]] = ["worker", "prefill", "decode"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/ccl_main_pools.py b/platform_api_python_client/models/ccl_main_pools.py index 0bf6a2e..3fb5ad7 100644 --- a/platform_api_python_client/models/ccl_main_pools.py +++ b/platform_api_python_client/models/ccl_main_pools.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.pool import Pool from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CclMainPools(BaseModel): """ @@ -31,7 +32,8 @@ class CclMainPools(BaseModel): __properties: ClassVar[List[str]] = ["main"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/cert_manager.py b/platform_api_python_client/models/cert_manager.py index 84200b5..1ebb525 100644 --- a/platform_api_python_client/models/cert_manager.py +++ b/platform_api_python_client/models/cert_manager.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CertManager(BaseModel): """ @@ -31,7 +32,8 @@ class CertManager(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/cluster_capacity_response.py b/platform_api_python_client/models/cluster_capacity_response.py index d394826..f4f10ce 100644 --- a/platform_api_python_client/models/cluster_capacity_response.py +++ b/platform_api_python_client/models/cluster_capacity_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.gpu_type_capacity import GpuTypeCapacity from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClusterCapacityResponse(BaseModel): """ @@ -33,7 +34,8 @@ class ClusterCapacityResponse(BaseModel): __properties: ClassVar[List[str]] = ["cluster_id", "cluster_name", "gpu_types"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -75,8 +76,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.gpu_types: for _item_gpu_types in self.gpu_types: - if _item_gpu_types: - _items.append(_item_gpu_types.to_dict()) + _items.append(_item_gpu_types.to_dict() if _item_gpu_types is not None else None) _dict['gpu_types'] = _items return _dict diff --git a/platform_api_python_client/models/cluster_components.py b/platform_api_python_client/models/cluster_components.py index 9915b26..3ce7d4a 100644 --- a/platform_api_python_client/models/cluster_components.py +++ b/platform_api_python_client/models/cluster_components.py @@ -39,6 +39,7 @@ from platform_api_python_client.models.teleport_kube_agent import TeleportKubeAgent from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClusterComponents(BaseModel): """ @@ -65,7 +66,8 @@ class ClusterComponents(BaseModel): __properties: ClassVar[List[str]] = ["kube_prometheus_stack", "istio", "cert_manager", "ingress_nginx", "spire_crds", "spire", "external_dns", "prometheus_adapter", "keda", "fluent_bit", "argo_rollouts", "network_operator", "opentelemetry_collector", "gpu_operator", "longhorn", "metrics_server", "teleport_kube_agent", "final_stack"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -77,8 +79,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/cluster_config.py b/platform_api_python_client/models/cluster_config.py index 1c0ed0a..b4eb8b9 100644 --- a/platform_api_python_client/models/cluster_config.py +++ b/platform_api_python_client/models/cluster_config.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.cluster_components import ClusterComponents from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClusterConfig(BaseModel): """ @@ -31,7 +32,8 @@ class ClusterConfig(BaseModel): __properties: ClassVar[List[str]] = ["components"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/cluster_credential.py b/platform_api_python_client/models/cluster_credential.py index 79d2e14..82152bf 100644 --- a/platform_api_python_client/models/cluster_credential.py +++ b/platform_api_python_client/models/cluster_credential.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClusterCredential(BaseModel): """ @@ -32,7 +33,8 @@ class ClusterCredential(BaseModel): __properties: ClassVar[List[str]] = ["server", "bearer_token", "ca_cert"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/cluster_registration_request.py b/platform_api_python_client/models/cluster_registration_request.py index d2d0830..3b5f6b8 100644 --- a/platform_api_python_client/models/cluster_registration_request.py +++ b/platform_api_python_client/models/cluster_registration_request.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.cluster_credential import ClusterCredential from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClusterRegistrationRequest(BaseModel): """ @@ -36,7 +37,8 @@ class ClusterRegistrationRequest(BaseModel): __properties: ClassVar[List[str]] = ["display_name", "storage_class", "region", "cloud_provider", "credential"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -48,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/cluster_registration_response.py b/platform_api_python_client/models/cluster_registration_response.py index f96d0fd..7389d01 100644 --- a/platform_api_python_client/models/cluster_registration_response.py +++ b/platform_api_python_client/models/cluster_registration_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClusterRegistrationResponse(BaseModel): """ @@ -30,7 +31,8 @@ class ClusterRegistrationResponse(BaseModel): __properties: ClassVar[List[str]] = ["id"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/config_file_mount.py b/platform_api_python_client/models/config_file_mount.py index 90b8c03..aca0948 100644 --- a/platform_api_python_client/models/config_file_mount.py +++ b/platform_api_python_client/models/config_file_mount.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ConfigFileMount(BaseModel): """ @@ -32,15 +33,16 @@ class ConfigFileMount(BaseModel): content: Annotated[str, Field(min_length=1, strict=True)] __properties: ClassVar[List[str]] = ["filename", "mount_path", "content"] - @field_validator('filename') + @field_validator('filename', mode="before") def filename_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-zA-Z0-9._-]+$", value): + if isinstance(value, str) and not re.match(r"^[a-zA-Z0-9._-]+$", value): raise ValueError(r"must validate the regular expression /^[a-zA-Z0-9._-]+$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -52,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_compute_deployment_request.py b/platform_api_python_client/models/create_compute_deployment_request.py index 91cc9e2..31b95d3 100644 --- a/platform_api_python_client/models/create_compute_deployment_request.py +++ b/platform_api_python_client/models/create_compute_deployment_request.py @@ -24,6 +24,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateComputeDeploymentRequest(BaseModel): """ @@ -35,7 +36,7 @@ class CreateComputeDeploymentRequest(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") image_url: StrictStr image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None @@ -45,25 +46,26 @@ class CreateComputeDeploymentRequest(BaseModel): enable_logging: Optional[StrictBool] = False __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_refs", "ssh_public_key", "enable_logging"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value - @field_validator('image_pull_secret_name') + @field_validator('image_pull_secret_name', mode="before") def image_pull_secret_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -75,8 +77,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -105,8 +106,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: diff --git a/platform_api_python_client/models/create_compute_deployment_response.py b/platform_api_python_client/models/create_compute_deployment_response.py index 2174943..3baf2b8 100644 --- a/platform_api_python_client/models/create_compute_deployment_response.py +++ b/platform_api_python_client/models/create_compute_deployment_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateComputeDeploymentResponse(BaseModel): """ @@ -34,7 +35,8 @@ class CreateComputeDeploymentResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url", "port"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -46,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_dynamo_deployment_request.py b/platform_api_python_client/models/create_dynamo_deployment_request.py index 7ca52d1..a221c76 100644 --- a/platform_api_python_client/models/create_dynamo_deployment_request.py +++ b/platform_api_python_client/models/create_dynamo_deployment_request.py @@ -22,12 +22,14 @@ from typing_extensions import Annotated from platform_api_python_client.models.backend_protocol import BackendProtocol from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput +from platform_api_python_client.models.dynamo_frontend_config import DynamoFrontendConfig from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode from platform_api_python_client.models.dynamo_weight_transfer_configuration import DynamoWeightTransferConfiguration from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateDynamoDeploymentRequest(BaseModel): """ @@ -37,26 +39,26 @@ class CreateDynamoDeploymentRequest(BaseModel): max_unavailable: Optional[StrictInt] = None name: Annotated[str, Field(min_length=1, strict=True, max_length=20)] cluster_id: StrictInt - hardware_instance_id: Optional[StrictInt] = None + hardware_instance_id: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") serving_mode: Optional[DynamoServingMode] = None - worker_pools: Optional[DynamoWorkerPools] = None - communications: Optional[DynamoCommunicationsInput] = None - weight_transfer: Optional[DynamoWeightTransferConfiguration] = None + worker_pools: Optional[DynamoWorkerPools] = Field(default=None, description="Hardware and scaling per worker role. Aggregated mode uses exactly `worker`; disaggregated mode uses exactly `prefill` and `decode`. Unused roles are null.") + communications: Optional[DynamoCommunicationsInput] = Field(default=None, description="Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration.") + weight_transfer: Optional[DynamoWeightTransferConfiguration] = Field(default=None, description="Platform-managed weight loading between the workers of a pool (ModelExpress peer transfer), in either serving mode. An empty object opts in and pins model_revision to a commit; omit or set null to keep the native loader.") model: StrictStr - model_revision: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + model_revision: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="Hugging Face branch, tag or commit of `model`. The API resolves it to a commit SHA and stores that SHA, so resume and rollback load the same weights. An update keeps the stored commit when it omits this field or sends that commit, as long as `model` is unchanged and extra_args does not set --revision; send a branch or tag to move to its newest commit. With no stored commit, weight_transfer pins the default branch's current commit, and otherwise each worker loads the default branch when it starts.") served_model_name: Optional[StrictStr] = None runtime_version: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Dynamo runtime image tag (for example 1.4.0). Defaults to the platform's current release; GET /prebuilt-images?type=dynamo lists the versions the platform has validated, but any tag may be requested. require_gpu_direct_rdma needs an EFA-capable image. Changing it restarts every component of a running deployment.") - min_replicas: Optional[StrictInt] = None - max_replicas: Optional[StrictInt] = None - concurrency: Optional[StrictInt] = None - cooldown_period: Optional[StrictInt] = None - extra_args: Optional[StrictStr] = None + min_replicas: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") + max_replicas: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") + concurrency: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") + cooldown_period: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") + extra_args: Optional[StrictStr] = Field(default=None, description="Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected.") hf_token: Optional[StrictStr] = None - hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None + 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.") env_vars: Optional[Dict[str, StrictStr]] = None env_vars_refs: Optional[Dict[str, Any]] = None endpoint_bearer_token: Optional[StrictStr] = None @@ -66,27 +68,29 @@ class CreateDynamoDeploymentRequest(BaseModel): enable_logging: Optional[StrictBool] = True enable_node_model_cache: Optional[StrictBool] = False backend_protocol: Optional[BackendProtocol] = None - __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "serving_mode", "worker_pools", "communications", "weight_transfer", "model", "model_revision", "served_model_name", "runtime_version", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "hf_token", "hf_token_ref", "env_vars", "env_vars_refs", "endpoint_bearer_token", "bearer_token_ref", "endpoint_certificate_authority", "image_pull_ref", "enable_logging", "enable_node_model_cache", "backend_protocol"] + frontend: Optional[DynamoFrontendConfig] = Field(default=None, description="Replica bounds for the Frontend (HTTP server and router) pods serving the endpoint, which are placed on separate nodes where possible. Two keep the endpoint serving through a node loss. min_replicas and max_replicas must be equal until Frontend autoscaling is supported. Changing them restarts every component of a running deployment.") + __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable", "name", "cluster_id", "hardware_instance_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "serving_mode", "worker_pools", "communications", "weight_transfer", "model", "model_revision", "served_model_name", "runtime_version", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "hf_token", "hf_token_ref", "env_vars", "env_vars_refs", "endpoint_bearer_token", "bearer_token_ref", "endpoint_certificate_authority", "image_pull_ref", "enable_logging", "enable_node_model_cache", "backend_protocol", "frontend"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value - @field_validator('runtime_version') + @field_validator('runtime_version', mode="before") def runtime_version_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -98,8 +102,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -128,8 +131,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of worker_pools if self.worker_pools: @@ -140,6 +142,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of weight_transfer if self.weight_transfer: _dict['weight_transfer'] = self.weight_transfer.to_dict() + # override the default output from pydantic by calling `to_dict()` of frontend + if self.frontend: + _dict['frontend'] = self.frontend.to_dict() # set to None if max_surge (nullable) is None # and model_fields_set contains the field if self.max_surge is None and "max_surge" in self.model_fields_set: @@ -289,7 +294,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "image_pull_ref": obj.get("image_pull_ref"), "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True, "enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False, - "backend_protocol": obj.get("backend_protocol") + "backend_protocol": obj.get("backend_protocol"), + "frontend": DynamoFrontendConfig.from_dict(obj["frontend"]) if obj.get("frontend") is not None else None }) return _obj diff --git a/platform_api_python_client/models/create_dynamo_deployment_response.py b/platform_api_python_client/models/create_dynamo_deployment_response.py index 823019b..f6526e6 100644 --- a/platform_api_python_client/models/create_dynamo_deployment_response.py +++ b/platform_api_python_client/models/create_dynamo_deployment_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateDynamoDeploymentResponse(BaseModel): """ @@ -33,7 +34,8 @@ class CreateDynamoDeploymentResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_filesystem_volume_request.py b/platform_api_python_client/models/create_filesystem_volume_request.py index 6bae519..4330f99 100644 --- a/platform_api_python_client/models/create_filesystem_volume_request.py +++ b/platform_api_python_client/models/create_filesystem_volume_request.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateFilesystemVolumeRequest(BaseModel): """ @@ -34,10 +35,10 @@ class CreateFilesystemVolumeRequest(BaseModel): storage_class: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=253)]] = None __properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "size_gb", "storage_class"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value @@ -48,18 +49,19 @@ def backend_validate_enum(cls, value): raise ValueError("must be one of enum values ('filesystem')") return value - @field_validator('storage_class') + @field_validator('storage_class', mode="before") def storage_class_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -71,8 +73,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_hardware_instance_request.py b/platform_api_python_client/models/create_hardware_instance_request.py index d7b780a..b7af144 100644 --- a/platform_api_python_client/models/create_hardware_instance_request.py +++ b/platform_api_python_client/models/create_hardware_instance_request.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateHardwareInstanceRequest(BaseModel): """ @@ -38,7 +39,8 @@ class CreateHardwareInstanceRequest(BaseModel): __properties: ClassVar[List[str]] = ["cluster_id", "name", "gpu_type", "num_gpu", "cpu", "memory", "accelerator_resource_key", "node_affinity_labels", "accelerator_memory"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -50,8 +52,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_inference_deployment_response.py b/platform_api_python_client/models/create_inference_deployment_response.py index 705965f..17f201c 100644 --- a/platform_api_python_client/models/create_inference_deployment_response.py +++ b/platform_api_python_client/models/create_inference_deployment_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateInferenceDeploymentResponse(BaseModel): """ @@ -33,7 +34,8 @@ class CreateInferenceDeploymentResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_inference_v3_deployment_request.py b/platform_api_python_client/models/create_inference_v3_deployment_request.py index b8b08a5..3ab3dd0 100644 --- a/platform_api_python_client/models/create_inference_v3_deployment_request.py +++ b/platform_api_python_client/models/create_inference_v3_deployment_request.py @@ -27,6 +27,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateInferenceV3DeploymentRequest(BaseModel): """ @@ -40,8 +41,8 @@ class CreateInferenceV3DeploymentRequest(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None - hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None + 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.") + 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.") image_url: StrictStr image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None @@ -67,25 +68,26 @@ class CreateInferenceV3DeploymentRequest(BaseModel): metrics: Optional[MetricsConfig] = None __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"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value - @field_validator('image_pull_secret_name') + @field_validator('image_pull_secret_name', mode="before") def image_pull_secret_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -97,8 +99,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -127,8 +128,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: diff --git a/platform_api_python_client/models/create_job_deployment_request.py b/platform_api_python_client/models/create_job_deployment_request.py index 8d16f50..bcd9db1 100644 --- a/platform_api_python_client/models/create_job_deployment_request.py +++ b/platform_api_python_client/models/create_job_deployment_request.py @@ -25,6 +25,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateJobDeploymentRequest(BaseModel): """ @@ -36,7 +37,7 @@ class CreateJobDeploymentRequest(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") image_url: StrictStr image_pull_secret_credentials: Optional[ImagePullSecretCredentials] = None image_pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None @@ -52,25 +53,26 @@ class CreateJobDeploymentRequest(BaseModel): config_file: Optional[ConfigFileMount] = None __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"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value - @field_validator('image_pull_secret_name') + @field_validator('image_pull_secret_name', mode="before") def image_pull_secret_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -82,8 +84,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -112,8 +113,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: diff --git a/platform_api_python_client/models/create_job_deployment_response.py b/platform_api_python_client/models/create_job_deployment_response.py index 6fbaa52..33a30d9 100644 --- a/platform_api_python_client/models/create_job_deployment_response.py +++ b/platform_api_python_client/models/create_job_deployment_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateJobDeploymentResponse(BaseModel): """ @@ -33,7 +34,8 @@ class CreateJobDeploymentResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "created_at", "endpoint_url"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_object_volume_request.py b/platform_api_python_client/models/create_object_volume_request.py index ce9108e..571b422 100644 --- a/platform_api_python_client/models/create_object_volume_request.py +++ b/platform_api_python_client/models/create_object_volume_request.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.object_storage_provider import ObjectStorageProvider from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateObjectVolumeRequest(BaseModel): """ @@ -38,10 +39,10 @@ class CreateObjectVolumeRequest(BaseModel): read_only: Optional[StrictBool] = False __properties: ClassVar[List[str]] = ["name", "cluster_id", "backend", "provider", "bucket", "region", "prefix", "read_only"] - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value @@ -52,22 +53,23 @@ def backend_validate_enum(cls, value): raise ValueError("must be one of enum values ('object')") return value - @field_validator('bucket') + @field_validator('bucket', mode="before") def bucket_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^(?:[0-9A-Za-z._-]+|arn:[a-z0-9-]+:s3(?:-outposts|-object-lambda)?:[0-9A-Za-z._:\/+=,@-]+)$", value): + 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): raise ValueError(r"must validate the regular expression /^(?:[0-9A-Za-z._-]+|arn:[a-z0-9-]+:s3(?:-outposts|-object-lambda)?:[0-9A-Za-z._:\/+=,@-]+)$/") return value - @field_validator('region') + @field_validator('region', mode="before") def region_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$", value): + if isinstance(value, str) and not re.match(r"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$", value): raise ValueError(r"must validate the regular expression /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -79,8 +81,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_organization_request.py b/platform_api_python_client/models/create_organization_request.py index ebc3c34..01fc90c 100644 --- a/platform_api_python_client/models/create_organization_request.py +++ b/platform_api_python_client/models/create_organization_request.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateOrganizationRequest(BaseModel): """ @@ -30,7 +31,8 @@ class CreateOrganizationRequest(BaseModel): __properties: ClassVar[List[str]] = ["name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_organization_response.py b/platform_api_python_client/models/create_organization_response.py index 7d48c88..8ff5dce 100644 --- a/platform_api_python_client/models/create_organization_response.py +++ b/platform_api_python_client/models/create_organization_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateOrganizationResponse(BaseModel): """ @@ -31,7 +32,8 @@ class CreateOrganizationResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_service_account_request.py b/platform_api_python_client/models/create_service_account_request.py index 2ad1259..9b67ded 100644 --- a/platform_api_python_client/models/create_service_account_request.py +++ b/platform_api_python_client/models/create_service_account_request.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateServiceAccountRequest(BaseModel): """ @@ -33,7 +34,8 @@ class CreateServiceAccountRequest(BaseModel): __properties: ClassVar[List[str]] = ["name", "description", "scopes"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/create_service_account_response.py b/platform_api_python_client/models/create_service_account_response.py index 5df1c40..9e65f6d 100644 --- a/platform_api_python_client/models/create_service_account_response.py +++ b/platform_api_python_client/models/create_service_account_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreateServiceAccountResponse(BaseModel): """ @@ -37,7 +38,8 @@ class CreateServiceAccountResponse(BaseModel): __properties: ClassVar[List[str]] = ["workos_id", "name", "description", "scopes", "created_at", "updated_at", "client_secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -49,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/credits_response.py b/platform_api_python_client/models/credits_response.py index 39456fa..87f9c03 100644 --- a/platform_api_python_client/models/credits_response.py +++ b/platform_api_python_client/models/credits_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CreditsResponse(BaseModel): """ @@ -30,7 +31,8 @@ class CreditsResponse(BaseModel): __properties: ClassVar[List[str]] = ["credits"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/daily_bill_response.py b/platform_api_python_client/models/daily_bill_response.py index c3664e4..31e48a7 100644 --- a/platform_api_python_client/models/daily_bill_response.py +++ b/platform_api_python_client/models/daily_bill_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DailyBillResponse(BaseModel): """ @@ -32,7 +33,8 @@ class DailyBillResponse(BaseModel): __properties: ClassVar[List[str]] = ["date", "credits"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/delete_user_vault_item_request.py b/platform_api_python_client/models/delete_user_vault_item_request.py index 38316d2..d49f5fb 100644 --- a/platform_api_python_client/models/delete_user_vault_item_request.py +++ b/platform_api_python_client/models/delete_user_vault_item_request.py @@ -24,6 +24,7 @@ from platform_api_python_client.models.vault_scope import VaultScope from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DeleteUserVaultItemRequest(BaseModel): """ @@ -37,7 +38,8 @@ class DeleteUserVaultItemRequest(BaseModel): __properties: ClassVar[List[str]] = ["id", "type", "key", "value", "visibility"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -49,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/deployment_log_event_v4.py b/platform_api_python_client/models/deployment_log_event_v4.py index 913dd20..4f7bf50 100644 --- a/platform_api_python_client/models/deployment_log_event_v4.py +++ b/platform_api_python_client/models/deployment_log_event_v4.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DeploymentLogEventV4(BaseModel): """ @@ -32,7 +33,8 @@ class DeploymentLogEventV4(BaseModel): __properties: ClassVar[List[str]] = ["id", "timestamp", "message"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/deployment_status_request.py b/platform_api_python_client/models/deployment_status_request.py index c93eeb2..c00071f 100644 --- a/platform_api_python_client/models/deployment_status_request.py +++ b/platform_api_python_client/models/deployment_status_request.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.deployment_status import DeploymentStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DeploymentStatusRequest(BaseModel): """ @@ -31,7 +32,8 @@ class DeploymentStatusRequest(BaseModel): __properties: ClassVar[List[str]] = ["status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/deployment_status_response.py b/platform_api_python_client/models/deployment_status_response.py index 7651bd7..9601624 100644 --- a/platform_api_python_client/models/deployment_status_response.py +++ b/platform_api_python_client/models/deployment_status_response.py @@ -25,6 +25,7 @@ from platform_api_python_client.models.service_status import ServiceStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DeploymentStatusResponse(BaseModel): """ @@ -40,7 +41,8 @@ class DeploymentStatusResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "type", "status", "service_status", "error_message", "endpoint_url", "pod_status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -52,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/deployment_status_v3_response.py b/platform_api_python_client/models/deployment_status_v3_response.py index df2847e..45cf06e 100644 --- a/platform_api_python_client/models/deployment_status_v3_response.py +++ b/platform_api_python_client/models/deployment_status_v3_response.py @@ -25,6 +25,7 @@ from platform_api_python_client.models.rollout_status import RolloutStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DeploymentStatusV3Response(BaseModel): """ @@ -39,7 +40,8 @@ class DeploymentStatusV3Response(BaseModel): __properties: ClassVar[List[str]] = ["id", "type", "status", "rollout_status", "endpoint_url", "revision_pod_details_list"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -51,8 +53,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -81,8 +82,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.revision_pod_details_list: for _item_revision_pod_details_list in self.revision_pod_details_list: - if _item_revision_pod_details_list: - _items.append(_item_revision_pod_details_list.to_dict()) + _items.append(_item_revision_pod_details_list.to_dict() if _item_revision_pod_details_list is not None else None) _dict['revision_pod_details_list'] = _items # set to None if rollout_status (nullable) is None # and model_fields_set contains the field diff --git a/platform_api_python_client/models/deployment_usage.py b/platform_api_python_client/models/deployment_usage.py index fe0eb37..ab0bd86 100644 --- a/platform_api_python_client/models/deployment_usage.py +++ b/platform_api_python_client/models/deployment_usage.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.deployment_usage_value import DeploymentUsageValue from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DeploymentUsage(BaseModel): """ @@ -32,7 +33,8 @@ class DeploymentUsage(BaseModel): __properties: ClassVar[List[str]] = ["metric", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -74,8 +75,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.values: for _item_values in self.values: - if _item_values: - _items.append(_item_values.to_dict()) + _items.append(_item_values.to_dict() if _item_values is not None else None) _dict['values'] = _items return _dict diff --git a/platform_api_python_client/models/deployment_usage_value.py b/platform_api_python_client/models/deployment_usage_value.py index b8ddd2a..65d6111 100644 --- a/platform_api_python_client/models/deployment_usage_value.py +++ b/platform_api_python_client/models/deployment_usage_value.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DeploymentUsageValue(BaseModel): """ @@ -31,7 +32,8 @@ class DeploymentUsageValue(BaseModel): __properties: ClassVar[List[str]] = ["timestamp", "value"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/dynamo_communications_input.py b/platform_api_python_client/models/dynamo_communications_input.py index a2873a1..8cc693d 100644 --- a/platform_api_python_client/models/dynamo_communications_input.py +++ b/platform_api_python_client/models/dynamo_communications_input.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.dynamo_kv_transfer_configuration import DynamoKvTransferConfiguration from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DynamoCommunicationsInput(BaseModel): """ @@ -31,7 +32,8 @@ class DynamoCommunicationsInput(BaseModel): __properties: ClassVar[List[str]] = ["kv_transfer"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/dynamo_communications_output.py b/platform_api_python_client/models/dynamo_frontend_config.py similarity index 62% rename from platform_api_python_client/models/dynamo_communications_output.py rename to platform_api_python_client/models/dynamo_frontend_config.py index 563d83b..40589ec 100644 --- a/platform_api_python_client/models/dynamo_communications_output.py +++ b/platform_api_python_client/models/dynamo_frontend_config.py @@ -17,21 +17,24 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict -from typing import Any, ClassVar, Dict, List -from platform_api_python_client.models.dynamo_kv_transfer_configuration import DynamoKvTransferConfiguration +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python -class DynamoCommunicationsOutput(BaseModel): +class DynamoFrontendConfig(BaseModel): """ - DynamoCommunicationsOutput + Replica bounds for the Dynamo Frontend, shaped like a worker pool's so that Frontend autoscaling can arrive without an API change. Until it does, the Frontend runs a fixed count: ``min_replicas`` must equal ``max_replicas``. """ # noqa: E501 - kv_transfer: DynamoKvTransferConfiguration - __properties: ClassVar[List[str]] = ["kv_transfer"] + min_replicas: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = 3 + max_replicas: Optional[Annotated[int, Field(le=10, strict=True, ge=1)]] = 3 + __properties: ClassVar[List[str]] = ["min_replicas", "max_replicas"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,12 +46,11 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of DynamoCommunicationsOutput from a JSON string""" + """Create an instance of DynamoFrontendConfig from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -69,14 +71,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of kv_transfer - if self.kv_transfer: - _dict['kv_transfer'] = self.kv_transfer.to_dict() return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of DynamoCommunicationsOutput from a dict""" + """Create an instance of DynamoFrontendConfig from a dict""" if obj is None: return None @@ -84,7 +83,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "kv_transfer": DynamoKvTransferConfiguration.from_dict(obj["kv_transfer"]) if obj.get("kv_transfer") is not None else None + "min_replicas": obj.get("min_replicas") if obj.get("min_replicas") is not None else 3, + "max_replicas": obj.get("max_replicas") if obj.get("max_replicas") is not None else 3 }) return _obj diff --git a/platform_api_python_client/models/dynamo_image.py b/platform_api_python_client/models/dynamo_image.py index 6bc86f0..28fb111 100644 --- a/platform_api_python_client/models/dynamo_image.py +++ b/platform_api_python_client/models/dynamo_image.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DynamoImage(BaseModel): """ @@ -31,18 +32,19 @@ class DynamoImage(BaseModel): pull_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None __properties: ClassVar[List[str]] = ["runtime_version", "pull_ref"] - @field_validator('runtime_version') + @field_validator('runtime_version', mode="before") def runtime_version_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value): + if isinstance(value, str) and not re.match(r"^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$", value): raise ValueError(r"must validate the regular expression /^[A-Za-z0-9_][A-Za-z0-9._-]{0,127}$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -54,8 +56,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/dynamo_kv_transfer_configuration.py b/platform_api_python_client/models/dynamo_kv_transfer_configuration.py index 93f514a..cc4e9b3 100644 --- a/platform_api_python_client/models/dynamo_kv_transfer_configuration.py +++ b/platform_api_python_client/models/dynamo_kv_transfer_configuration.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.dynamo_kv_transfer_policy import DynamoKvTransferPolicy from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DynamoKvTransferConfiguration(BaseModel): """ @@ -31,7 +32,8 @@ class DynamoKvTransferConfiguration(BaseModel): __properties: ClassVar[List[str]] = ["policy"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/dynamo_weight_transfer_configuration.py b/platform_api_python_client/models/dynamo_weight_transfer_configuration.py index 8d41f2c..4f0304e 100644 --- a/platform_api_python_client/models/dynamo_weight_transfer_configuration.py +++ b/platform_api_python_client/models/dynamo_weight_transfer_configuration.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.dynamo_weight_transfer_policy import DynamoWeightTransferPolicy from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DynamoWeightTransferConfiguration(BaseModel): """ @@ -31,7 +32,8 @@ class DynamoWeightTransferConfiguration(BaseModel): __properties: ClassVar[List[str]] = ["policy"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/dynamo_worker_pool_config.py b/platform_api_python_client/models/dynamo_worker_pool_config.py index e177efc..13cdc03 100644 --- a/platform_api_python_client/models/dynamo_worker_pool_config.py +++ b/platform_api_python_client/models/dynamo_worker_pool_config.py @@ -22,13 +22,14 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DynamoWorkerPoolConfig(BaseModel): """ Hardware and scaling for one Dynamo worker role. ``min_replicas``/``max_replicas`` are the canonical size. ``replicas`` is the deprecated fixed-size alias (``min == max``) still accepted on disaggregated pools. ``parse_dynamo_topology`` owns the cross-field rules (bounds ordering, autoscaling target, which roles may autoscale). """ # noqa: E501 hardware_instance_id: StrictInt - replicas: Optional[Annotated[int, Field(strict=True, ge=1)]] = None + replicas: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Deprecated fixed pool size, equivalent to min_replicas == max_replicas.") min_replicas: Optional[Annotated[int, Field(strict=True, ge=0)]] = None max_replicas: Optional[Annotated[int, Field(strict=True, ge=1)]] = None concurrency: Optional[Annotated[int, Field(strict=True, ge=1)]] = None @@ -36,7 +37,8 @@ class DynamoWorkerPoolConfig(BaseModel): __properties: ClassVar[List[str]] = ["hardware_instance_id", "replicas", "min_replicas", "max_replicas", "concurrency", "cooldown_period"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -48,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/dynamo_worker_pools.py b/platform_api_python_client/models/dynamo_worker_pools.py index 5678089..8d89a28 100644 --- a/platform_api_python_client/models/dynamo_worker_pools.py +++ b/platform_api_python_client/models/dynamo_worker_pools.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.dynamo_worker_pool_config import DynamoWorkerPoolConfig from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class DynamoWorkerPools(BaseModel): """ @@ -33,7 +34,8 @@ class DynamoWorkerPools(BaseModel): __properties: ClassVar[List[str]] = ["worker", "prefill", "decode"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/env.py b/platform_api_python_client/models/env.py index 05c1b0c..c7a6a45 100644 --- a/platform_api_python_client/models/env.py +++ b/platform_api_python_client/models/env.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Env(BaseModel): """ @@ -31,7 +32,8 @@ class Env(BaseModel): __properties: ClassVar[List[str]] = ["vars", "refs"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/external_dns.py b/platform_api_python_client/models/external_dns.py index f3ab5cb..a56123d 100644 --- a/platform_api_python_client/models/external_dns.py +++ b/platform_api_python_client/models/external_dns.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ExternalDns(BaseModel): """ @@ -31,7 +32,8 @@ class ExternalDns(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/final_stack.py b/platform_api_python_client/models/final_stack.py index 09e4b87..b0a6a2d 100644 --- a/platform_api_python_client/models/final_stack.py +++ b/platform_api_python_client/models/final_stack.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class FinalStack(BaseModel): """ @@ -31,7 +32,8 @@ class FinalStack(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/fluent_bit.py b/platform_api_python_client/models/fluent_bit.py index 6c6d219..5addeff 100644 --- a/platform_api_python_client/models/fluent_bit.py +++ b/platform_api_python_client/models/fluent_bit.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class FluentBit(BaseModel): """ @@ -31,7 +32,8 @@ class FluentBit(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/generate_service_account_secret_response.py b/platform_api_python_client/models/generate_service_account_secret_response.py index cbeeab7..2b9eb62 100644 --- a/platform_api_python_client/models/generate_service_account_secret_response.py +++ b/platform_api_python_client/models/generate_service_account_secret_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GenerateServiceAccountSecretResponse(BaseModel): """ @@ -30,7 +31,8 @@ class GenerateServiceAccountSecretResponse(BaseModel): __properties: ClassVar[List[str]] = ["client_secret"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/get_cluster_response.py b/platform_api_python_client/models/get_cluster_response.py index 9e2dd6e..7e61706 100644 --- a/platform_api_python_client/models/get_cluster_response.py +++ b/platform_api_python_client/models/get_cluster_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetClusterResponse(BaseModel): """ @@ -35,7 +36,8 @@ class GetClusterResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "cluster_name", "display_name", "region", "deployment_creation_disabled", "managed_by_ccluster"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -47,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/get_compute_deployment_response.py b/platform_api_python_client/models/get_compute_deployment_response.py index 60998b6..e20b1b8 100644 --- a/platform_api_python_client/models/get_compute_deployment_response.py +++ b/platform_api_python_client/models/get_compute_deployment_response.py @@ -27,6 +27,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetComputeDeploymentResponse(BaseModel): """ @@ -43,7 +44,7 @@ class GetComputeDeploymentResponse(BaseModel): created_at: datetime hardware_instance_id: StrictInt revision_number: StrictInt - chart_revision: Optional[StrictStr] = None + 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.") user_annotations: Optional[Dict[str, StrictStr]] = None priority: Optional[StrictStr] = None volume_mounts: Optional[List[VolumeMount]] = None @@ -58,18 +59,19 @@ class GetComputeDeploymentResponse(BaseModel): enable_logging: Optional[StrictBool] = True __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", "exposed_port", "ssh_public_key", "ssh_password", "env_vars", "image_pull_secret_credentials", "env_vars_refs", "image_pull_ref", "image_pull_secret_name", "enable_logging"] - @field_validator('image_pull_secret_name') + @field_validator('image_pull_secret_name', mode="before") def image_pull_secret_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -81,8 +83,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -111,8 +112,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: diff --git a/platform_api_python_client/models/get_deployment_log_response.py b/platform_api_python_client/models/get_deployment_log_response.py index aadbb46..20795e0 100644 --- a/platform_api_python_client/models/get_deployment_log_response.py +++ b/platform_api_python_client/models/get_deployment_log_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetDeploymentLogResponse(BaseModel): """ @@ -31,7 +32,8 @@ class GetDeploymentLogResponse(BaseModel): __properties: ClassVar[List[str]] = ["events", "next_page_token"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/get_deployment_log_v4_response.py b/platform_api_python_client/models/get_deployment_log_v4_response.py index 5f284e8..03886e3 100644 --- a/platform_api_python_client/models/get_deployment_log_v4_response.py +++ b/platform_api_python_client/models/get_deployment_log_v4_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.deployment_log_event_v4 import DeploymentLogEventV4 from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetDeploymentLogV4Response(BaseModel): """ @@ -31,7 +32,8 @@ class GetDeploymentLogV4Response(BaseModel): __properties: ClassVar[List[str]] = ["events"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.events: for _item_events in self.events: - if _item_events: - _items.append(_item_events.to_dict()) + _items.append(_item_events.to_dict() if _item_events is not None else None) _dict['events'] = _items return _dict diff --git a/platform_api_python_client/models/get_deployment_pods_response.py b/platform_api_python_client/models/get_deployment_pods_response.py index 2d0ce50..1d98210 100644 --- a/platform_api_python_client/models/get_deployment_pods_response.py +++ b/platform_api_python_client/models/get_deployment_pods_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetDeploymentPodsResponse(BaseModel): """ @@ -30,7 +31,8 @@ class GetDeploymentPodsResponse(BaseModel): __properties: ClassVar[List[str]] = ["pods"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/get_deployment_response.py b/platform_api_python_client/models/get_deployment_response.py index 6e29409..17fbbb6 100644 --- a/platform_api_python_client/models/get_deployment_response.py +++ b/platform_api_python_client/models/get_deployment_response.py @@ -18,13 +18,14 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from platform_api_python_client.models.deployment_status import DeploymentStatus from platform_api_python_client.models.deployment_type import DeploymentType from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetDeploymentResponse(BaseModel): """ @@ -41,14 +42,15 @@ class GetDeploymentResponse(BaseModel): created_at: datetime hardware_instance_id: StrictInt revision_number: StrictInt - chart_revision: Optional[StrictStr] = None + 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.") user_annotations: Optional[Dict[str, StrictStr]] = None priority: Optional[StrictStr] = None volume_mounts: Optional[List[VolumeMount]] = None __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"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -60,8 +62,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -90,8 +91,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # set to None if image_url (nullable) is None # and model_fields_set contains the field diff --git a/platform_api_python_client/models/get_deployment_revision_response.py b/platform_api_python_client/models/get_deployment_revision_response.py index 2e261a8..6f89bd5 100644 --- a/platform_api_python_client/models/get_deployment_revision_response.py +++ b/platform_api_python_client/models/get_deployment_revision_response.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.deployment_response import DeploymentResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetDeploymentRevisionResponse(BaseModel): """ @@ -38,7 +39,8 @@ class GetDeploymentRevisionResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "revision_number", "deployment_id", "deployment_response", "notes", "created_at", "updated_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -50,8 +52,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/get_deployment_usage_response.py b/platform_api_python_client/models/get_deployment_usage_response.py index 9242168..05acbc9 100644 --- a/platform_api_python_client/models/get_deployment_usage_response.py +++ b/platform_api_python_client/models/get_deployment_usage_response.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.usage_availability import UsageAvailability from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetDeploymentUsageResponse(BaseModel): """ @@ -34,7 +35,8 @@ class GetDeploymentUsageResponse(BaseModel): __properties: ClassVar[List[str]] = ["values", "availability", "last_sample_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -46,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,8 +77,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.values: for _item_values in self.values: - if _item_values: - _items.append(_item_values.to_dict()) + _items.append(_item_values.to_dict() if _item_values is not None else None) _dict['values'] = _items # set to None if availability (nullable) is None # and model_fields_set contains the field diff --git a/platform_api_python_client/models/get_dynamo_deployment_response.py b/platform_api_python_client/models/get_dynamo_deployment_response.py index 5a08a07..8fe368c 100644 --- a/platform_api_python_client/models/get_dynamo_deployment_response.py +++ b/platform_api_python_client/models/get_dynamo_deployment_response.py @@ -24,13 +24,15 @@ from platform_api_python_client.models.backend_protocol import BackendProtocol from platform_api_python_client.models.deployment_status import DeploymentStatus from platform_api_python_client.models.deployment_type import DeploymentType -from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput +from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput +from platform_api_python_client.models.dynamo_frontend_config import DynamoFrontendConfig from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode from platform_api_python_client.models.dynamo_weight_transfer_configuration import DynamoWeightTransferConfiguration from platform_api_python_client.models.dynamo_worker_pools import DynamoWorkerPools from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetDynamoDeploymentResponse(BaseModel): """ @@ -47,23 +49,23 @@ class GetDynamoDeploymentResponse(BaseModel): created_at: datetime hardware_instance_id: StrictInt revision_number: StrictInt - chart_revision: Optional[StrictStr] = None + 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.") user_annotations: Optional[Dict[str, StrictStr]] = None priority: Optional[StrictStr] = None volume_mounts: Optional[List[VolumeMount]] = None hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None serving_mode: Optional[DynamoServingMode] = None - worker_pools: Optional[DynamoWorkerPools] = None - communications: Optional[DynamoCommunicationsOutput] = None - weight_transfer: Optional[DynamoWeightTransferConfiguration] = None + worker_pools: Optional[DynamoWorkerPools] = Field(default=None, description="Hardware and scaling per worker role. Aggregated mode uses exactly `worker`; disaggregated mode uses exactly `prefill` and `decode`. Unused roles are null.") + communications: Optional[DynamoCommunicationsInput] = Field(default=None, description="Requested communication policy; null for revisions using the legacy configuration.") + weight_transfer: Optional[DynamoWeightTransferConfiguration] = Field(default=None, description="Requested weight transfer policy; null when the workers use the native loader.") model: StrictStr - model_revision: Optional[StrictStr] = None + model_revision: Optional[StrictStr] = Field(default=None, description="Commit SHA of `model` this revision loads; null when the workers load the default branch.") served_model_name: Optional[StrictStr] = None - runtime_version: Optional[StrictStr] = None + runtime_version: Optional[StrictStr] = Field(default=None, description="Dynamo runtime version tag this revision renders with.") min_replicas: StrictInt = Field(description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") max_replicas: StrictInt = Field(description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") - concurrency: Optional[StrictInt] = None - cooldown_period: Optional[StrictInt] = None + concurrency: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") + cooldown_period: Optional[StrictInt] = Field(default=None, description="Deprecated aggregated-only spelling; set this under worker_pools.worker instead. Accepted alongside worker_pools when the values agree.") extra_args: Optional[StrictStr] = None env_vars: Optional[Dict[str, StrictStr]] = None env_vars_refs: Optional[Dict[str, Any]] = None @@ -74,10 +76,12 @@ class GetDynamoDeploymentResponse(BaseModel): enable_logging: Optional[StrictBool] = True enable_node_model_cache: Optional[StrictBool] = False backend_protocol: Optional[BackendProtocol] = None - __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", "serving_mode", "worker_pools", "communications", "weight_transfer", "model", "model_revision", "served_model_name", "runtime_version", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "env_vars", "env_vars_refs", "endpoint_certificate_authority", "endpoint_bearer_token", "bearer_token_ref", "image_pull_ref", "enable_logging", "enable_node_model_cache", "backend_protocol"] + frontend: Optional[DynamoFrontendConfig] = Field(default=None, description="Frontend replica bounds this revision requests; the defaults for revisions created before the field.") + __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", "serving_mode", "worker_pools", "communications", "weight_transfer", "model", "model_revision", "served_model_name", "runtime_version", "min_replicas", "max_replicas", "concurrency", "cooldown_period", "extra_args", "env_vars", "env_vars_refs", "endpoint_certificate_authority", "endpoint_bearer_token", "bearer_token_ref", "image_pull_ref", "enable_logging", "enable_node_model_cache", "backend_protocol", "frontend"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -89,8 +93,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -119,8 +122,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of worker_pools if self.worker_pools: @@ -131,6 +133,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of weight_transfer if self.weight_transfer: _dict['weight_transfer'] = self.weight_transfer.to_dict() + # override the default output from pydantic by calling `to_dict()` of frontend + if self.frontend: + _dict['frontend'] = self.frontend.to_dict() # set to None if image_url (nullable) is None # and model_fields_set contains the field if self.image_url is None and "image_url" in self.model_fields_set: @@ -251,7 +256,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hf_token_ref": obj.get("hf_token_ref"), "serving_mode": obj.get("serving_mode"), "worker_pools": DynamoWorkerPools.from_dict(obj["worker_pools"]) if obj.get("worker_pools") is not None else None, - "communications": DynamoCommunicationsOutput.from_dict(obj["communications"]) if obj.get("communications") is not None else None, + "communications": DynamoCommunicationsInput.from_dict(obj["communications"]) if obj.get("communications") is not None else None, "weight_transfer": DynamoWeightTransferConfiguration.from_dict(obj["weight_transfer"]) if obj.get("weight_transfer") is not None else None, "model": obj.get("model"), "model_revision": obj.get("model_revision"), @@ -270,7 +275,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "image_pull_ref": obj.get("image_pull_ref"), "enable_logging": obj.get("enable_logging") if obj.get("enable_logging") is not None else True, "enable_node_model_cache": obj.get("enable_node_model_cache") if obj.get("enable_node_model_cache") is not None else False, - "backend_protocol": obj.get("backend_protocol") + "backend_protocol": obj.get("backend_protocol"), + "frontend": DynamoFrontendConfig.from_dict(obj["frontend"]) if obj.get("frontend") is not None else None }) return _obj diff --git a/platform_api_python_client/models/get_filesystem_volume_response.py b/platform_api_python_client/models/get_filesystem_volume_response.py index 15d4e63..165d07b 100644 --- a/platform_api_python_client/models/get_filesystem_volume_response.py +++ b/platform_api_python_client/models/get_filesystem_volume_response.py @@ -24,6 +24,7 @@ from platform_api_python_client.models.volume_status import VolumeStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetFilesystemVolumeResponse(BaseModel): """ @@ -49,7 +50,8 @@ def backend_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -61,8 +63,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/get_inference_deployment_response.py b/platform_api_python_client/models/get_inference_deployment_response.py index 8d2b661..290ff8d 100644 --- a/platform_api_python_client/models/get_inference_deployment_response.py +++ b/platform_api_python_client/models/get_inference_deployment_response.py @@ -18,13 +18,14 @@ import json from datetime import datetime -from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional from platform_api_python_client.models.deployment_status import DeploymentStatus from platform_api_python_client.models.deployment_type import DeploymentType from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetInferenceDeploymentResponse(BaseModel): """ @@ -41,7 +42,7 @@ class GetInferenceDeploymentResponse(BaseModel): created_at: datetime hardware_instance_id: StrictInt revision_number: StrictInt - chart_revision: Optional[StrictStr] = None + 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.") user_annotations: Optional[Dict[str, StrictStr]] = None priority: Optional[StrictStr] = None volume_mounts: Optional[List[VolumeMount]] = None @@ -59,7 +60,8 @@ class GetInferenceDeploymentResponse(BaseModel): __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_scale", "max_scale", "initial_scale", "concurrency", "healthcheck", "endpoint_certificate_authority", "endpoint_bearer_token", "env_vars", "command", "command_args"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -71,8 +73,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -101,8 +102,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # set to None if image_url (nullable) is None # and model_fields_set contains the field diff --git a/platform_api_python_client/models/get_inference_v3_deployment_response.py b/platform_api_python_client/models/get_inference_v3_deployment_response.py index 5aa9de9..758968c 100644 --- a/platform_api_python_client/models/get_inference_v3_deployment_response.py +++ b/platform_api_python_client/models/get_inference_v3_deployment_response.py @@ -30,6 +30,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetInferenceV3DeploymentResponse(BaseModel): """ @@ -46,7 +47,7 @@ class GetInferenceV3DeploymentResponse(BaseModel): created_at: datetime hardware_instance_id: StrictInt revision_number: StrictInt - chart_revision: Optional[StrictStr] = None + 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.") user_annotations: Optional[Dict[str, StrictStr]] = None priority: Optional[StrictStr] = None volume_mounts: Optional[List[VolumeMount]] = None @@ -76,18 +77,19 @@ class GetInferenceV3DeploymentResponse(BaseModel): metrics: Optional[MetricsConfig] = None __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", "enable_logging", "enable_node_model_cache", "session_affinity", "config_file", "metrics"] - @field_validator('image_pull_secret_name') + @field_validator('image_pull_secret_name', mode="before") def image_pull_secret_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -99,8 +101,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -129,8 +130,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: diff --git a/platform_api_python_client/models/get_job_deployment_response.py b/platform_api_python_client/models/get_job_deployment_response.py index 2b83ca8..b02575a 100644 --- a/platform_api_python_client/models/get_job_deployment_response.py +++ b/platform_api_python_client/models/get_job_deployment_response.py @@ -28,6 +28,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetJobDeploymentResponse(BaseModel): """ @@ -44,7 +45,7 @@ class GetJobDeploymentResponse(BaseModel): created_at: datetime hardware_instance_id: StrictInt revision_number: StrictInt - chart_revision: Optional[StrictStr] = None + 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.") user_annotations: Optional[Dict[str, StrictStr]] = None priority: Optional[StrictStr] = None volume_mounts: Optional[List[VolumeMount]] = None @@ -64,18 +65,19 @@ class GetJobDeploymentResponse(BaseModel): config_file: Optional[ConfigFileMount] = None __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"] - @field_validator('image_pull_secret_name') + @field_validator('image_pull_secret_name', mode="before") def image_pull_secret_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -87,8 +89,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -117,8 +118,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of image_pull_secret_credentials if self.image_pull_secret_credentials: diff --git a/platform_api_python_client/models/get_object_volume_response.py b/platform_api_python_client/models/get_object_volume_response.py index 3b9d982..941ce83 100644 --- a/platform_api_python_client/models/get_object_volume_response.py +++ b/platform_api_python_client/models/get_object_volume_response.py @@ -25,6 +25,7 @@ from platform_api_python_client.models.volume_status import VolumeStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GetObjectVolumeResponse(BaseModel): """ @@ -53,7 +54,8 @@ def backend_validate_enum(cls, value): return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -65,8 +67,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/gpu_operator.py b/platform_api_python_client/models/gpu_operator.py index a18a613..27526dc 100644 --- a/platform_api_python_client/models/gpu_operator.py +++ b/platform_api_python_client/models/gpu_operator.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GpuOperator(BaseModel): """ @@ -31,7 +32,8 @@ class GpuOperator(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/gpu_type_capacity.py b/platform_api_python_client/models/gpu_type_capacity.py index 0333354..976f214 100644 --- a/platform_api_python_client/models/gpu_type_capacity.py +++ b/platform_api_python_client/models/gpu_type_capacity.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GpuTypeCapacity(BaseModel): """ @@ -32,7 +33,8 @@ class GpuTypeCapacity(BaseModel): __properties: ClassVar[List[str]] = ["gpu_type", "total_gpus", "used_gpus"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/hardware_instance_response.py b/platform_api_python_client/models/hardware_instance_response.py index 86d2afb..78c3c61 100644 --- a/platform_api_python_client/models/hardware_instance_response.py +++ b/platform_api_python_client/models/hardware_instance_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class HardwareInstanceResponse(BaseModel): """ @@ -38,7 +39,8 @@ class HardwareInstanceResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "name", "gpu_type", "num_gpu", "cpu", "memory", "cluster_id", "accelerator_memory", "cost_per_hr"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -50,8 +52,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/hardware_preset_response.py b/platform_api_python_client/models/hardware_preset_response.py index 85da07e..1fe4cff 100644 --- a/platform_api_python_client/models/hardware_preset_response.py +++ b/platform_api_python_client/models/hardware_preset_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class HardwarePresetResponse(BaseModel): """ @@ -32,7 +33,8 @@ class HardwarePresetResponse(BaseModel): __properties: ClassVar[List[str]] = ["gpu_type", "accelerator_memory", "is_mig"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/http_validation_error.py b/platform_api_python_client/models/http_validation_error.py index 9ff09c8..db28a21 100644 --- a/platform_api_python_client/models/http_validation_error.py +++ b/platform_api_python_client/models/http_validation_error.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.validation_error import ValidationError from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class HTTPValidationError(BaseModel): """ @@ -31,7 +32,8 @@ class HTTPValidationError(BaseModel): __properties: ClassVar[List[str]] = ["detail"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.detail: for _item_detail in self.detail: - if _item_detail: - _items.append(_item_detail.to_dict()) + _items.append(_item_detail.to_dict() if _item_detail is not None else None) _dict['detail'] = _items return _dict diff --git a/platform_api_python_client/models/image.py b/platform_api_python_client/models/image.py index 0671416..12a58b2 100644 --- a/platform_api_python_client/models/image.py +++ b/platform_api_python_client/models/image.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Image(BaseModel): """ @@ -32,18 +33,19 @@ class Image(BaseModel): 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.") __properties: ClassVar[List[str]] = ["url", "pull_ref", "pull_secret_name"] - @field_validator('pull_secret_name') + @field_validator('pull_secret_name', mode="before") def pull_secret_name_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$", value): + 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): 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])?)*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -55,8 +57,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/image_pull_secret_credentials.py b/platform_api_python_client/models/image_pull_secret_credentials.py index df2d96d..91437ce 100644 --- a/platform_api_python_client/models/image_pull_secret_credentials.py +++ b/platform_api_python_client/models/image_pull_secret_credentials.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ImagePullSecretCredentials(BaseModel): """ @@ -31,7 +32,8 @@ class ImagePullSecretCredentials(BaseModel): __properties: ClassVar[List[str]] = ["username", "password"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/ingress.py b/platform_api_python_client/models/ingress.py index d65c7f9..4ee2da6 100644 --- a/platform_api_python_client/models/ingress.py +++ b/platform_api_python_client/models/ingress.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.backend_protocol import BackendProtocol from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Ingress(BaseModel): """ @@ -34,7 +35,8 @@ class Ingress(BaseModel): __properties: ClassVar[List[str]] = ["backend_protocol", "bearer_token_ref", "certificate_authority"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -46,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/ingress_nginx.py b/platform_api_python_client/models/ingress_nginx.py index ec898c4..e1e5620 100644 --- a/platform_api_python_client/models/ingress_nginx.py +++ b/platform_api_python_client/models/ingress_nginx.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class IngressNginx(BaseModel): """ @@ -31,7 +32,8 @@ class IngressNginx(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/insight_list_item_response.py b/platform_api_python_client/models/insight_list_item_response.py index 7da75f7..0cd605b 100644 --- a/platform_api_python_client/models/insight_list_item_response.py +++ b/platform_api_python_client/models/insight_list_item_response.py @@ -25,6 +25,7 @@ from platform_api_python_client.models.insight_status import InsightStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class InsightListItemResponse(BaseModel): """ @@ -41,7 +42,8 @@ class InsightListItemResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "identity", "severity", "status", "title", "observed_at", "created_at", "resource"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -53,8 +55,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/insight_resource.py b/platform_api_python_client/models/insight_resource.py index 5fc5911..918cadb 100644 --- a/platform_api_python_client/models/insight_resource.py +++ b/platform_api_python_client/models/insight_resource.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.insight_resource_type import InsightResourceType from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class InsightResource(BaseModel): """ @@ -33,7 +34,8 @@ class InsightResource(BaseModel): __properties: ClassVar[List[str]] = ["type", "id", "name"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/insight_response.py b/platform_api_python_client/models/insight_response.py index a550062..c01c1e8 100644 --- a/platform_api_python_client/models/insight_response.py +++ b/platform_api_python_client/models/insight_response.py @@ -26,6 +26,7 @@ from platform_api_python_client.models.insight_status_change_response import InsightStatusChangeResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class InsightResponse(BaseModel): """ @@ -48,7 +49,8 @@ class InsightResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "identity", "severity", "status", "title", "observed_at", "created_at", "resource", "observed_summary", "recommended_steps", "content", "reported_by", "updated_at", "history"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -60,8 +62,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -93,8 +94,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.history: for _item_history in self.history: - if _item_history: - _items.append(_item_history.to_dict()) + _items.append(_item_history.to_dict() if _item_history is not None else None) _dict['history'] = _items # set to None if content (nullable) is None # and model_fields_set contains the field diff --git a/platform_api_python_client/models/insight_status_change_response.py b/platform_api_python_client/models/insight_status_change_response.py index 081ba08..1662281 100644 --- a/platform_api_python_client/models/insight_status_change_response.py +++ b/platform_api_python_client/models/insight_status_change_response.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.insight_status import InsightStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class InsightStatusChangeResponse(BaseModel): """ @@ -36,7 +37,8 @@ class InsightStatusChangeResponse(BaseModel): __properties: ClassVar[List[str]] = ["from_status", "to_status", "actor_name", "created_at", "comment"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -48,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/invite_user_request.py b/platform_api_python_client/models/invite_user_request.py index 2704384..93dd9e5 100644 --- a/platform_api_python_client/models/invite_user_request.py +++ b/platform_api_python_client/models/invite_user_request.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class InviteUserRequest(BaseModel): """ @@ -30,7 +31,8 @@ class InviteUserRequest(BaseModel): __properties: ClassVar[List[str]] = ["email"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/istio.py b/platform_api_python_client/models/istio.py index 4d2261a..a46929b 100644 --- a/platform_api_python_client/models/istio.py +++ b/platform_api_python_client/models/istio.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.istio_overrides import IstioOverrides from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Istio(BaseModel): """ @@ -32,7 +33,8 @@ class Istio(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/istio_cni_overrides.py b/platform_api_python_client/models/istio_cni_overrides.py index 66f1d9e..09b12c6 100644 --- a/platform_api_python_client/models/istio_cni_overrides.py +++ b/platform_api_python_client/models/istio_cni_overrides.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class IstioCniOverrides(BaseModel): """ @@ -31,7 +32,8 @@ class IstioCniOverrides(BaseModel): __properties: ClassVar[List[str]] = ["cniBinDir", "cniConfDir"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/istio_cni_subchart_overrides.py b/platform_api_python_client/models/istio_cni_subchart_overrides.py index 5ef569a..c8095b2 100644 --- a/platform_api_python_client/models/istio_cni_subchart_overrides.py +++ b/platform_api_python_client/models/istio_cni_subchart_overrides.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.istio_cni_overrides import IstioCniOverrides from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class IstioCniSubchartOverrides(BaseModel): """ @@ -31,7 +32,8 @@ class IstioCniSubchartOverrides(BaseModel): __properties: ClassVar[List[str]] = ["cni"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/istio_overrides.py b/platform_api_python_client/models/istio_overrides.py index bdbf315..f45312c 100644 --- a/platform_api_python_client/models/istio_overrides.py +++ b/platform_api_python_client/models/istio_overrides.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.istio_cni_subchart_overrides import IstioCniSubchartOverrides from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class IstioOverrides(BaseModel): """ @@ -31,7 +32,8 @@ class IstioOverrides(BaseModel): __properties: ClassVar[List[str]] = ["istio-cni"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/keda.py b/platform_api_python_client/models/keda.py index 0928f48..5312eca 100644 --- a/platform_api_python_client/models/keda.py +++ b/platform_api_python_client/models/keda.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Keda(BaseModel): """ @@ -31,7 +32,8 @@ class Keda(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/kube_prometheus_stack.py b/platform_api_python_client/models/kube_prometheus_stack.py index 6c3b08e..8b54a79 100644 --- a/platform_api_python_client/models/kube_prometheus_stack.py +++ b/platform_api_python_client/models/kube_prometheus_stack.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class KubePrometheusStack(BaseModel): """ @@ -31,7 +32,8 @@ class KubePrometheusStack(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/list_cluster_capacity_response.py b/platform_api_python_client/models/list_cluster_capacity_response.py index af59dd1..caa3d93 100644 --- a/platform_api_python_client/models/list_cluster_capacity_response.py +++ b/platform_api_python_client/models/list_cluster_capacity_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.cluster_capacity_response import ClusterCapacityResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListClusterCapacityResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListClusterCapacityResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_daily_bill_response.py b/platform_api_python_client/models/list_daily_bill_response.py index 6fe65c3..88be83c 100644 --- a/platform_api_python_client/models/list_daily_bill_response.py +++ b/platform_api_python_client/models/list_daily_bill_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.daily_bill_response import DailyBillResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListDailyBillResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListDailyBillResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_deployment_revisions_response.py b/platform_api_python_client/models/list_deployment_revisions_response.py index 8e1268d..3fbc9f2 100644 --- a/platform_api_python_client/models/list_deployment_revisions_response.py +++ b/platform_api_python_client/models/list_deployment_revisions_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.get_deployment_revision_response import GetDeploymentRevisionResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListDeploymentRevisionsResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListDeploymentRevisionsResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_get_cluster_response.py b/platform_api_python_client/models/list_get_cluster_response.py index bd0d5cf..2e065af 100644 --- a/platform_api_python_client/models/list_get_cluster_response.py +++ b/platform_api_python_client/models/list_get_cluster_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.get_cluster_response import GetClusterResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListGetClusterResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListGetClusterResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_get_deployment_response.py b/platform_api_python_client/models/list_get_deployment_response.py index 07734a8..6178b4b 100644 --- a/platform_api_python_client/models/list_get_deployment_response.py +++ b/platform_api_python_client/models/list_get_deployment_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.get_deployment_response import GetDeploymentResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListGetDeploymentResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListGetDeploymentResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_hardware_instance_response.py b/platform_api_python_client/models/list_hardware_instance_response.py index 56b99c6..5ffb8ce 100644 --- a/platform_api_python_client/models/list_hardware_instance_response.py +++ b/platform_api_python_client/models/list_hardware_instance_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.hardware_instance_response import HardwareInstanceResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListHardwareInstanceResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListHardwareInstanceResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_hardware_preset_response.py b/platform_api_python_client/models/list_hardware_preset_response.py index b94c8c8..4851c99 100644 --- a/platform_api_python_client/models/list_hardware_preset_response.py +++ b/platform_api_python_client/models/list_hardware_preset_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.hardware_preset_response import HardwarePresetResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListHardwarePresetResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListHardwarePresetResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_insights_response.py b/platform_api_python_client/models/list_insights_response.py index 62af7ab..cdde8d4 100644 --- a/platform_api_python_client/models/list_insights_response.py +++ b/platform_api_python_client/models/list_insights_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.insight_list_item_response import InsightListItemResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListInsightsResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListInsightsResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_organization_gpu_quota_response.py b/platform_api_python_client/models/list_organization_gpu_quota_response.py index a8bea34..f1a017a 100644 --- a/platform_api_python_client/models/list_organization_gpu_quota_response.py +++ b/platform_api_python_client/models/list_organization_gpu_quota_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.organization_gpu_quota_response import OrganizationGpuQuotaResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListOrganizationGpuQuotaResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListOrganizationGpuQuotaResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_prebuilt_image_response.py b/platform_api_python_client/models/list_prebuilt_image_response.py index 3db0fec..0d8e3c5 100644 --- a/platform_api_python_client/models/list_prebuilt_image_response.py +++ b/platform_api_python_client/models/list_prebuilt_image_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.prebuilt_image_response import PrebuiltImageResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListPrebuiltImageResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListPrebuiltImageResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_service_accounts_response.py b/platform_api_python_client/models/list_service_accounts_response.py index 3b85fa7..f5cf831 100644 --- a/platform_api_python_client/models/list_service_accounts_response.py +++ b/platform_api_python_client/models/list_service_accounts_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.service_account_response import ServiceAccountResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListServiceAccountsResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListServiceAccountsResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_user_vault_items_response.py b/platform_api_python_client/models/list_user_vault_items_response.py index 57060f9..f7d4d2e 100644 --- a/platform_api_python_client/models/list_user_vault_items_response.py +++ b/platform_api_python_client/models/list_user_vault_items_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.user_vault_item import UserVaultItem from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListUserVaultItemsResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListUserVaultItemsResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/list_volumes_response.py b/platform_api_python_client/models/list_volumes_response.py index c295220..6f090cd 100644 --- a/platform_api_python_client/models/list_volumes_response.py +++ b/platform_api_python_client/models/list_volumes_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.get_volume_response import GetVolumeResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ListVolumesResponse(BaseModel): """ @@ -31,7 +32,8 @@ class ListVolumesResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/validation_error_loc_inner.py b/platform_api_python_client/models/location_inner.py similarity index 91% rename from platform_api_python_client/models/validation_error_loc_inner.py rename to platform_api_python_client/models/location_inner.py index abee848..97f31a2 100644 --- a/platform_api_python_client/models/validation_error_loc_inner.py +++ b/platform_api_python_client/models/location_inner.py @@ -23,11 +23,11 @@ from typing_extensions import Literal, Self from pydantic import Field -VALIDATIONERRORLOCINNER_ANY_OF_SCHEMAS = ["int", "str"] +LOCATIONINNER_ANY_OF_SCHEMAS = ["int", "str"] -class ValidationErrorLocInner(BaseModel): +class LocationInner(BaseModel): """ - ValidationErrorLocInner + LocationInner """ # data type: str @@ -57,7 +57,7 @@ def __init__(self, *args, **kwargs) -> None: @field_validator('actual_instance') def actual_instance_must_validate_anyof(cls, v): - instance = ValidationErrorLocInner.model_construct() + instance = LocationInner.model_construct() error_messages = [] # validate data type: str try: @@ -73,7 +73,7 @@ def actual_instance_must_validate_anyof(cls, v): error_messages.append(str(e)) if error_messages: # no match - raise ValueError("No match found when setting the actual_instance in ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when setting the actual_instance in LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages)) else: return v @@ -107,7 +107,7 @@ def from_json(cls, json_str: str) -> Self: if error_messages: # no match - raise ValueError("No match found when deserializing the JSON string into ValidationErrorLocInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages)) + raise ValueError("No match found when deserializing the JSON string into LocationInner with anyOf schemas: int, str. Details: " + ", ".join(error_messages)) else: return instance diff --git a/platform_api_python_client/models/longhorn.py b/platform_api_python_client/models/longhorn.py index 72ac984..ba08e38 100644 --- a/platform_api_python_client/models/longhorn.py +++ b/platform_api_python_client/models/longhorn.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Longhorn(BaseModel): """ @@ -31,7 +32,8 @@ class Longhorn(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/metrics_config.py b/platform_api_python_client/models/metrics_config.py index 0dae7e6..0b2f8b9 100644 --- a/platform_api_python_client/models/metrics_config.py +++ b/platform_api_python_client/models/metrics_config.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class MetricsConfig(BaseModel): """ @@ -31,15 +32,16 @@ class MetricsConfig(BaseModel): path: Annotated[str, Field(strict=True)] __properties: ClassVar[List[str]] = ["port", "path"] - @field_validator('path') + @field_validator('path', mode="before") def path_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^\/[^\s?#]*$", value): + if isinstance(value, str) and not re.match(r"^\/[^\s?#]*$", value): raise ValueError(r"must validate the regular expression /^\/[^\s?#]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -51,8 +53,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/metrics_server.py b/platform_api_python_client/models/metrics_server.py index 3568b62..dda19d5 100644 --- a/platform_api_python_client/models/metrics_server.py +++ b/platform_api_python_client/models/metrics_server.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class MetricsServer(BaseModel): """ @@ -31,7 +32,8 @@ class MetricsServer(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/network_operator.py b/platform_api_python_client/models/network_operator.py index 6f2156c..0b7c1b6 100644 --- a/platform_api_python_client/models/network_operator.py +++ b/platform_api_python_client/models/network_operator.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class NetworkOperator(BaseModel): """ @@ -31,7 +32,8 @@ class NetworkOperator(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/opentelemetry_collector.py b/platform_api_python_client/models/opentelemetry_collector.py index 9230fe0..e492149 100644 --- a/platform_api_python_client/models/opentelemetry_collector.py +++ b/platform_api_python_client/models/opentelemetry_collector.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class OpentelemetryCollector(BaseModel): """ @@ -31,7 +32,8 @@ class OpentelemetryCollector(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/organization_gpu_quota_request.py b/platform_api_python_client/models/organization_gpu_quota_request.py index 4569eca..977dfe9 100644 --- a/platform_api_python_client/models/organization_gpu_quota_request.py +++ b/platform_api_python_client/models/organization_gpu_quota_request.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class OrganizationGpuQuotaRequest(BaseModel): """ @@ -31,7 +32,8 @@ class OrganizationGpuQuotaRequest(BaseModel): __properties: ClassVar[List[str]] = ["gpu_quota"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/organization_gpu_quota_response.py b/platform_api_python_client/models/organization_gpu_quota_response.py index 4e7f1c1..5eca2f8 100644 --- a/platform_api_python_client/models/organization_gpu_quota_response.py +++ b/platform_api_python_client/models/organization_gpu_quota_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class OrganizationGpuQuotaResponse(BaseModel): """ @@ -32,7 +33,8 @@ class OrganizationGpuQuotaResponse(BaseModel): __properties: ClassVar[List[str]] = ["organization_id", "cluster_id", "gpu_quota"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/pod_details.py b/platform_api_python_client/models/pod_details.py index b32aa19..29896d2 100644 --- a/platform_api_python_client/models/pod_details.py +++ b/platform_api_python_client/models/pod_details.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.pod_status import PodStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class PodDetails(BaseModel): """ @@ -36,7 +37,8 @@ class PodDetails(BaseModel): __properties: ClassVar[List[str]] = ["name", "revision_number", "component_type", "status", "error_message"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -48,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/pool.py b/platform_api_python_client/models/pool.py index cb34a81..01b2f08 100644 --- a/platform_api_python_client/models/pool.py +++ b/platform_api_python_client/models/pool.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Pool(BaseModel): """ @@ -35,7 +36,8 @@ class Pool(BaseModel): __properties: ClassVar[List[str]] = ["hardware_instance_id", "min_replicas", "max_replicas", "concurrency", "cooldown_period"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -47,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/prebuilt_image_response.py b/platform_api_python_client/models/prebuilt_image_response.py index 513b5d7..86a288e 100644 --- a/platform_api_python_client/models/prebuilt_image_response.py +++ b/platform_api_python_client/models/prebuilt_image_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.deployment_type import DeploymentType from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class PrebuiltImageResponse(BaseModel): """ @@ -36,7 +37,8 @@ class PrebuiltImageResponse(BaseModel): __properties: ClassVar[List[str]] = ["image_name", "label", "tags", "type", "port", "healthcheck"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -48,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/prometheus_adapter.py b/platform_api_python_client/models/prometheus_adapter.py index ea79586..b28692b 100644 --- a/platform_api_python_client/models/prometheus_adapter.py +++ b/platform_api_python_client/models/prometheus_adapter.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class PrometheusAdapter(BaseModel): """ @@ -31,7 +32,8 @@ class PrometheusAdapter(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/revision_pod_details.py b/platform_api_python_client/models/revision_pod_details.py index 2a36ea7..50476aa 100644 --- a/platform_api_python_client/models/revision_pod_details.py +++ b/platform_api_python_client/models/revision_pod_details.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.service_status import ServiceStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class RevisionPodDetails(BaseModel): """ @@ -35,7 +36,8 @@ class RevisionPodDetails(BaseModel): __properties: ClassVar[List[str]] = ["revision_number", "revision_status", "pod_details_list", "error_message"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -47,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +78,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.pod_details_list: for _item_pod_details_list in self.pod_details_list: - if _item_pod_details_list: - _items.append(_item_pod_details_list.to_dict()) + _items.append(_item_pod_details_list.to_dict() if _item_pod_details_list is not None else None) _dict['pod_details_list'] = _items # set to None if revision_number (nullable) is None # and model_fields_set contains the field diff --git a/platform_api_python_client/models/rollout_strategy_params.py b/platform_api_python_client/models/rollout_strategy_params.py index 8880e23..8bba145 100644 --- a/platform_api_python_client/models/rollout_strategy_params.py +++ b/platform_api_python_client/models/rollout_strategy_params.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class RolloutStrategyParams(BaseModel): """ @@ -31,7 +32,8 @@ class RolloutStrategyParams(BaseModel): __properties: ClassVar[List[str]] = ["max_surge", "max_unavailable"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/service_account_response.py b/platform_api_python_client/models/service_account_response.py index 2722519..e6f2c07 100644 --- a/platform_api_python_client/models/service_account_response.py +++ b/platform_api_python_client/models/service_account_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ServiceAccountResponse(BaseModel): """ @@ -36,7 +37,8 @@ class ServiceAccountResponse(BaseModel): __properties: ClassVar[List[str]] = ["workos_id", "name", "description", "scopes", "created_at", "updated_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -48,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/spire.py b/platform_api_python_client/models/spire.py index 20f7a83..bb33e46 100644 --- a/platform_api_python_client/models/spire.py +++ b/platform_api_python_client/models/spire.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Spire(BaseModel): """ @@ -31,7 +32,8 @@ class Spire(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/spire_crds.py b/platform_api_python_client/models/spire_crds.py index 6aa4d04..3bfb472 100644 --- a/platform_api_python_client/models/spire_crds.py +++ b/platform_api_python_client/models/spire_crds.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class SpireCrds(BaseModel): """ @@ -31,7 +32,8 @@ class SpireCrds(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/teleport_kube_agent.py b/platform_api_python_client/models/teleport_kube_agent.py index c6073a8..0c22b12 100644 --- a/platform_api_python_client/models/teleport_kube_agent.py +++ b/platform_api_python_client/models/teleport_kube_agent.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class TeleportKubeAgent(BaseModel): """ @@ -31,7 +32,8 @@ class TeleportKubeAgent(BaseModel): __properties: ClassVar[List[str]] = ["enabled", "values"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,6 +70,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # set to None if values (nullable) is None + # and model_fields_set contains the field + if self.values is None and "values" in self.model_fields_set: + _dict['values'] = None + return _dict @classmethod diff --git a/platform_api_python_client/models/unified_get_compute_deployment_response.py b/platform_api_python_client/models/unified_get_compute_deployment_response.py index 1744130..be73557 100644 --- a/platform_api_python_client/models/unified_get_compute_deployment_response.py +++ b/platform_api_python_client/models/unified_get_compute_deployment_response.py @@ -28,6 +28,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetComputeDeploymentResponse(BaseModel): """ @@ -46,7 +47,7 @@ class UnifiedGetComputeDeploymentResponse(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclMainPools env: Optional[Env] = None image: Image @@ -62,15 +63,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_compute')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -82,8 +84,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -112,8 +113,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: diff --git a/platform_api_python_client/models/unified_get_deployment_logs_response.py b/platform_api_python_client/models/unified_get_deployment_logs_response.py index fbcb487..6754856 100644 --- a/platform_api_python_client/models/unified_get_deployment_logs_response.py +++ b/platform_api_python_client/models/unified_get_deployment_logs_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.deployment_log_event_v4 import DeploymentLogEventV4 from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetDeploymentLogsResponse(BaseModel): """ @@ -31,7 +32,8 @@ class UnifiedGetDeploymentLogsResponse(BaseModel): __properties: ClassVar[List[str]] = ["events"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.events: for _item_events in self.events: - if _item_events: - _items.append(_item_events.to_dict()) + _items.append(_item_events.to_dict() if _item_events is not None else None) _dict['events'] = _items return _dict diff --git a/platform_api_python_client/models/unified_get_deployment_pods_response.py b/platform_api_python_client/models/unified_get_deployment_pods_response.py index 2d5545a..ace9616 100644 --- a/platform_api_python_client/models/unified_get_deployment_pods_response.py +++ b/platform_api_python_client/models/unified_get_deployment_pods_response.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetDeploymentPodsResponse(BaseModel): """ @@ -30,7 +31,8 @@ class UnifiedGetDeploymentPodsResponse(BaseModel): __properties: ClassVar[List[str]] = ["pods"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/unified_get_deployment_revision_response.py b/platform_api_python_client/models/unified_get_deployment_revision_response.py index de2ecca..a6bc3b7 100644 --- a/platform_api_python_client/models/unified_get_deployment_revision_response.py +++ b/platform_api_python_client/models/unified_get_deployment_revision_response.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.unified_get_deployment_response import UnifiedGetDeploymentResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetDeploymentRevisionResponse(BaseModel): """ @@ -38,7 +39,8 @@ class UnifiedGetDeploymentRevisionResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "revision_number", "deployment_id", "deployment_response", "notes", "created_at", "updated_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -50,8 +52,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/unified_get_deployment_rollout_response.py b/platform_api_python_client/models/unified_get_deployment_rollout_response.py index 66c0184..f06111c 100644 --- a/platform_api_python_client/models/unified_get_deployment_rollout_response.py +++ b/platform_api_python_client/models/unified_get_deployment_rollout_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.rollout_status import RolloutStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetDeploymentRolloutResponse(BaseModel): """ @@ -32,7 +33,8 @@ class UnifiedGetDeploymentRolloutResponse(BaseModel): __properties: ClassVar[List[str]] = ["paused", "status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -44,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/unified_get_deployment_usage_response.py b/platform_api_python_client/models/unified_get_deployment_usage_response.py index 411bdb2..263ce88 100644 --- a/platform_api_python_client/models/unified_get_deployment_usage_response.py +++ b/platform_api_python_client/models/unified_get_deployment_usage_response.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.usage_availability import UsageAvailability from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetDeploymentUsageResponse(BaseModel): """ @@ -34,7 +35,8 @@ class UnifiedGetDeploymentUsageResponse(BaseModel): __properties: ClassVar[List[str]] = ["values", "availability", "last_sample_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -46,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -76,8 +77,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.values: for _item_values in self.values: - if _item_values: - _items.append(_item_values.to_dict()) + _items.append(_item_values.to_dict() if _item_values is not None else None) _dict['values'] = _items # set to None if availability (nullable) is None # and model_fields_set contains the field diff --git a/platform_api_python_client/models/unified_get_dynamo_deployment_response.py b/platform_api_python_client/models/unified_get_dynamo_deployment_response.py index d87e3cb..6c74d8e 100644 --- a/platform_api_python_client/models/unified_get_dynamo_deployment_response.py +++ b/platform_api_python_client/models/unified_get_dynamo_deployment_response.py @@ -23,7 +23,7 @@ from typing_extensions import Annotated from platform_api_python_client.models.ccl_dynamo_pools import CclDynamoPools from platform_api_python_client.models.deployment_status import DeploymentStatus -from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput +from platform_api_python_client.models.dynamo_communications_input import DynamoCommunicationsInput from platform_api_python_client.models.dynamo_image import DynamoImage from platform_api_python_client.models.dynamo_serving_mode import DynamoServingMode from platform_api_python_client.models.env import Env @@ -31,6 +31,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetDynamoDeploymentResponse(BaseModel): """ @@ -49,17 +50,17 @@ class UnifiedGetDynamoDeploymentResponse(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclDynamoPools env: Optional[Env] = None image: Optional[DynamoImage] = None ingress: Ingress serving_mode: Optional[DynamoServingMode] = None - communications: Optional[DynamoCommunicationsOutput] = None + communications: Optional[DynamoCommunicationsInput] = Field(default=None, description="Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration.") model: StrictStr served_model_name: Optional[StrictStr] = None - extra_args: Optional[StrictStr] = None - hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None + extra_args: Optional[StrictStr] = Field(default=None, description="Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected.") + hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Access-token vault item ID for HF_TOKEN.") enable_logging: Optional[StrictBool] = True enable_node_model_cache: Optional[StrictBool] = False __properties: ClassVar[List[str]] = ["id", "status", "creator_email", "created_at", "updated_at", "revision_number", "endpoint_url", "type", "name", "cluster_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "pools", "env", "image", "ingress", "serving_mode", "communications", "model", "served_model_name", "extra_args", "hf_token_ref", "enable_logging", "enable_node_model_cache"] @@ -71,15 +72,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_dynamo')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -91,8 +93,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -121,8 +122,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: @@ -205,7 +205,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "image": DynamoImage.from_dict(obj["image"]) if obj.get("image") is not None else None, "ingress": Ingress.from_dict(obj["ingress"]) if obj.get("ingress") is not None else None, "serving_mode": obj.get("serving_mode"), - "communications": DynamoCommunicationsOutput.from_dict(obj["communications"]) if obj.get("communications") is not None else None, + "communications": DynamoCommunicationsInput.from_dict(obj["communications"]) if obj.get("communications") is not None else None, "model": obj.get("model"), "served_model_name": obj.get("served_model_name"), "extra_args": obj.get("extra_args"), diff --git a/platform_api_python_client/models/unified_get_inference_v3_deployment_response.py b/platform_api_python_client/models/unified_get_inference_v3_deployment_response.py index e7f12f6..478615d 100644 --- a/platform_api_python_client/models/unified_get_inference_v3_deployment_response.py +++ b/platform_api_python_client/models/unified_get_inference_v3_deployment_response.py @@ -31,6 +31,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetInferenceV3DeploymentResponse(BaseModel): """ @@ -49,7 +50,7 @@ class UnifiedGetInferenceV3DeploymentResponse(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclMainPools env: Optional[Env] = None image: Image @@ -58,7 +59,7 @@ class UnifiedGetInferenceV3DeploymentResponse(BaseModel): healthcheck: Optional[StrictStr] = None command: Optional[StrictStr] = None config_file: Optional[ConfigFileMount] = None - hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None + hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Access-token vault item ID for HF_TOKEN.") 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.") metrics: Optional[MetricsConfig] = None enable_logging: Optional[StrictBool] = False @@ -72,15 +73,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_inference')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -92,8 +94,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -122,8 +123,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: diff --git a/platform_api_python_client/models/unified_get_job_deployment_response.py b/platform_api_python_client/models/unified_get_job_deployment_response.py index 7baf305..7398c81 100644 --- a/platform_api_python_client/models/unified_get_job_deployment_response.py +++ b/platform_api_python_client/models/unified_get_job_deployment_response.py @@ -29,6 +29,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedGetJobDeploymentResponse(BaseModel): """ @@ -47,7 +48,7 @@ class UnifiedGetJobDeploymentResponse(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclMainPools env: Optional[Env] = None image: Image @@ -67,15 +68,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_job')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -87,8 +89,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -117,8 +118,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: diff --git a/platform_api_python_client/models/unified_list_deployment_revisions_response.py b/platform_api_python_client/models/unified_list_deployment_revisions_response.py index 8946132..3d4b619 100644 --- a/platform_api_python_client/models/unified_list_deployment_revisions_response.py +++ b/platform_api_python_client/models/unified_list_deployment_revisions_response.py @@ -22,6 +22,7 @@ from platform_api_python_client.models.unified_get_deployment_revision_response import UnifiedGetDeploymentRevisionResponse from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedListDeploymentRevisionsResponse(BaseModel): """ @@ -31,7 +32,8 @@ class UnifiedListDeploymentRevisionsResponse(BaseModel): __properties: ClassVar[List[str]] = ["results"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -43,8 +45,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +74,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.results: for _item_results in self.results: - if _item_results: - _items.append(_item_results.to_dict()) + _items.append(_item_results.to_dict() if _item_results is not None else None) _dict['results'] = _items return _dict diff --git a/platform_api_python_client/models/unified_update_deployment_rollout_request.py b/platform_api_python_client/models/unified_update_deployment_rollout_request.py index e6f83be..d77e257 100644 --- a/platform_api_python_client/models/unified_update_deployment_rollout_request.py +++ b/platform_api_python_client/models/unified_update_deployment_rollout_request.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedUpdateDeploymentRolloutRequest(BaseModel): """ @@ -30,7 +31,8 @@ class UnifiedUpdateDeploymentRolloutRequest(BaseModel): __properties: ClassVar[List[str]] = ["paused"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/unified_write_compute_deployment_request.py b/platform_api_python_client/models/unified_write_compute_deployment_request.py index 64bead4..6876871 100644 --- a/platform_api_python_client/models/unified_write_compute_deployment_request.py +++ b/platform_api_python_client/models/unified_write_compute_deployment_request.py @@ -26,6 +26,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedWriteComputeDeploymentRequest(BaseModel): """ @@ -37,7 +38,7 @@ class UnifiedWriteComputeDeploymentRequest(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclMainPools env: Optional[Env] = None image: Image @@ -52,15 +53,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_compute')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -72,8 +74,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -102,8 +103,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: diff --git a/platform_api_python_client/models/unified_write_deployment_response.py b/platform_api_python_client/models/unified_write_deployment_response.py index 595bbfb..37cc0df 100644 --- a/platform_api_python_client/models/unified_write_deployment_response.py +++ b/platform_api_python_client/models/unified_write_deployment_response.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.deployment_type import DeploymentType from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedWriteDeploymentResponse(BaseModel): """ @@ -37,7 +38,8 @@ class UnifiedWriteDeploymentResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "type", "created_at", "updated_at", "endpoint_url", "port"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -49,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/unified_write_dynamo_deployment_request.py b/platform_api_python_client/models/unified_write_dynamo_deployment_request.py index dc65513..7e45c96 100644 --- a/platform_api_python_client/models/unified_write_dynamo_deployment_request.py +++ b/platform_api_python_client/models/unified_write_dynamo_deployment_request.py @@ -29,6 +29,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedWriteDynamoDeploymentRequest(BaseModel): """ @@ -40,17 +41,17 @@ class UnifiedWriteDynamoDeploymentRequest(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclDynamoPools env: Optional[Env] = None image: Optional[DynamoImage] = None ingress: Ingress serving_mode: Optional[DynamoServingMode] = None - communications: Optional[DynamoCommunicationsInput] = None + communications: Optional[DynamoCommunicationsInput] = Field(default=None, description="Platform-managed worker communications. Only disaggregated KV transfer is supported. Omit or set null to preserve the legacy connector configuration.") model: StrictStr served_model_name: Optional[StrictStr] = None - extra_args: Optional[StrictStr] = None - hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None + extra_args: Optional[StrictStr] = Field(default=None, description="Extra worker CLI arguments as a single shell-style string, split into argv with POSIX shell quoting (shlex). Backslash is an escape character, so `\\` is consumed unless quoted: e.g. `--regex \\d+` reaches the worker as `d+`. Wrap literal backslashes in single quotes (`--regex '\\d+'`). Unbalanced quotes or a trailing backslash are rejected.") + hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Access-token vault item ID for HF_TOKEN.") enable_logging: Optional[StrictBool] = True enable_node_model_cache: Optional[StrictBool] = False __properties: ClassVar[List[str]] = ["type", "name", "cluster_id", "user_annotations", "chart_revision", "volume_mounts", "priority", "pools", "env", "image", "ingress", "serving_mode", "communications", "model", "served_model_name", "extra_args", "hf_token_ref", "enable_logging", "enable_node_model_cache"] @@ -62,15 +63,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_dynamo')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -82,8 +84,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -112,8 +113,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: diff --git a/platform_api_python_client/models/unified_write_inference_v3_deployment_request.py b/platform_api_python_client/models/unified_write_inference_v3_deployment_request.py index 021250d..1eae0b7 100644 --- a/platform_api_python_client/models/unified_write_inference_v3_deployment_request.py +++ b/platform_api_python_client/models/unified_write_inference_v3_deployment_request.py @@ -29,6 +29,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedWriteInferenceV3DeploymentRequest(BaseModel): """ @@ -40,7 +41,7 @@ class UnifiedWriteInferenceV3DeploymentRequest(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclMainPools env: Optional[Env] = None image: Image @@ -49,7 +50,7 @@ class UnifiedWriteInferenceV3DeploymentRequest(BaseModel): healthcheck: Optional[StrictStr] = None command: Optional[StrictStr] = None config_file: Optional[ConfigFileMount] = None - hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = None + hf_token_ref: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Access-token vault item ID for HF_TOKEN.") 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.") metrics: Optional[MetricsConfig] = None enable_logging: Optional[StrictBool] = False @@ -63,15 +64,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_inference')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -83,8 +85,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -113,8 +114,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: diff --git a/platform_api_python_client/models/unified_write_job_deployment_request.py b/platform_api_python_client/models/unified_write_job_deployment_request.py index 23c58d1..f62dbee 100644 --- a/platform_api_python_client/models/unified_write_job_deployment_request.py +++ b/platform_api_python_client/models/unified_write_job_deployment_request.py @@ -27,6 +27,7 @@ from platform_api_python_client.models.volume_mount import VolumeMount from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UnifiedWriteJobDeploymentRequest(BaseModel): """ @@ -38,7 +39,7 @@ class UnifiedWriteJobDeploymentRequest(BaseModel): user_annotations: Optional[Dict[str, StrictStr]] = None chart_revision: Optional[StrictStr] = None volume_mounts: Optional[Annotated[List[VolumeMount], Field(max_length=10)]] = None - priority: Optional[Annotated[str, Field(strict=True, max_length=253)]] = None + 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.") pools: CclMainPools env: Optional[Env] = None image: Image @@ -58,15 +59,16 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('ccl_job')") return value - @field_validator('name') + @field_validator('name', mode="before") def name_validate_regular_expression(cls, value): """Validates the regular expression""" - if not re.match(r"^[a-z][a-z0-9-]*$", value): + if isinstance(value, str) and not re.match(r"^[a-z][a-z0-9-]*$", value): raise ValueError(r"must validate the regular expression /^[a-z][a-z0-9-]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -78,8 +80,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -108,8 +109,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.volume_mounts: for _item_volume_mounts in self.volume_mounts: - if _item_volume_mounts: - _items.append(_item_volume_mounts.to_dict()) + _items.append(_item_volume_mounts.to_dict() if _item_volume_mounts is not None else None) _dict['volume_mounts'] = _items # override the default output from pydantic by calling `to_dict()` of pools if self.pools: diff --git a/platform_api_python_client/models/update_cluster_metadata_request.py b/platform_api_python_client/models/update_cluster_metadata_request.py index 8ce216d..968749f 100644 --- a/platform_api_python_client/models/update_cluster_metadata_request.py +++ b/platform_api_python_client/models/update_cluster_metadata_request.py @@ -21,6 +21,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UpdateClusterMetadataRequest(BaseModel): """ @@ -30,7 +31,8 @@ class UpdateClusterMetadataRequest(BaseModel): __properties: ClassVar[List[str]] = ["deployment_creation_disabled"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -42,8 +44,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/update_deployment_response.py b/platform_api_python_client/models/update_deployment_response.py index c35bc01..1cfeacb 100644 --- a/platform_api_python_client/models/update_deployment_response.py +++ b/platform_api_python_client/models/update_deployment_response.py @@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UpdateDeploymentResponse(BaseModel): """ @@ -33,7 +34,8 @@ class UpdateDeploymentResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "endpoint_url", "updated_at"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/update_deployment_status_v3_request.py b/platform_api_python_client/models/update_deployment_status_v3_request.py index e417229..bc1244f 100644 --- a/platform_api_python_client/models/update_deployment_status_v3_request.py +++ b/platform_api_python_client/models/update_deployment_status_v3_request.py @@ -23,6 +23,7 @@ from platform_api_python_client.models.rollout_status import RolloutStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UpdateDeploymentStatusV3Request(BaseModel): """ @@ -33,7 +34,8 @@ class UpdateDeploymentStatusV3Request(BaseModel): __properties: ClassVar[List[str]] = ["status", "rollout_status"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/update_insight_status_request.py b/platform_api_python_client/models/update_insight_status_request.py index 2242304..ec249de 100644 --- a/platform_api_python_client/models/update_insight_status_request.py +++ b/platform_api_python_client/models/update_insight_status_request.py @@ -23,27 +23,29 @@ from platform_api_python_client.models.insight_status import InsightStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UpdateInsightStatusRequest(BaseModel): """ UpdateInsightStatusRequest """ # noqa: E501 status: InsightStatus - comment: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2000)]] = None + comment: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2000)]] = Field(default=None, description="Why the status changed; kept in the history and shown to reporters") __properties: ClassVar[List[str]] = ["status", "comment"] - @field_validator('comment') + @field_validator('comment', mode="before") def comment_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[^\x00]*$", value): + if isinstance(value, str) and not re.match(r"^[^\x00]*$", value): raise ValueError(r"must validate the regular expression /^[^\x00]*$/") return value model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -55,8 +57,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/update_service_account_request.py b/platform_api_python_client/models/update_service_account_request.py index b65004f..c86d283 100644 --- a/platform_api_python_client/models/update_service_account_request.py +++ b/platform_api_python_client/models/update_service_account_request.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UpdateServiceAccountRequest(BaseModel): """ @@ -33,7 +34,8 @@ class UpdateServiceAccountRequest(BaseModel): __properties: ClassVar[List[str]] = ["name", "description", "scopes"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/upsert_user_vault_item_request.py b/platform_api_python_client/models/upsert_user_vault_item_request.py index 3b552d8..023866c 100644 --- a/platform_api_python_client/models/upsert_user_vault_item_request.py +++ b/platform_api_python_client/models/upsert_user_vault_item_request.py @@ -24,6 +24,7 @@ from platform_api_python_client.models.vault_scope import VaultScope from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UpsertUserVaultItemRequest(BaseModel): """ @@ -37,7 +38,8 @@ class UpsertUserVaultItemRequest(BaseModel): __properties: ClassVar[List[str]] = ["id", "type", "key", "value", "visibility"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -49,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/user_vault_item.py b/platform_api_python_client/models/user_vault_item.py index 5c8e874..b0f1f39 100644 --- a/platform_api_python_client/models/user_vault_item.py +++ b/platform_api_python_client/models/user_vault_item.py @@ -24,6 +24,7 @@ from platform_api_python_client.models.vault_scope import VaultScope from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserVaultItem(BaseModel): """ @@ -37,7 +38,8 @@ class UserVaultItem(BaseModel): __properties: ClassVar[List[str]] = ["id", "type", "key", "value", "visibility"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -49,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/validation_error.py b/platform_api_python_client/models/validation_error.py index d0c2f01..bd32643 100644 --- a/platform_api_python_client/models/validation_error.py +++ b/platform_api_python_client/models/validation_error.py @@ -19,15 +19,16 @@ from pydantic import BaseModel, ConfigDict, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from platform_api_python_client.models.validation_error_loc_inner import ValidationErrorLocInner +from platform_api_python_client.models.location_inner import LocationInner from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ValidationError(BaseModel): """ ValidationError """ # noqa: E501 - loc: List[ValidationErrorLocInner] + loc: List[LocationInner] msg: StrictStr type: StrictStr input: Optional[Any] = None @@ -35,7 +36,8 @@ class ValidationError(BaseModel): __properties: ClassVar[List[str]] = ["loc", "msg", "type", "input", "ctx"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -47,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +78,7 @@ def to_dict(self) -> Dict[str, Any]: _items = [] if self.loc: for _item_loc in self.loc: - if _item_loc: - _items.append(_item_loc.to_dict()) + _items.append(_item_loc.to_dict() if _item_loc is not None else None) _dict['loc'] = _items # set to None if input (nullable) is None # and model_fields_set contains the field @@ -97,7 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "loc": [ValidationErrorLocInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None, + "loc": [LocationInner.from_dict(_item) for _item in obj["loc"]] if obj.get("loc") is not None else None, "msg": obj.get("msg"), "type": obj.get("type"), "input": obj.get("input"), diff --git a/platform_api_python_client/models/volume_mount.py b/platform_api_python_client/models/volume_mount.py index 9d7ec3c..4e281e3 100644 --- a/platform_api_python_client/models/volume_mount.py +++ b/platform_api_python_client/models/volume_mount.py @@ -22,6 +22,7 @@ from typing_extensions import Annotated from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class VolumeMount(BaseModel): """ @@ -33,7 +34,8 @@ class VolumeMount(BaseModel): __properties: ClassVar[List[str]] = ["volume_id", "mount_path", "read_only"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -45,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/models/volume_status_response.py b/platform_api_python_client/models/volume_status_response.py index 24259c7..85099ce 100644 --- a/platform_api_python_client/models/volume_status_response.py +++ b/platform_api_python_client/models/volume_status_response.py @@ -24,6 +24,7 @@ from platform_api_python_client.models.volume_status import VolumeStatus from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class VolumeStatusResponse(BaseModel): """ @@ -37,7 +38,8 @@ class VolumeStatusResponse(BaseModel): __properties: ClassVar[List[str]] = ["id", "backend", "status", "service_status", "error_message"] model_config = ConfigDict( - populate_by_name=True, + validate_by_name=True, + validate_by_alias=True, validate_assignment=True, protected_namespaces=(), ) @@ -49,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: diff --git a/platform_api_python_client/rest.py b/platform_api_python_client/rest.py index 8cbbf58..9349f47 100644 --- a/platform_api_python_client/rest.py +++ b/platform_api_python_client/rest.py @@ -12,10 +12,12 @@ """ # noqa: E501 +import ipaddress import io import json import re import ssl +from urllib.parse import urlparse import urllib3 @@ -34,6 +36,59 @@ def is_socks_proxy_url(url): else: return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES +def contenttype_matches(contenttype, maintype, subtype): + """Matches the given contenttype against the given type and subtype + + :param contenttype: the content type to match + :param maintype: the expected maintype + :param subtype: the expected subtype + :return: `true` when the given content type matches the given type and subtype, + regardless of the presence of mime type parameters, otherwise returns `false`. + :rtype: bool + """ + pattern = '{type}/(?:[^+;]+\\+)?{subtype}(?:[ \t]*;.*)?'.format( + type = re.escape(maintype), + subtype = re.escape(subtype), + ) + return re.fullmatch(pattern, contenttype, re.IGNORECASE) is not None + +def should_bypass_proxies(url: str, no_proxy: str) -> bool: + """Return whether ``url`` matches the comma-separated ``no_proxy`` rules.""" + parsed_url = urlparse(url) + if not parsed_url.hostname: + return True + + host = parsed_url.hostname.lower() + host_and_port = parsed_url.netloc.lower() + try: + host_ip = ipaddress.ip_address(host) + except ValueError: + host_ip = None + + for entry in (entry.strip().lower() for entry in no_proxy.split(',')): + if not entry: + continue + if entry == '*': + return True + + if host_ip is not None: + try: + if host_ip in ipaddress.ip_network(entry, strict=False): + return True + except ValueError: + pass + + entry = entry.lstrip('.') + if ( + host == entry + or host.endswith('.' + entry) + or host_and_port == entry + or host_and_port.endswith('.' + entry) + ): + return True + + return False + class RESTResponse(io.IOBase): @@ -48,12 +103,17 @@ def read(self): self.data = self.response.data return self.data + @property + def headers(self): + """Returns a dictionary of response headers.""" + return self.response.headers + def getheaders(self): - """Returns a dictionary of the response headers.""" + """Returns a dictionary of the response headers; use ``headers`` instead.""" return self.response.headers def getheader(self, name, default=None): - """Returns a given response header.""" + """Returns a given response header; use ``headers.get()`` instead.""" return self.response.headers.get(name, default) @@ -76,6 +136,7 @@ def __init__(self, configuration) -> None: "ca_certs": configuration.ssl_ca_cert, "cert_file": configuration.cert_file, "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, } if configuration.assert_hostname is not None: pool_args['assert_hostname'] = ( @@ -98,7 +159,9 @@ def __init__(self, configuration) -> None: # https pool manager self.pool_manager: urllib3.PoolManager - if configuration.proxy: + if configuration.proxy and not should_bypass_proxies( + configuration.host, configuration.no_proxy or '' + ): if is_socks_proxy_url(configuration.proxy): from urllib3.contrib.socks import SOCKSProxyManager pool_args["proxy_url"] = configuration.proxy @@ -107,6 +170,8 @@ def __init__(self, configuration) -> None: else: pool_args["proxy_url"] = configuration.proxy pool_args["proxy_headers"] = configuration.proxy_headers + if configuration.proxy_ssl_context is not None: + pool_args["proxy_ssl_context"] = configuration.proxy_ssl_context self.pool_manager = urllib3.ProxyManager(**pool_args) else: self.pool_manager = urllib3.PoolManager(**pool_args) @@ -170,12 +235,24 @@ def request( # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # no content type provided or payload is json content_type = headers.get('Content-Type') - if ( + is_json = ( not content_type - or re.search('json', content_type, re.IGNORECASE) - ): + or contenttype_matches(content_type, 'application', 'json') + ) + # JSON is valid YAML 1.2, so structured YAML bodies can use + # the existing JSON serializer: + # https://yaml.org/spec/1.2.2/#13-relation-to-json + is_structured_yaml = ( + content_type + and ( + contenttype_matches(content_type, 'application', 'yaml') + or contenttype_matches(content_type, 'text', 'yaml') + or contenttype_matches(content_type, 'text', 'x-yaml') + ) + and not isinstance(body, (str, bytes)) + ) + if is_json or is_structured_yaml: request_body = None if body is not None: request_body = json.dumps(body) @@ -187,7 +264,7 @@ def request( headers=headers, preload_content=False ) - elif content_type == 'application/x-www-form-urlencoded': + elif contenttype_matches(content_type, 'application', 'x-www-form-urlencoded'): r = self.pool_manager.request( method, url, @@ -197,7 +274,7 @@ def request( headers=headers, preload_content=False ) - elif content_type == 'multipart/form-data': + elif contenttype_matches(content_type, 'multipart', 'form-data'): # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. @@ -225,7 +302,7 @@ def request( headers=headers, preload_content=False ) - elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + elif content_type.startswith('text/') and isinstance(body, bool): request_body = "true" if body else "false" r = self.pool_manager.request( method, diff --git a/pyproject.toml b/pyproject.toml index 5c56a76..2eca55f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,29 +1,33 @@ -[tool.poetry] +[project] name = "platform_api_python_client" -version = "4.37.1" +version = "4.38.0" description = "Platform External API" -authors = ["OpenAPI Generator Community "] -license = "NoLicense" +authors = [ + {name = "OpenAPI Generator Community",email = "team@openapitools.org"}, +] readme = "README.md" -repository = "https://github.com/centml/platform/client" keywords = ["OpenAPI", "OpenAPI-Generator", "Platform External API"] -include = ["platform_api_python_client/py.typed"] +requires-python = ">=3.10" -[tool.poetry.dependencies] -python = "^3.8" +dependencies = [ + "urllib3 (>=2.7.0,<3.0.0)", + "python-dateutil (>=2.8.2)", + "pydantic (>=2.11)", + "typing-extensions (>=4.7.1)", +] -urllib3 = ">= 1.25.3 < 3.0.0" -python-dateutil = ">= 2.8.2" -pydantic = ">= 2" -typing-extensions = ">= 4.7.1" +[project.urls] +Repository = "https://github.com/centml/platform/client" -[tool.poetry.dev-dependencies] -pytest = ">= 7.2.1" -pytest-cov = ">= 2.8.1" -tox = ">= 3.9.0" -flake8 = ">= 4.0.0" -types-python-dateutil = ">= 2.8.19.14" -mypy = ">= 1.5" +[dependency-groups] +dev = [ + "pytest>=9.0.3", + "pytest-cov>=2.8.1", + "tox>=3.9.0", + "flake8>=4.0.0", + "types-python-dateutil>=2.8.19.14", + "mypy>=1.5", +] [build-system] @@ -49,7 +53,7 @@ warn_unused_ignores = true ## Getting these passing should be easy strict_equality = true -strict_concatenate = true +extra_checks = true ## Strongly recommend enabling this one as soon as you can check_untyped_defs = true @@ -70,3 +74,20 @@ disallow_any_generics = true # ### This one can be tricky to get passing if you use a lot of untyped libraries #warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "platform_api_python_client.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/requirements.txt b/requirements.txt index 67f7f68..1d751a9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -urllib3 >= 1.25.3, < 3.0.0 +urllib3 >= 2.7.0, < 3.0.0 python_dateutil >= 2.8.2 -pydantic >= 2 +pydantic >= 2.11 typing-extensions >= 4.7.1 diff --git a/setup.py b/setup.py index c48173c..7fb9ba6 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,3 @@ -# coding: utf-8 - """ Platform External API @@ -21,12 +19,12 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "platform-api-python-client" -VERSION = "4.37.1" -PYTHON_REQUIRES = ">= 3.8" +VERSION = "4.38.0" +PYTHON_REQUIRES = ">= 3.10" REQUIRES = [ - "urllib3 >= 1.25.3, < 3.0.0", + "urllib3 >= 2.7.0, < 3.0.0", "python-dateutil >= 2.8.2", - "pydantic >= 2", + "pydantic >= 2.11", "typing-extensions >= 4.7.1", ] diff --git a/test-requirements.txt b/test-requirements.txt index e98555c..9cb0629 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,4 +1,4 @@ -pytest >= 7.2.1 +pytest >= 9.0.3 pytest-cov >= 2.8.1 tox >= 3.9.0 flake8 >= 4.0.0 diff --git a/test/test_cluster_components.py b/test/test_cluster_components.py index f30f1ee..14bf447 100644 --- a/test/test_cluster_components.py +++ b/test/test_cluster_components.py @@ -37,62 +37,58 @@ def make_instance(self, include_optional) -> ClusterComponents: return ClusterComponents( kube_prometheus_stack = platform_api_python_client.models.kube_prometheus_stack.KubePrometheusStack( enabled = True, - values = platform_api_python_client.models.kube_prometheus_stack_overrides.KubePrometheusStackOverrides(), ), + values = null, ), istio = platform_api_python_client.models.istio.Istio( enabled = True, - values = platform_api_python_client.models.istio_overrides.IstioOverrides( - istio_cni = platform_api_python_client.models.istio_cni_subchart_overrides.IstioCniSubchartOverrides( - cni = platform_api_python_client.models.istio_cni_overrides.IstioCniOverrides( - cni_bin_dir = '', - cni_conf_dir = '', ), ), ), ), + values = null, ), cert_manager = platform_api_python_client.models.cert_manager.CertManager( enabled = True, - values = platform_api_python_client.models.cert_manager_overrides.CertManagerOverrides(), ), + values = null, ), ingress_nginx = platform_api_python_client.models.ingress_nginx.IngressNginx( enabled = True, - values = platform_api_python_client.models.ingress_nginx_overrides.IngressNginxOverrides(), ), + values = null, ), spire_crds = platform_api_python_client.models.spire_crds.SpireCrds( enabled = True, - values = platform_api_python_client.models.spire_crds_overrides.SpireCrdsOverrides(), ), + values = null, ), spire = platform_api_python_client.models.spire.Spire( enabled = True, - values = platform_api_python_client.models.spire_overrides.SpireOverrides(), ), + values = null, ), external_dns = platform_api_python_client.models.external_dns.ExternalDns( enabled = True, - values = platform_api_python_client.models.external_dns_overrides.ExternalDnsOverrides(), ), + values = null, ), prometheus_adapter = platform_api_python_client.models.prometheus_adapter.PrometheusAdapter( enabled = True, - values = platform_api_python_client.models.prometheus_adapter_overrides.PrometheusAdapterOverrides(), ), + values = null, ), keda = platform_api_python_client.models.keda.Keda( enabled = True, - values = platform_api_python_client.models.keda_overrides.KedaOverrides(), ), + values = null, ), fluent_bit = platform_api_python_client.models.fluent_bit.FluentBit( enabled = True, - values = platform_api_python_client.models.fluent_bit_overrides.FluentBitOverrides(), ), + values = null, ), argo_rollouts = platform_api_python_client.models.argo_rollouts.ArgoRollouts( enabled = True, - values = platform_api_python_client.models.argo_rollouts_overrides.ArgoRolloutsOverrides(), ), + values = null, ), network_operator = platform_api_python_client.models.network_operator.NetworkOperator( enabled = True, - values = platform_api_python_client.models.network_operator_overrides.NetworkOperatorOverrides(), ), + values = null, ), opentelemetry_collector = platform_api_python_client.models.opentelemetry_collector.OpentelemetryCollector( enabled = True, - values = platform_api_python_client.models.opentelemetry_collector_overrides.OpentelemetryCollectorOverrides(), ), + values = null, ), gpu_operator = platform_api_python_client.models.gpu_operator.GpuOperator( enabled = True, - values = platform_api_python_client.models.gpu_operator_overrides.GpuOperatorOverrides(), ), + values = null, ), longhorn = platform_api_python_client.models.longhorn.Longhorn( enabled = True, - values = platform_api_python_client.models.longhorn_overrides.LonghornOverrides(), ), + values = null, ), metrics_server = platform_api_python_client.models.metrics_server.MetricsServer( enabled = True, - values = platform_api_python_client.models.metrics_server_overrides.MetricsServerOverrides(), ), + values = null, ), teleport_kube_agent = platform_api_python_client.models.teleport_kube_agent.TeleportKubeAgent( enabled = True, - values = platform_api_python_client.models.teleport_kube_agent_overrides.TeleportKubeAgentOverrides(), ), + values = null, ), final_stack = platform_api_python_client.models.final_stack.FinalStack( enabled = True, - values = platform_api_python_client.models.final_stack_overrides.FinalStackOverrides(), ) + values = null, ) ) else: return ClusterComponents( diff --git a/test/test_cluster_config.py b/test/test_cluster_config.py index 5bd9184..1cdc595 100644 --- a/test/test_cluster_config.py +++ b/test/test_cluster_config.py @@ -38,82 +38,116 @@ def make_instance(self, include_optional) -> ClusterConfig: components = platform_api_python_client.models.cluster_components.ClusterComponents( kube_prometheus_stack = platform_api_python_client.models.kube_prometheus_stack.KubePrometheusStack( enabled = True, - values = platform_api_python_client.models.kube_prometheus_stack_overrides.KubePrometheusStackOverrides(), ), + values = null, ), istio = platform_api_python_client.models.istio.Istio( - enabled = True, ), + enabled = True, + values = null, ), cert_manager = platform_api_python_client.models.cert_manager.CertManager( - enabled = True, ), + enabled = True, + values = null, ), ingress_nginx = platform_api_python_client.models.ingress_nginx.IngressNginx( - enabled = True, ), + enabled = True, + values = null, ), spire_crds = platform_api_python_client.models.spire_crds.SpireCrds( - enabled = True, ), + enabled = True, + values = null, ), spire = platform_api_python_client.models.spire.Spire( - enabled = True, ), + enabled = True, + values = null, ), external_dns = platform_api_python_client.models.external_dns.ExternalDns( - enabled = True, ), + enabled = True, + values = null, ), prometheus_adapter = platform_api_python_client.models.prometheus_adapter.PrometheusAdapter( - enabled = True, ), + enabled = True, + values = null, ), keda = platform_api_python_client.models.keda.Keda( - enabled = True, ), + enabled = True, + values = null, ), fluent_bit = platform_api_python_client.models.fluent_bit.FluentBit( - enabled = True, ), + enabled = True, + values = null, ), argo_rollouts = platform_api_python_client.models.argo_rollouts.ArgoRollouts( - enabled = True, ), + enabled = True, + values = null, ), network_operator = platform_api_python_client.models.network_operator.NetworkOperator( - enabled = True, ), + enabled = True, + values = null, ), opentelemetry_collector = platform_api_python_client.models.opentelemetry_collector.OpentelemetryCollector( - enabled = True, ), + enabled = True, + values = null, ), gpu_operator = platform_api_python_client.models.gpu_operator.GpuOperator( - enabled = True, ), + enabled = True, + values = null, ), longhorn = platform_api_python_client.models.longhorn.Longhorn( - enabled = True, ), + enabled = True, + values = null, ), metrics_server = platform_api_python_client.models.metrics_server.MetricsServer( - enabled = True, ), + enabled = True, + values = null, ), teleport_kube_agent = platform_api_python_client.models.teleport_kube_agent.TeleportKubeAgent( - enabled = True, ), + enabled = True, + values = null, ), final_stack = platform_api_python_client.models.final_stack.FinalStack( - enabled = True, ), ) + enabled = True, + values = null, ), ) ) else: return ClusterConfig( components = platform_api_python_client.models.cluster_components.ClusterComponents( kube_prometheus_stack = platform_api_python_client.models.kube_prometheus_stack.KubePrometheusStack( enabled = True, - values = platform_api_python_client.models.kube_prometheus_stack_overrides.KubePrometheusStackOverrides(), ), + values = null, ), istio = platform_api_python_client.models.istio.Istio( - enabled = True, ), + enabled = True, + values = null, ), cert_manager = platform_api_python_client.models.cert_manager.CertManager( - enabled = True, ), + enabled = True, + values = null, ), ingress_nginx = platform_api_python_client.models.ingress_nginx.IngressNginx( - enabled = True, ), + enabled = True, + values = null, ), spire_crds = platform_api_python_client.models.spire_crds.SpireCrds( - enabled = True, ), + enabled = True, + values = null, ), spire = platform_api_python_client.models.spire.Spire( - enabled = True, ), + enabled = True, + values = null, ), external_dns = platform_api_python_client.models.external_dns.ExternalDns( - enabled = True, ), + enabled = True, + values = null, ), prometheus_adapter = platform_api_python_client.models.prometheus_adapter.PrometheusAdapter( - enabled = True, ), + enabled = True, + values = null, ), keda = platform_api_python_client.models.keda.Keda( - enabled = True, ), + enabled = True, + values = null, ), fluent_bit = platform_api_python_client.models.fluent_bit.FluentBit( - enabled = True, ), + enabled = True, + values = null, ), argo_rollouts = platform_api_python_client.models.argo_rollouts.ArgoRollouts( - enabled = True, ), + enabled = True, + values = null, ), network_operator = platform_api_python_client.models.network_operator.NetworkOperator( - enabled = True, ), + enabled = True, + values = null, ), opentelemetry_collector = platform_api_python_client.models.opentelemetry_collector.OpentelemetryCollector( - enabled = True, ), + enabled = True, + values = null, ), gpu_operator = platform_api_python_client.models.gpu_operator.GpuOperator( - enabled = True, ), + enabled = True, + values = null, ), longhorn = platform_api_python_client.models.longhorn.Longhorn( - enabled = True, ), + enabled = True, + values = null, ), metrics_server = platform_api_python_client.models.metrics_server.MetricsServer( - enabled = True, ), + enabled = True, + values = null, ), teleport_kube_agent = platform_api_python_client.models.teleport_kube_agent.TeleportKubeAgent( - enabled = True, ), + enabled = True, + values = null, ), final_stack = platform_api_python_client.models.final_stack.FinalStack( - enabled = True, ), ), + enabled = True, + values = null, ), ), ) """ diff --git a/test/test_create_dynamo_deployment_request.py b/test/test_create_dynamo_deployment_request.py index 8bb5e64..0d3645e 100644 --- a/test/test_create_dynamo_deployment_request.py +++ b/test/test_create_dynamo_deployment_request.py @@ -53,26 +53,14 @@ def make_instance(self, include_optional) -> CreateDynamoDeploymentRequest: priority = '', serving_mode = 'aggregated', worker_pools = platform_api_python_client.models.dynamo_worker_pools.DynamoWorkerPools( - worker = platform_api_python_client.models.dynamo_worker_pool_config.DynamoWorkerPoolConfig( - hardware_instance_id = 56, - replicas = 1.0, - min_replicas = 0.0, - max_replicas = 1.0, - concurrency = 1.0, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.dynamo_worker_pool_config.DynamoWorkerPoolConfig( - hardware_instance_id = 56, - replicas = 1.0, - min_replicas = 0.0, - max_replicas = 1.0, - concurrency = 1.0, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), communications = platform_api_python_client.models.dynamo_communications.DynamoCommunications( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), ), + policy = null, ), ), weight_transfer = platform_api_python_client.models.dynamo_weight_transfer_configuration.DynamoWeightTransferConfiguration( - policy = 'require_gpu_direct_rdma', ), + policy = null, ), model = '', model_revision = '0', served_model_name = '', @@ -94,7 +82,10 @@ def make_instance(self, include_optional) -> CreateDynamoDeploymentRequest: image_pull_ref = 1.0, enable_logging = True, enable_node_model_cache = True, - backend_protocol = 'HTTP' + backend_protocol = 'HTTP', + frontend = platform_api_python_client.models.dynamo_frontend_config.DynamoFrontendConfig( + min_replicas = 1.0, + max_replicas = 1.0, ) ) else: return CreateDynamoDeploymentRequest( diff --git a/test/test_deployment_response.py b/test/test_deployment_response.py index 24ff741..8313cb8 100644 --- a/test/test_deployment_response.py +++ b/test/test_deployment_response.py @@ -60,26 +60,14 @@ def make_instance(self, include_optional) -> DeploymentResponse: hf_token_ref = 1.0, serving_mode = 'aggregated', worker_pools = platform_api_python_client.models.dynamo_worker_pools.DynamoWorkerPools( - worker = platform_api_python_client.models.dynamo_worker_pool_config.DynamoWorkerPoolConfig( - hardware_instance_id = 56, - replicas = 1.0, - min_replicas = 0.0, - max_replicas = 1.0, - concurrency = 1.0, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.dynamo_worker_pool_config.DynamoWorkerPoolConfig( - hardware_instance_id = 56, - replicas = 1.0, - min_replicas = 0.0, - max_replicas = 1.0, - concurrency = 1.0, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), communications = platform_api_python_client.models.dynamo_communications.DynamoCommunications( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), ), + policy = null, ), ), weight_transfer = platform_api_python_client.models.dynamo_weight_transfer_configuration.DynamoWeightTransferConfiguration( - policy = 'require_gpu_direct_rdma', ), + policy = null, ), model = '', model_revision = '', served_model_name = '', @@ -100,6 +88,9 @@ def make_instance(self, include_optional) -> DeploymentResponse: enable_logging = True, enable_node_model_cache = True, backend_protocol = 'HTTP', + frontend = platform_api_python_client.models.dynamo_frontend_config.DynamoFrontendConfig( + min_replicas = 1.0, + max_replicas = 1.0, ), container_port = 56, healthcheck = '', command = [ diff --git a/test/test_deployment_status_v3_response.py b/test/test_deployment_status_v3_response.py index b707f0b..8bc9536 100644 --- a/test/test_deployment_status_v3_response.py +++ b/test/test_deployment_status_v3_response.py @@ -48,7 +48,7 @@ def make_instance(self, include_optional) -> DeploymentStatusV3Response: platform_api_python_client.models.pod_details.PodDetails( name = '', revision_number = 56, - component_type = 'user-container', + component_type = null, status = 'ScalingUp', error_message = '', ) ], diff --git a/test/test_dynamo_communications_input.py b/test/test_dynamo_communications_input.py index 8de64be..8359699 100644 --- a/test/test_dynamo_communications_input.py +++ b/test/test_dynamo_communications_input.py @@ -36,12 +36,12 @@ def make_instance(self, include_optional) -> DynamoCommunicationsInput: if include_optional: return DynamoCommunicationsInput( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ) + policy = null, ) ) else: return DynamoCommunicationsInput( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), + policy = null, ), ) """ diff --git a/test/test_dynamo_communications_output.py b/test/test_dynamo_communications_output.py deleted file mode 100644 index 35f500c..0000000 --- a/test/test_dynamo_communications_output.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Platform External API - - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - The version of the OpenAPI document: 0.1.0 - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from platform_api_python_client.models.dynamo_communications_output import DynamoCommunicationsOutput - -class TestDynamoCommunicationsOutput(unittest.TestCase): - """DynamoCommunicationsOutput unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> DynamoCommunicationsOutput: - """Test DynamoCommunicationsOutput - include_optional is a boolean, when False only required - params are included, when True both required and - optional params are included """ - # uncomment below to create an instance of `DynamoCommunicationsOutput` - """ - model = DynamoCommunicationsOutput() - if include_optional: - return DynamoCommunicationsOutput( - kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ) - ) - else: - return DynamoCommunicationsOutput( - kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), - ) - """ - - def testDynamoCommunicationsOutput(self): - """Test DynamoCommunicationsOutput""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_dynamo_frontend_config.py b/test/test_dynamo_frontend_config.py new file mode 100644 index 0000000..22b5c08 --- /dev/null +++ b/test/test_dynamo_frontend_config.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Platform External API + + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + The version of the OpenAPI document: 0.1.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from platform_api_python_client.models.dynamo_frontend_config import DynamoFrontendConfig + +class TestDynamoFrontendConfig(unittest.TestCase): + """DynamoFrontendConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DynamoFrontendConfig: + """Test DynamoFrontendConfig + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `DynamoFrontendConfig` + """ + model = DynamoFrontendConfig() + if include_optional: + return DynamoFrontendConfig( + min_replicas = 1.0, + max_replicas = 1.0 + ) + else: + return DynamoFrontendConfig( + ) + """ + + def testDynamoFrontendConfig(self): + """Test DynamoFrontendConfig""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_deployment_log_response.py b/test/test_get_deployment_log_response.py index afbb0e4..7aa764b 100644 --- a/test/test_get_deployment_log_response.py +++ b/test/test_get_deployment_log_response.py @@ -36,14 +36,14 @@ def make_instance(self, include_optional) -> GetDeploymentLogResponse: if include_optional: return GetDeploymentLogResponse( events = [ - None + { } ], next_page_token = '' ) else: return GetDeploymentLogResponse( events = [ - None + { } ], ) """ diff --git a/test/test_get_dynamo_deployment_response.py b/test/test_get_dynamo_deployment_response.py index 94ad72f..51b3e7a 100644 --- a/test/test_get_dynamo_deployment_response.py +++ b/test/test_get_dynamo_deployment_response.py @@ -60,26 +60,14 @@ def make_instance(self, include_optional) -> GetDynamoDeploymentResponse: hf_token_ref = 1.0, serving_mode = 'aggregated', worker_pools = platform_api_python_client.models.dynamo_worker_pools.DynamoWorkerPools( - worker = platform_api_python_client.models.dynamo_worker_pool_config.DynamoWorkerPoolConfig( - hardware_instance_id = 56, - replicas = 1.0, - min_replicas = 0.0, - max_replicas = 1.0, - concurrency = 1.0, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.dynamo_worker_pool_config.DynamoWorkerPoolConfig( - hardware_instance_id = 56, - replicas = 1.0, - min_replicas = 0.0, - max_replicas = 1.0, - concurrency = 1.0, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), communications = platform_api_python_client.models.dynamo_communications.DynamoCommunications( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), ), + policy = null, ), ), weight_transfer = platform_api_python_client.models.dynamo_weight_transfer_configuration.DynamoWeightTransferConfiguration( - policy = 'require_gpu_direct_rdma', ), + policy = null, ), model = '', model_revision = '', served_model_name = '', @@ -99,7 +87,10 @@ def make_instance(self, include_optional) -> GetDynamoDeploymentResponse: image_pull_ref = 1.0, enable_logging = True, enable_node_model_cache = True, - backend_protocol = 'HTTP' + backend_protocol = 'HTTP', + frontend = platform_api_python_client.models.dynamo_frontend_config.DynamoFrontendConfig( + min_replicas = 1.0, + max_replicas = 1.0, ) ) else: return GetDynamoDeploymentResponse( diff --git a/test/test_istio.py b/test/test_istio.py index 4ea8553..aa48216 100644 --- a/test/test_istio.py +++ b/test/test_istio.py @@ -37,10 +37,7 @@ def make_instance(self, include_optional) -> Istio: return Istio( enabled = True, values = platform_api_python_client.models.istio_overrides.IstioOverrides( - istio_cni = platform_api_python_client.models.istio_cni_subchart_overrides.IstioCniSubchartOverrides( - cni = platform_api_python_client.models.istio_cni_overrides.IstioCniOverrides( - cni_bin_dir = '', - cni_conf_dir = '', ), ), ) + istio_cni = null, ) ) else: return Istio( diff --git a/test/test_istio_overrides.py b/test/test_istio_overrides.py index aa9b3ea..5b95281 100644 --- a/test/test_istio_overrides.py +++ b/test/test_istio_overrides.py @@ -36,9 +36,7 @@ def make_instance(self, include_optional) -> IstioOverrides: if include_optional: return IstioOverrides( istio_cni = platform_api_python_client.models.istio_cni_subchart_overrides.IstioCniSubchartOverrides( - cni = platform_api_python_client.models.istio_cni_overrides.IstioCniOverrides( - cni_bin_dir = '', - cni_conf_dir = '', ), ) + cni = null, ) ) else: return IstioOverrides( diff --git a/test/test_list_user_vault_items_response.py b/test/test_list_user_vault_items_response.py index 8df8343..c2907fb 100644 --- a/test/test_list_user_vault_items_response.py +++ b/test/test_list_user_vault_items_response.py @@ -41,7 +41,7 @@ def make_instance(self, include_optional) -> ListUserVaultItemsResponse: type = 'env_vars', key = '', value = '', - visibility = 'USER', ) + visibility = null, ) ] ) else: @@ -52,7 +52,7 @@ def make_instance(self, include_optional) -> ListUserVaultItemsResponse: type = 'env_vars', key = '', value = '', - visibility = 'USER', ) + visibility = null, ) ], ) """ diff --git a/test/test_validation_error_loc_inner.py b/test/test_location_inner.py similarity index 59% rename from test/test_validation_error_loc_inner.py rename to test/test_location_inner.py index cda1710..4ac5a8c 100644 --- a/test/test_validation_error_loc_inner.py +++ b/test/test_location_inner.py @@ -14,10 +14,10 @@ import unittest -from platform_api_python_client.models.validation_error_loc_inner import ValidationErrorLocInner +from platform_api_python_client.models.location_inner import LocationInner -class TestValidationErrorLocInner(unittest.TestCase): - """ValidationErrorLocInner unit test stubs""" +class TestLocationInner(unittest.TestCase): + """LocationInner unit test stubs""" def setUp(self): pass @@ -25,24 +25,24 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional) -> ValidationErrorLocInner: - """Test ValidationErrorLocInner + def make_instance(self, include_optional) -> LocationInner: + """Test LocationInner include_optional is a boolean, when False only required params are included, when True both required and optional params are included """ - # uncomment below to create an instance of `ValidationErrorLocInner` + # uncomment below to create an instance of `LocationInner` """ - model = ValidationErrorLocInner() + model = LocationInner() if include_optional: - return ValidationErrorLocInner( + return LocationInner( ) else: - return ValidationErrorLocInner( + return LocationInner( ) """ - def testValidationErrorLocInner(self): - """Test ValidationErrorLocInner""" + def testLocationInner(self): + """Test LocationInner""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) diff --git a/test/test_revision_pod_details.py b/test/test_revision_pod_details.py index c984708..e40d9f6 100644 --- a/test/test_revision_pod_details.py +++ b/test/test_revision_pod_details.py @@ -41,7 +41,7 @@ def make_instance(self, include_optional) -> RevisionPodDetails: platform_api_python_client.models.pod_details.PodDetails( name = '', revision_number = 56, - component_type = 'user-container', + component_type = null, status = 'ScalingUp', error_message = '', ) ], diff --git a/test/test_unified_get_deployment_response.py b/test/test_unified_get_deployment_response.py index 8da30b9..56fa190 100644 --- a/test/test_unified_get_deployment_response.py +++ b/test/test_unified_get_deployment_response.py @@ -57,19 +57,9 @@ def make_instance(self, include_optional) -> UnifiedGetDeploymentResponse: ], priority = '', pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), env = platform_api_python_client.models.env.Env( vars = { 'key' : '' @@ -82,7 +72,7 @@ def make_instance(self, include_optional) -> UnifiedGetDeploymentResponse: enable_logging = True, exposed_port = 56, ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0, @@ -105,7 +95,7 @@ def make_instance(self, include_optional) -> UnifiedGetDeploymentResponse: serving_mode = 'aggregated', communications = platform_api_python_client.models.dynamo_communications.DynamoCommunications( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), ), + policy = null, ), ), model = '', served_model_name = '', extra_args = '' @@ -123,26 +113,16 @@ def make_instance(self, include_optional) -> UnifiedGetDeploymentResponse: name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', cluster_id = 56, pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), image = platform_api_python_client.models.dynamo_image.DynamoImage( runtime_version = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L', pull_ref = 1.0, ), ssh_public_key = '0', exposed_port = 56, ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0, diff --git a/test/test_unified_get_dynamo_deployment_response.py b/test/test_unified_get_dynamo_deployment_response.py index 462bcff..95dc8d1 100644 --- a/test/test_unified_get_dynamo_deployment_response.py +++ b/test/test_unified_get_dynamo_deployment_response.py @@ -57,19 +57,9 @@ def make_instance(self, include_optional) -> UnifiedGetDynamoDeploymentResponse: ], priority = '', pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), env = platform_api_python_client.models.env.Env( vars = { 'key' : '' @@ -79,13 +69,13 @@ def make_instance(self, include_optional) -> UnifiedGetDynamoDeploymentResponse: runtime_version = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L', pull_ref = 1.0, ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), serving_mode = 'aggregated', communications = platform_api_python_client.models.dynamo_communications.DynamoCommunications( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), ), + policy = null, ), ), model = '', served_model_name = '', extra_args = '', @@ -106,21 +96,11 @@ def make_instance(self, include_optional) -> UnifiedGetDynamoDeploymentResponse: name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', cluster_id = 56, pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), model = '', diff --git a/test/test_unified_get_inference_v3_deployment_response.py b/test/test_unified_get_inference_v3_deployment_response.py index a7ba339..be3f419 100644 --- a/test/test_unified_get_inference_v3_deployment_response.py +++ b/test/test_unified_get_inference_v3_deployment_response.py @@ -73,7 +73,7 @@ def make_instance(self, include_optional) -> UnifiedGetInferenceV3DeploymentResp pull_ref = 1.0, pull_secret_name = 'w1c2v7s6djuy1zmetozkhdomha1bae37b8ocvx8o53ow2eg7p6qw9qklp6l4y010fogx.mjvnh6nzn2yp6d7tmo7zxedi-pkbmhcbu-4d4ncp9sp-gpju7f9r1ly-n2jyba-zuswj171d3kxld4uyykb66fgvcwlw.s.p6div96l1hmssf5by0949ps5we2h1m5s.4.7ftu50o3hq25-ctix-xt8fyuzw85-6ya.ezgfzdm4groy.ccn4nxdzyngfr2bsdqi-90qr77qnqf26kpzuf5a652r9yc8wgc.uoko8ht4bjsb-86ca0gq8ejs584qp107f5qv9ze3gk7q64-5mecujmelufynb1wtb8v2n1x9-y9o36a.uqixpalso4ehay1yebs1kiembt-homr2.864bew-vpjuuty7-xv4qjygg3hwqd-5gynywalvhvvesyveyxp35spjahpsiagrj0jehh3a3x8z9axqtswj383252z.d6d4ifob3rgi7j1fao-vb9l55lz.bsk1mqype9zx3n6q-u55t879v1lf.1.k.isf-swgdlh.0.m4u5aoqakjc4xlcmbpoy4ndizk4s3cdhxttexawd8mnl6e4uzxalowdqy9rokd32ct-w5p-yt-emwrzfi.lulqkw0osnqktff9fp6xbt97440w4wt3xjayovyb7flljlnosgtrofp.o.j.p5-2p577rg1fwny6cq1e2d3p5aa62rscqk6cxzeqcrvjnbqd52lumjr3qda19c-7skjef4ovphp57sme4j.v.ex0xp4ft9xd1-4zvmus0m5p.v0h-jlvu47xor814uas43gvg7px7mohsvz1n3b561az73nipt-so37iphbtnhmw48ibn.m.bk41trymo7d0ea3vl3k8vn3ygn2a7ps3-pdkhjjxrdr3lz6urrzqtzh9wngf-95dvz5km9h9e5j8vg6kx1nnqzi442akggqdhy6.i.gupb4cz72xp4qgqp5jsd55qux2vq83uq1j9iy-qb4bt8kb625gpncppm1zw5yrhj.5q6soeyc3hzdpj1thb.b.b5xq79rwp3km1p11ikuwgghy12wdp5xrrsyrsnl7yjolek10nb0oh.h.x.2h707s1vjswprq6au.xucdr85u0erh5dfg2hvs9u7vn0y8ci0w5cs0m66nvcce2fr52dkbd9-7klkniu5cpn6qugmep5e6p9gx9creyetm.2sgithzei3bx4-4ox6m2aiffxmcwza92oxtwxs76a.s.z.im-3mvtf47ak-ld.a.2elgcf13ovinqusgnnclaaotmbqdseafe1dkj6zg4q-zexx0zm-n.j3-w17r6rxur1pbea75jjl8lv5xitcozp.c.h.61bftab5cre-v.9.v.s.fyenvbtf508c5c3k.mghqe7lyva958ar2bzuf2507k602lnujv0ps2icyh27nxstaqbg38m0hpe.g.bg8n69rdva8j104ap-cf1p9yc1ijk9np17sjmh2tukz4atwz0044pdhk9pk1eft1nod0p9-vepbljhwtpf-qd2ysm1.3tiane3jk-09bf0q3dbgqocrp16dzj0xk-uyej17sd81mbgu820re53g21e779vy6.z.rm8pn0xdthfd9cqpo9sslxeml661r0eol4jypf6mdna86sfgz92k.y-52xiufg9mfli1bjvsy947g3cz7wufbd001uiwvuaxblt37i0ah0z6f6qhqwar1c3r14v-vt3pd5kbrrs94okiob2jznknec6ky.3.d.dgp-oapce410llsnx-m--ufb725icarr8pijimdu9gxv3p7744x7btxc9-zq66zjny7rvcbdfcl-7ksv-awu1ddn3dlag.1cg4obm9r3waeqrdsk53.1.q.k.w.gz5qwr2rjf1o2625v873inyqekdlul-2yu96dhuposmz433w4216crklr6.5ifmkesrrzj9hbtdyamuoxl0l1gb0vgsms5ou3nfhhnvvfktn2uyclzyqvy90vz11a6oipnv4tno7.z.t.u4pfk1y-f41a9ekyw5sfqgxxg2436imo6t94jmeph0msaf6p04q5p6z75n97ibih9ynp9w52m2.7bh985by7-jms7z9rzl84e9iub-3gwwq4fe81bi2bmela-4-ti6-mqq-em0m73ls976osz80kxxj.x.jxe4zxgit8guso2bynf9xkxywffvyznse5yovoes9zqhgf9wk74po4qj1hri4b.06kv2f-9nff.ejas130ndgnxp85h0saokre-wcp8nl4iio.g.z8c-0hnu2tn0fal1tsn8phrmhzoys2l25i7fgxqn8.w.w.z0', ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0, @@ -115,7 +115,7 @@ def make_instance(self, include_optional) -> UnifiedGetInferenceV3DeploymentResp pull_ref = 1.0, pull_secret_name = 'w1c2v7s6djuy1zmetozkhdomha1bae37b8ocvx8o53ow2eg7p6qw9qklp6l4y010fogx.mjvnh6nzn2yp6d7tmo7zxedi-pkbmhcbu-4d4ncp9sp-gpju7f9r1ly-n2jyba-zuswj171d3kxld4uyykb66fgvcwlw.s.p6div96l1hmssf5by0949ps5we2h1m5s.4.7ftu50o3hq25-ctix-xt8fyuzw85-6ya.ezgfzdm4groy.ccn4nxdzyngfr2bsdqi-90qr77qnqf26kpzuf5a652r9yc8wgc.uoko8ht4bjsb-86ca0gq8ejs584qp107f5qv9ze3gk7q64-5mecujmelufynb1wtb8v2n1x9-y9o36a.uqixpalso4ehay1yebs1kiembt-homr2.864bew-vpjuuty7-xv4qjygg3hwqd-5gynywalvhvvesyveyxp35spjahpsiagrj0jehh3a3x8z9axqtswj383252z.d6d4ifob3rgi7j1fao-vb9l55lz.bsk1mqype9zx3n6q-u55t879v1lf.1.k.isf-swgdlh.0.m4u5aoqakjc4xlcmbpoy4ndizk4s3cdhxttexawd8mnl6e4uzxalowdqy9rokd32ct-w5p-yt-emwrzfi.lulqkw0osnqktff9fp6xbt97440w4wt3xjayovyb7flljlnosgtrofp.o.j.p5-2p577rg1fwny6cq1e2d3p5aa62rscqk6cxzeqcrvjnbqd52lumjr3qda19c-7skjef4ovphp57sme4j.v.ex0xp4ft9xd1-4zvmus0m5p.v0h-jlvu47xor814uas43gvg7px7mohsvz1n3b561az73nipt-so37iphbtnhmw48ibn.m.bk41trymo7d0ea3vl3k8vn3ygn2a7ps3-pdkhjjxrdr3lz6urrzqtzh9wngf-95dvz5km9h9e5j8vg6kx1nnqzi442akggqdhy6.i.gupb4cz72xp4qgqp5jsd55qux2vq83uq1j9iy-qb4bt8kb625gpncppm1zw5yrhj.5q6soeyc3hzdpj1thb.b.b5xq79rwp3km1p11ikuwgghy12wdp5xrrsyrsnl7yjolek10nb0oh.h.x.2h707s1vjswprq6au.xucdr85u0erh5dfg2hvs9u7vn0y8ci0w5cs0m66nvcce2fr52dkbd9-7klkniu5cpn6qugmep5e6p9gx9creyetm.2sgithzei3bx4-4ox6m2aiffxmcwza92oxtwxs76a.s.z.im-3mvtf47ak-ld.a.2elgcf13ovinqusgnnclaaotmbqdseafe1dkj6zg4q-zexx0zm-n.j3-w17r6rxur1pbea75jjl8lv5xitcozp.c.h.61bftab5cre-v.9.v.s.fyenvbtf508c5c3k.mghqe7lyva958ar2bzuf2507k602lnujv0ps2icyh27nxstaqbg38m0hpe.g.bg8n69rdva8j104ap-cf1p9yc1ijk9np17sjmh2tukz4atwz0044pdhk9pk1eft1nod0p9-vepbljhwtpf-qd2ysm1.3tiane3jk-09bf0q3dbgqocrp16dzj0xk-uyej17sd81mbgu820re53g21e779vy6.z.rm8pn0xdthfd9cqpo9sslxeml661r0eol4jypf6mdna86sfgz92k.y-52xiufg9mfli1bjvsy947g3cz7wufbd001uiwvuaxblt37i0ah0z6f6qhqwar1c3r14v-vt3pd5kbrrs94okiob2jznknec6ky.3.d.dgp-oapce410llsnx-m--ufb725icarr8pijimdu9gxv3p7744x7btxc9-zq66zjny7rvcbdfcl-7ksv-awu1ddn3dlag.1cg4obm9r3waeqrdsk53.1.q.k.w.gz5qwr2rjf1o2625v873inyqekdlul-2yu96dhuposmz433w4216crklr6.5ifmkesrrzj9hbtdyamuoxl0l1gb0vgsms5ou3nfhhnvvfktn2uyclzyqvy90vz11a6oipnv4tno7.z.t.u4pfk1y-f41a9ekyw5sfqgxxg2436imo6t94jmeph0msaf6p04q5p6z75n97ibih9ynp9w52m2.7bh985by7-jms7z9rzl84e9iub-3gwwq4fe81bi2bmela-4-ti6-mqq-em0m73ls976osz80kxxj.x.jxe4zxgit8guso2bynf9xkxywffvyznse5yovoes9zqhgf9wk74po4qj1hri4b.06kv2f-9nff.ejas130ndgnxp85h0saokre-wcp8nl4iio.g.z8c-0hnu2tn0fal1tsn8phrmhzoys2l25i7fgxqn8.w.w.z0', ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0, diff --git a/test/test_unified_write_deployment_request.py b/test/test_unified_write_deployment_request.py index fcdacaa..6d71292 100644 --- a/test/test_unified_write_deployment_request.py +++ b/test/test_unified_write_deployment_request.py @@ -50,19 +50,9 @@ def make_instance(self, include_optional) -> UnifiedWriteDeploymentRequest: ], priority = '', pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), env = platform_api_python_client.models.env.Env( vars = { 'key' : '' @@ -74,7 +64,7 @@ def make_instance(self, include_optional) -> UnifiedWriteDeploymentRequest: ssh_public_key = '0', enable_logging = True, ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0, @@ -97,7 +87,7 @@ def make_instance(self, include_optional) -> UnifiedWriteDeploymentRequest: serving_mode = 'aggregated', communications = platform_api_python_client.models.dynamo_communications.DynamoCommunications( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), ), + policy = null, ), ), model = '', served_model_name = '', extra_args = '' @@ -108,25 +98,15 @@ def make_instance(self, include_optional) -> UnifiedWriteDeploymentRequest: name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', cluster_id = 56, pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), image = platform_api_python_client.models.dynamo_image.DynamoImage( runtime_version = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L', pull_ref = 1.0, ), ssh_public_key = '0', ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0, diff --git a/test/test_unified_write_dynamo_deployment_request.py b/test/test_unified_write_dynamo_deployment_request.py index 265eebd..6356d60 100644 --- a/test/test_unified_write_dynamo_deployment_request.py +++ b/test/test_unified_write_dynamo_deployment_request.py @@ -50,19 +50,9 @@ def make_instance(self, include_optional) -> UnifiedWriteDynamoDeploymentRequest ], priority = '', pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), env = platform_api_python_client.models.env.Env( vars = { 'key' : '' @@ -72,13 +62,13 @@ def make_instance(self, include_optional) -> UnifiedWriteDynamoDeploymentRequest runtime_version = 'e6bUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awxoFZxHzs6ED.kjUSnTINkYPUndNl8pmPg5K897Fu1JEFj9R1_dz9rEoBi0L', pull_ref = 1.0, ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), serving_mode = 'aggregated', communications = platform_api_python_client.models.dynamo_communications.DynamoCommunications( kv_transfer = platform_api_python_client.models.dynamo_kv_transfer_configuration.DynamoKvTransferConfiguration( - policy = 'allow_tcp', ), ), + policy = null, ), ), model = '', served_model_name = '', extra_args = '', @@ -92,21 +82,11 @@ def make_instance(self, include_optional) -> UnifiedWriteDynamoDeploymentRequest name = 'ar1c2v7s6djuy1zmetozkhdomha1b0', cluster_id = 56, pools = platform_api_python_client.models.ccl_dynamo_pools.CclDynamoPools( - worker = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - prefill = platform_api_python_client.models.pool.Pool( - hardware_instance_id = 56, - min_replicas = 56, - max_replicas = 56, - concurrency = 56, - cooldown_period = 0.0, ), - decode = , ), + worker = null, + prefill = null, + decode = null, ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), model = '', diff --git a/test/test_unified_write_inference_v3_deployment_request.py b/test/test_unified_write_inference_v3_deployment_request.py index c5a60ad..11e8e52 100644 --- a/test/test_unified_write_inference_v3_deployment_request.py +++ b/test/test_unified_write_inference_v3_deployment_request.py @@ -66,7 +66,7 @@ def make_instance(self, include_optional) -> UnifiedWriteInferenceV3DeploymentRe pull_ref = 1.0, pull_secret_name = 'w1c2v7s6djuy1zmetozkhdomha1bae37b8ocvx8o53ow2eg7p6qw9qklp6l4y010fogx.mjvnh6nzn2yp6d7tmo7zxedi-pkbmhcbu-4d4ncp9sp-gpju7f9r1ly-n2jyba-zuswj171d3kxld4uyykb66fgvcwlw.s.p6div96l1hmssf5by0949ps5we2h1m5s.4.7ftu50o3hq25-ctix-xt8fyuzw85-6ya.ezgfzdm4groy.ccn4nxdzyngfr2bsdqi-90qr77qnqf26kpzuf5a652r9yc8wgc.uoko8ht4bjsb-86ca0gq8ejs584qp107f5qv9ze3gk7q64-5mecujmelufynb1wtb8v2n1x9-y9o36a.uqixpalso4ehay1yebs1kiembt-homr2.864bew-vpjuuty7-xv4qjygg3hwqd-5gynywalvhvvesyveyxp35spjahpsiagrj0jehh3a3x8z9axqtswj383252z.d6d4ifob3rgi7j1fao-vb9l55lz.bsk1mqype9zx3n6q-u55t879v1lf.1.k.isf-swgdlh.0.m4u5aoqakjc4xlcmbpoy4ndizk4s3cdhxttexawd8mnl6e4uzxalowdqy9rokd32ct-w5p-yt-emwrzfi.lulqkw0osnqktff9fp6xbt97440w4wt3xjayovyb7flljlnosgtrofp.o.j.p5-2p577rg1fwny6cq1e2d3p5aa62rscqk6cxzeqcrvjnbqd52lumjr3qda19c-7skjef4ovphp57sme4j.v.ex0xp4ft9xd1-4zvmus0m5p.v0h-jlvu47xor814uas43gvg7px7mohsvz1n3b561az73nipt-so37iphbtnhmw48ibn.m.bk41trymo7d0ea3vl3k8vn3ygn2a7ps3-pdkhjjxrdr3lz6urrzqtzh9wngf-95dvz5km9h9e5j8vg6kx1nnqzi442akggqdhy6.i.gupb4cz72xp4qgqp5jsd55qux2vq83uq1j9iy-qb4bt8kb625gpncppm1zw5yrhj.5q6soeyc3hzdpj1thb.b.b5xq79rwp3km1p11ikuwgghy12wdp5xrrsyrsnl7yjolek10nb0oh.h.x.2h707s1vjswprq6au.xucdr85u0erh5dfg2hvs9u7vn0y8ci0w5cs0m66nvcce2fr52dkbd9-7klkniu5cpn6qugmep5e6p9gx9creyetm.2sgithzei3bx4-4ox6m2aiffxmcwza92oxtwxs76a.s.z.im-3mvtf47ak-ld.a.2elgcf13ovinqusgnnclaaotmbqdseafe1dkj6zg4q-zexx0zm-n.j3-w17r6rxur1pbea75jjl8lv5xitcozp.c.h.61bftab5cre-v.9.v.s.fyenvbtf508c5c3k.mghqe7lyva958ar2bzuf2507k602lnujv0ps2icyh27nxstaqbg38m0hpe.g.bg8n69rdva8j104ap-cf1p9yc1ijk9np17sjmh2tukz4atwz0044pdhk9pk1eft1nod0p9-vepbljhwtpf-qd2ysm1.3tiane3jk-09bf0q3dbgqocrp16dzj0xk-uyej17sd81mbgu820re53g21e779vy6.z.rm8pn0xdthfd9cqpo9sslxeml661r0eol4jypf6mdna86sfgz92k.y-52xiufg9mfli1bjvsy947g3cz7wufbd001uiwvuaxblt37i0ah0z6f6qhqwar1c3r14v-vt3pd5kbrrs94okiob2jznknec6ky.3.d.dgp-oapce410llsnx-m--ufb725icarr8pijimdu9gxv3p7744x7btxc9-zq66zjny7rvcbdfcl-7ksv-awu1ddn3dlag.1cg4obm9r3waeqrdsk53.1.q.k.w.gz5qwr2rjf1o2625v873inyqekdlul-2yu96dhuposmz433w4216crklr6.5ifmkesrrzj9hbtdyamuoxl0l1gb0vgsms5ou3nfhhnvvfktn2uyclzyqvy90vz11a6oipnv4tno7.z.t.u4pfk1y-f41a9ekyw5sfqgxxg2436imo6t94jmeph0msaf6p04q5p6z75n97ibih9ynp9w52m2.7bh985by7-jms7z9rzl84e9iub-3gwwq4fe81bi2bmela-4-ti6-mqq-em0m73ls976osz80kxxj.x.jxe4zxgit8guso2bynf9xkxywffvyznse5yovoes9zqhgf9wk74po4qj1hri4b.06kv2f-9nff.ejas130ndgnxp85h0saokre-wcp8nl4iio.g.z8c-0hnu2tn0fal1tsn8phrmhzoys2l25i7fgxqn8.w.w.z0', ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0, @@ -101,7 +101,7 @@ def make_instance(self, include_optional) -> UnifiedWriteInferenceV3DeploymentRe pull_ref = 1.0, pull_secret_name = 'w1c2v7s6djuy1zmetozkhdomha1bae37b8ocvx8o53ow2eg7p6qw9qklp6l4y010fogx.mjvnh6nzn2yp6d7tmo7zxedi-pkbmhcbu-4d4ncp9sp-gpju7f9r1ly-n2jyba-zuswj171d3kxld4uyykb66fgvcwlw.s.p6div96l1hmssf5by0949ps5we2h1m5s.4.7ftu50o3hq25-ctix-xt8fyuzw85-6ya.ezgfzdm4groy.ccn4nxdzyngfr2bsdqi-90qr77qnqf26kpzuf5a652r9yc8wgc.uoko8ht4bjsb-86ca0gq8ejs584qp107f5qv9ze3gk7q64-5mecujmelufynb1wtb8v2n1x9-y9o36a.uqixpalso4ehay1yebs1kiembt-homr2.864bew-vpjuuty7-xv4qjygg3hwqd-5gynywalvhvvesyveyxp35spjahpsiagrj0jehh3a3x8z9axqtswj383252z.d6d4ifob3rgi7j1fao-vb9l55lz.bsk1mqype9zx3n6q-u55t879v1lf.1.k.isf-swgdlh.0.m4u5aoqakjc4xlcmbpoy4ndizk4s3cdhxttexawd8mnl6e4uzxalowdqy9rokd32ct-w5p-yt-emwrzfi.lulqkw0osnqktff9fp6xbt97440w4wt3xjayovyb7flljlnosgtrofp.o.j.p5-2p577rg1fwny6cq1e2d3p5aa62rscqk6cxzeqcrvjnbqd52lumjr3qda19c-7skjef4ovphp57sme4j.v.ex0xp4ft9xd1-4zvmus0m5p.v0h-jlvu47xor814uas43gvg7px7mohsvz1n3b561az73nipt-so37iphbtnhmw48ibn.m.bk41trymo7d0ea3vl3k8vn3ygn2a7ps3-pdkhjjxrdr3lz6urrzqtzh9wngf-95dvz5km9h9e5j8vg6kx1nnqzi442akggqdhy6.i.gupb4cz72xp4qgqp5jsd55qux2vq83uq1j9iy-qb4bt8kb625gpncppm1zw5yrhj.5q6soeyc3hzdpj1thb.b.b5xq79rwp3km1p11ikuwgghy12wdp5xrrsyrsnl7yjolek10nb0oh.h.x.2h707s1vjswprq6au.xucdr85u0erh5dfg2hvs9u7vn0y8ci0w5cs0m66nvcce2fr52dkbd9-7klkniu5cpn6qugmep5e6p9gx9creyetm.2sgithzei3bx4-4ox6m2aiffxmcwza92oxtwxs76a.s.z.im-3mvtf47ak-ld.a.2elgcf13ovinqusgnnclaaotmbqdseafe1dkj6zg4q-zexx0zm-n.j3-w17r6rxur1pbea75jjl8lv5xitcozp.c.h.61bftab5cre-v.9.v.s.fyenvbtf508c5c3k.mghqe7lyva958ar2bzuf2507k602lnujv0ps2icyh27nxstaqbg38m0hpe.g.bg8n69rdva8j104ap-cf1p9yc1ijk9np17sjmh2tukz4atwz0044pdhk9pk1eft1nod0p9-vepbljhwtpf-qd2ysm1.3tiane3jk-09bf0q3dbgqocrp16dzj0xk-uyej17sd81mbgu820re53g21e779vy6.z.rm8pn0xdthfd9cqpo9sslxeml661r0eol4jypf6mdna86sfgz92k.y-52xiufg9mfli1bjvsy947g3cz7wufbd001uiwvuaxblt37i0ah0z6f6qhqwar1c3r14v-vt3pd5kbrrs94okiob2jznknec6ky.3.d.dgp-oapce410llsnx-m--ufb725icarr8pijimdu9gxv3p7744x7btxc9-zq66zjny7rvcbdfcl-7ksv-awu1ddn3dlag.1cg4obm9r3waeqrdsk53.1.q.k.w.gz5qwr2rjf1o2625v873inyqekdlul-2yu96dhuposmz433w4216crklr6.5ifmkesrrzj9hbtdyamuoxl0l1gb0vgsms5ou3nfhhnvvfktn2uyclzyqvy90vz11a6oipnv4tno7.z.t.u4pfk1y-f41a9ekyw5sfqgxxg2436imo6t94jmeph0msaf6p04q5p6z75n97ibih9ynp9w52m2.7bh985by7-jms7z9rzl84e9iub-3gwwq4fe81bi2bmela-4-ti6-mqq-em0m73ls976osz80kxxj.x.jxe4zxgit8guso2bynf9xkxywffvyznse5yovoes9zqhgf9wk74po4qj1hri4b.06kv2f-9nff.ejas130ndgnxp85h0saokre-wcp8nl4iio.g.z8c-0hnu2tn0fal1tsn8phrmhzoys2l25i7fgxqn8.w.w.z0', ), ingress = platform_api_python_client.models.ingress.Ingress( - backend_protocol = 'HTTP', + backend_protocol = null, bearer_token_ref = 1.0, certificate_authority = '', ), port = 1.0,