From f28a24fdb3326e5296e51882a2218beb2286cfff Mon Sep 17 00:00:00 2001 From: Alex Creasy Date: Mon, 8 Jul 2024 16:56:11 +0100 Subject: [PATCH 1/3] Improve grammar in documentation (#174) Signed-off-by: Alex Creasy --- docs/logical_model.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/logical_model.md b/docs/logical_model.md index 9b8173298..4e7ce13e9 100644 --- a/docs/logical_model.md +++ b/docs/logical_model.md @@ -44,9 +44,9 @@ Examples: * A Pickle file * A checkpoint .ckpt file -Provides several properties which can be used to locate and identify the model artifact/file (on storage). Some of the properties, such as **storage_key** and **storage_path**, are loosely modeled after KServe InferenceService’s [storage spec](https://github.com/kserve/kserve/blob/d977cc0c89d32a029123635f216c82d287683775/pkg/apis/serving/v1beta1/predictor.go#L89) for historical reasons (and [integration](https://github.com/kserve/modelmesh-serving/blob/release-0.11/docs/quickstart.md#2-deploy-a-model) [blueprints](https://github.com/kserve/kserve/blob/master/docs/samples/storage/storageSpec/README.md#create-the-inferenceservice)), but we found it providing a flexible, general logical structure to capture “a storage pointer and resolver” which can be applied to several technical solutions beyond KServe or Model Mesh. +Provides several properties which can be used to locate and identify the model artifact/file (on storage). Some of the properties, such as **storage_key** and **storage_path**, are loosely modeled after KServe InferenceService’s [storage spec](https://github.com/kserve/kserve/blob/d977cc0c89d32a029123635f216c82d287683775/pkg/apis/serving/v1beta1/predictor.go#L89) for historical reasons (and [integration](https://github.com/kserve/modelmesh-serving/blob/release-0.11/docs/quickstart.md#2-deploy-a-model) [blueprints](https://github.com/kserve/kserve/blob/master/docs/samples/storage/storageSpec/README.md#create-the-inferenceservice)), but we found it provides a flexible, general logical structure to capture “a storage pointer and resolver”, which can be applied to several technical solutions beyond KServe or Model Mesh. -`uri` can be used as a general mechanism to locate the model artifact/file on storage. We recommend using the URI protocol to identify the kind of storage, while the remainder to locate the artifact/file. This makes it possible for downstream use to leverage URI as the resolution mechanism, eventually augmented with credentials to be supplied by platform idiomatic choice for secret management and access control. +`uri` can be used as a general mechanism to locate the model artifact/file on storage. We recommend using the URI protocol to identify the kind of storage, while the remainder to locate the artifact/file. This makes it possible for downstream use to leverage URI as the resolution mechanism, eventually augmented with credentials to be supplied by the platform's idiomatic choice for secret management and access control. `storage_key` can be used to reference the access key to be used in conjunction with URI (above) in order to gain access to the artifact/file. From 9b9be5087c4e7e636eb67605c5e3ac5412db5286 Mon Sep 17 00:00:00 2001 From: Isabella Basso Date: Mon, 8 Jul 2024 16:18:11 -0300 Subject: [PATCH 2/3] Switch Python client backend to use REST (#152) * py: add generated REST backend Signed-off-by: Isabella do Amaral * py: initial generated code Signed-off-by: Isabella do Amaral * py: remove gRPC backend Signed-off-by: Isabella do Amaral * py: rename exceptions Signed-off-by: Isabella do Amaral * py: wrap generated types Signed-off-by: Isabella do Amaral * py: core: wrap async client with ctx manager Signed-off-by: Isabella do Amaral * py: client: wrap async core with sync client Signed-off-by: Isabella do Amaral * GHA: update python constraints Signed-off-by: Isabella do Amaral * py: setup mypy Signed-off-by: Isabella do Amaral --------- Signed-off-by: Isabella do Amaral --- .github/workflows/build-image-pr.yml | 4 +- .github/workflows/constraints.txt | 9 +- .github/workflows/python-release.yml | 2 +- .github/workflows/python-tests.yml | 6 +- clients/python/Makefile | 36 + clients/python/README.md | 52 +- clients/python/docs/reference.md | 176 +- clients/python/noxfile.py | 11 +- clients/python/openapitools.json | 7 + clients/python/patches/asyncio-only.patch | 42 + clients/python/patches/fix-validators.patch | 24 + clients/python/poetry.lock | 873 +- clients/python/pyproject.toml | 37 +- clients/python/src/.openapi-generator-ignore | 23 + clients/python/src/.openapi-generator/FILES | 116 + clients/python/src/.openapi-generator/VERSION | 1 + clients/python/src/model_registry/_client.py | 130 +- clients/python/src/model_registry/core.py | 437 +- .../python/src/model_registry/exceptions.py | 10 +- .../src/model_registry/store/__init__.py | 10 - .../python/src/model_registry/store/base.py | 12 - .../src/model_registry/store/wrapper.py | 375 - .../src/model_registry/types/__init__.py | 20 +- .../src/model_registry/types/artifacts.py | 217 +- .../python/src/model_registry/types/base.py | 234 +- .../src/model_registry/types/contexts.py | 189 +- .../src/model_registry/types/options.py | 61 +- clients/python/src/model_registry/utils.py | 86 - clients/python/src/mr_openapi/README.md | 185 + clients/python/src/mr_openapi/__init__.py | 85 + clients/python/src/mr_openapi/api/__init__.py | 4 + .../api/model_registry_service_api.py | 9508 +++++++++++++++++ clients/python/src/mr_openapi/api_client.py | 663 ++ clients/python/src/mr_openapi/api_response.py | 21 + .../python/src/mr_openapi/configuration.py | 434 + .../python/src/mr_openapi/docs/Artifact.md | 44 + .../src/mr_openapi/docs/ArtifactList.md | 33 + .../src/mr_openapi/docs/ArtifactState.md | 12 + .../src/mr_openapi/docs/BaseArtifact.md | 37 + .../src/mr_openapi/docs/BaseArtifactCreate.md | 34 + .../src/mr_openapi/docs/BaseArtifactUpdate.md | 33 + .../src/mr_openapi/docs/BaseExecution.md | 36 + .../mr_openapi/docs/BaseExecutionCreate.md | 33 + .../mr_openapi/docs/BaseExecutionUpdate.md | 32 + .../src/mr_openapi/docs/BaseResource.md | 35 + .../src/mr_openapi/docs/BaseResourceCreate.md | 32 + .../src/mr_openapi/docs/BaseResourceList.md | 31 + .../src/mr_openapi/docs/BaseResourceUpdate.md | 31 + .../python/src/mr_openapi/docs/DocArtifact.md | 39 + clients/python/src/mr_openapi/docs/Error.md | 31 + .../src/mr_openapi/docs/ExecutionState.md | 12 + .../src/mr_openapi/docs/InferenceService.md | 41 + .../mr_openapi/docs/InferenceServiceCreate.md | 38 + .../mr_openapi/docs/InferenceServiceList.md | 33 + .../mr_openapi/docs/InferenceServiceState.md | 12 + .../mr_openapi/docs/InferenceServiceUpdate.md | 35 + .../src/mr_openapi/docs/MetadataBoolValue.md | 31 + .../mr_openapi/docs/MetadataDoubleValue.md | 31 + .../src/mr_openapi/docs/MetadataIntValue.md | 31 + .../src/mr_openapi/docs/MetadataProtoValue.md | 32 + .../mr_openapi/docs/MetadataStringValue.md | 31 + .../mr_openapi/docs/MetadataStructValue.md | 31 + .../src/mr_openapi/docs/MetadataValue.md | 37 + .../src/mr_openapi/docs/ModelArtifact.md | 44 + .../mr_openapi/docs/ModelArtifactCreate.md | 40 + .../src/mr_openapi/docs/ModelArtifactList.md | 33 + .../mr_openapi/docs/ModelArtifactUpdate.md | 39 + .../docs/ModelRegistryServiceApi.md | 3030 ++++++ .../src/mr_openapi/docs/ModelVersion.md | 39 + .../src/mr_openapi/docs/ModelVersionCreate.md | 36 + .../src/mr_openapi/docs/ModelVersionList.md | 33 + .../src/mr_openapi/docs/ModelVersionState.md | 12 + .../src/mr_openapi/docs/ModelVersionUpdate.md | 34 + .../src/mr_openapi/docs/OrderByField.md | 12 + .../src/mr_openapi/docs/RegisteredModel.md | 38 + .../mr_openapi/docs/RegisteredModelCreate.md | 35 + .../mr_openapi/docs/RegisteredModelList.md | 33 + .../mr_openapi/docs/RegisteredModelState.md | 12 + .../mr_openapi/docs/RegisteredModelUpdate.md | 34 + .../python/src/mr_openapi/docs/ServeModel.md | 38 + .../src/mr_openapi/docs/ServeModelCreate.md | 35 + .../src/mr_openapi/docs/ServeModelList.md | 33 + .../src/mr_openapi/docs/ServeModelUpdate.md | 33 + .../src/mr_openapi/docs/ServingEnvironment.md | 36 + .../docs/ServingEnvironmentCreate.md | 33 + .../mr_openapi/docs/ServingEnvironmentList.md | 33 + .../docs/ServingEnvironmentUpdate.md | 32 + .../python/src/mr_openapi/docs/SortOrder.md | 12 + clients/python/src/mr_openapi/exceptions.py | 190 + .../python/src/mr_openapi/models/__init__.py | 68 + .../python/src/mr_openapi/models/artifact.py | 178 + .../src/mr_openapi/models/artifact_list.py | 99 + .../src/mr_openapi/models/artifact_state.py | 36 + .../src/mr_openapi/models/base_artifact.py | 151 + .../mr_openapi/models/base_artifact_create.py | 118 + .../mr_openapi/models/base_artifact_update.py | 113 + .../src/mr_openapi/models/base_execution.py | 145 + .../models/base_execution_create.py | 113 + .../models/base_execution_update.py | 108 + .../src/mr_openapi/models/base_resource.py | 141 + .../mr_openapi/models/base_resource_create.py | 110 + .../mr_openapi/models/base_resource_list.py | 81 + .../mr_openapi/models/base_resource_update.py | 105 + .../src/mr_openapi/models/doc_artifact.py | 153 + clients/python/src/mr_openapi/models/error.py | 76 + .../src/mr_openapi/models/execution_state.py | 36 + .../mr_openapi/models/inference_service.py | 166 + .../models/inference_service_create.py | 140 + .../models/inference_service_list.py | 101 + .../models/inference_service_state.py | 31 + .../models/inference_service_update.py | 123 + .../mr_openapi/models/metadata_bool_value.py | 83 + .../models/metadata_double_value.py | 83 + .../mr_openapi/models/metadata_int_value.py | 81 + .../mr_openapi/models/metadata_proto_value.py | 85 + .../models/metadata_string_value.py | 83 + .../models/metadata_struct_value.py | 83 + .../src/mr_openapi/models/metadata_value.py | 277 + .../src/mr_openapi/models/model_artifact.py | 176 + .../models/model_artifact_create.py | 148 + .../mr_openapi/models/model_artifact_list.py | 101 + .../models/model_artifact_update.py | 142 + .../src/mr_openapi/models/model_version.py | 153 + .../mr_openapi/models/model_version_create.py | 127 + .../mr_openapi/models/model_version_list.py | 99 + .../mr_openapi/models/model_version_state.py | 31 + .../mr_openapi/models/model_version_update.py | 110 + .../src/mr_openapi/models/order_by_field.py | 32 + .../src/mr_openapi/models/registered_model.py | 148 + .../models/registered_model_create.py | 115 + .../models/registered_model_list.py | 101 + .../models/registered_model_state.py | 31 + .../models/registered_model_update.py | 110 + .../src/mr_openapi/models/serve_model.py | 150 + .../mr_openapi/models/serve_model_create.py | 124 + .../src/mr_openapi/models/serve_model_list.py | 99 + .../mr_openapi/models/serve_model_update.py | 108 + .../mr_openapi/models/serving_environment.py | 141 + .../models/serving_environment_create.py | 110 + .../models/serving_environment_list.py | 101 + .../models/serving_environment_update.py | 105 + .../src/mr_openapi/models/sort_order.py | 31 + clients/python/src/mr_openapi/rest.py | 167 + .../python/src/mr_openapi/test/__init__.py | 0 .../src/mr_openapi/test/test_artifact.py | 67 + .../src/mr_openapi/test/test_artifact_list.py | 58 + .../mr_openapi/test/test_artifact_state.py | 29 + .../src/mr_openapi/test/test_base_artifact.py | 60 + .../test/test_base_artifact_create.py | 57 + .../test/test_base_artifact_update.py | 56 + .../mr_openapi/test/test_base_execution.py | 59 + .../test/test_base_execution_create.py | 56 + .../test/test_base_execution_update.py | 55 + .../src/mr_openapi/test/test_base_resource.py | 58 + .../test/test_base_resource_create.py | 55 + .../test/test_base_resource_list.py | 55 + .../test/test_base_resource_update.py | 54 + .../src/mr_openapi/test/test_doc_artifact.py | 62 + .../python/src/mr_openapi/test/test_error.py | 53 + .../mr_openapi/test/test_execution_state.py | 29 + .../mr_openapi/test/test_inference_service.py | 65 + .../test/test_inference_service_create.py | 62 + .../test/test_inference_service_list.py | 58 + .../test/test_inference_service_state.py | 29 + .../test/test_inference_service_update.py | 57 + .../test/test_metadata_bool_value.py | 53 + .../test/test_metadata_double_value.py | 53 + .../test/test_metadata_int_value.py | 53 + .../test/test_metadata_proto_value.py | 55 + .../test/test_metadata_string_value.py | 53 + .../test/test_metadata_struct_value.py | 53 + .../mr_openapi/test/test_metadata_value.py | 65 + .../mr_openapi/test/test_model_artifact.py | 67 + .../test/test_model_artifact_create.py | 62 + .../test/test_model_artifact_list.py | 59 + .../test/test_model_artifact_update.py | 61 + .../test/test_model_registry_service_api.py | 272 + .../src/mr_openapi/test/test_model_version.py | 62 + .../test/test_model_version_create.py | 59 + .../test/test_model_version_list.py | 58 + .../test/test_model_version_state.py | 29 + .../test/test_model_version_update.py | 56 + .../mr_openapi/test/test_order_by_field.py | 29 + .../mr_openapi/test/test_registered_model.py | 60 + .../test/test_registered_model_create.py | 57 + .../test/test_registered_model_list.py | 58 + .../test/test_registered_model_state.py | 29 + .../test/test_registered_model_update.py | 56 + .../src/mr_openapi/test/test_serve_model.py | 61 + .../test/test_serve_model_create.py | 58 + .../mr_openapi/test/test_serve_model_list.py | 58 + .../test/test_serve_model_update.py | 55 + .../test/test_serving_environment.py | 58 + .../test/test_serving_environment_create.py | 55 + .../test/test_serving_environment_list.py | 58 + .../test/test_serving_environment_update.py | 54 + .../src/mr_openapi/test/test_sort_order.py | 29 + clients/python/tests/__init__.py | 14 - clients/python/tests/basic_test.py | 147 + clients/python/tests/conftest.py | 270 +- clients/python/tests/store/__init__.py | 1 - clients/python/tests/store/test_wrapper.py | 133 - clients/python/tests/test_client.py | 104 +- clients/python/tests/test_core.py | 439 +- clients/python/tests/types/__init__.py | 1 - .../tests/types/test_artifact_mapping.py | 106 - .../tests/types/test_context_mapping.py | 134 - test/robot/ModelRegistry.py | 49 +- 208 files changed, 26949 insertions(+), 2422 deletions(-) create mode 100644 clients/python/Makefile create mode 100644 clients/python/openapitools.json create mode 100644 clients/python/patches/asyncio-only.patch create mode 100644 clients/python/patches/fix-validators.patch create mode 100644 clients/python/src/.openapi-generator-ignore create mode 100644 clients/python/src/.openapi-generator/FILES create mode 100644 clients/python/src/.openapi-generator/VERSION delete mode 100644 clients/python/src/model_registry/store/__init__.py delete mode 100644 clients/python/src/model_registry/store/base.py delete mode 100644 clients/python/src/model_registry/store/wrapper.py create mode 100644 clients/python/src/mr_openapi/README.md create mode 100644 clients/python/src/mr_openapi/__init__.py create mode 100644 clients/python/src/mr_openapi/api/__init__.py create mode 100644 clients/python/src/mr_openapi/api/model_registry_service_api.py create mode 100644 clients/python/src/mr_openapi/api_client.py create mode 100644 clients/python/src/mr_openapi/api_response.py create mode 100644 clients/python/src/mr_openapi/configuration.py create mode 100644 clients/python/src/mr_openapi/docs/Artifact.md create mode 100644 clients/python/src/mr_openapi/docs/ArtifactList.md create mode 100644 clients/python/src/mr_openapi/docs/ArtifactState.md create mode 100644 clients/python/src/mr_openapi/docs/BaseArtifact.md create mode 100644 clients/python/src/mr_openapi/docs/BaseArtifactCreate.md create mode 100644 clients/python/src/mr_openapi/docs/BaseArtifactUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/BaseExecution.md create mode 100644 clients/python/src/mr_openapi/docs/BaseExecutionCreate.md create mode 100644 clients/python/src/mr_openapi/docs/BaseExecutionUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/BaseResource.md create mode 100644 clients/python/src/mr_openapi/docs/BaseResourceCreate.md create mode 100644 clients/python/src/mr_openapi/docs/BaseResourceList.md create mode 100644 clients/python/src/mr_openapi/docs/BaseResourceUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/DocArtifact.md create mode 100644 clients/python/src/mr_openapi/docs/Error.md create mode 100644 clients/python/src/mr_openapi/docs/ExecutionState.md create mode 100644 clients/python/src/mr_openapi/docs/InferenceService.md create mode 100644 clients/python/src/mr_openapi/docs/InferenceServiceCreate.md create mode 100644 clients/python/src/mr_openapi/docs/InferenceServiceList.md create mode 100644 clients/python/src/mr_openapi/docs/InferenceServiceState.md create mode 100644 clients/python/src/mr_openapi/docs/InferenceServiceUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/MetadataBoolValue.md create mode 100644 clients/python/src/mr_openapi/docs/MetadataDoubleValue.md create mode 100644 clients/python/src/mr_openapi/docs/MetadataIntValue.md create mode 100644 clients/python/src/mr_openapi/docs/MetadataProtoValue.md create mode 100644 clients/python/src/mr_openapi/docs/MetadataStringValue.md create mode 100644 clients/python/src/mr_openapi/docs/MetadataStructValue.md create mode 100644 clients/python/src/mr_openapi/docs/MetadataValue.md create mode 100644 clients/python/src/mr_openapi/docs/ModelArtifact.md create mode 100644 clients/python/src/mr_openapi/docs/ModelArtifactCreate.md create mode 100644 clients/python/src/mr_openapi/docs/ModelArtifactList.md create mode 100644 clients/python/src/mr_openapi/docs/ModelArtifactUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/ModelRegistryServiceApi.md create mode 100644 clients/python/src/mr_openapi/docs/ModelVersion.md create mode 100644 clients/python/src/mr_openapi/docs/ModelVersionCreate.md create mode 100644 clients/python/src/mr_openapi/docs/ModelVersionList.md create mode 100644 clients/python/src/mr_openapi/docs/ModelVersionState.md create mode 100644 clients/python/src/mr_openapi/docs/ModelVersionUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/OrderByField.md create mode 100644 clients/python/src/mr_openapi/docs/RegisteredModel.md create mode 100644 clients/python/src/mr_openapi/docs/RegisteredModelCreate.md create mode 100644 clients/python/src/mr_openapi/docs/RegisteredModelList.md create mode 100644 clients/python/src/mr_openapi/docs/RegisteredModelState.md create mode 100644 clients/python/src/mr_openapi/docs/RegisteredModelUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/ServeModel.md create mode 100644 clients/python/src/mr_openapi/docs/ServeModelCreate.md create mode 100644 clients/python/src/mr_openapi/docs/ServeModelList.md create mode 100644 clients/python/src/mr_openapi/docs/ServeModelUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/ServingEnvironment.md create mode 100644 clients/python/src/mr_openapi/docs/ServingEnvironmentCreate.md create mode 100644 clients/python/src/mr_openapi/docs/ServingEnvironmentList.md create mode 100644 clients/python/src/mr_openapi/docs/ServingEnvironmentUpdate.md create mode 100644 clients/python/src/mr_openapi/docs/SortOrder.md create mode 100644 clients/python/src/mr_openapi/exceptions.py create mode 100644 clients/python/src/mr_openapi/models/__init__.py create mode 100644 clients/python/src/mr_openapi/models/artifact.py create mode 100644 clients/python/src/mr_openapi/models/artifact_list.py create mode 100644 clients/python/src/mr_openapi/models/artifact_state.py create mode 100644 clients/python/src/mr_openapi/models/base_artifact.py create mode 100644 clients/python/src/mr_openapi/models/base_artifact_create.py create mode 100644 clients/python/src/mr_openapi/models/base_artifact_update.py create mode 100644 clients/python/src/mr_openapi/models/base_execution.py create mode 100644 clients/python/src/mr_openapi/models/base_execution_create.py create mode 100644 clients/python/src/mr_openapi/models/base_execution_update.py create mode 100644 clients/python/src/mr_openapi/models/base_resource.py create mode 100644 clients/python/src/mr_openapi/models/base_resource_create.py create mode 100644 clients/python/src/mr_openapi/models/base_resource_list.py create mode 100644 clients/python/src/mr_openapi/models/base_resource_update.py create mode 100644 clients/python/src/mr_openapi/models/doc_artifact.py create mode 100644 clients/python/src/mr_openapi/models/error.py create mode 100644 clients/python/src/mr_openapi/models/execution_state.py create mode 100644 clients/python/src/mr_openapi/models/inference_service.py create mode 100644 clients/python/src/mr_openapi/models/inference_service_create.py create mode 100644 clients/python/src/mr_openapi/models/inference_service_list.py create mode 100644 clients/python/src/mr_openapi/models/inference_service_state.py create mode 100644 clients/python/src/mr_openapi/models/inference_service_update.py create mode 100644 clients/python/src/mr_openapi/models/metadata_bool_value.py create mode 100644 clients/python/src/mr_openapi/models/metadata_double_value.py create mode 100644 clients/python/src/mr_openapi/models/metadata_int_value.py create mode 100644 clients/python/src/mr_openapi/models/metadata_proto_value.py create mode 100644 clients/python/src/mr_openapi/models/metadata_string_value.py create mode 100644 clients/python/src/mr_openapi/models/metadata_struct_value.py create mode 100644 clients/python/src/mr_openapi/models/metadata_value.py create mode 100644 clients/python/src/mr_openapi/models/model_artifact.py create mode 100644 clients/python/src/mr_openapi/models/model_artifact_create.py create mode 100644 clients/python/src/mr_openapi/models/model_artifact_list.py create mode 100644 clients/python/src/mr_openapi/models/model_artifact_update.py create mode 100644 clients/python/src/mr_openapi/models/model_version.py create mode 100644 clients/python/src/mr_openapi/models/model_version_create.py create mode 100644 clients/python/src/mr_openapi/models/model_version_list.py create mode 100644 clients/python/src/mr_openapi/models/model_version_state.py create mode 100644 clients/python/src/mr_openapi/models/model_version_update.py create mode 100644 clients/python/src/mr_openapi/models/order_by_field.py create mode 100644 clients/python/src/mr_openapi/models/registered_model.py create mode 100644 clients/python/src/mr_openapi/models/registered_model_create.py create mode 100644 clients/python/src/mr_openapi/models/registered_model_list.py create mode 100644 clients/python/src/mr_openapi/models/registered_model_state.py create mode 100644 clients/python/src/mr_openapi/models/registered_model_update.py create mode 100644 clients/python/src/mr_openapi/models/serve_model.py create mode 100644 clients/python/src/mr_openapi/models/serve_model_create.py create mode 100644 clients/python/src/mr_openapi/models/serve_model_list.py create mode 100644 clients/python/src/mr_openapi/models/serve_model_update.py create mode 100644 clients/python/src/mr_openapi/models/serving_environment.py create mode 100644 clients/python/src/mr_openapi/models/serving_environment_create.py create mode 100644 clients/python/src/mr_openapi/models/serving_environment_list.py create mode 100644 clients/python/src/mr_openapi/models/serving_environment_update.py create mode 100644 clients/python/src/mr_openapi/models/sort_order.py create mode 100644 clients/python/src/mr_openapi/rest.py create mode 100644 clients/python/src/mr_openapi/test/__init__.py create mode 100644 clients/python/src/mr_openapi/test/test_artifact.py create mode 100644 clients/python/src/mr_openapi/test/test_artifact_list.py create mode 100644 clients/python/src/mr_openapi/test/test_artifact_state.py create mode 100644 clients/python/src/mr_openapi/test/test_base_artifact.py create mode 100644 clients/python/src/mr_openapi/test/test_base_artifact_create.py create mode 100644 clients/python/src/mr_openapi/test/test_base_artifact_update.py create mode 100644 clients/python/src/mr_openapi/test/test_base_execution.py create mode 100644 clients/python/src/mr_openapi/test/test_base_execution_create.py create mode 100644 clients/python/src/mr_openapi/test/test_base_execution_update.py create mode 100644 clients/python/src/mr_openapi/test/test_base_resource.py create mode 100644 clients/python/src/mr_openapi/test/test_base_resource_create.py create mode 100644 clients/python/src/mr_openapi/test/test_base_resource_list.py create mode 100644 clients/python/src/mr_openapi/test/test_base_resource_update.py create mode 100644 clients/python/src/mr_openapi/test/test_doc_artifact.py create mode 100644 clients/python/src/mr_openapi/test/test_error.py create mode 100644 clients/python/src/mr_openapi/test/test_execution_state.py create mode 100644 clients/python/src/mr_openapi/test/test_inference_service.py create mode 100644 clients/python/src/mr_openapi/test/test_inference_service_create.py create mode 100644 clients/python/src/mr_openapi/test/test_inference_service_list.py create mode 100644 clients/python/src/mr_openapi/test/test_inference_service_state.py create mode 100644 clients/python/src/mr_openapi/test/test_inference_service_update.py create mode 100644 clients/python/src/mr_openapi/test/test_metadata_bool_value.py create mode 100644 clients/python/src/mr_openapi/test/test_metadata_double_value.py create mode 100644 clients/python/src/mr_openapi/test/test_metadata_int_value.py create mode 100644 clients/python/src/mr_openapi/test/test_metadata_proto_value.py create mode 100644 clients/python/src/mr_openapi/test/test_metadata_string_value.py create mode 100644 clients/python/src/mr_openapi/test/test_metadata_struct_value.py create mode 100644 clients/python/src/mr_openapi/test/test_metadata_value.py create mode 100644 clients/python/src/mr_openapi/test/test_model_artifact.py create mode 100644 clients/python/src/mr_openapi/test/test_model_artifact_create.py create mode 100644 clients/python/src/mr_openapi/test/test_model_artifact_list.py create mode 100644 clients/python/src/mr_openapi/test/test_model_artifact_update.py create mode 100644 clients/python/src/mr_openapi/test/test_model_registry_service_api.py create mode 100644 clients/python/src/mr_openapi/test/test_model_version.py create mode 100644 clients/python/src/mr_openapi/test/test_model_version_create.py create mode 100644 clients/python/src/mr_openapi/test/test_model_version_list.py create mode 100644 clients/python/src/mr_openapi/test/test_model_version_state.py create mode 100644 clients/python/src/mr_openapi/test/test_model_version_update.py create mode 100644 clients/python/src/mr_openapi/test/test_order_by_field.py create mode 100644 clients/python/src/mr_openapi/test/test_registered_model.py create mode 100644 clients/python/src/mr_openapi/test/test_registered_model_create.py create mode 100644 clients/python/src/mr_openapi/test/test_registered_model_list.py create mode 100644 clients/python/src/mr_openapi/test/test_registered_model_state.py create mode 100644 clients/python/src/mr_openapi/test/test_registered_model_update.py create mode 100644 clients/python/src/mr_openapi/test/test_serve_model.py create mode 100644 clients/python/src/mr_openapi/test/test_serve_model_create.py create mode 100644 clients/python/src/mr_openapi/test/test_serve_model_list.py create mode 100644 clients/python/src/mr_openapi/test/test_serve_model_update.py create mode 100644 clients/python/src/mr_openapi/test/test_serving_environment.py create mode 100644 clients/python/src/mr_openapi/test/test_serving_environment_create.py create mode 100644 clients/python/src/mr_openapi/test/test_serving_environment_list.py create mode 100644 clients/python/src/mr_openapi/test/test_serving_environment_update.py create mode 100644 clients/python/src/mr_openapi/test/test_sort_order.py create mode 100644 clients/python/tests/basic_test.py delete mode 100644 clients/python/tests/store/__init__.py delete mode 100644 clients/python/tests/store/test_wrapper.py delete mode 100644 clients/python/tests/types/__init__.py delete mode 100644 clients/python/tests/types/test_artifact_mapping.py delete mode 100644 clients/python/tests/types/test_context_mapping.py diff --git a/.github/workflows/build-image-pr.yml b/.github/workflows/build-image-pr.yml index ea9e53f51..14ff73f5b 100644 --- a/.github/workflows/build-image-pr.yml +++ b/.github/workflows/build-image-pr.yml @@ -80,6 +80,6 @@ jobs: pip install dist/*.whl - name: Connect with Python client run: | - kubectl port-forward -n kubeflow service/model-registry-service 9090:9090 & + kubectl port-forward -n kubeflow service/model-registry-service 8080:8080 & sleep 5 - python test/python/test_mr_conn.py localhost 9090 + python test/python/test_mr_conn.py http://localhost 8080 diff --git a/.github/workflows/constraints.txt b/.github/workflows/constraints.txt index 25d0a41b5..a958db401 100644 --- a/.github/workflows/constraints.txt +++ b/.github/workflows/constraints.txt @@ -1,5 +1,6 @@ -pip==23.3.1 -nox==2023.04.22 -nox-poetry==1.0.2 -poetry==1.6.1 +pip==23.3.2 +nox==2023.4.22 +nox-poetry==1.0.3 +poetry==1.8.3 +poetry-plugin-export==1.8.0 virtualenv==20.24.6 diff --git a/.github/workflows/python-release.yml b/.github/workflows/python-release.yml index 63977ee4a..a4b46956f 100644 --- a/.github/workflows/python-release.yml +++ b/.github/workflows/python-release.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.12" - name: Upgrade pip run: | pip install --constraint=.github/workflows/constraints.txt pip diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index a653cde37..00eeefaf2 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -11,11 +11,15 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.10"] + python: ["3.12"] session: [lint, tests, mypy, docs-build] include: - python: "3.9" session: tests + - python: "3.10" + session: tests + - python: "3.11" + session: tests env: NOXSESSION: ${{ matrix.session }} FORCE_COLOR: "1" diff --git a/clients/python/Makefile b/clients/python/Makefile new file mode 100644 index 000000000..839031653 --- /dev/null +++ b/clients/python/Makefile @@ -0,0 +1,36 @@ +.PHONY: install +install: + ../../bin/openapi-generator-cli generate -i ../../api/openapi/model-registry.yaml -g python -o src/ --package-name mr_openapi --additional-properties=library=asyncio,generateSourceCodeOnly=true,useOneOfDiscriminatorLookup=true + mv src/mr_openapi{_,/}README.md + git apply patches/* + poetry install + +.PHONY: clean +clean: + rm -rf src/mr_openapi + +.PHONY: test +test: + poetry run pytest -s + +.PHONY: lint-check +lint-check: + poetry run ruff check + poetry run black src/mr_openapi --check + +.PHONY: lint-apply +lint-apply: + poetry run ruff check --fix --unsafe-fixes || true + poetry run black src/mr_openapi + +.PHONY: build +build: install lint-apply + poetry build + +.PHONY: publish +publish: install + poetry publish --build -u ${PYPI_USERNAME} -p ${PYPI_PASSWORD} + +.PHONY: update +update: + poetry lock diff --git a/clients/python/README.md b/clients/python/README.md index d1ad03e6c..3cb83a76c 100644 --- a/clients/python/README.md +++ b/clients/python/README.md @@ -10,9 +10,9 @@ This library provides a high level interface for interacting with a model regist ```py from model_registry import ModelRegistry -registry = ModelRegistry("server-address", author="Ada Lovelace") # Defaults to a secure connection via port 443 +registry = ModelRegistry("https://server-address", author="Ada Lovelace") # Defaults to a secure connection via port 443 -# registry = ModelRegistry("server-address", 1234, author="Ada Lovelace", is_secure=False) # To use MR without TLS +# registry = ModelRegistry("http://server-address", 1234, author="Ada Lovelace", is_secure=False) # To use MR without TLS model = registry.register_model( "my-model", # model name @@ -34,9 +34,9 @@ model = registry.register_model( model = registry.get_registered_model("my-model") -version = registry.get_model_version("my-model", "v2.0") +version = registry.get_model_version("my-model", "2.0.0") -experiment = registry.get_model_artifact("my-model", "v2.0") +experiment = registry.get_model_artifact("my-model", "2.0.0") ``` ### Importing from S3 @@ -102,51 +102,21 @@ There are caveats to be noted when using this method: ) ``` -## Advanced use-cases - -### Using Model Registry Python Client with newer Python versions (>=3.11) - -> [!CAUTION] -> The mechanism described in this section is a temporary workaround and likely will never be supported. -> This workaround is ONLY applicable if your Python/Notebook project does NOT make use of MLMD directly or indirectly. - - - -This project _currently_ depends for internal implementations on the Google's [MLMD Python library](https://pypi.org/project/ml-metadata/). -Due to this dependency, this project supports [only the Python versions](https://github.com/kubeflow/model-registry/blob/8d77c13100c6cc5a9465d4293403114a3576fdd7/clients/python/pyproject.toml#L14) which are also available for the MLMD library (see more [here](https://pypi.org/project/ml-metadata/#files)). - -As a workaround, **only IF your Python/Notebook project does NOT make use of MLMD directly or indirectly**, -you could opt-in to make use of a non-constrained variant of the MLMD dependency supporting _only_ remote gRPC calls (and not constrained by specific Python versions or architectures): - -``` -!pip install "https://github.com/opendatahub-io/ml-metadata/releases/download/v1.14.0%2Bremote.1/ml_metadata-1.14.0+remote.1-py3-none-any.whl" # need a Python 3.11 compatible version -!pip install --no-deps --ignore-requires-python --pre "model-registry" # ignore dependencies because of the above override -``` - -You can read more about this use-case, in the [Remote-only packaging of MLMD Python lib](https://github.com/kubeflow/model-registry/blob/main/docs/remote_only_packaging_of_MLMD_Python_lib.md) document. - ## Development Common tasks, such as building documentation and running tests, can be executed using [`nox`](https://github.com/wntrblm/nox) sessions. Use `nox -l` to list sessions and execute them using `nox -s [session]`. -### Running Locally on Mac M1 or M2 (arm64 architecture) - -If you want run tests locally you will need to set up a development environment, including docker engine; we recommend following the instructions [here](https://github.com/kubeflow/model-registry/blob/main/CONTRIBUTING.md#docker-engine). +Alternatively, use `make install` to setup a local Python virtual environment with `poetry`. -You will also have to change the package source to one compatible with ARM64 architecture. This can be actioned by uncommenting lines 14 or 15 in the pyproject.toml file. Run the following command after you have uncommented the line. +To run the tests you will need `docker` (or equivalent) and the `compose` extension command. +This is necessary as the test suite will manage a Model Registry server and an MLMD instance to ensure a clean state on +each run. +You can use `make test` to execute `pytest`. -```sh -poetry lock -``` - -Use the following commands to directly run the tests with individual test output. Alternatively you can use the nox session commands above. +### Running Locally on Mac M1 or M2 (arm64 architecture) -```sh -poetry install -poetry run pytest -v -``` +Check out our [recommendations on setting up your docker engine](https://github.com/kubeflow/model-registry/blob/main/CONTRIBUTING.md#docker-engine) on an ARM processor. diff --git a/clients/python/docs/reference.md b/clients/python/docs/reference.md index f8fb44c5f..404eeaf73 100644 --- a/clients/python/docs/reference.md +++ b/clients/python/docs/reference.md @@ -8,92 +8,146 @@ ## Core -### Register objects +The core {py:class}`model_registry.core.ModelRegistryAPIClient` is a lower level client that tries to emulate the Go +gRPC client. +As it wraps the client provided by the generated module `mr_openapi`, it's also an async interface for the client. + +To create a client you should use the {py:meth}`model_registry.core.ModelRegistryAPIClient.secure_connection` or {py:meth}`model_registry.core.ModelRegistryAPIClient.insecure_connection` constructor. E.g. ```py -from model_registry import ModelRegistry +from model_registry.core import ModelRegistryAPIClient + +insecure_registry = ModelRegistryAPIClient.insecure_connection( + "server-address", "port", + # optionally, you can identify yourself + # user_token=os.environ["MY_TOKEN"] +) + +insecure_registry = ModelRegistryAPIClient.insecure_connection( + "server-address", "port", + user_token=os.environ["MY_TOKEN"] # this is necessary on a secure connection + # optionally, use a custom_ca + # custom_ca=os.environ["MY_CERT"] +) +``` -registry = ModelRegistry("server-address", "port") +The {py:class}`model_registry.core.ModelRegistryAPIClient` manages an async connection for you, so you only need to set +up the client once, and only need to `await` when making calls -- how convenient! -model_id = registry.upsert_registered_model(model) -# we need a model to associate the version to -version_id = registry.upsert_model_version(version, model_id) +### Register objects -# we need a version to associate an trained model to -experiment_id = registry.upsert_model_artifact(trained_model, version_id) +```py +from model_registry.types import RegisteredModel, ModelVersion, ModelArtifact +from model_registry.utils import s3_uri_from + +async def register_a_model(): + model = await registry.upsert_registered_model( + RegisteredModel( + name="HAL", + owner="me ", + ) + ) + assert model.id # this should be valid now + + # we need a registered model to associate the version to + version = await registry.upsert_model_version( + ModelVersion( + name="9000", + author="Mr. Tom A.I.", + external_id="HAL-9000", + ), + model.id + ) + assert version.id + + # we need a version to associate a trained model to + trained_model = await registry.upsert_model_artifact( + ModelArtifact( + name="HAL-core", + uri=s3_uri_from("build/onnx/hal.onnx", "cool-bucket"), + model_format_name="onnx", + model_format_version="1", + storage_key="secret_secret", + ), + version.id + ) + assert trained_model.id ``` -### Query objects - -There are several ways to get previously registered objects from the registry. - -#### By ID +> Note: to execute the remaining examples, you should wrap them in an async function like shown above. +> Check out the [Python asyncio module docs](https://docs.python.org/3/library/asyncio.html) -IDs are created once the object is registered, you can either keep the string returned by the -`upsert_*` functions, or access the `id` property of the objects. +As objects are only assigned IDs upon creation, you can use this property to verify whether an object exists. -```py -new_model = RegisteredModel("new_model") +### Query objects -new_model_id = registry.upsert_registered_model(new_model) +There are several ways to get registered objects from the registry. -assert new_model_id == new_model.id -``` +#### By ID -To query objects using IDs, do +After upserting an object you can use its `id` to fetch it again. ```py -another_model = registry.get_registered_model_by_id("another-model-id") +new_model = await registry.upsert_registered_model(RegisteredModel("new_model")) -another_version = registry.get_model_version_by_id("another-version-id", another_model.id) +maybe_new_model = await registry.get_registered_model_by_id(new_model.id) -another_trained_model = registry.get_model_artifact_by_id("another-model-artifact-id") +assert maybe_new_model == new_model # True ``` #### By parameters External IDs can be used to query objects in the wild. -Note that external IDs must be unique among artifacts or -contexts (see [Types](#types)). +Note that external IDs must be unique among artifacts or contexts (see [Types](#types)). ```py -trained_model = ModelArtifact("my_model_name", "resource_URI", - description="Model description", - external_id="unique_reference") +trained_model = ModelArtifact( + name="my_model_name", + uri="resource_URI", + description="Model description", + external_id="unique_reference" +) # As a version is a context, we can have the same external_id as the above -version = ModelVersion(trained_model, "v1.0", "model author", - external_id="unique_reference") +version = ModelVersion( + name="v1.0", + author="model author", + external_id="unique_reference" +) # Registering this will cause an error! -# model = RegisteredModel("my_model_name", -# external_id="unique_reference") - -model = RegisteredModel("my_model_name", - external_id="another_unique_reference") +# model = RegisteredModel( +# name="my_model_name", +# external_id="unique_reference", # this wouldn't be unique +# ) + +model = RegisteredModel( + name="my_model_name", + external_id="another_unique_reference" +) ``` You can also perform queries by parameters: ```py # We can get the model artifact associated to a version -another_trained_model = registry.get_model_artifact_by_params(model_version_id=another_version.id) +another_trained_model = await registry.get_model_artifact_by_params(name="my_model_name", model_version_id=another_version.id) # Or by its unique identifier -trained_model = registry.get_model_artifact_by_params(external_id="unique_reference") +trained_model = await registry.get_model_artifact_by_params(external_id="unique_reference") # Same thing for a version -version = registry.get_model_version_by_params(external_id="unique_reference") +version = await registry.get_model_version_by_params(external_id="unique_reference") # Or for a model -model = registry.get_registered_model_by_params(external_id="another_unique_reference") +model = await registry.get_registered_model_by_params(external_id="another_unique_reference") # We can also get a version by its name and associated model id -version = registry.get_model_version_by_params(version="v1.0", registered_model_id="x") +version = await registry.get_model_version_by_params(version="v1.0", registered_model_id="x") # And we can get a model by simply calling its name -model = registry.get_registered_model_by_params(name="my_model_name") +model = await registry.get_registered_model_by_params(name="my_model_name") ``` ### Query multiple objects @@ -101,28 +155,27 @@ model = registry.get_registered_model_by_params(name="my_model_name") We can query all objects of a type ```py -models = registry.get_registered_models() +models = await registry.get_registered_models() -versions = registry.get_model_versions("registered_model_id") +versions = await registry.get_model_versions("registered_model_id") # We can get a list of all model artifacts -all_model_artifacts = registry.get_model_artifacts() +all_model_artifacts = await registry.get_model_artifacts() ``` - -To limit or order the query, provide a `ListOptions` object +To limit or order the query, provide a {py:class}`model_registry.types.ListOptions` object. ```py -from model_registry import ListOptions, OrderByField +from model_registry import ListOptions options = ListOptions(limit=50) -first_50_models = registry.get_registered_models(options) +first_50_models = await registry.get_registered_models(options) # By default we get ascending order -options = ListOptions(order_by=OrderByField.CREATE_TIME, is_asc=False) +options = ListOptions.order_by_creation_time(is_asc=False) -last_50_models = registry.get_registered_models(options) +last_50_models = await registry.get_registered_models(options) ``` ```{eval-rst} @@ -138,12 +191,21 @@ Registry objects can be created by doing ```py from model_registry.types import ModelArtifact, ModelVersion, RegisteredModel -trained_model = ModelArtifact("my_model_name", "resource_URI", - description="Model description") - -version = ModelVersion(trained_model.name, "v1.0", "model author") - -model = RegisteredModel(trained_model.name) +trained_model = ModelArtifact( + name="model-exec", + uri="resource_URI", + description="Model description", +) + +version = ModelVersion( + name="v1.0", + author="model author", +) + +model = RegisteredModel( + name="model", + owner="team", +) ``` ```{eval-rst} diff --git a/clients/python/noxfile.py b/clients/python/noxfile.py index ad66ffd69..c92fe9b01 100644 --- a/clients/python/noxfile.py +++ b/clients/python/noxfile.py @@ -1,4 +1,5 @@ """Nox sessions.""" + import os import shutil import sys @@ -20,7 +21,7 @@ package = "model_registry" -python_versions = ["3.10", "3.9"] +python_versions = ["3.12", "3.11","3.10", "3.9"] nox.needs_version = ">= 2021.6.6" nox.options.sessions = ( "tests", @@ -33,7 +34,8 @@ def lint(session: Session) -> None: """Lint using ruff.""" session.install("ruff") - session.run("ruff", "check", ".") + # can't check the whole project because of the generated code + session.run("ruff", "check", "src/model_registry", "tests") @session(python=python_versions) @@ -42,7 +44,7 @@ def mypy(session: Session) -> None: session.install(".") session.install("mypy") - session.run("mypy", "src") + session.run("mypy", "src/model_registry") @session(python=python_versions) @@ -52,9 +54,10 @@ def tests(session: Session) -> None: session.install( "coverage[toml]", "pytest", + "pytest-asyncio", + "nest-asyncio", "pytest-cov", "pygments", - "testcontainers", "huggingface-hub", ) try: diff --git a/clients/python/openapitools.json b/clients/python/openapitools.json new file mode 100644 index 000000000..5c50d6a26 --- /dev/null +++ b/clients/python/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.6.0" + } +} diff --git a/clients/python/patches/asyncio-only.patch b/clients/python/patches/asyncio-only.patch new file mode 100644 index 000000000..0fb2a0a4e --- /dev/null +++ b/clients/python/patches/asyncio-only.patch @@ -0,0 +1,42 @@ +diff --git a/clients/python/src/mr_openapi/configuration.py b/clients/python/src/mr_openapi/configuration.py +index 795d09e8..bab01d69 100644 +--- a/clients/python/src/mr_openapi/configuration.py ++++ b/clients/python/src/mr_openapi/configuration.py +@@ -17,7 +17,6 @@ import logging + from logging import FileHandler + import sys + from typing import Optional +-import urllib3 + + import http.client as httplib + +@@ -110,7 +109,6 @@ class Configuration: + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("mr_openapi") +- self.logger["urllib3_logger"] = logging.getLogger("urllib3") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ +@@ -335,21 +333,6 @@ class Configuration: + else: + return key + +- def get_basic_auth_token(self): +- """Gets HTTP basic authentication header (string). +- +- :return: The token for basic HTTP authentication. +- """ +- username = "" +- if self.username is not None: +- username = self.username +- 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): + """Gets Auth Settings dict for api client. + diff --git a/clients/python/patches/fix-validators.patch b/clients/python/patches/fix-validators.patch new file mode 100644 index 000000000..34677c3a8 --- /dev/null +++ b/clients/python/patches/fix-validators.patch @@ -0,0 +1,24 @@ +diff --git a/clients/python/src/mr_openapi/models/doc_artifact.py b/clients/python/src/mr_openapi/models/doc_artifact.py +index 5e6a34a5..4f7c29bd 100644 +--- a/clients/python/src/mr_openapi/models/doc_artifact.py ++++ b/clients/python/src/mr_openapi/models/doc_artifact.py +@@ -104,6 +104,7 @@ class DocArtifact(BaseModel): + return cls.model_validate(obj) + + _obj = cls.model_validate({ ++ "artifactType": "doc-artifact", + "customProperties": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["customProperties"].items() +diff --git a/clients/python/src/mr_openapi/models/model_artifact.py b/clients/python/src/mr_openapi/models/model_artifact.py +index 380d1480..306d74d6 100644 +--- a/clients/python/src/mr_openapi/models/model_artifact.py ++++ b/clients/python/src/mr_openapi/models/model_artifact.py +@@ -109,6 +109,7 @@ class ModelArtifact(BaseModel): + return cls.model_validate(obj) + + _obj = cls.model_validate({ ++ "artifactType": "model-artifact", + "customProperties": dict( + (_k, MetadataValue.from_dict(_v)) + for _k, _v in obj["customProperties"].items() diff --git a/clients/python/poetry.lock b/clients/python/poetry.lock index f9fd4782e..16f089cbd 100644 --- a/clients/python/poetry.lock +++ b/clients/python/poetry.lock @@ -1,16 +1,129 @@ # This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. [[package]] -name = "absl-py" -version = "1.4.0" -description = "Abseil Python Common Libraries, see https://github.com/abseil/abseil-py." +name = "aiohttp" +version = "3.9.5" +description = "Async http client/server framework (asyncio)" optional = false -python-versions = ">=3.6" +python-versions = ">=3.8" +files = [ + {file = "aiohttp-3.9.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:fcde4c397f673fdec23e6b05ebf8d4751314fa7c24f93334bf1f1364c1c69ac7"}, + {file = "aiohttp-3.9.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:5d6b3f1fabe465e819aed2c421a6743d8debbde79b6a8600739300630a01bf2c"}, + {file = "aiohttp-3.9.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:6ae79c1bc12c34082d92bf9422764f799aee4746fd7a392db46b7fd357d4a17a"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4d3ebb9e1316ec74277d19c5f482f98cc65a73ccd5430540d6d11682cd857430"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84dabd95154f43a2ea80deffec9cb44d2e301e38a0c9d331cc4aa0166fe28ae3"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c8a02fbeca6f63cb1f0475c799679057fc9268b77075ab7cf3f1c600e81dd46b"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c26959ca7b75ff768e2776d8055bf9582a6267e24556bb7f7bd29e677932be72"}, + {file = "aiohttp-3.9.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:714d4e5231fed4ba2762ed489b4aec07b2b9953cf4ee31e9871caac895a839c0"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:e7a6a8354f1b62e15d48e04350f13e726fa08b62c3d7b8401c0a1314f02e3558"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:c413016880e03e69d166efb5a1a95d40f83d5a3a648d16486592c49ffb76d0db"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:ff84aeb864e0fac81f676be9f4685f0527b660f1efdc40dcede3c251ef1e867f"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:ad7f2919d7dac062f24d6f5fe95d401597fbb015a25771f85e692d043c9d7832"}, + {file = "aiohttp-3.9.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:702e2c7c187c1a498a4e2b03155d52658fdd6fda882d3d7fbb891a5cf108bb10"}, + {file = "aiohttp-3.9.5-cp310-cp310-win32.whl", hash = "sha256:67c3119f5ddc7261d47163ed86d760ddf0e625cd6246b4ed852e82159617b5fb"}, + {file = "aiohttp-3.9.5-cp310-cp310-win_amd64.whl", hash = "sha256:471f0ef53ccedec9995287f02caf0c068732f026455f07db3f01a46e49d76bbb"}, + {file = "aiohttp-3.9.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:e0ae53e33ee7476dd3d1132f932eeb39bf6125083820049d06edcdca4381f342"}, + {file = "aiohttp-3.9.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c088c4d70d21f8ca5c0b8b5403fe84a7bc8e024161febdd4ef04575ef35d474d"}, + {file = "aiohttp-3.9.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:639d0042b7670222f33b0028de6b4e2fad6451462ce7df2af8aee37dcac55424"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f26383adb94da5e7fb388d441bf09c61e5e35f455a3217bfd790c6b6bc64b2ee"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:66331d00fb28dc90aa606d9a54304af76b335ae204d1836f65797d6fe27f1ca2"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4ff550491f5492ab5ed3533e76b8567f4b37bd2995e780a1f46bca2024223233"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f22eb3a6c1080d862befa0a89c380b4dafce29dc6cd56083f630073d102eb595"}, + {file = "aiohttp-3.9.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a81b1143d42b66ffc40a441379387076243ef7b51019204fd3ec36b9f69e77d6"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:f64fd07515dad67f24b6ea4a66ae2876c01031de91c93075b8093f07c0a2d93d"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:93e22add827447d2e26d67c9ac0161756007f152fdc5210277d00a85f6c92323"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:55b39c8684a46e56ef8c8d24faf02de4a2b2ac60d26cee93bc595651ff545de9"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:4715a9b778f4293b9f8ae7a0a7cef9829f02ff8d6277a39d7f40565c737d3771"}, + {file = "aiohttp-3.9.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:afc52b8d969eff14e069a710057d15ab9ac17cd4b6753042c407dcea0e40bf75"}, + {file = "aiohttp-3.9.5-cp311-cp311-win32.whl", hash = "sha256:b3df71da99c98534be076196791adca8819761f0bf6e08e07fd7da25127150d6"}, + {file = "aiohttp-3.9.5-cp311-cp311-win_amd64.whl", hash = "sha256:88e311d98cc0bf45b62fc46c66753a83445f5ab20038bcc1b8a1cc05666f428a"}, + {file = "aiohttp-3.9.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:c7a4b7a6cf5b6eb11e109a9755fd4fda7d57395f8c575e166d363b9fc3ec4678"}, + {file = "aiohttp-3.9.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:0a158704edf0abcac8ac371fbb54044f3270bdbc93e254a82b6c82be1ef08f3c"}, + {file = "aiohttp-3.9.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:d153f652a687a8e95ad367a86a61e8d53d528b0530ef382ec5aaf533140ed00f"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:82a6a97d9771cb48ae16979c3a3a9a18b600a8505b1115cfe354dfb2054468b4"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:60cdbd56f4cad9f69c35eaac0fbbdf1f77b0ff9456cebd4902f3dd1cf096464c"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8676e8fd73141ded15ea586de0b7cda1542960a7b9ad89b2b06428e97125d4fa"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:da00da442a0e31f1c69d26d224e1efd3a1ca5bcbf210978a2ca7426dfcae9f58"}, + {file = "aiohttp-3.9.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:18f634d540dd099c262e9f887c8bbacc959847cfe5da7a0e2e1cf3f14dbf2daf"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:320e8618eda64e19d11bdb3bd04ccc0a816c17eaecb7e4945d01deee2a22f95f"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:2faa61a904b83142747fc6a6d7ad8fccff898c849123030f8e75d5d967fd4a81"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:8c64a6dc3fe5db7b1b4d2b5cb84c4f677768bdc340611eca673afb7cf416ef5a"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:393c7aba2b55559ef7ab791c94b44f7482a07bf7640d17b341b79081f5e5cd1a"}, + {file = "aiohttp-3.9.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c671dc117c2c21a1ca10c116cfcd6e3e44da7fcde37bf83b2be485ab377b25da"}, + {file = "aiohttp-3.9.5-cp312-cp312-win32.whl", hash = "sha256:5a7ee16aab26e76add4afc45e8f8206c95d1d75540f1039b84a03c3b3800dd59"}, + {file = "aiohttp-3.9.5-cp312-cp312-win_amd64.whl", hash = "sha256:5ca51eadbd67045396bc92a4345d1790b7301c14d1848feaac1d6a6c9289e888"}, + {file = "aiohttp-3.9.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:694d828b5c41255e54bc2dddb51a9f5150b4eefa9886e38b52605a05d96566e8"}, + {file = "aiohttp-3.9.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0605cc2c0088fcaae79f01c913a38611ad09ba68ff482402d3410bf59039bfb8"}, + {file = "aiohttp-3.9.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4558e5012ee03d2638c681e156461d37b7a113fe13970d438d95d10173d25f78"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dbc053ac75ccc63dc3a3cc547b98c7258ec35a215a92bd9f983e0aac95d3d5b"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4109adee842b90671f1b689901b948f347325045c15f46b39797ae1bf17019de"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6ea1a5b409a85477fd8e5ee6ad8f0e40bf2844c270955e09360418cfd09abac"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f3c2890ca8c59ee683fd09adf32321a40fe1cf164e3387799efb2acebf090c11"}, + {file = "aiohttp-3.9.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3916c8692dbd9d55c523374a3b8213e628424d19116ac4308e434dbf6d95bbdd"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:8d1964eb7617907c792ca00b341b5ec3e01ae8c280825deadbbd678447b127e1"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:d5ab8e1f6bee051a4bf6195e38a5c13e5e161cb7bad83d8854524798bd9fcd6e"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:52c27110f3862a1afbcb2af4281fc9fdc40327fa286c4625dfee247c3ba90156"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:7f64cbd44443e80094309875d4f9c71d0401e966d191c3d469cde4642bc2e031"}, + {file = "aiohttp-3.9.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8b4f72fbb66279624bfe83fd5eb6aea0022dad8eec62b71e7bf63ee1caadeafe"}, + {file = "aiohttp-3.9.5-cp38-cp38-win32.whl", hash = "sha256:6380c039ec52866c06d69b5c7aad5478b24ed11696f0e72f6b807cfb261453da"}, + {file = "aiohttp-3.9.5-cp38-cp38-win_amd64.whl", hash = "sha256:da22dab31d7180f8c3ac7c7635f3bcd53808f374f6aa333fe0b0b9e14b01f91a"}, + {file = "aiohttp-3.9.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:1732102949ff6087589408d76cd6dea656b93c896b011ecafff418c9661dc4ed"}, + {file = "aiohttp-3.9.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c6021d296318cb6f9414b48e6a439a7f5d1f665464da507e8ff640848ee2a58a"}, + {file = "aiohttp-3.9.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:239f975589a944eeb1bad26b8b140a59a3a320067fb3cd10b75c3092405a1372"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3b7b30258348082826d274504fbc7c849959f1989d86c29bc355107accec6cfb"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:cd2adf5c87ff6d8b277814a28a535b59e20bfea40a101db6b3bdca7e9926bc24"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e9a3d838441bebcf5cf442700e3963f58b5c33f015341f9ea86dcd7d503c07e2"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9e3a1ae66e3d0c17cf65c08968a5ee3180c5a95920ec2731f53343fac9bad106"}, + {file = "aiohttp-3.9.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9c69e77370cce2d6df5d12b4e12bdcca60c47ba13d1cbbc8645dd005a20b738b"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:0cbf56238f4bbf49dab8c2dc2e6b1b68502b1e88d335bea59b3f5b9f4c001475"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:d1469f228cd9ffddd396d9948b8c9cd8022b6d1bf1e40c6f25b0fb90b4f893ed"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:45731330e754f5811c314901cebdf19dd776a44b31927fa4b4dbecab9e457b0c"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:3fcb4046d2904378e3aeea1df51f697b0467f2aac55d232c87ba162709478c46"}, + {file = "aiohttp-3.9.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8cf142aa6c1a751fcb364158fd710b8a9be874b81889c2bd13aa8893197455e2"}, + {file = "aiohttp-3.9.5-cp39-cp39-win32.whl", hash = "sha256:7b179eea70833c8dee51ec42f3b4097bd6370892fa93f510f76762105568cf09"}, + {file = "aiohttp-3.9.5-cp39-cp39-win_amd64.whl", hash = "sha256:38d80498e2e169bc61418ff36170e0aad0cd268da8b38a17c4cf29d254a8b3f1"}, + {file = "aiohttp-3.9.5.tar.gz", hash = "sha256:edea7d15772ceeb29db4aff55e482d4bcfb6ae160ce144f2682de02f6d693551"}, +] + +[package.dependencies] +aiosignal = ">=1.1.2" +async-timeout = {version = ">=4.0,<5.0", markers = "python_version < \"3.11\""} +attrs = ">=17.3.0" +frozenlist = ">=1.1.1" +multidict = ">=4.5,<7.0" +yarl = ">=1.0,<2.0" + +[package.extras] +speedups = ["Brotli", "aiodns", "brotlicffi"] + +[[package]] +name = "aiohttp-retry" +version = "2.8.3" +description = "Simple retry client for aiohttp" +optional = false +python-versions = ">=3.7" +files = [ + {file = "aiohttp_retry-2.8.3-py3-none-any.whl", hash = "sha256:3aeeead8f6afe48272db93ced9440cf4eda8b6fd7ee2abb25357b7eb28525b45"}, + {file = "aiohttp_retry-2.8.3.tar.gz", hash = "sha256:9a8e637e31682ad36e1ff9f8bcba912fcfc7d7041722bc901a4b948da4d71ea9"}, +] + +[package.dependencies] +aiohttp = "*" + +[[package]] +name = "aiosignal" +version = "1.3.1" +description = "aiosignal: a list of registered asynchronous callbacks" +optional = false +python-versions = ">=3.7" files = [ - {file = "absl-py-1.4.0.tar.gz", hash = "sha256:d2c244d01048ba476e7c080bd2c6df5e141d211de80223460d5b3b8a2a58433d"}, - {file = "absl_py-1.4.0-py3-none-any.whl", hash = "sha256:0d3fe606adfa4f7db64792dd4c7aee4ee0c38ab75dfd353b7a83ed3e957fcb47"}, + {file = "aiosignal-1.3.1-py3-none-any.whl", hash = "sha256:f8376fb07dd1e86a584e4fcdec80b36b7f81aac666ebc724e2c090300dd83b17"}, + {file = "aiosignal-1.3.1.tar.gz", hash = "sha256:54cd96e15e1649b75d6c87526a6ff0b6c1b0dd3459f43d9ca11d48c339b68cfc"}, ] +[package.dependencies] +frozenlist = ">=1.1.0" + [[package]] name = "alabaster" version = "0.7.16" @@ -22,6 +135,17 @@ files = [ {file = "alabaster-0.7.16.tar.gz", hash = "sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65"}, ] +[[package]] +name = "annotated-types" +version = "0.7.0" +description = "Reusable constraint types to use with typing.Annotated" +optional = false +python-versions = ">=3.8" +files = [ + {file = "annotated_types-0.7.0-py3-none-any.whl", hash = "sha256:1f02e8b43a8fbbc3f3e0d4f0f4bfc8131bcb4eebe8849b8e5c773f3a1c582a53"}, + {file = "annotated_types-0.7.0.tar.gz", hash = "sha256:aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89"}, +] + [[package]] name = "anyio" version = "4.3.0" @@ -44,6 +168,17 @@ doc = ["Sphinx (>=7)", "packaging", "sphinx-autodoc-typehints (>=1.2.0)", "sphin test = ["anyio[trio]", "coverage[toml] (>=7)", "exceptiongroup (>=1.2.0)", "hypothesis (>=4.0)", "psutil (>=5.9)", "pytest (>=7.0)", "pytest-mock (>=3.6.1)", "trustme", "uvloop (>=0.17)"] trio = ["trio (>=0.23)"] +[[package]] +name = "async-timeout" +version = "4.0.3" +description = "Timeout context manager for asyncio programs" +optional = false +python-versions = ">=3.7" +files = [ + {file = "async-timeout-4.0.3.tar.gz", hash = "sha256:4640d96be84d82d02ed59ea2b7105a0f7b33abe8703703cd0ab0bf87c427522f"}, + {file = "async_timeout-4.0.3-py3-none-any.whl", hash = "sha256:7405140ff1230c310e51dc27b3145b9092d659ce68ff733fb0cefe3ee42be028"}, +] + [[package]] name = "attrs" version = "21.4.0" @@ -72,6 +207,9 @@ files = [ {file = "Babel-2.13.1.tar.gz", hash = "sha256:33e0952d7dd6374af8dbf6768cc4ddf3ccfefc244f9986d4074704f2fbd18900"}, ] +[package.dependencies] +setuptools = {version = "*", markers = "python_version >= \"3.12\""} + [package.extras] dev = ["freezegun (>=1.0,<2.0)", "pytest (>=6.0)", "pytest-cov"] @@ -295,28 +433,6 @@ tomli = {version = "*", optional = true, markers = "python_full_version <= \"3.1 [package.extras] toml = ["tomli"] -[[package]] -name = "docker" -version = "7.1.0" -description = "A Python library for the Docker Engine API." -optional = false -python-versions = ">=3.8" -files = [ - {file = "docker-7.1.0-py3-none-any.whl", hash = "sha256:c96b93b7f0a746f9e77d325bcfb87422a3d8bd4f03136ae8a85b37f1898d5fc0"}, - {file = "docker-7.1.0.tar.gz", hash = "sha256:ad8c70e6e3f8926cb8a92619b832b4ea5299e2831c14284663184e200546fa6c"}, -] - -[package.dependencies] -pywin32 = {version = ">=304", markers = "sys_platform == \"win32\""} -requests = ">=2.26.0" -urllib3 = ">=1.26.0" - -[package.extras] -dev = ["coverage (==7.2.7)", "pytest (==7.4.2)", "pytest-cov (==4.1.0)", "pytest-timeout (==2.1.0)", "ruff (==0.1.8)"] -docs = ["myst-parser (==0.18.0)", "sphinx (==5.1.1)"] -ssh = ["paramiko (>=2.4.3)"] -websockets = ["websocket-client (>=1.3.0)"] - [[package]] name = "docutils" version = "0.20.1" @@ -328,6 +444,20 @@ files = [ {file = "docutils-0.20.1.tar.gz", hash = "sha256:f08a4e276c3a1583a86dce3e34aba3fe04d02bba2dd51ed16106244e8a923e3b"}, ] +[[package]] +name = "eval-type-backport" +version = "0.2.0" +description = "Like `typing._eval_type`, but lets older Python versions use newer typing features." +optional = false +python-versions = ">=3.8" +files = [ + {file = "eval_type_backport-0.2.0-py3-none-any.whl", hash = "sha256:ac2f73d30d40c5a30a80b8739a789d6bb5e49fdffa66d7912667e2015d9c9933"}, + {file = "eval_type_backport-0.2.0.tar.gz", hash = "sha256:68796cfbc7371ebf923f03bdf7bef415f3ec098aeced24e054b253a0e78f7b37"}, +] + +[package.extras] +tests = ["pytest"] + [[package]] name = "exceptiongroup" version = "1.2.0" @@ -358,6 +488,92 @@ docs = ["furo (>=2023.9.10)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1 testing = ["covdefaults (>=2.3)", "coverage (>=7.3.2)", "diff-cover (>=8)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)", "pytest-timeout (>=2.2)"] typing = ["typing-extensions (>=4.8)"] +[[package]] +name = "frozenlist" +version = "1.4.1" +description = "A list-like structure which implements collections.abc.MutableSequence" +optional = false +python-versions = ">=3.8" +files = [ + {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:f9aa1878d1083b276b0196f2dfbe00c9b7e752475ed3b682025ff20c1c1f51ac"}, + {file = "frozenlist-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:29acab3f66f0f24674b7dc4736477bcd4bc3ad4b896f5f45379a67bce8b96868"}, + {file = "frozenlist-1.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:74fb4bee6880b529a0c6560885fce4dc95936920f9f20f53d99a213f7bf66776"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:590344787a90ae57d62511dd7c736ed56b428f04cd8c161fcc5e7232c130c69a"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:068b63f23b17df8569b7fdca5517edef76171cf3897eb68beb01341131fbd2ad"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5c849d495bf5154cd8da18a9eb15db127d4dba2968d88831aff6f0331ea9bd4c"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9750cc7fe1ae3b1611bb8cfc3f9ec11d532244235d75901fb6b8e42ce9229dfe"}, + {file = "frozenlist-1.4.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a9b2de4cf0cdd5bd2dee4c4f63a653c61d2408055ab77b151c1957f221cabf2a"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:0633c8d5337cb5c77acbccc6357ac49a1770b8c487e5b3505c57b949b4b82e98"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:27657df69e8801be6c3638054e202a135c7f299267f1a55ed3a598934f6c0d75"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:f9a3ea26252bd92f570600098783d1371354d89d5f6b7dfd87359d669f2109b5"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:4f57dab5fe3407b6c0c1cc907ac98e8a189f9e418f3b6e54d65a718aaafe3950"}, + {file = "frozenlist-1.4.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e02a0e11cf6597299b9f3bbd3f93d79217cb90cfd1411aec33848b13f5c656cc"}, + {file = "frozenlist-1.4.1-cp310-cp310-win32.whl", hash = "sha256:a828c57f00f729620a442881cc60e57cfcec6842ba38e1b19fd3e47ac0ff8dc1"}, + {file = "frozenlist-1.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:f56e2333dda1fe0f909e7cc59f021eba0d2307bc6f012a1ccf2beca6ba362439"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:a0cb6f11204443f27a1628b0e460f37fb30f624be6051d490fa7d7e26d4af3d0"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b46c8ae3a8f1f41a0d2ef350c0b6e65822d80772fe46b653ab6b6274f61d4a49"}, + {file = "frozenlist-1.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:fde5bd59ab5357e3853313127f4d3565fc7dad314a74d7b5d43c22c6a5ed2ced"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:722e1124aec435320ae01ee3ac7bec11a5d47f25d0ed6328f2273d287bc3abb0"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2471c201b70d58a0f0c1f91261542a03d9a5e088ed3dc6c160d614c01649c106"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c757a9dd70d72b076d6f68efdbb9bc943665ae954dad2801b874c8c69e185068"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f146e0911cb2f1da549fc58fc7bcd2b836a44b79ef871980d605ec392ff6b0d2"}, + {file = "frozenlist-1.4.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4f9c515e7914626b2a2e1e311794b4c35720a0be87af52b79ff8e1429fc25f19"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:c302220494f5c1ebeb0912ea782bcd5e2f8308037b3c7553fad0e48ebad6ad82"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:442acde1e068288a4ba7acfe05f5f343e19fac87bfc96d89eb886b0363e977ec"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:1b280e6507ea8a4fa0c0a7150b4e526a8d113989e28eaaef946cc77ffd7efc0a"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:fe1a06da377e3a1062ae5fe0926e12b84eceb8a50b350ddca72dc85015873f74"}, + {file = "frozenlist-1.4.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:db9e724bebd621d9beca794f2a4ff1d26eed5965b004a97f1f1685a173b869c2"}, + {file = "frozenlist-1.4.1-cp311-cp311-win32.whl", hash = "sha256:e774d53b1a477a67838a904131c4b0eef6b3d8a651f8b138b04f748fccfefe17"}, + {file = "frozenlist-1.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:fb3c2db03683b5767dedb5769b8a40ebb47d6f7f45b1b3e3b4b51ec8ad9d9825"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:1979bc0aeb89b33b588c51c54ab0161791149f2461ea7c7c946d95d5f93b56ae"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cc7b01b3754ea68a62bd77ce6020afaffb44a590c2289089289363472d13aedb"}, + {file = "frozenlist-1.4.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:c9c92be9fd329ac801cc420e08452b70e7aeab94ea4233a4804f0915c14eba9b"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5c3894db91f5a489fc8fa6a9991820f368f0b3cbdb9cd8849547ccfab3392d86"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ba60bb19387e13597fb059f32cd4d59445d7b18b69a745b8f8e5db0346f33480"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8aefbba5f69d42246543407ed2461db31006b0f76c4e32dfd6f42215a2c41d09"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:780d3a35680ced9ce682fbcf4cb9c2bad3136eeff760ab33707b71db84664e3a"}, + {file = "frozenlist-1.4.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9acbb16f06fe7f52f441bb6f413ebae6c37baa6ef9edd49cdd567216da8600cd"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:23b701e65c7b36e4bf15546a89279bd4d8675faabc287d06bbcfac7d3c33e1e6"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:3e0153a805a98f5ada7e09826255ba99fb4f7524bb81bf6b47fb702666484ae1"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:dd9b1baec094d91bf36ec729445f7769d0d0cf6b64d04d86e45baf89e2b9059b"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:1a4471094e146b6790f61b98616ab8e44f72661879cc63fa1049d13ef711e71e"}, + {file = "frozenlist-1.4.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:5667ed53d68d91920defdf4035d1cdaa3c3121dc0b113255124bcfada1cfa1b8"}, + {file = "frozenlist-1.4.1-cp312-cp312-win32.whl", hash = "sha256:beee944ae828747fd7cb216a70f120767fc9f4f00bacae8543c14a6831673f89"}, + {file = "frozenlist-1.4.1-cp312-cp312-win_amd64.whl", hash = "sha256:64536573d0a2cb6e625cf309984e2d873979709f2cf22839bf2d61790b448ad5"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:20b51fa3f588ff2fe658663db52a41a4f7aa6c04f6201449c6c7c476bd255c0d"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:410478a0c562d1a5bcc2f7ea448359fcb050ed48b3c6f6f4f18c313a9bdb1826"}, + {file = "frozenlist-1.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c6321c9efe29975232da3bd0af0ad216800a47e93d763ce64f291917a381b8eb"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:48f6a4533887e189dae092f1cf981f2e3885175f7a0f33c91fb5b7b682b6bab6"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6eb73fa5426ea69ee0e012fb59cdc76a15b1283d6e32e4f8dc4482ec67d1194d"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:fbeb989b5cc29e8daf7f976b421c220f1b8c731cbf22b9130d8815418ea45887"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:32453c1de775c889eb4e22f1197fe3bdfe457d16476ea407472b9442e6295f7a"}, + {file = "frozenlist-1.4.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:693945278a31f2086d9bf3df0fe8254bbeaef1fe71e1351c3bd730aa7d31c41b"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:1d0ce09d36d53bbbe566fe296965b23b961764c0bcf3ce2fa45f463745c04701"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:3a670dc61eb0d0eb7080890c13de3066790f9049b47b0de04007090807c776b0"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:dca69045298ce5c11fd539682cff879cc1e664c245d1c64da929813e54241d11"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:a06339f38e9ed3a64e4c4e43aec7f59084033647f908e4259d279a52d3757d09"}, + {file = "frozenlist-1.4.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:b7f2f9f912dca3934c1baec2e4585a674ef16fe00218d833856408c48d5beee7"}, + {file = "frozenlist-1.4.1-cp38-cp38-win32.whl", hash = "sha256:e7004be74cbb7d9f34553a5ce5fb08be14fb33bc86f332fb71cbe5216362a497"}, + {file = "frozenlist-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:5a7d70357e7cee13f470c7883a063aae5fe209a493c57d86eb7f5a6f910fae09"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:bfa4a17e17ce9abf47a74ae02f32d014c5e9404b6d9ac7f729e01562bbee601e"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b7e3ed87d4138356775346e6845cccbe66cd9e207f3cd11d2f0b9fd13681359d"}, + {file = "frozenlist-1.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:c99169d4ff810155ca50b4da3b075cbde79752443117d89429595c2e8e37fed8"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:edb678da49d9f72c9f6c609fbe41a5dfb9a9282f9e6a2253d5a91e0fc382d7c0"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:6db4667b187a6742b33afbbaf05a7bc551ffcf1ced0000a571aedbb4aa42fc7b"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55fdc093b5a3cb41d420884cdaf37a1e74c3c37a31f46e66286d9145d2063bd0"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:82e8211d69a4f4bc360ea22cd6555f8e61a1bd211d1d5d39d3d228b48c83a897"}, + {file = "frozenlist-1.4.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:89aa2c2eeb20957be2d950b85974b30a01a762f3308cd02bb15e1ad632e22dc7"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9d3e0c25a2350080e9319724dede4f31f43a6c9779be48021a7f4ebde8b2d742"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7268252af60904bf52c26173cbadc3a071cece75f873705419c8681f24d3edea"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:0c250a29735d4f15321007fb02865f0e6b6a41a6b88f1f523ca1596ab5f50bd5"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:96ec70beabbd3b10e8bfe52616a13561e58fe84c0101dd031dc78f250d5128b9"}, + {file = "frozenlist-1.4.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:23b2d7679b73fe0e5a4560b672a39f98dfc6f60df63823b0a9970525325b95f6"}, + {file = "frozenlist-1.4.1-cp39-cp39-win32.whl", hash = "sha256:a7496bfe1da7fb1a4e1cc23bb67c58fab69311cc7d32b5a99c2007b4b2a0e932"}, + {file = "frozenlist-1.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:e6a20a581f9ce92d389a8c7d7c3dd47c81fd5d6e655c8dddf341e14aa48659d0"}, + {file = "frozenlist-1.4.1-py3-none-any.whl", hash = "sha256:04ced3e6a46b4cfffe20f9ae482818e34eba9b5fb0ce4056e4cc9b6e212d09b7"}, + {file = "frozenlist-1.4.1.tar.gz", hash = "sha256:c037a86e8513059a2613aaba4d817bb90b9d9b6b69aace3ce9c877e8c8ed402b"}, +] + [[package]] name = "fsspec" version = "2023.12.2" @@ -410,72 +626,6 @@ pygments = ">=2.7" sphinx = ">=6.0,<8.0" sphinx-basic-ng = ">=1.0.0.beta2" -[[package]] -name = "grpcio" -version = "1.59.3" -description = "HTTP/2-based RPC framework" -optional = false -python-versions = ">=3.7" -files = [ - {file = "grpcio-1.59.3-cp310-cp310-linux_armv7l.whl", hash = "sha256:aca028a6c7806e5b61e5f9f4232432c52856f7fcb98e330b20b6bc95d657bdcc"}, - {file = "grpcio-1.59.3-cp310-cp310-macosx_12_0_universal2.whl", hash = "sha256:19ad26a7967f7999c8960d2b9fe382dae74c55b0c508c613a6c2ba21cddf2354"}, - {file = "grpcio-1.59.3-cp310-cp310-manylinux_2_17_aarch64.whl", hash = "sha256:72b71dad2a3d1650e69ad42a5c4edbc59ee017f08c32c95694172bc501def23c"}, - {file = "grpcio-1.59.3-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c0f0a11d82d0253656cc42e04b6a149521e02e755fe2e4edd21123de610fd1d4"}, - {file = "grpcio-1.59.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:60cddafb70f9a2c81ba251b53b4007e07cca7389e704f86266e22c4bffd8bf1d"}, - {file = "grpcio-1.59.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6c75a1fa0e677c1d2b6d4196ad395a5c381dfb8385f07ed034ef667cdcdbcc25"}, - {file = "grpcio-1.59.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:e1d8e01438d5964a11167eec1edb5f85ed8e475648f36c834ed5db4ffba24ac8"}, - {file = "grpcio-1.59.3-cp310-cp310-win32.whl", hash = "sha256:c4b0076f0bf29ee62335b055a9599f52000b7941f577daa001c7ef961a1fbeab"}, - {file = "grpcio-1.59.3-cp310-cp310-win_amd64.whl", hash = "sha256:b1f00a3e6e0c3dccccffb5579fc76ebfe4eb40405ba308505b41ef92f747746a"}, - {file = "grpcio-1.59.3-cp311-cp311-linux_armv7l.whl", hash = "sha256:3996aaa21231451161dc29df6a43fcaa8b332042b6150482c119a678d007dd86"}, - {file = "grpcio-1.59.3-cp311-cp311-macosx_10_10_universal2.whl", hash = "sha256:cb4e9cbd9b7388fcb06412da9f188c7803742d06d6f626304eb838d1707ec7e3"}, - {file = "grpcio-1.59.3-cp311-cp311-manylinux_2_17_aarch64.whl", hash = "sha256:8022ca303d6c694a0d7acfb2b472add920217618d3a99eb4b14edc7c6a7e8fcf"}, - {file = "grpcio-1.59.3-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b36683fad5664283755a7f4e2e804e243633634e93cd798a46247b8e54e3cb0d"}, - {file = "grpcio-1.59.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8239b853226e4824e769517e1b5232e7c4dda3815b200534500338960fcc6118"}, - {file = "grpcio-1.59.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:0511af8653fbda489ff11d542a08505d56023e63cafbda60e6e00d4e0bae86ea"}, - {file = "grpcio-1.59.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e78dc982bda74cef2ddfce1c91d29b96864c4c680c634e279ed204d51e227473"}, - {file = "grpcio-1.59.3-cp311-cp311-win32.whl", hash = "sha256:6a5c3a96405966c023e139c3bcccb2c7c776a6f256ac6d70f8558c9041bdccc3"}, - {file = "grpcio-1.59.3-cp311-cp311-win_amd64.whl", hash = "sha256:ed26826ee423b11477297b187371cdf4fa1eca874eb1156422ef3c9a60590dd9"}, - {file = "grpcio-1.59.3-cp312-cp312-linux_armv7l.whl", hash = "sha256:45dddc5cb5227d30fa43652d8872dc87f086d81ab4b500be99413bad0ae198d7"}, - {file = "grpcio-1.59.3-cp312-cp312-macosx_10_10_universal2.whl", hash = "sha256:1736496d74682e53dd0907fd515f2694d8e6a96c9a359b4080b2504bf2b2d91b"}, - {file = "grpcio-1.59.3-cp312-cp312-manylinux_2_17_aarch64.whl", hash = "sha256:ddbd1a16138e52e66229047624de364f88a948a4d92ba20e4e25ad7d22eef025"}, - {file = "grpcio-1.59.3-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:fcfa56f8d031ffda902c258c84c4b88707f3a4be4827b4e3ab8ec7c24676320d"}, - {file = "grpcio-1.59.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f2eb8f0c7c0c62f7a547ad7a91ba627a5aa32a5ae8d930783f7ee61680d7eb8d"}, - {file = "grpcio-1.59.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:8d993399cc65e3a34f8fd48dd9ad7a376734564b822e0160dd18b3d00c1a33f9"}, - {file = "grpcio-1.59.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:c0bd141f4f41907eb90bda74d969c3cb21c1c62779419782a5b3f5e4b5835718"}, - {file = "grpcio-1.59.3-cp312-cp312-win32.whl", hash = "sha256:33b8fd65d4e97efa62baec6171ce51f9cf68f3a8ba9f866f4abc9d62b5c97b79"}, - {file = "grpcio-1.59.3-cp312-cp312-win_amd64.whl", hash = "sha256:0e735ed002f50d4f3cb9ecfe8ac82403f5d842d274c92d99db64cfc998515e07"}, - {file = "grpcio-1.59.3-cp37-cp37m-linux_armv7l.whl", hash = "sha256:ea40ce4404e7cca0724c91a7404da410f0144148fdd58402a5942971e3469b94"}, - {file = "grpcio-1.59.3-cp37-cp37m-macosx_10_10_universal2.whl", hash = "sha256:83113bcc393477b6f7342b9f48e8a054330c895205517edc66789ceea0796b53"}, - {file = "grpcio-1.59.3-cp37-cp37m-manylinux_2_17_aarch64.whl", hash = "sha256:73afbac602b8f1212a50088193601f869b5073efa9855b3e51aaaec97848fc8a"}, - {file = "grpcio-1.59.3-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:575d61de1950b0b0699917b686b1ca108690702fcc2df127b8c9c9320f93e069"}, - {file = "grpcio-1.59.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8cd76057b5c9a4d68814610ef9226925f94c1231bbe533fdf96f6181f7d2ff9e"}, - {file = "grpcio-1.59.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:95d6fd804c81efe4879e38bfd84d2b26e339a0a9b797e7615e884ef4686eb47b"}, - {file = "grpcio-1.59.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:0d42048b8a3286ea4134faddf1f9a59cf98192b94aaa10d910a25613c5eb5bfb"}, - {file = "grpcio-1.59.3-cp37-cp37m-win_amd64.whl", hash = "sha256:4619fea15c64bcdd9d447cdbdde40e3d5f1da3a2e8ae84103d94a9c1df210d7e"}, - {file = "grpcio-1.59.3-cp38-cp38-linux_armv7l.whl", hash = "sha256:95b5506e70284ac03b2005dd9ffcb6708c9ae660669376f0192a710687a22556"}, - {file = "grpcio-1.59.3-cp38-cp38-macosx_10_10_universal2.whl", hash = "sha256:9e17660947660ccfce56c7869032910c179a5328a77b73b37305cd1ee9301c2e"}, - {file = "grpcio-1.59.3-cp38-cp38-manylinux_2_17_aarch64.whl", hash = "sha256:00912ce19914d038851be5cd380d94a03f9d195643c28e3ad03d355cc02ce7e8"}, - {file = "grpcio-1.59.3-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e58b3cadaa3c90f1efca26ba33e0d408b35b497307027d3d707e4bcd8de862a6"}, - {file = "grpcio-1.59.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d787ecadea865bdf78f6679f6f5bf4b984f18f659257ba612979df97a298b3c3"}, - {file = "grpcio-1.59.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:0814942ba1bba269db4e760a34388640c601dece525c6a01f3b4ff030cc0db69"}, - {file = "grpcio-1.59.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:fb111aa99d3180c361a35b5ae1e2c63750220c584a1344229abc139d5c891881"}, - {file = "grpcio-1.59.3-cp38-cp38-win32.whl", hash = "sha256:eb8ba504c726befe40a356ecbe63c6c3c64c9a439b3164f5a718ec53c9874da0"}, - {file = "grpcio-1.59.3-cp38-cp38-win_amd64.whl", hash = "sha256:cdbc6b32fadab9bebc6f49d3e7ec4c70983c71e965497adab7f87de218e84391"}, - {file = "grpcio-1.59.3-cp39-cp39-linux_armv7l.whl", hash = "sha256:c82ca1e4be24a98a253d6dbaa216542e4163f33f38163fc77964b0f0d255b552"}, - {file = "grpcio-1.59.3-cp39-cp39-macosx_10_10_universal2.whl", hash = "sha256:36636babfda14f9e9687f28d5b66d349cf88c1301154dc71c6513de2b6c88c59"}, - {file = "grpcio-1.59.3-cp39-cp39-manylinux_2_17_aarch64.whl", hash = "sha256:5f9b2e591da751ac7fdd316cc25afafb7a626dededa9b414f90faad7f3ccebdb"}, - {file = "grpcio-1.59.3-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a93a82876a4926bf451db82ceb725bd87f42292bacc94586045261f501a86994"}, - {file = "grpcio-1.59.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce31fa0bfdd1f2bb15b657c16105c8652186eab304eb512e6ae3b99b2fdd7d13"}, - {file = "grpcio-1.59.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:16da0e40573962dab6cba16bec31f25a4f468e6d05b658e589090fe103b03e3d"}, - {file = "grpcio-1.59.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:d1d1a17372fd425addd5812049fa7374008ffe689585f27f802d0935522cf4b7"}, - {file = "grpcio-1.59.3-cp39-cp39-win32.whl", hash = "sha256:52cc38a7241b5f7b4a91aaf9000fdd38e26bb00d5e8a71665ce40cfcee716281"}, - {file = "grpcio-1.59.3-cp39-cp39-win_amd64.whl", hash = "sha256:b491e5bbcad3020a96842040421e508780cade35baba30f402df9d321d1c423e"}, - {file = "grpcio-1.59.3.tar.gz", hash = "sha256:7800f99568a74a06ebdccd419dd1b6e639b477dcaf6da77ea702f8fb14ce5f80"}, -] - -[package.extras] -protobuf = ["grpcio-tools (>=1.59.3)"] - [[package]] name = "h11" version = "0.14.0" @@ -734,30 +884,104 @@ files = [ ] [[package]] -name = "ml-metadata" -version = "1.14.0" -description = "A library for maintaining metadata for artifacts." +name = "multidict" +version = "6.0.5" +description = "multidict implementation" optional = false -python-versions = ">=3.8,<4" +python-versions = ">=3.7" files = [ - {file = "ml_metadata-1.14.0-cp310-cp310-macosx_12_0_x86_64.whl", hash = "sha256:50ef7c83e917f591639447e8b395fb97abded9a86be9afddab79b2155eb5a32c"}, - {file = "ml_metadata-1.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:69bd8690c0c54a9332f4958ec4c541d44f994a7d7e382801fa242e63b182ec37"}, - {file = "ml_metadata-1.14.0-cp310-cp310-win_amd64.whl", hash = "sha256:367e9bfe8449baed86242ba0ffc7956b0e8cac1d0bb0ccb296ff5634410fd07b"}, - {file = "ml_metadata-1.14.0-cp38-cp38-macosx_12_0_x86_64.whl", hash = "sha256:8823d01fa3488a6918ce8c7b318929b71aff0774c238b2426cc469d2ee115efd"}, - {file = "ml_metadata-1.14.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ebaabd99c1028a98a947787a9d195b752c787270bc5105b2414cdefb0204c0d0"}, - {file = "ml_metadata-1.14.0-cp38-cp38-win_amd64.whl", hash = "sha256:b40be36440a63b40a4a788a40fbbe37c086cc89977867f10ae17150146474098"}, - {file = "ml_metadata-1.14.0-cp39-cp39-macosx_12_0_x86_64.whl", hash = "sha256:5671da7d3f765fb37d7c2a302d597ad0adeaf9655bf0e59dbe06ff7e9f6b155e"}, - {file = "ml_metadata-1.14.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:92bdfccdfe3755ad1545ed052c84f47880713ce49e72a5fcc395ad6699ccedd9"}, - {file = "ml_metadata-1.14.0-cp39-cp39-win_amd64.whl", hash = "sha256:8dd44943c61716a9086635f24b75c3b18e1bee33cf5a600600616f0307400845"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:228b644ae063c10e7f324ab1ab6b548bdf6f8b47f3ec234fef1093bc2735e5f9"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:896ebdcf62683551312c30e20614305f53125750803b614e9e6ce74a96232604"}, + {file = "multidict-6.0.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:411bf8515f3be9813d06004cac41ccf7d1cd46dfe233705933dd163b60e37600"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1d147090048129ce3c453f0292e7697d333db95e52616b3793922945804a433c"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:215ed703caf15f578dca76ee6f6b21b7603791ae090fbf1ef9d865571039ade5"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7c6390cf87ff6234643428991b7359b5f59cc15155695deb4eda5c777d2b880f"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:21fd81c4ebdb4f214161be351eb5bcf385426bf023041da2fd9e60681f3cebae"}, + {file = "multidict-6.0.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3cc2ad10255f903656017363cd59436f2111443a76f996584d1077e43ee51182"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6939c95381e003f54cd4c5516740faba40cf5ad3eeff460c3ad1d3e0ea2549bf"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:220dd781e3f7af2c2c1053da9fa96d9cf3072ca58f057f4c5adaaa1cab8fc442"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:766c8f7511df26d9f11cd3a8be623e59cca73d44643abab3f8c8c07620524e4a"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:fe5d7785250541f7f5019ab9cba2c71169dc7d74d0f45253f8313f436458a4ef"}, + {file = "multidict-6.0.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c1c1496e73051918fcd4f58ff2e0f2f3066d1c76a0c6aeffd9b45d53243702cc"}, + {file = "multidict-6.0.5-cp310-cp310-win32.whl", hash = "sha256:7afcdd1fc07befad18ec4523a782cde4e93e0a2bf71239894b8d61ee578c1319"}, + {file = "multidict-6.0.5-cp310-cp310-win_amd64.whl", hash = "sha256:99f60d34c048c5c2fabc766108c103612344c46e35d4ed9ae0673d33c8fb26e8"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:f285e862d2f153a70586579c15c44656f888806ed0e5b56b64489afe4a2dbfba"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:53689bb4e102200a4fafa9de9c7c3c212ab40a7ab2c8e474491914d2305f187e"}, + {file = "multidict-6.0.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:612d1156111ae11d14afaf3a0669ebf6c170dbb735e510a7438ffe2369a847fd"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7be7047bd08accdb7487737631d25735c9a04327911de89ff1b26b81745bd4e3"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de170c7b4fe6859beb8926e84f7d7d6c693dfe8e27372ce3b76f01c46e489fcf"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:04bde7a7b3de05732a4eb39c94574db1ec99abb56162d6c520ad26f83267de29"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:85f67aed7bb647f93e7520633d8f51d3cbc6ab96957c71272b286b2f30dc70ed"}, + {file = "multidict-6.0.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:425bf820055005bfc8aa9a0b99ccb52cc2f4070153e34b701acc98d201693733"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d3eb1ceec286eba8220c26f3b0096cf189aea7057b6e7b7a2e60ed36b373b77f"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:7901c05ead4b3fb75113fb1dd33eb1253c6d3ee37ce93305acd9d38e0b5f21a4"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:e0e79d91e71b9867c73323a3444724d496c037e578a0e1755ae159ba14f4f3d1"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:29bfeb0dff5cb5fdab2023a7a9947b3b4af63e9c47cae2a10ad58394b517fddc"}, + {file = "multidict-6.0.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e030047e85cbcedbfc073f71836d62dd5dadfbe7531cae27789ff66bc551bd5e"}, + {file = "multidict-6.0.5-cp311-cp311-win32.whl", hash = "sha256:2f4848aa3baa109e6ab81fe2006c77ed4d3cd1e0ac2c1fbddb7b1277c168788c"}, + {file = "multidict-6.0.5-cp311-cp311-win_amd64.whl", hash = "sha256:2faa5ae9376faba05f630d7e5e6be05be22913782b927b19d12b8145968a85ea"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:51d035609b86722963404f711db441cf7134f1889107fb171a970c9701f92e1e"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:cbebcd5bcaf1eaf302617c114aa67569dd3f090dd0ce8ba9e35e9985b41ac35b"}, + {file = "multidict-6.0.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2ffc42c922dbfddb4a4c3b438eb056828719f07608af27d163191cb3e3aa6cc5"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ceb3b7e6a0135e092de86110c5a74e46bda4bd4fbfeeb3a3bcec79c0f861e450"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:79660376075cfd4b2c80f295528aa6beb2058fd289f4c9252f986751a4cd0496"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e4428b29611e989719874670fd152b6625500ad6c686d464e99f5aaeeaca175a"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d84a5c3a5f7ce6db1f999fb9438f686bc2e09d38143f2d93d8406ed2dd6b9226"}, + {file = "multidict-6.0.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:76c0de87358b192de7ea9649beb392f107dcad9ad27276324c24c91774ca5271"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:79a6d2ba910adb2cbafc95dad936f8b9386e77c84c35bc0add315b856d7c3abb"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:92d16a3e275e38293623ebf639c471d3e03bb20b8ebb845237e0d3664914caef"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:fb616be3538599e797a2017cccca78e354c767165e8858ab5116813146041a24"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:14c2976aa9038c2629efa2c148022ed5eb4cb939e15ec7aace7ca932f48f9ba6"}, + {file = "multidict-6.0.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:435a0984199d81ca178b9ae2c26ec3d49692d20ee29bc4c11a2a8d4514c67eda"}, + {file = "multidict-6.0.5-cp312-cp312-win32.whl", hash = "sha256:9fe7b0653ba3d9d65cbe7698cca585bf0f8c83dbbcc710db9c90f478e175f2d5"}, + {file = "multidict-6.0.5-cp312-cp312-win_amd64.whl", hash = "sha256:01265f5e40f5a17f8241d52656ed27192be03bfa8764d88e8220141d1e4b3556"}, + {file = "multidict-6.0.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:19fe01cea168585ba0f678cad6f58133db2aa14eccaf22f88e4a6dccadfad8b3"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6bf7a982604375a8d49b6cc1b781c1747f243d91b81035a9b43a2126c04766f5"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:107c0cdefe028703fb5dafe640a409cb146d44a6ae201e55b35a4af8e95457dd"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:403c0911cd5d5791605808b942c88a8155c2592e05332d2bf78f18697a5fa15e"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aeaf541ddbad8311a87dd695ed9642401131ea39ad7bc8cf3ef3967fd093b626"}, + {file = "multidict-6.0.5-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e4972624066095e52b569e02b5ca97dbd7a7ddd4294bf4e7247d52635630dd83"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d946b0a9eb8aaa590df1fe082cee553ceab173e6cb5b03239716338629c50c7a"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b55358304d7a73d7bdf5de62494aaf70bd33015831ffd98bc498b433dfe5b10c"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:a3145cb08d8625b2d3fee1b2d596a8766352979c9bffe5d7833e0503d0f0b5e5"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:d65f25da8e248202bd47445cec78e0025c0fe7582b23ec69c3b27a640dd7a8e3"}, + {file = "multidict-6.0.5-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:c9bf56195c6bbd293340ea82eafd0071cb3d450c703d2c93afb89f93b8386ccc"}, + {file = "multidict-6.0.5-cp37-cp37m-win32.whl", hash = "sha256:69db76c09796b313331bb7048229e3bee7928eb62bab5e071e9f7fcc4879caee"}, + {file = "multidict-6.0.5-cp37-cp37m-win_amd64.whl", hash = "sha256:fce28b3c8a81b6b36dfac9feb1de115bab619b3c13905b419ec71d03a3fc1423"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:76f067f5121dcecf0d63a67f29080b26c43c71a98b10c701b0677e4a065fbd54"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b82cc8ace10ab5bd93235dfaab2021c70637005e1ac787031f4d1da63d493c1d"}, + {file = "multidict-6.0.5-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:5cb241881eefd96b46f89b1a056187ea8e9ba14ab88ba632e68d7a2ecb7aadf7"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e8e94e6912639a02ce173341ff62cc1201232ab86b8a8fcc05572741a5dc7d93"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:09a892e4a9fb47331da06948690ae38eaa2426de97b4ccbfafbdcbe5c8f37ff8"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:55205d03e8a598cfc688c71ca8ea5f66447164efff8869517f175ea632c7cb7b"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:37b15024f864916b4951adb95d3a80c9431299080341ab9544ed148091b53f50"}, + {file = "multidict-6.0.5-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2a1dee728b52b33eebff5072817176c172050d44d67befd681609b4746e1c2e"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:edd08e6f2f1a390bf137080507e44ccc086353c8e98c657e666c017718561b89"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:60d698e8179a42ec85172d12f50b1668254628425a6bd611aba022257cac1386"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:3d25f19500588cbc47dc19081d78131c32637c25804df8414463ec908631e453"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:4cc0ef8b962ac7a5e62b9e826bd0cd5040e7d401bc45a6835910ed699037a461"}, + {file = "multidict-6.0.5-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:eca2e9d0cc5a889850e9bbd68e98314ada174ff6ccd1129500103df7a94a7a44"}, + {file = "multidict-6.0.5-cp38-cp38-win32.whl", hash = "sha256:4a6a4f196f08c58c59e0b8ef8ec441d12aee4125a7d4f4fef000ccb22f8d7241"}, + {file = "multidict-6.0.5-cp38-cp38-win_amd64.whl", hash = "sha256:0275e35209c27a3f7951e1ce7aaf93ce0d163b28948444bec61dd7badc6d3f8c"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e7be68734bd8c9a513f2b0cfd508802d6609da068f40dc57d4e3494cefc92929"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1d9ea7a7e779d7a3561aade7d596649fbecfa5c08a7674b11b423783217933f9"}, + {file = "multidict-6.0.5-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ea1456df2a27c73ce51120fa2f519f1bea2f4a03a917f4a43c8707cf4cbbae1a"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cf590b134eb70629e350691ecca88eac3e3b8b3c86992042fb82e3cb1830d5e1"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5c0631926c4f58e9a5ccce555ad7747d9a9f8b10619621f22f9635f069f6233e"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dce1c6912ab9ff5f179eaf6efe7365c1f425ed690b03341911bf4939ef2f3046"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0868d64af83169e4d4152ec612637a543f7a336e4a307b119e98042e852ad9c"}, + {file = "multidict-6.0.5-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:141b43360bfd3bdd75f15ed811850763555a251e38b2405967f8e25fb43f7d40"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:7df704ca8cf4a073334e0427ae2345323613e4df18cc224f647f251e5e75a527"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:6214c5a5571802c33f80e6c84713b2c79e024995b9c5897f794b43e714daeec9"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:cd6c8fca38178e12c00418de737aef1261576bd1b6e8c6134d3e729a4e858b38"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:e02021f87a5b6932fa6ce916ca004c4d441509d33bbdbeca70d05dff5e9d2479"}, + {file = "multidict-6.0.5-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:ebd8d160f91a764652d3e51ce0d2956b38efe37c9231cd82cfc0bed2e40b581c"}, + {file = "multidict-6.0.5-cp39-cp39-win32.whl", hash = "sha256:04da1bb8c8dbadf2a18a452639771951c662c5ad03aefe4884775454be322c9b"}, + {file = "multidict-6.0.5-cp39-cp39-win_amd64.whl", hash = "sha256:d6f6d4f185481c9669b9447bf9d9cf3b95a0e9df9d169bbc17e363b7d5487755"}, + {file = "multidict-6.0.5-py3-none-any.whl", hash = "sha256:0d63c74e3d7ab26de115c49bffc92cc77ed23395303d496eae515d4204a625e7"}, + {file = "multidict-6.0.5.tar.gz", hash = "sha256:f7e301075edaf50500f0b341543c41194d8df3ae5caf4702f2095f3ca73dd8da"}, ] -[package.dependencies] -absl-py = ">=0.9,<2.0.0" -attrs = ">=20.3,<22" -grpcio = ">=1.8.6,<2" -protobuf = ">=3.13,<4" -six = ">=1.10,<2" - [[package]] name = "mypy" version = "1.10.0" @@ -843,6 +1067,17 @@ rtd = ["ipython", "sphinx (>=7)", "sphinx-autodoc2 (>=0.5.0,<0.6.0)", "sphinx-bo testing = ["beautifulsoup4", "coverage[toml]", "defusedxml", "pytest (>=8,<9)", "pytest-cov", "pytest-param-files (>=0.6.0,<0.7.0)", "pytest-regressions", "sphinx-pytest"] testing-docutils = ["pygments", "pytest (>=8,<9)", "pytest-param-files (>=0.6.0,<0.7.0)"] +[[package]] +name = "nest-asyncio" +version = "1.6.0" +description = "Patch asyncio to allow nested event loops" +optional = false +python-versions = ">=3.5" +files = [ + {file = "nest_asyncio-1.6.0-py3-none-any.whl", hash = "sha256:87af6efd6b5e897c81050477ef65c62e2b2f35d51703cae01aff2905b1852e1c"}, + {file = "nest_asyncio-1.6.0.tar.gz", hash = "sha256:6f172d5449aca15afd6c646851f4e31e02c598d553a667e38cafa997cfec55fe"}, +] + [[package]] name = "packaging" version = "23.2" @@ -870,36 +1105,115 @@ dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] [[package]] -name = "protobuf" -version = "3.20.3" -description = "Protocol Buffers" +name = "pydantic" +version = "2.7.4" +description = "Data validation using Python type hints" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" +files = [ + {file = "pydantic-2.7.4-py3-none-any.whl", hash = "sha256:ee8538d41ccb9c0a9ad3e0e5f07bf15ed8015b481ced539a1759d8cc89ae90d0"}, + {file = "pydantic-2.7.4.tar.gz", hash = "sha256:0c84efd9548d545f63ac0060c1e4d39bb9b14db8b3c0652338aecc07b5adec52"}, +] + +[package.dependencies] +annotated-types = ">=0.4.0" +pydantic-core = "2.18.4" +typing-extensions = ">=4.6.1" + +[package.extras] +email = ["email-validator (>=2.0.0)"] + +[[package]] +name = "pydantic-core" +version = "2.18.4" +description = "Core functionality for Pydantic validation and serialization" +optional = false +python-versions = ">=3.8" files = [ - {file = "protobuf-3.20.3-cp310-cp310-manylinux2014_aarch64.whl", hash = "sha256:f4bd856d702e5b0d96a00ec6b307b0f51c1982c2bf9c0052cf9019e9a544ba99"}, - {file = "protobuf-3.20.3-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:9aae4406ea63d825636cc11ffb34ad3379335803216ee3a856787bcf5ccc751e"}, - {file = "protobuf-3.20.3-cp310-cp310-win32.whl", hash = "sha256:28545383d61f55b57cf4df63eebd9827754fd2dc25f80c5253f9184235db242c"}, - {file = "protobuf-3.20.3-cp310-cp310-win_amd64.whl", hash = "sha256:67a3598f0a2dcbc58d02dd1928544e7d88f764b47d4a286202913f0b2801c2e7"}, - {file = "protobuf-3.20.3-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:899dc660cd599d7352d6f10d83c95df430a38b410c1b66b407a6b29265d66469"}, - {file = "protobuf-3.20.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:e64857f395505ebf3d2569935506ae0dfc4a15cb80dc25261176c784662cdcc4"}, - {file = "protobuf-3.20.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:d9e4432ff660d67d775c66ac42a67cf2453c27cb4d738fc22cb53b5d84c135d4"}, - {file = "protobuf-3.20.3-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:74480f79a023f90dc6e18febbf7b8bac7508420f2006fabd512013c0c238f454"}, - {file = "protobuf-3.20.3-cp37-cp37m-win32.whl", hash = "sha256:b6cc7ba72a8850621bfec987cb72623e703b7fe2b9127a161ce61e61558ad905"}, - {file = "protobuf-3.20.3-cp37-cp37m-win_amd64.whl", hash = "sha256:8c0c984a1b8fef4086329ff8dd19ac77576b384079247c770f29cc8ce3afa06c"}, - {file = "protobuf-3.20.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:de78575669dddf6099a8a0f46a27e82a1783c557ccc38ee620ed8cc96d3be7d7"}, - {file = "protobuf-3.20.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:f4c42102bc82a51108e449cbb32b19b180022941c727bac0cfd50170341f16ee"}, - {file = "protobuf-3.20.3-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:44246bab5dd4b7fbd3c0c80b6f16686808fab0e4aca819ade6e8d294a29c7050"}, - {file = "protobuf-3.20.3-cp38-cp38-win32.whl", hash = "sha256:c02ce36ec760252242a33967d51c289fd0e1c0e6e5cc9397e2279177716add86"}, - {file = "protobuf-3.20.3-cp38-cp38-win_amd64.whl", hash = "sha256:447d43819997825d4e71bf5769d869b968ce96848b6479397e29fc24c4a5dfe9"}, - {file = "protobuf-3.20.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:398a9e0c3eaceb34ec1aee71894ca3299605fa8e761544934378bbc6c97de23b"}, - {file = "protobuf-3.20.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:bf01b5720be110540be4286e791db73f84a2b721072a3711efff6c324cdf074b"}, - {file = "protobuf-3.20.3-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:daa564862dd0d39c00f8086f88700fdbe8bc717e993a21e90711acfed02f2402"}, - {file = "protobuf-3.20.3-cp39-cp39-win32.whl", hash = "sha256:819559cafa1a373b7096a482b504ae8a857c89593cf3a25af743ac9ecbd23480"}, - {file = "protobuf-3.20.3-cp39-cp39-win_amd64.whl", hash = "sha256:03038ac1cfbc41aa21f6afcbcd357281d7521b4157926f30ebecc8d4ea59dcb7"}, - {file = "protobuf-3.20.3-py2.py3-none-any.whl", hash = "sha256:a7ca6d488aa8ff7f329d4c545b2dbad8ac31464f1d8b1c87ad1346717731e4db"}, - {file = "protobuf-3.20.3.tar.gz", hash = "sha256:2e3427429c9cffebf259491be0af70189607f365c2f41c7c3764af6f337105f2"}, + {file = "pydantic_core-2.18.4-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:f76d0ad001edd426b92233d45c746fd08f467d56100fd8f30e9ace4b005266e4"}, + {file = "pydantic_core-2.18.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:59ff3e89f4eaf14050c8022011862df275b552caef8082e37b542b066ce1ff26"}, + {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a55b5b16c839df1070bc113c1f7f94a0af4433fcfa1b41799ce7606e5c79ce0a"}, + {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:4d0dcc59664fcb8974b356fe0a18a672d6d7cf9f54746c05f43275fc48636851"}, + {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8951eee36c57cd128f779e641e21eb40bc5073eb28b2d23f33eb0ef14ffb3f5d"}, + {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4701b19f7e3a06ea655513f7938de6f108123bf7c86bbebb1196eb9bd35cf724"}, + {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e00a3f196329e08e43d99b79b286d60ce46bed10f2280d25a1718399457e06be"}, + {file = "pydantic_core-2.18.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:97736815b9cc893b2b7f663628e63f436018b75f44854c8027040e05230eeddb"}, + {file = "pydantic_core-2.18.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:6891a2ae0e8692679c07728819b6e2b822fb30ca7445f67bbf6509b25a96332c"}, + {file = "pydantic_core-2.18.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bc4ff9805858bd54d1a20efff925ccd89c9d2e7cf4986144b30802bf78091c3e"}, + {file = "pydantic_core-2.18.4-cp310-none-win32.whl", hash = "sha256:1b4de2e51bbcb61fdebd0ab86ef28062704f62c82bbf4addc4e37fa4b00b7cbc"}, + {file = "pydantic_core-2.18.4-cp310-none-win_amd64.whl", hash = "sha256:6a750aec7bf431517a9fd78cb93c97b9b0c496090fee84a47a0d23668976b4b0"}, + {file = "pydantic_core-2.18.4-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:942ba11e7dfb66dc70f9ae66b33452f51ac7bb90676da39a7345e99ffb55402d"}, + {file = "pydantic_core-2.18.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b2ebef0e0b4454320274f5e83a41844c63438fdc874ea40a8b5b4ecb7693f1c4"}, + {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a642295cd0c8df1b86fc3dced1d067874c353a188dc8e0f744626d49e9aa51c4"}, + {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f09baa656c904807e832cf9cce799c6460c450c4ad80803517032da0cd062e2"}, + {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:98906207f29bc2c459ff64fa007afd10a8c8ac080f7e4d5beff4c97086a3dabd"}, + {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:19894b95aacfa98e7cb093cd7881a0c76f55731efad31073db4521e2b6ff5b7d"}, + {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fbbdc827fe5e42e4d196c746b890b3d72876bdbf160b0eafe9f0334525119c8"}, + {file = "pydantic_core-2.18.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f85d05aa0918283cf29a30b547b4df2fbb56b45b135f9e35b6807cb28bc47951"}, + {file = "pydantic_core-2.18.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e85637bc8fe81ddb73fda9e56bab24560bdddfa98aa64f87aaa4e4b6730c23d2"}, + {file = "pydantic_core-2.18.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:2f5966897e5461f818e136b8451d0551a2e77259eb0f73a837027b47dc95dab9"}, + {file = "pydantic_core-2.18.4-cp311-none-win32.whl", hash = "sha256:44c7486a4228413c317952e9d89598bcdfb06399735e49e0f8df643e1ccd0558"}, + {file = "pydantic_core-2.18.4-cp311-none-win_amd64.whl", hash = "sha256:8a7164fe2005d03c64fd3b85649891cd4953a8de53107940bf272500ba8a788b"}, + {file = "pydantic_core-2.18.4-cp311-none-win_arm64.whl", hash = "sha256:4e99bc050fe65c450344421017f98298a97cefc18c53bb2f7b3531eb39bc7805"}, + {file = "pydantic_core-2.18.4-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:6f5c4d41b2771c730ea1c34e458e781b18cc668d194958e0112455fff4e402b2"}, + {file = "pydantic_core-2.18.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2fdf2156aa3d017fddf8aea5adfba9f777db1d6022d392b682d2a8329e087cef"}, + {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4748321b5078216070b151d5271ef3e7cc905ab170bbfd27d5c83ee3ec436695"}, + {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:847a35c4d58721c5dc3dba599878ebbdfd96784f3fb8bb2c356e123bdcd73f34"}, + {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:3c40d4eaad41f78e3bbda31b89edc46a3f3dc6e171bf0ecf097ff7a0ffff7cb1"}, + {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:21a5e440dbe315ab9825fcd459b8814bb92b27c974cbc23c3e8baa2b76890077"}, + {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:01dd777215e2aa86dfd664daed5957704b769e726626393438f9c87690ce78c3"}, + {file = "pydantic_core-2.18.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:4b06beb3b3f1479d32befd1f3079cc47b34fa2da62457cdf6c963393340b56e9"}, + {file = "pydantic_core-2.18.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:564d7922e4b13a16b98772441879fcdcbe82ff50daa622d681dd682175ea918c"}, + {file = "pydantic_core-2.18.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:0eb2a4f660fcd8e2b1c90ad566db2b98d7f3f4717c64fe0a83e0adb39766d5b8"}, + {file = "pydantic_core-2.18.4-cp312-none-win32.whl", hash = "sha256:8b8bab4c97248095ae0c4455b5a1cd1cdd96e4e4769306ab19dda135ea4cdb07"}, + {file = "pydantic_core-2.18.4-cp312-none-win_amd64.whl", hash = "sha256:14601cdb733d741b8958224030e2bfe21a4a881fb3dd6fbb21f071cabd48fa0a"}, + {file = "pydantic_core-2.18.4-cp312-none-win_arm64.whl", hash = "sha256:c1322d7dd74713dcc157a2b7898a564ab091ca6c58302d5c7b4c07296e3fd00f"}, + {file = "pydantic_core-2.18.4-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:823be1deb01793da05ecb0484d6c9e20baebb39bd42b5d72636ae9cf8350dbd2"}, + {file = "pydantic_core-2.18.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:ebef0dd9bf9b812bf75bda96743f2a6c5734a02092ae7f721c048d156d5fabae"}, + {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ae1d6df168efb88d7d522664693607b80b4080be6750c913eefb77e34c12c71a"}, + {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f9899c94762343f2cc2fc64c13e7cae4c3cc65cdfc87dd810a31654c9b7358cc"}, + {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99457f184ad90235cfe8461c4d70ab7dd2680e28821c29eca00252ba90308c78"}, + {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:18f469a3d2a2fdafe99296a87e8a4c37748b5080a26b806a707f25a902c040a8"}, + {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b7cdf28938ac6b8b49ae5e92f2735056a7ba99c9b110a474473fd71185c1af5d"}, + {file = "pydantic_core-2.18.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:938cb21650855054dc54dfd9120a851c974f95450f00683399006aa6e8abb057"}, + {file = "pydantic_core-2.18.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:44cd83ab6a51da80fb5adbd9560e26018e2ac7826f9626bc06ca3dc074cd198b"}, + {file = "pydantic_core-2.18.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:972658f4a72d02b8abfa2581d92d59f59897d2e9f7e708fdabe922f9087773af"}, + {file = "pydantic_core-2.18.4-cp38-none-win32.whl", hash = "sha256:1d886dc848e60cb7666f771e406acae54ab279b9f1e4143babc9c2258213daa2"}, + {file = "pydantic_core-2.18.4-cp38-none-win_amd64.whl", hash = "sha256:bb4462bd43c2460774914b8525f79b00f8f407c945d50881568f294c1d9b4443"}, + {file = "pydantic_core-2.18.4-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:44a688331d4a4e2129140a8118479443bd6f1905231138971372fcde37e43528"}, + {file = "pydantic_core-2.18.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a2fdd81edd64342c85ac7cf2753ccae0b79bf2dfa063785503cb85a7d3593223"}, + {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:86110d7e1907ab36691f80b33eb2da87d780f4739ae773e5fc83fb272f88825f"}, + {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:46387e38bd641b3ee5ce247563b60c5ca098da9c56c75c157a05eaa0933ed154"}, + {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:123c3cec203e3f5ac7b000bd82235f1a3eced8665b63d18be751f115588fea30"}, + {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dc1803ac5c32ec324c5261c7209e8f8ce88e83254c4e1aebdc8b0a39f9ddb443"}, + {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:53db086f9f6ab2b4061958d9c276d1dbe3690e8dd727d6abf2321d6cce37fa94"}, + {file = "pydantic_core-2.18.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:abc267fa9837245cc28ea6929f19fa335f3dc330a35d2e45509b6566dc18be23"}, + {file = "pydantic_core-2.18.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:a0d829524aaefdebccb869eed855e2d04c21d2d7479b6cada7ace5448416597b"}, + {file = "pydantic_core-2.18.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:509daade3b8649f80d4e5ff21aa5673e4ebe58590b25fe42fac5f0f52c6f034a"}, + {file = "pydantic_core-2.18.4-cp39-none-win32.whl", hash = "sha256:ca26a1e73c48cfc54c4a76ff78df3727b9d9f4ccc8dbee4ae3f73306a591676d"}, + {file = "pydantic_core-2.18.4-cp39-none-win_amd64.whl", hash = "sha256:c67598100338d5d985db1b3d21f3619ef392e185e71b8d52bceacc4a7771ea7e"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:574d92eac874f7f4db0ca653514d823a0d22e2354359d0759e3f6a406db5d55d"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:1f4d26ceb5eb9eed4af91bebeae4b06c3fb28966ca3a8fb765208cf6b51102ab"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:77450e6d20016ec41f43ca4a6c63e9fdde03f0ae3fe90e7c27bdbeaece8b1ed4"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d323a01da91851a4f17bf592faf46149c9169d68430b3146dcba2bb5e5719abc"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:43d447dd2ae072a0065389092a231283f62d960030ecd27565672bd40746c507"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:578e24f761f3b425834f297b9935e1ce2e30f51400964ce4801002435a1b41ef"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:81b5efb2f126454586d0f40c4d834010979cb80785173d1586df845a632e4e6d"}, + {file = "pydantic_core-2.18.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:ab86ce7c8f9bea87b9d12c7f0af71102acbf5ecbc66c17796cff45dae54ef9a5"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:90afc12421df2b1b4dcc975f814e21bc1754640d502a2fbcc6d41e77af5ec312"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:51991a89639a912c17bef4b45c87bd83593aee0437d8102556af4885811d59f5"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:293afe532740370aba8c060882f7d26cfd00c94cae32fd2e212a3a6e3b7bc15e"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b48ece5bde2e768197a2d0f6e925f9d7e3e826f0ad2271120f8144a9db18d5c8"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:eae237477a873ab46e8dd748e515c72c0c804fb380fbe6c85533c7de51f23a8f"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:834b5230b5dfc0c1ec37b2fda433b271cbbc0e507560b5d1588e2cc1148cf1ce"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:e858ac0a25074ba4bce653f9b5d0a85b7456eaddadc0ce82d3878c22489fa4ee"}, + {file = "pydantic_core-2.18.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:2fd41f6eff4c20778d717af1cc50eca52f5afe7805ee530a4fbd0bae284f16e9"}, + {file = "pydantic_core-2.18.4.tar.gz", hash = "sha256:ec3beeada09ff865c344ff3bc2f427f5e6c26401cc6113d77e372c3fdac73864"}, ] +[package.dependencies] +typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" + [[package]] name = "pygments" version = "2.17.2" @@ -937,6 +1251,24 @@ tomli = {version = ">=1", markers = "python_version < \"3.11\""} [package.extras] dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +[[package]] +name = "pytest-asyncio" +version = "0.23.7" +description = "Pytest support for asyncio" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_asyncio-0.23.7-py3-none-any.whl", hash = "sha256:009b48127fbe44518a547bddd25611551b0e43ccdbf1e67d12479f569832c20b"}, + {file = "pytest_asyncio-0.23.7.tar.gz", hash = "sha256:5f5c72948f4c49e7db4f29f2521d4031f1c27f86e57b046126654083d4770268"}, +] + +[package.dependencies] +pytest = ">=7.0.0,<9" + +[package.extras] +docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] +testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] + [[package]] name = "pytest-cov" version = "5.0.0" @@ -956,28 +1288,19 @@ pytest = ">=4.6" testing = ["fields", "hunter", "process-tests", "pytest-xdist", "virtualenv"] [[package]] -name = "pywin32" -version = "306" -description = "Python for Window Extensions" +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" optional = false -python-versions = "*" +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ - {file = "pywin32-306-cp310-cp310-win32.whl", hash = "sha256:06d3420a5155ba65f0b72f2699b5bacf3109f36acbe8923765c22938a69dfc8d"}, - {file = "pywin32-306-cp310-cp310-win_amd64.whl", hash = "sha256:84f4471dbca1887ea3803d8848a1616429ac94a4a8d05f4bc9c5dcfd42ca99c8"}, - {file = "pywin32-306-cp311-cp311-win32.whl", hash = "sha256:e65028133d15b64d2ed8f06dd9fbc268352478d4f9289e69c190ecd6818b6407"}, - {file = "pywin32-306-cp311-cp311-win_amd64.whl", hash = "sha256:a7639f51c184c0272e93f244eb24dafca9b1855707d94c192d4a0b4c01e1100e"}, - {file = "pywin32-306-cp311-cp311-win_arm64.whl", hash = "sha256:70dba0c913d19f942a2db25217d9a1b726c278f483a919f1abfed79c9cf64d3a"}, - {file = "pywin32-306-cp312-cp312-win32.whl", hash = "sha256:383229d515657f4e3ed1343da8be101000562bf514591ff383ae940cad65458b"}, - {file = "pywin32-306-cp312-cp312-win_amd64.whl", hash = "sha256:37257794c1ad39ee9be652da0462dc2e394c8159dfd913a8a4e8eb6fd346da0e"}, - {file = "pywin32-306-cp312-cp312-win_arm64.whl", hash = "sha256:5821ec52f6d321aa59e2db7e0a35b997de60c201943557d108af9d4ae1ec7040"}, - {file = "pywin32-306-cp37-cp37m-win32.whl", hash = "sha256:1c73ea9a0d2283d889001998059f5eaaba3b6238f767c9cf2833b13e6a685f65"}, - {file = "pywin32-306-cp37-cp37m-win_amd64.whl", hash = "sha256:72c5f621542d7bdd4fdb716227be0dd3f8565c11b280be6315b06ace35487d36"}, - {file = "pywin32-306-cp38-cp38-win32.whl", hash = "sha256:e4c092e2589b5cf0d365849e73e02c391c1349958c5ac3e9d5ccb9a28e017b3a"}, - {file = "pywin32-306-cp38-cp38-win_amd64.whl", hash = "sha256:e8ac1ae3601bee6ca9f7cb4b5363bf1c0badb935ef243c4733ff9a393b1690c0"}, - {file = "pywin32-306-cp39-cp39-win32.whl", hash = "sha256:e25fd5b485b55ac9c057f67d94bc203f3f6595078d1fb3b458c9c28b7153a802"}, - {file = "pywin32-306-cp39-cp39-win_amd64.whl", hash = "sha256:39b61c15272833b5c329a2989999dcae836b1eed650252ab1b7bfbe1d59f30f4"}, + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, ] +[package.dependencies] +six = ">=1.5" + [[package]] name = "pyyaml" version = "6.0.1" @@ -1084,6 +1407,21 @@ files = [ {file = "ruff-0.4.10.tar.gz", hash = "sha256:3aa4f2bc388a30d346c56524f7cacca85945ba124945fe489952aadb6b5cd804"}, ] +[[package]] +name = "setuptools" +version = "70.2.0" +description = "Easily download, build, install, upgrade, and uninstall Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "setuptools-70.2.0-py3-none-any.whl", hash = "sha256:b8b8060bb426838fbe942479c90296ce976249451118ef566a5a0b7d8b78fb05"}, + {file = "setuptools-70.2.0.tar.gz", hash = "sha256:bd63e505105011b25c3c11f753f7e3b8465ea739efddaccef8f0efac2137bac1"}, +] + +[package.extras] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "importlib-metadata", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.2.0)", "jaraco.test", "mypy (==1.10.0)", "packaging (>=23.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-home (>=0.5)", "pytest-mypy", "pytest-perf", "pytest-ruff (>=0.3.2)", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel"] + [[package]] name = "six" version = "1.16.0" @@ -1325,49 +1663,6 @@ typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\"" [package.extras] full = ["httpx (>=0.22.0)", "itsdangerous", "jinja2", "python-multipart (>=0.0.7)", "pyyaml"] -[[package]] -name = "testcontainers" -version = "4.6.0" -description = "Python library for throwaway instances of anything that can run in a Docker container" -optional = false -python-versions = "<4.0,>=3.9" -files = [ - {file = "testcontainers-4.6.0-py3-none-any.whl", hash = "sha256:043c556b96de308ed1af8965515eb9dfb3dffc96dea0a0e4e1c08968693d56ce"}, - {file = "testcontainers-4.6.0.tar.gz", hash = "sha256:dbe8a6e6c5e7282d39cc26a0c294070461249dea21de42cc371c177420f38af8"}, -] - -[package.dependencies] -docker = "*" -typing-extensions = "*" -urllib3 = "*" -wrapt = "*" - -[package.extras] -arangodb = ["python-arango (>=7.8,<8.0)"] -azurite = ["azure-storage-blob (>=12.19,<13.0)"] -chroma = ["chromadb-client"] -clickhouse = ["clickhouse-driver"] -google = ["google-cloud-datastore (>=2)", "google-cloud-pubsub (>=2)"] -influxdb = ["influxdb", "influxdb-client"] -k3s = ["kubernetes", "pyyaml"] -keycloak = ["python-keycloak"] -localstack = ["boto3"] -minio = ["minio"] -mongodb = ["pymongo"] -mssql = ["pymssql", "sqlalchemy"] -mysql = ["pymysql[rsa]", "sqlalchemy"] -nats = ["nats-py"] -neo4j = ["neo4j"] -opensearch = ["opensearch-py"] -oracle = ["oracledb", "sqlalchemy"] -oracle-free = ["oracledb", "sqlalchemy"] -qdrant = ["qdrant-client"] -rabbitmq = ["pika"] -redis = ["redis"] -registry = ["bcrypt"] -selenium = ["selenium"] -weaviate = ["weaviate-client (>=4.5.4,<5.0.0)"] - [[package]] name = "tomli" version = "2.0.1" @@ -1629,84 +1924,108 @@ files = [ ] [[package]] -name = "wrapt" -version = "1.16.0" -description = "Module for decorators, wrappers and monkey patching." +name = "yarl" +version = "1.9.4" +description = "Yet another URL library" optional = false -python-versions = ">=3.6" +python-versions = ">=3.7" files = [ - {file = "wrapt-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ffa565331890b90056c01db69c0fe634a776f8019c143a5ae265f9c6bc4bd6d4"}, - {file = "wrapt-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:e4fdb9275308292e880dcbeb12546df7f3e0f96c6b41197e0cf37d2826359020"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bb2dee3874a500de01c93d5c71415fcaef1d858370d405824783e7a8ef5db440"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2a88e6010048489cda82b1326889ec075a8c856c2e6a256072b28eaee3ccf487"}, - {file = "wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ac83a914ebaf589b69f7d0a1277602ff494e21f4c2f743313414378f8f50a4cf"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:73aa7d98215d39b8455f103de64391cb79dfcad601701a3aa0dddacf74911d72"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:807cc8543a477ab7422f1120a217054f958a66ef7314f76dd9e77d3f02cdccd0"}, - {file = "wrapt-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bf5703fdeb350e36885f2875d853ce13172ae281c56e509f4e6eca049bdfb136"}, - {file = "wrapt-1.16.0-cp310-cp310-win32.whl", hash = "sha256:f6b2d0c6703c988d334f297aa5df18c45e97b0af3679bb75059e0e0bd8b1069d"}, - {file = "wrapt-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:decbfa2f618fa8ed81c95ee18a387ff973143c656ef800c9f24fb7e9c16054e2"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:1a5db485fe2de4403f13fafdc231b0dbae5eca4359232d2efc79025527375b09"}, - {file = "wrapt-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:75ea7d0ee2a15733684badb16de6794894ed9c55aa5e9903260922f0482e687d"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a452f9ca3e3267cd4d0fcf2edd0d035b1934ac2bd7e0e57ac91ad6b95c0c6389"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:43aa59eadec7890d9958748db829df269f0368521ba6dc68cc172d5d03ed8060"}, - {file = "wrapt-1.16.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:72554a23c78a8e7aa02abbd699d129eead8b147a23c56e08d08dfc29cfdddca1"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:d2efee35b4b0a347e0d99d28e884dfd82797852d62fcd7ebdeee26f3ceb72cf3"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:6dcfcffe73710be01d90cae08c3e548d90932d37b39ef83969ae135d36ef3956"}, - {file = "wrapt-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:eb6e651000a19c96f452c85132811d25e9264d836951022d6e81df2fff38337d"}, - {file = "wrapt-1.16.0-cp311-cp311-win32.whl", hash = "sha256:66027d667efe95cc4fa945af59f92c5a02c6f5bb6012bff9e60542c74c75c362"}, - {file = "wrapt-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:aefbc4cb0a54f91af643660a0a150ce2c090d3652cf4052a5397fb2de549cd89"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:5eb404d89131ec9b4f748fa5cfb5346802e5ee8836f57d516576e61f304f3b7b"}, - {file = "wrapt-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:9090c9e676d5236a6948330e83cb89969f433b1943a558968f659ead07cb3b36"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:94265b00870aa407bd0cbcfd536f17ecde43b94fb8d228560a1e9d3041462d73"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f2058f813d4f2b5e3a9eb2eb3faf8f1d99b81c3e51aeda4b168406443e8ba809"}, - {file = "wrapt-1.16.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:98b5e1f498a8ca1858a1cdbffb023bfd954da4e3fa2c0cb5853d40014557248b"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:14d7dc606219cdd7405133c713f2c218d4252f2a469003f8c46bb92d5d095d81"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:49aac49dc4782cb04f58986e81ea0b4768e4ff197b57324dcbd7699c5dfb40b9"}, - {file = "wrapt-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:418abb18146475c310d7a6dc71143d6f7adec5b004ac9ce08dc7a34e2babdc5c"}, - {file = "wrapt-1.16.0-cp312-cp312-win32.whl", hash = "sha256:685f568fa5e627e93f3b52fda002c7ed2fa1800b50ce51f6ed1d572d8ab3e7fc"}, - {file = "wrapt-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:dcdba5c86e368442528f7060039eda390cc4091bfd1dca41e8046af7c910dda8"}, - {file = "wrapt-1.16.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:d462f28826f4657968ae51d2181a074dfe03c200d6131690b7d65d55b0f360f8"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a33a747400b94b6d6b8a165e4480264a64a78c8a4c734b62136062e9a248dd39"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b3646eefa23daeba62643a58aac816945cadc0afaf21800a1421eeba5f6cfb9c"}, - {file = "wrapt-1.16.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3ebf019be5c09d400cf7b024aa52b1f3aeebeff51550d007e92c3c1c4afc2a40"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_aarch64.whl", hash = "sha256:0d2691979e93d06a95a26257adb7bfd0c93818e89b1406f5a28f36e0d8c1e1fc"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_i686.whl", hash = "sha256:1acd723ee2a8826f3d53910255643e33673e1d11db84ce5880675954183ec47e"}, - {file = "wrapt-1.16.0-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:bc57efac2da352a51cc4658878a68d2b1b67dbe9d33c36cb826ca449d80a8465"}, - {file = "wrapt-1.16.0-cp36-cp36m-win32.whl", hash = "sha256:da4813f751142436b075ed7aa012a8778aa43a99f7b36afe9b742d3ed8bdc95e"}, - {file = "wrapt-1.16.0-cp36-cp36m-win_amd64.whl", hash = "sha256:6f6eac2360f2d543cc875a0e5efd413b6cbd483cb3ad7ebf888884a6e0d2e966"}, - {file = "wrapt-1.16.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:a0ea261ce52b5952bf669684a251a66df239ec6d441ccb59ec7afa882265d593"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7bd2d7ff69a2cac767fbf7a2b206add2e9a210e57947dd7ce03e25d03d2de292"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:9159485323798c8dc530a224bd3ffcf76659319ccc7bbd52e01e73bd0241a0c5"}, - {file = "wrapt-1.16.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a86373cf37cd7764f2201b76496aba58a52e76dedfaa698ef9e9688bfd9e41cf"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:73870c364c11f03ed072dda68ff7aea6d2a3a5c3fe250d917a429c7432e15228"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:b935ae30c6e7400022b50f8d359c03ed233d45b725cfdd299462f41ee5ffba6f"}, - {file = "wrapt-1.16.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:db98ad84a55eb09b3c32a96c576476777e87c520a34e2519d3e59c44710c002c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win32.whl", hash = "sha256:9153ed35fc5e4fa3b2fe97bddaa7cbec0ed22412b85bcdaf54aeba92ea37428c"}, - {file = "wrapt-1.16.0-cp37-cp37m-win_amd64.whl", hash = "sha256:66dfbaa7cfa3eb707bbfcd46dab2bc6207b005cbc9caa2199bcbc81d95071a00"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:1dd50a2696ff89f57bd8847647a1c363b687d3d796dc30d4dd4a9d1689a706f0"}, - {file = "wrapt-1.16.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:44a2754372e32ab315734c6c73b24351d06e77ffff6ae27d2ecf14cf3d229202"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e9723528b9f787dc59168369e42ae1c3b0d3fadb2f1a71de14531d321ee05b0"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dbed418ba5c3dce92619656802cc5355cb679e58d0d89b50f116e4a9d5a9603e"}, - {file = "wrapt-1.16.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:941988b89b4fd6b41c3f0bfb20e92bd23746579736b7343283297c4c8cbae68f"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6a42cd0cfa8ffc1915aef79cb4284f6383d8a3e9dcca70c445dcfdd639d51267"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:1ca9b6085e4f866bd584fb135a041bfc32cab916e69f714a7d1d397f8c4891ca"}, - {file = "wrapt-1.16.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d5e49454f19ef621089e204f862388d29e6e8d8b162efce05208913dde5b9ad6"}, - {file = "wrapt-1.16.0-cp38-cp38-win32.whl", hash = "sha256:c31f72b1b6624c9d863fc095da460802f43a7c6868c5dda140f51da24fd47d7b"}, - {file = "wrapt-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:490b0ee15c1a55be9c1bd8609b8cecd60e325f0575fc98f50058eae366e01f41"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:9b201ae332c3637a42f02d1045e1d0cccfdc41f1f2f801dafbaa7e9b4797bfc2"}, - {file = "wrapt-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:2076fad65c6736184e77d7d4729b63a6d1ae0b70da4868adeec40989858eb3fb"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c5cd603b575ebceca7da5a3a251e69561bec509e0b46e4993e1cac402b7247b8"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b47cfad9e9bbbed2339081f4e346c93ecd7ab504299403320bf85f7f85c7d46c"}, - {file = "wrapt-1.16.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f8212564d49c50eb4565e502814f694e240c55551a5f1bc841d4fcaabb0a9b8a"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:5f15814a33e42b04e3de432e573aa557f9f0f56458745c2074952f564c50e664"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:db2e408d983b0e61e238cf579c09ef7020560441906ca990fe8412153e3b291f"}, - {file = "wrapt-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:edfad1d29c73f9b863ebe7082ae9321374ccb10879eeabc84ba3b69f2579d537"}, - {file = "wrapt-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed867c42c268f876097248e05b6117a65bcd1e63b779e916fe2e33cd6fd0d3c3"}, - {file = "wrapt-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:eb1b046be06b0fce7249f1d025cd359b4b80fc1c3e24ad9eca33e0dcdb2e4a35"}, - {file = "wrapt-1.16.0-py3-none-any.whl", hash = "sha256:6906c4100a8fcbf2fa735f6059214bb13b97f75b1a61777fcf6432121ef12ef1"}, - {file = "wrapt-1.16.0.tar.gz", hash = "sha256:5f370f952971e7d17c7d1ead40e49f32345a7f7a5373571ef44d800d06b1899d"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:a8c1df72eb746f4136fe9a2e72b0c9dc1da1cbd23b5372f94b5820ff8ae30e0e"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:a3a6ed1d525bfb91b3fc9b690c5a21bb52de28c018530ad85093cc488bee2dd2"}, + {file = "yarl-1.9.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:c38c9ddb6103ceae4e4498f9c08fac9b590c5c71b0370f98714768e22ac6fa66"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d9e09c9d74f4566e905a0b8fa668c58109f7624db96a2171f21747abc7524234"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b8477c1ee4bd47c57d49621a062121c3023609f7a13b8a46953eb6c9716ca392"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d5ff2c858f5f6a42c2a8e751100f237c5e869cbde669a724f2062d4c4ef93551"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:357495293086c5b6d34ca9616a43d329317feab7917518bc97a08f9e55648455"}, + {file = "yarl-1.9.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:54525ae423d7b7a8ee81ba189f131054defdb122cde31ff17477951464c1691c"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:801e9264d19643548651b9db361ce3287176671fb0117f96b5ac0ee1c3530d53"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:e516dc8baf7b380e6c1c26792610230f37147bb754d6426462ab115a02944385"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_ppc64le.whl", hash = "sha256:7d5aaac37d19b2904bb9dfe12cdb08c8443e7ba7d2852894ad448d4b8f442863"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_s390x.whl", hash = "sha256:54beabb809ffcacbd9d28ac57b0db46e42a6e341a030293fb3185c409e626b8b"}, + {file = "yarl-1.9.4-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:bac8d525a8dbc2a1507ec731d2867025d11ceadcb4dd421423a5d42c56818541"}, + {file = "yarl-1.9.4-cp310-cp310-win32.whl", hash = "sha256:7855426dfbddac81896b6e533ebefc0af2f132d4a47340cee6d22cac7190022d"}, + {file = "yarl-1.9.4-cp310-cp310-win_amd64.whl", hash = "sha256:848cd2a1df56ddbffeb375535fb62c9d1645dde33ca4d51341378b3f5954429b"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:35a2b9396879ce32754bd457d31a51ff0a9d426fd9e0e3c33394bf4b9036b099"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:4c7d56b293cc071e82532f70adcbd8b61909eec973ae9d2d1f9b233f3d943f2c"}, + {file = "yarl-1.9.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d8a1c6c0be645c745a081c192e747c5de06e944a0d21245f4cf7c05e457c36e0"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4b3c1ffe10069f655ea2d731808e76e0f452fc6c749bea04781daf18e6039525"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:549d19c84c55d11687ddbd47eeb348a89df9cb30e1993f1b128f4685cd0ebbf8"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a7409f968456111140c1c95301cadf071bd30a81cbd7ab829169fb9e3d72eae9"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e23a6d84d9d1738dbc6e38167776107e63307dfc8ad108e580548d1f2c587f42"}, + {file = "yarl-1.9.4-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d8b889777de69897406c9fb0b76cdf2fd0f31267861ae7501d93003d55f54fbe"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:03caa9507d3d3c83bca08650678e25364e1843b484f19986a527630ca376ecce"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:4e9035df8d0880b2f1c7f5031f33f69e071dfe72ee9310cfc76f7b605958ceb9"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_ppc64le.whl", hash = "sha256:c0ec0ed476f77db9fb29bca17f0a8fcc7bc97ad4c6c1d8959c507decb22e8572"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_s390x.whl", hash = "sha256:ee04010f26d5102399bd17f8df8bc38dc7ccd7701dc77f4a68c5b8d733406958"}, + {file = "yarl-1.9.4-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:49a180c2e0743d5d6e0b4d1a9e5f633c62eca3f8a86ba5dd3c471060e352ca98"}, + {file = "yarl-1.9.4-cp311-cp311-win32.whl", hash = "sha256:81eb57278deb6098a5b62e88ad8281b2ba09f2f1147c4767522353eaa6260b31"}, + {file = "yarl-1.9.4-cp311-cp311-win_amd64.whl", hash = "sha256:d1d2532b340b692880261c15aee4dc94dd22ca5d61b9db9a8a361953d36410b1"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:0d2454f0aef65ea81037759be5ca9947539667eecebca092733b2eb43c965a81"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:44d8ffbb9c06e5a7f529f38f53eda23e50d1ed33c6c869e01481d3fafa6b8142"}, + {file = "yarl-1.9.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:aaaea1e536f98754a6e5c56091baa1b6ce2f2700cc4a00b0d49eca8dea471074"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3777ce5536d17989c91696db1d459574e9a9bd37660ea7ee4d3344579bb6f129"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:9fc5fc1eeb029757349ad26bbc5880557389a03fa6ada41703db5e068881e5f2"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ea65804b5dc88dacd4a40279af0cdadcfe74b3e5b4c897aa0d81cf86927fee78"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:aa102d6d280a5455ad6a0f9e6d769989638718e938a6a0a2ff3f4a7ff8c62cc4"}, + {file = "yarl-1.9.4-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09efe4615ada057ba2d30df871d2f668af661e971dfeedf0c159927d48bbeff0"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:008d3e808d03ef28542372d01057fd09168419cdc8f848efe2804f894ae03e51"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:6f5cb257bc2ec58f437da2b37a8cd48f666db96d47b8a3115c29f316313654ff"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_ppc64le.whl", hash = "sha256:992f18e0ea248ee03b5a6e8b3b4738850ae7dbb172cc41c966462801cbf62cf7"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_s390x.whl", hash = "sha256:0e9d124c191d5b881060a9e5060627694c3bdd1fe24c5eecc8d5d7d0eb6faabc"}, + {file = "yarl-1.9.4-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:3986b6f41ad22988e53d5778f91855dc0399b043fc8946d4f2e68af22ee9ff10"}, + {file = "yarl-1.9.4-cp312-cp312-win32.whl", hash = "sha256:4b21516d181cd77ebd06ce160ef8cc2a5e9ad35fb1c5930882baff5ac865eee7"}, + {file = "yarl-1.9.4-cp312-cp312-win_amd64.whl", hash = "sha256:a9bd00dc3bc395a662900f33f74feb3e757429e545d831eef5bb280252631984"}, + {file = "yarl-1.9.4-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:63b20738b5aac74e239622d2fe30df4fca4942a86e31bf47a81a0e94c14df94f"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d7d7f7de27b8944f1fee2c26a88b4dabc2409d2fea7a9ed3df79b67277644e17"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:c74018551e31269d56fab81a728f683667e7c28c04e807ba08f8c9e3bba32f14"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ca06675212f94e7a610e85ca36948bb8fc023e458dd6c63ef71abfd482481aa5"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5aef935237d60a51a62b86249839b51345f47564208c6ee615ed2a40878dccdd"}, + {file = "yarl-1.9.4-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2b134fd795e2322b7684155b7855cc99409d10b2e408056db2b93b51a52accc7"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d25039a474c4c72a5ad4b52495056f843a7ff07b632c1b92ea9043a3d9950f6e"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:f7d6b36dd2e029b6bcb8a13cf19664c7b8e19ab3a58e0fefbb5b8461447ed5ec"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_ppc64le.whl", hash = "sha256:957b4774373cf6f709359e5c8c4a0af9f6d7875db657adb0feaf8d6cb3c3964c"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_s390x.whl", hash = "sha256:d7eeb6d22331e2fd42fce928a81c697c9ee2d51400bd1a28803965883e13cead"}, + {file = "yarl-1.9.4-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:6a962e04b8f91f8c4e5917e518d17958e3bdee71fd1d8b88cdce74dd0ebbf434"}, + {file = "yarl-1.9.4-cp37-cp37m-win32.whl", hash = "sha256:f3bc6af6e2b8f92eced34ef6a96ffb248e863af20ef4fde9448cc8c9b858b749"}, + {file = "yarl-1.9.4-cp37-cp37m-win_amd64.whl", hash = "sha256:ad4d7a90a92e528aadf4965d685c17dacff3df282db1121136c382dc0b6014d2"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:ec61d826d80fc293ed46c9dd26995921e3a82146feacd952ef0757236fc137be"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8be9e837ea9113676e5754b43b940b50cce76d9ed7d2461df1af39a8ee674d9f"}, + {file = "yarl-1.9.4-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:bef596fdaa8f26e3d66af846bbe77057237cb6e8efff8cd7cc8dff9a62278bbf"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d47552b6e52c3319fede1b60b3de120fe83bde9b7bddad11a69fb0af7db32f1"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:84fc30f71689d7fc9168b92788abc977dc8cefa806909565fc2951d02f6b7d57"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:4aa9741085f635934f3a2583e16fcf62ba835719a8b2b28fb2917bb0537c1dfa"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:206a55215e6d05dbc6c98ce598a59e6fbd0c493e2de4ea6cc2f4934d5a18d130"}, + {file = "yarl-1.9.4-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:07574b007ee20e5c375a8fe4a0789fad26db905f9813be0f9fef5a68080de559"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:5a2e2433eb9344a163aced6a5f6c9222c0786e5a9e9cac2c89f0b28433f56e23"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:6ad6d10ed9b67a382b45f29ea028f92d25bc0bc1daf6c5b801b90b5aa70fb9ec"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_ppc64le.whl", hash = "sha256:6fe79f998a4052d79e1c30eeb7d6c1c1056ad33300f682465e1b4e9b5a188b78"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_s390x.whl", hash = "sha256:a825ec844298c791fd28ed14ed1bffc56a98d15b8c58a20e0e08c1f5f2bea1be"}, + {file = "yarl-1.9.4-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:8619d6915b3b0b34420cf9b2bb6d81ef59d984cb0fde7544e9ece32b4b3043c3"}, + {file = "yarl-1.9.4-cp38-cp38-win32.whl", hash = "sha256:686a0c2f85f83463272ddffd4deb5e591c98aac1897d65e92319f729c320eece"}, + {file = "yarl-1.9.4-cp38-cp38-win_amd64.whl", hash = "sha256:a00862fb23195b6b8322f7d781b0dc1d82cb3bcac346d1e38689370cc1cc398b"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:604f31d97fa493083ea21bd9b92c419012531c4e17ea6da0f65cacdcf5d0bd27"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:8a854227cf581330ffa2c4824d96e52ee621dd571078a252c25e3a3b3d94a1b1"}, + {file = "yarl-1.9.4-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:ba6f52cbc7809cd8d74604cce9c14868306ae4aa0282016b641c661f981a6e91"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a6327976c7c2f4ee6816eff196e25385ccc02cb81427952414a64811037bbc8b"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8397a3817d7dcdd14bb266283cd1d6fc7264a48c186b986f32e86d86d35fbac5"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e0381b4ce23ff92f8170080c97678040fc5b08da85e9e292292aba67fdac6c34"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:23d32a2594cb5d565d358a92e151315d1b2268bc10f4610d098f96b147370136"}, + {file = "yarl-1.9.4-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ddb2a5c08a4eaaba605340fdee8fc08e406c56617566d9643ad8bf6852778fc7"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:26a1dc6285e03f3cc9e839a2da83bcbf31dcb0d004c72d0730e755b33466c30e"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:18580f672e44ce1238b82f7fb87d727c4a131f3a9d33a5e0e82b793362bf18b4"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_ppc64le.whl", hash = "sha256:29e0f83f37610f173eb7e7b5562dd71467993495e568e708d99e9d1944f561ec"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_s390x.whl", hash = "sha256:1f23e4fe1e8794f74b6027d7cf19dc25f8b63af1483d91d595d4a07eca1fb26c"}, + {file = "yarl-1.9.4-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:db8e58b9d79200c76956cefd14d5c90af54416ff5353c5bfd7cbe58818e26ef0"}, + {file = "yarl-1.9.4-cp39-cp39-win32.whl", hash = "sha256:c7224cab95645c7ab53791022ae77a4509472613e839dab722a72abe5a684575"}, + {file = "yarl-1.9.4-cp39-cp39-win_amd64.whl", hash = "sha256:824d6c50492add5da9374875ce72db7a0733b29c2394890aef23d533106e2b15"}, + {file = "yarl-1.9.4-py3-none-any.whl", hash = "sha256:928cecb0ef9d5a7946eb6ff58417ad2fe9375762382f1bf5c55e61645f2c43ad"}, + {file = "yarl-1.9.4.tar.gz", hash = "sha256:566db86717cf8080b99b58b083b773a908ae40f06681e87e589a976faf8246bf"}, ] +[package.dependencies] +idna = ">=2.0" +multidict = ">=4.0" + [[package]] name = "zipp" version = "3.17.0" @@ -1727,5 +2046,5 @@ hf = ["huggingface-hub"] [metadata] lock-version = "2.0" -python-versions = ">= 3.9, < 3.11" -content-hash = "d401c9afba4135d37a0166471c28814cf909da577a2da922057c96a1702edb09" +python-versions = ">= 3.9, < 4.0" +content-hash = "792af27df44e31a0573bf7cd37887e47626894cbfaa4358723002bd73fce9251" diff --git a/clients/python/pyproject.toml b/clients/python/pyproject.toml index a8c114ad2..70cdbda10 100644 --- a/clients/python/pyproject.toml +++ b/clients/python/pyproject.toml @@ -6,21 +6,27 @@ authors = ["Isabella Basso do Amaral "] license = "Apache-2.0" readme = "README.md" homepage = "https://github.com/kubeflow/model-registry" +packages = [ + { include = "model_registry", from = "src" }, + { include = "mr_openapi", from = "src" }, +] [tool.poetry.urls] "Issues" = "https://github.com/kubeflow/model-registry/issues" [tool.poetry.dependencies] -python = ">= 3.9, < 3.11" # mainly aligns constraints with: https://pypi.org/project/ml-metadata/#files -attrs = "^21.0" -ml-metadata = "==1.14.0" -# you might consider using locally the following alternative, when developing on Apple-silicon/ARM-based computers: -# ml-metadata = { url = "https://github.com/opendatahub-io/ml-metadata/releases/download/v1.14.0%2Bremote.1/ml_metadata-1.14.0+remote.1-py3-none-any.whl" } +python = ">= 3.9, < 4.0" typing-extensions = "^4.8" +pydantic = "^2.7.4" +python-dateutil = "^2.9.0.post0" +aiohttp = "^3.9.5" +aiohttp-retry = "^2.8.3" +# allows for reentrant event loops (used for sync client) +nest-asyncio = "^1.6.0" +# necessary for modern type annotations using pydantic on 3.9 +eval-type-backport = "^0.2.0" huggingface-hub = { version = ">=0.20.1,<0.24.0", optional = true } -# pin docker+requests dependencies of testcontainers to docker ^7.1.0 for compatibility with requests ^2.32.2; ref: https://github.com/testcontainers/testcontainers-python/issues/577#issuecomment-2123324367 -requests = { version = "^2.32.2", optional = true } [tool.poetry.extras] hf = ["huggingface-hub"] @@ -40,9 +46,8 @@ coverage = { extras = ["toml"], version = "^7.3.2" } pytest-cov = ">=4.1,<6.0" ruff = "^0.4.4" mypy = "^1.7.0" -testcontainers = "^4.5.0" -# pin docker+requests dependencies of testcontainers to docker ^7.1.0 for compatibility with requests ^2.32.2; ref: https://github.com/testcontainers/testcontainers-python/issues/577#issuecomment-2123324367 -docker = "^7.1.0" +pytest-asyncio = "^0.23.7" +requests = "^2.32.2" [tool.coverage.run] branch = true @@ -62,6 +67,9 @@ build-backend = "poetry.core.masonry.api" [tool.black] line-length = 119 +[tool.pytest.ini_options] +asyncio_mode = "auto" + [tool.ruff] target-version = "py39" respect-gitignore = true @@ -99,3 +107,12 @@ per-file-ignores = { "tests/**/*.py" = [ [tool.ruff.lint.pydocstyle] convention = "google" + +[tool.mypy] +python_version = "3.9" +strict = false +pretty = true +show_column_numbers = true +show_error_codes = true +show_error_context = true +ignore_missing_imports = true diff --git a/clients/python/src/.openapi-generator-ignore b/clients/python/src/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/clients/python/src/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/clients/python/src/.openapi-generator/FILES b/clients/python/src/.openapi-generator/FILES new file mode 100644 index 000000000..381cbe349 --- /dev/null +++ b/clients/python/src/.openapi-generator/FILES @@ -0,0 +1,116 @@ +mr_openapi/__init__.py +mr_openapi/api/__init__.py +mr_openapi/api/model_registry_service_api.py +mr_openapi/api_client.py +mr_openapi/api_response.py +mr_openapi/configuration.py +mr_openapi/docs/Artifact.md +mr_openapi/docs/ArtifactList.md +mr_openapi/docs/ArtifactState.md +mr_openapi/docs/BaseArtifact.md +mr_openapi/docs/BaseArtifactCreate.md +mr_openapi/docs/BaseArtifactUpdate.md +mr_openapi/docs/BaseExecution.md +mr_openapi/docs/BaseExecutionCreate.md +mr_openapi/docs/BaseExecutionUpdate.md +mr_openapi/docs/BaseResource.md +mr_openapi/docs/BaseResourceCreate.md +mr_openapi/docs/BaseResourceList.md +mr_openapi/docs/BaseResourceUpdate.md +mr_openapi/docs/DocArtifact.md +mr_openapi/docs/Error.md +mr_openapi/docs/ExecutionState.md +mr_openapi/docs/InferenceService.md +mr_openapi/docs/InferenceServiceCreate.md +mr_openapi/docs/InferenceServiceList.md +mr_openapi/docs/InferenceServiceState.md +mr_openapi/docs/InferenceServiceUpdate.md +mr_openapi/docs/MetadataBoolValue.md +mr_openapi/docs/MetadataDoubleValue.md +mr_openapi/docs/MetadataIntValue.md +mr_openapi/docs/MetadataProtoValue.md +mr_openapi/docs/MetadataStringValue.md +mr_openapi/docs/MetadataStructValue.md +mr_openapi/docs/MetadataValue.md +mr_openapi/docs/ModelArtifact.md +mr_openapi/docs/ModelArtifactCreate.md +mr_openapi/docs/ModelArtifactList.md +mr_openapi/docs/ModelArtifactUpdate.md +mr_openapi/docs/ModelRegistryServiceApi.md +mr_openapi/docs/ModelVersion.md +mr_openapi/docs/ModelVersionCreate.md +mr_openapi/docs/ModelVersionList.md +mr_openapi/docs/ModelVersionState.md +mr_openapi/docs/ModelVersionUpdate.md +mr_openapi/docs/OrderByField.md +mr_openapi/docs/RegisteredModel.md +mr_openapi/docs/RegisteredModelCreate.md +mr_openapi/docs/RegisteredModelList.md +mr_openapi/docs/RegisteredModelState.md +mr_openapi/docs/RegisteredModelUpdate.md +mr_openapi/docs/ServeModel.md +mr_openapi/docs/ServeModelCreate.md +mr_openapi/docs/ServeModelList.md +mr_openapi/docs/ServeModelUpdate.md +mr_openapi/docs/ServingEnvironment.md +mr_openapi/docs/ServingEnvironmentCreate.md +mr_openapi/docs/ServingEnvironmentList.md +mr_openapi/docs/ServingEnvironmentUpdate.md +mr_openapi/docs/SortOrder.md +mr_openapi/exceptions.py +mr_openapi/models/__init__.py +mr_openapi/models/artifact.py +mr_openapi/models/artifact_list.py +mr_openapi/models/artifact_state.py +mr_openapi/models/base_artifact.py +mr_openapi/models/base_artifact_create.py +mr_openapi/models/base_artifact_update.py +mr_openapi/models/base_execution.py +mr_openapi/models/base_execution_create.py +mr_openapi/models/base_execution_update.py +mr_openapi/models/base_resource.py +mr_openapi/models/base_resource_create.py +mr_openapi/models/base_resource_list.py +mr_openapi/models/base_resource_update.py +mr_openapi/models/doc_artifact.py +mr_openapi/models/error.py +mr_openapi/models/execution_state.py +mr_openapi/models/inference_service.py +mr_openapi/models/inference_service_create.py +mr_openapi/models/inference_service_list.py +mr_openapi/models/inference_service_state.py +mr_openapi/models/inference_service_update.py +mr_openapi/models/metadata_bool_value.py +mr_openapi/models/metadata_double_value.py +mr_openapi/models/metadata_int_value.py +mr_openapi/models/metadata_proto_value.py +mr_openapi/models/metadata_string_value.py +mr_openapi/models/metadata_struct_value.py +mr_openapi/models/metadata_value.py +mr_openapi/models/model_artifact.py +mr_openapi/models/model_artifact_create.py +mr_openapi/models/model_artifact_list.py +mr_openapi/models/model_artifact_update.py +mr_openapi/models/model_version.py +mr_openapi/models/model_version_create.py +mr_openapi/models/model_version_list.py +mr_openapi/models/model_version_state.py +mr_openapi/models/model_version_update.py +mr_openapi/models/order_by_field.py +mr_openapi/models/registered_model.py +mr_openapi/models/registered_model_create.py +mr_openapi/models/registered_model_list.py +mr_openapi/models/registered_model_state.py +mr_openapi/models/registered_model_update.py +mr_openapi/models/serve_model.py +mr_openapi/models/serve_model_create.py +mr_openapi/models/serve_model_list.py +mr_openapi/models/serve_model_update.py +mr_openapi/models/serving_environment.py +mr_openapi/models/serving_environment_create.py +mr_openapi/models/serving_environment_list.py +mr_openapi/models/serving_environment_update.py +mr_openapi/models/sort_order.py +mr_openapi/rest.py +mr_openapi/test/__init__.py +mr_openapi_README.md diff --git a/clients/python/src/.openapi-generator/VERSION b/clients/python/src/.openapi-generator/VERSION new file mode 100644 index 000000000..93c8ddab9 --- /dev/null +++ b/clients/python/src/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.6.0 diff --git a/clients/python/src/model_registry/_client.py b/clients/python/src/model_registry/_client.py index 6c70726a2..2d263e520 100644 --- a/clients/python/src/model_registry/_client.py +++ b/clients/python/src/model_registry/_client.py @@ -4,13 +4,12 @@ import os from pathlib import Path -from typing import get_args +from typing import Any, get_args from warnings import warn from .core import ModelRegistryAPIClient -from .exceptions import StoreException -from .store import ScalarType -from .types import ModelArtifact, ModelVersion, RegisteredModel +from .exceptions import StoreError +from .types import ModelArtifact, ModelVersion, RegisteredModel, SupportedTypes class ModelRegistry: @@ -24,7 +23,7 @@ def __init__( author: str, is_secure: bool = True, user_token: bytes | None = None, - custom_ca: bytes | None = None, + custom_ca: str | None = None, ): """Constructor. @@ -36,8 +35,12 @@ def __init__( author: Name of the author. is_secure: Whether to use a secure connection. Defaults to True. user_token: The PEM-encoded user token as a byte string. Defaults to content of path on envvar KF_PIPELINES_SA_TOKEN_PATH. - custom_ca: The PEM-encoded root certificates as a byte string. Defaults to contents of path on envvar CERT. + custom_ca: Path to the PEM-encoded root certificates as a byte string. Defaults to path on envvar CERT. """ + import nest_asyncio + + nest_asyncio.apply() + # TODO: get remaining args from env self._author = author @@ -52,50 +55,64 @@ def __init__( if is_secure: root_ca = None if not custom_ca: - if ca_path := os.getenv("CERT"): - root_ca = Path(ca_path).read_bytes() + if cert := os.getenv("CERT"): + root_ca = cert # client might have a default CA setup else: root_ca = custom_ca + if not user_token: + msg = "user token must be provided for secure connection" + raise StoreError(msg) + self._api = ModelRegistryAPIClient.secure_connection( - server_address, port, user_token, root_ca + server_address, port, user_token=user_token, custom_ca=root_ca ) elif custom_ca: - msg = "Custom CA provided without secure connection" - raise StoreException(msg) + msg = "Custom CA provided without secure connection, conflicting options" + raise StoreError(msg) else: self._api = ModelRegistryAPIClient.insecure_connection( server_address, port, user_token ) - def _register_model(self, name: str, **kwargs) -> RegisteredModel: - if rm := self._api.get_registered_model_by_params(name): + def async_runner(self, coro: Any) -> Any: + import asyncio + + try: + loop = asyncio.get_event_loop() + except RuntimeError: + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + return loop.run_until_complete(coro) + + async def _register_model(self, name: str, **kwargs) -> RegisteredModel: + if rm := await self._api.get_registered_model_by_params(name): return rm - rm = RegisteredModel(name, **kwargs) - self._api.upsert_registered_model(rm) - return rm + return await self._api.upsert_registered_model( + RegisteredModel(name=name, **kwargs) + ) - def _register_new_version( + async def _register_new_version( self, rm: RegisteredModel, version: str, author: str, /, **kwargs ) -> ModelVersion: assert rm.id is not None, "Registered model must have an ID" - if self._api.get_model_version_by_params(rm.id, version): + if await self._api.get_model_version_by_params(rm.id, version): msg = f"Version {version} already exists" - raise StoreException(msg) + raise StoreError(msg) - mv = ModelVersion(rm.name, version, author, **kwargs) - self._api.upsert_model_version(mv, rm.id) - return mv + return await self._api.upsert_model_version( + ModelVersion(name=version, author=author, **kwargs), rm.id + ) - def _register_model_artifact( - self, mv: ModelVersion, uri: str, /, **kwargs + async def _register_model_artifact( + self, mv: ModelVersion, name: str, uri: str, /, **kwargs ) -> ModelArtifact: assert mv.id is not None, "Model version must have an ID" - ma = ModelArtifact(mv.model_name, uri, **kwargs) - self._api.upsert_model_artifact(ma, mv.id) - return ma + return await self._api.upsert_model_artifact( + ModelArtifact(name=name, uri=uri, **kwargs), mv.id + ) def register_model( self, @@ -111,7 +128,7 @@ def register_model( author: str | None = None, owner: str | None = None, description: str | None = None, - metadata: dict[str, ScalarType] | None = None, + metadata: dict[str, SupportedTypes] | None = None, ) -> RegisteredModel: """Register a model. @@ -142,22 +159,27 @@ def register_model( Returns: Registered model. """ - rm = self._register_model(name, owner=owner or self._author) - mv = self._register_new_version( - rm, - version, - author or self._author, - description=description, - metadata=metadata or {}, + rm = self.async_runner(self._register_model(name, owner=owner or self._author)) + mv = self.async_runner( + self._register_new_version( + rm, + version, + author or self._author, + description=description, + custom_properties=metadata or {}, + ) ) - self._register_model_artifact( - mv, - uri, - model_format_name=model_format_name, - model_format_version=model_format_version, - storage_key=storage_key, - storage_path=storage_path, - service_account_name=service_account_name, + self.async_runner( + self._register_model_artifact( + mv, + name, + uri, + model_format_name=model_format_name, + model_format_version=model_format_version, + storage_key=storage_key, + storage_path=storage_path, + service_account_name=service_account_name, + ) ) return rm @@ -202,18 +224,18 @@ def register_hf_model( from huggingface_hub import HfApi, hf_hub_url, utils except ImportError as e: msg = "huggingface_hub is not installed" - raise StoreException(msg) from e + raise StoreError(msg) from e api = HfApi() try: model_info = api.model_info(repo, revision=git_ref) except utils.RepositoryNotFoundError as e: msg = f"Repository {repo} does not exist" - raise StoreException(msg) from e + raise StoreError(msg) from e except utils.RevisionNotFoundError as e: # TODO: as all hf-hub client calls default to using main, should we provide a tip? msg = f"Revision {git_ref} does not exist" - raise StoreException(msg) from e + raise StoreError(msg) from e if not author: # model author can be None if the repo is in a "global" namespace (i.e. no / in repo). @@ -241,7 +263,7 @@ def register_hf_model( k: v for k, v in card_data.to_dict().items() # TODO: (#151) preserve tags, possibly other complex metadata - if isinstance(v, get_args(ScalarType)) + if isinstance(v, get_args(SupportedTypes)) } ) return self.register_model( @@ -266,7 +288,7 @@ def get_registered_model(self, name: str) -> RegisteredModel | None: Returns: Registered model. """ - return self._api.get_registered_model_by_params(name) + return self.async_runner(self._api.get_registered_model_by_params(name)) def get_model_version(self, name: str, version: str) -> ModelVersion | None: """Get a model version. @@ -281,10 +303,11 @@ def get_model_version(self, name: str, version: str) -> ModelVersion | None: Raises: StoreException: If the model does not exist. """ - if not (rm := self._api.get_registered_model_by_params(name)): + if not (rm := self.get_registered_model(name)): msg = f"Model {name} does not exist" - raise StoreException(msg) - return self._api.get_model_version_by_params(rm.id, version) + raise StoreError(msg) + assert rm.id + return self.async_runner(self._api.get_model_version_by_params(rm.id, version)) def get_model_artifact(self, name: str, version: str) -> ModelArtifact | None: """Get a model artifact. @@ -301,5 +324,6 @@ def get_model_artifact(self, name: str, version: str) -> ModelArtifact | None: """ if not (mv := self.get_model_version(name, version)): msg = f"Version {version} does not exist" - raise StoreException(msg) - return self._api.get_model_artifact_by_params(mv.id) + raise StoreError(msg) + assert mv.id + return self.async_runner(self._api.get_model_artifact_by_params(name, mv.id)) diff --git a/clients/python/src/model_registry/core.py b/clients/python/src/model_registry/core.py index a4e06040d..a9b267e38 100644 --- a/clients/python/src/model_registry/core.py +++ b/clients/python/src/model_registry/core.py @@ -2,55 +2,63 @@ from __future__ import annotations +from collections.abc import AsyncIterator +from contextlib import asynccontextmanager from dataclasses import dataclass -import grpc - -from .exceptions import StoreException -from .store import MLMDStore, ProtoType -from .types import ListOptions, ModelArtifact, ModelVersion, RegisteredModel -from .types.base import ProtoBase -from .types.options import MLMDListOptions -from .utils import header_adder_interceptor +from mr_openapi import ( + ApiClient, + Configuration, + ModelRegistryServiceApi, +) +from mr_openapi import ( + exceptions as mr_exceptions, +) +from typing_extensions import overload + +from ._utils import required_args +from .types import ( + Artifact, + ListOptions, + ModelArtifact, + ModelVersion, + RegisteredModel, +) @dataclass class ModelRegistryAPIClient: """Model registry API.""" - store: MLMDStore + config: Configuration @classmethod def secure_connection( cls, server_address: str, port: int = 443, - user_token: bytes | None = None, - custom_ca: bytes | None = None, + *, + user_token: bytes, + custom_ca: str | None = None, ) -> ModelRegistryAPIClient: """Constructor. Args: server_address: Server address. port: Server port. Defaults to 443. + + Keyword Args: user_token: The PEM-encoded user token as a byte string. - custom_ca: The PEM-encoded root certificates as a byte string. Defaults to GRPC_DEFAULT_SSL_ROOTS_FILE_PATH, then system default. + custom_ca: The path to a PEM- """ - if not user_token: - msg = "user token must be provided for secure connection" - raise StoreException(msg) - - chan = grpc.secure_channel( - f"{server_address}:{port}", - grpc.composite_channel_credentials( - # custom_ca = None will get the default root certificates - grpc.ssl_channel_credentials(custom_ca), - grpc.access_token_call_credentials(user_token), - ), + return cls( + Configuration( + f"{server_address}:{port}", + access_token=user_token, + ssl_ca_cert=custom_ca, + ) ) - return cls(MLMDStore.from_channel(chan)) - @classmethod def insecure_connection( cls, @@ -65,58 +73,45 @@ def insecure_connection( port: Server port. user_token: The PEM-encoded user token as a byte string. """ - if user_token: - chan = grpc.intercept_channel( - grpc.insecure_channel(f"{server_address}:{port}"), - # header key has to be lowercase - header_adder_interceptor("authorization", f"Bearer {user_token}"), - ) - else: - chan = grpc.insecure_channel(f"{server_address}:{port}") - - return cls(MLMDStore.from_channel(chan)) - - def _map(self, py_obj: ProtoBase) -> ProtoType: - """Map a Python object to a proto object. - - Helper around the `map` method of the Python object. + return cls( + Configuration(host=f"{server_address}:{port}", access_token=user_token) + ) - Args: - py_obj: Python object. + @asynccontextmanager + async def get_client(self) -> AsyncIterator[ModelRegistryServiceApi]: + """Get a client for the model registry.""" + api_client = ApiClient(self.config) + client = ModelRegistryServiceApi(api_client) - Returns: - Proto object. - """ - type_id = self.store.get_type_id( - py_obj.get_proto_type(), py_obj.get_proto_type_name() - ) - return py_obj.map(type_id) + try: + yield client + finally: + await api_client.close() - def upsert_registered_model(self, registered_model: RegisteredModel) -> str: + async def upsert_registered_model( + self, registered_model: RegisteredModel + ) -> RegisteredModel: """Upsert a registered model. Updates or creates a registered model on the server. - This updates the registered_model instance passed in with new data from the servers. Args: registered_model: Registered model. Returns: - ID of the registered model. + New registered model. """ - id = self.store.put_context(self._map(registered_model)) - new_py_rm = RegisteredModel.unmap( - self.store.get_context(RegisteredModel.get_proto_type_name(), id) - ) - id = str(id) - registered_model.id = id - registered_model.create_time_since_epoch = new_py_rm.create_time_since_epoch - registered_model.last_update_time_since_epoch = ( - new_py_rm.last_update_time_since_epoch - ) - return id + async with self.get_client() as client: + if registered_model.id: + rm = await client.update_registered_model( + registered_model.id, registered_model.update() + ) + else: + rm = await client.create_registered_model(registered_model.create()) - def get_registered_model_by_id(self, id: str) -> RegisteredModel | None: + return RegisteredModel.from_basemodel(rm) + + async def get_registered_model_by_id(self, id: str) -> RegisteredModel | None: """Fetch a registered model by its ID. Args: @@ -125,15 +120,22 @@ def get_registered_model_by_id(self, id: str) -> RegisteredModel | None: Returns: Registered model. """ - proto_rm = self.store.get_context( - RegisteredModel.get_proto_type_name(), id=int(id) - ) - if proto_rm is not None: - return RegisteredModel.unmap(proto_rm) + async with self.get_client() as client: + try: + rm = await client.get_registered_model(id) + except mr_exceptions.NotFoundException: + return None - return None + return RegisteredModel.from_basemodel(rm) - def get_registered_model_by_params( + @overload + async def get_registered_model_by_params(self, name: str): ... + + @overload + async def get_registered_model_by_params(self, *, external_id: str): ... + + @required_args(("name",), ("external_id",)) + async def get_registered_model_by_params( self, name: str | None = None, external_id: str | None = None ) -> RegisteredModel | None: """Fetch a registered model by its name or external ID. @@ -144,24 +146,18 @@ def get_registered_model_by_params( Returns: Registered model. - - Raises: - StoreException: If neither name nor external ID is provided. """ - if name is None and external_id is None: - msg = "Either name or external_id must be provided" - raise StoreException(msg) - proto_rm = self.store.get_context( - RegisteredModel.get_proto_type_name(), - name=name, - external_id=external_id, - ) - if proto_rm is not None: - return RegisteredModel.unmap(proto_rm) + async with self.get_client() as client: + try: + rm = await client.find_registered_model( + name=name, external_id=external_id + ) + except mr_exceptions.NotFoundException: + return None - return None + return RegisteredModel.from_basemodel(rm) - def get_registered_models( + async def get_registered_models( self, options: ListOptions | None = None ) -> list[RegisteredModel]: """Fetch registered models. @@ -172,43 +168,42 @@ def get_registered_models( Returns: Registered models. """ - mlmd_options = options.as_mlmd_list_options() if options else MLMDListOptions() - proto_rms = self.store.get_contexts( - RegisteredModel.get_proto_type_name(), mlmd_options - ) - return [RegisteredModel.unmap(proto_rm) for proto_rm in proto_rms] + async with self.get_client() as client: + rms = await client.get_registered_models( + **(options or ListOptions()).as_options() + ) + + return [RegisteredModel.from_basemodel(rm) for rm in rms.items or []] - def upsert_model_version( + async def upsert_model_version( self, model_version: ModelVersion, registered_model_id: str - ) -> str: + ) -> ModelVersion: """Upsert a model version. Updates or creates a model version on the server. - This updates the model_version instance passed in with new data from the servers. Args: model_version: Model version to upsert. registered_model_id: ID of the registered model this version will be associated to. Returns: - ID of the model version. + New model version. """ - # this is not ideal but we need this info for the prefix - model_version._registered_model_id = registered_model_id - id = self.store.put_context(self._map(model_version)) - self.store.put_context_parent(int(registered_model_id), id) - new_py_mv = ModelVersion.unmap( - self.store.get_context(ModelVersion.get_proto_type_name(), id) - ) - id = str(id) - model_version.id = id - model_version.create_time_since_epoch = new_py_mv.create_time_since_epoch - model_version.last_update_time_since_epoch = ( - new_py_mv.last_update_time_since_epoch - ) - return id - - def get_model_version_by_id(self, model_version_id: str) -> ModelVersion | None: + async with self.get_client() as client: + if model_version.id: + mv = await client.update_model_version( + model_version.id, model_version.update() + ) + else: + mv = await client.create_model_version( + model_version.create(registered_model_id=registered_model_id) + ) + + return ModelVersion.from_basemodel(mv) + + async def get_model_version_by_id( + self, model_version_id: str + ) -> ModelVersion | None: """Fetch a model version by its ID. Args: @@ -217,15 +212,15 @@ def get_model_version_by_id(self, model_version_id: str) -> ModelVersion | None: Returns: Model version. """ - proto_mv = self.store.get_context( - ModelVersion.get_proto_type_name(), id=int(model_version_id) - ) - if proto_mv is not None: - return ModelVersion.unmap(proto_mv) + async with self.get_client() as client: + try: + mv = await client.get_model_version(model_version_id) + except mr_exceptions.NotFoundException: + return None - return None + return ModelVersion.from_basemodel(mv) - def get_model_versions( + async def get_model_versions( self, registered_model_id: str, options: ListOptions | None = None ) -> list[ModelVersion]: """Fetch model versions by registered model ID. @@ -237,95 +232,85 @@ def get_model_versions( Returns: Model versions. """ - mlmd_options = options.as_mlmd_list_options() if options else MLMDListOptions() - mlmd_options.filter_query = f"parent_contexts_a.id = {registered_model_id}" - return [ - ModelVersion.unmap(proto_mv) - for proto_mv in self.store.get_contexts( - ModelVersion.get_proto_type_name(), mlmd_options + async with self.get_client() as client: + mvs = await client.get_registered_model_versions( + registered_model_id, **(options or ListOptions()).as_options() ) - ] - def get_model_version_by_params( + return [ModelVersion.from_basemodel(mv) for mv in mvs.items or []] + + @overload + async def get_model_version_by_params( + self, registered_model_id: str, name: str + ): ... + + @overload + async def get_model_version_by_params(self, *, external_id: str): ... + + @required_args( + ( + "registered_model_id", + "name", + ), + ("external_id",), + ) + async def get_model_version_by_params( self, registered_model_id: str | None = None, - version: str | None = None, + name: str | None = None, external_id: str | None = None, ) -> ModelVersion | None: """Fetch a model version by associated parameters. - Either fetches by using external ID or by using registered model ID and version. + Either fetches by using external ID or by using registered model ID and version name. Args: registered_model_id: Registered model ID. - version: Model version. + name: Model version. external_id: Model version external ID. Returns: Model version. - - Raises: - StoreException: If neither external ID nor registered model ID and version is provided. """ - if external_id is not None: - proto_mv = self.store.get_context( - ModelVersion.get_proto_type_name(), external_id=external_id - ) - elif registered_model_id is None or version is None: - msg = ( - "Either registered_model_id and version or external_id must be provided" - ) - raise StoreException(msg) - else: - proto_mv = self.store.get_context( - ModelVersion.get_proto_type_name(), - name=f"{registered_model_id}:{version}", - ) - if proto_mv is not None: - return ModelVersion.unmap(proto_mv) - - return None - - def upsert_model_artifact( + async with self.get_client() as client: + try: + mv = await client.find_model_version( + name=name, + external_id=external_id, + parent_resource_id=registered_model_id, + ) + except mr_exceptions.NotFoundException: + return None + + return ModelVersion.from_basemodel(mv) + + async def upsert_model_artifact( self, model_artifact: ModelArtifact, model_version_id: str - ) -> str: + ) -> ModelArtifact: """Upsert a model artifact. Updates or creates a model artifact on the server. - This updates the model_artifact instance passed in with new data from the servers. Args: model_artifact: Model artifact to upsert. model_version_id: ID of the model version this artifact will be associated to. Returns: - ID of the model artifact. - - Raises: - StoreException: If the model version already has a model artifact. + New model artifact. """ - mv_id = int(model_version_id) - if self.store.get_attributed_artifact( - ModelArtifact.get_proto_type_name(), mv_id - ): - msg = f"Model version with ID {mv_id} already has a model artifact" - raise StoreException(msg) - - model_artifact._model_version_id = model_version_id - id = self.store.put_artifact(self._map(model_artifact)) - self.store.put_attribution(mv_id, id) - new_py_ma = ModelArtifact.unmap( - self.store.get_artifact(ModelArtifact.get_proto_type_name(), id) - ) - id = str(id) - model_artifact.id = id - model_artifact.create_time_since_epoch = new_py_ma.create_time_since_epoch - model_artifact.last_update_time_since_epoch = ( - new_py_ma.last_update_time_since_epoch - ) - return id + async with self.get_client() as client: + if model_artifact.id: + ma = await client.update_model_artifact( + model_artifact.id, model_artifact.update() + ) + return ModelArtifact.from_basemodel(ma) + + art = await client.create_model_version_artifact( + model_version_id, model_artifact.wrap() + ) + return ModelArtifact.from_artifact(art) - def get_model_artifact_by_id(self, id: str) -> ModelArtifact | None: + async def get_model_artifact_by_id(self, id: str) -> ModelArtifact | None: """Fetch a model artifact by its ID. Args: @@ -334,44 +319,60 @@ def get_model_artifact_by_id(self, id: str) -> ModelArtifact | None: Returns: Model artifact. """ - proto_ma = self.store.get_artifact(ModelArtifact.get_proto_type_name(), int(id)) - if proto_ma is not None: - return ModelArtifact.unmap(proto_ma) + async with self.get_client() as client: + try: + ma = await client.get_model_artifact(id) + except mr_exceptions.NotFoundException: + return None - return None + return ModelArtifact.from_basemodel(ma) - def get_model_artifact_by_params( - self, model_version_id: str | None = None, external_id: str | None = None + @overload + async def get_model_artifact_by_params( + self, + name: str, + model_version_id: str, + ): ... + + @overload + async def get_model_artifact_by_params(self, *, external_id: str): ... + + @required_args( + ( + "name", + "model_version_id", + ), + ("external_id",), + ) + async def get_model_artifact_by_params( + self, + name: str | None = None, + model_version_id: str | None = None, + external_id: str | None = None, ) -> ModelArtifact | None: - """Fetch a model artifact either by external ID or by the ID of its associated model version. + """Fetch a model artifact either by external ID or by its name and the ID of its associated model version. Args: + name: Model artifact name. model_version_id: ID of the associated model version. external_id: Model artifact external ID. Returns: Model artifact. - - Raises: - StoreException: If neither external ID nor model version ID is provided. """ - if external_id: - proto_ma = self.store.get_artifact( - ModelArtifact.get_proto_type_name(), external_id=external_id - ) - elif not model_version_id: - msg = "Either model_version_id or external_id must be provided" - raise StoreException(msg) - else: - proto_ma = self.store.get_attributed_artifact( - ModelArtifact.get_proto_type_name(), int(model_version_id) - ) - if proto_ma is not None: - return ModelArtifact.unmap(proto_ma) - - return None - - def get_model_artifacts( + async with self.get_client() as client: + try: + ma = await client.find_model_artifact( + name=name, + parent_resource_id=model_version_id, + external_id=external_id, + ) + except mr_exceptions.NotFoundException: + return None + + return ModelArtifact.from_basemodel(ma) + + async def get_model_artifacts( self, model_version_id: str | None = None, options: ListOptions | None = None, @@ -385,11 +386,19 @@ def get_model_artifacts( Returns: Model artifacts. """ - mlmd_options = options.as_mlmd_list_options() if options else MLMDListOptions() - if model_version_id is not None: - mlmd_options.filter_query = f"contexts_a.id = {model_version_id}" - - proto_mas = self.store.get_artifacts( - ModelArtifact.get_proto_type_name(), mlmd_options - ) - return [ModelArtifact.unmap(proto_ma) for proto_ma in proto_mas] + async with self.get_client() as client: + if model_version_id: + arts = await client.get_model_version_artifacts( + model_version_id, **(options or ListOptions()).as_options() + ) + models = [] + for art in arts.items or []: + converted = Artifact.validate_artifact(art) + if isinstance(converted, ModelArtifact): + models.append(converted) + return models + + mas = await client.get_model_artifacts( + **(options or ListOptions()).as_options() + ) + return [ModelArtifact.from_basemodel(ma) for ma in mas.items or []] diff --git a/clients/python/src/model_registry/exceptions.py b/clients/python/src/model_registry/exceptions.py index 7a52ddacf..58cee78b5 100644 --- a/clients/python/src/model_registry/exceptions.py +++ b/clients/python/src/model_registry/exceptions.py @@ -1,7 +1,7 @@ """Exceptions for the model registry.""" -class StoreException(Exception): +class StoreError(Exception): """Storage related error.""" @@ -9,17 +9,17 @@ class MissingMetadata(Exception): """Not enough metadata to complete operation.""" -class UnsupportedTypeException(StoreException): +class UnsupportedType(StoreError): """Raised when an unsupported type is encountered.""" -class TypeNotFoundException(StoreException): +class TypeNotFound(StoreError): """Raised when a type cannot be found.""" -class ServerException(StoreException): +class ServerError(StoreError): """Raised when the server returns a bad response.""" -class DuplicateException(StoreException): +class DuplicateError(StoreError): """Raised when the user tries to put an object with a conflicting property.""" diff --git a/clients/python/src/model_registry/store/__init__.py b/clients/python/src/model_registry/store/__init__.py deleted file mode 100644 index d35c27500..000000000 --- a/clients/python/src/model_registry/store/__init__.py +++ /dev/null @@ -1,10 +0,0 @@ -"""Model registry storage backends.""" - -from .base import ProtoType, ScalarType -from .wrapper import MLMDStore - -__all__ = [ - "ProtoType", - "ScalarType", - "MLMDStore", -] diff --git a/clients/python/src/model_registry/store/base.py b/clients/python/src/model_registry/store/base.py deleted file mode 100644 index 3482ee9ea..000000000 --- a/clients/python/src/model_registry/store/base.py +++ /dev/null @@ -1,12 +0,0 @@ -"""Base classes and types for MLMD store.""" - -from typing import Union - -from ml_metadata.proto import Artifact, Context - -# Union of all proto types. -ProtoType = Union[Artifact, Context] -# Union of all scalar types. -# -# Those types are easy to map to and from proto types, and can also be queried in MLMD. -ScalarType = Union[str, int, float, bool] diff --git a/clients/python/src/model_registry/store/wrapper.py b/clients/python/src/model_registry/store/wrapper.py deleted file mode 100644 index dd291eeb8..000000000 --- a/clients/python/src/model_registry/store/wrapper.py +++ /dev/null @@ -1,375 +0,0 @@ -"""MLMD storage backend wrapper.""" - -from __future__ import annotations - -from collections.abc import Sequence -from dataclasses import dataclass -from typing import ClassVar - -from grpc import Channel -from ml_metadata import errors -from ml_metadata.metadata_store import ListOptions, MetadataStore -from ml_metadata.proto import ( - Artifact, - Attribution, - Context, - MetadataStoreClientConfig, - ParentContext, -) -from ml_metadata.proto.metadata_store_service_pb2_grpc import MetadataStoreServiceStub - -from model_registry.exceptions import ( - DuplicateException, - ServerException, - StoreException, - TypeNotFoundException, -) - -from .base import ProtoType - - -@dataclass -class MLMDStore: - """MLMD storage backend.""" - - store: MetadataStore - # cache for MLMD type IDs - _type_ids: ClassVar[dict[str, int]] = {} - - @classmethod - def from_config(cls, host: str, port: int): - """Constructor. - - Args: - host: MLMD store server host. - port: MLMD store server port. - """ - return cls( - MetadataStore( - MetadataStoreClientConfig( - host=host, - port=port, - ) - ) - ) - - @classmethod - def from_channel(cls, chan: Channel): - """Constructor. - - Args: - chan: gRPC channel to the MLMD store. - """ - store = MetadataStore( - MetadataStoreClientConfig(host="localhost", port=8080), - ) - store._metadata_store_stub = MetadataStoreServiceStub(chan) - return cls(store) - - def get_type_id(self, pt: type[ProtoType], type_name: str) -> int: - """Get backend ID for a type. - - Args: - pt: Proto type. - type_name: Name of the type. - - Returns: - Backend ID. - - Raises: - TypeNotFoundException: If the type doesn't exist. - ServerException: If there was an error getting the type. - """ - if type_name in self._type_ids: - return self._type_ids[type_name] - - pt_name = pt.__name__.lower() - - try: - _type = getattr(self.store, f"get_{pt_name}_type")(type_name) - except errors.NotFoundError as e: - msg = f"{pt_name} type {type_name} does not exist" - raise TypeNotFoundException(msg) from e - except errors.InternalError as e: - msg = f"Couldn't get {pt_name} type {type_name} from MLMD store" - raise ServerException(msg) from e - - self._type_ids[type_name] = _type.id - return _type.id - - def put_artifact(self, artifact: Artifact) -> int: - """Put an artifact in the store. - - Args: - artifact: Artifact to put. - - Returns: - ID of the artifact. - - Raises: - DuplicateException: If an artifact with the same name or external id already exists. - TypeNotFoundException: If the type doesn't exist. - StoreException: If the artifact isn't properly formed. - """ - try: - return self.store.put_artifacts([artifact])[0] - except errors.AlreadyExistsError as e: - msg = f"Artifact {artifact.name} already exists" - raise DuplicateException(msg) from e - except errors.InvalidArgumentError as e: - msg = "Artifact has invalid properties" - raise StoreException(msg) from e - except errors.NotFoundError as e: - msg = f"Artifact type {artifact.type} does not exist" - raise TypeNotFoundException(msg) from e - - def put_context(self, context: Context) -> int: - """Put a context in the store. - - Args: - context: Context to put. - - Returns: - ID of the context. - - Raises: - DuplicateException: If a context with the same name or external id already exists. - TypeNotFoundException: If the type doesn't exist. - StoreException: If the context isn't propertly formed. - """ - try: - return self.store.put_contexts([context])[0] - except errors.AlreadyExistsError as e: - msg = f"Context {context.name} already exists" - raise DuplicateException(msg) from e - except errors.InvalidArgumentError as e: - msg = "Context has invalid properties" - raise StoreException(msg) from e - except errors.NotFoundError as e: - msg = f"Context type {context.type} does not exist" - raise TypeNotFoundException(msg) from e - - def _filter_type( - self, type_name: str, protos: Sequence[ProtoType] - ) -> list[ProtoType]: - return [proto for proto in protos if proto.type == type_name] - - def get_context( - self, - ctx_type_name: str, - id: int | None = None, - name: str | None = None, - external_id: str | None = None, - ) -> Context | None: - """Get a context from the store. - - This gets a context either by ID, name or external ID. - If multiple arguments are provided, the simplest query will be performed. - - Args: - ctx_type_name: Name of the context type. - id: ID of the context. - name: Name of the context. - external_id: External ID of the context. - - Returns: - Context. - - Raises: - StoreException: Invalid arguments. - """ - if name is not None: - return self.store.get_context_by_type_and_name(ctx_type_name, name) - - if id is not None: - contexts = self.store.get_contexts_by_id([id]) - elif external_id is not None: - contexts = self.store.get_contexts_by_external_ids([external_id]) - else: - msg = "Either id, name or external_id must be provided" - raise StoreException(msg) - - contexts = self._filter_type(ctx_type_name, contexts) - if contexts: - return contexts[0] - - return None - - def get_contexts(self, ctx_type_name: str, options: ListOptions) -> list[Context]: - """Get contexts from the store. - - Args: - ctx_type_name: Name of the context type. - options: List options. - - Returns: - Contexts. - - Raises: - TypeNotFoundException: If the type doesn't exist. - ServerException: If there was an error getting the type. - StoreException: Invalid arguments. - """ - # TODO: should we make options optional? - # if options is not None: - try: - contexts = self.store.get_contexts(options) - except errors.InvalidArgumentError as e: - msg = f"Invalid arguments for get_contexts: {e}" - raise StoreException(msg) from e - except errors.InternalError as e: - msg = "Couldn't get contexts from MLMD store" - raise ServerException(msg) from e - - contexts = self._filter_type(ctx_type_name, contexts) - # else: - # contexts = self.store.get_contexts_by_type(ctx_type_name) - - if not contexts and ctx_type_name not in [ - t.name for t in self.store.get_context_types() - ]: - msg = f"Context type {ctx_type_name} does not exist" - raise TypeNotFoundException(msg) - - return contexts - - def put_context_parent(self, parent_id: int, child_id: int): - """Put a parent-child relationship between two contexts. - - Args: - parent_id: ID of the parent context. - child_id: ID of the child context. - - Raises: - StoreException: If the parent context doesn't exist. - ServerException: If there was an error putting the parent context. - """ - try: - self.store.put_parent_contexts( - [ParentContext(parent_id=parent_id, child_id=child_id)] - ) - except errors.AlreadyExistsError as e: - msg = f"Parent context {parent_id} already exists for context {child_id}" - raise StoreException(msg) from e - except errors.InternalError as e: - msg = f"Couldn't put parent context {parent_id} for context {child_id}" - raise ServerException(msg) from e - - def put_attribution(self, context_id: int, artifact_id: int): - """Put an attribution relationship between a context and an artifact. - - Args: - context_id: ID of the context. - artifact_id: ID of the artifact. - - Raises: - StoreException: Invalid argument. - """ - attribution = Attribution(context_id=context_id, artifact_id=artifact_id) - try: - self.store.put_attributions_and_associations([attribution], []) - except errors.InvalidArgumentError as e: - if "artifact" in str(e).lower(): - msg = f"Artifact with ID {artifact_id} does not exist" - raise StoreException(msg) from e - - if "context" in str(e).lower(): - msg = f"Context with ID {context_id} does not exist" - raise StoreException(msg) from e - - msg = f"Invalid argument: {e}" - raise StoreException(msg) from e - - def get_artifact( - self, - art_type_name: str, - id: int | None = None, - name: str | None = None, - external_id: str | None = None, - ) -> Artifact | None: - """Get an artifact from the store. - - Gets an artifact either by ID, name or external ID. - - Args: - art_type_name: Name of the artifact type. - id: ID of the artifact. - name: Name of the artifact. - external_id: External ID of the artifact. - - Returns: - Artifact. - - Raises: - StoreException: Invalid arguments. - """ - if name is not None: - return self.store.get_artifact_by_type_and_name(art_type_name, name) - - if id is not None: - artifacts = self.store.get_artifacts_by_id([id]) - elif external_id is not None: - artifacts = self.store.get_artifacts_by_external_ids([external_id]) - else: - msg = "Either id, name or external_id must be provided" - raise StoreException(msg) - - artifacts = self._filter_type(art_type_name, artifacts) - if artifacts: - return artifacts[0] - - return None - - def get_attributed_artifact(self, art_type_name: str, ctx_id: int) -> Artifact: - """Get an artifact from the store by its attributed context. - - Args: - art_type_name: Name of the artifact type. - ctx_id: ID of the context. - - Returns: - Artifact. - """ - try: - artifacts = self.store.get_artifacts_by_context(ctx_id) - except errors.InternalError as e: - msg = f"Couldn't get artifacts by context {ctx_id}" - raise ServerException(msg) from e - artifacts = self._filter_type(art_type_name, artifacts) - if artifacts: - return artifacts[0] - - return None - - def get_artifacts(self, art_type_name: str, options: ListOptions) -> list[Artifact]: - """Get artifacts from the store. - - Args: - art_type_name: Name of the artifact type. - options: List options. - - Returns: - Artifacts. - - Raises: - TypeNotFoundException: If the type doesn't exist. - ServerException: If there was an error getting the type. - StoreException: Invalid arguments. - """ - try: - artifacts = self.store.get_artifacts(options) - except errors.InvalidArgumentError as e: - msg = f"Invalid arguments for get_artifacts: {e}" - raise StoreException(msg) from e - except errors.InternalError as e: - msg = "Couldn't get artifacts from MLMD store" - raise ServerException(msg) from e - - artifacts = self._filter_type(art_type_name, artifacts) - if not artifacts and art_type_name not in [ - t.name for t in self.store.get_artifact_types() - ]: - msg = f"Artifact type {art_type_name} does not exist" - raise TypeNotFoundException(msg) - - return artifacts diff --git a/clients/python/src/model_registry/types/__init__.py b/clients/python/src/model_registry/types/__init__.py index 722dc9d14..e63612a83 100644 --- a/clients/python/src/model_registry/types/__init__.py +++ b/clients/python/src/model_registry/types/__init__.py @@ -3,19 +3,27 @@ Types are based on [ML Metadata](https://github.com/google/ml-metadata), with Pythonic class wrappers. """ -from .artifacts import ArtifactState, ModelArtifact -from .contexts import ContextState, ModelVersion, RegisteredModel -from .options import ListOptions, OrderByField +from .artifacts import Artifact, ArtifactState, ModelArtifact +from .base import SupportedTypes +from .contexts import ( + ModelVersion, + ModelVersionState, + RegisteredModel, + RegisteredModelState, +) +from .options import ListOptions __all__ = [ # Artifacts - "ModelArtifact", + "Artifact", "ArtifactState", + "ModelArtifact", # Contexts "ModelVersion", + "ModelVersionState", "RegisteredModel", - "ContextState", + "RegisteredModelState", + "SupportedTypes", # Options "ListOptions", - "OrderByField", ] diff --git a/clients/python/src/model_registry/types/artifacts.py b/clients/python/src/model_registry/types/artifacts.py index da7c27998..4bb4af4e7 100644 --- a/clients/python/src/model_registry/types/artifacts.py +++ b/clients/python/src/model_registry/types/artifacts.py @@ -12,32 +12,32 @@ from __future__ import annotations -from enum import Enum, unique -from uuid import uuid4 - -from attrs import define, field -from ml_metadata.proto import Artifact +from abc import ABC, abstractmethod +from typing import Any, TypeVar + +from mr_openapi import ( + Artifact as ArtifactBaseModel, +) +from mr_openapi import ( + ArtifactState, + ModelArtifactCreate, + ModelArtifactUpdate, +) +from mr_openapi import ( + DocArtifact as DocArtifactBaseModel, +) +from mr_openapi import ( + ModelArtifact as ModelArtifactBaseModel, +) from typing_extensions import override -from .base import Prefixable, ProtoBase - - -@unique -class ArtifactState(Enum): - """State of an artifact.""" +from .base import BaseResourceModel - UNKNOWN = Artifact.UNKNOWN - PENDING = Artifact.PENDING - LIVE = Artifact.LIVE - MARKED_FOR_DELETION = Artifact.MARKED_FOR_DELETION - DELETED = Artifact.DELETED - ABANDONED = Artifact.ABANDONED - REFERENCE = Artifact.REFERENCE +A = TypeVar("A", bound="Artifact") -@define(slots=False) -class BaseArtifact(ProtoBase): - """Abstract base class for all artifacts. +class Artifact(BaseResourceModel, ABC): + """Base class for all artifacts. Attributes: name: Name of the artifact. @@ -45,36 +45,83 @@ class BaseArtifact(ProtoBase): state: State of the artifact. """ - name: str + name: str | None = None uri: str - state: ArtifactState = field(init=False, default=ArtifactState.UNKNOWN) + state: ArtifactState = ArtifactState.UNKNOWN @classmethod + def from_artifact(cls: type[A], source: ArtifactBaseModel) -> A: + """Convert a base artifact.""" + model = source.actual_instance + assert model + return cls.from_basemodel(model) + + @staticmethod + def validate_artifact(source: ArtifactBaseModel) -> DocArtifact | ModelArtifact: + """Validate an artifact.""" + model = source.actual_instance + assert model + if isinstance(model, DocArtifactBaseModel): + return DocArtifact.from_basemodel(model) + return ModelArtifact.from_basemodel(model) + + @abstractmethod + def as_basemodel(self) -> Any: + """Wrap the object in a BaseModel object.""" + + def wrap(self) -> ArtifactBaseModel: + """Wrap the object in a ArtifactBaseModel object.""" + return ArtifactBaseModel(self.as_basemodel()) + + +class DocArtifact(Artifact): + """Represents a Document Artifact. + + Attributes: + name: Name of the document. + uri: URI of the document. + description: Description of the object. + external_id: Customizable ID. Has to be unique among instances of the same type. + """ + @override - def get_proto_type(cls) -> type[Artifact]: - return Artifact + def create(self, **kwargs) -> Any: + raise NotImplementedError @override - def map(self, type_id: int) -> Artifact: - mlmd_obj = super().map(type_id) - mlmd_obj.uri = self.uri - mlmd_obj.state = self.state.value - return mlmd_obj + def update(self, **kwargs) -> Any: + raise NotImplementedError + + @override + def as_basemodel(self) -> DocArtifactBaseModel: + return DocArtifactBaseModel( + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("custom_properties")), + artifactType="doc-artifact", + ) @classmethod @override - def unmap(cls, mlmd_obj: Artifact) -> BaseArtifact: - py_obj = super().unmap(mlmd_obj) - assert isinstance( - py_obj, BaseArtifact - ), f"Expected BaseArtifact, got {type(py_obj)}" - py_obj.uri = mlmd_obj.uri - py_obj.state = ArtifactState(mlmd_obj.state) - return py_obj - - -@define(slots=False, auto_attribs=True) -class ModelArtifact(BaseArtifact, Prefixable): + def from_basemodel(cls, source: DocArtifactBaseModel) -> DocArtifact: + assert source.name + assert source.uri + assert source.state + return cls( + id=source.id, + name=source.name, + description=source.description, + external_id=source.external_id, + create_time_since_epoch=source.create_time_since_epoch, + last_update_time_since_epoch=source.last_update_time_since_epoch, + uri=source.uri, + state=source.state, + custom_properties=cls._unmap_custom_properties(source.custom_properties) + if source.custom_properties + else None, + ) + + +class ModelArtifact(Artifact): """Represents a Model. Attributes: @@ -90,46 +137,62 @@ class ModelArtifact(BaseArtifact, Prefixable): """ # TODO: this could be an enum of valid formats - model_format_name: str | None = field(kw_only=True, default=None) - model_format_version: str | None = field(kw_only=True, default=None) - storage_key: str | None = field(kw_only=True, default=None) - storage_path: str | None = field(kw_only=True, default=None) - service_account_name: str | None = field(kw_only=True, default=None) + model_format_name: str | None = None + model_format_version: str | None = None + storage_key: str | None = None + storage_path: str | None = None + service_account_name: str | None = None - _model_version_id: str | None = field(init=False, default=None) + _model_version_id: str | None = None - @property @override - def mlmd_name_prefix(self) -> str: - return self._model_version_id if self._model_version_id else uuid4().hex + def create(self, **kwargs) -> ModelArtifactCreate: + """Create a new ModelArtifactCreate object.""" + return ModelArtifactCreate( + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("id", "custom_properties")), + **kwargs, + ) @override - def map(self, type_id: int) -> Artifact: - mlmd_obj = super().map(type_id) - props = { - "model_format_name": self.model_format_name, - "model_format_version": self.model_format_version, - "storage_key": self.storage_key, - "storage_path": self.storage_path, - "service_account_name": self.service_account_name, - } - self._map_props(props, mlmd_obj.properties) - return mlmd_obj + def update(self, **kwargs) -> ModelArtifactUpdate: + """Create a new ModelArtifactUpdate object.""" + return ModelArtifactUpdate( + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("id", "name", "custom_properties")), + **kwargs, + ) @override + def as_basemodel(self) -> ModelArtifactBaseModel: + return ModelArtifactBaseModel( + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("custom_properties")), + artifactType="model-artifact", + ) + @classmethod - def unmap(cls, mlmd_obj: Artifact) -> ModelArtifact: - py_obj = super().unmap(mlmd_obj) - assert isinstance( - py_obj, ModelArtifact - ), f"Expected ModelArtifact, got {type(py_obj)}" - py_obj.model_format_name = mlmd_obj.properties["model_format_name"].string_value - py_obj.model_format_version = mlmd_obj.properties[ - "model_format_version" - ].string_value - py_obj.storage_key = mlmd_obj.properties["storage_key"].string_value - py_obj.storage_path = mlmd_obj.properties["storage_path"].string_value - py_obj.service_account_name = mlmd_obj.properties[ - "service_account_name" - ].string_value - return py_obj + @override + def from_basemodel(cls, source: ModelArtifactBaseModel) -> ModelArtifact: + """Create a new ModelArtifact object from a BaseModel object.""" + assert source.name + assert source.uri + assert source.state + return cls( + id=source.id, + name=source.name, + description=source.description, + external_id=source.external_id, + create_time_since_epoch=source.create_time_since_epoch, + last_update_time_since_epoch=source.last_update_time_since_epoch, + uri=source.uri, + model_format_name=source.model_format_name, + model_format_version=source.model_format_version, + storage_key=source.storage_key, + storage_path=source.storage_path, + service_account_name=source.service_account_name, + state=source.state, + custom_properties=cls._unmap_custom_properties(source.custom_properties) + if source.custom_properties + else None, + ) diff --git a/clients/python/src/model_registry/types/base.py b/clients/python/src/model_registry/types/base.py index 1d67bcce3..5a69e18c8 100644 --- a/clients/python/src/model_registry/types/base.py +++ b/clients/python/src/model_registry/types/base.py @@ -3,82 +3,23 @@ from __future__ import annotations from abc import ABC, abstractmethod -from collections.abc import Mapping -from typing import Any, TypeVar, get_args +from collections.abc import Sequence +from typing import Any, Union, get_args -from attrs import define, field -from typing_extensions import override +from mr_openapi.models.metadata_value import MetadataValue +from pydantic import BaseModel, ConfigDict -from model_registry.store import ProtoType, ScalarType +SupportedTypes = Union[bool, int, float, str] -class Mappable(ABC): - """Interface for types that can be mapped to and from proto types.""" - - @classmethod - def get_proto_type_name(cls) -> str: - """Name of the proto type. - - Returns: - Name of the class prefixed with `kf.` - """ - return f"kf.{cls.__name__}" - - @property - @abstractmethod - def proto_name(self) -> str: - """Name of the proto object.""" - pass - - @abstractmethod - def map(self, type_id: int) -> ProtoType: - """Map to a proto object. - - Args: - type_id (int): ID of the type. - - Returns: - Proto object. - """ - pass - - @classmethod - @abstractmethod - def unmap(cls, mlmd_obj: ProtoType) -> Mappable: - """Map from a proto object. - - Args: - mlmd_obj: Proto object. - - Returns: - Python object. - """ - pass - - -class Prefixable(ABC): - """Interface for types that are prefixed. - - We use prefixes to ensure that the user can insert more than one instance of the same type - with the same name/external_id. - """ - - @property - @abstractmethod - def mlmd_name_prefix(self) -> str: - """Prefix to be used in the proto object.""" - pass - - -@define(slots=False, init=False) -class ProtoBase(Mappable, ABC): +class BaseResourceModel(BaseModel, ABC): """Abstract base type for protos. - This is a type defining common functionality for all types representing Model Registry protos, + This is a type defining common functionality for all types representing Model Registry resources, such as Artifacts, Contexts, and Executions. Attributes: - id: Protobuf object ID. Auto-assigned when put on the server. + id: Object ID. Auto-assigned when put on the server. name: Name of the object. description: Description of the object. external_id: Customizable ID. Has to be unique among instances of the same type. @@ -86,104 +27,91 @@ class ProtoBase(Mappable, ABC): last_update_time_since_epoch: Seconds elapsed since object last update time, measured against epoch. """ - name: str = field(init=False) - id: str | None = field(init=False, default=None) - description: str | None = field(kw_only=True, default=None) - external_id: str | None = field(kw_only=True, default=None) - create_time_since_epoch: int | None = field(init=False, default=None) - last_update_time_since_epoch: int | None = field(init=False, default=None) + model_config = ConfigDict(protected_namespaces=()) - @property - @override - def proto_name(self) -> str: - if isinstance(self, Prefixable): - return f"{self.mlmd_name_prefix}:{self.name}" - return self.name + id: str | None = None + description: str | None = None + external_id: str | None = None + create_time_since_epoch: str | None = None + last_update_time_since_epoch: str | None = None + custom_properties: dict[str, SupportedTypes] | None = None - @classmethod @abstractmethod - def get_proto_type(cls) -> type[ProtoType]: - """Proto type associated with this class. + def create(self, **kwargs) -> Any: + """Convert the object to a create request.""" - Returns: - Proto type. - """ - pass + @abstractmethod + def update(self, **kwargs) -> Any: + """Convert the object to an update request.""" - @staticmethod - def _map_props( - py_props: Mapping[str, ScalarType | None], mlmd_props: dict[str, Any] - ): + @classmethod + @abstractmethod + def from_basemodel(cls, source: Any) -> Any: + """Create a new object from a BaseModel object.""" + + def _map_custom_properties( + self, + ) -> dict[str, MetadataValue] | None: """Map properties from Python to proto. Args: py_props: Python properties. mlmd_props: Proto properties, will be modified in place. """ - for key, value in py_props.items(): + if not self.custom_properties: + return None + + def get_meta_type(v: SupportedTypes) -> str: + if isinstance(v, float): + return "double" + if isinstance(v, str): + return "string" + return type(v).__name__.lower() + + def get_meta_value(v: SupportedTypes) -> MetadataValue: + type = get_meta_type(v) + v = str(v) if isinstance(v, int) and not isinstance(v, bool) else v + return MetadataValue.from_dict( + { + f"{type}_value": v, + "metadataType": f"Metadata{type.capitalize()}Value", + } + ) + + dest = {} + for key, value in self.custom_properties.items(): if value is None: continue - # TODO: use pattern matching here (3.10) - if isinstance(value, bool): - mlmd_props[key].bool_value = value - elif isinstance(value, int): - mlmd_props[key].int_value = value - elif isinstance(value, float): - mlmd_props[key].double_value = value - elif isinstance(value, str): - mlmd_props[key].string_value = value - else: - msg = f"Unsupported type: {type(value)}" - raise Exception(msg) - - @override - def map(self, type_id: int) -> ProtoType: - mlmd_obj = (self.get_proto_type())() - mlmd_obj.name = self.proto_name - mlmd_obj.type_id = type_id - if self.id: - mlmd_obj.id = int(self.id) - if self.external_id: - mlmd_obj.external_id = self.external_id - if self.description: - mlmd_obj.properties["description"].string_value = self.description - return mlmd_obj - - @staticmethod - def _unmap_props(mlmd_props: dict[str, Any]) -> dict[str, ScalarType]: - """Map properties from proto to Python. - - Args: - mlmd_props: Proto properties. - - Returns: - Python properties. - """ - py_props: dict[str, ScalarType] = {} - for key, prop in mlmd_props.items(): - _, value = prop.ListFields()[0] - if not isinstance(value, get_args(ScalarType)): - msg = f"Unsupported type {type(value)} on key {key}" - raise Exception(msg) - py_props[key] = value - - return py_props - - T = TypeVar("T", bound="ProtoBase") + dest[key] = get_meta_value(value) + return dest @classmethod - @override - def unmap(cls: type[T], mlmd_obj: ProtoType) -> T: - py_obj = cls.__new__(cls) - py_obj.id = str(mlmd_obj.id) - if isinstance(py_obj, Prefixable): - name: str = mlmd_obj.name - assert ":" in name, f"Expected {name} to be prefixed" - py_obj.name = name.split(":", 1)[1] - else: - py_obj.name = mlmd_obj.name - py_obj.description = mlmd_obj.properties["description"].string_value - py_obj.external_id = mlmd_obj.external_id - py_obj.create_time_since_epoch = mlmd_obj.create_time_since_epoch - py_obj.last_update_time_since_epoch = mlmd_obj.last_update_time_since_epoch - return py_obj + def _unmap_custom_properties( + cls, custom_properties: dict[str, MetadataValue] + ) -> dict[str, SupportedTypes]: + def get_meta_value(meta: Any) -> SupportedTypes: + type_name = meta.metadata_type[8:-5].lower() + # Metadata type names are in the format MetadataValue + v = getattr(meta, f"{type_name}_value") + if type_name == "int": + return int(v) + return v + + return { + name: value + for name, meta_value in custom_properties.items() + if isinstance( + value := get_meta_value(meta_value.actual_instance), + get_args(SupportedTypes), + ) + } + + def _props_as_dict( + self, exclude: Sequence[str] | None = None, alias: bool = False + ) -> dict[str, Any]: + exclude = exclude or [] + return { + k: getattr(self, k) + for k in self.model_json_schema(alias).get("properties", {}) + if k not in exclude + } diff --git a/clients/python/src/model_registry/types/contexts.py b/clients/python/src/model_registry/types/contexts.py index ecd083c79..0d55114f8 100644 --- a/clients/python/src/model_registry/types/contexts.py +++ b/clients/python/src/model_registry/types/contexts.py @@ -11,120 +11,78 @@ from __future__ import annotations -from abc import ABC -from enum import Enum, unique - -from attrs import define, field -from ml_metadata.proto import Context +from mr_openapi import ( + ModelVersion as ModelVersionBaseModel, +) +from mr_openapi import ( + ModelVersionCreate, + ModelVersionState, + ModelVersionUpdate, + RegisteredModelCreate, + RegisteredModelState, + RegisteredModelUpdate, +) +from mr_openapi import ( + RegisteredModel as RegisteredModelBaseModel, +) from typing_extensions import override -from model_registry.store import ScalarType - -from .artifacts import BaseArtifact -from .base import Prefixable, ProtoBase - - -@unique -class ContextState(Enum): - """State of the context. - - LIVE: The context is live and can be used. - ARCHIVED: The context is archived and can't be used. - """ - - LIVE = "LIVE" - ARCHIVED = "ARCHIVED" - - -@define(slots=False, init=False) -class BaseContext(ProtoBase, ABC): - """Abstract base class for all contexts.""" +from .base import BaseResourceModel - state: ContextState = field(init=False, default=ContextState.LIVE) - @override - def map(self, type_id: int) -> Context: - mlmd_obj = super().map(type_id) - mlmd_obj.properties["state"].string_value = self.state.value - return mlmd_obj - - @classmethod - @override - def unmap(cls, mlmd_obj: Context) -> BaseContext: - py_obj = super().unmap(mlmd_obj) - assert isinstance( - py_obj, BaseContext - ), f"Expected BaseContext, got {type(py_obj)}" - py_obj.state = ContextState(mlmd_obj.properties["state"].string_value) - return py_obj - - @classmethod - @override - def get_proto_type(cls) -> type[Context]: - return Context - - -@define(slots=False) -class ModelVersion(BaseContext, Prefixable): +class ModelVersion(BaseResourceModel): """Represents a model version. Attributes: - model_name: Name of the model associated with this version. - version: Version of the model. + name: Name of this version. author: Author of the model version. description: Description of the object. external_id: Customizable ID. Has to be unique among instances of the same type. artifacts: Artifacts associated with this version. - metadata: Metadata associated with this version. """ - model_name: str - version: str - author: str - metadata: dict[str, ScalarType] = field(factory=dict) - artifacts: list[BaseArtifact] = field(init=False, factory=list) - - _registered_model_id: str | None = field(init=False, default=None) - - def __attrs_post_init__(self) -> None: - self.name = self.version + name: str + author: str | None = None + state: ModelVersionState = ModelVersionState.LIVE - @property @override - def mlmd_name_prefix(self) -> str: - assert ( - self._registered_model_id is not None - ), "There's no registered model associated with this version" - return self._registered_model_id + def create(self, *, registered_model_id: str, **kwargs) -> ModelVersionCreate: # type: ignore[override] + return ModelVersionCreate( + registeredModelId=registered_model_id, + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("id", "custom_properties")), + **kwargs, + ) @override - def map(self, type_id: int) -> Context: - mlmd_obj = super().map(type_id) - # this should match the name of the registered model - props = { - "model_name": self.model_name, - "author": self.author, - } - self._map_props(props, mlmd_obj.properties) - self._map_props(self.metadata, mlmd_obj.custom_properties) - return mlmd_obj + def update(self, **kwargs) -> ModelVersionUpdate: + return ModelVersionUpdate( + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("id", "name", "custom_properties")), + **kwargs, + ) @classmethod @override - def unmap(cls, mlmd_obj: Context) -> ModelVersion: - py_obj = super().unmap(mlmd_obj) - assert isinstance( - py_obj, ModelVersion - ), f"Expected ModelVersion, got {type(py_obj)}" - py_obj.version = py_obj.name - py_obj.model_name = mlmd_obj.properties["model_name"].string_value - py_obj.author = mlmd_obj.properties["author"].string_value - py_obj.metadata = cls._unmap_props(mlmd_obj.custom_properties) - return py_obj - - -@define(slots=False) -class RegisteredModel(BaseContext): + def from_basemodel(cls, source: ModelVersionBaseModel) -> ModelVersion: + assert source.name + assert source.state + return cls( + id=source.id, + name=source.name, + state=source.state, + author=source.author, + description=source.description, + external_id=source.external_id, + create_time_since_epoch=source.create_time_since_epoch, + last_update_time_since_epoch=source.last_update_time_since_epoch, + custom_properties=cls._unmap_custom_properties(source.custom_properties) + if source.custom_properties + else None, + ) + + +class RegisteredModel(BaseResourceModel): """Represents a registered model. Attributes: @@ -136,20 +94,39 @@ class RegisteredModel(BaseContext): name: str owner: str | None = None + state: RegisteredModelState = RegisteredModelState.LIVE + + @override + def create(self, **kwargs) -> RegisteredModelCreate: + return RegisteredModelCreate( + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("id", "custom_properties")), + **kwargs, + ) @override - def map(self, type_id: int) -> Context: - mlmd_obj = super().map(type_id) - props = {"owner": self.owner} - self._map_props(props, mlmd_obj.properties) - return mlmd_obj + def update(self, **kwargs) -> RegisteredModelUpdate: + return RegisteredModelUpdate( + customProperties=self._map_custom_properties(), + **self._props_as_dict(exclude=("id", "name", "custom_properties")), + **kwargs, + ) @classmethod @override - def unmap(cls, mlmd_obj: Context) -> RegisteredModel: - py_obj = super().unmap(mlmd_obj) - assert isinstance( - py_obj, RegisteredModel - ), f"Expected RegisteredModel, got {type(py_obj)}" - py_obj.owner = mlmd_obj.properties["owner"].string_value - return py_obj + def from_basemodel(cls, source: RegisteredModelBaseModel) -> RegisteredModel: + assert source.name + assert source.state + return cls( + id=source.id, + name=source.name, + owner=source.owner, + state=source.state, + description=source.description, + external_id=source.external_id, + create_time_since_epoch=source.create_time_since_epoch, + last_update_time_since_epoch=source.last_update_time_since_epoch, + custom_properties=cls._unmap_custom_properties(source.custom_properties) + if source.custom_properties + else None, + ) diff --git a/clients/python/src/model_registry/types/options.py b/clients/python/src/model_registry/types/options.py index 3e4ef688a..3be74ef48 100644 --- a/clients/python/src/model_registry/types/options.py +++ b/clients/python/src/model_registry/types/options.py @@ -5,22 +5,13 @@ from __future__ import annotations -from enum import Enum +from dataclasses import dataclass +from typing import Any -from attrs import define, field -from ml_metadata.metadata_store import ListOptions as MLMDListOptions -from ml_metadata.metadata_store import OrderByField as MLMDOrderByField +from mr_openapi import OrderByField, SortOrder -class OrderByField(Enum): - """Fields to order by.""" - - CREATE_TIME = MLMDOrderByField.CREATE_TIME - UPDATE_TIME = MLMDOrderByField.UPDATE_TIME - ID = MLMDOrderByField.ID - - -@define +@dataclass class ListOptions: """Options for listing objects. @@ -30,18 +21,32 @@ class ListOptions: is_asc: Whether to order in ascending order. Defaults to True. """ - limit: int | None = field(default=None) - order_by: OrderByField | None = field(default=None) - is_asc: bool = field(default=True) - - def as_mlmd_list_options(self) -> MLMDListOptions: - """Convert to MLMD ListOptions. - - Returns: - MLMD ListOptions. - """ - return MLMDListOptions( - limit=self.limit, - order_by=OrderByField(self.order_by).value if self.order_by else None, - is_asc=self.is_asc, - ) + limit: int | None = None + order_by: OrderByField | None = None + is_asc: bool = True + + @classmethod + def order_by_creation_time(cls, **kwargs) -> ListOptions: + """Return options to order by creation time.""" + return cls(order_by=OrderByField.CREATE_TIME, **kwargs) + + @classmethod + def order_by_update_time(cls, **kwargs) -> ListOptions: + """Return options to order by update time.""" + return cls(order_by=OrderByField.LAST_UPDATE_TIME, **kwargs) + + @classmethod + def order_by_id(cls, **kwargs) -> ListOptions: + """Return options to order by ID.""" + return cls(order_by=OrderByField.ID, **kwargs) + + def as_options(self) -> dict[str, Any]: + """Convert to options dictionary.""" + options = {} + if self.limit is not None: + options["page_size"] = str(self.limit) + if self.order_by is not None: + options["order_by"] = self.order_by + if self.is_asc is not None: + options["sort_order"] = SortOrder.ASC if self.is_asc else SortOrder.DESC + return options diff --git a/clients/python/src/model_registry/utils.py b/clients/python/src/model_registry/utils.py index 1deb67a62..e60dcf5dd 100644 --- a/clients/python/src/model_registry/utils.py +++ b/clients/python/src/model_registry/utils.py @@ -3,11 +3,7 @@ from __future__ import annotations import os -from collections import namedtuple -from typing import Callable -import grpc -from attr import dataclass from typing_extensions import overload from ._utils import required_args @@ -94,85 +90,3 @@ def s3_uri_from( # https://alexwlchan.net/2020/s3-keys-are-not-file-paths/ nor do they resolve to valid URls # FIXME: is this safe? return f"s3://{bucket}/{path}?endpoint={endpoint}&defaultRegion={region}" - - -# https://github.com/grpc/grpc/blob/master/examples/python/interceptors/headers/generic_client_interceptor.py -@dataclass -class GenericClientInterceptor( # noqa: D101 - grpc.UnaryUnaryClientInterceptor, - grpc.UnaryStreamClientInterceptor, - grpc.StreamUnaryClientInterceptor, - grpc.StreamStreamClientInterceptor, -): - fn: Callable - - def intercept_unary_unary(self, continuation, client_call_details, request): # noqa: D102 - new_details, new_request_iterator, postprocess = self.fn( - client_call_details, iter((request,)), False, False - ) - response = continuation(new_details, next(new_request_iterator)) - return postprocess(response) if postprocess else response - - def intercept_unary_stream(self, continuation, client_call_details, request): # noqa: D102 - new_details, new_request_iterator, postprocess = self.fn( - client_call_details, iter((request,)), False, True - ) - response_it = continuation(new_details, next(new_request_iterator)) - return postprocess(response_it) if postprocess else response_it - - def intercept_stream_unary( # noqa: D102 - self, continuation, client_call_details, request_iterator - ): - new_details, new_request_iterator, postprocess = self.fn( - client_call_details, request_iterator, True, False - ) - response = continuation(new_details, new_request_iterator) - return postprocess(response) if postprocess else response - - def intercept_stream_stream( # noqa: D102 - self, continuation, client_call_details, request_iterator - ): - new_details, new_request_iterator, postprocess = self.fn( - client_call_details, request_iterator, True, True - ) - response_it = continuation(new_details, new_request_iterator) - return postprocess(response_it) if postprocess else response_it - - -# https://github.com/grpc/grpc/blob/master/examples/python/interceptors/headers/header_manipulator_client_interceptor.py -# we need to subclass ClientCallDetails to add a constructor (it's ABC) -class ClientCallDetails( # noqa: D101 - namedtuple("ClientCallDetails", ("method", "timeout", "metadata", "credentials")), - grpc.ClientCallDetails, -): - pass - - -def header_adder_interceptor(header, value): - """Create a client interceptor that adds a header to requests.""" - - def intercept_call( - client_call_details, - request_iterator, - request_streaming, - response_streaming, - ): - metadata = list(client_call_details.metadata or []) - metadata.append( - ( - header, - value, - ) - ) - return ( - ClientCallDetails( - client_call_details.method, - client_call_details.timeout, - metadata, - client_call_details.credentials, - ), - request_iterator, - None, - ) - - return GenericClientInterceptor(intercept_call) diff --git a/clients/python/src/mr_openapi/README.md b/clients/python/src/mr_openapi/README.md new file mode 100644 index 000000000..91ce44912 --- /dev/null +++ b/clients/python/src/mr_openapi/README.md @@ -0,0 +1,185 @@ +# mr-openapi +REST API for Model Registry to create and manage ML model metadata + +The `mr_openapi` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: v1alpha3 +- Package version: 1.0.0 +- Generator version: 7.6.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen + +## Requirements. + +Python 3.7+ + +## Installation & Usage + +This python library package is generated without supporting files like setup.py or requirements files + +To be able to use it, you will need these dependencies in your own package that uses this library: + +* urllib3 >= 1.25.3 +* python-dateutil +* aiohttp +* pydantic + +## Getting Started + +In your own code, to use this library to connect and interact with mr-openapi, +you can run the following: + +```python + +import mr_openapi +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + servingenvironment_id = 'servingenvironment_id_example' # str | A unique identifier for a `ServingEnvironment`. + inference_service_create = mr_openapi.InferenceServiceCreate() # InferenceServiceCreate | A new `InferenceService` to be created. + + try: + # Create a InferenceService in ServingEnvironment + api_response = await api_instance.create_environment_inference_service(servingenvironment_id, inference_service_create) + print("The response of ModelRegistryServiceApi->create_environment_inference_service:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling ModelRegistryServiceApi->create_environment_inference_service: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://localhost:8080* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ModelRegistryServiceApi* | [**create_environment_inference_service**](mr_openapi/docs/ModelRegistryServiceApi.md#create_environment_inference_service) | **POST** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services | Create a InferenceService in ServingEnvironment +*ModelRegistryServiceApi* | [**create_inference_service**](mr_openapi/docs/ModelRegistryServiceApi.md#create_inference_service) | **POST** /api/model_registry/v1alpha3/inference_services | Create a InferenceService +*ModelRegistryServiceApi* | [**create_inference_service_serve**](mr_openapi/docs/ModelRegistryServiceApi.md#create_inference_service_serve) | **POST** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves | Create a ServeModel action in a InferenceService +*ModelRegistryServiceApi* | [**create_model_artifact**](mr_openapi/docs/ModelRegistryServiceApi.md#create_model_artifact) | **POST** /api/model_registry/v1alpha3/model_artifacts | Create a ModelArtifact +*ModelRegistryServiceApi* | [**create_model_version**](mr_openapi/docs/ModelRegistryServiceApi.md#create_model_version) | **POST** /api/model_registry/v1alpha3/model_versions | Create a ModelVersion +*ModelRegistryServiceApi* | [**create_model_version_artifact**](mr_openapi/docs/ModelRegistryServiceApi.md#create_model_version_artifact) | **POST** /api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts | Create an Artifact in a ModelVersion +*ModelRegistryServiceApi* | [**create_registered_model**](mr_openapi/docs/ModelRegistryServiceApi.md#create_registered_model) | **POST** /api/model_registry/v1alpha3/registered_models | Create a RegisteredModel +*ModelRegistryServiceApi* | [**create_registered_model_version**](mr_openapi/docs/ModelRegistryServiceApi.md#create_registered_model_version) | **POST** /api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions | Create a ModelVersion in RegisteredModel +*ModelRegistryServiceApi* | [**create_serving_environment**](mr_openapi/docs/ModelRegistryServiceApi.md#create_serving_environment) | **POST** /api/model_registry/v1alpha3/serving_environments | Create a ServingEnvironment +*ModelRegistryServiceApi* | [**find_inference_service**](mr_openapi/docs/ModelRegistryServiceApi.md#find_inference_service) | **GET** /api/model_registry/v1alpha3/inference_service | Get an InferenceServices that matches search parameters. +*ModelRegistryServiceApi* | [**find_model_artifact**](mr_openapi/docs/ModelRegistryServiceApi.md#find_model_artifact) | **GET** /api/model_registry/v1alpha3/model_artifact | Get a ModelArtifact that matches search parameters. +*ModelRegistryServiceApi* | [**find_model_version**](mr_openapi/docs/ModelRegistryServiceApi.md#find_model_version) | **GET** /api/model_registry/v1alpha3/model_version | Get a ModelVersion that matches search parameters. +*ModelRegistryServiceApi* | [**find_registered_model**](mr_openapi/docs/ModelRegistryServiceApi.md#find_registered_model) | **GET** /api/model_registry/v1alpha3/registered_model | Get a RegisteredModel that matches search parameters. +*ModelRegistryServiceApi* | [**find_serving_environment**](mr_openapi/docs/ModelRegistryServiceApi.md#find_serving_environment) | **GET** /api/model_registry/v1alpha3/serving_environment | Find ServingEnvironment +*ModelRegistryServiceApi* | [**get_environment_inference_services**](mr_openapi/docs/ModelRegistryServiceApi.md#get_environment_inference_services) | **GET** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services | List All ServingEnvironment's InferenceServices +*ModelRegistryServiceApi* | [**get_inference_service**](mr_openapi/docs/ModelRegistryServiceApi.md#get_inference_service) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId} | Get a InferenceService +*ModelRegistryServiceApi* | [**get_inference_service_model**](mr_openapi/docs/ModelRegistryServiceApi.md#get_inference_service_model) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/model | Get InferenceService's RegisteredModel +*ModelRegistryServiceApi* | [**get_inference_service_serves**](mr_openapi/docs/ModelRegistryServiceApi.md#get_inference_service_serves) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves | List All InferenceService's ServeModel actions +*ModelRegistryServiceApi* | [**get_inference_service_version**](mr_openapi/docs/ModelRegistryServiceApi.md#get_inference_service_version) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/version | Get InferenceService's ModelVersion +*ModelRegistryServiceApi* | [**get_inference_services**](mr_openapi/docs/ModelRegistryServiceApi.md#get_inference_services) | **GET** /api/model_registry/v1alpha3/inference_services | List All InferenceServices +*ModelRegistryServiceApi* | [**get_model_artifact**](mr_openapi/docs/ModelRegistryServiceApi.md#get_model_artifact) | **GET** /api/model_registry/v1alpha3/model_artifacts/{modelartifactId} | Get a ModelArtifact +*ModelRegistryServiceApi* | [**get_model_artifacts**](mr_openapi/docs/ModelRegistryServiceApi.md#get_model_artifacts) | **GET** /api/model_registry/v1alpha3/model_artifacts | List All ModelArtifacts +*ModelRegistryServiceApi* | [**get_model_version**](mr_openapi/docs/ModelRegistryServiceApi.md#get_model_version) | **GET** /api/model_registry/v1alpha3/model_versions/{modelversionId} | Get a ModelVersion +*ModelRegistryServiceApi* | [**get_model_version_artifacts**](mr_openapi/docs/ModelRegistryServiceApi.md#get_model_version_artifacts) | **GET** /api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts | List all artifacts associated with the `ModelVersion` +*ModelRegistryServiceApi* | [**get_model_versions**](mr_openapi/docs/ModelRegistryServiceApi.md#get_model_versions) | **GET** /api/model_registry/v1alpha3/model_versions | List All ModelVersions +*ModelRegistryServiceApi* | [**get_registered_model**](mr_openapi/docs/ModelRegistryServiceApi.md#get_registered_model) | **GET** /api/model_registry/v1alpha3/registered_models/{registeredmodelId} | Get a RegisteredModel +*ModelRegistryServiceApi* | [**get_registered_model_versions**](mr_openapi/docs/ModelRegistryServiceApi.md#get_registered_model_versions) | **GET** /api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions | List All RegisteredModel's ModelVersions +*ModelRegistryServiceApi* | [**get_registered_models**](mr_openapi/docs/ModelRegistryServiceApi.md#get_registered_models) | **GET** /api/model_registry/v1alpha3/registered_models | List All RegisteredModels +*ModelRegistryServiceApi* | [**get_serving_environment**](mr_openapi/docs/ModelRegistryServiceApi.md#get_serving_environment) | **GET** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId} | Get a ServingEnvironment +*ModelRegistryServiceApi* | [**get_serving_environments**](mr_openapi/docs/ModelRegistryServiceApi.md#get_serving_environments) | **GET** /api/model_registry/v1alpha3/serving_environments | List All ServingEnvironments +*ModelRegistryServiceApi* | [**update_inference_service**](mr_openapi/docs/ModelRegistryServiceApi.md#update_inference_service) | **PATCH** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId} | Update a InferenceService +*ModelRegistryServiceApi* | [**update_model_artifact**](mr_openapi/docs/ModelRegistryServiceApi.md#update_model_artifact) | **PATCH** /api/model_registry/v1alpha3/model_artifacts/{modelartifactId} | Update a ModelArtifact +*ModelRegistryServiceApi* | [**update_model_version**](mr_openapi/docs/ModelRegistryServiceApi.md#update_model_version) | **PATCH** /api/model_registry/v1alpha3/model_versions/{modelversionId} | Update a ModelVersion +*ModelRegistryServiceApi* | [**update_registered_model**](mr_openapi/docs/ModelRegistryServiceApi.md#update_registered_model) | **PATCH** /api/model_registry/v1alpha3/registered_models/{registeredmodelId} | Update a RegisteredModel +*ModelRegistryServiceApi* | [**update_serving_environment**](mr_openapi/docs/ModelRegistryServiceApi.md#update_serving_environment) | **PATCH** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId} | Update a ServingEnvironment + + +## Documentation For Models + + - [Artifact](mr_openapi/docs/Artifact.md) + - [ArtifactList](mr_openapi/docs/ArtifactList.md) + - [ArtifactState](mr_openapi/docs/ArtifactState.md) + - [BaseArtifact](mr_openapi/docs/BaseArtifact.md) + - [BaseArtifactCreate](mr_openapi/docs/BaseArtifactCreate.md) + - [BaseArtifactUpdate](mr_openapi/docs/BaseArtifactUpdate.md) + - [BaseExecution](mr_openapi/docs/BaseExecution.md) + - [BaseExecutionCreate](mr_openapi/docs/BaseExecutionCreate.md) + - [BaseExecutionUpdate](mr_openapi/docs/BaseExecutionUpdate.md) + - [BaseResource](mr_openapi/docs/BaseResource.md) + - [BaseResourceCreate](mr_openapi/docs/BaseResourceCreate.md) + - [BaseResourceList](mr_openapi/docs/BaseResourceList.md) + - [BaseResourceUpdate](mr_openapi/docs/BaseResourceUpdate.md) + - [DocArtifact](mr_openapi/docs/DocArtifact.md) + - [Error](mr_openapi/docs/Error.md) + - [ExecutionState](mr_openapi/docs/ExecutionState.md) + - [InferenceService](mr_openapi/docs/InferenceService.md) + - [InferenceServiceCreate](mr_openapi/docs/InferenceServiceCreate.md) + - [InferenceServiceList](mr_openapi/docs/InferenceServiceList.md) + - [InferenceServiceState](mr_openapi/docs/InferenceServiceState.md) + - [InferenceServiceUpdate](mr_openapi/docs/InferenceServiceUpdate.md) + - [MetadataBoolValue](mr_openapi/docs/MetadataBoolValue.md) + - [MetadataDoubleValue](mr_openapi/docs/MetadataDoubleValue.md) + - [MetadataIntValue](mr_openapi/docs/MetadataIntValue.md) + - [MetadataProtoValue](mr_openapi/docs/MetadataProtoValue.md) + - [MetadataStringValue](mr_openapi/docs/MetadataStringValue.md) + - [MetadataStructValue](mr_openapi/docs/MetadataStructValue.md) + - [MetadataValue](mr_openapi/docs/MetadataValue.md) + - [ModelArtifact](mr_openapi/docs/ModelArtifact.md) + - [ModelArtifactCreate](mr_openapi/docs/ModelArtifactCreate.md) + - [ModelArtifactList](mr_openapi/docs/ModelArtifactList.md) + - [ModelArtifactUpdate](mr_openapi/docs/ModelArtifactUpdate.md) + - [ModelVersion](mr_openapi/docs/ModelVersion.md) + - [ModelVersionCreate](mr_openapi/docs/ModelVersionCreate.md) + - [ModelVersionList](mr_openapi/docs/ModelVersionList.md) + - [ModelVersionState](mr_openapi/docs/ModelVersionState.md) + - [ModelVersionUpdate](mr_openapi/docs/ModelVersionUpdate.md) + - [OrderByField](mr_openapi/docs/OrderByField.md) + - [RegisteredModel](mr_openapi/docs/RegisteredModel.md) + - [RegisteredModelCreate](mr_openapi/docs/RegisteredModelCreate.md) + - [RegisteredModelList](mr_openapi/docs/RegisteredModelList.md) + - [RegisteredModelState](mr_openapi/docs/RegisteredModelState.md) + - [RegisteredModelUpdate](mr_openapi/docs/RegisteredModelUpdate.md) + - [ServeModel](mr_openapi/docs/ServeModel.md) + - [ServeModelCreate](mr_openapi/docs/ServeModelCreate.md) + - [ServeModelList](mr_openapi/docs/ServeModelList.md) + - [ServeModelUpdate](mr_openapi/docs/ServeModelUpdate.md) + - [ServingEnvironment](mr_openapi/docs/ServingEnvironment.md) + - [ServingEnvironmentCreate](mr_openapi/docs/ServingEnvironmentCreate.md) + - [ServingEnvironmentList](mr_openapi/docs/ServingEnvironmentList.md) + - [ServingEnvironmentUpdate](mr_openapi/docs/ServingEnvironmentUpdate.md) + - [SortOrder](mr_openapi/docs/SortOrder.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### Bearer + +- **Type**: Bearer authentication (JWT) + + +## Author + + + + diff --git a/clients/python/src/mr_openapi/__init__.py b/clients/python/src/mr_openapi/__init__.py new file mode 100644 index 000000000..3a01c51df --- /dev/null +++ b/clients/python/src/mr_openapi/__init__.py @@ -0,0 +1,85 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Model Registry REST API + + REST API for Model Registry to create and manage ML model metadata + + The version of the OpenAPI document: v1alpha3 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "1.0.0" + +# import apis into sdk package +from mr_openapi.api.model_registry_service_api import ModelRegistryServiceApi + +# import ApiClient +from mr_openapi.api_response import ApiResponse +from mr_openapi.api_client import ApiClient +from mr_openapi.configuration import Configuration +from mr_openapi.exceptions import OpenApiException +from mr_openapi.exceptions import ApiTypeError +from mr_openapi.exceptions import ApiValueError +from mr_openapi.exceptions import ApiKeyError +from mr_openapi.exceptions import ApiAttributeError +from mr_openapi.exceptions import ApiException + +# import models into sdk package +from mr_openapi.models.artifact import Artifact +from mr_openapi.models.artifact_list import ArtifactList +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.base_artifact import BaseArtifact +from mr_openapi.models.base_artifact_create import BaseArtifactCreate +from mr_openapi.models.base_artifact_update import BaseArtifactUpdate +from mr_openapi.models.base_execution import BaseExecution +from mr_openapi.models.base_execution_create import BaseExecutionCreate +from mr_openapi.models.base_execution_update import BaseExecutionUpdate +from mr_openapi.models.base_resource import BaseResource +from mr_openapi.models.base_resource_create import BaseResourceCreate +from mr_openapi.models.base_resource_list import BaseResourceList +from mr_openapi.models.base_resource_update import BaseResourceUpdate +from mr_openapi.models.doc_artifact import DocArtifact +from mr_openapi.models.error import Error +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.models.inference_service_create import InferenceServiceCreate +from mr_openapi.models.inference_service_list import InferenceServiceList +from mr_openapi.models.inference_service_state import InferenceServiceState +from mr_openapi.models.inference_service_update import InferenceServiceUpdate +from mr_openapi.models.metadata_bool_value import MetadataBoolValue +from mr_openapi.models.metadata_double_value import MetadataDoubleValue +from mr_openapi.models.metadata_int_value import MetadataIntValue +from mr_openapi.models.metadata_proto_value import MetadataProtoValue +from mr_openapi.models.metadata_string_value import MetadataStringValue +from mr_openapi.models.metadata_struct_value import MetadataStructValue +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.model_artifact import ModelArtifact +from mr_openapi.models.model_artifact_create import ModelArtifactCreate +from mr_openapi.models.model_artifact_list import ModelArtifactList +from mr_openapi.models.model_artifact_update import ModelArtifactUpdate +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.models.model_version_create import ModelVersionCreate +from mr_openapi.models.model_version_list import ModelVersionList +from mr_openapi.models.model_version_state import ModelVersionState +from mr_openapi.models.model_version_update import ModelVersionUpdate +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.models.registered_model_create import RegisteredModelCreate +from mr_openapi.models.registered_model_list import RegisteredModelList +from mr_openapi.models.registered_model_state import RegisteredModelState +from mr_openapi.models.registered_model_update import RegisteredModelUpdate +from mr_openapi.models.serve_model import ServeModel +from mr_openapi.models.serve_model_create import ServeModelCreate +from mr_openapi.models.serve_model_list import ServeModelList +from mr_openapi.models.serve_model_update import ServeModelUpdate +from mr_openapi.models.serving_environment import ServingEnvironment +from mr_openapi.models.serving_environment_create import ServingEnvironmentCreate +from mr_openapi.models.serving_environment_list import ServingEnvironmentList +from mr_openapi.models.serving_environment_update import ServingEnvironmentUpdate +from mr_openapi.models.sort_order import SortOrder diff --git a/clients/python/src/mr_openapi/api/__init__.py b/clients/python/src/mr_openapi/api/__init__.py new file mode 100644 index 000000000..ac696d4d3 --- /dev/null +++ b/clients/python/src/mr_openapi/api/__init__.py @@ -0,0 +1,4 @@ +# flake8: noqa + +# import apis into api package +from mr_openapi.api.model_registry_service_api import ModelRegistryServiceApi diff --git a/clients/python/src/mr_openapi/api/model_registry_service_api.py b/clients/python/src/mr_openapi/api/model_registry_service_api.py new file mode 100644 index 000000000..498d4817b --- /dev/null +++ b/clients/python/src/mr_openapi/api/model_registry_service_api.py @@ -0,0 +1,9508 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from typing import Annotated, Any, Optional, Union + +from pydantic import Field, StrictFloat, StrictInt, StrictStr, validate_call + +from mr_openapi.api_client import ApiClient, RequestSerialized +from mr_openapi.api_response import ApiResponse +from mr_openapi.models.artifact import Artifact +from mr_openapi.models.artifact_list import ArtifactList +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.models.inference_service_create import InferenceServiceCreate +from mr_openapi.models.inference_service_list import InferenceServiceList +from mr_openapi.models.inference_service_update import InferenceServiceUpdate +from mr_openapi.models.model_artifact import ModelArtifact +from mr_openapi.models.model_artifact_create import ModelArtifactCreate +from mr_openapi.models.model_artifact_list import ModelArtifactList +from mr_openapi.models.model_artifact_update import ModelArtifactUpdate +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.models.model_version_create import ModelVersionCreate +from mr_openapi.models.model_version_list import ModelVersionList +from mr_openapi.models.model_version_update import ModelVersionUpdate +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.models.registered_model_create import RegisteredModelCreate +from mr_openapi.models.registered_model_list import RegisteredModelList +from mr_openapi.models.registered_model_update import RegisteredModelUpdate +from mr_openapi.models.serve_model import ServeModel +from mr_openapi.models.serve_model_create import ServeModelCreate +from mr_openapi.models.serve_model_list import ServeModelList +from mr_openapi.models.serving_environment import ServingEnvironment +from mr_openapi.models.serving_environment_create import ServingEnvironmentCreate +from mr_openapi.models.serving_environment_list import ServingEnvironmentList +from mr_openapi.models.serving_environment_update import ServingEnvironmentUpdate +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import RESTResponseType + + +class ModelRegistryServiceApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech. + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + @validate_call + async def create_environment_inference_service( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + inference_service_create: Annotated[ + InferenceServiceCreate, Field(description="A new `InferenceService` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InferenceService: + """Create a InferenceService in ServingEnvironment. + + Creates a new instance of a `InferenceService`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param inference_service_create: A new `InferenceService` to be created. (required) + :type inference_service_create: InferenceServiceCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_environment_inference_service_serialize( + servingenvironment_id=servingenvironment_id, + inference_service_create=inference_service_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_environment_inference_service_with_http_info( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + inference_service_create: Annotated[ + InferenceServiceCreate, Field(description="A new `InferenceService` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InferenceService]: + """Create a InferenceService in ServingEnvironment. + + Creates a new instance of a `InferenceService`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param inference_service_create: A new `InferenceService` to be created. (required) + :type inference_service_create: InferenceServiceCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_environment_inference_service_serialize( + servingenvironment_id=servingenvironment_id, + inference_service_create=inference_service_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_environment_inference_service_without_preload_content( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + inference_service_create: Annotated[ + InferenceServiceCreate, Field(description="A new `InferenceService` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a InferenceService in ServingEnvironment. + + Creates a new instance of a `InferenceService`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param inference_service_create: A new `InferenceService` to be created. (required) + :type inference_service_create: InferenceServiceCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_environment_inference_service_serialize( + servingenvironment_id=servingenvironment_id, + inference_service_create=inference_service_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_environment_inference_service_serialize( + self, + servingenvironment_id, + inference_service_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if servingenvironment_id is not None: + _path_params["servingenvironmentId"] = servingenvironment_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if inference_service_create is not None: + _body_params = inference_service_create + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_inference_service( + self, + inference_service_create: Annotated[ + InferenceServiceCreate, Field(description="A new `InferenceService` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InferenceService: + """Create a InferenceService. + + Creates a new instance of a `InferenceService`. + + :param inference_service_create: A new `InferenceService` to be created. (required) + :type inference_service_create: InferenceServiceCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_inference_service_serialize( + inference_service_create=inference_service_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_inference_service_with_http_info( + self, + inference_service_create: Annotated[ + InferenceServiceCreate, Field(description="A new `InferenceService` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InferenceService]: + """Create a InferenceService. + + Creates a new instance of a `InferenceService`. + + :param inference_service_create: A new `InferenceService` to be created. (required) + :type inference_service_create: InferenceServiceCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_inference_service_serialize( + inference_service_create=inference_service_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_inference_service_without_preload_content( + self, + inference_service_create: Annotated[ + InferenceServiceCreate, Field(description="A new `InferenceService` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a InferenceService. + + Creates a new instance of a `InferenceService`. + + :param inference_service_create: A new `InferenceService` to be created. (required) + :type inference_service_create: InferenceServiceCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_inference_service_serialize( + inference_service_create=inference_service_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_inference_service_serialize( + self, + inference_service_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if inference_service_create is not None: + _body_params = inference_service_create + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/inference_services", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_inference_service_serve( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + serve_model_create: Annotated[ + ServeModelCreate, Field(description="A new `ServeModel` to be associated with the `InferenceService`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServeModel: + """Create a ServeModel action in a InferenceService. + + Creates a new instance of a `ServeModel` associated with `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param serve_model_create: A new `ServeModel` to be associated with the `InferenceService`. (required) + :type serve_model_create: ServeModelCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_inference_service_serve_serialize( + inferenceservice_id=inferenceservice_id, + serve_model_create=serve_model_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ServeModel", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_inference_service_serve_with_http_info( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + serve_model_create: Annotated[ + ServeModelCreate, Field(description="A new `ServeModel` to be associated with the `InferenceService`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServeModel]: + """Create a ServeModel action in a InferenceService. + + Creates a new instance of a `ServeModel` associated with `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param serve_model_create: A new `ServeModel` to be associated with the `InferenceService`. (required) + :type serve_model_create: ServeModelCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_inference_service_serve_serialize( + inferenceservice_id=inferenceservice_id, + serve_model_create=serve_model_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ServeModel", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_inference_service_serve_without_preload_content( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + serve_model_create: Annotated[ + ServeModelCreate, Field(description="A new `ServeModel` to be associated with the `InferenceService`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a ServeModel action in a InferenceService. + + Creates a new instance of a `ServeModel` associated with `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param serve_model_create: A new `ServeModel` to be associated with the `InferenceService`. (required) + :type serve_model_create: ServeModelCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_inference_service_serve_serialize( + inferenceservice_id=inferenceservice_id, + serve_model_create=serve_model_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ServeModel", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_inference_service_serve_serialize( + self, + inferenceservice_id, + serve_model_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if inferenceservice_id is not None: + _path_params["inferenceserviceId"] = inferenceservice_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if serve_model_create is not None: + _body_params = serve_model_create + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_model_artifact( + self, + model_artifact_create: Annotated[ + ModelArtifactCreate, Field(description="A new `ModelArtifact` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelArtifact: + """Create a ModelArtifact. + + Creates a new instance of a `ModelArtifact`. + + :param model_artifact_create: A new `ModelArtifact` to be created. (required) + :type model_artifact_create: ModelArtifactCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_artifact_serialize( + model_artifact_create=model_artifact_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelArtifact", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_model_artifact_with_http_info( + self, + model_artifact_create: Annotated[ + ModelArtifactCreate, Field(description="A new `ModelArtifact` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelArtifact]: + """Create a ModelArtifact. + + Creates a new instance of a `ModelArtifact`. + + :param model_artifact_create: A new `ModelArtifact` to be created. (required) + :type model_artifact_create: ModelArtifactCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_artifact_serialize( + model_artifact_create=model_artifact_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelArtifact", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_model_artifact_without_preload_content( + self, + model_artifact_create: Annotated[ + ModelArtifactCreate, Field(description="A new `ModelArtifact` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a ModelArtifact. + + Creates a new instance of a `ModelArtifact`. + + :param model_artifact_create: A new `ModelArtifact` to be created. (required) + :type model_artifact_create: ModelArtifactCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_artifact_serialize( + model_artifact_create=model_artifact_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelArtifact", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_model_artifact_serialize( + self, + model_artifact_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if model_artifact_create is not None: + _body_params = model_artifact_create + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/model_artifacts", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_model_version( + self, + model_version_create: Annotated[ModelVersionCreate, Field(description="A new `ModelVersion` to be created.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersion: + """Create a ModelVersion. + + Creates a new instance of a `ModelVersion`. + + :param model_version_create: A new `ModelVersion` to be created. (required) + :type model_version_create: ModelVersionCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_version_serialize( + model_version_create=model_version_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelVersion", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_model_version_with_http_info( + self, + model_version_create: Annotated[ModelVersionCreate, Field(description="A new `ModelVersion` to be created.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersion]: + """Create a ModelVersion. + + Creates a new instance of a `ModelVersion`. + + :param model_version_create: A new `ModelVersion` to be created. (required) + :type model_version_create: ModelVersionCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_version_serialize( + model_version_create=model_version_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelVersion", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_model_version_without_preload_content( + self, + model_version_create: Annotated[ModelVersionCreate, Field(description="A new `ModelVersion` to be created.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a ModelVersion. + + Creates a new instance of a `ModelVersion`. + + :param model_version_create: A new `ModelVersion` to be created. (required) + :type model_version_create: ModelVersionCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_version_serialize( + model_version_create=model_version_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelVersion", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_model_version_serialize( + self, + model_version_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if model_version_create is not None: + _body_params = model_version_create + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/model_versions", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_model_version_artifact( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + artifact: Annotated[ + Artifact, Field(description="A new or existing `Artifact` to be associated with the `ModelVersion`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Artifact: + """Create an Artifact in a ModelVersion. + + Creates a new instance of an Artifact if needed and associates it with `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param artifact: A new or existing `Artifact` to be associated with the `ModelVersion`. (required) + :type artifact: Artifact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_version_artifact_serialize( + modelversion_id=modelversion_id, + artifact=artifact, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "Artifact", + "201": "Artifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_model_version_artifact_with_http_info( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + artifact: Annotated[ + Artifact, Field(description="A new or existing `Artifact` to be associated with the `ModelVersion`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Artifact]: + """Create an Artifact in a ModelVersion. + + Creates a new instance of an Artifact if needed and associates it with `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param artifact: A new or existing `Artifact` to be associated with the `ModelVersion`. (required) + :type artifact: Artifact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_version_artifact_serialize( + modelversion_id=modelversion_id, + artifact=artifact, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "Artifact", + "201": "Artifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_model_version_artifact_without_preload_content( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + artifact: Annotated[ + Artifact, Field(description="A new or existing `Artifact` to be associated with the `ModelVersion`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an Artifact in a ModelVersion. + + Creates a new instance of an Artifact if needed and associates it with `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param artifact: A new or existing `Artifact` to be associated with the `ModelVersion`. (required) + :type artifact: Artifact + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_model_version_artifact_serialize( + modelversion_id=modelversion_id, + artifact=artifact, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "Artifact", + "201": "Artifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_model_version_artifact_serialize( + self, + modelversion_id, + artifact, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if modelversion_id is not None: + _path_params["modelversionId"] = modelversion_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if artifact is not None: + _body_params = artifact + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_registered_model( + self, + registered_model_create: Annotated[ + RegisteredModelCreate, Field(description="A new `RegisteredModel` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RegisteredModel: + """Create a RegisteredModel. + + Creates a new instance of a `RegisteredModel`. + + :param registered_model_create: A new `RegisteredModel` to be created. (required) + :type registered_model_create: RegisteredModelCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_registered_model_serialize( + registered_model_create=registered_model_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "RegisteredModel", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_registered_model_with_http_info( + self, + registered_model_create: Annotated[ + RegisteredModelCreate, Field(description="A new `RegisteredModel` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RegisteredModel]: + """Create a RegisteredModel. + + Creates a new instance of a `RegisteredModel`. + + :param registered_model_create: A new `RegisteredModel` to be created. (required) + :type registered_model_create: RegisteredModelCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_registered_model_serialize( + registered_model_create=registered_model_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "RegisteredModel", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_registered_model_without_preload_content( + self, + registered_model_create: Annotated[ + RegisteredModelCreate, Field(description="A new `RegisteredModel` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a RegisteredModel. + + Creates a new instance of a `RegisteredModel`. + + :param registered_model_create: A new `RegisteredModel` to be created. (required) + :type registered_model_create: RegisteredModelCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_registered_model_serialize( + registered_model_create=registered_model_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "RegisteredModel", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_registered_model_serialize( + self, + registered_model_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if registered_model_create is not None: + _body_params = registered_model_create + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/registered_models", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_registered_model_version( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + model_version: Annotated[ModelVersion, Field(description="A new `ModelVersion` to be created.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersion: + """Create a ModelVersion in RegisteredModel. + + Creates a new instance of a `ModelVersion`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param model_version: A new `ModelVersion` to be created. (required) + :type model_version: ModelVersion + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_registered_model_version_serialize( + registeredmodel_id=registeredmodel_id, + model_version=model_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_registered_model_version_with_http_info( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + model_version: Annotated[ModelVersion, Field(description="A new `ModelVersion` to be created.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersion]: + """Create a ModelVersion in RegisteredModel. + + Creates a new instance of a `ModelVersion`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param model_version: A new `ModelVersion` to be created. (required) + :type model_version: ModelVersion + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_registered_model_version_serialize( + registeredmodel_id=registeredmodel_id, + model_version=model_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_registered_model_version_without_preload_content( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + model_version: Annotated[ModelVersion, Field(description="A new `ModelVersion` to be created.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a ModelVersion in RegisteredModel. + + Creates a new instance of a `ModelVersion`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param model_version: A new `ModelVersion` to be created. (required) + :type model_version: ModelVersion + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_registered_model_version_serialize( + registeredmodel_id=registeredmodel_id, + model_version=model_version, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_registered_model_version_serialize( + self, + registeredmodel_id, + model_version, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if registeredmodel_id is not None: + _path_params["registeredmodelId"] = registeredmodel_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if model_version is not None: + _body_params = model_version + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def create_serving_environment( + self, + serving_environment_create: Annotated[ + ServingEnvironmentCreate, Field(description="A new `ServingEnvironment` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServingEnvironment: + """Create a ServingEnvironment. + + Creates a new instance of a `ServingEnvironment`. + + :param serving_environment_create: A new `ServingEnvironment` to be created. (required) + :type serving_environment_create: ServingEnvironmentCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_serving_environment_serialize( + serving_environment_create=serving_environment_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ServingEnvironment", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def create_serving_environment_with_http_info( + self, + serving_environment_create: Annotated[ + ServingEnvironmentCreate, Field(description="A new `ServingEnvironment` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServingEnvironment]: + """Create a ServingEnvironment. + + Creates a new instance of a `ServingEnvironment`. + + :param serving_environment_create: A new `ServingEnvironment` to be created. (required) + :type serving_environment_create: ServingEnvironmentCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_serving_environment_serialize( + serving_environment_create=serving_environment_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ServingEnvironment", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def create_serving_environment_without_preload_content( + self, + serving_environment_create: Annotated[ + ServingEnvironmentCreate, Field(description="A new `ServingEnvironment` to be created.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a ServingEnvironment. + + Creates a new instance of a `ServingEnvironment`. + + :param serving_environment_create: A new `ServingEnvironment` to be created. (required) + :type serving_environment_create: ServingEnvironmentCreate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._create_serving_environment_serialize( + serving_environment_create=serving_environment_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "201": "ServingEnvironment", + "400": "Error", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _create_serving_environment_serialize( + self, + serving_environment_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if serving_environment_create is not None: + _body_params = serving_environment_create + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="POST", + resource_path="/api/model_registry/v1alpha3/serving_environments", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def find_inference_service( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InferenceService: + """Get an InferenceServices that matches search parameters. + + Gets the details of a single instance of `InferenceService` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_inference_service_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def find_inference_service_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InferenceService]: + """Get an InferenceServices that matches search parameters. + + Gets the details of a single instance of `InferenceService` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_inference_service_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def find_inference_service_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an InferenceServices that matches search parameters. + + Gets the details of a single instance of `InferenceService` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_inference_service_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _find_inference_service_serialize( + self, + name, + external_id, + parent_resource_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + if parent_resource_id is not None: + + _query_params.append(("parentResourceId", parent_resource_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/inference_service", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def find_model_artifact( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelArtifact: + """Get a ModelArtifact that matches search parameters. + + Gets the details of a single instance of a `ModelArtifact` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_model_artifact_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def find_model_artifact_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelArtifact]: + """Get a ModelArtifact that matches search parameters. + + Gets the details of a single instance of a `ModelArtifact` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_model_artifact_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def find_model_artifact_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a ModelArtifact that matches search parameters. + + Gets the details of a single instance of a `ModelArtifact` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_model_artifact_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _find_model_artifact_serialize( + self, + name, + external_id, + parent_resource_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + if parent_resource_id is not None: + + _query_params.append(("parentResourceId", parent_resource_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/model_artifact", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def find_model_version( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersion: + """Get a ModelVersion that matches search parameters. + + Gets the details of a single instance of a `ModelVersion` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_model_version_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def find_model_version_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersion]: + """Get a ModelVersion that matches search parameters. + + Gets the details of a single instance of a `ModelVersion` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_model_version_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def find_model_version_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + parent_resource_id: Annotated[ + Optional[StrictStr], Field(description="ID of the parent resource to use for search.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a ModelVersion that matches search parameters. + + Gets the details of a single instance of a `ModelVersion` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param parent_resource_id: ID of the parent resource to use for search. + :type parent_resource_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_model_version_serialize( + name=name, + external_id=external_id, + parent_resource_id=parent_resource_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _find_model_version_serialize( + self, + name, + external_id, + parent_resource_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + if parent_resource_id is not None: + + _query_params.append(("parentResourceId", parent_resource_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/model_version", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def find_registered_model( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RegisteredModel: + """Get a RegisteredModel that matches search parameters. + + Gets the details of a single instance of a `RegisteredModel` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_registered_model_serialize( + name=name, + external_id=external_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def find_registered_model_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RegisteredModel]: + """Get a RegisteredModel that matches search parameters. + + Gets the details of a single instance of a `RegisteredModel` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_registered_model_serialize( + name=name, + external_id=external_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def find_registered_model_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a RegisteredModel that matches search parameters. + + Gets the details of a single instance of a `RegisteredModel` that matches search parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_registered_model_serialize( + name=name, + external_id=external_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _find_registered_model_serialize( + self, + name, + external_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/registered_model", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def find_serving_environment( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServingEnvironment: + """Find ServingEnvironment. + + Finds a `ServingEnvironment` entity that matches query parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_serving_environment_serialize( + name=name, + external_id=external_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def find_serving_environment_with_http_info( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServingEnvironment]: + """Find ServingEnvironment. + + Finds a `ServingEnvironment` entity that matches query parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_serving_environment_serialize( + name=name, + external_id=external_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def find_serving_environment_without_preload_content( + self, + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Find ServingEnvironment. + + Finds a `ServingEnvironment` entity that matches query parameters. + + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._find_serving_environment_serialize( + name=name, + external_id=external_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _find_serving_environment_serialize( + self, + name, + external_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/serving_environment", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_environment_inference_services( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InferenceServiceList: + """List All ServingEnvironment's InferenceServices. + + Gets a list of all `InferenceService` entities for the `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_environment_inference_services_serialize( + servingenvironment_id=servingenvironment_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceServiceList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_environment_inference_services_with_http_info( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InferenceServiceList]: + """List All ServingEnvironment's InferenceServices. + + Gets a list of all `InferenceService` entities for the `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_environment_inference_services_serialize( + servingenvironment_id=servingenvironment_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceServiceList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_environment_inference_services_without_preload_content( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All ServingEnvironment's InferenceServices. + + Gets a list of all `InferenceService` entities for the `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_environment_inference_services_serialize( + servingenvironment_id=servingenvironment_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceServiceList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_environment_inference_services_serialize( + self, + servingenvironment_id, + name, + external_id, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if servingenvironment_id is not None: + _path_params["servingenvironmentId"] = servingenvironment_id + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_inference_service( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InferenceService: + """Get a InferenceService. + + Gets the details of a single instance of a `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_inference_service_with_http_info( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InferenceService]: + """Get a InferenceService. + + Gets the details of a single instance of a `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_inference_service_without_preload_content( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a InferenceService. + + Gets the details of a single instance of a `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_inference_service_serialize( + self, + inferenceservice_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if inferenceservice_id is not None: + _path_params["inferenceserviceId"] = inferenceservice_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_inference_service_model( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RegisteredModel: + """Get InferenceService's RegisteredModel. + + Gets the `RegisteredModel` entity for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_model_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_inference_service_model_with_http_info( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RegisteredModel]: + """Get InferenceService's RegisteredModel. + + Gets the `RegisteredModel` entity for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_model_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_inference_service_model_without_preload_content( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get InferenceService's RegisteredModel. + + Gets the `RegisteredModel` entity for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_model_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_inference_service_model_serialize( + self, + inferenceservice_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if inferenceservice_id is not None: + _path_params["inferenceserviceId"] = inferenceservice_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/model", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_inference_service_serves( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServeModelList: + """List All InferenceService's ServeModel actions. + + Gets a list of all `ServeModel` entities for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_serves_serialize( + inferenceservice_id=inferenceservice_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServeModelList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_inference_service_serves_with_http_info( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServeModelList]: + """List All InferenceService's ServeModel actions. + + Gets a list of all `ServeModel` entities for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_serves_serialize( + inferenceservice_id=inferenceservice_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServeModelList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_inference_service_serves_without_preload_content( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All InferenceService's ServeModel actions. + + Gets a list of all `ServeModel` entities for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_serves_serialize( + inferenceservice_id=inferenceservice_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServeModelList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_inference_service_serves_serialize( + self, + inferenceservice_id, + name, + external_id, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if inferenceservice_id is not None: + _path_params["inferenceserviceId"] = inferenceservice_id + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_inference_service_version( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersion: + """Get InferenceService's ModelVersion. + + Gets the `ModelVersion` entity for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_version_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_inference_service_version_with_http_info( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersion]: + """Get InferenceService's ModelVersion. + + Gets the `ModelVersion` entity for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_version_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_inference_service_version_without_preload_content( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get InferenceService's ModelVersion. + + Gets the `ModelVersion` entity for the `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_service_version_serialize( + inferenceservice_id=inferenceservice_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_inference_service_version_serialize( + self, + inferenceservice_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if inferenceservice_id is not None: + _path_params["inferenceserviceId"] = inferenceservice_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/version", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_inference_services( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InferenceServiceList: + """List All InferenceServices. + + Gets a list of all `InferenceService` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_services_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceServiceList", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_inference_services_with_http_info( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InferenceServiceList]: + """List All InferenceServices. + + Gets a list of all `InferenceService` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_services_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceServiceList", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_inference_services_without_preload_content( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All InferenceServices. + + Gets a list of all `InferenceService` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_inference_services_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceServiceList", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_inference_services_serialize( + self, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/inference_services", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_model_artifact( + self, + modelartifact_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelArtifact`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelArtifact: + """Get a ModelArtifact. + + Gets the details of a single instance of a `ModelArtifact`. + + :param modelartifact_id: A unique identifier for a `ModelArtifact`. (required) + :type modelartifact_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_artifact_serialize( + modelartifact_id=modelartifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_model_artifact_with_http_info( + self, + modelartifact_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelArtifact`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelArtifact]: + """Get a ModelArtifact. + + Gets the details of a single instance of a `ModelArtifact`. + + :param modelartifact_id: A unique identifier for a `ModelArtifact`. (required) + :type modelartifact_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_artifact_serialize( + modelartifact_id=modelartifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_model_artifact_without_preload_content( + self, + modelartifact_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelArtifact`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a ModelArtifact. + + Gets the details of a single instance of a `ModelArtifact`. + + :param modelartifact_id: A unique identifier for a `ModelArtifact`. (required) + :type modelartifact_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_artifact_serialize( + modelartifact_id=modelartifact_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_model_artifact_serialize( + self, + modelartifact_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if modelartifact_id is not None: + _path_params["modelartifactId"] = modelartifact_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/model_artifacts/{modelartifactId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_model_artifacts( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelArtifactList: + """List All ModelArtifacts. + + Gets a list of all `ModelArtifact` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_artifacts_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifactList", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_model_artifacts_with_http_info( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelArtifactList]: + """List All ModelArtifacts. + + Gets a list of all `ModelArtifact` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_artifacts_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifactList", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_model_artifacts_without_preload_content( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All ModelArtifacts. + + Gets a list of all `ModelArtifact` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_artifacts_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifactList", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_model_artifacts_serialize( + self, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/model_artifacts", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_model_version( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersion: + """Get a ModelVersion. + + Gets the details of a single instance of a `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_version_serialize( + modelversion_id=modelversion_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_model_version_with_http_info( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersion]: + """Get a ModelVersion. + + Gets the details of a single instance of a `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_version_serialize( + modelversion_id=modelversion_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_model_version_without_preload_content( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a ModelVersion. + + Gets the details of a single instance of a `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_version_serialize( + modelversion_id=modelversion_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_model_version_serialize( + self, + modelversion_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if modelversion_id is not None: + _path_params["modelversionId"] = modelversion_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/model_versions/{modelversionId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_model_version_artifacts( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ArtifactList: + """List all artifacts associated with the `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_version_artifacts_serialize( + modelversion_id=modelversion_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ArtifactList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_model_version_artifacts_with_http_info( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ArtifactList]: + """List all artifacts associated with the `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_version_artifacts_serialize( + modelversion_id=modelversion_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ArtifactList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_model_version_artifacts_without_preload_content( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List all artifacts associated with the `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_version_artifacts_serialize( + modelversion_id=modelversion_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ArtifactList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_model_version_artifacts_serialize( + self, + modelversion_id, + name, + external_id, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if modelversion_id is not None: + _path_params["modelversionId"] = modelversion_id + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_model_versions( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersionList: + """List All ModelVersions. + + Gets a list of all `ModelVersion` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_versions_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersionList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_model_versions_with_http_info( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersionList]: + """List All ModelVersions. + + Gets a list of all `ModelVersion` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_versions_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersionList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_model_versions_without_preload_content( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All ModelVersions. + + Gets a list of all `ModelVersion` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_model_versions_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersionList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_model_versions_serialize( + self, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/model_versions", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_registered_model( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RegisteredModel: + """Get a RegisteredModel. + + Gets the details of a single instance of a `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_model_serialize( + registeredmodel_id=registeredmodel_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_registered_model_with_http_info( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RegisteredModel]: + """Get a RegisteredModel. + + Gets the details of a single instance of a `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_model_serialize( + registeredmodel_id=registeredmodel_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_registered_model_without_preload_content( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a RegisteredModel. + + Gets the details of a single instance of a `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_model_serialize( + registeredmodel_id=registeredmodel_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_registered_model_serialize( + self, + registeredmodel_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if registeredmodel_id is not None: + _path_params["registeredmodelId"] = registeredmodel_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/registered_models/{registeredmodelId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_registered_model_versions( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersionList: + """List All RegisteredModel's ModelVersions. + + Gets a list of all `ModelVersion` entities for the `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_model_versions_serialize( + registeredmodel_id=registeredmodel_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersionList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_registered_model_versions_with_http_info( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersionList]: + """List All RegisteredModel's ModelVersions. + + Gets a list of all `ModelVersion` entities for the `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_model_versions_serialize( + registeredmodel_id=registeredmodel_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersionList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_registered_model_versions_without_preload_content( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + name: Annotated[Optional[StrictStr], Field(description="Name of entity to search.")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External ID of entity to search.")] = None, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All RegisteredModel's ModelVersions. + + Gets a list of all `ModelVersion` entities for the `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param name: Name of entity to search. + :type name: str + :param external_id: External ID of entity to search. + :type external_id: str + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_model_versions_serialize( + registeredmodel_id=registeredmodel_id, + name=name, + external_id=external_id, + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersionList", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_registered_model_versions_serialize( + self, + registeredmodel_id, + name, + external_id, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if registeredmodel_id is not None: + _path_params["registeredmodelId"] = registeredmodel_id + # process the query parameters + if name is not None: + + _query_params.append(("name", name)) + + if external_id is not None: + + _query_params.append(("externalId", external_id)) + + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_registered_models( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RegisteredModelList: + """List All RegisteredModels. + + Gets a list of all `RegisteredModel` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_models_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModelList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_registered_models_with_http_info( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RegisteredModelList]: + """List All RegisteredModels. + + Gets a list of all `RegisteredModel` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_models_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModelList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_registered_models_without_preload_content( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All RegisteredModels. + + Gets a list of all `RegisteredModel` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_registered_models_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModelList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_registered_models_serialize( + self, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/registered_models", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_serving_environment( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServingEnvironment: + """Get a ServingEnvironment. + + Gets the details of a single instance of a `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_serving_environment_serialize( + servingenvironment_id=servingenvironment_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_serving_environment_with_http_info( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServingEnvironment]: + """Get a ServingEnvironment. + + Gets the details of a single instance of a `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_serving_environment_serialize( + servingenvironment_id=servingenvironment_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_serving_environment_without_preload_content( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a ServingEnvironment. + + Gets the details of a single instance of a `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_serving_environment_serialize( + servingenvironment_id=servingenvironment_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_serving_environment_serialize( + self, + servingenvironment_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if servingenvironment_id is not None: + _path_params["servingenvironmentId"] = servingenvironment_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def get_serving_environments( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServingEnvironmentList: + """List All ServingEnvironments. + + Gets a list of all `ServingEnvironment` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_serving_environments_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironmentList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def get_serving_environments_with_http_info( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServingEnvironmentList]: + """List All ServingEnvironments. + + Gets a list of all `ServingEnvironment` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_serving_environments_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironmentList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def get_serving_environments_without_preload_content( + self, + page_size: Annotated[Optional[StrictStr], Field(description="Number of entities in each page.")] = None, + order_by: Annotated[ + Optional[OrderByField], Field(description="Specifies the order by criteria for listing entities.") + ] = None, + sort_order: Annotated[ + Optional[SortOrder], Field(description="Specifies the sort order for listing entities, defaults to ASC.") + ] = None, + next_page_token: Annotated[ + Optional[StrictStr], Field(description="Token to use to retrieve next page of results.") + ] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List All ServingEnvironments. + + Gets a list of all `ServingEnvironment` entities. + + :param page_size: Number of entities in each page. + :type page_size: str + :param order_by: Specifies the order by criteria for listing entities. + :type order_by: OrderByField + :param sort_order: Specifies the sort order for listing entities, defaults to ASC. + :type sort_order: SortOrder + :param next_page_token: Token to use to retrieve next page of results. + :type next_page_token: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._get_serving_environments_serialize( + page_size=page_size, + order_by=order_by, + sort_order=sort_order, + next_page_token=next_page_token, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironmentList", + "401": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _get_serving_environments_serialize( + self, + page_size, + order_by, + sort_order, + next_page_token, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if page_size is not None: + + _query_params.append(("pageSize", page_size)) + + if order_by is not None: + + _query_params.append(("orderBy", order_by.value)) + + if sort_order is not None: + + _query_params.append(("sortOrder", sort_order.value)) + + if next_page_token is not None: + + _query_params.append(("nextPageToken", next_page_token)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="GET", + resource_path="/api/model_registry/v1alpha3/serving_environments", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def update_inference_service( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + inference_service_update: Annotated[ + InferenceServiceUpdate, Field(description="Updated `InferenceService` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> InferenceService: + """Update a InferenceService. + + Updates an existing `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param inference_service_update: Updated `InferenceService` information. (required) + :type inference_service_update: InferenceServiceUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_inference_service_serialize( + inferenceservice_id=inferenceservice_id, + inference_service_update=inference_service_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def update_inference_service_with_http_info( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + inference_service_update: Annotated[ + InferenceServiceUpdate, Field(description="Updated `InferenceService` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[InferenceService]: + """Update a InferenceService. + + Updates an existing `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param inference_service_update: Updated `InferenceService` information. (required) + :type inference_service_update: InferenceServiceUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_inference_service_serialize( + inferenceservice_id=inferenceservice_id, + inference_service_update=inference_service_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def update_inference_service_without_preload_content( + self, + inferenceservice_id: Annotated[StrictStr, Field(description="A unique identifier for a `InferenceService`.")], + inference_service_update: Annotated[ + InferenceServiceUpdate, Field(description="Updated `InferenceService` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a InferenceService. + + Updates an existing `InferenceService`. + + :param inferenceservice_id: A unique identifier for a `InferenceService`. (required) + :type inferenceservice_id: str + :param inference_service_update: Updated `InferenceService` information. (required) + :type inference_service_update: InferenceServiceUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_inference_service_serialize( + inferenceservice_id=inferenceservice_id, + inference_service_update=inference_service_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "InferenceService", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_inference_service_serialize( + self, + inferenceservice_id, + inference_service_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if inferenceservice_id is not None: + _path_params["inferenceserviceId"] = inferenceservice_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if inference_service_update is not None: + _body_params = inference_service_update + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/api/model_registry/v1alpha3/inference_services/{inferenceserviceId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def update_model_artifact( + self, + modelartifact_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelArtifact`.")], + model_artifact_update: Annotated[ + ModelArtifactUpdate, Field(description="Updated `ModelArtifact` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelArtifact: + """Update a ModelArtifact. + + Updates an existing `ModelArtifact`. + + :param modelartifact_id: A unique identifier for a `ModelArtifact`. (required) + :type modelartifact_id: str + :param model_artifact_update: Updated `ModelArtifact` information. (required) + :type model_artifact_update: ModelArtifactUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_model_artifact_serialize( + modelartifact_id=modelartifact_id, + model_artifact_update=model_artifact_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def update_model_artifact_with_http_info( + self, + modelartifact_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelArtifact`.")], + model_artifact_update: Annotated[ + ModelArtifactUpdate, Field(description="Updated `ModelArtifact` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelArtifact]: + """Update a ModelArtifact. + + Updates an existing `ModelArtifact`. + + :param modelartifact_id: A unique identifier for a `ModelArtifact`. (required) + :type modelartifact_id: str + :param model_artifact_update: Updated `ModelArtifact` information. (required) + :type model_artifact_update: ModelArtifactUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_model_artifact_serialize( + modelartifact_id=modelartifact_id, + model_artifact_update=model_artifact_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def update_model_artifact_without_preload_content( + self, + modelartifact_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelArtifact`.")], + model_artifact_update: Annotated[ + ModelArtifactUpdate, Field(description="Updated `ModelArtifact` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a ModelArtifact. + + Updates an existing `ModelArtifact`. + + :param modelartifact_id: A unique identifier for a `ModelArtifact`. (required) + :type modelartifact_id: str + :param model_artifact_update: Updated `ModelArtifact` information. (required) + :type model_artifact_update: ModelArtifactUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_model_artifact_serialize( + modelartifact_id=modelartifact_id, + model_artifact_update=model_artifact_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelArtifact", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_model_artifact_serialize( + self, + modelartifact_id, + model_artifact_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if modelartifact_id is not None: + _path_params["modelartifactId"] = modelartifact_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if model_artifact_update is not None: + _body_params = model_artifact_update + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/api/model_registry/v1alpha3/model_artifacts/{modelartifactId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def update_model_version( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + model_version_update: Annotated[ModelVersionUpdate, Field(description="Updated `ModelVersion` information.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModelVersion: + """Update a ModelVersion. + + Updates an existing `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param model_version_update: Updated `ModelVersion` information. (required) + :type model_version_update: ModelVersionUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_model_version_serialize( + modelversion_id=modelversion_id, + model_version_update=model_version_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def update_model_version_with_http_info( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + model_version_update: Annotated[ModelVersionUpdate, Field(description="Updated `ModelVersion` information.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModelVersion]: + """Update a ModelVersion. + + Updates an existing `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param model_version_update: Updated `ModelVersion` information. (required) + :type model_version_update: ModelVersionUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_model_version_serialize( + modelversion_id=modelversion_id, + model_version_update=model_version_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def update_model_version_without_preload_content( + self, + modelversion_id: Annotated[StrictStr, Field(description="A unique identifier for a `ModelVersion`.")], + model_version_update: Annotated[ModelVersionUpdate, Field(description="Updated `ModelVersion` information.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a ModelVersion. + + Updates an existing `ModelVersion`. + + :param modelversion_id: A unique identifier for a `ModelVersion`. (required) + :type modelversion_id: str + :param model_version_update: Updated `ModelVersion` information. (required) + :type model_version_update: ModelVersionUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_model_version_serialize( + modelversion_id=modelversion_id, + model_version_update=model_version_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ModelVersion", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_model_version_serialize( + self, + modelversion_id, + model_version_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if modelversion_id is not None: + _path_params["modelversionId"] = modelversion_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if model_version_update is not None: + _body_params = model_version_update + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/api/model_registry/v1alpha3/model_versions/{modelversionId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def update_registered_model( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + registered_model_update: Annotated[ + RegisteredModelUpdate, Field(description="Updated `RegisteredModel` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RegisteredModel: + """Update a RegisteredModel. + + Updates an existing `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param registered_model_update: Updated `RegisteredModel` information. (required) + :type registered_model_update: RegisteredModelUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_registered_model_serialize( + registeredmodel_id=registeredmodel_id, + registered_model_update=registered_model_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def update_registered_model_with_http_info( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + registered_model_update: Annotated[ + RegisteredModelUpdate, Field(description="Updated `RegisteredModel` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[RegisteredModel]: + """Update a RegisteredModel. + + Updates an existing `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param registered_model_update: Updated `RegisteredModel` information. (required) + :type registered_model_update: RegisteredModelUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_registered_model_serialize( + registeredmodel_id=registeredmodel_id, + registered_model_update=registered_model_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def update_registered_model_without_preload_content( + self, + registeredmodel_id: Annotated[StrictStr, Field(description="A unique identifier for a `RegisteredModel`.")], + registered_model_update: Annotated[ + RegisteredModelUpdate, Field(description="Updated `RegisteredModel` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a RegisteredModel. + + Updates an existing `RegisteredModel`. + + :param registeredmodel_id: A unique identifier for a `RegisteredModel`. (required) + :type registeredmodel_id: str + :param registered_model_update: Updated `RegisteredModel` information. (required) + :type registered_model_update: RegisteredModelUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_registered_model_serialize( + registeredmodel_id=registeredmodel_id, + registered_model_update=registered_model_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "RegisteredModel", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_registered_model_serialize( + self, + registeredmodel_id, + registered_model_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if registeredmodel_id is not None: + _path_params["registeredmodelId"] = registeredmodel_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if registered_model_update is not None: + _body_params = registered_model_update + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/api/model_registry/v1alpha3/registered_models/{registeredmodelId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) + + @validate_call + async def update_serving_environment( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + serving_environment_update: Annotated[ + ServingEnvironmentUpdate, Field(description="Updated `ServingEnvironment` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ServingEnvironment: + """Update a ServingEnvironment. + + Updates an existing `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param serving_environment_update: Updated `ServingEnvironment` information. (required) + :type serving_environment_update: ServingEnvironmentUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_serving_environment_serialize( + servingenvironment_id=servingenvironment_id, + serving_environment_update=serving_environment_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + async def update_serving_environment_with_http_info( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + serving_environment_update: Annotated[ + ServingEnvironmentUpdate, Field(description="Updated `ServingEnvironment` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ServingEnvironment]: + """Update a ServingEnvironment. + + Updates an existing `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param serving_environment_update: Updated `ServingEnvironment` information. (required) + :type serving_environment_update: ServingEnvironmentUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_serving_environment_serialize( + servingenvironment_id=servingenvironment_id, + serving_environment_update=serving_environment_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + async def update_serving_environment_without_preload_content( + self, + servingenvironment_id: Annotated[ + StrictStr, Field(description="A unique identifier for a `ServingEnvironment`.") + ], + serving_environment_update: Annotated[ + ServingEnvironmentUpdate, Field(description="Updated `ServingEnvironment` information.") + ], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]], + ] = None, + _request_auth: Optional[dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a ServingEnvironment. + + Updates an existing `ServingEnvironment`. + + :param servingenvironment_id: A unique identifier for a `ServingEnvironment`. (required) + :type servingenvironment_id: str + :param serving_environment_update: Updated `ServingEnvironment` information. (required) + :type serving_environment_update: ServingEnvironmentUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + _param = self._update_serving_environment_serialize( + servingenvironment_id=servingenvironment_id, + serving_environment_update=serving_environment_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index, + ) + + _response_types_map: dict[str, Optional[str]] = { + "200": "ServingEnvironment", + "400": "Error", + "401": "Error", + "404": "Error", + "500": "Error", + } + response_data = await self.api_client.call_api(*_param, _request_timeout=_request_timeout) + return response_data.response + + def _update_serving_environment_serialize( + self, + servingenvironment_id, + serving_environment_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: dict[str, str] = {} + + _path_params: dict[str, str] = {} + _query_params: list[tuple[str, str]] = [] + _header_params: dict[str, Optional[str]] = _headers or {} + _form_params: list[tuple[str, str]] = [] + _files: dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if servingenvironment_id is not None: + _path_params["servingenvironmentId"] = servingenvironment_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if serving_environment_update is not None: + _body_params = serving_environment_update + + # set the HTTP header `Accept` + _header_params["Accept"] = self.api_client.select_header_accept(["application/json"]) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params["Content-Type"] = _content_type + else: + _default_content_type = self.api_client.select_header_content_type(["application/json"]) + if _default_content_type is not None: + _header_params["Content-Type"] = _default_content_type + + # authentication setting + _auth_settings: list[str] = ["Bearer"] + + return self.api_client.param_serialize( + method="PATCH", + resource_path="/api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}", + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth, + ) diff --git a/clients/python/src/mr_openapi/api_client.py b/clients/python/src/mr_openapi/api_client.py new file mode 100644 index 000000000..9ab240bb8 --- /dev/null +++ b/clients/python/src/mr_openapi/api_client.py @@ -0,0 +1,663 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import datetime +import json +import mimetypes +import os +import re +import tempfile +from enum import Enum +from typing import Optional, Union +from urllib.parse import quote + +from dateutil.parser import parse +from pydantic import SecretStr + +import mr_openapi.models +from mr_openapi import rest +from mr_openapi.api_response import ApiResponse +from mr_openapi.api_response import T as ApiResponseT +from mr_openapi.configuration import Configuration +from mr_openapi.exceptions import ( + ApiException, + ApiValueError, +) + +RequestSerialized = tuple[str, str, dict[str, str], Optional[str], list[str]] + + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + "int": int, + "long": int, # TODO remove as only py3 is supported? + "float": float, + "str": str, + "bool": bool, + "date": datetime.date, + "datetime": datetime.datetime, + "object": object, + } + _pool = None + + def __init__(self, configuration=None, header_name=None, header_value=None, cookie=None) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = "OpenAPI-Generator/1.0.0/python" + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + + @property + def user_agent(self): + """User agent for this API client.""" + return self.default_headers["User-Agent"] + + @user_agent.setter + def user_agent(self, value): + self.default_headers["User-Agent"] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None, + ) -> RequestSerialized: + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files). + """ + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params["Cookie"] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict(self.parameters_to_tuples(header_params, collection_formats)) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples(path_params, collection_formats) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace(f"{{{k}}}", quote(str(v), safe=config.safe_chars_for_path_param)) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples(post_params, collection_formats) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, query_params, auth_settings, resource_path, method, body, request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query(query_params, collection_formats) + url += "?" + url_query + + return method, url, header_params, body, post_params + + async def call_api( + self, method, url, header_params=None, body=None, post_params=None, _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse. + """ + try: + # perform request and return response + response_data = await self.rest_client.request( + method, + url, + headers=header_params, + body=body, + post_params=post_params, + _request_timeout=_request_timeout, + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, response_data: rest.RESTResponse, response_types_map: Optional[dict[str, ApiResponseT]] = None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse. + """ + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + 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") + 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" + response_text = response_data.data.decode(encoding) + if response_type in ["bytearray", "str"]: + return_data = self.__deserialize_primitive(response_text, response_type) + else: + return_data = self.deserialize(response_text, response_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code=response_data.status, + data=return_data, + headers=response_data.getheaders(), + raw_data=response_data.data, + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, list): + return [self.sanitize_for_serialization(sub_obj) for sub_obj in obj] + elif isinstance(obj, tuple): + return tuple(self.sanitize_for_serialization(sub_obj) for sub_obj in obj) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + + elif isinstance(obj, dict): + obj_dict = obj + 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(obj.to_dict): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return {key: self.sanitize_for_serialization(val) for key, val in obj_dict.items()} + + def deserialize(self, response_text, response_type): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + + :return: deserialized object. + """ + # fetch data from response object + try: + data = json.loads(response_text) + except ValueError: + data = response_text + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith("List["): + m = re.match(r"List\[(.*)]", klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) for sub_data in data] + + if klass.startswith("Dict["): + m = re.match(r"Dict\[([^,]*), (.*)]", klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(mr_openapi.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass == object: + return self.__deserialize_object(data) + elif klass == datetime.date: + return self.__deserialize_date(data) + elif klass == datetime.datetime: + return self.__deserialize_datetime(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: list[tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, value) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append((k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: list[tuple[str, str]] = [] + 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 isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == "multi": + new_params.extend((k, str(value)) for value in v) + else: + if collection_format == "ssv": + delimiter = " " + elif collection_format == "tsv": + delimiter = "\t" + elif collection_format == "pipes": + delimiter = "|" + else: # csv is the default + delimiter = "," + new_params.append((k, delimiter.join(quote(str(value)) for value in v))) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters(self, files: dict[str, Union[str, bytes]]): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, "rb") as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + else: + msg = "Unsupported file value" + raise ValueError(msg) + mimetype = mimetypes.guess_type(filename)[0] or "application/octet-stream" + params.append((k, (filename, filedata, mimetype))) + return params + + def select_header_accept(self, accepts: list[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search("json", accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search("json", content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, headers, queries, auth_settings, resource_path, method, body, request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params(headers, queries, resource_path, method, body, request_auth) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params(headers, queries, resource_path, method, body, auth_setting) + + def _apply_auth_params(self, headers, queries, resource_path, method, body, auth_setting) -> None: + """Updates the request parameters based on a single auth_setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting["in"] == "cookie": + headers["Cookie"] = auth_setting["value"] + elif auth_setting["in"] == "header": + if auth_setting["type"] != "http-signature": + headers[auth_setting["key"]] = auth_setting["value"] + elif auth_setting["in"] == "query": + queries.append((auth_setting["key"], auth_setting["value"])) + else: + msg = "Authentication token must be in `query` or `header`" + raise ApiValueError(msg) + + def __deserialize_file(self, response): + """Deserializes body to file. + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.getheader("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) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException(status=0, reason=f"Failed to parse `{string}` as date object") + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException(status=0, reason=(f"Failed to parse `{string}` as datetime object")) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException(status=0, reason=(f"Failed to parse `{data}` as `{klass}`")) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + return klass.from_dict(data) diff --git a/clients/python/src/mr_openapi/api_response.py b/clients/python/src/mr_openapi/api_response.py new file mode 100644 index 000000000..d1b9661e0 --- /dev/null +++ b/clients/python/src/mr_openapi/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations + +from collections.abc import Mapping +from typing import Generic, TypeVar + +from pydantic import BaseModel, Field, StrictBytes, StrictInt + +T = TypeVar("T") + + +class ApiResponse(BaseModel, Generic[T]): + """API response object.""" + + status_code: StrictInt = Field(description="HTTP status code") + headers: Mapping[str, str] | None = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = {"arbitrary_types_allowed": True} diff --git a/clients/python/src/mr_openapi/configuration.py b/clients/python/src/mr_openapi/configuration.py new file mode 100644 index 000000000..f31a0730e --- /dev/null +++ b/clients/python/src/mr_openapi/configuration.py @@ -0,0 +1,434 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import copy +import http.client as httplib +import logging +import sys +from logging import FileHandler +from typing import Optional + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + "multipleOf", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", +} + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + configuration. + :param server_operation_variables: Mapping from operation ID to a mapping with + string values to replace variables in templated server configuration. + The validation of enums is performed for variables with defined enum + values before. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + + :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, + ssl_ca_cert=None, + ) -> None: + """Constructor.""" + self._base_path = "https://localhost:8080" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("mr_openapi") + self.logger_format = "%(asctime)s %(levelname)s %(message)s" + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + self.debug = False + """Debug switch + """ + + self.verify_ssl = True + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.cert_file = None + """client certificate file + """ + self.key_file = None + """client key file + """ + self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ + self.safe_chars_for_path_param = "" + """Safe chars for path_param + """ + self.retries = None + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation + self.client_side_validation = True + + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + def __deepcopy__(self, memo): + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + 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 + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name, value): + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default): + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls): + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls): + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = Configuration() + return cls._default + + @property + def logger_file(self): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value): + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self): + """Debug status. + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value): + """Debug status. + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value): + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier, alias=None): + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not 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) + if prefix: + return f"{prefix} {key}" + else: + return key + return None + + def auth_settings(self): + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth = {} + if self.access_token is not None: + auth["Bearer"] = { + "type": "bearer", + "in": "header", + "format": "JWT", + "key": "Authorization", + "value": "Bearer " + self.access_token, + } + return auth + + def to_debug_report(self): + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return ( + "Python SDK Debug Report:\n" + f"OS: {sys.platform}\n" + f"Python Version: {sys.version}\n" + "Version of the API: v1alpha3\n" + "SDK Package Version: 1.0.0" + ) + + def get_host_settings(self): + """Gets an array of host settings. + + :return: An array of host settings + """ + return [ + { + "url": "https://localhost:8080", + "description": "No description provided", + }, + { + "url": "http://localhost:8080", + "description": "No description provided", + }, + ] + + def get_host_from_settings(self, index, variables=None, servers=None): + """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 + :param servers: an array of host settings or None + :return: URL based on host settings. + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + msg = f"Invalid index {index} when selecting the host settings. " f"Must be less than {len(servers)}" + raise ValueError(msg) + + url = server["url"] + + # go through variables and replace placeholders + for variable_name, variable in server.get("variables", {}).items(): + used_value = variables.get(variable_name, variable["default_value"]) + + if "enum_values" in variable and used_value not in variable["enum_values"]: + msg = "The variable `{}` in the host URL has invalid value " "{}. Must be {}.".format( + variable_name, variables[variable_name], variable["enum_values"] + ) + raise ValueError(msg) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self): + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value): + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/clients/python/src/mr_openapi/docs/Artifact.md b/clients/python/src/mr_openapi/docs/Artifact.md new file mode 100644 index 000000000..c13542ff8 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/Artifact.md @@ -0,0 +1,44 @@ +# Artifact + +A metadata Artifact Entity. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**artifact_type** | **str** | | [default to 'doc-artifact'] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] +**model_format_name** | **str** | Name of the model format. | [optional] +**storage_key** | **str** | Storage secret name. | [optional] +**storage_path** | **str** | Path for model in storage provided by `storageKey`. | [optional] +**model_format_version** | **str** | Version of the model format. | [optional] +**service_account_name** | **str** | Name of the service account with storage secret. | [optional] + +## Example + +```python +from mr_openapi.models.artifact import Artifact + +# TODO update the JSON string below +json = "{}" +# create an instance of Artifact from a JSON string +artifact_instance = Artifact.from_json(json) +# print the JSON string representation of the object +print(Artifact.to_json()) + +# convert the object into a dict +artifact_dict = artifact_instance.to_dict() +# create an instance of Artifact from a dict +artifact_from_dict = Artifact.from_dict(artifact_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/clients/python/src/mr_openapi/docs/ArtifactList.md b/clients/python/src/mr_openapi/docs/ArtifactList.md new file mode 100644 index 000000000..99f18e8b3 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ArtifactList.md @@ -0,0 +1,33 @@ +# ArtifactList + +A list of Artifact entities. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | +**items** | [**List[Artifact]**](Artifact.md) | Array of `Artifact` entities. | [optional] + +## Example + +```python +from mr_openapi.models.artifact_list import ArtifactList + +# TODO update the JSON string below +json = "{}" +# create an instance of ArtifactList from a JSON string +artifact_list_instance = ArtifactList.from_json(json) +# print the JSON string representation of the object +print(ArtifactList.to_json()) + +# convert the object into a dict +artifact_list_dict = artifact_list_instance.to_dict() +# create an instance of ArtifactList from a dict +artifact_list_from_dict = ArtifactList.from_dict(artifact_list_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/clients/python/src/mr_openapi/docs/ArtifactState.md b/clients/python/src/mr_openapi/docs/ArtifactState.md new file mode 100644 index 000000000..3c7442e9e --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ArtifactState.md @@ -0,0 +1,12 @@ +# ArtifactState + + - PENDING: A state indicating that the artifact may exist. - LIVE: A state indicating that the artifact should exist, unless something external to the system deletes it. - MARKED_FOR_DELETION: A state indicating that the artifact should be deleted. - DELETED: A state indicating that the artifact has been deleted. - ABANDONED: A state indicating that the artifact has been abandoned, which may be due to a failed or cancelled execution. - REFERENCE: A state indicating that the artifact is a reference artifact. At execution start time, the orchestrator produces an output artifact for each output key with state PENDING. However, for an intermediate artifact, this first artifact's state will be REFERENCE. Intermediate artifacts emitted during a component's execution will copy the REFERENCE artifact's attributes. At the end of an execution, the artifact state should remain REFERENCE instead of being changed to LIVE. See also: ml-metadata Artifact.State + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/clients/python/src/mr_openapi/docs/BaseArtifact.md b/clients/python/src/mr_openapi/docs/BaseArtifact.md new file mode 100644 index 000000000..9f3b683a8 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseArtifact.md @@ -0,0 +1,37 @@ +# BaseArtifact + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] + +## Example + +```python +from mr_openapi.models.base_artifact import BaseArtifact + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseArtifact from a JSON string +base_artifact_instance = BaseArtifact.from_json(json) +# print the JSON string representation of the object +print(BaseArtifact.to_json()) + +# convert the object into a dict +base_artifact_dict = base_artifact_instance.to_dict() +# create an instance of BaseArtifact from a dict +base_artifact_from_dict = BaseArtifact.from_dict(base_artifact_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/clients/python/src/mr_openapi/docs/BaseArtifactCreate.md b/clients/python/src/mr_openapi/docs/BaseArtifactCreate.md new file mode 100644 index 000000000..f73991062 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseArtifactCreate.md @@ -0,0 +1,34 @@ +# BaseArtifactCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] + +## Example + +```python +from mr_openapi.models.base_artifact_create import BaseArtifactCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseArtifactCreate from a JSON string +base_artifact_create_instance = BaseArtifactCreate.from_json(json) +# print the JSON string representation of the object +print(BaseArtifactCreate.to_json()) + +# convert the object into a dict +base_artifact_create_dict = base_artifact_create_instance.to_dict() +# create an instance of BaseArtifactCreate from a dict +base_artifact_create_from_dict = BaseArtifactCreate.from_dict(base_artifact_create_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/clients/python/src/mr_openapi/docs/BaseArtifactUpdate.md b/clients/python/src/mr_openapi/docs/BaseArtifactUpdate.md new file mode 100644 index 000000000..60b7d36aa --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseArtifactUpdate.md @@ -0,0 +1,33 @@ +# BaseArtifactUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] + +## Example + +```python +from mr_openapi.models.base_artifact_update import BaseArtifactUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseArtifactUpdate from a JSON string +base_artifact_update_instance = BaseArtifactUpdate.from_json(json) +# print the JSON string representation of the object +print(BaseArtifactUpdate.to_json()) + +# convert the object into a dict +base_artifact_update_dict = base_artifact_update_instance.to_dict() +# create an instance of BaseArtifactUpdate from a dict +base_artifact_update_from_dict = BaseArtifactUpdate.from_dict(base_artifact_update_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/clients/python/src/mr_openapi/docs/BaseExecution.md b/clients/python/src/mr_openapi/docs/BaseExecution.md new file mode 100644 index 000000000..e8c9fd531 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseExecution.md @@ -0,0 +1,36 @@ +# BaseExecution + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_known_state** | [**ExecutionState**](ExecutionState.md) | | [optional] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] + +## Example + +```python +from mr_openapi.models.base_execution import BaseExecution + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseExecution from a JSON string +base_execution_instance = BaseExecution.from_json(json) +# print the JSON string representation of the object +print(BaseExecution.to_json()) + +# convert the object into a dict +base_execution_dict = base_execution_instance.to_dict() +# create an instance of BaseExecution from a dict +base_execution_from_dict = BaseExecution.from_dict(base_execution_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/clients/python/src/mr_openapi/docs/BaseExecutionCreate.md b/clients/python/src/mr_openapi/docs/BaseExecutionCreate.md new file mode 100644 index 000000000..020df818e --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseExecutionCreate.md @@ -0,0 +1,33 @@ +# BaseExecutionCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_known_state** | [**ExecutionState**](ExecutionState.md) | | [optional] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] + +## Example + +```python +from mr_openapi.models.base_execution_create import BaseExecutionCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseExecutionCreate from a JSON string +base_execution_create_instance = BaseExecutionCreate.from_json(json) +# print the JSON string representation of the object +print(BaseExecutionCreate.to_json()) + +# convert the object into a dict +base_execution_create_dict = base_execution_create_instance.to_dict() +# create an instance of BaseExecutionCreate from a dict +base_execution_create_from_dict = BaseExecutionCreate.from_dict(base_execution_create_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/clients/python/src/mr_openapi/docs/BaseExecutionUpdate.md b/clients/python/src/mr_openapi/docs/BaseExecutionUpdate.md new file mode 100644 index 000000000..f14627cda --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseExecutionUpdate.md @@ -0,0 +1,32 @@ +# BaseExecutionUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**last_known_state** | [**ExecutionState**](ExecutionState.md) | | [optional] + +## Example + +```python +from mr_openapi.models.base_execution_update import BaseExecutionUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseExecutionUpdate from a JSON string +base_execution_update_instance = BaseExecutionUpdate.from_json(json) +# print the JSON string representation of the object +print(BaseExecutionUpdate.to_json()) + +# convert the object into a dict +base_execution_update_dict = base_execution_update_instance.to_dict() +# create an instance of BaseExecutionUpdate from a dict +base_execution_update_from_dict = BaseExecutionUpdate.from_dict(base_execution_update_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/clients/python/src/mr_openapi/docs/BaseResource.md b/clients/python/src/mr_openapi/docs/BaseResource.md new file mode 100644 index 000000000..7eab714fd --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseResource.md @@ -0,0 +1,35 @@ +# BaseResource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] + +## Example + +```python +from mr_openapi.models.base_resource import BaseResource + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResource from a JSON string +base_resource_instance = BaseResource.from_json(json) +# print the JSON string representation of the object +print(BaseResource.to_json()) + +# convert the object into a dict +base_resource_dict = base_resource_instance.to_dict() +# create an instance of BaseResource from a dict +base_resource_from_dict = BaseResource.from_dict(base_resource_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/clients/python/src/mr_openapi/docs/BaseResourceCreate.md b/clients/python/src/mr_openapi/docs/BaseResourceCreate.md new file mode 100644 index 000000000..7d238cf9a --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseResourceCreate.md @@ -0,0 +1,32 @@ +# BaseResourceCreate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] + +## Example + +```python +from mr_openapi.models.base_resource_create import BaseResourceCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResourceCreate from a JSON string +base_resource_create_instance = BaseResourceCreate.from_json(json) +# print the JSON string representation of the object +print(BaseResourceCreate.to_json()) + +# convert the object into a dict +base_resource_create_dict = base_resource_create_instance.to_dict() +# create an instance of BaseResourceCreate from a dict +base_resource_create_from_dict = BaseResourceCreate.from_dict(base_resource_create_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/clients/python/src/mr_openapi/docs/BaseResourceList.md b/clients/python/src/mr_openapi/docs/BaseResourceList.md new file mode 100644 index 000000000..d60063b0b --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseResourceList.md @@ -0,0 +1,31 @@ +# BaseResourceList + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | + +## Example + +```python +from mr_openapi.models.base_resource_list import BaseResourceList + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResourceList from a JSON string +base_resource_list_instance = BaseResourceList.from_json(json) +# print the JSON string representation of the object +print(BaseResourceList.to_json()) + +# convert the object into a dict +base_resource_list_dict = base_resource_list_instance.to_dict() +# create an instance of BaseResourceList from a dict +base_resource_list_from_dict = BaseResourceList.from_dict(base_resource_list_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/clients/python/src/mr_openapi/docs/BaseResourceUpdate.md b/clients/python/src/mr_openapi/docs/BaseResourceUpdate.md new file mode 100644 index 000000000..d9b0ac407 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/BaseResourceUpdate.md @@ -0,0 +1,31 @@ +# BaseResourceUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] + +## Example + +```python +from mr_openapi.models.base_resource_update import BaseResourceUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of BaseResourceUpdate from a JSON string +base_resource_update_instance = BaseResourceUpdate.from_json(json) +# print the JSON string representation of the object +print(BaseResourceUpdate.to_json()) + +# convert the object into a dict +base_resource_update_dict = base_resource_update_instance.to_dict() +# create an instance of BaseResourceUpdate from a dict +base_resource_update_from_dict = BaseResourceUpdate.from_dict(base_resource_update_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/clients/python/src/mr_openapi/docs/DocArtifact.md b/clients/python/src/mr_openapi/docs/DocArtifact.md new file mode 100644 index 000000000..cbde80cf6 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/DocArtifact.md @@ -0,0 +1,39 @@ +# DocArtifact + +A document. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**artifact_type** | **str** | | [default to 'doc-artifact'] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] + +## Example + +```python +from mr_openapi.models.doc_artifact import DocArtifact + +# TODO update the JSON string below +json = "{}" +# create an instance of DocArtifact from a JSON string +doc_artifact_instance = DocArtifact.from_json(json) +# print the JSON string representation of the object +print(DocArtifact.to_json()) + +# convert the object into a dict +doc_artifact_dict = doc_artifact_instance.to_dict() +# create an instance of DocArtifact from a dict +doc_artifact_from_dict = DocArtifact.from_dict(doc_artifact_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/clients/python/src/mr_openapi/docs/Error.md b/clients/python/src/mr_openapi/docs/Error.md new file mode 100644 index 000000000..20319b227 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/Error.md @@ -0,0 +1,31 @@ +# Error + +Error code and message. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code | +**message** | **str** | Error message | + +## Example + +```python +from mr_openapi.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print(Error.to_json()) + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_from_dict = Error.from_dict(error_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/clients/python/src/mr_openapi/docs/ExecutionState.md b/clients/python/src/mr_openapi/docs/ExecutionState.md new file mode 100644 index 000000000..49bb37cc0 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ExecutionState.md @@ -0,0 +1,12 @@ +# ExecutionState + +The state of the Execution. The state transitions are NEW -> RUNNING -> COMPLETE | CACHED | FAILED | CANCELED CACHED means the execution is skipped due to cached results. CANCELED means the execution is skipped due to precondition not met. It is different from CACHED in that a CANCELED execution will not have any event associated with it. It is different from FAILED in that there is no unexpected error happened and it is regarded as a normal state. See also: ml-metadata Execution.State + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/clients/python/src/mr_openapi/docs/InferenceService.md b/clients/python/src/mr_openapi/docs/InferenceService.md new file mode 100644 index 000000000..9c8dc21d8 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/InferenceService.md @@ -0,0 +1,41 @@ +# InferenceService + +An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] +**model_version_id** | **str** | ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served. | [optional] +**runtime** | **str** | Model runtime. | [optional] +**desired_state** | [**InferenceServiceState**](InferenceServiceState.md) | | [optional] +**registered_model_id** | **str** | ID of the `RegisteredModel` to serve. | +**serving_environment_id** | **str** | ID of the parent `ServingEnvironment` for this `InferenceService` entity. | + +## Example + +```python +from mr_openapi.models.inference_service import InferenceService + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceService from a JSON string +inference_service_instance = InferenceService.from_json(json) +# print the JSON string representation of the object +print(InferenceService.to_json()) + +# convert the object into a dict +inference_service_dict = inference_service_instance.to_dict() +# create an instance of InferenceService from a dict +inference_service_from_dict = InferenceService.from_dict(inference_service_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/clients/python/src/mr_openapi/docs/InferenceServiceCreate.md b/clients/python/src/mr_openapi/docs/InferenceServiceCreate.md new file mode 100644 index 000000000..c3d745507 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/InferenceServiceCreate.md @@ -0,0 +1,38 @@ +# InferenceServiceCreate + +An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**model_version_id** | **str** | ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served. | [optional] +**runtime** | **str** | Model runtime. | [optional] +**desired_state** | [**InferenceServiceState**](InferenceServiceState.md) | | [optional] +**registered_model_id** | **str** | ID of the `RegisteredModel` to serve. | +**serving_environment_id** | **str** | ID of the parent `ServingEnvironment` for this `InferenceService` entity. | + +## Example + +```python +from mr_openapi.models.inference_service_create import InferenceServiceCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceServiceCreate from a JSON string +inference_service_create_instance = InferenceServiceCreate.from_json(json) +# print the JSON string representation of the object +print(InferenceServiceCreate.to_json()) + +# convert the object into a dict +inference_service_create_dict = inference_service_create_instance.to_dict() +# create an instance of InferenceServiceCreate from a dict +inference_service_create_from_dict = InferenceServiceCreate.from_dict(inference_service_create_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/clients/python/src/mr_openapi/docs/InferenceServiceList.md b/clients/python/src/mr_openapi/docs/InferenceServiceList.md new file mode 100644 index 000000000..2063707f7 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/InferenceServiceList.md @@ -0,0 +1,33 @@ +# InferenceServiceList + +List of InferenceServices. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | +**items** | [**List[InferenceService]**](InferenceService.md) | | [optional] + +## Example + +```python +from mr_openapi.models.inference_service_list import InferenceServiceList + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceServiceList from a JSON string +inference_service_list_instance = InferenceServiceList.from_json(json) +# print the JSON string representation of the object +print(InferenceServiceList.to_json()) + +# convert the object into a dict +inference_service_list_dict = inference_service_list_instance.to_dict() +# create an instance of InferenceServiceList from a dict +inference_service_list_from_dict = InferenceServiceList.from_dict(inference_service_list_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/clients/python/src/mr_openapi/docs/InferenceServiceState.md b/clients/python/src/mr_openapi/docs/InferenceServiceState.md new file mode 100644 index 000000000..6c4276f96 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/InferenceServiceState.md @@ -0,0 +1,12 @@ +# InferenceServiceState + +- DEPLOYED: A state indicating that the `InferenceService` should be deployed. - UNDEPLOYED: A state indicating that the `InferenceService` should be un-deployed. The state indicates the desired state of inference service. See the associated `ServeModel` for the actual status of service deployment action. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/clients/python/src/mr_openapi/docs/InferenceServiceUpdate.md b/clients/python/src/mr_openapi/docs/InferenceServiceUpdate.md new file mode 100644 index 000000000..238747d7a --- /dev/null +++ b/clients/python/src/mr_openapi/docs/InferenceServiceUpdate.md @@ -0,0 +1,35 @@ +# InferenceServiceUpdate + +An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**model_version_id** | **str** | ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served. | [optional] +**runtime** | **str** | Model runtime. | [optional] +**desired_state** | [**InferenceServiceState**](InferenceServiceState.md) | | [optional] + +## Example + +```python +from mr_openapi.models.inference_service_update import InferenceServiceUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of InferenceServiceUpdate from a JSON string +inference_service_update_instance = InferenceServiceUpdate.from_json(json) +# print the JSON string representation of the object +print(InferenceServiceUpdate.to_json()) + +# convert the object into a dict +inference_service_update_dict = inference_service_update_instance.to_dict() +# create an instance of InferenceServiceUpdate from a dict +inference_service_update_from_dict = InferenceServiceUpdate.from_dict(inference_service_update_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/clients/python/src/mr_openapi/docs/MetadataBoolValue.md b/clients/python/src/mr_openapi/docs/MetadataBoolValue.md new file mode 100644 index 000000000..9ed8ace8f --- /dev/null +++ b/clients/python/src/mr_openapi/docs/MetadataBoolValue.md @@ -0,0 +1,31 @@ +# MetadataBoolValue + +A bool property value. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bool_value** | **bool** | | +**metadata_type** | **str** | | [default to 'MetadataBoolValue'] + +## Example + +```python +from mr_openapi.models.metadata_bool_value import MetadataBoolValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataBoolValue from a JSON string +metadata_bool_value_instance = MetadataBoolValue.from_json(json) +# print the JSON string representation of the object +print(MetadataBoolValue.to_json()) + +# convert the object into a dict +metadata_bool_value_dict = metadata_bool_value_instance.to_dict() +# create an instance of MetadataBoolValue from a dict +metadata_bool_value_from_dict = MetadataBoolValue.from_dict(metadata_bool_value_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/clients/python/src/mr_openapi/docs/MetadataDoubleValue.md b/clients/python/src/mr_openapi/docs/MetadataDoubleValue.md new file mode 100644 index 000000000..735ed72f0 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/MetadataDoubleValue.md @@ -0,0 +1,31 @@ +# MetadataDoubleValue + +A double property value. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**double_value** | **float** | | +**metadata_type** | **str** | | [default to 'MetadataDoubleValue'] + +## Example + +```python +from mr_openapi.models.metadata_double_value import MetadataDoubleValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataDoubleValue from a JSON string +metadata_double_value_instance = MetadataDoubleValue.from_json(json) +# print the JSON string representation of the object +print(MetadataDoubleValue.to_json()) + +# convert the object into a dict +metadata_double_value_dict = metadata_double_value_instance.to_dict() +# create an instance of MetadataDoubleValue from a dict +metadata_double_value_from_dict = MetadataDoubleValue.from_dict(metadata_double_value_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/clients/python/src/mr_openapi/docs/MetadataIntValue.md b/clients/python/src/mr_openapi/docs/MetadataIntValue.md new file mode 100644 index 000000000..e7666324d --- /dev/null +++ b/clients/python/src/mr_openapi/docs/MetadataIntValue.md @@ -0,0 +1,31 @@ +# MetadataIntValue + +An integer (int64) property value. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**int_value** | **str** | | +**metadata_type** | **str** | | [default to 'MetadataIntValue'] + +## Example + +```python +from mr_openapi.models.metadata_int_value import MetadataIntValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataIntValue from a JSON string +metadata_int_value_instance = MetadataIntValue.from_json(json) +# print the JSON string representation of the object +print(MetadataIntValue.to_json()) + +# convert the object into a dict +metadata_int_value_dict = metadata_int_value_instance.to_dict() +# create an instance of MetadataIntValue from a dict +metadata_int_value_from_dict = MetadataIntValue.from_dict(metadata_int_value_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/clients/python/src/mr_openapi/docs/MetadataProtoValue.md b/clients/python/src/mr_openapi/docs/MetadataProtoValue.md new file mode 100644 index 000000000..bf90cc943 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/MetadataProtoValue.md @@ -0,0 +1,32 @@ +# MetadataProtoValue + +A proto property value. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | url describing proto value | +**proto_value** | **str** | Base64 encoded bytes for proto value | +**metadata_type** | **str** | | [default to 'MetadataProtoValue'] + +## Example + +```python +from mr_openapi.models.metadata_proto_value import MetadataProtoValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataProtoValue from a JSON string +metadata_proto_value_instance = MetadataProtoValue.from_json(json) +# print the JSON string representation of the object +print(MetadataProtoValue.to_json()) + +# convert the object into a dict +metadata_proto_value_dict = metadata_proto_value_instance.to_dict() +# create an instance of MetadataProtoValue from a dict +metadata_proto_value_from_dict = MetadataProtoValue.from_dict(metadata_proto_value_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/clients/python/src/mr_openapi/docs/MetadataStringValue.md b/clients/python/src/mr_openapi/docs/MetadataStringValue.md new file mode 100644 index 000000000..3288dc2cb --- /dev/null +++ b/clients/python/src/mr_openapi/docs/MetadataStringValue.md @@ -0,0 +1,31 @@ +# MetadataStringValue + +A string property value. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**string_value** | **str** | | +**metadata_type** | **str** | | [default to 'MetadataStringValue'] + +## Example + +```python +from mr_openapi.models.metadata_string_value import MetadataStringValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataStringValue from a JSON string +metadata_string_value_instance = MetadataStringValue.from_json(json) +# print the JSON string representation of the object +print(MetadataStringValue.to_json()) + +# convert the object into a dict +metadata_string_value_dict = metadata_string_value_instance.to_dict() +# create an instance of MetadataStringValue from a dict +metadata_string_value_from_dict = MetadataStringValue.from_dict(metadata_string_value_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/clients/python/src/mr_openapi/docs/MetadataStructValue.md b/clients/python/src/mr_openapi/docs/MetadataStructValue.md new file mode 100644 index 000000000..d3bccba4b --- /dev/null +++ b/clients/python/src/mr_openapi/docs/MetadataStructValue.md @@ -0,0 +1,31 @@ +# MetadataStructValue + +A struct property value. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**struct_value** | **str** | Base64 encoded bytes for struct value | +**metadata_type** | **str** | | [default to 'MetadataStructValue'] + +## Example + +```python +from mr_openapi.models.metadata_struct_value import MetadataStructValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataStructValue from a JSON string +metadata_struct_value_instance = MetadataStructValue.from_json(json) +# print the JSON string representation of the object +print(MetadataStructValue.to_json()) + +# convert the object into a dict +metadata_struct_value_dict = metadata_struct_value_instance.to_dict() +# create an instance of MetadataStructValue from a dict +metadata_struct_value_from_dict = MetadataStructValue.from_dict(metadata_struct_value_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/clients/python/src/mr_openapi/docs/MetadataValue.md b/clients/python/src/mr_openapi/docs/MetadataValue.md new file mode 100644 index 000000000..a2b818f54 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/MetadataValue.md @@ -0,0 +1,37 @@ +# MetadataValue + +A value in properties. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**int_value** | **str** | | +**metadata_type** | **str** | | [default to 'MetadataBoolValue'] +**double_value** | **float** | | +**string_value** | **str** | | +**struct_value** | **str** | Base64 encoded bytes for struct value | +**type** | **str** | url describing proto value | +**proto_value** | **str** | Base64 encoded bytes for proto value | +**bool_value** | **bool** | | + +## Example + +```python +from mr_openapi.models.metadata_value import MetadataValue + +# TODO update the JSON string below +json = "{}" +# create an instance of MetadataValue from a JSON string +metadata_value_instance = MetadataValue.from_json(json) +# print the JSON string representation of the object +print(MetadataValue.to_json()) + +# convert the object into a dict +metadata_value_dict = metadata_value_instance.to_dict() +# create an instance of MetadataValue from a dict +metadata_value_from_dict = MetadataValue.from_dict(metadata_value_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/clients/python/src/mr_openapi/docs/ModelArtifact.md b/clients/python/src/mr_openapi/docs/ModelArtifact.md new file mode 100644 index 000000000..a29f23862 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelArtifact.md @@ -0,0 +1,44 @@ +# ModelArtifact + +An ML model artifact. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**artifact_type** | **str** | | [default to 'model-artifact'] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] +**model_format_name** | **str** | Name of the model format. | [optional] +**storage_key** | **str** | Storage secret name. | [optional] +**storage_path** | **str** | Path for model in storage provided by `storageKey`. | [optional] +**model_format_version** | **str** | Version of the model format. | [optional] +**service_account_name** | **str** | Name of the service account with storage secret. | [optional] + +## Example + +```python +from mr_openapi.models.model_artifact import ModelArtifact + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelArtifact from a JSON string +model_artifact_instance = ModelArtifact.from_json(json) +# print the JSON string representation of the object +print(ModelArtifact.to_json()) + +# convert the object into a dict +model_artifact_dict = model_artifact_instance.to_dict() +# create an instance of ModelArtifact from a dict +model_artifact_from_dict = ModelArtifact.from_dict(model_artifact_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/clients/python/src/mr_openapi/docs/ModelArtifactCreate.md b/clients/python/src/mr_openapi/docs/ModelArtifactCreate.md new file mode 100644 index 000000000..24fa8f020 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelArtifactCreate.md @@ -0,0 +1,40 @@ +# ModelArtifactCreate + +An ML model artifact. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**model_format_name** | **str** | Name of the model format. | [optional] +**storage_key** | **str** | Storage secret name. | [optional] +**storage_path** | **str** | Path for model in storage provided by `storageKey`. | [optional] +**model_format_version** | **str** | Version of the model format. | [optional] +**service_account_name** | **str** | Name of the service account with storage secret. | [optional] + +## Example + +```python +from mr_openapi.models.model_artifact_create import ModelArtifactCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelArtifactCreate from a JSON string +model_artifact_create_instance = ModelArtifactCreate.from_json(json) +# print the JSON string representation of the object +print(ModelArtifactCreate.to_json()) + +# convert the object into a dict +model_artifact_create_dict = model_artifact_create_instance.to_dict() +# create an instance of ModelArtifactCreate from a dict +model_artifact_create_from_dict = ModelArtifactCreate.from_dict(model_artifact_create_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/clients/python/src/mr_openapi/docs/ModelArtifactList.md b/clients/python/src/mr_openapi/docs/ModelArtifactList.md new file mode 100644 index 000000000..f1438408c --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelArtifactList.md @@ -0,0 +1,33 @@ +# ModelArtifactList + +List of ModelArtifact entities. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | +**items** | [**List[ModelArtifact]**](ModelArtifact.md) | Array of `ModelArtifact` entities. | [optional] + +## Example + +```python +from mr_openapi.models.model_artifact_list import ModelArtifactList + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelArtifactList from a JSON string +model_artifact_list_instance = ModelArtifactList.from_json(json) +# print the JSON string representation of the object +print(ModelArtifactList.to_json()) + +# convert the object into a dict +model_artifact_list_dict = model_artifact_list_instance.to_dict() +# create an instance of ModelArtifactList from a dict +model_artifact_list_from_dict = ModelArtifactList.from_dict(model_artifact_list_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/clients/python/src/mr_openapi/docs/ModelArtifactUpdate.md b/clients/python/src/mr_openapi/docs/ModelArtifactUpdate.md new file mode 100644 index 000000000..a8ea3add2 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelArtifactUpdate.md @@ -0,0 +1,39 @@ +# ModelArtifactUpdate + +An ML model artifact. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**uri** | **str** | The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact. | [optional] +**state** | [**ArtifactState**](ArtifactState.md) | | [optional] +**model_format_name** | **str** | Name of the model format. | [optional] +**storage_key** | **str** | Storage secret name. | [optional] +**storage_path** | **str** | Path for model in storage provided by `storageKey`. | [optional] +**model_format_version** | **str** | Version of the model format. | [optional] +**service_account_name** | **str** | Name of the service account with storage secret. | [optional] + +## Example + +```python +from mr_openapi.models.model_artifact_update import ModelArtifactUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelArtifactUpdate from a JSON string +model_artifact_update_instance = ModelArtifactUpdate.from_json(json) +# print the JSON string representation of the object +print(ModelArtifactUpdate.to_json()) + +# convert the object into a dict +model_artifact_update_dict = model_artifact_update_instance.to_dict() +# create an instance of ModelArtifactUpdate from a dict +model_artifact_update_from_dict = ModelArtifactUpdate.from_dict(model_artifact_update_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/clients/python/src/mr_openapi/docs/ModelRegistryServiceApi.md b/clients/python/src/mr_openapi/docs/ModelRegistryServiceApi.md new file mode 100644 index 000000000..f6ebff989 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelRegistryServiceApi.md @@ -0,0 +1,3030 @@ +# mr_openapi.ModelRegistryServiceApi + +All URIs are relative to *https://localhost:8080* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**create_environment_inference_service**](ModelRegistryServiceApi.md#create_environment_inference_service) | **POST** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services | Create a InferenceService in ServingEnvironment +[**create_inference_service**](ModelRegistryServiceApi.md#create_inference_service) | **POST** /api/model_registry/v1alpha3/inference_services | Create a InferenceService +[**create_inference_service_serve**](ModelRegistryServiceApi.md#create_inference_service_serve) | **POST** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves | Create a ServeModel action in a InferenceService +[**create_model_artifact**](ModelRegistryServiceApi.md#create_model_artifact) | **POST** /api/model_registry/v1alpha3/model_artifacts | Create a ModelArtifact +[**create_model_version**](ModelRegistryServiceApi.md#create_model_version) | **POST** /api/model_registry/v1alpha3/model_versions | Create a ModelVersion +[**create_model_version_artifact**](ModelRegistryServiceApi.md#create_model_version_artifact) | **POST** /api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts | Create an Artifact in a ModelVersion +[**create_registered_model**](ModelRegistryServiceApi.md#create_registered_model) | **POST** /api/model_registry/v1alpha3/registered_models | Create a RegisteredModel +[**create_registered_model_version**](ModelRegistryServiceApi.md#create_registered_model_version) | **POST** /api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions | Create a ModelVersion in RegisteredModel +[**create_serving_environment**](ModelRegistryServiceApi.md#create_serving_environment) | **POST** /api/model_registry/v1alpha3/serving_environments | Create a ServingEnvironment +[**find_inference_service**](ModelRegistryServiceApi.md#find_inference_service) | **GET** /api/model_registry/v1alpha3/inference_service | Get an InferenceServices that matches search parameters. +[**find_model_artifact**](ModelRegistryServiceApi.md#find_model_artifact) | **GET** /api/model_registry/v1alpha3/model_artifact | Get a ModelArtifact that matches search parameters. +[**find_model_version**](ModelRegistryServiceApi.md#find_model_version) | **GET** /api/model_registry/v1alpha3/model_version | Get a ModelVersion that matches search parameters. +[**find_registered_model**](ModelRegistryServiceApi.md#find_registered_model) | **GET** /api/model_registry/v1alpha3/registered_model | Get a RegisteredModel that matches search parameters. +[**find_serving_environment**](ModelRegistryServiceApi.md#find_serving_environment) | **GET** /api/model_registry/v1alpha3/serving_environment | Find ServingEnvironment +[**get_environment_inference_services**](ModelRegistryServiceApi.md#get_environment_inference_services) | **GET** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId}/inference_services | List All ServingEnvironment's InferenceServices +[**get_inference_service**](ModelRegistryServiceApi.md#get_inference_service) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId} | Get a InferenceService +[**get_inference_service_model**](ModelRegistryServiceApi.md#get_inference_service_model) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/model | Get InferenceService's RegisteredModel +[**get_inference_service_serves**](ModelRegistryServiceApi.md#get_inference_service_serves) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/serves | List All InferenceService's ServeModel actions +[**get_inference_service_version**](ModelRegistryServiceApi.md#get_inference_service_version) | **GET** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId}/version | Get InferenceService's ModelVersion +[**get_inference_services**](ModelRegistryServiceApi.md#get_inference_services) | **GET** /api/model_registry/v1alpha3/inference_services | List All InferenceServices +[**get_model_artifact**](ModelRegistryServiceApi.md#get_model_artifact) | **GET** /api/model_registry/v1alpha3/model_artifacts/{modelartifactId} | Get a ModelArtifact +[**get_model_artifacts**](ModelRegistryServiceApi.md#get_model_artifacts) | **GET** /api/model_registry/v1alpha3/model_artifacts | List All ModelArtifacts +[**get_model_version**](ModelRegistryServiceApi.md#get_model_version) | **GET** /api/model_registry/v1alpha3/model_versions/{modelversionId} | Get a ModelVersion +[**get_model_version_artifacts**](ModelRegistryServiceApi.md#get_model_version_artifacts) | **GET** /api/model_registry/v1alpha3/model_versions/{modelversionId}/artifacts | List all artifacts associated with the `ModelVersion` +[**get_model_versions**](ModelRegistryServiceApi.md#get_model_versions) | **GET** /api/model_registry/v1alpha3/model_versions | List All ModelVersions +[**get_registered_model**](ModelRegistryServiceApi.md#get_registered_model) | **GET** /api/model_registry/v1alpha3/registered_models/{registeredmodelId} | Get a RegisteredModel +[**get_registered_model_versions**](ModelRegistryServiceApi.md#get_registered_model_versions) | **GET** /api/model_registry/v1alpha3/registered_models/{registeredmodelId}/versions | List All RegisteredModel's ModelVersions +[**get_registered_models**](ModelRegistryServiceApi.md#get_registered_models) | **GET** /api/model_registry/v1alpha3/registered_models | List All RegisteredModels +[**get_serving_environment**](ModelRegistryServiceApi.md#get_serving_environment) | **GET** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId} | Get a ServingEnvironment +[**get_serving_environments**](ModelRegistryServiceApi.md#get_serving_environments) | **GET** /api/model_registry/v1alpha3/serving_environments | List All ServingEnvironments +[**update_inference_service**](ModelRegistryServiceApi.md#update_inference_service) | **PATCH** /api/model_registry/v1alpha3/inference_services/{inferenceserviceId} | Update a InferenceService +[**update_model_artifact**](ModelRegistryServiceApi.md#update_model_artifact) | **PATCH** /api/model_registry/v1alpha3/model_artifacts/{modelartifactId} | Update a ModelArtifact +[**update_model_version**](ModelRegistryServiceApi.md#update_model_version) | **PATCH** /api/model_registry/v1alpha3/model_versions/{modelversionId} | Update a ModelVersion +[**update_registered_model**](ModelRegistryServiceApi.md#update_registered_model) | **PATCH** /api/model_registry/v1alpha3/registered_models/{registeredmodelId} | Update a RegisteredModel +[**update_serving_environment**](ModelRegistryServiceApi.md#update_serving_environment) | **PATCH** /api/model_registry/v1alpha3/serving_environments/{servingenvironmentId} | Update a ServingEnvironment + + +# **create_environment_inference_service** +> InferenceService create_environment_inference_service(servingenvironment_id, inference_service_create) + +Create a InferenceService in ServingEnvironment + +Creates a new instance of a `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.models.inference_service_create import InferenceServiceCreate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + servingenvironment_id = 'servingenvironment_id_example' # str | A unique identifier for a `ServingEnvironment`. + inference_service_create = mr_openapi.InferenceServiceCreate() # InferenceServiceCreate | A new `InferenceService` to be created. + + try: + # Create a InferenceService in ServingEnvironment + api_response = await api_instance.create_environment_inference_service(servingenvironment_id, inference_service_create) + print("The response of ModelRegistryServiceApi->create_environment_inference_service:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_environment_inference_service: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **servingenvironment_id** | **str**| A unique identifier for a `ServingEnvironment`. | + **inference_service_create** | [**InferenceServiceCreate**](InferenceServiceCreate.md)| A new `InferenceService` to be created. | + +### Return type + +[**InferenceService**](InferenceService.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | A response containing a `InferenceService` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_inference_service** +> InferenceService create_inference_service(inference_service_create) + +Create a InferenceService + +Creates a new instance of a `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.models.inference_service_create import InferenceServiceCreate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + inference_service_create = mr_openapi.InferenceServiceCreate() # InferenceServiceCreate | A new `InferenceService` to be created. + + try: + # Create a InferenceService + api_response = await api_instance.create_inference_service(inference_service_create) + print("The response of ModelRegistryServiceApi->create_inference_service:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_inference_service: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inference_service_create** | [**InferenceServiceCreate**](InferenceServiceCreate.md)| A new `InferenceService` to be created. | + +### Return type + +[**InferenceService**](InferenceService.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `InferenceService` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_inference_service_serve** +> ServeModel create_inference_service_serve(inferenceservice_id, serve_model_create) + +Create a ServeModel action in a InferenceService + +Creates a new instance of a `ServeModel` associated with `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.serve_model import ServeModel +from mr_openapi.models.serve_model_create import ServeModelCreate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + inferenceservice_id = 'inferenceservice_id_example' # str | A unique identifier for a `InferenceService`. + serve_model_create = mr_openapi.ServeModelCreate() # ServeModelCreate | A new `ServeModel` to be associated with the `InferenceService`. + + try: + # Create a ServeModel action in a InferenceService + api_response = await api_instance.create_inference_service_serve(inferenceservice_id, serve_model_create) + print("The response of ModelRegistryServiceApi->create_inference_service_serve:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_inference_service_serve: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inferenceservice_id** | **str**| A unique identifier for a `InferenceService`. | + **serve_model_create** | [**ServeModelCreate**](ServeModelCreate.md)| A new `ServeModel` to be associated with the `InferenceService`. | + +### Return type + +[**ServeModel**](ServeModel.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | A response containing a `ServeModel` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_model_artifact** +> ModelArtifact create_model_artifact(model_artifact_create) + +Create a ModelArtifact + +Creates a new instance of a `ModelArtifact`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_artifact import ModelArtifact +from mr_openapi.models.model_artifact_create import ModelArtifactCreate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + model_artifact_create = mr_openapi.ModelArtifactCreate() # ModelArtifactCreate | A new `ModelArtifact` to be created. + + try: + # Create a ModelArtifact + api_response = await api_instance.create_model_artifact(model_artifact_create) + print("The response of ModelRegistryServiceApi->create_model_artifact:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_model_artifact: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **model_artifact_create** | [**ModelArtifactCreate**](ModelArtifactCreate.md)| A new `ModelArtifact` to be created. | + +### Return type + +[**ModelArtifact**](ModelArtifact.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | A response containing a `ModelArtifact` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_model_version** +> ModelVersion create_model_version(model_version_create) + +Create a ModelVersion + +Creates a new instance of a `ModelVersion`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.models.model_version_create import ModelVersionCreate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + model_version_create = mr_openapi.ModelVersionCreate() # ModelVersionCreate | A new `ModelVersion` to be created. + + try: + # Create a ModelVersion + api_response = await api_instance.create_model_version(model_version_create) + print("The response of ModelRegistryServiceApi->create_model_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_model_version: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **model_version_create** | [**ModelVersionCreate**](ModelVersionCreate.md)| A new `ModelVersion` to be created. | + +### Return type + +[**ModelVersion**](ModelVersion.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | A response containing a `ModelVersion` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_model_version_artifact** +> Artifact create_model_version_artifact(modelversion_id, artifact) + +Create an Artifact in a ModelVersion + +Creates a new instance of an Artifact if needed and associates it with `ModelVersion`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.artifact import Artifact +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + modelversion_id = 'modelversion_id_example' # str | A unique identifier for a `ModelVersion`. + artifact = mr_openapi.Artifact() # Artifact | A new or existing `Artifact` to be associated with the `ModelVersion`. + + try: + # Create an Artifact in a ModelVersion + api_response = await api_instance.create_model_version_artifact(modelversion_id, artifact) + print("The response of ModelRegistryServiceApi->create_model_version_artifact:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_model_version_artifact: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelversion_id** | **str**| A unique identifier for a `ModelVersion`. | + **artifact** | [**Artifact**](Artifact.md)| A new or existing `Artifact` to be associated with the `ModelVersion`. | + +### Return type + +[**Artifact**](Artifact.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing an `Artifact` entity. | - | +**201** | A response containing an `Artifact` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_registered_model** +> RegisteredModel create_registered_model(registered_model_create) + +Create a RegisteredModel + +Creates a new instance of a `RegisteredModel`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.models.registered_model_create import RegisteredModelCreate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + registered_model_create = mr_openapi.RegisteredModelCreate() # RegisteredModelCreate | A new `RegisteredModel` to be created. + + try: + # Create a RegisteredModel + api_response = await api_instance.create_registered_model(registered_model_create) + print("The response of ModelRegistryServiceApi->create_registered_model:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_registered_model: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registered_model_create** | [**RegisteredModelCreate**](RegisteredModelCreate.md)| A new `RegisteredModel` to be created. | + +### Return type + +[**RegisteredModel**](RegisteredModel.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | A response containing a `RegisteredModel` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_registered_model_version** +> ModelVersion create_registered_model_version(registeredmodel_id, model_version) + +Create a ModelVersion in RegisteredModel + +Creates a new instance of a `ModelVersion`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + registeredmodel_id = 'registeredmodel_id_example' # str | A unique identifier for a `RegisteredModel`. + model_version = mr_openapi.ModelVersion() # ModelVersion | A new `ModelVersion` to be created. + + try: + # Create a ModelVersion in RegisteredModel + api_response = await api_instance.create_registered_model_version(registeredmodel_id, model_version) + print("The response of ModelRegistryServiceApi->create_registered_model_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_registered_model_version: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registeredmodel_id** | **str**| A unique identifier for a `RegisteredModel`. | + **model_version** | [**ModelVersion**](ModelVersion.md)| A new `ModelVersion` to be created. | + +### Return type + +[**ModelVersion**](ModelVersion.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | A response containing a `ModelVersion` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **create_serving_environment** +> ServingEnvironment create_serving_environment(serving_environment_create) + +Create a ServingEnvironment + +Creates a new instance of a `ServingEnvironment`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.serving_environment import ServingEnvironment +from mr_openapi.models.serving_environment_create import ServingEnvironmentCreate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + serving_environment_create = mr_openapi.ServingEnvironmentCreate() # ServingEnvironmentCreate | A new `ServingEnvironment` to be created. + + try: + # Create a ServingEnvironment + api_response = await api_instance.create_serving_environment(serving_environment_create) + print("The response of ModelRegistryServiceApi->create_serving_environment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->create_serving_environment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **serving_environment_create** | [**ServingEnvironmentCreate**](ServingEnvironmentCreate.md)| A new `ServingEnvironment` to be created. | + +### Return type + +[**ServingEnvironment**](ServingEnvironment.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | A response containing a `ServingEnvironment` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_inference_service** +> InferenceService find_inference_service(name=name, external_id=external_id, parent_resource_id=parent_resource_id) + +Get an InferenceServices that matches search parameters. + +Gets the details of a single instance of `InferenceService` that matches search parameters. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + parent_resource_id = '10' # str | ID of the parent resource to use for search. (optional) + + try: + # Get an InferenceServices that matches search parameters. + api_response = await api_instance.find_inference_service(name=name, external_id=external_id, parent_resource_id=parent_resource_id) + print("The response of ModelRegistryServiceApi->find_inference_service:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->find_inference_service: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + **parent_resource_id** | **str**| ID of the parent resource to use for search. | [optional] + +### Return type + +[**InferenceService**](InferenceService.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `InferenceService` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_model_artifact** +> ModelArtifact find_model_artifact(name=name, external_id=external_id, parent_resource_id=parent_resource_id) + +Get a ModelArtifact that matches search parameters. + +Gets the details of a single instance of a `ModelArtifact` that matches search parameters. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_artifact import ModelArtifact +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + parent_resource_id = '10' # str | ID of the parent resource to use for search. (optional) + + try: + # Get a ModelArtifact that matches search parameters. + api_response = await api_instance.find_model_artifact(name=name, external_id=external_id, parent_resource_id=parent_resource_id) + print("The response of ModelRegistryServiceApi->find_model_artifact:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->find_model_artifact: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + **parent_resource_id** | **str**| ID of the parent resource to use for search. | [optional] + +### Return type + +[**ModelArtifact**](ModelArtifact.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ModelArtifact` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_model_version** +> ModelVersion find_model_version(name=name, external_id=external_id, parent_resource_id=parent_resource_id) + +Get a ModelVersion that matches search parameters. + +Gets the details of a single instance of a `ModelVersion` that matches search parameters. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + parent_resource_id = '10' # str | ID of the parent resource to use for search. (optional) + + try: + # Get a ModelVersion that matches search parameters. + api_response = await api_instance.find_model_version(name=name, external_id=external_id, parent_resource_id=parent_resource_id) + print("The response of ModelRegistryServiceApi->find_model_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->find_model_version: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + **parent_resource_id** | **str**| ID of the parent resource to use for search. | [optional] + +### Return type + +[**ModelVersion**](ModelVersion.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ModelVersion` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_registered_model** +> RegisteredModel find_registered_model(name=name, external_id=external_id) + +Get a RegisteredModel that matches search parameters. + +Gets the details of a single instance of a `RegisteredModel` that matches search parameters. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + + try: + # Get a RegisteredModel that matches search parameters. + api_response = await api_instance.find_registered_model(name=name, external_id=external_id) + print("The response of ModelRegistryServiceApi->find_registered_model:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->find_registered_model: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + +### Return type + +[**RegisteredModel**](RegisteredModel.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `RegisteredModel` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **find_serving_environment** +> ServingEnvironment find_serving_environment(name=name, external_id=external_id) + +Find ServingEnvironment + +Finds a `ServingEnvironment` entity that matches query parameters. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.serving_environment import ServingEnvironment +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + + try: + # Find ServingEnvironment + api_response = await api_instance.find_serving_environment(name=name, external_id=external_id) + print("The response of ModelRegistryServiceApi->find_serving_environment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->find_serving_environment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + +### Return type + +[**ServingEnvironment**](ServingEnvironment.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ServingEnvironment` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_environment_inference_services** +> InferenceServiceList get_environment_inference_services(servingenvironment_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All ServingEnvironment's InferenceServices + +Gets a list of all `InferenceService` entities for the `ServingEnvironment`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.inference_service_list import InferenceServiceList +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + servingenvironment_id = 'servingenvironment_id_example' # str | A unique identifier for a `ServingEnvironment`. + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All ServingEnvironment's InferenceServices + api_response = await api_instance.get_environment_inference_services(servingenvironment_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_environment_inference_services:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_environment_inference_services: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **servingenvironment_id** | **str**| A unique identifier for a `ServingEnvironment`. | + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**InferenceServiceList**](InferenceServiceList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `InferenceService` entities. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inference_service** +> InferenceService get_inference_service(inferenceservice_id) + +Get a InferenceService + +Gets the details of a single instance of a `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + inferenceservice_id = 'inferenceservice_id_example' # str | A unique identifier for a `InferenceService`. + + try: + # Get a InferenceService + api_response = await api_instance.get_inference_service(inferenceservice_id) + print("The response of ModelRegistryServiceApi->get_inference_service:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_inference_service: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inferenceservice_id** | **str**| A unique identifier for a `InferenceService`. | + +### Return type + +[**InferenceService**](InferenceService.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `InferenceService` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inference_service_model** +> RegisteredModel get_inference_service_model(inferenceservice_id) + +Get InferenceService's RegisteredModel + +Gets the `RegisteredModel` entity for the `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + inferenceservice_id = 'inferenceservice_id_example' # str | A unique identifier for a `InferenceService`. + + try: + # Get InferenceService's RegisteredModel + api_response = await api_instance.get_inference_service_model(inferenceservice_id) + print("The response of ModelRegistryServiceApi->get_inference_service_model:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_inference_service_model: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inferenceservice_id** | **str**| A unique identifier for a `InferenceService`. | + +### Return type + +[**RegisteredModel**](RegisteredModel.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `RegisteredModel` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inference_service_serves** +> ServeModelList get_inference_service_serves(inferenceservice_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All InferenceService's ServeModel actions + +Gets a list of all `ServeModel` entities for the `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.serve_model_list import ServeModelList +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + inferenceservice_id = 'inferenceservice_id_example' # str | A unique identifier for a `InferenceService`. + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All InferenceService's ServeModel actions + api_response = await api_instance.get_inference_service_serves(inferenceservice_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_inference_service_serves:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_inference_service_serves: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inferenceservice_id** | **str**| A unique identifier for a `InferenceService`. | + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**ServeModelList**](ServeModelList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `ServeModel` entities. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inference_service_version** +> ModelVersion get_inference_service_version(inferenceservice_id) + +Get InferenceService's ModelVersion + +Gets the `ModelVersion` entity for the `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + inferenceservice_id = 'inferenceservice_id_example' # str | A unique identifier for a `InferenceService`. + + try: + # Get InferenceService's ModelVersion + api_response = await api_instance.get_inference_service_version(inferenceservice_id) + print("The response of ModelRegistryServiceApi->get_inference_service_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_inference_service_version: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inferenceservice_id** | **str**| A unique identifier for a `InferenceService`. | + +### Return type + +[**ModelVersion**](ModelVersion.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ModelVersion` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_inference_services** +> InferenceServiceList get_inference_services(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All InferenceServices + +Gets a list of all `InferenceService` entities. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.inference_service_list import InferenceServiceList +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All InferenceServices + api_response = await api_instance.get_inference_services(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_inference_services:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_inference_services: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**InferenceServiceList**](InferenceServiceList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `InferenceService` entities. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_model_artifact** +> ModelArtifact get_model_artifact(modelartifact_id) + +Get a ModelArtifact + +Gets the details of a single instance of a `ModelArtifact`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_artifact import ModelArtifact +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + modelartifact_id = 'modelartifact_id_example' # str | A unique identifier for a `ModelArtifact`. + + try: + # Get a ModelArtifact + api_response = await api_instance.get_model_artifact(modelartifact_id) + print("The response of ModelRegistryServiceApi->get_model_artifact:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_model_artifact: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelartifact_id** | **str**| A unique identifier for a `ModelArtifact`. | + +### Return type + +[**ModelArtifact**](ModelArtifact.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ModelArtifact` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_model_artifacts** +> ModelArtifactList get_model_artifacts(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All ModelArtifacts + +Gets a list of all `ModelArtifact` entities. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_artifact_list import ModelArtifactList +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All ModelArtifacts + api_response = await api_instance.get_model_artifacts(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_model_artifacts:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_model_artifacts: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**ModelArtifactList**](ModelArtifactList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of ModelArtifact entities. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_model_version** +> ModelVersion get_model_version(modelversion_id) + +Get a ModelVersion + +Gets the details of a single instance of a `ModelVersion`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + modelversion_id = 'modelversion_id_example' # str | A unique identifier for a `ModelVersion`. + + try: + # Get a ModelVersion + api_response = await api_instance.get_model_version(modelversion_id) + print("The response of ModelRegistryServiceApi->get_model_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_model_version: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelversion_id** | **str**| A unique identifier for a `ModelVersion`. | + +### Return type + +[**ModelVersion**](ModelVersion.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ModelVersion` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_model_version_artifacts** +> ArtifactList get_model_version_artifacts(modelversion_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List all artifacts associated with the `ModelVersion` + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.artifact_list import ArtifactList +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + modelversion_id = 'modelversion_id_example' # str | A unique identifier for a `ModelVersion`. + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List all artifacts associated with the `ModelVersion` + api_response = await api_instance.get_model_version_artifacts(modelversion_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_model_version_artifacts:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_model_version_artifacts: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelversion_id** | **str**| A unique identifier for a `ModelVersion`. | + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**ArtifactList**](ArtifactList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `Artifact` entities. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_model_versions** +> ModelVersionList get_model_versions(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All ModelVersions + +Gets a list of all `ModelVersion` entities. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version_list import ModelVersionList +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All ModelVersions + api_response = await api_instance.get_model_versions(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_model_versions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_model_versions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**ModelVersionList**](ModelVersionList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `ModelVersion` entities. | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_registered_model** +> RegisteredModel get_registered_model(registeredmodel_id) + +Get a RegisteredModel + +Gets the details of a single instance of a `RegisteredModel`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + registeredmodel_id = 'registeredmodel_id_example' # str | A unique identifier for a `RegisteredModel`. + + try: + # Get a RegisteredModel + api_response = await api_instance.get_registered_model(registeredmodel_id) + print("The response of ModelRegistryServiceApi->get_registered_model:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_registered_model: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registeredmodel_id** | **str**| A unique identifier for a `RegisteredModel`. | + +### Return type + +[**RegisteredModel**](RegisteredModel.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `RegisteredModel` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_registered_model_versions** +> ModelVersionList get_registered_model_versions(registeredmodel_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All RegisteredModel's ModelVersions + +Gets a list of all `ModelVersion` entities for the `RegisteredModel`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version_list import ModelVersionList +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + registeredmodel_id = 'registeredmodel_id_example' # str | A unique identifier for a `RegisteredModel`. + name = 'entity-name' # str | Name of entity to search. (optional) + external_id = '10' # str | External ID of entity to search. (optional) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All RegisteredModel's ModelVersions + api_response = await api_instance.get_registered_model_versions(registeredmodel_id, name=name, external_id=external_id, page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_registered_model_versions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_registered_model_versions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registeredmodel_id** | **str**| A unique identifier for a `RegisteredModel`. | + **name** | **str**| Name of entity to search. | [optional] + **external_id** | **str**| External ID of entity to search. | [optional] + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**ModelVersionList**](ModelVersionList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `ModelVersion` entities. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_registered_models** +> RegisteredModelList get_registered_models(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All RegisteredModels + +Gets a list of all `RegisteredModel` entities. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.registered_model_list import RegisteredModelList +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All RegisteredModels + api_response = await api_instance.get_registered_models(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_registered_models:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_registered_models: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**RegisteredModelList**](RegisteredModelList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `RegisteredModel` entities. | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_serving_environment** +> ServingEnvironment get_serving_environment(servingenvironment_id) + +Get a ServingEnvironment + +Gets the details of a single instance of a `ServingEnvironment`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.serving_environment import ServingEnvironment +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + servingenvironment_id = 'servingenvironment_id_example' # str | A unique identifier for a `ServingEnvironment`. + + try: + # Get a ServingEnvironment + api_response = await api_instance.get_serving_environment(servingenvironment_id) + print("The response of ModelRegistryServiceApi->get_serving_environment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_serving_environment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **servingenvironment_id** | **str**| A unique identifier for a `ServingEnvironment`. | + +### Return type + +[**ServingEnvironment**](ServingEnvironment.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ServingEnvironment` entity. | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_serving_environments** +> ServingEnvironmentList get_serving_environments(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + +List All ServingEnvironments + +Gets a list of all `ServingEnvironment` entities. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.serving_environment_list import ServingEnvironmentList +from mr_openapi.models.sort_order import SortOrder +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + page_size = '100' # str | Number of entities in each page. (optional) + order_by = mr_openapi.OrderByField() # OrderByField | Specifies the order by criteria for listing entities. (optional) + sort_order = mr_openapi.SortOrder() # SortOrder | Specifies the sort order for listing entities, defaults to ASC. (optional) + next_page_token = 'IkhlbGxvLCB3b3JsZC4i' # str | Token to use to retrieve next page of results. (optional) + + try: + # List All ServingEnvironments + api_response = await api_instance.get_serving_environments(page_size=page_size, order_by=order_by, sort_order=sort_order, next_page_token=next_page_token) + print("The response of ModelRegistryServiceApi->get_serving_environments:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->get_serving_environments: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **page_size** | **str**| Number of entities in each page. | [optional] + **order_by** | [**OrderByField**](.md)| Specifies the order by criteria for listing entities. | [optional] + **sort_order** | [**SortOrder**](.md)| Specifies the sort order for listing entities, defaults to ASC. | [optional] + **next_page_token** | **str**| Token to use to retrieve next page of results. | [optional] + +### Return type + +[**ServingEnvironmentList**](ServingEnvironmentList.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a list of `ServingEnvironment` entities. | - | +**401** | Unauthorized | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_inference_service** +> InferenceService update_inference_service(inferenceservice_id, inference_service_update) + +Update a InferenceService + +Updates an existing `InferenceService`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.models.inference_service_update import InferenceServiceUpdate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + inferenceservice_id = 'inferenceservice_id_example' # str | A unique identifier for a `InferenceService`. + inference_service_update = mr_openapi.InferenceServiceUpdate() # InferenceServiceUpdate | Updated `InferenceService` information. + + try: + # Update a InferenceService + api_response = await api_instance.update_inference_service(inferenceservice_id, inference_service_update) + print("The response of ModelRegistryServiceApi->update_inference_service:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->update_inference_service: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **inferenceservice_id** | **str**| A unique identifier for a `InferenceService`. | + **inference_service_update** | [**InferenceServiceUpdate**](InferenceServiceUpdate.md)| Updated `InferenceService` information. | + +### Return type + +[**InferenceService**](InferenceService.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `InferenceService` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_model_artifact** +> ModelArtifact update_model_artifact(modelartifact_id, model_artifact_update) + +Update a ModelArtifact + +Updates an existing `ModelArtifact`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_artifact import ModelArtifact +from mr_openapi.models.model_artifact_update import ModelArtifactUpdate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + modelartifact_id = 'modelartifact_id_example' # str | A unique identifier for a `ModelArtifact`. + model_artifact_update = mr_openapi.ModelArtifactUpdate() # ModelArtifactUpdate | Updated `ModelArtifact` information. + + try: + # Update a ModelArtifact + api_response = await api_instance.update_model_artifact(modelartifact_id, model_artifact_update) + print("The response of ModelRegistryServiceApi->update_model_artifact:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->update_model_artifact: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelartifact_id** | **str**| A unique identifier for a `ModelArtifact`. | + **model_artifact_update** | [**ModelArtifactUpdate**](ModelArtifactUpdate.md)| Updated `ModelArtifact` information. | + +### Return type + +[**ModelArtifact**](ModelArtifact.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ModelArtifact` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_model_version** +> ModelVersion update_model_version(modelversion_id, model_version_update) + +Update a ModelVersion + +Updates an existing `ModelVersion`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.models.model_version_update import ModelVersionUpdate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + modelversion_id = 'modelversion_id_example' # str | A unique identifier for a `ModelVersion`. + model_version_update = mr_openapi.ModelVersionUpdate() # ModelVersionUpdate | Updated `ModelVersion` information. + + try: + # Update a ModelVersion + api_response = await api_instance.update_model_version(modelversion_id, model_version_update) + print("The response of ModelRegistryServiceApi->update_model_version:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->update_model_version: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **modelversion_id** | **str**| A unique identifier for a `ModelVersion`. | + **model_version_update** | [**ModelVersionUpdate**](ModelVersionUpdate.md)| Updated `ModelVersion` information. | + +### Return type + +[**ModelVersion**](ModelVersion.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ModelVersion` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_registered_model** +> RegisteredModel update_registered_model(registeredmodel_id, registered_model_update) + +Update a RegisteredModel + +Updates an existing `RegisteredModel`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.models.registered_model_update import RegisteredModelUpdate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + registeredmodel_id = 'registeredmodel_id_example' # str | A unique identifier for a `RegisteredModel`. + registered_model_update = mr_openapi.RegisteredModelUpdate() # RegisteredModelUpdate | Updated `RegisteredModel` information. + + try: + # Update a RegisteredModel + api_response = await api_instance.update_registered_model(registeredmodel_id, registered_model_update) + print("The response of ModelRegistryServiceApi->update_registered_model:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->update_registered_model: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **registeredmodel_id** | **str**| A unique identifier for a `RegisteredModel`. | + **registered_model_update** | [**RegisteredModelUpdate**](RegisteredModelUpdate.md)| Updated `RegisteredModel` information. | + +### Return type + +[**RegisteredModel**](RegisteredModel.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `RegisteredModel` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **update_serving_environment** +> ServingEnvironment update_serving_environment(servingenvironment_id, serving_environment_update) + +Update a ServingEnvironment + +Updates an existing `ServingEnvironment`. + +### Example + +* Bearer (JWT) Authentication (Bearer): + +```python +import mr_openapi +from mr_openapi.models.serving_environment import ServingEnvironment +from mr_openapi.models.serving_environment_update import ServingEnvironmentUpdate +from mr_openapi.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://localhost:8080 +# See configuration.py for a list of all supported configuration parameters. +configuration = mr_openapi.Configuration( + host = "https://localhost:8080" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): Bearer +configuration = mr_openapi.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +async with mr_openapi.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = mr_openapi.ModelRegistryServiceApi(api_client) + servingenvironment_id = 'servingenvironment_id_example' # str | A unique identifier for a `ServingEnvironment`. + serving_environment_update = mr_openapi.ServingEnvironmentUpdate() # ServingEnvironmentUpdate | Updated `ServingEnvironment` information. + + try: + # Update a ServingEnvironment + api_response = await api_instance.update_serving_environment(servingenvironment_id, serving_environment_update) + print("The response of ModelRegistryServiceApi->update_serving_environment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ModelRegistryServiceApi->update_serving_environment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **servingenvironment_id** | **str**| A unique identifier for a `ServingEnvironment`. | + **serving_environment_update** | [**ServingEnvironmentUpdate**](ServingEnvironmentUpdate.md)| Updated `ServingEnvironment` information. | + +### Return type + +[**ServingEnvironment**](ServingEnvironment.md) + +### Authorization + +[Bearer](../README.md#Bearer) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | A response containing a `ServingEnvironment` entity. | - | +**400** | Bad Request parameters | - | +**401** | Unauthorized | - | +**404** | The specified resource was not found | - | +**500** | Unexpected internal server error | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/clients/python/src/mr_openapi/docs/ModelVersion.md b/clients/python/src/mr_openapi/docs/ModelVersion.md new file mode 100644 index 000000000..71995e114 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelVersion.md @@ -0,0 +1,39 @@ +# ModelVersion + +Represents a ModelVersion belonging to a RegisteredModel. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**state** | [**ModelVersionState**](ModelVersionState.md) | | [optional] +**author** | **str** | Name of the author. | [optional] +**registered_model_id** | **str** | ID of the `RegisteredModel` to which this version belongs. | +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] + +## Example + +```python +from mr_openapi.models.model_version import ModelVersion + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelVersion from a JSON string +model_version_instance = ModelVersion.from_json(json) +# print the JSON string representation of the object +print(ModelVersion.to_json()) + +# convert the object into a dict +model_version_dict = model_version_instance.to_dict() +# create an instance of ModelVersion from a dict +model_version_from_dict = ModelVersion.from_dict(model_version_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/clients/python/src/mr_openapi/docs/ModelVersionCreate.md b/clients/python/src/mr_openapi/docs/ModelVersionCreate.md new file mode 100644 index 000000000..18e6adc52 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelVersionCreate.md @@ -0,0 +1,36 @@ +# ModelVersionCreate + +Represents a ModelVersion belonging to a RegisteredModel. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**state** | [**ModelVersionState**](ModelVersionState.md) | | [optional] +**author** | **str** | Name of the author. | [optional] +**registered_model_id** | **str** | ID of the `RegisteredModel` to which this version belongs. | + +## Example + +```python +from mr_openapi.models.model_version_create import ModelVersionCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelVersionCreate from a JSON string +model_version_create_instance = ModelVersionCreate.from_json(json) +# print the JSON string representation of the object +print(ModelVersionCreate.to_json()) + +# convert the object into a dict +model_version_create_dict = model_version_create_instance.to_dict() +# create an instance of ModelVersionCreate from a dict +model_version_create_from_dict = ModelVersionCreate.from_dict(model_version_create_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/clients/python/src/mr_openapi/docs/ModelVersionList.md b/clients/python/src/mr_openapi/docs/ModelVersionList.md new file mode 100644 index 000000000..4b09362d4 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelVersionList.md @@ -0,0 +1,33 @@ +# ModelVersionList + +List of ModelVersion entities. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | +**items** | [**List[ModelVersion]**](ModelVersion.md) | Array of `ModelVersion` entities. | [optional] + +## Example + +```python +from mr_openapi.models.model_version_list import ModelVersionList + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelVersionList from a JSON string +model_version_list_instance = ModelVersionList.from_json(json) +# print the JSON string representation of the object +print(ModelVersionList.to_json()) + +# convert the object into a dict +model_version_list_dict = model_version_list_instance.to_dict() +# create an instance of ModelVersionList from a dict +model_version_list_from_dict = ModelVersionList.from_dict(model_version_list_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/clients/python/src/mr_openapi/docs/ModelVersionState.md b/clients/python/src/mr_openapi/docs/ModelVersionState.md new file mode 100644 index 000000000..0686f4809 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelVersionState.md @@ -0,0 +1,12 @@ +# ModelVersionState + +- LIVE: A state indicating that the `ModelVersion` exists - ARCHIVED: A state indicating that the `ModelVersion` has been archived. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/clients/python/src/mr_openapi/docs/ModelVersionUpdate.md b/clients/python/src/mr_openapi/docs/ModelVersionUpdate.md new file mode 100644 index 000000000..6b52b668d --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ModelVersionUpdate.md @@ -0,0 +1,34 @@ +# ModelVersionUpdate + +Represents a ModelVersion belonging to a RegisteredModel. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**state** | [**ModelVersionState**](ModelVersionState.md) | | [optional] +**author** | **str** | Name of the author. | [optional] + +## Example + +```python +from mr_openapi.models.model_version_update import ModelVersionUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ModelVersionUpdate from a JSON string +model_version_update_instance = ModelVersionUpdate.from_json(json) +# print the JSON string representation of the object +print(ModelVersionUpdate.to_json()) + +# convert the object into a dict +model_version_update_dict = model_version_update_instance.to_dict() +# create an instance of ModelVersionUpdate from a dict +model_version_update_from_dict = ModelVersionUpdate.from_dict(model_version_update_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/clients/python/src/mr_openapi/docs/OrderByField.md b/clients/python/src/mr_openapi/docs/OrderByField.md new file mode 100644 index 000000000..00620847f --- /dev/null +++ b/clients/python/src/mr_openapi/docs/OrderByField.md @@ -0,0 +1,12 @@ +# OrderByField + +Supported fields for ordering result entities. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/clients/python/src/mr_openapi/docs/RegisteredModel.md b/clients/python/src/mr_openapi/docs/RegisteredModel.md new file mode 100644 index 000000000..d66b1fbd0 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/RegisteredModel.md @@ -0,0 +1,38 @@ +# RegisteredModel + +A registered model in model registry. A registered model has ModelVersion children. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] +**owner** | **str** | | [optional] +**state** | [**RegisteredModelState**](RegisteredModelState.md) | | [optional] + +## Example + +```python +from mr_openapi.models.registered_model import RegisteredModel + +# TODO update the JSON string below +json = "{}" +# create an instance of RegisteredModel from a JSON string +registered_model_instance = RegisteredModel.from_json(json) +# print the JSON string representation of the object +print(RegisteredModel.to_json()) + +# convert the object into a dict +registered_model_dict = registered_model_instance.to_dict() +# create an instance of RegisteredModel from a dict +registered_model_from_dict = RegisteredModel.from_dict(registered_model_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/clients/python/src/mr_openapi/docs/RegisteredModelCreate.md b/clients/python/src/mr_openapi/docs/RegisteredModelCreate.md new file mode 100644 index 000000000..0002e3207 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/RegisteredModelCreate.md @@ -0,0 +1,35 @@ +# RegisteredModelCreate + +A registered model in model registry. A registered model has ModelVersion children. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**owner** | **str** | | [optional] +**state** | [**RegisteredModelState**](RegisteredModelState.md) | | [optional] + +## Example + +```python +from mr_openapi.models.registered_model_create import RegisteredModelCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of RegisteredModelCreate from a JSON string +registered_model_create_instance = RegisteredModelCreate.from_json(json) +# print the JSON string representation of the object +print(RegisteredModelCreate.to_json()) + +# convert the object into a dict +registered_model_create_dict = registered_model_create_instance.to_dict() +# create an instance of RegisteredModelCreate from a dict +registered_model_create_from_dict = RegisteredModelCreate.from_dict(registered_model_create_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/clients/python/src/mr_openapi/docs/RegisteredModelList.md b/clients/python/src/mr_openapi/docs/RegisteredModelList.md new file mode 100644 index 000000000..d29840b12 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/RegisteredModelList.md @@ -0,0 +1,33 @@ +# RegisteredModelList + +List of RegisteredModels. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | +**items** | [**List[RegisteredModel]**](RegisteredModel.md) | | [optional] + +## Example + +```python +from mr_openapi.models.registered_model_list import RegisteredModelList + +# TODO update the JSON string below +json = "{}" +# create an instance of RegisteredModelList from a JSON string +registered_model_list_instance = RegisteredModelList.from_json(json) +# print the JSON string representation of the object +print(RegisteredModelList.to_json()) + +# convert the object into a dict +registered_model_list_dict = registered_model_list_instance.to_dict() +# create an instance of RegisteredModelList from a dict +registered_model_list_from_dict = RegisteredModelList.from_dict(registered_model_list_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/clients/python/src/mr_openapi/docs/RegisteredModelState.md b/clients/python/src/mr_openapi/docs/RegisteredModelState.md new file mode 100644 index 000000000..77ed5c6ca --- /dev/null +++ b/clients/python/src/mr_openapi/docs/RegisteredModelState.md @@ -0,0 +1,12 @@ +# RegisteredModelState + +- LIVE: A state indicating that the `RegisteredModel` exists - ARCHIVED: A state indicating that the `RegisteredModel` has been archived. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/clients/python/src/mr_openapi/docs/RegisteredModelUpdate.md b/clients/python/src/mr_openapi/docs/RegisteredModelUpdate.md new file mode 100644 index 000000000..b6987971b --- /dev/null +++ b/clients/python/src/mr_openapi/docs/RegisteredModelUpdate.md @@ -0,0 +1,34 @@ +# RegisteredModelUpdate + +A registered model in model registry. A registered model has ModelVersion children. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**owner** | **str** | | [optional] +**state** | [**RegisteredModelState**](RegisteredModelState.md) | | [optional] + +## Example + +```python +from mr_openapi.models.registered_model_update import RegisteredModelUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of RegisteredModelUpdate from a JSON string +registered_model_update_instance = RegisteredModelUpdate.from_json(json) +# print the JSON string representation of the object +print(RegisteredModelUpdate.to_json()) + +# convert the object into a dict +registered_model_update_dict = registered_model_update_instance.to_dict() +# create an instance of RegisteredModelUpdate from a dict +registered_model_update_from_dict = RegisteredModelUpdate.from_dict(registered_model_update_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/clients/python/src/mr_openapi/docs/ServeModel.md b/clients/python/src/mr_openapi/docs/ServeModel.md new file mode 100644 index 000000000..a8268842c --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServeModel.md @@ -0,0 +1,38 @@ +# ServeModel + +An ML model serving action. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_known_state** | [**ExecutionState**](ExecutionState.md) | | [optional] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] +**model_version_id** | **str** | ID of the `ModelVersion` that was served in `InferenceService`. | + +## Example + +```python +from mr_openapi.models.serve_model import ServeModel + +# TODO update the JSON string below +json = "{}" +# create an instance of ServeModel from a JSON string +serve_model_instance = ServeModel.from_json(json) +# print the JSON string representation of the object +print(ServeModel.to_json()) + +# convert the object into a dict +serve_model_dict = serve_model_instance.to_dict() +# create an instance of ServeModel from a dict +serve_model_from_dict = ServeModel.from_dict(serve_model_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/clients/python/src/mr_openapi/docs/ServeModelCreate.md b/clients/python/src/mr_openapi/docs/ServeModelCreate.md new file mode 100644 index 000000000..bca344286 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServeModelCreate.md @@ -0,0 +1,35 @@ +# ServeModelCreate + +An ML model serving action. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_known_state** | [**ExecutionState**](ExecutionState.md) | | [optional] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**model_version_id** | **str** | ID of the `ModelVersion` that was served in `InferenceService`. | + +## Example + +```python +from mr_openapi.models.serve_model_create import ServeModelCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of ServeModelCreate from a JSON string +serve_model_create_instance = ServeModelCreate.from_json(json) +# print the JSON string representation of the object +print(ServeModelCreate.to_json()) + +# convert the object into a dict +serve_model_create_dict = serve_model_create_instance.to_dict() +# create an instance of ServeModelCreate from a dict +serve_model_create_from_dict = ServeModelCreate.from_dict(serve_model_create_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/clients/python/src/mr_openapi/docs/ServeModelList.md b/clients/python/src/mr_openapi/docs/ServeModelList.md new file mode 100644 index 000000000..8cc651063 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServeModelList.md @@ -0,0 +1,33 @@ +# ServeModelList + +List of ServeModel entities. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | +**items** | [**List[ServeModel]**](ServeModel.md) | Array of `ModelArtifact` entities. | [optional] + +## Example + +```python +from mr_openapi.models.serve_model_list import ServeModelList + +# TODO update the JSON string below +json = "{}" +# create an instance of ServeModelList from a JSON string +serve_model_list_instance = ServeModelList.from_json(json) +# print the JSON string representation of the object +print(ServeModelList.to_json()) + +# convert the object into a dict +serve_model_list_dict = serve_model_list_instance.to_dict() +# create an instance of ServeModelList from a dict +serve_model_list_from_dict = ServeModelList.from_dict(serve_model_list_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/clients/python/src/mr_openapi/docs/ServeModelUpdate.md b/clients/python/src/mr_openapi/docs/ServeModelUpdate.md new file mode 100644 index 000000000..6a80a919f --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServeModelUpdate.md @@ -0,0 +1,33 @@ +# ServeModelUpdate + +An ML model serving action. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**last_known_state** | [**ExecutionState**](ExecutionState.md) | | [optional] +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] + +## Example + +```python +from mr_openapi.models.serve_model_update import ServeModelUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ServeModelUpdate from a JSON string +serve_model_update_instance = ServeModelUpdate.from_json(json) +# print the JSON string representation of the object +print(ServeModelUpdate.to_json()) + +# convert the object into a dict +serve_model_update_dict = serve_model_update_instance.to_dict() +# create an instance of ServeModelUpdate from a dict +serve_model_update_from_dict = ServeModelUpdate.from_dict(serve_model_update_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/clients/python/src/mr_openapi/docs/ServingEnvironment.md b/clients/python/src/mr_openapi/docs/ServingEnvironment.md new file mode 100644 index 000000000..f7ea335ed --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServingEnvironment.md @@ -0,0 +1,36 @@ +# ServingEnvironment + +A Model Serving environment for serving `RegisteredModels`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] +**id** | **str** | Output only. The unique server generated id of the resource. | [optional] [readonly] +**create_time_since_epoch** | **str** | Output only. Create time of the resource in millisecond since epoch. | [optional] [readonly] +**last_update_time_since_epoch** | **str** | Output only. Last update time of the resource since epoch in millisecond since epoch. | [optional] [readonly] + +## Example + +```python +from mr_openapi.models.serving_environment import ServingEnvironment + +# TODO update the JSON string below +json = "{}" +# create an instance of ServingEnvironment from a JSON string +serving_environment_instance = ServingEnvironment.from_json(json) +# print the JSON string representation of the object +print(ServingEnvironment.to_json()) + +# convert the object into a dict +serving_environment_dict = serving_environment_instance.to_dict() +# create an instance of ServingEnvironment from a dict +serving_environment_from_dict = ServingEnvironment.from_dict(serving_environment_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/clients/python/src/mr_openapi/docs/ServingEnvironmentCreate.md b/clients/python/src/mr_openapi/docs/ServingEnvironmentCreate.md new file mode 100644 index 000000000..afaaf1342 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServingEnvironmentCreate.md @@ -0,0 +1,33 @@ +# ServingEnvironmentCreate + +A Model Serving environment for serving `RegisteredModels`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] +**name** | **str** | The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set. | [optional] + +## Example + +```python +from mr_openapi.models.serving_environment_create import ServingEnvironmentCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of ServingEnvironmentCreate from a JSON string +serving_environment_create_instance = ServingEnvironmentCreate.from_json(json) +# print the JSON string representation of the object +print(ServingEnvironmentCreate.to_json()) + +# convert the object into a dict +serving_environment_create_dict = serving_environment_create_instance.to_dict() +# create an instance of ServingEnvironmentCreate from a dict +serving_environment_create_from_dict = ServingEnvironmentCreate.from_dict(serving_environment_create_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/clients/python/src/mr_openapi/docs/ServingEnvironmentList.md b/clients/python/src/mr_openapi/docs/ServingEnvironmentList.md new file mode 100644 index 000000000..43e6e1363 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServingEnvironmentList.md @@ -0,0 +1,33 @@ +# ServingEnvironmentList + +List of ServingEnvironments. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next_page_token** | **str** | Token to use to retrieve next page of results. | +**page_size** | **int** | Maximum number of resources to return in the result. | +**size** | **int** | Number of items in result list. | +**items** | [**List[ServingEnvironment]**](ServingEnvironment.md) | | [optional] + +## Example + +```python +from mr_openapi.models.serving_environment_list import ServingEnvironmentList + +# TODO update the JSON string below +json = "{}" +# create an instance of ServingEnvironmentList from a JSON string +serving_environment_list_instance = ServingEnvironmentList.from_json(json) +# print the JSON string representation of the object +print(ServingEnvironmentList.to_json()) + +# convert the object into a dict +serving_environment_list_dict = serving_environment_list_instance.to_dict() +# create an instance of ServingEnvironmentList from a dict +serving_environment_list_from_dict = ServingEnvironmentList.from_dict(serving_environment_list_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/clients/python/src/mr_openapi/docs/ServingEnvironmentUpdate.md b/clients/python/src/mr_openapi/docs/ServingEnvironmentUpdate.md new file mode 100644 index 000000000..1dac7bd18 --- /dev/null +++ b/clients/python/src/mr_openapi/docs/ServingEnvironmentUpdate.md @@ -0,0 +1,32 @@ +# ServingEnvironmentUpdate + +A Model Serving environment for serving `RegisteredModels`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**custom_properties** | [**Dict[str, MetadataValue]**](MetadataValue.md) | User provided custom properties which are not defined by its type. | [optional] +**description** | **str** | An optional description about the resource. | [optional] +**external_id** | **str** | The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance. | [optional] + +## Example + +```python +from mr_openapi.models.serving_environment_update import ServingEnvironmentUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ServingEnvironmentUpdate from a JSON string +serving_environment_update_instance = ServingEnvironmentUpdate.from_json(json) +# print the JSON string representation of the object +print(ServingEnvironmentUpdate.to_json()) + +# convert the object into a dict +serving_environment_update_dict = serving_environment_update_instance.to_dict() +# create an instance of ServingEnvironmentUpdate from a dict +serving_environment_update_from_dict = ServingEnvironmentUpdate.from_dict(serving_environment_update_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/clients/python/src/mr_openapi/docs/SortOrder.md b/clients/python/src/mr_openapi/docs/SortOrder.md new file mode 100644 index 000000000..2793df4cb --- /dev/null +++ b/clients/python/src/mr_openapi/docs/SortOrder.md @@ -0,0 +1,12 @@ +# SortOrder + +Supported sort direction for ordering result entities. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/clients/python/src/mr_openapi/exceptions.py b/clients/python/src/mr_openapi/exceptions.py new file mode 100644 index 000000000..9a3f720ab --- /dev/null +++ b/clients/python/src/mr_openapi/exceptions.py @@ -0,0 +1,190 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import contextlib +from typing import Any, Optional + +from typing_extensions import Self + + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions.""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> None: + """Raises an exception for TypeErrors. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = f"{msg} at {render_path(path_to_item)}" + super().__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """Args: + msg (str): the exception message. + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = f"{msg} at {render_path(path_to_item)}" + super().__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = f"{msg} at {render_path(path_to_item)}" + super().__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """Args: + msg (str): the exception message. + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = f"{msg} at {render_path(path_to_item)}" + super().__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + with contextlib.suppress(Exception): + self.body = http_resp.data.decode("utf-8") + self.headers = http_resp.getheaders() + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(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) + + def __str__(self): + """Custom error messages for exception.""" + error_message = f"({self.status})\n" f"Reason: {self.reason}\n" + if self.headers: + error_message += f"HTTP response headers: {self.headers}\n" + + if self.data or self.body: + error_message += f"HTTP response body: {self.data or self.body}\n" + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +def render_path(path_to_item): + """Returns a string representation of a path.""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += f"[{pth}]" + else: + result += f"['{pth}']" + return result diff --git a/clients/python/src/mr_openapi/models/__init__.py b/clients/python/src/mr_openapi/models/__init__.py new file mode 100644 index 000000000..ceb6da35f --- /dev/null +++ b/clients/python/src/mr_openapi/models/__init__.py @@ -0,0 +1,68 @@ +# coding: utf-8 + +# flake8: noqa +""" + Model Registry REST API + + REST API for Model Registry to create and manage ML model metadata + + The version of the OpenAPI document: v1alpha3 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from mr_openapi.models.artifact import Artifact +from mr_openapi.models.artifact_list import ArtifactList +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.base_artifact import BaseArtifact +from mr_openapi.models.base_artifact_create import BaseArtifactCreate +from mr_openapi.models.base_artifact_update import BaseArtifactUpdate +from mr_openapi.models.base_execution import BaseExecution +from mr_openapi.models.base_execution_create import BaseExecutionCreate +from mr_openapi.models.base_execution_update import BaseExecutionUpdate +from mr_openapi.models.base_resource import BaseResource +from mr_openapi.models.base_resource_create import BaseResourceCreate +from mr_openapi.models.base_resource_list import BaseResourceList +from mr_openapi.models.base_resource_update import BaseResourceUpdate +from mr_openapi.models.doc_artifact import DocArtifact +from mr_openapi.models.error import Error +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.inference_service import InferenceService +from mr_openapi.models.inference_service_create import InferenceServiceCreate +from mr_openapi.models.inference_service_list import InferenceServiceList +from mr_openapi.models.inference_service_state import InferenceServiceState +from mr_openapi.models.inference_service_update import InferenceServiceUpdate +from mr_openapi.models.metadata_bool_value import MetadataBoolValue +from mr_openapi.models.metadata_double_value import MetadataDoubleValue +from mr_openapi.models.metadata_int_value import MetadataIntValue +from mr_openapi.models.metadata_proto_value import MetadataProtoValue +from mr_openapi.models.metadata_string_value import MetadataStringValue +from mr_openapi.models.metadata_struct_value import MetadataStructValue +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.model_artifact import ModelArtifact +from mr_openapi.models.model_artifact_create import ModelArtifactCreate +from mr_openapi.models.model_artifact_list import ModelArtifactList +from mr_openapi.models.model_artifact_update import ModelArtifactUpdate +from mr_openapi.models.model_version import ModelVersion +from mr_openapi.models.model_version_create import ModelVersionCreate +from mr_openapi.models.model_version_list import ModelVersionList +from mr_openapi.models.model_version_state import ModelVersionState +from mr_openapi.models.model_version_update import ModelVersionUpdate +from mr_openapi.models.order_by_field import OrderByField +from mr_openapi.models.registered_model import RegisteredModel +from mr_openapi.models.registered_model_create import RegisteredModelCreate +from mr_openapi.models.registered_model_list import RegisteredModelList +from mr_openapi.models.registered_model_state import RegisteredModelState +from mr_openapi.models.registered_model_update import RegisteredModelUpdate +from mr_openapi.models.serve_model import ServeModel +from mr_openapi.models.serve_model_create import ServeModelCreate +from mr_openapi.models.serve_model_list import ServeModelList +from mr_openapi.models.serve_model_update import ServeModelUpdate +from mr_openapi.models.serving_environment import ServingEnvironment +from mr_openapi.models.serving_environment_create import ServingEnvironmentCreate +from mr_openapi.models.serving_environment_list import ServingEnvironmentList +from mr_openapi.models.serving_environment_update import ServingEnvironmentUpdate +from mr_openapi.models.sort_order import SortOrder diff --git a/clients/python/src/mr_openapi/models/artifact.py b/clients/python/src/mr_openapi/models/artifact.py new file mode 100644 index 000000000..6e2e79486 --- /dev/null +++ b/clients/python/src/mr_openapi/models/artifact.py @@ -0,0 +1,178 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any + +from pydantic import ( + BaseModel, + ConfigDict, + ValidationError, + field_validator, +) +from typing_extensions import Self + +from mr_openapi.models.doc_artifact import DocArtifact +from mr_openapi.models.model_artifact import ModelArtifact + +ARTIFACT_ONE_OF_SCHEMAS = ["DocArtifact", "ModelArtifact"] + + +class Artifact(BaseModel): + """A metadata Artifact Entity.""" + + # data type: ModelArtifact + oneof_schema_1_validator: ModelArtifact | None = None + # data type: DocArtifact + oneof_schema_2_validator: DocArtifact | None = None + actual_instance: DocArtifact | ModelArtifact | None = None + one_of_schemas: set[str] = {"DocArtifact", "ModelArtifact"} + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + discriminator_value_class_map: dict[str, str] = {} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + msg = "If a position argument is used, only 1 is allowed to set `actual_instance`" + raise ValueError(msg) + if kwargs: + msg = "If a position argument is used, keyword arguments cannot be used." + raise ValueError(msg) + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + Artifact.model_construct() + error_messages = [] + match = 0 + # validate data type: ModelArtifact + if not isinstance(v, ModelArtifact): + error_messages.append(f"Error! Input type `{type(v)}` is not `ModelArtifact`") + else: + match += 1 + # validate data type: DocArtifact + if not isinstance(v, DocArtifact): + error_messages.append(f"Error! Input type `{type(v)}` is not `DocArtifact`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when setting `actual_instance` in Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: str | dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string.""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # use oneOf discriminator to lookup the data type + _data_type = json.loads(json_str).get("artifactType") + if not _data_type: + msg = "Failed to lookup data type from the field `artifactType` in the input." + raise ValueError(msg) + + # check if data type is `DocArtifact` + if _data_type == "doc-artifact": + instance.actual_instance = DocArtifact.from_json(json_str) + return instance + + # check if data type is `ModelArtifact` + if _data_type == "model-artifact": + instance.actual_instance = ModelArtifact.from_json(json_str) + return instance + + # check if data type is `DocArtifact` + if _data_type == "DocArtifact": + instance.actual_instance = DocArtifact.from_json(json_str) + return instance + + # check if data type is `ModelArtifact` + if _data_type == "ModelArtifact": + instance.actual_instance = ModelArtifact.from_json(json_str) + return instance + + # deserialize data into ModelArtifact + try: + instance.actual_instance = ModelArtifact.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DocArtifact + try: + instance.actual_instance = DocArtifact.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into Artifact with oneOf schemas: DocArtifact, ModelArtifact. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance.""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> dict[str, Any] | DocArtifact | ModelArtifact | None: + """Returns the dict representation of the actual instance.""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance.""" + return pprint.pformat(self.model_dump()) diff --git a/clients/python/src/mr_openapi/models/artifact_list.py b/clients/python/src/mr_openapi/models/artifact_list.py new file mode 100644 index 000000000..e0b6221c1 --- /dev/null +++ b/clients/python/src/mr_openapi/models/artifact_list.py @@ -0,0 +1,99 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact import Artifact + + +class ArtifactList(BaseModel): + """A list of Artifact entities.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + items: list[Artifact] | None = Field(default=None, description="Array of `Artifact` entities.") + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ArtifactList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ArtifactList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "nextPageToken": obj.get("nextPageToken"), + "pageSize": obj.get("pageSize"), + "size": obj.get("size"), + "items": ( + [Artifact.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/artifact_state.py b/clients/python/src/mr_openapi/models/artifact_state.py new file mode 100644 index 000000000..c33f08044 --- /dev/null +++ b/clients/python/src/mr_openapi/models/artifact_state.py @@ -0,0 +1,36 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class ArtifactState(str, Enum): + """- PENDING: A state indicating that the artifact may exist. - LIVE: A state indicating that the artifact should exist, unless something external to the system deletes it. - MARKED_FOR_DELETION: A state indicating that the artifact should be deleted. - DELETED: A state indicating that the artifact has been deleted. - ABANDONED: A state indicating that the artifact has been abandoned, which may be due to a failed or cancelled execution. - REFERENCE: A state indicating that the artifact is a reference artifact. At execution start time, the orchestrator produces an output artifact for each output key with state PENDING. However, for an intermediate artifact, this first artifact's state will be REFERENCE. Intermediate artifacts emitted during a component's execution will copy the REFERENCE artifact's attributes. At the end of an execution, the artifact state should remain REFERENCE instead of being changed to LIVE. See also: ml-metadata Artifact.State.""" + + """ + allowed enum values + """ + UNKNOWN = "UNKNOWN" + PENDING = "PENDING" + LIVE = "LIVE" + MARKED_FOR_DELETION = "MARKED_FOR_DELETION" + DELETED = "DELETED" + ABANDONED = "ABANDONED" + REFERENCE = "REFERENCE" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ArtifactState from a JSON string.""" + return cls(json.loads(json_str)) diff --git a/clients/python/src/mr_openapi/models/base_artifact.py b/clients/python/src/mr_openapi/models/base_artifact.py new file mode 100644 index 000000000..83d7aa3dd --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_artifact.py @@ -0,0 +1,151 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseArtifact(BaseModel): + """BaseArtifact.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + uri: StrictStr | None = Field( + default=None, + description="The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.", + ) + state: ArtifactState | None = None + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "uri", + "state", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseArtifact from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseArtifact from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "uri": obj.get("uri"), + "state": obj.get("state"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_artifact_create.py b/clients/python/src/mr_openapi/models/base_artifact_create.py new file mode 100644 index 000000000..40540b0f0 --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_artifact_create.py @@ -0,0 +1,118 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseArtifactCreate(BaseModel): + """BaseArtifactCreate.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + uri: StrictStr | None = Field( + default=None, + description="The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.", + ) + state: ArtifactState | None = None + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "uri", "state", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseArtifactCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseArtifactCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "uri": obj.get("uri"), + "state": obj.get("state"), + "name": obj.get("name"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_artifact_update.py b/clients/python/src/mr_openapi/models/base_artifact_update.py new file mode 100644 index 000000000..08c6b4c2e --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_artifact_update.py @@ -0,0 +1,113 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseArtifactUpdate(BaseModel): + """BaseArtifactUpdate.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + uri: StrictStr | None = Field( + default=None, + description="The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.", + ) + state: ArtifactState | None = None + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "uri", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseArtifactUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseArtifactUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "uri": obj.get("uri"), + "state": obj.get("state"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_execution.py b/clients/python/src/mr_openapi/models/base_execution.py new file mode 100644 index 000000000..f740c19b8 --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_execution.py @@ -0,0 +1,145 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseExecution(BaseModel): + """BaseExecution.""" # noqa: E501 + + last_known_state: ExecutionState | None = Field(default=None, alias="lastKnownState") + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + __properties: ClassVar[list[str]] = [ + "lastKnownState", + "customProperties", + "description", + "externalId", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseExecution from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseExecution from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "lastKnownState": obj.get("lastKnownState"), + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_execution_create.py b/clients/python/src/mr_openapi/models/base_execution_create.py new file mode 100644 index 000000000..3cd70a8a3 --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_execution_create.py @@ -0,0 +1,113 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseExecutionCreate(BaseModel): + """BaseExecutionCreate.""" # noqa: E501 + + last_known_state: ExecutionState | None = Field(default=None, alias="lastKnownState") + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + __properties: ClassVar[list[str]] = ["lastKnownState", "customProperties", "description", "externalId", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseExecutionCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseExecutionCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "lastKnownState": obj.get("lastKnownState"), + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_execution_update.py b/clients/python/src/mr_openapi/models/base_execution_update.py new file mode 100644 index 000000000..bdef49c4b --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_execution_update.py @@ -0,0 +1,108 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseExecutionUpdate(BaseModel): + """BaseExecutionUpdate.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + last_known_state: ExecutionState | None = Field(default=None, alias="lastKnownState") + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "lastKnownState"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseExecutionUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseExecutionUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "lastKnownState": obj.get("lastKnownState"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_resource.py b/clients/python/src/mr_openapi/models/base_resource.py new file mode 100644 index 000000000..ad83a1cd7 --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_resource.py @@ -0,0 +1,141 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseResource(BaseModel): + """BaseResource.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseResource from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseResource from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_resource_create.py b/clients/python/src/mr_openapi/models/base_resource_create.py new file mode 100644 index 000000000..84123a00e --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_resource_create.py @@ -0,0 +1,110 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseResourceCreate(BaseModel): + """BaseResourceCreate.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseResourceCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseResourceCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + } + ) diff --git a/clients/python/src/mr_openapi/models/base_resource_list.py b/clients/python/src/mr_openapi/models/base_resource_list.py new file mode 100644 index 000000000..882ed3ff5 --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_resource_list.py @@ -0,0 +1,81 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + + +class BaseResourceList(BaseModel): + """BaseResourceList.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseResourceList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseResourceList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + {"nextPageToken": obj.get("nextPageToken"), "pageSize": obj.get("pageSize"), "size": obj.get("size")} + ) diff --git a/clients/python/src/mr_openapi/models/base_resource_update.py b/clients/python/src/mr_openapi/models/base_resource_update.py new file mode 100644 index 000000000..b690d8575 --- /dev/null +++ b/clients/python/src/mr_openapi/models/base_resource_update.py @@ -0,0 +1,105 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue + + +class BaseResourceUpdate(BaseModel): + """BaseResourceUpdate.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of BaseResourceUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of BaseResourceUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/doc_artifact.py b/clients/python/src/mr_openapi/models/doc_artifact.py new file mode 100644 index 000000000..b8ef19c0d --- /dev/null +++ b/clients/python/src/mr_openapi/models/doc_artifact.py @@ -0,0 +1,153 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.metadata_value import MetadataValue + + +class DocArtifact(BaseModel): + """A document.""" # noqa: E501 + + artifact_type: StrictStr = Field(alias="artifactType") + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + uri: StrictStr | None = Field( + default=None, + description="The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.", + ) + state: ArtifactState | None = None + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "uri", + "state", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of DocArtifact from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of DocArtifact from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "artifactType": "doc-artifact", + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "uri": obj.get("uri"), + "state": obj.get("state"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + } + ) diff --git a/clients/python/src/mr_openapi/models/error.py b/clients/python/src/mr_openapi/models/error.py new file mode 100644 index 000000000..30258a5a0 --- /dev/null +++ b/clients/python/src/mr_openapi/models/error.py @@ -0,0 +1,76 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class Error(BaseModel): + """Error code and message.""" # noqa: E501 + + code: StrictStr = Field(description="Error code") + message: StrictStr = Field(description="Error message") + __properties: ClassVar[list[str]] = ["code", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of Error from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of Error from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate({"code": obj.get("code"), "message": obj.get("message")}) diff --git a/clients/python/src/mr_openapi/models/execution_state.py b/clients/python/src/mr_openapi/models/execution_state.py new file mode 100644 index 000000000..a492572de --- /dev/null +++ b/clients/python/src/mr_openapi/models/execution_state.py @@ -0,0 +1,36 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class ExecutionState(str, Enum): + """The state of the Execution. The state transitions are NEW -> RUNNING -> COMPLETE | CACHED | FAILED | CANCELED CACHED means the execution is skipped due to cached results. CANCELED means the execution is skipped due to precondition not met. It is different from CACHED in that a CANCELED execution will not have any event associated with it. It is different from FAILED in that there is no unexpected error happened and it is regarded as a normal state. See also: ml-metadata Execution.State.""" + + """ + allowed enum values + """ + UNKNOWN = "UNKNOWN" + NEW = "NEW" + RUNNING = "RUNNING" + COMPLETE = "COMPLETE" + FAILED = "FAILED" + CACHED = "CACHED" + CANCELED = "CANCELED" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ExecutionState from a JSON string.""" + return cls(json.loads(json_str)) diff --git a/clients/python/src/mr_openapi/models/inference_service.py b/clients/python/src/mr_openapi/models/inference_service.py new file mode 100644 index 000000000..b26bd54f9 --- /dev/null +++ b/clients/python/src/mr_openapi/models/inference_service.py @@ -0,0 +1,166 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.inference_service_state import InferenceServiceState +from mr_openapi.models.metadata_value import MetadataValue + + +class InferenceService(BaseModel): + """An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + model_version_id: StrictStr | None = Field( + default=None, + description="ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served.", + alias="modelVersionId", + ) + runtime: StrictStr | None = Field(default=None, description="Model runtime.") + desired_state: InferenceServiceState | None = Field(default=None, alias="desiredState") + registered_model_id: StrictStr = Field( + description="ID of the `RegisteredModel` to serve.", alias="registeredModelId" + ) + serving_environment_id: StrictStr = Field( + description="ID of the parent `ServingEnvironment` for this `InferenceService` entity.", + alias="servingEnvironmentId", + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + "modelVersionId", + "runtime", + "desiredState", + "registeredModelId", + "servingEnvironmentId", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of InferenceService from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of InferenceService from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + "modelVersionId": obj.get("modelVersionId"), + "runtime": obj.get("runtime"), + "desiredState": obj.get("desiredState"), + "registeredModelId": obj.get("registeredModelId"), + "servingEnvironmentId": obj.get("servingEnvironmentId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/inference_service_create.py b/clients/python/src/mr_openapi/models/inference_service_create.py new file mode 100644 index 000000000..7ef1f8332 --- /dev/null +++ b/clients/python/src/mr_openapi/models/inference_service_create.py @@ -0,0 +1,140 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.inference_service_state import InferenceServiceState +from mr_openapi.models.metadata_value import MetadataValue + + +class InferenceServiceCreate(BaseModel): + """An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + model_version_id: StrictStr | None = Field( + default=None, + description="ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served.", + alias="modelVersionId", + ) + runtime: StrictStr | None = Field(default=None, description="Model runtime.") + desired_state: InferenceServiceState | None = Field(default=None, alias="desiredState") + registered_model_id: StrictStr = Field( + description="ID of the `RegisteredModel` to serve.", alias="registeredModelId" + ) + serving_environment_id: StrictStr = Field( + description="ID of the parent `ServingEnvironment` for this `InferenceService` entity.", + alias="servingEnvironmentId", + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "name", + "modelVersionId", + "runtime", + "desiredState", + "registeredModelId", + "servingEnvironmentId", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of InferenceServiceCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of InferenceServiceCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "modelVersionId": obj.get("modelVersionId"), + "runtime": obj.get("runtime"), + "desiredState": obj.get("desiredState"), + "registeredModelId": obj.get("registeredModelId"), + "servingEnvironmentId": obj.get("servingEnvironmentId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/inference_service_list.py b/clients/python/src/mr_openapi/models/inference_service_list.py new file mode 100644 index 000000000..adc5e301f --- /dev/null +++ b/clients/python/src/mr_openapi/models/inference_service_list.py @@ -0,0 +1,101 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + +from mr_openapi.models.inference_service import InferenceService + + +class InferenceServiceList(BaseModel): + """List of InferenceServices.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + items: list[InferenceService] | None = None + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of InferenceServiceList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of InferenceServiceList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "nextPageToken": obj.get("nextPageToken"), + "pageSize": obj.get("pageSize"), + "size": obj.get("size"), + "items": ( + [InferenceService.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/inference_service_state.py b/clients/python/src/mr_openapi/models/inference_service_state.py new file mode 100644 index 000000000..9fbc9ada6 --- /dev/null +++ b/clients/python/src/mr_openapi/models/inference_service_state.py @@ -0,0 +1,31 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class InferenceServiceState(str, Enum): + """- DEPLOYED: A state indicating that the `InferenceService` should be deployed. - UNDEPLOYED: A state indicating that the `InferenceService` should be un-deployed. The state indicates the desired state of inference service. See the associated `ServeModel` for the actual status of service deployment action.""" + + """ + allowed enum values + """ + DEPLOYED = "DEPLOYED" + UNDEPLOYED = "UNDEPLOYED" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of InferenceServiceState from a JSON string.""" + return cls(json.loads(json_str)) diff --git a/clients/python/src/mr_openapi/models/inference_service_update.py b/clients/python/src/mr_openapi/models/inference_service_update.py new file mode 100644 index 000000000..3de9961c7 --- /dev/null +++ b/clients/python/src/mr_openapi/models/inference_service_update.py @@ -0,0 +1,123 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.inference_service_state import InferenceServiceState +from mr_openapi.models.metadata_value import MetadataValue + + +class InferenceServiceUpdate(BaseModel): + """An `InferenceService` entity in a `ServingEnvironment` represents a deployed `ModelVersion` from a `RegisteredModel` created by Model Serving.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + model_version_id: StrictStr | None = Field( + default=None, + description="ID of the `ModelVersion` to serve. If it's unspecified, then the latest `ModelVersion` by creation order will be served.", + alias="modelVersionId", + ) + runtime: StrictStr | None = Field(default=None, description="Model runtime.") + desired_state: InferenceServiceState | None = Field(default=None, alias="desiredState") + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "modelVersionId", + "runtime", + "desiredState", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of InferenceServiceUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of InferenceServiceUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "modelVersionId": obj.get("modelVersionId"), + "runtime": obj.get("runtime"), + "desiredState": obj.get("desiredState"), + } + ) diff --git a/clients/python/src/mr_openapi/models/metadata_bool_value.py b/clients/python/src/mr_openapi/models/metadata_bool_value.py new file mode 100644 index 000000000..4bb55a6f1 --- /dev/null +++ b/clients/python/src/mr_openapi/models/metadata_bool_value.py @@ -0,0 +1,83 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing_extensions import Self + + +class MetadataBoolValue(BaseModel): + """A bool property value.""" # noqa: E501 + + bool_value: StrictBool + metadata_type: StrictStr = Field(alias="metadataType") + __properties: ClassVar[list[str]] = ["bool_value", "metadataType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of MetadataBoolValue from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of MetadataBoolValue from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "bool_value": obj.get("bool_value"), + "metadataType": ( + obj.get("metadataType") if obj.get("metadataType") is not None else "MetadataBoolValue" + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/metadata_double_value.py b/clients/python/src/mr_openapi/models/metadata_double_value.py new file mode 100644 index 000000000..d39d11f09 --- /dev/null +++ b/clients/python/src/mr_openapi/models/metadata_double_value.py @@ -0,0 +1,83 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing_extensions import Self + + +class MetadataDoubleValue(BaseModel): + """A double property value.""" # noqa: E501 + + double_value: StrictFloat | StrictInt + metadata_type: StrictStr = Field(alias="metadataType") + __properties: ClassVar[list[str]] = ["double_value", "metadataType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of MetadataDoubleValue from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of MetadataDoubleValue from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "double_value": obj.get("double_value"), + "metadataType": ( + obj.get("metadataType") if obj.get("metadataType") is not None else "MetadataDoubleValue" + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/metadata_int_value.py b/clients/python/src/mr_openapi/models/metadata_int_value.py new file mode 100644 index 000000000..3b18f5d2d --- /dev/null +++ b/clients/python/src/mr_openapi/models/metadata_int_value.py @@ -0,0 +1,81 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class MetadataIntValue(BaseModel): + """An integer (int64) property value.""" # noqa: E501 + + int_value: StrictStr + metadata_type: StrictStr = Field(alias="metadataType") + __properties: ClassVar[list[str]] = ["int_value", "metadataType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of MetadataIntValue from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of MetadataIntValue from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "int_value": obj.get("int_value"), + "metadataType": obj.get("metadataType") if obj.get("metadataType") is not None else "MetadataIntValue", + } + ) diff --git a/clients/python/src/mr_openapi/models/metadata_proto_value.py b/clients/python/src/mr_openapi/models/metadata_proto_value.py new file mode 100644 index 000000000..7dceb2338 --- /dev/null +++ b/clients/python/src/mr_openapi/models/metadata_proto_value.py @@ -0,0 +1,85 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class MetadataProtoValue(BaseModel): + """A proto property value.""" # noqa: E501 + + type: StrictStr = Field(description="url describing proto value") + proto_value: StrictStr = Field(description="Base64 encoded bytes for proto value") + metadata_type: StrictStr = Field(alias="metadataType") + __properties: ClassVar[list[str]] = ["type", "proto_value", "metadataType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of MetadataProtoValue from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of MetadataProtoValue from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "type": obj.get("type"), + "proto_value": obj.get("proto_value"), + "metadataType": ( + obj.get("metadataType") if obj.get("metadataType") is not None else "MetadataProtoValue" + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/metadata_string_value.py b/clients/python/src/mr_openapi/models/metadata_string_value.py new file mode 100644 index 000000000..49f8df564 --- /dev/null +++ b/clients/python/src/mr_openapi/models/metadata_string_value.py @@ -0,0 +1,83 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class MetadataStringValue(BaseModel): + """A string property value.""" # noqa: E501 + + string_value: StrictStr + metadata_type: StrictStr = Field(alias="metadataType") + __properties: ClassVar[list[str]] = ["string_value", "metadataType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of MetadataStringValue from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of MetadataStringValue from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "string_value": obj.get("string_value"), + "metadataType": ( + obj.get("metadataType") if obj.get("metadataType") is not None else "MetadataStringValue" + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/metadata_struct_value.py b/clients/python/src/mr_openapi/models/metadata_struct_value.py new file mode 100644 index 000000000..7c19f4d06 --- /dev/null +++ b/clients/python/src/mr_openapi/models/metadata_struct_value.py @@ -0,0 +1,83 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + + +class MetadataStructValue(BaseModel): + """A struct property value.""" # noqa: E501 + + struct_value: StrictStr = Field(description="Base64 encoded bytes for struct value") + metadata_type: StrictStr = Field(alias="metadataType") + __properties: ClassVar[list[str]] = ["struct_value", "metadataType"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of MetadataStructValue from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + return self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of MetadataStructValue from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "struct_value": obj.get("struct_value"), + "metadataType": ( + obj.get("metadataType") if obj.get("metadataType") is not None else "MetadataStructValue" + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/metadata_value.py b/clients/python/src/mr_openapi/models/metadata_value.py new file mode 100644 index 000000000..b5d13e208 --- /dev/null +++ b/clients/python/src/mr_openapi/models/metadata_value.py @@ -0,0 +1,277 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +from typing import Any + +from pydantic import ( + BaseModel, + ConfigDict, + ValidationError, + field_validator, +) +from typing_extensions import Self + +from mr_openapi.models.metadata_bool_value import MetadataBoolValue +from mr_openapi.models.metadata_double_value import MetadataDoubleValue +from mr_openapi.models.metadata_int_value import MetadataIntValue +from mr_openapi.models.metadata_proto_value import MetadataProtoValue +from mr_openapi.models.metadata_string_value import MetadataStringValue +from mr_openapi.models.metadata_struct_value import MetadataStructValue + +METADATAVALUE_ONE_OF_SCHEMAS = [ + "MetadataBoolValue", + "MetadataDoubleValue", + "MetadataIntValue", + "MetadataProtoValue", + "MetadataStringValue", + "MetadataStructValue", +] + + +class MetadataValue(BaseModel): + """A value in properties.""" + + # data type: MetadataIntValue + oneof_schema_1_validator: MetadataIntValue | None = None + # data type: MetadataDoubleValue + oneof_schema_2_validator: MetadataDoubleValue | None = None + # data type: MetadataStringValue + oneof_schema_3_validator: MetadataStringValue | None = None + # data type: MetadataStructValue + oneof_schema_4_validator: MetadataStructValue | None = None + # data type: MetadataProtoValue + oneof_schema_5_validator: MetadataProtoValue | None = None + # data type: MetadataBoolValue + oneof_schema_6_validator: MetadataBoolValue | None = None + actual_instance: ( + MetadataBoolValue + | MetadataDoubleValue + | MetadataIntValue + | MetadataProtoValue + | MetadataStringValue + | MetadataStructValue + | None + ) = None + one_of_schemas: set[str] = { + "MetadataBoolValue", + "MetadataDoubleValue", + "MetadataIntValue", + "MetadataProtoValue", + "MetadataStringValue", + "MetadataStructValue", + } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + discriminator_value_class_map: dict[str, str] = {} + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + msg = "If a position argument is used, only 1 is allowed to set `actual_instance`" + raise ValueError(msg) + if kwargs: + msg = "If a position argument is used, keyword arguments cannot be used." + raise ValueError(msg) + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator("actual_instance") + def actual_instance_must_validate_oneof(cls, v): + MetadataValue.model_construct() + error_messages = [] + match = 0 + # validate data type: MetadataIntValue + if not isinstance(v, MetadataIntValue): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetadataIntValue`") + else: + match += 1 + # validate data type: MetadataDoubleValue + if not isinstance(v, MetadataDoubleValue): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetadataDoubleValue`") + else: + match += 1 + # validate data type: MetadataStringValue + if not isinstance(v, MetadataStringValue): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetadataStringValue`") + else: + match += 1 + # validate data type: MetadataStructValue + if not isinstance(v, MetadataStructValue): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetadataStructValue`") + else: + match += 1 + # validate data type: MetadataProtoValue + if not isinstance(v, MetadataProtoValue): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetadataProtoValue`") + else: + match += 1 + # validate data type: MetadataBoolValue + if not isinstance(v, MetadataBoolValue): + error_messages.append(f"Error! Input type `{type(v)}` is not `MetadataBoolValue`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when setting `actual_instance` in MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when setting `actual_instance` in MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + + ", ".join(error_messages) + ) + else: + return v + + @classmethod + def from_dict(cls, obj: str | dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string.""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # use oneOf discriminator to lookup the data type + _data_type = json.loads(json_str).get("metadataType") + if not _data_type: + msg = "Failed to lookup data type from the field `metadataType` in the input." + raise ValueError(msg) + + # check if data type is `MetadataBoolValue` + if _data_type == "MetadataBoolValue": + instance.actual_instance = MetadataBoolValue.from_json(json_str) + return instance + + # check if data type is `MetadataDoubleValue` + if _data_type == "MetadataDoubleValue": + instance.actual_instance = MetadataDoubleValue.from_json(json_str) + return instance + + # check if data type is `MetadataIntValue` + if _data_type == "MetadataIntValue": + instance.actual_instance = MetadataIntValue.from_json(json_str) + return instance + + # check if data type is `MetadataProtoValue` + if _data_type == "MetadataProtoValue": + instance.actual_instance = MetadataProtoValue.from_json(json_str) + return instance + + # check if data type is `MetadataStringValue` + if _data_type == "MetadataStringValue": + instance.actual_instance = MetadataStringValue.from_json(json_str) + return instance + + # check if data type is `MetadataStructValue` + if _data_type == "MetadataStructValue": + instance.actual_instance = MetadataStructValue.from_json(json_str) + return instance + + # deserialize data into MetadataIntValue + try: + instance.actual_instance = MetadataIntValue.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MetadataDoubleValue + try: + instance.actual_instance = MetadataDoubleValue.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MetadataStringValue + try: + instance.actual_instance = MetadataStringValue.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MetadataStructValue + try: + instance.actual_instance = MetadataStructValue.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MetadataProtoValue + try: + instance.actual_instance = MetadataProtoValue.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into MetadataBoolValue + try: + instance.actual_instance = MetadataBoolValue.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError( + "Multiple matches found when deserializing the JSON string into MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + + ", ".join(error_messages) + ) + elif match == 0: + # no match + raise ValueError( + "No match found when deserializing the JSON string into MetadataValue with oneOf schemas: MetadataBoolValue, MetadataDoubleValue, MetadataIntValue, MetadataProtoValue, MetadataStringValue, MetadataStructValue. Details: " + + ", ".join(error_messages) + ) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance.""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict( + self, + ) -> ( + dict[str, Any] + | MetadataBoolValue + | MetadataDoubleValue + | MetadataIntValue + | MetadataProtoValue + | MetadataStringValue + | MetadataStructValue + | None + ): + """Returns the dict representation of the actual instance.""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance.""" + return pprint.pformat(self.model_dump()) diff --git a/clients/python/src/mr_openapi/models/model_artifact.py b/clients/python/src/mr_openapi/models/model_artifact.py new file mode 100644 index 000000000..f0e3ae3c2 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_artifact.py @@ -0,0 +1,176 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.metadata_value import MetadataValue + + +class ModelArtifact(BaseModel): + """An ML model artifact.""" # noqa: E501 + + artifact_type: StrictStr = Field(alias="artifactType") + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + uri: StrictStr | None = Field( + default=None, + description="The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.", + ) + state: ArtifactState | None = None + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + model_format_name: StrictStr | None = Field( + default=None, description="Name of the model format.", alias="modelFormatName" + ) + storage_key: StrictStr | None = Field(default=None, description="Storage secret name.", alias="storageKey") + storage_path: StrictStr | None = Field( + default=None, description="Path for model in storage provided by `storageKey`.", alias="storagePath" + ) + model_format_version: StrictStr | None = Field( + default=None, description="Version of the model format.", alias="modelFormatVersion" + ) + service_account_name: StrictStr | None = Field( + default=None, description="Name of the service account with storage secret.", alias="serviceAccountName" + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "uri", + "state", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + "modelFormatName", + "storageKey", + "storagePath", + "modelFormatVersion", + "serviceAccountName", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelArtifact from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelArtifact from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "artifactType": "model-artifact", + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "uri": obj.get("uri"), + "state": obj.get("state"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + "modelFormatName": obj.get("modelFormatName"), + "storageKey": obj.get("storageKey"), + "storagePath": obj.get("storagePath"), + "modelFormatVersion": obj.get("modelFormatVersion"), + "serviceAccountName": obj.get("serviceAccountName"), + } + ) diff --git a/clients/python/src/mr_openapi/models/model_artifact_create.py b/clients/python/src/mr_openapi/models/model_artifact_create.py new file mode 100644 index 000000000..bc5a34d70 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_artifact_create.py @@ -0,0 +1,148 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.metadata_value import MetadataValue + + +class ModelArtifactCreate(BaseModel): + """An ML model artifact.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + uri: StrictStr | None = Field( + default=None, + description="The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.", + ) + state: ArtifactState | None = None + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + model_format_name: StrictStr | None = Field( + default=None, description="Name of the model format.", alias="modelFormatName" + ) + storage_key: StrictStr | None = Field(default=None, description="Storage secret name.", alias="storageKey") + storage_path: StrictStr | None = Field( + default=None, description="Path for model in storage provided by `storageKey`.", alias="storagePath" + ) + model_format_version: StrictStr | None = Field( + default=None, description="Version of the model format.", alias="modelFormatVersion" + ) + service_account_name: StrictStr | None = Field( + default=None, description="Name of the service account with storage secret.", alias="serviceAccountName" + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "uri", + "state", + "name", + "modelFormatName", + "storageKey", + "storagePath", + "modelFormatVersion", + "serviceAccountName", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelArtifactCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelArtifactCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "uri": obj.get("uri"), + "state": obj.get("state"), + "name": obj.get("name"), + "modelFormatName": obj.get("modelFormatName"), + "storageKey": obj.get("storageKey"), + "storagePath": obj.get("storagePath"), + "modelFormatVersion": obj.get("modelFormatVersion"), + "serviceAccountName": obj.get("serviceAccountName"), + } + ) diff --git a/clients/python/src/mr_openapi/models/model_artifact_list.py b/clients/python/src/mr_openapi/models/model_artifact_list.py new file mode 100644 index 000000000..c2be49c99 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_artifact_list.py @@ -0,0 +1,101 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + +from mr_openapi.models.model_artifact import ModelArtifact + + +class ModelArtifactList(BaseModel): + """List of ModelArtifact entities.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + items: list[ModelArtifact] | None = Field(default=None, description="Array of `ModelArtifact` entities.") + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelArtifactList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelArtifactList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "nextPageToken": obj.get("nextPageToken"), + "pageSize": obj.get("pageSize"), + "size": obj.get("size"), + "items": ( + [ModelArtifact.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/model_artifact_update.py b/clients/python/src/mr_openapi/models/model_artifact_update.py new file mode 100644 index 000000000..6df6896d5 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_artifact_update.py @@ -0,0 +1,142 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.artifact_state import ArtifactState +from mr_openapi.models.metadata_value import MetadataValue + + +class ModelArtifactUpdate(BaseModel): + """An ML model artifact.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + uri: StrictStr | None = Field( + default=None, + description="The uniform resource identifier of the physical artifact. May be empty if there is no physical artifact.", + ) + state: ArtifactState | None = None + model_format_name: StrictStr | None = Field( + default=None, description="Name of the model format.", alias="modelFormatName" + ) + storage_key: StrictStr | None = Field(default=None, description="Storage secret name.", alias="storageKey") + storage_path: StrictStr | None = Field( + default=None, description="Path for model in storage provided by `storageKey`.", alias="storagePath" + ) + model_format_version: StrictStr | None = Field( + default=None, description="Version of the model format.", alias="modelFormatVersion" + ) + service_account_name: StrictStr | None = Field( + default=None, description="Name of the service account with storage secret.", alias="serviceAccountName" + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "uri", + "state", + "modelFormatName", + "storageKey", + "storagePath", + "modelFormatVersion", + "serviceAccountName", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelArtifactUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelArtifactUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "uri": obj.get("uri"), + "state": obj.get("state"), + "modelFormatName": obj.get("modelFormatName"), + "storageKey": obj.get("storageKey"), + "storagePath": obj.get("storagePath"), + "modelFormatVersion": obj.get("modelFormatVersion"), + "serviceAccountName": obj.get("serviceAccountName"), + } + ) diff --git a/clients/python/src/mr_openapi/models/model_version.py b/clients/python/src/mr_openapi/models/model_version.py new file mode 100644 index 000000000..7dc71d0b7 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_version.py @@ -0,0 +1,153 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.model_version_state import ModelVersionState + + +class ModelVersion(BaseModel): + """Represents a ModelVersion belonging to a RegisteredModel.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + state: ModelVersionState | None = None + author: StrictStr | None = Field(default=None, description="Name of the author.") + registered_model_id: StrictStr = Field( + description="ID of the `RegisteredModel` to which this version belongs.", alias="registeredModelId" + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "name", + "state", + "author", + "registeredModelId", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelVersion from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelVersion from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "state": obj.get("state"), + "author": obj.get("author"), + "registeredModelId": obj.get("registeredModelId"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + } + ) diff --git a/clients/python/src/mr_openapi/models/model_version_create.py b/clients/python/src/mr_openapi/models/model_version_create.py new file mode 100644 index 000000000..4688aa664 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_version_create.py @@ -0,0 +1,127 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.model_version_state import ModelVersionState + + +class ModelVersionCreate(BaseModel): + """Represents a ModelVersion belonging to a RegisteredModel.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + state: ModelVersionState | None = None + author: StrictStr | None = Field(default=None, description="Name of the author.") + registered_model_id: StrictStr = Field( + description="ID of the `RegisteredModel` to which this version belongs.", alias="registeredModelId" + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "name", + "state", + "author", + "registeredModelId", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelVersionCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelVersionCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "state": obj.get("state"), + "author": obj.get("author"), + "registeredModelId": obj.get("registeredModelId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/model_version_list.py b/clients/python/src/mr_openapi/models/model_version_list.py new file mode 100644 index 000000000..7503d063b --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_version_list.py @@ -0,0 +1,99 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + +from mr_openapi.models.model_version import ModelVersion + + +class ModelVersionList(BaseModel): + """List of ModelVersion entities.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + items: list[ModelVersion] | None = Field(default=None, description="Array of `ModelVersion` entities.") + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelVersionList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelVersionList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "nextPageToken": obj.get("nextPageToken"), + "pageSize": obj.get("pageSize"), + "size": obj.get("size"), + "items": ( + [ModelVersion.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/model_version_state.py b/clients/python/src/mr_openapi/models/model_version_state.py new file mode 100644 index 000000000..433d01e49 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_version_state.py @@ -0,0 +1,31 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class ModelVersionState(str, Enum): + """- LIVE: A state indicating that the `ModelVersion` exists - ARCHIVED: A state indicating that the `ModelVersion` has been archived.""" + + """ + allowed enum values + """ + LIVE = "LIVE" + ARCHIVED = "ARCHIVED" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ModelVersionState from a JSON string.""" + return cls(json.loads(json_str)) diff --git a/clients/python/src/mr_openapi/models/model_version_update.py b/clients/python/src/mr_openapi/models/model_version_update.py new file mode 100644 index 000000000..eba671fb7 --- /dev/null +++ b/clients/python/src/mr_openapi/models/model_version_update.py @@ -0,0 +1,110 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.model_version_state import ModelVersionState + + +class ModelVersionUpdate(BaseModel): + """Represents a ModelVersion belonging to a RegisteredModel.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + state: ModelVersionState | None = None + author: StrictStr | None = Field(default=None, description="Name of the author.") + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "state", "author"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ModelVersionUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ModelVersionUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "state": obj.get("state"), + "author": obj.get("author"), + } + ) diff --git a/clients/python/src/mr_openapi/models/order_by_field.py b/clients/python/src/mr_openapi/models/order_by_field.py new file mode 100644 index 000000000..8d0b2b388 --- /dev/null +++ b/clients/python/src/mr_openapi/models/order_by_field.py @@ -0,0 +1,32 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class OrderByField(str, Enum): + """Supported fields for ordering result entities.""" + + """ + allowed enum values + """ + CREATE_TIME = "CREATE_TIME" + LAST_UPDATE_TIME = "LAST_UPDATE_TIME" + ID = "Id" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OrderByField from a JSON string.""" + return cls(json.loads(json_str)) diff --git a/clients/python/src/mr_openapi/models/registered_model.py b/clients/python/src/mr_openapi/models/registered_model.py new file mode 100644 index 000000000..e8fa97056 --- /dev/null +++ b/clients/python/src/mr_openapi/models/registered_model.py @@ -0,0 +1,148 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.registered_model_state import RegisteredModelState + + +class RegisteredModel(BaseModel): + """A registered model in model registry. A registered model has ModelVersion children.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + owner: StrictStr | None = None + state: RegisteredModelState | None = None + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + "owner", + "state", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of RegisteredModel from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of RegisteredModel from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + "owner": obj.get("owner"), + "state": obj.get("state"), + } + ) diff --git a/clients/python/src/mr_openapi/models/registered_model_create.py b/clients/python/src/mr_openapi/models/registered_model_create.py new file mode 100644 index 000000000..dcec5693a --- /dev/null +++ b/clients/python/src/mr_openapi/models/registered_model_create.py @@ -0,0 +1,115 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.registered_model_state import RegisteredModelState + + +class RegisteredModelCreate(BaseModel): + """A registered model in model registry. A registered model has ModelVersion children.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + owner: StrictStr | None = None + state: RegisteredModelState | None = None + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "name", "owner", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of RegisteredModelCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of RegisteredModelCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "owner": obj.get("owner"), + "state": obj.get("state"), + } + ) diff --git a/clients/python/src/mr_openapi/models/registered_model_list.py b/clients/python/src/mr_openapi/models/registered_model_list.py new file mode 100644 index 000000000..d69d8b3f4 --- /dev/null +++ b/clients/python/src/mr_openapi/models/registered_model_list.py @@ -0,0 +1,101 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + +from mr_openapi.models.registered_model import RegisteredModel + + +class RegisteredModelList(BaseModel): + """List of RegisteredModels.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + items: list[RegisteredModel] | None = None + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of RegisteredModelList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of RegisteredModelList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "nextPageToken": obj.get("nextPageToken"), + "pageSize": obj.get("pageSize"), + "size": obj.get("size"), + "items": ( + [RegisteredModel.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/registered_model_state.py b/clients/python/src/mr_openapi/models/registered_model_state.py new file mode 100644 index 000000000..b2d05aad3 --- /dev/null +++ b/clients/python/src/mr_openapi/models/registered_model_state.py @@ -0,0 +1,31 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class RegisteredModelState(str, Enum): + """- LIVE: A state indicating that the `RegisteredModel` exists - ARCHIVED: A state indicating that the `RegisteredModel` has been archived.""" + + """ + allowed enum values + """ + LIVE = "LIVE" + ARCHIVED = "ARCHIVED" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RegisteredModelState from a JSON string.""" + return cls(json.loads(json_str)) diff --git a/clients/python/src/mr_openapi/models/registered_model_update.py b/clients/python/src/mr_openapi/models/registered_model_update.py new file mode 100644 index 000000000..48c379d28 --- /dev/null +++ b/clients/python/src/mr_openapi/models/registered_model_update.py @@ -0,0 +1,110 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue +from mr_openapi.models.registered_model_state import RegisteredModelState + + +class RegisteredModelUpdate(BaseModel): + """A registered model in model registry. A registered model has ModelVersion children.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + owner: StrictStr | None = None + state: RegisteredModelState | None = None + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "owner", "state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of RegisteredModelUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of RegisteredModelUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "owner": obj.get("owner"), + "state": obj.get("state"), + } + ) diff --git a/clients/python/src/mr_openapi/models/serve_model.py b/clients/python/src/mr_openapi/models/serve_model.py new file mode 100644 index 000000000..786b0c43e --- /dev/null +++ b/clients/python/src/mr_openapi/models/serve_model.py @@ -0,0 +1,150 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.metadata_value import MetadataValue + + +class ServeModel(BaseModel): + """An ML model serving action.""" # noqa: E501 + + last_known_state: ExecutionState | None = Field(default=None, alias="lastKnownState") + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + model_version_id: StrictStr = Field( + description="ID of the `ModelVersion` that was served in `InferenceService`.", alias="modelVersionId" + ) + __properties: ClassVar[list[str]] = [ + "lastKnownState", + "customProperties", + "description", + "externalId", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + "modelVersionId", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServeModel from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServeModel from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "lastKnownState": obj.get("lastKnownState"), + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + "modelVersionId": obj.get("modelVersionId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/serve_model_create.py b/clients/python/src/mr_openapi/models/serve_model_create.py new file mode 100644 index 000000000..005e601b3 --- /dev/null +++ b/clients/python/src/mr_openapi/models/serve_model_create.py @@ -0,0 +1,124 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.metadata_value import MetadataValue + + +class ServeModelCreate(BaseModel): + """An ML model serving action.""" # noqa: E501 + + last_known_state: ExecutionState | None = Field(default=None, alias="lastKnownState") + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + model_version_id: StrictStr = Field( + description="ID of the `ModelVersion` that was served in `InferenceService`.", alias="modelVersionId" + ) + __properties: ClassVar[list[str]] = [ + "lastKnownState", + "customProperties", + "description", + "externalId", + "name", + "modelVersionId", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServeModelCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServeModelCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "lastKnownState": obj.get("lastKnownState"), + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "modelVersionId": obj.get("modelVersionId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/serve_model_list.py b/clients/python/src/mr_openapi/models/serve_model_list.py new file mode 100644 index 000000000..622314d27 --- /dev/null +++ b/clients/python/src/mr_openapi/models/serve_model_list.py @@ -0,0 +1,99 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + +from mr_openapi.models.serve_model import ServeModel + + +class ServeModelList(BaseModel): + """List of ServeModel entities.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + items: list[ServeModel] | None = Field(default=None, description="Array of `ModelArtifact` entities.") + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServeModelList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServeModelList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "nextPageToken": obj.get("nextPageToken"), + "pageSize": obj.get("pageSize"), + "size": obj.get("size"), + "items": ( + [ServeModel.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/serve_model_update.py b/clients/python/src/mr_openapi/models/serve_model_update.py new file mode 100644 index 000000000..59c8cce09 --- /dev/null +++ b/clients/python/src/mr_openapi/models/serve_model_update.py @@ -0,0 +1,108 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.execution_state import ExecutionState +from mr_openapi.models.metadata_value import MetadataValue + + +class ServeModelUpdate(BaseModel): + """An ML model serving action.""" # noqa: E501 + + last_known_state: ExecutionState | None = Field(default=None, alias="lastKnownState") + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + __properties: ClassVar[list[str]] = ["lastKnownState", "customProperties", "description", "externalId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServeModelUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServeModelUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "lastKnownState": obj.get("lastKnownState"), + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/serving_environment.py b/clients/python/src/mr_openapi/models/serving_environment.py new file mode 100644 index 000000000..02bca9b9a --- /dev/null +++ b/clients/python/src/mr_openapi/models/serving_environment.py @@ -0,0 +1,141 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue + + +class ServingEnvironment(BaseModel): + """A Model Serving environment for serving `RegisteredModels`.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + id: StrictStr | None = Field( + default=None, description="Output only. The unique server generated id of the resource." + ) + create_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Create time of the resource in millisecond since epoch.", + alias="createTimeSinceEpoch", + ) + last_update_time_since_epoch: StrictStr | None = Field( + default=None, + description="Output only. Last update time of the resource since epoch in millisecond since epoch.", + alias="lastUpdateTimeSinceEpoch", + ) + __properties: ClassVar[list[str]] = [ + "customProperties", + "description", + "externalId", + "name", + "id", + "createTimeSinceEpoch", + "lastUpdateTimeSinceEpoch", + ] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServingEnvironment from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: set[str] = { + "id", + "create_time_since_epoch", + "last_update_time_since_epoch", + } + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServingEnvironment from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + "id": obj.get("id"), + "createTimeSinceEpoch": obj.get("createTimeSinceEpoch"), + "lastUpdateTimeSinceEpoch": obj.get("lastUpdateTimeSinceEpoch"), + } + ) diff --git a/clients/python/src/mr_openapi/models/serving_environment_create.py b/clients/python/src/mr_openapi/models/serving_environment_create.py new file mode 100644 index 000000000..f935a8e7e --- /dev/null +++ b/clients/python/src/mr_openapi/models/serving_environment_create.py @@ -0,0 +1,110 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue + + +class ServingEnvironmentCreate(BaseModel): + """A Model Serving environment for serving `RegisteredModels`.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + name: StrictStr | None = Field( + default=None, + description="The client provided name of the artifact. This field is optional. If set, it must be unique among all the artifacts of the same artifact type within a database instance and cannot be changed once set.", + ) + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServingEnvironmentCreate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServingEnvironmentCreate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + "name": obj.get("name"), + } + ) diff --git a/clients/python/src/mr_openapi/models/serving_environment_list.py b/clients/python/src/mr_openapi/models/serving_environment_list.py new file mode 100644 index 000000000..aea137777 --- /dev/null +++ b/clients/python/src/mr_openapi/models/serving_environment_list.py @@ -0,0 +1,101 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing_extensions import Self + +from mr_openapi.models.serving_environment import ServingEnvironment + + +class ServingEnvironmentList(BaseModel): + """List of ServingEnvironments.""" # noqa: E501 + + next_page_token: StrictStr = Field( + description="Token to use to retrieve next page of results.", alias="nextPageToken" + ) + page_size: StrictInt = Field(description="Maximum number of resources to return in the result.", alias="pageSize") + size: StrictInt = Field(description="Number of items in result list.") + items: list[ServingEnvironment] | None = None + __properties: ClassVar[list[str]] = ["nextPageToken", "pageSize", "size", "items"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServingEnvironmentList from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in items (list) + _items = [] + if self.items: + for _item in self.items: + if _item: + _items.append(_item.to_dict()) + _dict["items"] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServingEnvironmentList from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "nextPageToken": obj.get("nextPageToken"), + "pageSize": obj.get("pageSize"), + "size": obj.get("size"), + "items": ( + [ServingEnvironment.from_dict(_item) for _item in obj["items"]] + if obj.get("items") is not None + else None + ), + } + ) diff --git a/clients/python/src/mr_openapi/models/serving_environment_update.py b/clients/python/src/mr_openapi/models/serving_environment_update.py new file mode 100644 index 000000000..365ca8227 --- /dev/null +++ b/clients/python/src/mr_openapi/models/serving_environment_update.py @@ -0,0 +1,105 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +import pprint +import re # noqa: F401 +from typing import Any, ClassVar + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing_extensions import Self + +from mr_openapi.models.metadata_value import MetadataValue + + +class ServingEnvironmentUpdate(BaseModel): + """A Model Serving environment for serving `RegisteredModels`.""" # noqa: E501 + + custom_properties: dict[str, MetadataValue] | None = Field( + default=None, + description="User provided custom properties which are not defined by its type.", + alias="customProperties", + ) + description: StrictStr | None = Field(default=None, description="An optional description about the resource.") + external_id: StrictStr | None = Field( + default=None, + description="The external id that come from the clients’ system. This field is optional. If set, it must be unique among all resources within a database instance.", + alias="externalId", + ) + __properties: ClassVar[list[str]] = ["customProperties", "description", "externalId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + def to_str(self) -> str: + """Returns the string representation of the model using alias.""" + return pprint.pformat(self.model_dump(by_alias=True)) + + 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()) + + @classmethod + def from_json(cls, json_str: str) -> Self | None: + """Create an instance of ServingEnvironmentUpdate from a JSON string.""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: set[str] = set() + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each value in custom_properties (dict) + _field_dict = {} + if self.custom_properties: + for _key in self.custom_properties: + if self.custom_properties[_key]: + _field_dict[_key] = self.custom_properties[_key].to_dict() + _dict["customProperties"] = _field_dict + return _dict + + @classmethod + def from_dict(cls, obj: dict[str, Any] | None) -> Self | None: + """Create an instance of ServingEnvironmentUpdate from a dict.""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + return cls.model_validate( + { + "customProperties": ( + {_k: MetadataValue.from_dict(_v) for _k, _v in obj["customProperties"].items()} + if obj.get("customProperties") is not None + else None + ), + "description": obj.get("description"), + "externalId": obj.get("externalId"), + } + ) diff --git a/clients/python/src/mr_openapi/models/sort_order.py b/clients/python/src/mr_openapi/models/sort_order.py new file mode 100644 index 000000000..17c8c969e --- /dev/null +++ b/clients/python/src/mr_openapi/models/sort_order.py @@ -0,0 +1,31 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations + +import json +from enum import Enum + +from typing_extensions import Self + + +class SortOrder(str, Enum): + """Supported sort direction for ordering result entities.""" + + """ + allowed enum values + """ + ASC = "ASC" + DESC = "DESC" + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SortOrder from a JSON string.""" + return cls(json.loads(json_str)) diff --git a/clients/python/src/mr_openapi/rest.py b/clients/python/src/mr_openapi/rest.py new file mode 100644 index 000000000..e5a6116bf --- /dev/null +++ b/clients/python/src/mr_openapi/rest.py @@ -0,0 +1,167 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import io +import json +import re +import ssl +from typing import Optional, Union + +import aiohttp +import aiohttp_retry + +from mr_openapi.exceptions import ApiException, ApiValueError + +RESTResponseType = aiohttp.ClientResponse + +ALLOW_RETRY_METHODS = frozenset({"DELETE", "GET", "HEAD", "OPTIONS", "PUT", "TRACE"}) + + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.read() + return self.data + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + + # maxsize is number of requests to host that are allowed in parallel + maxsize = configuration.connection_pool_maxsize + + ssl_context = ssl.create_default_context(cafile=configuration.ssl_ca_cert) + if configuration.cert_file: + ssl_context.load_cert_chain(configuration.cert_file, keyfile=configuration.key_file) + + if not configuration.verify_ssl: + ssl_context.check_hostname = False + ssl_context.verify_mode = ssl.CERT_NONE + + connector = aiohttp.TCPConnector(limit=maxsize, ssl=ssl_context) + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + # https pool manager + self.pool_manager = aiohttp.ClientSession(connector=connector, trust_env=True) + + retries = configuration.retries + self.retry_client: Optional[aiohttp_retry.RetryClient] + if retries is not None: + self.retry_client = aiohttp_retry.RetryClient( + client_session=self.pool_manager, + retry_options=aiohttp_retry.ExponentialRetry( + attempts=retries, factor=0.0, start_timeout=0.0, max_timeout=120.0 + ), + ) + else: + self.retry_client = None + + async def close(self): + await self.pool_manager.close() + if self.retry_client is not None: + await self.retry_client.close() + + async def request(self, method, url, headers=None, body=None, post_params=None, _request_timeout=None): + """Execute request. + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + """ + method = method.upper() + assert method in ["GET", "HEAD", "DELETE", "POST", "PUT", "PATCH", "OPTIONS"] + + if post_params and body: + msg = "body parameter cannot be used with post_params parameter." + raise ApiValueError(msg) + + post_params = post_params or {} + headers = headers or {} + # url already contains the URL query string + timeout = _request_timeout or 5 * 60 + + if "Content-Type" not in headers: + headers["Content-Type"] = "application/json" + + args = {"method": method, "url": url, "timeout": timeout, "headers": headers} + + if self.proxy: + args["proxy"] = self.proxy + if self.proxy_headers: + args["proxy_headers"] = self.proxy_headers + + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ["POST", "PUT", "PATCH", "OPTIONS", "DELETE"]: + if re.search("json", headers["Content-Type"], re.IGNORECASE): + if body is not None: + body = json.dumps(body) + args["data"] = body + elif headers["Content-Type"] == "application/x-www-form-urlencoded": + args["data"] = aiohttp.FormData(post_params) + elif headers["Content-Type"] == "multipart/form-data": + # must del headers['Content-Type'], or the correct + # Content-Type which generated by aiohttp + del headers["Content-Type"] + data = aiohttp.FormData() + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + data.add_field(k, value=v[1], filename=v[0], content_type=v[2]) + else: + data.add_field(k, v) + args["data"] = data + + # Pass a `bytes` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, bytes): + args["data"] = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + + pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] + if self.retry_client is not None and method in ALLOW_RETRY_METHODS: + pool_manager = self.retry_client + else: + pool_manager = self.pool_manager + + r = await pool_manager.request(**args) + + return RESTResponse(r) diff --git a/clients/python/src/mr_openapi/test/__init__.py b/clients/python/src/mr_openapi/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/clients/python/src/mr_openapi/test/test_artifact.py b/clients/python/src/mr_openapi/test/test_artifact.py new file mode 100644 index 000000000..6778a327d --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_artifact.py @@ -0,0 +1,67 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.artifact import Artifact + + +class TestArtifact(unittest.TestCase): + """Artifact unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Artifact: + """Test Artifact + include_option 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 `Artifact` + """ + model = Artifact() + if include_optional: + return Artifact( + artifact_type = 'doc-artifact', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '', + model_format_name = '', + storage_key = '', + storage_path = '', + model_format_version = '', + service_account_name = '' + ) + else: + return Artifact( + artifact_type = 'doc-artifact', + ) + """ + + def testArtifact(self): + """Test Artifact.""" + # 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/clients/python/src/mr_openapi/test/test_artifact_list.py b/clients/python/src/mr_openapi/test/test_artifact_list.py new file mode 100644 index 000000000..11c31beb8 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_artifact_list.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.artifact_list import ArtifactList + + +class TestArtifactList(unittest.TestCase): + """ArtifactList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ArtifactList: + """Test ArtifactList + include_option 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 `ArtifactList` + """ + model = ArtifactList() + if include_optional: + return ArtifactList( + next_page_token = '', + page_size = 56, + size = 56, + items = [ + null + ] + ) + else: + return ArtifactList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testArtifactList(self): + """Test ArtifactList.""" + # 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/clients/python/src/mr_openapi/test/test_artifact_state.py b/clients/python/src/mr_openapi/test/test_artifact_state.py new file mode 100644 index 000000000..b9130e1ea --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_artifact_state.py @@ -0,0 +1,29 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestArtifactState(unittest.TestCase): + """ArtifactState unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testArtifactState(self): + """Test ArtifactState.""" + # inst = ArtifactState() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/src/mr_openapi/test/test_base_artifact.py b/clients/python/src/mr_openapi/test/test_base_artifact.py new file mode 100644 index 000000000..807d16d59 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_artifact.py @@ -0,0 +1,60 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_artifact import BaseArtifact + + +class TestBaseArtifact(unittest.TestCase): + """BaseArtifact unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseArtifact: + """Test BaseArtifact + include_option 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 `BaseArtifact` + """ + model = BaseArtifact() + if include_optional: + return BaseArtifact( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '' + ) + else: + return BaseArtifact( + ) + """ + + def testBaseArtifact(self): + """Test BaseArtifact.""" + # 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/clients/python/src/mr_openapi/test/test_base_artifact_create.py b/clients/python/src/mr_openapi/test/test_base_artifact_create.py new file mode 100644 index 000000000..8f42fcc0a --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_artifact_create.py @@ -0,0 +1,57 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_artifact_create import BaseArtifactCreate + + +class TestBaseArtifactCreate(unittest.TestCase): + """BaseArtifactCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseArtifactCreate: + """Test BaseArtifactCreate + include_option 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 `BaseArtifactCreate` + """ + model = BaseArtifactCreate() + if include_optional: + return BaseArtifactCreate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN', + name = '' + ) + else: + return BaseArtifactCreate( + ) + """ + + def testBaseArtifactCreate(self): + """Test BaseArtifactCreate.""" + # 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/clients/python/src/mr_openapi/test/test_base_artifact_update.py b/clients/python/src/mr_openapi/test/test_base_artifact_update.py new file mode 100644 index 000000000..edcd1ff2b --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_artifact_update.py @@ -0,0 +1,56 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_artifact_update import BaseArtifactUpdate + + +class TestBaseArtifactUpdate(unittest.TestCase): + """BaseArtifactUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseArtifactUpdate: + """Test BaseArtifactUpdate + include_option 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 `BaseArtifactUpdate` + """ + model = BaseArtifactUpdate() + if include_optional: + return BaseArtifactUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN' + ) + else: + return BaseArtifactUpdate( + ) + """ + + def testBaseArtifactUpdate(self): + """Test BaseArtifactUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_base_execution.py b/clients/python/src/mr_openapi/test/test_base_execution.py new file mode 100644 index 000000000..a429634aa --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_execution.py @@ -0,0 +1,59 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_execution import BaseExecution + + +class TestBaseExecution(unittest.TestCase): + """BaseExecution unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseExecution: + """Test BaseExecution + include_option 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 `BaseExecution` + """ + model = BaseExecution() + if include_optional: + return BaseExecution( + last_known_state = 'UNKNOWN', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '' + ) + else: + return BaseExecution( + ) + """ + + def testBaseExecution(self): + """Test BaseExecution.""" + # 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/clients/python/src/mr_openapi/test/test_base_execution_create.py b/clients/python/src/mr_openapi/test/test_base_execution_create.py new file mode 100644 index 000000000..a84a0b65a --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_execution_create.py @@ -0,0 +1,56 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_execution_create import BaseExecutionCreate + + +class TestBaseExecutionCreate(unittest.TestCase): + """BaseExecutionCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseExecutionCreate: + """Test BaseExecutionCreate + include_option 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 `BaseExecutionCreate` + """ + model = BaseExecutionCreate() + if include_optional: + return BaseExecutionCreate( + last_known_state = 'UNKNOWN', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '' + ) + else: + return BaseExecutionCreate( + ) + """ + + def testBaseExecutionCreate(self): + """Test BaseExecutionCreate.""" + # 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/clients/python/src/mr_openapi/test/test_base_execution_update.py b/clients/python/src/mr_openapi/test/test_base_execution_update.py new file mode 100644 index 000000000..78576df78 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_execution_update.py @@ -0,0 +1,55 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_execution_update import BaseExecutionUpdate + + +class TestBaseExecutionUpdate(unittest.TestCase): + """BaseExecutionUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseExecutionUpdate: + """Test BaseExecutionUpdate + include_option 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 `BaseExecutionUpdate` + """ + model = BaseExecutionUpdate() + if include_optional: + return BaseExecutionUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + last_known_state = 'UNKNOWN' + ) + else: + return BaseExecutionUpdate( + ) + """ + + def testBaseExecutionUpdate(self): + """Test BaseExecutionUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_base_resource.py b/clients/python/src/mr_openapi/test/test_base_resource.py new file mode 100644 index 000000000..a3d81811b --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_resource.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_resource import BaseResource + + +class TestBaseResource(unittest.TestCase): + """BaseResource unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResource: + """Test BaseResource + include_option 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 `BaseResource` + """ + model = BaseResource() + if include_optional: + return BaseResource( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '' + ) + else: + return BaseResource( + ) + """ + + def testBaseResource(self): + """Test BaseResource.""" + # 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/clients/python/src/mr_openapi/test/test_base_resource_create.py b/clients/python/src/mr_openapi/test/test_base_resource_create.py new file mode 100644 index 000000000..9c00038ca --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_resource_create.py @@ -0,0 +1,55 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_resource_create import BaseResourceCreate + + +class TestBaseResourceCreate(unittest.TestCase): + """BaseResourceCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResourceCreate: + """Test BaseResourceCreate + include_option 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 `BaseResourceCreate` + """ + model = BaseResourceCreate() + if include_optional: + return BaseResourceCreate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '' + ) + else: + return BaseResourceCreate( + ) + """ + + def testBaseResourceCreate(self): + """Test BaseResourceCreate.""" + # 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/clients/python/src/mr_openapi/test/test_base_resource_list.py b/clients/python/src/mr_openapi/test/test_base_resource_list.py new file mode 100644 index 000000000..7501b19ee --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_resource_list.py @@ -0,0 +1,55 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_resource_list import BaseResourceList + + +class TestBaseResourceList(unittest.TestCase): + """BaseResourceList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResourceList: + """Test BaseResourceList + include_option 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 `BaseResourceList` + """ + model = BaseResourceList() + if include_optional: + return BaseResourceList( + next_page_token = '', + page_size = 56, + size = 56 + ) + else: + return BaseResourceList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testBaseResourceList(self): + """Test BaseResourceList.""" + # 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/clients/python/src/mr_openapi/test/test_base_resource_update.py b/clients/python/src/mr_openapi/test/test_base_resource_update.py new file mode 100644 index 000000000..dbdc94d28 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_base_resource_update.py @@ -0,0 +1,54 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.base_resource_update import BaseResourceUpdate + + +class TestBaseResourceUpdate(unittest.TestCase): + """BaseResourceUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> BaseResourceUpdate: + """Test BaseResourceUpdate + include_option 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 `BaseResourceUpdate` + """ + model = BaseResourceUpdate() + if include_optional: + return BaseResourceUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '' + ) + else: + return BaseResourceUpdate( + ) + """ + + def testBaseResourceUpdate(self): + """Test BaseResourceUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_doc_artifact.py b/clients/python/src/mr_openapi/test/test_doc_artifact.py new file mode 100644 index 000000000..afcc0a7f1 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_doc_artifact.py @@ -0,0 +1,62 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.doc_artifact import DocArtifact + + +class TestDocArtifact(unittest.TestCase): + """DocArtifact unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> DocArtifact: + """Test DocArtifact + include_option 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 `DocArtifact` + """ + model = DocArtifact() + if include_optional: + return DocArtifact( + artifact_type = 'doc-artifact', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '' + ) + else: + return DocArtifact( + artifact_type = 'doc-artifact', + ) + """ + + def testDocArtifact(self): + """Test DocArtifact.""" + # 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/clients/python/src/mr_openapi/test/test_error.py b/clients/python/src/mr_openapi/test/test_error.py new file mode 100644 index 000000000..81e40c7ff --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_error.py @@ -0,0 +1,53 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.error import Error + + +class TestError(unittest.TestCase): + """Error unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error: + """Test Error + include_option 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 `Error` + """ + model = Error() + if include_optional: + return Error( + code = '', + message = '' + ) + else: + return Error( + code = '', + message = '', + ) + """ + + def testError(self): + """Test Error.""" + # 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/clients/python/src/mr_openapi/test/test_execution_state.py b/clients/python/src/mr_openapi/test/test_execution_state.py new file mode 100644 index 000000000..e9d0ab99e --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_execution_state.py @@ -0,0 +1,29 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestExecutionState(unittest.TestCase): + """ExecutionState unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testExecutionState(self): + """Test ExecutionState.""" + # inst = ExecutionState() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/src/mr_openapi/test/test_inference_service.py b/clients/python/src/mr_openapi/test/test_inference_service.py new file mode 100644 index 000000000..cf4c87fd3 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_inference_service.py @@ -0,0 +1,65 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.inference_service import InferenceService + + +class TestInferenceService(unittest.TestCase): + """InferenceService unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InferenceService: + """Test InferenceService + include_option 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 `InferenceService` + """ + model = InferenceService() + if include_optional: + return InferenceService( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '', + model_version_id = '', + runtime = '', + desired_state = 'DEPLOYED', + registered_model_id = '', + serving_environment_id = '' + ) + else: + return InferenceService( + registered_model_id = '', + serving_environment_id = '', + ) + """ + + def testInferenceService(self): + """Test InferenceService.""" + # 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/clients/python/src/mr_openapi/test/test_inference_service_create.py b/clients/python/src/mr_openapi/test/test_inference_service_create.py new file mode 100644 index 000000000..24af68b7b --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_inference_service_create.py @@ -0,0 +1,62 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.inference_service_create import InferenceServiceCreate + + +class TestInferenceServiceCreate(unittest.TestCase): + """InferenceServiceCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InferenceServiceCreate: + """Test InferenceServiceCreate + include_option 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 `InferenceServiceCreate` + """ + model = InferenceServiceCreate() + if include_optional: + return InferenceServiceCreate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + model_version_id = '', + runtime = '', + desired_state = 'DEPLOYED', + registered_model_id = '', + serving_environment_id = '' + ) + else: + return InferenceServiceCreate( + registered_model_id = '', + serving_environment_id = '', + ) + """ + + def testInferenceServiceCreate(self): + """Test InferenceServiceCreate.""" + # 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/clients/python/src/mr_openapi/test/test_inference_service_list.py b/clients/python/src/mr_openapi/test/test_inference_service_list.py new file mode 100644 index 000000000..4c55a9e3f --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_inference_service_list.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.inference_service_list import InferenceServiceList + + +class TestInferenceServiceList(unittest.TestCase): + """InferenceServiceList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InferenceServiceList: + """Test InferenceServiceList + include_option 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 `InferenceServiceList` + """ + model = InferenceServiceList() + if include_optional: + return InferenceServiceList( + next_page_token = '', + page_size = 56, + size = 56, + items = [ + null + ] + ) + else: + return InferenceServiceList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testInferenceServiceList(self): + """Test InferenceServiceList.""" + # 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/clients/python/src/mr_openapi/test/test_inference_service_state.py b/clients/python/src/mr_openapi/test/test_inference_service_state.py new file mode 100644 index 000000000..7e147ec41 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_inference_service_state.py @@ -0,0 +1,29 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestInferenceServiceState(unittest.TestCase): + """InferenceServiceState unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInferenceServiceState(self): + """Test InferenceServiceState.""" + # inst = InferenceServiceState() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/src/mr_openapi/test/test_inference_service_update.py b/clients/python/src/mr_openapi/test/test_inference_service_update.py new file mode 100644 index 000000000..281ce6479 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_inference_service_update.py @@ -0,0 +1,57 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.inference_service_update import InferenceServiceUpdate + + +class TestInferenceServiceUpdate(unittest.TestCase): + """InferenceServiceUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> InferenceServiceUpdate: + """Test InferenceServiceUpdate + include_option 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 `InferenceServiceUpdate` + """ + model = InferenceServiceUpdate() + if include_optional: + return InferenceServiceUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + model_version_id = '', + runtime = '', + desired_state = 'DEPLOYED' + ) + else: + return InferenceServiceUpdate( + ) + """ + + def testInferenceServiceUpdate(self): + """Test InferenceServiceUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_metadata_bool_value.py b/clients/python/src/mr_openapi/test/test_metadata_bool_value.py new file mode 100644 index 000000000..64c0ec7c7 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_metadata_bool_value.py @@ -0,0 +1,53 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.metadata_bool_value import MetadataBoolValue + + +class TestMetadataBoolValue(unittest.TestCase): + """MetadataBoolValue unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataBoolValue: + """Test MetadataBoolValue + include_option 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 `MetadataBoolValue` + """ + model = MetadataBoolValue() + if include_optional: + return MetadataBoolValue( + bool_value = True, + metadata_type = 'MetadataBoolValue' + ) + else: + return MetadataBoolValue( + bool_value = True, + metadata_type = 'MetadataBoolValue', + ) + """ + + def testMetadataBoolValue(self): + """Test MetadataBoolValue.""" + # 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/clients/python/src/mr_openapi/test/test_metadata_double_value.py b/clients/python/src/mr_openapi/test/test_metadata_double_value.py new file mode 100644 index 000000000..4c7387dba --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_metadata_double_value.py @@ -0,0 +1,53 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.metadata_double_value import MetadataDoubleValue + + +class TestMetadataDoubleValue(unittest.TestCase): + """MetadataDoubleValue unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataDoubleValue: + """Test MetadataDoubleValue + include_option 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 `MetadataDoubleValue` + """ + model = MetadataDoubleValue() + if include_optional: + return MetadataDoubleValue( + double_value = 1.337, + metadata_type = 'MetadataDoubleValue' + ) + else: + return MetadataDoubleValue( + double_value = 1.337, + metadata_type = 'MetadataDoubleValue', + ) + """ + + def testMetadataDoubleValue(self): + """Test MetadataDoubleValue.""" + # 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/clients/python/src/mr_openapi/test/test_metadata_int_value.py b/clients/python/src/mr_openapi/test/test_metadata_int_value.py new file mode 100644 index 000000000..6b724c8b6 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_metadata_int_value.py @@ -0,0 +1,53 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.metadata_int_value import MetadataIntValue + + +class TestMetadataIntValue(unittest.TestCase): + """MetadataIntValue unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataIntValue: + """Test MetadataIntValue + include_option 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 `MetadataIntValue` + """ + model = MetadataIntValue() + if include_optional: + return MetadataIntValue( + int_value = '', + metadata_type = 'MetadataIntValue' + ) + else: + return MetadataIntValue( + int_value = '', + metadata_type = 'MetadataIntValue', + ) + """ + + def testMetadataIntValue(self): + """Test MetadataIntValue.""" + # 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/clients/python/src/mr_openapi/test/test_metadata_proto_value.py b/clients/python/src/mr_openapi/test/test_metadata_proto_value.py new file mode 100644 index 000000000..e4427e259 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_metadata_proto_value.py @@ -0,0 +1,55 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.metadata_proto_value import MetadataProtoValue + + +class TestMetadataProtoValue(unittest.TestCase): + """MetadataProtoValue unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataProtoValue: + """Test MetadataProtoValue + include_option 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 `MetadataProtoValue` + """ + model = MetadataProtoValue() + if include_optional: + return MetadataProtoValue( + type = '', + proto_value = '', + metadata_type = 'MetadataProtoValue' + ) + else: + return MetadataProtoValue( + type = '', + proto_value = '', + metadata_type = 'MetadataProtoValue', + ) + """ + + def testMetadataProtoValue(self): + """Test MetadataProtoValue.""" + # 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/clients/python/src/mr_openapi/test/test_metadata_string_value.py b/clients/python/src/mr_openapi/test/test_metadata_string_value.py new file mode 100644 index 000000000..c2742e70b --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_metadata_string_value.py @@ -0,0 +1,53 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.metadata_string_value import MetadataStringValue + + +class TestMetadataStringValue(unittest.TestCase): + """MetadataStringValue unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataStringValue: + """Test MetadataStringValue + include_option 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 `MetadataStringValue` + """ + model = MetadataStringValue() + if include_optional: + return MetadataStringValue( + string_value = '', + metadata_type = 'MetadataStringValue' + ) + else: + return MetadataStringValue( + string_value = '', + metadata_type = 'MetadataStringValue', + ) + """ + + def testMetadataStringValue(self): + """Test MetadataStringValue.""" + # 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/clients/python/src/mr_openapi/test/test_metadata_struct_value.py b/clients/python/src/mr_openapi/test/test_metadata_struct_value.py new file mode 100644 index 000000000..0ade74f45 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_metadata_struct_value.py @@ -0,0 +1,53 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.metadata_struct_value import MetadataStructValue + + +class TestMetadataStructValue(unittest.TestCase): + """MetadataStructValue unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataStructValue: + """Test MetadataStructValue + include_option 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 `MetadataStructValue` + """ + model = MetadataStructValue() + if include_optional: + return MetadataStructValue( + struct_value = '', + metadata_type = 'MetadataStructValue' + ) + else: + return MetadataStructValue( + struct_value = '', + metadata_type = 'MetadataStructValue', + ) + """ + + def testMetadataStructValue(self): + """Test MetadataStructValue.""" + # 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/clients/python/src/mr_openapi/test/test_metadata_value.py b/clients/python/src/mr_openapi/test/test_metadata_value.py new file mode 100644 index 000000000..60bd697c4 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_metadata_value.py @@ -0,0 +1,65 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.metadata_value import MetadataValue + + +class TestMetadataValue(unittest.TestCase): + """MetadataValue unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> MetadataValue: + """Test MetadataValue + include_option 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 `MetadataValue` + """ + model = MetadataValue() + if include_optional: + return MetadataValue( + int_value = '', + metadata_type = 'MetadataBoolValue', + double_value = 1.337, + string_value = '', + struct_value = '', + type = '', + proto_value = '', + bool_value = True + ) + else: + return MetadataValue( + int_value = '', + metadata_type = 'MetadataBoolValue', + double_value = 1.337, + string_value = '', + struct_value = '', + type = '', + proto_value = '', + bool_value = True, + ) + """ + + def testMetadataValue(self): + """Test MetadataValue.""" + # 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/clients/python/src/mr_openapi/test/test_model_artifact.py b/clients/python/src/mr_openapi/test/test_model_artifact.py new file mode 100644 index 000000000..88c378a1d --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_artifact.py @@ -0,0 +1,67 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_artifact import ModelArtifact + + +class TestModelArtifact(unittest.TestCase): + """ModelArtifact unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelArtifact: + """Test ModelArtifact + include_option 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 `ModelArtifact` + """ + model = ModelArtifact() + if include_optional: + return ModelArtifact( + artifact_type = 'model-artifact', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '', + model_format_name = '', + storage_key = '', + storage_path = '', + model_format_version = '', + service_account_name = '' + ) + else: + return ModelArtifact( + artifact_type = 'model-artifact', + ) + """ + + def testModelArtifact(self): + """Test ModelArtifact.""" + # 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/clients/python/src/mr_openapi/test/test_model_artifact_create.py b/clients/python/src/mr_openapi/test/test_model_artifact_create.py new file mode 100644 index 000000000..28f373312 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_artifact_create.py @@ -0,0 +1,62 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_artifact_create import ModelArtifactCreate + + +class TestModelArtifactCreate(unittest.TestCase): + """ModelArtifactCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelArtifactCreate: + """Test ModelArtifactCreate + include_option 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 `ModelArtifactCreate` + """ + model = ModelArtifactCreate() + if include_optional: + return ModelArtifactCreate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN', + name = '', + model_format_name = '', + storage_key = '', + storage_path = '', + model_format_version = '', + service_account_name = '' + ) + else: + return ModelArtifactCreate( + ) + """ + + def testModelArtifactCreate(self): + """Test ModelArtifactCreate.""" + # 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/clients/python/src/mr_openapi/test/test_model_artifact_list.py b/clients/python/src/mr_openapi/test/test_model_artifact_list.py new file mode 100644 index 000000000..03f345e1e --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_artifact_list.py @@ -0,0 +1,59 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_artifact_list import ModelArtifactList + + +class TestModelArtifactList(unittest.TestCase): + """ModelArtifactList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelArtifactList: + """Test ModelArtifactList + include_option 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 `ModelArtifactList` + """ + model = ModelArtifactList() + if include_optional: + return ModelArtifactList( + next_page_token = '', + page_size = 56, + size = 56, + items = [ + mr_openapi.models.model_artifact.ModelArtifact( + artifact_type = 'model-artifact', ) + ] + ) + else: + return ModelArtifactList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testModelArtifactList(self): + """Test ModelArtifactList.""" + # 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/clients/python/src/mr_openapi/test/test_model_artifact_update.py b/clients/python/src/mr_openapi/test/test_model_artifact_update.py new file mode 100644 index 000000000..fb4857487 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_artifact_update.py @@ -0,0 +1,61 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_artifact_update import ModelArtifactUpdate + + +class TestModelArtifactUpdate(unittest.TestCase): + """ModelArtifactUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelArtifactUpdate: + """Test ModelArtifactUpdate + include_option 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 `ModelArtifactUpdate` + """ + model = ModelArtifactUpdate() + if include_optional: + return ModelArtifactUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + uri = '', + state = 'UNKNOWN', + model_format_name = '', + storage_key = '', + storage_path = '', + model_format_version = '', + service_account_name = '' + ) + else: + return ModelArtifactUpdate( + ) + """ + + def testModelArtifactUpdate(self): + """Test ModelArtifactUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_model_registry_service_api.py b/clients/python/src/mr_openapi/test/test_model_registry_service_api.py new file mode 100644 index 000000000..dd405ea7e --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_registry_service_api.py @@ -0,0 +1,272 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.api.model_registry_service_api import ModelRegistryServiceApi + + +class TestModelRegistryServiceApi(unittest.TestCase): + """ModelRegistryServiceApi unit test stubs.""" + + def setUp(self) -> None: + self.api = ModelRegistryServiceApi() + + def tearDown(self) -> None: + pass + + def test_create_environment_inference_service(self) -> None: + """Test case for create_environment_inference_service. + + Create a InferenceService in ServingEnvironment + """ + pass + + def test_create_inference_service(self) -> None: + """Test case for create_inference_service. + + Create a InferenceService + """ + pass + + def test_create_inference_service_serve(self) -> None: + """Test case for create_inference_service_serve. + + Create a ServeModel action in a InferenceService + """ + pass + + def test_create_model_artifact(self) -> None: + """Test case for create_model_artifact. + + Create a ModelArtifact + """ + pass + + def test_create_model_version(self) -> None: + """Test case for create_model_version. + + Create a ModelVersion + """ + pass + + def test_create_model_version_artifact(self) -> None: + """Test case for create_model_version_artifact. + + Create an Artifact in a ModelVersion + """ + pass + + def test_create_registered_model(self) -> None: + """Test case for create_registered_model. + + Create a RegisteredModel + """ + pass + + def test_create_registered_model_version(self) -> None: + """Test case for create_registered_model_version. + + Create a ModelVersion in RegisteredModel + """ + pass + + def test_create_serving_environment(self) -> None: + """Test case for create_serving_environment. + + Create a ServingEnvironment + """ + pass + + def test_find_inference_service(self) -> None: + """Test case for find_inference_service. + + Get an InferenceServices that matches search parameters. + """ + pass + + def test_find_model_artifact(self) -> None: + """Test case for find_model_artifact. + + Get a ModelArtifact that matches search parameters. + """ + pass + + def test_find_model_version(self) -> None: + """Test case for find_model_version. + + Get a ModelVersion that matches search parameters. + """ + pass + + def test_find_registered_model(self) -> None: + """Test case for find_registered_model. + + Get a RegisteredModel that matches search parameters. + """ + pass + + def test_find_serving_environment(self) -> None: + """Test case for find_serving_environment. + + Find ServingEnvironment + """ + pass + + def test_get_environment_inference_services(self) -> None: + """Test case for get_environment_inference_services. + + List All ServingEnvironment's InferenceServices + """ + pass + + def test_get_inference_service(self) -> None: + """Test case for get_inference_service. + + Get a InferenceService + """ + pass + + def test_get_inference_service_model(self) -> None: + """Test case for get_inference_service_model. + + Get InferenceService's RegisteredModel + """ + pass + + def test_get_inference_service_serves(self) -> None: + """Test case for get_inference_service_serves. + + List All InferenceService's ServeModel actions + """ + pass + + def test_get_inference_service_version(self) -> None: + """Test case for get_inference_service_version. + + Get InferenceService's ModelVersion + """ + pass + + def test_get_inference_services(self) -> None: + """Test case for get_inference_services. + + List All InferenceServices + """ + pass + + def test_get_model_artifact(self) -> None: + """Test case for get_model_artifact. + + Get a ModelArtifact + """ + pass + + def test_get_model_artifacts(self) -> None: + """Test case for get_model_artifacts. + + List All ModelArtifacts + """ + pass + + def test_get_model_version(self) -> None: + """Test case for get_model_version. + + Get a ModelVersion + """ + pass + + def test_get_model_version_artifacts(self) -> None: + """Test case for get_model_version_artifacts. + + List all artifacts associated with the `ModelVersion` + """ + pass + + def test_get_model_versions(self) -> None: + """Test case for get_model_versions. + + List All ModelVersions + """ + pass + + def test_get_registered_model(self) -> None: + """Test case for get_registered_model. + + Get a RegisteredModel + """ + pass + + def test_get_registered_model_versions(self) -> None: + """Test case for get_registered_model_versions. + + List All RegisteredModel's ModelVersions + """ + pass + + def test_get_registered_models(self) -> None: + """Test case for get_registered_models. + + List All RegisteredModels + """ + pass + + def test_get_serving_environment(self) -> None: + """Test case for get_serving_environment. + + Get a ServingEnvironment + """ + pass + + def test_get_serving_environments(self) -> None: + """Test case for get_serving_environments. + + List All ServingEnvironments + """ + pass + + def test_update_inference_service(self) -> None: + """Test case for update_inference_service. + + Update a InferenceService + """ + pass + + def test_update_model_artifact(self) -> None: + """Test case for update_model_artifact. + + Update a ModelArtifact + """ + pass + + def test_update_model_version(self) -> None: + """Test case for update_model_version. + + Update a ModelVersion + """ + pass + + def test_update_registered_model(self) -> None: + """Test case for update_registered_model. + + Update a RegisteredModel + """ + pass + + def test_update_serving_environment(self) -> None: + """Test case for update_serving_environment. + + Update a ServingEnvironment + """ + pass + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/src/mr_openapi/test/test_model_version.py b/clients/python/src/mr_openapi/test/test_model_version.py new file mode 100644 index 000000000..59910eea8 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_version.py @@ -0,0 +1,62 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_version import ModelVersion + + +class TestModelVersion(unittest.TestCase): + """ModelVersion unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelVersion: + """Test ModelVersion + include_option 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 `ModelVersion` + """ + model = ModelVersion() + if include_optional: + return ModelVersion( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + state = 'LIVE', + author = '', + registered_model_id = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '' + ) + else: + return ModelVersion( + registered_model_id = '', + ) + """ + + def testModelVersion(self): + """Test ModelVersion.""" + # 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/clients/python/src/mr_openapi/test/test_model_version_create.py b/clients/python/src/mr_openapi/test/test_model_version_create.py new file mode 100644 index 000000000..033e69948 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_version_create.py @@ -0,0 +1,59 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_version_create import ModelVersionCreate + + +class TestModelVersionCreate(unittest.TestCase): + """ModelVersionCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelVersionCreate: + """Test ModelVersionCreate + include_option 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 `ModelVersionCreate` + """ + model = ModelVersionCreate() + if include_optional: + return ModelVersionCreate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + state = 'LIVE', + author = '', + registered_model_id = '' + ) + else: + return ModelVersionCreate( + registered_model_id = '', + ) + """ + + def testModelVersionCreate(self): + """Test ModelVersionCreate.""" + # 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/clients/python/src/mr_openapi/test/test_model_version_list.py b/clients/python/src/mr_openapi/test/test_model_version_list.py new file mode 100644 index 000000000..06214e27a --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_version_list.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_version_list import ModelVersionList + + +class TestModelVersionList(unittest.TestCase): + """ModelVersionList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelVersionList: + """Test ModelVersionList + include_option 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 `ModelVersionList` + """ + model = ModelVersionList() + if include_optional: + return ModelVersionList( + next_page_token = '', + page_size = 56, + size = 56, + items = [ + null + ] + ) + else: + return ModelVersionList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testModelVersionList(self): + """Test ModelVersionList.""" + # 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/clients/python/src/mr_openapi/test/test_model_version_state.py b/clients/python/src/mr_openapi/test/test_model_version_state.py new file mode 100644 index 000000000..72ac1bfbc --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_version_state.py @@ -0,0 +1,29 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestModelVersionState(unittest.TestCase): + """ModelVersionState unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testModelVersionState(self): + """Test ModelVersionState.""" + # inst = ModelVersionState() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/src/mr_openapi/test/test_model_version_update.py b/clients/python/src/mr_openapi/test/test_model_version_update.py new file mode 100644 index 000000000..d436fd1c4 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_model_version_update.py @@ -0,0 +1,56 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.model_version_update import ModelVersionUpdate + + +class TestModelVersionUpdate(unittest.TestCase): + """ModelVersionUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ModelVersionUpdate: + """Test ModelVersionUpdate + include_option 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 `ModelVersionUpdate` + """ + model = ModelVersionUpdate() + if include_optional: + return ModelVersionUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + state = 'LIVE', + author = '' + ) + else: + return ModelVersionUpdate( + ) + """ + + def testModelVersionUpdate(self): + """Test ModelVersionUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_order_by_field.py b/clients/python/src/mr_openapi/test/test_order_by_field.py new file mode 100644 index 000000000..6a8280e84 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_order_by_field.py @@ -0,0 +1,29 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestOrderByField(unittest.TestCase): + """OrderByField unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testOrderByField(self): + """Test OrderByField.""" + # inst = OrderByField() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/src/mr_openapi/test/test_registered_model.py b/clients/python/src/mr_openapi/test/test_registered_model.py new file mode 100644 index 000000000..680df55c3 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_registered_model.py @@ -0,0 +1,60 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.registered_model import RegisteredModel + + +class TestRegisteredModel(unittest.TestCase): + """RegisteredModel unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RegisteredModel: + """Test RegisteredModel + include_option 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 `RegisteredModel` + """ + model = RegisteredModel() + if include_optional: + return RegisteredModel( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '', + owner = '', + state = 'LIVE' + ) + else: + return RegisteredModel( + ) + """ + + def testRegisteredModel(self): + """Test RegisteredModel.""" + # 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/clients/python/src/mr_openapi/test/test_registered_model_create.py b/clients/python/src/mr_openapi/test/test_registered_model_create.py new file mode 100644 index 000000000..4d1030998 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_registered_model_create.py @@ -0,0 +1,57 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.registered_model_create import RegisteredModelCreate + + +class TestRegisteredModelCreate(unittest.TestCase): + """RegisteredModelCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RegisteredModelCreate: + """Test RegisteredModelCreate + include_option 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 `RegisteredModelCreate` + """ + model = RegisteredModelCreate() + if include_optional: + return RegisteredModelCreate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + owner = '', + state = 'LIVE' + ) + else: + return RegisteredModelCreate( + ) + """ + + def testRegisteredModelCreate(self): + """Test RegisteredModelCreate.""" + # 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/clients/python/src/mr_openapi/test/test_registered_model_list.py b/clients/python/src/mr_openapi/test/test_registered_model_list.py new file mode 100644 index 000000000..ce380cfef --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_registered_model_list.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.registered_model_list import RegisteredModelList + + +class TestRegisteredModelList(unittest.TestCase): + """RegisteredModelList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RegisteredModelList: + """Test RegisteredModelList + include_option 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 `RegisteredModelList` + """ + model = RegisteredModelList() + if include_optional: + return RegisteredModelList( + next_page_token = '', + page_size = 56, + size = 56, + items = [ + null + ] + ) + else: + return RegisteredModelList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testRegisteredModelList(self): + """Test RegisteredModelList.""" + # 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/clients/python/src/mr_openapi/test/test_registered_model_state.py b/clients/python/src/mr_openapi/test/test_registered_model_state.py new file mode 100644 index 000000000..6bcdd294c --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_registered_model_state.py @@ -0,0 +1,29 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestRegisteredModelState(unittest.TestCase): + """RegisteredModelState unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testRegisteredModelState(self): + """Test RegisteredModelState.""" + # inst = RegisteredModelState() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/src/mr_openapi/test/test_registered_model_update.py b/clients/python/src/mr_openapi/test/test_registered_model_update.py new file mode 100644 index 000000000..2cf645e25 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_registered_model_update.py @@ -0,0 +1,56 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.registered_model_update import RegisteredModelUpdate + + +class TestRegisteredModelUpdate(unittest.TestCase): + """RegisteredModelUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> RegisteredModelUpdate: + """Test RegisteredModelUpdate + include_option 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 `RegisteredModelUpdate` + """ + model = RegisteredModelUpdate() + if include_optional: + return RegisteredModelUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + owner = '', + state = 'LIVE' + ) + else: + return RegisteredModelUpdate( + ) + """ + + def testRegisteredModelUpdate(self): + """Test RegisteredModelUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_serve_model.py b/clients/python/src/mr_openapi/test/test_serve_model.py new file mode 100644 index 000000000..f95fc624e --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serve_model.py @@ -0,0 +1,61 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serve_model import ServeModel + + +class TestServeModel(unittest.TestCase): + """ServeModel unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServeModel: + """Test ServeModel + include_option 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 `ServeModel` + """ + model = ServeModel() + if include_optional: + return ServeModel( + last_known_state = 'UNKNOWN', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '', + model_version_id = '' + ) + else: + return ServeModel( + model_version_id = '', + ) + """ + + def testServeModel(self): + """Test ServeModel.""" + # 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/clients/python/src/mr_openapi/test/test_serve_model_create.py b/clients/python/src/mr_openapi/test/test_serve_model_create.py new file mode 100644 index 000000000..faf7d07dd --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serve_model_create.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serve_model_create import ServeModelCreate + + +class TestServeModelCreate(unittest.TestCase): + """ServeModelCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServeModelCreate: + """Test ServeModelCreate + include_option 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 `ServeModelCreate` + """ + model = ServeModelCreate() + if include_optional: + return ServeModelCreate( + last_known_state = 'UNKNOWN', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + model_version_id = '' + ) + else: + return ServeModelCreate( + model_version_id = '', + ) + """ + + def testServeModelCreate(self): + """Test ServeModelCreate.""" + # 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/clients/python/src/mr_openapi/test/test_serve_model_list.py b/clients/python/src/mr_openapi/test/test_serve_model_list.py new file mode 100644 index 000000000..1f2740d1d --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serve_model_list.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serve_model_list import ServeModelList + + +class TestServeModelList(unittest.TestCase): + """ServeModelList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServeModelList: + """Test ServeModelList + include_option 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 `ServeModelList` + """ + model = ServeModelList() + if include_optional: + return ServeModelList( + next_page_token = '', + page_size = 56, + size = 56, + items = [ + mr_openapi.models.serve_model.ServeModel() + ] + ) + else: + return ServeModelList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testServeModelList(self): + """Test ServeModelList.""" + # 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/clients/python/src/mr_openapi/test/test_serve_model_update.py b/clients/python/src/mr_openapi/test/test_serve_model_update.py new file mode 100644 index 000000000..bb59e1a21 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serve_model_update.py @@ -0,0 +1,55 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serve_model_update import ServeModelUpdate + + +class TestServeModelUpdate(unittest.TestCase): + """ServeModelUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServeModelUpdate: + """Test ServeModelUpdate + include_option 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 `ServeModelUpdate` + """ + model = ServeModelUpdate() + if include_optional: + return ServeModelUpdate( + last_known_state = 'UNKNOWN', + custom_properties = { + 'key' : null + }, + description = '', + external_id = '' + ) + else: + return ServeModelUpdate( + ) + """ + + def testServeModelUpdate(self): + """Test ServeModelUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_serving_environment.py b/clients/python/src/mr_openapi/test/test_serving_environment.py new file mode 100644 index 000000000..fce796b0a --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serving_environment.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serving_environment import ServingEnvironment + + +class TestServingEnvironment(unittest.TestCase): + """ServingEnvironment unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServingEnvironment: + """Test ServingEnvironment + include_option 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 `ServingEnvironment` + """ + model = ServingEnvironment() + if include_optional: + return ServingEnvironment( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '', + id = '', + create_time_since_epoch = '', + last_update_time_since_epoch = '' + ) + else: + return ServingEnvironment( + ) + """ + + def testServingEnvironment(self): + """Test ServingEnvironment.""" + # 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/clients/python/src/mr_openapi/test/test_serving_environment_create.py b/clients/python/src/mr_openapi/test/test_serving_environment_create.py new file mode 100644 index 000000000..7a6fd6c51 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serving_environment_create.py @@ -0,0 +1,55 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serving_environment_create import ServingEnvironmentCreate + + +class TestServingEnvironmentCreate(unittest.TestCase): + """ServingEnvironmentCreate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServingEnvironmentCreate: + """Test ServingEnvironmentCreate + include_option 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 `ServingEnvironmentCreate` + """ + model = ServingEnvironmentCreate() + if include_optional: + return ServingEnvironmentCreate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '', + name = '' + ) + else: + return ServingEnvironmentCreate( + ) + """ + + def testServingEnvironmentCreate(self): + """Test ServingEnvironmentCreate.""" + # 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/clients/python/src/mr_openapi/test/test_serving_environment_list.py b/clients/python/src/mr_openapi/test/test_serving_environment_list.py new file mode 100644 index 000000000..659b14f19 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serving_environment_list.py @@ -0,0 +1,58 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serving_environment_list import ServingEnvironmentList + + +class TestServingEnvironmentList(unittest.TestCase): + """ServingEnvironmentList unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServingEnvironmentList: + """Test ServingEnvironmentList + include_option 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 `ServingEnvironmentList` + """ + model = ServingEnvironmentList() + if include_optional: + return ServingEnvironmentList( + next_page_token = '', + page_size = 56, + size = 56, + items = [ + null + ] + ) + else: + return ServingEnvironmentList( + next_page_token = '', + page_size = 56, + size = 56, + ) + """ + + def testServingEnvironmentList(self): + """Test ServingEnvironmentList.""" + # 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/clients/python/src/mr_openapi/test/test_serving_environment_update.py b/clients/python/src/mr_openapi/test/test_serving_environment_update.py new file mode 100644 index 000000000..5eb857e49 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_serving_environment_update.py @@ -0,0 +1,54 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + +from mr_openapi.models.serving_environment_update import ServingEnvironmentUpdate + + +class TestServingEnvironmentUpdate(unittest.TestCase): + """ServingEnvironmentUpdate unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ServingEnvironmentUpdate: + """Test ServingEnvironmentUpdate + include_option 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 `ServingEnvironmentUpdate` + """ + model = ServingEnvironmentUpdate() + if include_optional: + return ServingEnvironmentUpdate( + custom_properties = { + 'key' : null + }, + description = '', + external_id = '' + ) + else: + return ServingEnvironmentUpdate( + ) + """ + + def testServingEnvironmentUpdate(self): + """Test ServingEnvironmentUpdate.""" + # 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/clients/python/src/mr_openapi/test/test_sort_order.py b/clients/python/src/mr_openapi/test/test_sort_order.py new file mode 100644 index 000000000..70061fa76 --- /dev/null +++ b/clients/python/src/mr_openapi/test/test_sort_order.py @@ -0,0 +1,29 @@ +"""Model Registry REST API. + +REST API for Model Registry to create and manage ML model metadata + +The version of the OpenAPI document: v1alpha3 +Generated by OpenAPI Generator (https://openapi-generator.tech) + +Do not edit the class manually. +""" # noqa: E501 + +import unittest + + +class TestSortOrder(unittest.TestCase): + """SortOrder unit test stubs.""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testSortOrder(self): + """Test SortOrder.""" + # inst = SortOrder() + + +if __name__ == "__main__": + unittest.main() diff --git a/clients/python/tests/__init__.py b/clients/python/tests/__init__.py index b2b301e14..2d0446fe5 100644 --- a/clients/python/tests/__init__.py +++ b/clients/python/tests/__init__.py @@ -1,15 +1 @@ """Tests for model registry.""" - -from dataclasses import dataclass -from typing import Generic, TypeVar - -from model_registry.store import ProtoType -from model_registry.types.base import ProtoBase - -P = TypeVar("P", bound=ProtoBase) - - -@dataclass -class Mapped(Generic[P]): - proto: ProtoType - py: P diff --git a/clients/python/tests/basic_test.py b/clients/python/tests/basic_test.py new file mode 100644 index 000000000..8c0a87ec5 --- /dev/null +++ b/clients/python/tests/basic_test.py @@ -0,0 +1,147 @@ +"""Tests creation and retrieval of base models.""" + +import mr_openapi +import pytest +from mr_openapi import ( + Artifact, + DocArtifact, + MetadataValue, + ModelArtifact, + ModelVersionCreate, + RegisteredModelCreate, +) + +from .conftest import REGISTRY_URL, cleanup + + +@pytest.fixture() +@cleanup +async def client(): + config = mr_openapi.Configuration(REGISTRY_URL) + api_client = mr_openapi.ApiClient(config) + client = mr_openapi.ModelRegistryServiceApi(api_client) + yield client + await api_client.close() + + +@pytest.fixture() +def rm_create() -> RegisteredModelCreate: + return RegisteredModelCreate(name="registered", description="a registered model") + + +@pytest.fixture() +async def mv_create(client, rm_create) -> ModelVersionCreate: + # HACK: create an RM first because we need an ID for the instance + rm = await client.create_registered_model(rm_create) + assert rm is not None + return ModelVersionCreate( + name="version", + author="author", + registeredModelId=rm.id, + description="a model version", + ) + + +async def test_registered_model(client, rm_create): + rm_create.custom_properties = { + "key1": MetadataValue.from_dict( + {"string_value": "value1", "metadataType": "MetadataStringValue"}, + ) + } + + new_rm = await client.create_registered_model(rm_create) + print("created RM", new_rm, "with ID", new_rm.id) + assert rm_create.name == new_rm.name + assert rm_create.description == new_rm.description + assert new_rm.custom_properties == rm_create.custom_properties + + by_find = await client.find_registered_model(name=new_rm.name) + print("found RM", by_find, "with ID", by_find.id) + assert by_find == new_rm + assert by_find.id == new_rm.id + assert new_rm.name == by_find.name + assert new_rm.description == by_find.description + + +async def test_model_version(client, mv_create): + mv_create.custom_properties = { + "key1": MetadataValue.from_dict( + {"string_value": "value1", "metadataType": "MetadataStringValue"}, + ) + } + + new_mv = await client.create_model_version(mv_create) + print("created MV", new_mv, "with ID", new_mv.id) + assert mv_create.name == new_mv.name + assert mv_create.author == new_mv.author + assert mv_create.description == new_mv.description + assert mv_create.custom_properties == new_mv.custom_properties + + by_find = await client.get_model_version(new_mv.id) + print("found MV", by_find) + assert new_mv.id == by_find.id + assert new_mv.name == by_find.name + assert new_mv.author == by_find.author + assert new_mv.description == by_find.description + assert new_mv.custom_properties == by_find.custom_properties + + +async def test_model_artifact(client, mv_create): + mv = await client.create_model_version(mv_create) + assert mv is not None + + ma_create = ModelArtifact( + name="model", + uri="uri", + artifactType="model-artifact", + description="a model artifact", + customProperties={ + "key1": MetadataValue.from_dict( + {"string_value": "value1", "metadataType": "MetadataStringValue"}, + ) + }, + ) + + new_ma = ( + await client.create_model_version_artifact(mv.id, Artifact(ma_create)) + ).actual_instance + assert new_ma is not None + print("created MA", new_ma, "with ID", new_ma.id) + assert isinstance(new_ma, ModelArtifact) + assert ma_create.name == new_ma.name + assert ma_create.uri == new_ma.uri + assert ma_create.description == new_ma.description + assert ma_create.custom_properties == new_ma.custom_properties + + by_find = await client.get_model_artifact(new_ma.id) + assert by_find is not None + print("found MA", by_find) + assert new_ma.id == by_find.id + assert new_ma.name == by_find.name + assert new_ma.uri == by_find.uri + assert new_ma.description == by_find.description + assert new_ma.custom_properties == by_find.custom_properties + + doc_art = DocArtifact( + artifactType="doc-artifact", + uri="https://acme.org/README.md", + customProperties={ + "key1": MetadataValue.from_dict( + {"string_value": "value1", "metadataType": "MetadataStringValue"}, + ) + }, + ) + + new_da = ( + await client.create_model_version_artifact(mv.id, Artifact(doc_art)) + ).actual_instance + assert new_da is not None + print("created DA", new_da, "with ID", new_da.id) + assert isinstance(new_da, DocArtifact) + assert new_da.id != new_ma.id + assert new_da.uri == doc_art.uri + + list_artifacts = await client.get_model_version_artifacts(mv.id) + assert list_artifacts is not None + print("list artifacts", list_artifacts) + assert list_artifacts.size == 2 diff --git a/clients/python/tests/conftest.py b/clients/python/tests/conftest.py index b5ceb1e28..6f59cef36 100644 --- a/clients/python/tests/conftest.py +++ b/clients/python/tests/conftest.py @@ -1,200 +1,112 @@ +import asyncio +import inspect import os +import subprocess import time -from typing import Union +from contextlib import asynccontextmanager +from pathlib import Path +from time import sleep import pytest -from ml_metadata import errors, metadata_store -from ml_metadata.proto import ( - ArtifactType, - ContextType, - metadata_store_pb2, -) -from ml_metadata.proto.metadata_store_pb2 import MetadataStoreClientConfig -from model_registry.core import ModelRegistryAPIClient -from model_registry.store.wrapper import MLMDStore -from model_registry.types import ModelArtifact, ModelVersion, RegisteredModel -from testcontainers.core.container import DockerContainer -from testcontainers.core.waiting_utils import wait_for_logs - -ProtoTypeType = Union[ArtifactType, ContextType] - - -# ruff: noqa: PT021 supported -@pytest.fixture(scope="session") -def mlmd_port(request) -> int: - model_registry_root_dir = model_registry_root(request) - print( - "Assuming this is the Model Registry root directory:", model_registry_root_dir - ) - shared_volume = model_registry_root_dir / "test/config/ml-metadata" - sqlite_db_file = shared_volume / "metadata.sqlite.db" - if sqlite_db_file.exists(): - msg = f"The file {sqlite_db_file} already exists; make sure to cancel it before running these tests." - raise FileExistsError(msg) - container = DockerContainer("gcr.io/tfx-oss-public/ml_metadata_store_server:1.14.0") - container.with_exposed_ports(8080) - container.with_volume_mapping( - shared_volume, - "/tmp/shared", # noqa: S108 - "rw", - ) - container.with_env( - "METADATA_STORE_SERVER_CONFIG_FILE", - "/tmp/shared/conn_config.pb", # noqa: S108 - ) - container.start() - wait_for_logs(container, "Server listening on") - os.system('docker container ls --format "table {{.ID}}\t{{.Names}}\t{{.Ports}}" -a') # noqa governed test - print("waited for logs and port") - port = int(container.get_exposed_port(8080)) - print("port:", port) - - # this callback is needed in order to perform the container.stop() - # removing this callback might result in mlmd container shutting down before the tests had chance to fully run, - # and resulting in grpc connection resets. - def teardown(): - container.stop() - print("teardown of plain_wrapper completed.") - - request.addfinalizer(teardown) - - time.sleep( - 3 - ) # allowing some time for mlmd grpc to fully stabilize (is "spent" once per pytest session anyway) - _throwaway_store = metadata_store.MetadataStore( - MetadataStoreClientConfig(host="localhost", port=port) - ) - wait_for_grpc(container, _throwaway_store) +import requests +from aiohttp.helpers import isasyncgenfunction - return port +REGISTRY_HOST = "http://localhost" +REGISTRY_PORT = 8080 +REGISTRY_URL = f"{REGISTRY_HOST}:{REGISTRY_PORT}" +COMPOSE_FILE = "docker-compose.yaml" +MAX_POLL_TIME = 1200 # the first build is extremely slow if using docker-compose-*local*.yaml for bootstrap of builder image +POLL_INTERVAL = 1 +DOCKER = os.getenv("DOCKER", "docker") +start_time = time.time() -def model_registry_root(request): +@pytest.fixture(scope="session") +def root(request) -> Path: return (request.config.rootpath / "../..").resolve() # resolves to absolute path -@pytest.fixture() -def plain_wrapper(request, mlmd_port: int) -> MLMDStore: - sqlite_db_file = ( - model_registry_root(request) / "test/config/ml-metadata/metadata.sqlite.db" - ) +def poll_for_ready(): + while True: + elapsed_time = time.time() - start_time + if elapsed_time >= MAX_POLL_TIME: + print("Polling timed out.") + break - def teardown(): + print("Attempt to connect") try: - os.remove(sqlite_db_file) - print(f"Removed {sqlite_db_file} successfully.") - except Exception as e: - print(f"An error occurred while removing {sqlite_db_file}: {e}") - print("plain_wrapper_after_each done.") - - request.addfinalizer(teardown) - - to_return = MLMDStore.from_config("localhost", mlmd_port) - sanity_check_mlmd_connection_to_db(to_return) - return to_return - + response = requests.get(REGISTRY_URL, timeout=MAX_POLL_TIME) + if response.status_code == 404: + print("Server is up!") + break + except requests.exceptions.ConnectionError: + pass -def set_type_attrs(mlmd_obj: ProtoTypeType, name: str, props: list[str]): - mlmd_obj.name = name - for key in props: - mlmd_obj.properties[key] = metadata_store_pb2.STRING - return mlmd_obj + # Wait for the specified poll interval before trying again + time.sleep(POLL_INTERVAL) -def sanity_check_mlmd_connection_to_db(overview: MLMDStore): - # sanity check before each test: connect to MLMD directly, and dry-run any of the gRPC (read) operations; - # on newer Podman might delay in recognising volume mount files for sqlite3 db, - # hence in case of error "Cannot connect sqlite3 database: unable to open database file" make some retries. - retry_count = 0 - while retry_count < 3: - retry_count += 1 - try: - overview.store.get_artifact_types() - return - except Exception as e: - if ( - str(e) - == "Cannot connect sqlite3 database: unable to open database file" - ): - time.sleep(1) - else: - msg = "Failed to sanity check before each test, another type of error detected." - raise RuntimeError(msg) from e - msg = "Failed to sanity check before each test." - raise RuntimeError(msg) - - -@pytest.fixture() -def store_wrapper(plain_wrapper: MLMDStore) -> MLMDStore: - ma_type = set_type_attrs( - ArtifactType(), - ModelArtifact.get_proto_type_name(), - [ - "description", - "model_format_name", - "model_format_version", - "storage_key", - "storage_path", - "service_account_name", - ], - ) - - plain_wrapper.store.put_artifact_type(ma_type) - - mv_type = set_type_attrs( - ContextType(), - ModelVersion.get_proto_type_name(), - [ - "author", - "description", - "model_name", - "state", - ], +@pytest.fixture(scope="session", autouse=True) +def _compose_mr(root): + print("Assuming this is the Model Registry root directory:", root) + shared_volume = root / "test/config/ml-metadata" + sqlite_db_file = shared_volume / "metadata.sqlite.db" + if sqlite_db_file.exists(): + msg = f"The file {sqlite_db_file} already exists; make sure to cancel it before running these tests." + raise FileExistsError(msg) + print(f" Starting Docker Compose in folder {root}") + p = subprocess.Popen( + f"{DOCKER} compose -f {COMPOSE_FILE} up --build", + shell=True, # noqa: S602 + cwd=root, ) - - plain_wrapper.store.put_context_type(mv_type) - - rm_type = set_type_attrs( - ContextType(), - RegisteredModel.get_proto_type_name(), - [ - "description", - "state", - "owner", - ], + yield + + p.kill() + print(f" Closing Docker Compose in folder {root}") + subprocess.call( + f"{DOCKER} compose -f {COMPOSE_FILE} down", + shell=True, # noqa: S602 + cwd=root, ) + try: + os.remove(sqlite_db_file) + print(f"Removed {sqlite_db_file} successfully.") + except Exception as e: + print(f"An error occurred while removing {sqlite_db_file}: {e}") + + +def cleanup(client): + async def yield_and_restart(root): + poll_for_ready() + if inspect.iscoroutinefunction(client) or isasyncgenfunction(client): + async with asynccontextmanager(client)() as async_client: + yield async_client + else: + yield client() + + sqlite_db_file = root / "test/config/ml-metadata/metadata.sqlite.db" + try: + os.remove(sqlite_db_file) + print(f"Removed {sqlite_db_file} successfully.") + except Exception as e: + print(f"An error occurred while removing {sqlite_db_file}: {e}") + # we have to wait to make sure the server restarts after the file is gone + sleep(1) - plain_wrapper.store.put_context_type(rm_type) - - return plain_wrapper - + print("Restarting model-registry...") + subprocess.call( + f"{DOCKER} compose -f {COMPOSE_FILE} restart model-registry", + shell=True, # noqa: S602 + cwd=root, + ) -@pytest.fixture() -def mr_api(store_wrapper: MLMDStore) -> ModelRegistryAPIClient: - mr = object.__new__(ModelRegistryAPIClient) - mr.store = store_wrapper - return mr + return yield_and_restart -def wait_for_grpc( - container: DockerContainer, - store: metadata_store.MetadataStore, - timeout=6, - interval=2, -): - start = time.time() - while True: - duration = time.time() - start - results = None - try: - results = store.get_contexts() - except errors.UnavailableError as e: - print(e) - print("Container logs:\n", container.get_logs()) - print("Container not ready. Retrying...") - if results is not None: - return duration - if timeout and duration > timeout: - msg = f"wait_for_grpc not ready {timeout:.3f} seconds" - raise TimeoutError(msg) - time.sleep(interval) +# workaround: https://github.com/pytest-dev/pytest-asyncio/issues/706#issuecomment-2147044022 +@pytest.fixture(scope="session", autouse=True) +def event_loop(): + loop = asyncio.get_event_loop_policy().get_event_loop() + yield loop + loop.close() diff --git a/clients/python/tests/store/__init__.py b/clients/python/tests/store/__init__.py deleted file mode 100644 index ec9239a76..000000000 --- a/clients/python/tests/store/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for the store module.""" diff --git a/clients/python/tests/store/test_wrapper.py b/clients/python/tests/store/test_wrapper.py deleted file mode 100644 index 1ff1d2239..000000000 --- a/clients/python/tests/store/test_wrapper.py +++ /dev/null @@ -1,133 +0,0 @@ -"""Tests behavior of the MLMD wrapper. - -Tests whether the wrapper is properly handling misuses of the MLMD store, as common use cases -are already covered by the Registry client. -""" - -import pytest -from ml_metadata.proto import ( - Artifact, - ArtifactType, - Context, - ContextType, -) -from model_registry.exceptions import ( - DuplicateException, - StoreException, - TypeNotFoundException, -) -from model_registry.store import MLMDStore -from model_registry.types.options import MLMDListOptions - - -@pytest.fixture() -def artifact(plain_wrapper: MLMDStore) -> Artifact: - art_type = ArtifactType() - art_type.name = "test_artifact" - - art = Artifact() - art.name = "test_artifact" - art.type_id = plain_wrapper.store.put_artifact_type(art_type) - - return art - - -@pytest.fixture() -def context(plain_wrapper: MLMDStore) -> Context: - ctx_type = ContextType() - ctx_type.name = "test_context" - - ctx = Context() - ctx.name = "test_context" - ctx.type_id = plain_wrapper.store.put_context_type(ctx_type) - - return ctx - - -def test_get_undefined_artifact_type_id(plain_wrapper: MLMDStore): - with pytest.raises(TypeNotFoundException): - plain_wrapper.get_type_id(Artifact, "undefined") - - -def test_get_undefined_context_type_id(plain_wrapper: MLMDStore): - with pytest.raises(TypeNotFoundException): - plain_wrapper.get_type_id(Context, "undefined") - - -@pytest.mark.usefixtures("artifact") -def test_get_no_artifacts(plain_wrapper: MLMDStore): - arts = plain_wrapper.get_artifacts("test_artifact", MLMDListOptions()) - assert arts == [] - - -def test_get_undefined_artifacts(plain_wrapper: MLMDStore): - with pytest.raises(TypeNotFoundException): - plain_wrapper.get_artifacts("undefined", MLMDListOptions()) - - -@pytest.mark.usefixtures("context") -def test_get_no_contexts(plain_wrapper: MLMDStore): - ctxs = plain_wrapper.get_contexts("test_context", MLMDListOptions()) - assert ctxs == [] - - -def test_get_undefined_contexts(plain_wrapper: MLMDStore): - with pytest.raises(TypeNotFoundException): - plain_wrapper.get_contexts("undefined", MLMDListOptions()) - - -def test_put_invalid_artifact(plain_wrapper: MLMDStore, artifact: Artifact): - artifact.properties["null"].int_value = 0 - - with pytest.raises(StoreException): - plain_wrapper.put_artifact(artifact) - - -def test_put_duplicate_artifact(plain_wrapper: MLMDStore, artifact: Artifact): - plain_wrapper.store.put_artifacts([artifact]) - with pytest.raises(DuplicateException): - plain_wrapper.put_artifact(artifact) - - -def test_put_invalid_context(plain_wrapper: MLMDStore, context: Context): - context.properties["null"].int_value = 0 - - with pytest.raises(StoreException): - plain_wrapper.put_context(context) - - -def test_put_duplicate_context(plain_wrapper: MLMDStore, context: Context): - plain_wrapper.store.put_contexts([context]) - - with pytest.raises(DuplicateException): - plain_wrapper.put_context(context) - - -def test_put_attribution_with_invalid_context( - plain_wrapper: MLMDStore, artifact: Artifact -): - art_id = plain_wrapper.store.put_artifacts([artifact])[0] - - with pytest.raises(StoreException) as store_error: - plain_wrapper.put_attribution(0, art_id) - - assert "context" in str(store_error.value).lower() - - -def test_put_attribution_with_invalid_artifact( - plain_wrapper: MLMDStore, context: Context -): - ctx_id = plain_wrapper.store.put_contexts([context])[0] - - with pytest.raises(StoreException) as store_error: - plain_wrapper.put_attribution(ctx_id, 0) - - assert "artifact" in str(store_error.value).lower() - - -def test_get_undefined_artifact_by_id(plain_wrapper: MLMDStore): - assert plain_wrapper.get_artifact("dup", 0) is None - - -def test_get_undefined_context_by_id(plain_wrapper: MLMDStore): - assert plain_wrapper.get_context("dup", 0) is None diff --git a/clients/python/tests/test_client.py b/clients/python/tests/test_client.py index be041fa45..698ac68a4 100644 --- a/clients/python/tests/test_client.py +++ b/clients/python/tests/test_client.py @@ -2,51 +2,53 @@ import pytest from model_registry import ModelRegistry, utils -from model_registry.core import ModelRegistryAPIClient -from model_registry.exceptions import StoreException +from model_registry.exceptions import StoreError + +from .conftest import REGISTRY_HOST, REGISTRY_PORT, cleanup @pytest.fixture() -def mr_client(mr_api: ModelRegistryAPIClient) -> ModelRegistry: - mr = ModelRegistry.__new__(ModelRegistry) - mr._api = mr_api - mr._author = "test_author" - return mr +@cleanup +def client() -> ModelRegistry: + return ModelRegistry(REGISTRY_HOST, REGISTRY_PORT, author="author", is_secure=False) def test_secure_client(): os.environ["CERT"] = "" os.environ["KF_PIPELINES_SA_TOKEN_PATH"] = "" - with pytest.raises(StoreException) as e: + with pytest.raises(StoreError) as e: ModelRegistry("anything", author="test_author") assert "user token" in str(e.value).lower() -def test_register_new(mr_client: ModelRegistry): +async def test_register_new(client: ModelRegistry): name = "test_model" version = "1.0.0" - rm = mr_client.register_model( + rm = client.register_model( name, "s3", model_format_name="test_format", model_format_version="test_version", version=version, ) - assert rm.id is not None + assert rm.id - mr_api = mr_client._api - assert (mv := mr_api.get_model_version_by_params(rm.id, version)) is not None - assert mr_api.get_model_artifact_by_params(mv.id) is not None + mr_api = client._api + mv = await mr_api.get_model_version_by_params(rm.id, version) + assert mv + assert mv.id + ma = await mr_api.get_model_artifact_by_params(name, mv.id) + assert ma -def test_register_new_using_s3_uri_builder(mr_client: ModelRegistry): +async def test_register_new_using_s3_uri_builder(client: ModelRegistry): name = "test_model" version = "1.0.0" uri = utils.s3_uri_from( "storage/path", "my-bucket", endpoint="my-endpoint", region="my-region" ) - rm = mr_client.register_model( + rm = client.register_model( name, uri, model_format_name="test_format", @@ -55,13 +57,16 @@ def test_register_new_using_s3_uri_builder(mr_client: ModelRegistry): ) assert rm.id is not None - mr_api = mr_client._api - assert (mv := mr_api.get_model_version_by_params(rm.id, version)) is not None - assert (ma := mr_api.get_model_artifact_by_params(mv.id)) is not None + mr_api = client._api + mv = await mr_api.get_model_version_by_params(rm.id, version) + assert mv + assert mv.id + ma = await mr_api.get_model_artifact_by_params(name, mv.id) + assert ma assert ma.uri == uri -def test_register_existing_version(mr_client: ModelRegistry): +def test_register_existing_version(client: ModelRegistry): params = { "name": "test_model", "uri": "s3", @@ -69,18 +74,18 @@ def test_register_existing_version(mr_client: ModelRegistry): "model_format_version": "test_version", "version": "1.0.0", } - mr_client.register_model(**params) + client.register_model(**params) - with pytest.raises(StoreException): - mr_client.register_model(**params) + with pytest.raises(StoreError): + client.register_model(**params) -def test_get(mr_client: ModelRegistry): +async def test_get(client: ModelRegistry): name = "test_model" version = "1.0.0" metadata = {"a": 1, "b": "2"} - rm = mr_client.register_model( + rm = client.register_model( name, "s3", model_format_name="test_format", @@ -89,27 +94,28 @@ def test_get(mr_client: ModelRegistry): metadata=metadata, ) - assert (_rm := mr_client.get_registered_model(name)) + assert (_rm := client.get_registered_model(name)) assert rm.id == _rm.id - mr_api = mr_client._api - assert (mv := mr_api.get_model_version_by_params(rm.id, version)) - assert (ma := mr_api.get_model_artifact_by_params(mv.id)) + mr_api = client._api + assert (mv := await mr_api.get_model_version_by_params(rm.id, version)) + assert mv.id + assert (ma := await mr_api.get_model_artifact_by_params(name, mv.id)) - assert (_mv := mr_client.get_model_version(name, version)) + assert (_mv := client.get_model_version(name, version)) assert mv.id == _mv.id - assert mv.metadata == metadata - assert (_ma := mr_client.get_model_artifact(name, version)) + assert mv.custom_properties == metadata + assert (_ma := client.get_model_artifact(name, version)) assert ma.id == _ma.id -def test_hf_import(mr_client: ModelRegistry): +def test_hf_import(client: ModelRegistry): pytest.importorskip("huggingface_hub") name = "openai-community/gpt2" version = "1.2.3" author = "test author" - assert mr_client.register_hf_model( + assert client.register_hf_model( name, "onnx/decoder_model.onnx", author=author, @@ -117,19 +123,20 @@ def test_hf_import(mr_client: ModelRegistry): model_format_name="test format", model_format_version="test version", ) - assert (mv := mr_client.get_model_version(name, version)) + assert (mv := client.get_model_version(name, version)) assert mv.author == author - assert mv.metadata["model_author"] == author - assert mv.metadata["model_origin"] == "huggingface_hub" + assert mv.custom_properties + assert mv.custom_properties["model_author"] == author + assert mv.custom_properties["model_origin"] == "huggingface_hub" assert ( - mv.metadata["source_uri"] + mv.custom_properties["source_uri"] == "https://huggingface.co/openai-community/gpt2/resolve/main/onnx/decoder_model.onnx" ) - assert mv.metadata["repo"] == name - assert mr_client.get_model_artifact(name, version) + assert mv.custom_properties["repo"] == name + assert client.get_model_artifact(name, version) -def test_hf_import_default_env(mr_client: ModelRegistry): +def test_hf_import_default_env(client: ModelRegistry): """Test setting environment variables, hence triggering defaults, does _not_ interfere with HF metadata""" pytest.importorskip("huggingface_hub") name = "openai-community/gpt2" @@ -143,7 +150,7 @@ def test_hf_import_default_env(mr_client: ModelRegistry): for k, v in env_values.items(): os.environ[k] = v - assert mr_client.register_hf_model( + assert client.register_hf_model( name, "onnx/decoder_model.onnx", author=author, @@ -151,15 +158,16 @@ def test_hf_import_default_env(mr_client: ModelRegistry): model_format_name="test format", model_format_version="test version", ) - assert (mv := mr_client.get_model_version(name, version)) - assert mv.metadata["model_author"] == author - assert mv.metadata["model_origin"] == "huggingface_hub" + assert (mv := client.get_model_version(name, version)) + assert mv.custom_properties + assert mv.custom_properties["model_author"] == author + assert mv.custom_properties["model_origin"] == "huggingface_hub" assert ( - mv.metadata["source_uri"] + mv.custom_properties["source_uri"] == "https://huggingface.co/openai-community/gpt2/resolve/main/onnx/decoder_model.onnx" ) - assert mv.metadata["repo"] == name - assert mr_client.get_model_artifact(name, version) + assert mv.custom_properties["repo"] == name + assert client.get_model_artifact(name, version) for k in env_values: os.environ.pop(k) diff --git a/clients/python/tests/test_core.py b/clients/python/tests/test_core.py index bfbcf33c4..9ea6071c6 100644 --- a/clients/python/tests/test_core.py +++ b/clients/python/tests/test_core.py @@ -1,351 +1,266 @@ """Tests for user facing model registry APIs.""" import pytest -from attrs import evolve -from ml_metadata.proto import ( - Artifact, - Attribution, - Context, - ParentContext, -) from model_registry.core import ModelRegistryAPIClient -from model_registry.exceptions import StoreException -from model_registry.store import MLMDStore from model_registry.types import ModelArtifact, ModelVersion, RegisteredModel -from . import Mapped +from .conftest import REGISTRY_HOST, REGISTRY_PORT, cleanup @pytest.fixture() -def model(store_wrapper: MLMDStore) -> Mapped: - art = Artifact() - # we can't test the name directly as it's prefixed - art.name = "model" - art.type_id = store_wrapper.get_type_id( - Artifact, ModelArtifact.get_proto_type_name() - ) +@cleanup +def client(): + return ModelRegistryAPIClient.insecure_connection(REGISTRY_HOST, REGISTRY_PORT) - art.uri = "uri" - return Mapped(art, ModelArtifact("model", "uri")) +async def test_insert_registered_model(client: ModelRegistryAPIClient): + registered_model = RegisteredModel(name="test rm") + rm = await client.upsert_registered_model(registered_model) + assert rm.id + assert rm.name == registered_model.name + assert rm.external_id is None + assert rm.description is None + assert rm.create_time_since_epoch + assert rm.last_update_time_since_epoch -@pytest.fixture() -def model_version(store_wrapper: MLMDStore, model: Mapped) -> Mapped: - ctx = Context() - # we can't test the name directly as it's prefixed - ctx.name = "version" - ctx.type_id = store_wrapper.get_type_id(Context, ModelVersion.get_proto_type_name()) - ctx.properties["author"].string_value = "author" - ctx.properties["model_name"].string_value = model.py.name - ctx.properties["state"].string_value = "LIVE" +async def test_update_registered_model(client: ModelRegistryAPIClient): + registered_model = RegisteredModel(name="updated rm") + rm = await client.upsert_registered_model(registered_model) + last_update = rm.last_update_time_since_epoch + rm.description = "lorem ipsum" + rm = await client.upsert_registered_model(rm) - return Mapped(ctx, ModelVersion(model.py.name, "version", "author")) + assert rm.description == "lorem ipsum" + assert rm.last_update_time_since_epoch != last_update @pytest.fixture() -def registered_model(store_wrapper: MLMDStore, model: Mapped) -> Mapped: - ctx = Context() - ctx.name = model.py.name - ctx.type_id = store_wrapper.get_type_id( - Context, RegisteredModel.get_proto_type_name() - ) - ctx.properties["state"].string_value = "LIVE" - - return Mapped(ctx, RegisteredModel(model.py.name)) - - -# TODO: should we test insert/update separately? -def test_upsert_registered_model( - mr_api: ModelRegistryAPIClient, registered_model: Mapped -): - mr_api.upsert_registered_model(registered_model.py) - - rm_proto = mr_api.store.store.get_context_by_type_and_name( - RegisteredModel.get_proto_type_name(), registered_model.proto.name +async def registered_model(client: ModelRegistryAPIClient) -> RegisteredModel: + return await client.upsert_registered_model( + RegisteredModel(name="registered", external_id="mr id") ) - assert rm_proto is not None - assert registered_model.py.id == str(rm_proto.id) - assert registered_model.py.name == rm_proto.name -def test_get_registered_model_by_id( - mr_api: ModelRegistryAPIClient, - registered_model: Mapped, +async def test_get_registered_model_by_id( + client: ModelRegistryAPIClient, + registered_model: RegisteredModel, ): - rm_id = mr_api.store.store.put_contexts([registered_model.proto])[0] + assert (rm := await client.get_registered_model_by_id(str(registered_model.id))) + assert rm == registered_model - assert (mlmd_rm := mr_api.get_registered_model_by_id(str(rm_id))) - assert mlmd_rm.id == str(rm_id) - assert mlmd_rm.name == registered_model.py.name - assert mlmd_rm.name == registered_model.proto.name - -def test_get_registered_model_by_name( - mr_api: ModelRegistryAPIClient, - registered_model: Mapped, +async def test_get_registered_model_by_name( + client: ModelRegistryAPIClient, + registered_model: RegisteredModel, ): - rm_id = mr_api.store.store.put_contexts([registered_model.proto])[0] - assert ( - mlmd_rm := mr_api.get_registered_model_by_params(name=registered_model.py.name) + rm := await client.get_registered_model_by_params(name=registered_model.name) ) - assert mlmd_rm.id == str(rm_id) - assert mlmd_rm.name == registered_model.py.name - assert mlmd_rm.name == registered_model.proto.name + assert rm == registered_model -def test_get_registered_model_by_external_id( - mr_api: ModelRegistryAPIClient, - registered_model: Mapped, +async def test_get_registered_model_by_external_id( + client: ModelRegistryAPIClient, + registered_model: RegisteredModel, ): - registered_model.py.external_id = "external_id" - registered_model.proto.external_id = "external_id" - rm_id = mr_api.store.store.put_contexts([registered_model.proto])[0] - assert ( - mlmd_rm := mr_api.get_registered_model_by_params( - external_id=registered_model.py.external_id + rm := await client.get_registered_model_by_params( + external_id=registered_model.external_id ) ) - assert mlmd_rm.id == str(rm_id) - assert mlmd_rm.name == registered_model.py.name - assert mlmd_rm.name == registered_model.proto.name + assert rm == registered_model -def test_get_registered_models( - mr_api: ModelRegistryAPIClient, registered_model: Mapped +async def test_get_registered_models( + client: ModelRegistryAPIClient, registered_model: RegisteredModel ): - rm1_id = mr_api.store.store.put_contexts([registered_model.proto])[0] - registered_model.proto.name = "model2" - rm2_id = mr_api.store.store.put_contexts([registered_model.proto])[0] + rm2 = await client.upsert_registered_model(RegisteredModel(name="rm2")) - mlmd_rms = mr_api.get_registered_models() - assert len(mlmd_rms) == 2 - assert mlmd_rms[0].id in [str(rm1_id), str(rm2_id)] + rms = await client.get_registered_models() + assert [registered_model, rm2] == rms -def test_upsert_model_version( - mr_api: ModelRegistryAPIClient, - model_version: Mapped, - registered_model: Mapped, +async def test_insert_model_version( + client: ModelRegistryAPIClient, + registered_model: RegisteredModel, +): + model_version = ModelVersion(name="test version", author="test author") + mv = await client.upsert_model_version(model_version, str(registered_model.id)) + assert mv.id + assert mv.name == model_version.name + assert mv.external_id is None + assert mv.description is None + assert mv.create_time_since_epoch + assert mv.last_update_time_since_epoch + assert mv.author == model_version.author + + +async def test_update_model_version( + client: ModelRegistryAPIClient, registered_model: RegisteredModel ): - rm_id = mr_api.store.store.put_contexts([registered_model.proto])[0] - rm_id = str(rm_id) + model_version = ModelVersion(name="updated mv", author="test author") + mv = await client.upsert_model_version(model_version, str(registered_model.id)) + last_update = mv.last_update_time_since_epoch + mv.description = "lorem ipsum" + mv = await client.upsert_model_version(mv, str(registered_model.id)) - mr_api.upsert_model_version(model_version.py, rm_id) + assert mv.description == "lorem ipsum" + assert mv.last_update_time_since_epoch != last_update - mv_proto = mr_api.store.store.get_context_by_type_and_name( - ModelVersion.get_proto_type_name(), f"{rm_id}:{model_version.proto.name}" - ) - assert mv_proto is not None - assert model_version.py.id == str(mv_proto.id) - assert model_version.py.version != mv_proto.name +@pytest.fixture() +async def model_version( + client: ModelRegistryAPIClient, registered_model: RegisteredModel +) -> ModelVersion: + return await client.upsert_model_version( + ModelVersion(name="version", author="author", external_id="mv id"), + str(registered_model.id), + ) -def test_get_model_version_by_id(mr_api: ModelRegistryAPIClient, model_version: Mapped): - model_version.proto.name = f"1:{model_version.proto.name}" - ctx_id = mr_api.store.store.put_contexts([model_version.proto])[0] - id = str(ctx_id) - assert (mlmd_mv := mr_api.get_model_version_by_id(id)) - assert mlmd_mv.id == id - assert mlmd_mv.name == model_version.py.name - assert mlmd_mv.version != model_version.proto.name +async def test_get_model_version_by_id( + client: ModelRegistryAPIClient, model_version: ModelVersion +): + assert (mv := await client.get_model_version_by_id(str(model_version.id))) + assert mv == model_version -def test_get_model_version_by_name( - mr_api: ModelRegistryAPIClient, model_version: Mapped +async def test_get_model_version_by_name( + client: ModelRegistryAPIClient, + registered_model: RegisteredModel, + model_version: ModelVersion, ): - model_version.proto.name = f"1:{model_version.proto.name}" - mv_id = mr_api.store.store.put_contexts([model_version.proto])[0] - assert ( - mlmd_mv := mr_api.get_model_version_by_params( - registered_model_id="1", version=model_version.py.name + mv := await client.get_model_version_by_params( + registered_model_id=str(registered_model.id), name=model_version.name ) ) - assert mlmd_mv.id == str(mv_id) - assert mlmd_mv.name == model_version.py.name - assert mlmd_mv.name != model_version.proto.name + assert mv == model_version -def test_get_model_version_by_external_id( - mr_api: ModelRegistryAPIClient, model_version: Mapped +async def test_get_model_version_by_external_id( + client: ModelRegistryAPIClient, model_version: ModelVersion ): - model_version.proto.name = f"1:{model_version.proto.name}" - model_version.proto.external_id = "external_id" - model_version.py.external_id = "external_id" - mv_id = mr_api.store.store.put_contexts([model_version.proto])[0] - assert ( - mlmd_mv := mr_api.get_model_version_by_params( - external_id=model_version.py.external_id + mv := await client.get_model_version_by_params( + external_id=model_version.external_id ) ) - assert mlmd_mv.id == str(mv_id) - assert mlmd_mv.name == model_version.py.name - assert mlmd_mv.name != model_version.proto.name + assert mv == model_version -def test_get_model_versions( - mr_api: ModelRegistryAPIClient, - model_version: Mapped, - registered_model: Mapped, +async def test_get_model_versions( + client: ModelRegistryAPIClient, + registered_model: RegisteredModel, + model_version: ModelVersion, ): - rm_id = mr_api.store.store.put_contexts([registered_model.proto])[0] - - model_version.proto.name = f"{rm_id}:version" - mv1_id = mr_api.store.store.put_contexts([model_version.proto])[0] - model_version.proto.name = f"{rm_id}:version2" - mv2_id = mr_api.store.store.put_contexts([model_version.proto])[0] - - mr_api.store.store.put_parent_contexts( - [ - ParentContext(parent_id=rm_id, child_id=mv1_id), - ParentContext(parent_id=rm_id, child_id=mv2_id), - ] + mv2 = await client.upsert_model_version( + ModelVersion(name="mv2", author="author"), str(registered_model.id) ) - mlmd_mvs = mr_api.get_model_versions(str(rm_id)) - assert len(mlmd_mvs) == 2 - assert mlmd_mvs[0].id in [str(mv1_id), str(mv2_id)] + mvs = await client.get_model_versions(str(registered_model.id)) + assert [model_version, mv2] == mvs -def test_upsert_model_artifact( - monkeypatch, - mr_api: ModelRegistryAPIClient, - model: Mapped, - model_version: Mapped, +async def test_insert_model_artifact( + client: ModelRegistryAPIClient, + model_version: ModelVersion, ): - monkeypatch.setattr(ModelArtifact, "mlmd_name_prefix", "test_prefix") - - mv_id = mr_api.store.store.put_contexts([model_version.proto])[0] - mv_id = str(mv_id) - - mr_api.upsert_model_artifact(model.py, mv_id) - - ma_proto = mr_api.store.store.get_artifact_by_type_and_name( - ModelArtifact.get_proto_type_name(), f"test_prefix:{model.proto.name}" + props = { + "name": "test model", + "uri": "test uri", + "model_format_name": "test format", + "model_format_version": "test version", + "storage_key": "test key", + "storage_path": "test path", + "service_account_name": "test service account", + } + ma = await client.upsert_model_artifact( + ModelArtifact(**props), str(model_version.id) ) - assert ma_proto is not None - assert model.py.id == str(ma_proto.id) - assert model.py.name != ma_proto.name - - -def test_upsert_duplicate_model_artifact_with_different_version( - mr_api: ModelRegistryAPIClient, model: Mapped, model_version: Mapped + assert ma.id + assert ma.name == "test model" + assert ma.uri + assert ma.description is None + assert ma.external_id is None + assert ma.create_time_since_epoch + assert ma.last_update_time_since_epoch + assert ma.model_format_name + assert ma.model_format_version + assert ma.storage_key + assert ma.storage_path + assert ma.service_account_name + + +async def test_update_model_artifact( + client: ModelRegistryAPIClient, model_version: ModelVersion ): - mv1_id = mr_api.store.store.put_contexts([model_version.proto])[0] - mv1_id = str(mv1_id) + model = ModelArtifact(name="updated model", uri="uri") + ma = await client.upsert_model_artifact(model, str(model_version.id)) + last_update = ma.last_update_time_since_epoch + ma.description = "lorem ipsum" + ma = await client.upsert_model_artifact(ma, str(model_version.id)) - model_version.proto.name = "version2" - mv2_id = mr_api.store.store.put_contexts([model_version.proto])[0] - mv2_id = str(mv2_id) + assert ma.description == "lorem ipsum" + assert ma.last_update_time_since_epoch != last_update - ma1 = evolve(model.py) - mr_api.upsert_model_artifact(ma1, mv1_id) - ma2 = evolve(model.py) - mr_api.upsert_model_artifact(ma2, mv2_id) - ma_protos = mr_api.store.store.get_artifacts_by_id([int(ma1.id), int(ma2.id)]) - assert ma1.name == ma2.name - assert ma1.name != str(ma_protos[0].name) - assert ma2.name != str(ma_protos[1].name) +@pytest.fixture() +async def model( + client: ModelRegistryAPIClient, + model_version: ModelVersion, +) -> ModelArtifact: + return await client.upsert_model_artifact( + ModelArtifact(name="model", uri="uri", external_id="ma id"), + str(model_version.id), + ) -def test_upsert_duplicate_model_artifact_with_same_version( - mr_api: ModelRegistryAPIClient, model: Mapped, model_version: Mapped +async def test_get_model_artifact_by_id( + client: ModelRegistryAPIClient, model: ModelArtifact ): - mv_id = mr_api.store.store.put_contexts([model_version.proto])[0] - mv_id = str(mv_id) - - ma1 = evolve(model.py) - mr_api.upsert_model_artifact(ma1, mv_id) - ma2 = evolve(model.py) - with pytest.raises(StoreException): - mr_api.upsert_model_artifact(ma2, mv_id) - - -def test_get_model_artifact_by_id(mr_api: ModelRegistryAPIClient, model: Mapped): - model.proto.name = f"test_prefix:{model.proto.name}" - id = mr_api.store.store.put_artifacts([model.proto])[0] - id = str(id) - - assert (mlmd_ma := mr_api.get_model_artifact_by_id(id)) - assert mlmd_ma.id == id - assert mlmd_ma.name == model.py.name - assert mlmd_ma.name != model.proto.name + assert (ma := await client.get_model_artifact_by_id(str(model.id))) + assert ma == model -def test_get_model_artifact_by_model_version_id( - mr_api: ModelRegistryAPIClient, model: Mapped, model_version: Mapped +async def test_get_model_artifact_by_name( + client: ModelRegistryAPIClient, model_version: ModelVersion, model: ModelArtifact ): - mv_id = mr_api.store.store.put_contexts([model_version.proto])[0] - - model.proto.name = f"test_prefix:{model.proto.name}" - ma_id = mr_api.store.store.put_artifacts([model.proto])[0] - - mr_api.store.store.put_attributions_and_associations( - [Attribution(context_id=mv_id, artifact_id=ma_id)], [] + assert ( + ma := await client.get_model_artifact_by_params( + name=model.name, model_version_id=str(model_version.id) + ) ) - - assert (mlmd_ma := mr_api.get_model_artifact_by_params(model_version_id=str(mv_id))) - assert mlmd_ma.id == str(ma_id) - assert mlmd_ma.name == model.py.name - assert mlmd_ma.name != model.proto.name + assert ma == model -def test_get_model_artifact_by_external_id( - mr_api: ModelRegistryAPIClient, model: Mapped +async def test_get_model_artifact_by_external_id( + client: ModelRegistryAPIClient, model: ModelArtifact ): - model.proto.name = f"test_prefix:{model.proto.name}" - model.proto.external_id = "external_id" - model.py.external_id = "external_id" - - id = mr_api.store.store.put_artifacts([model.proto])[0] - id = str(id) - assert ( - mlmd_ma := mr_api.get_model_artifact_by_params(external_id=model.py.external_id) + ma := await client.get_model_artifact_by_params(external_id=model.external_id) ) - assert mlmd_ma.id == id - assert mlmd_ma.name == model.py.name - assert mlmd_ma.name != model.proto.name + assert ma == model -def test_get_all_model_artifacts(mr_api: ModelRegistryAPIClient, model: Mapped): - model.proto.name = "test_prefix:model1" - ma1_id = mr_api.store.store.put_artifacts([model.proto])[0] - model.proto.name = "test_prefix:model2" - ma2_id = mr_api.store.store.put_artifacts([model.proto])[0] +async def test_get_all_model_artifacts( + client: ModelRegistryAPIClient, model_version: ModelVersion, model: ModelArtifact +): + ma2 = await client.upsert_model_artifact( + ModelArtifact(name="ma2", uri="uri"), str(model_version.id) + ) - mlmd_mas = mr_api.get_model_artifacts() - assert len(mlmd_mas) == 2 - assert mlmd_mas[0].id in [str(ma1_id), str(ma2_id)] + mas = await client.get_model_artifacts() + assert [model, ma2] == mas -def test_get_model_artifacts_by_mv_id( - mr_api: ModelRegistryAPIClient, model: Mapped, model_version: Mapped +async def test_get_model_artifacts_by_mv_id( + client: ModelRegistryAPIClient, model_version: ModelVersion, model: ModelArtifact ): - mv1_id = mr_api.store.store.put_contexts([model_version.proto])[0] - - model_version.proto.name = "version2" - mv2_id = mr_api.store.store.put_contexts([model_version.proto])[0] - - model.proto.name = "test_prefix:model1" - ma1_id = mr_api.store.store.put_artifacts([model.proto])[0] - model.proto.name = "test_prefix:model2" - ma2_id = mr_api.store.store.put_artifacts([model.proto])[0] - - mr_api.store.store.put_attributions_and_associations( - [ - Attribution(context_id=mv1_id, artifact_id=ma1_id), - Attribution(context_id=mv2_id, artifact_id=ma2_id), - ], - [], + ma2 = await client.upsert_model_artifact( + ModelArtifact(name="ma2", uri="uri"), str(model_version.id) ) - mlmd_mas = mr_api.get_model_artifacts(str(mv1_id)) - assert len(mlmd_mas) == 1 - assert mlmd_mas[0].id == str(ma1_id) + mas = await client.get_model_artifacts(str(model_version.id)) + assert [model, ma2] == mas diff --git a/clients/python/tests/types/__init__.py b/clients/python/tests/types/__init__.py deleted file mode 100644 index 04c524def..000000000 --- a/clients/python/tests/types/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Tests for model registry types.""" diff --git a/clients/python/tests/types/test_artifact_mapping.py b/clients/python/tests/types/test_artifact_mapping.py deleted file mode 100644 index f1e45b9d5..000000000 --- a/clients/python/tests/types/test_artifact_mapping.py +++ /dev/null @@ -1,106 +0,0 @@ -"""Tests for artifact type mapping. - -Todo: - * should we parametrize the tests? -""" - -import pytest -from ml_metadata.proto import Artifact -from model_registry.types import ModelArtifact - -from .. import Mapped - - -@pytest.fixture() -def complete_model() -> Mapped: - proto_model = Artifact() - proto_model.name = "test_prefix:test_model" - proto_model.type_id = 1 - proto_model.external_id = "test_external_id" - proto_model.state = Artifact.UNKNOWN - proto_model.uri = "test_uri" - proto_model.properties["description"].string_value = "test description" - proto_model.properties["model_format_name"].string_value = "test_format" - proto_model.properties["model_format_version"].string_value = "test_format_version" - proto_model.properties["storage_key"].string_value = "test_storage_key" - proto_model.properties["storage_path"].string_value = "test_storage_path" - proto_model.properties["service_account_name"].string_value = "test_account_name" - - py_model = ModelArtifact( - "test_model", - "test_uri", - description="test description", - external_id="test_external_id", - model_format_name="test_format", - model_format_version="test_format_version", - storage_key="test_storage_key", - storage_path="test_storage_path", - service_account_name="test_account_name", - ) - - return Mapped(proto_model, py_model) - - -@pytest.fixture() -def minimal_model() -> Mapped: - proto_model = Artifact() - proto_model.name = "test_prefix:test_model" - proto_model.type_id = 1 - proto_model.state = Artifact.UNKNOWN - proto_model.uri = "test_uri" - - py_model = ModelArtifact("test_model", "test_uri") - return Mapped(proto_model, py_model) - - -def test_partial_model_mapping(monkeypatch, minimal_model: Mapped): - monkeypatch.setattr(ModelArtifact, "mlmd_name_prefix", "test_prefix") - - mapped_model = minimal_model.py.map(1) - proto_model = minimal_model.proto - assert mapped_model.name == proto_model.name - assert mapped_model.type_id == proto_model.type_id - assert mapped_model.state == proto_model.state - assert mapped_model.uri == proto_model.uri - - -def test_full_model_mapping(monkeypatch, complete_model: Mapped): - monkeypatch.setattr(ModelArtifact, "mlmd_name_prefix", "test_prefix") - - mapped_model = complete_model.py.map(1) - proto_model = complete_model.proto - assert mapped_model.name == proto_model.name - assert mapped_model.type_id == proto_model.type_id - assert mapped_model.state == proto_model.state - assert mapped_model.uri == proto_model.uri - assert mapped_model.external_id == proto_model.external_id - assert mapped_model.properties == proto_model.properties - - -def test_partial_model_unmapping(minimal_model: Mapped): - unmapped_model = ModelArtifact.unmap(minimal_model.proto) - py_model = minimal_model.py - assert unmapped_model.name == py_model.name - assert unmapped_model.state == py_model.state - assert unmapped_model.uri == py_model.uri - - -def test_full_model_unmapping(complete_model: Mapped): - unmapped_model = ModelArtifact.unmap(complete_model.proto) - py_model = complete_model.py - assert unmapped_model.name == py_model.name - assert unmapped_model.state == py_model.state - assert unmapped_model.uri == py_model.uri - assert unmapped_model.external_id == py_model.external_id - assert unmapped_model.description == py_model.description - assert unmapped_model.model_format_name == py_model.model_format_name - assert unmapped_model.model_format_version == py_model.model_format_version - assert unmapped_model.storage_key == py_model.storage_key - assert unmapped_model.storage_path == py_model.storage_path - assert unmapped_model.service_account_name == py_model.service_account_name - - -def test_model_prefix_generation(minimal_model: Mapped): - name1 = minimal_model.py.map(1).name - name2 = minimal_model.py.map(1).name - assert name1 != name2 diff --git a/clients/python/tests/types/test_context_mapping.py b/clients/python/tests/types/test_context_mapping.py deleted file mode 100644 index e430fa963..000000000 --- a/clients/python/tests/types/test_context_mapping.py +++ /dev/null @@ -1,134 +0,0 @@ -"""Tests for context type mapping. - -Todo: - * should we parametrize the tests? -""" - -import pytest -from ml_metadata.proto import Context -from model_registry.types import ContextState, ModelVersion, RegisteredModel - -from .. import Mapped - - -@pytest.fixture() -def full_model_version() -> Mapped: - proto_version = Context( - name="1:1.0.0", - type_id=2, - external_id="test_external_id", - ) - proto_version.properties["description"].string_value = "test description" - proto_version.properties["model_name"].string_value = "test_model" - proto_version.properties["author"].string_value = "test_author" - proto_version.properties["state"].string_value = "ARCHIVED" - proto_version.custom_properties["int_key"].int_value = 1 - proto_version.custom_properties["float_key"].double_value = 1.0 - proto_version.custom_properties["bool_key"].bool_value = True - proto_version.custom_properties["str_key"].string_value = "test_str" - - py_version = ModelVersion( - "test_model", - "1.0.0", - "test_author", - external_id="test_external_id", - description="test description", - metadata={ - "int_key": 1, - "float_key": 1.0, - "bool_key": True, - "str_key": "test_str", - }, - ) - py_version._registered_model_id = "1" - py_version.state = ContextState.ARCHIVED - return Mapped(proto_version, py_version) - - -@pytest.fixture() -def minimal_model_version() -> Mapped: - proto_version = Context(name="1:1.0.0", type_id=2) - proto_version.properties["model_name"].string_value = "test_model" - proto_version.properties["author"].string_value = "test_author" - proto_version.properties["state"].string_value = "LIVE" - - py_version = ModelVersion("test_model", "1.0.0", "test_author") - py_version._registered_model_id = "1" - return Mapped(proto_version, py_version) - - -def test_partial_model_version_mapping(minimal_model_version: Mapped): - mapped_version = minimal_model_version.py.map(2) - proto_version = minimal_model_version.proto - assert mapped_version.name == proto_version.name - assert mapped_version.type_id == proto_version.type_id - assert mapped_version.properties == proto_version.properties - - -def test_partial_model_version_unmapping(minimal_model_version: Mapped): - unmapped_version = ModelVersion.unmap(minimal_model_version.proto) - py_version = minimal_model_version.py - assert unmapped_version.version == py_version.version - assert unmapped_version.model_name == py_version.model_name - assert unmapped_version.author == py_version.author - assert unmapped_version.state == py_version.state - assert unmapped_version.metadata == py_version.metadata - - -def test_full_model_version_mapping(full_model_version: Mapped): - mapped_version = full_model_version.py.map(2) - proto_version = full_model_version.proto - assert mapped_version.name == proto_version.name - assert mapped_version.type_id == proto_version.type_id - assert mapped_version.external_id == proto_version.external_id - assert mapped_version.properties == proto_version.properties - assert mapped_version.custom_properties == proto_version.custom_properties - - -def test_full_model_version_unmapping(full_model_version: Mapped): - unmapped_version = ModelVersion.unmap(full_model_version.proto) - py_version = full_model_version.py - assert unmapped_version.version == py_version.version - assert unmapped_version.description == py_version.description - assert unmapped_version.external_id == py_version.external_id - assert unmapped_version.model_name == py_version.model_name - assert unmapped_version.author == py_version.author - assert unmapped_version.state == py_version.state - assert unmapped_version.metadata == py_version.metadata - - -@pytest.fixture() -def minimal_registered_model() -> Mapped: - proto_version = Context( - name="mnist", - type_id=1, - external_id="test_external_id") - proto_version.properties["description"].string_value = "test description" - proto_version.properties["state"].string_value = "LIVE" - proto_version.properties["owner"].string_value = "my owner" - - py_regmodel = RegisteredModel(name="mnist", - owner="my owner", - external_id="test_external_id", - description="test description") - return Mapped(proto_version, py_regmodel) - - -def test_minimal_registered_model_mapping(minimal_registered_model: Mapped): - mapped_version = minimal_registered_model.py.map(1) - proto_version = minimal_registered_model.proto - assert mapped_version.name == proto_version.name - assert mapped_version.type_id == proto_version.type_id - assert mapped_version.external_id == proto_version.external_id - assert mapped_version.properties == proto_version.properties - assert mapped_version.custom_properties == proto_version.custom_properties - - -def test_minimal_registered_model_unmapping(minimal_registered_model: Mapped): - unmapped_regmodel = RegisteredModel.unmap(minimal_registered_model.proto) - py_regmodel = minimal_registered_model.py - assert unmapped_regmodel.name == py_regmodel.name - assert unmapped_regmodel.owner == py_regmodel.owner - assert unmapped_regmodel.description == py_regmodel.description - assert unmapped_regmodel.external_id == py_regmodel.external_id - assert unmapped_regmodel.state == py_regmodel.state diff --git a/test/robot/ModelRegistry.py b/test/robot/ModelRegistry.py index 861249532..e8aabd171 100644 --- a/test/robot/ModelRegistry.py +++ b/test/robot/ModelRegistry.py @@ -1,4 +1,4 @@ -import model_registry as mr +from model_registry.core import ModelRegistryAPIClient from model_registry.types import ModelArtifact, ModelVersion, RegisteredModel from robot.libraries.BuiltIn import BuiltIn @@ -8,35 +8,40 @@ def write_to_console(s): BuiltIn().log_to_console(s) -class ModelRegistry(mr.core.ModelRegistryAPIClient): - def __init__(self, host: str = "localhost", port: int = 9090): - super().__init__(mr.store.MLMDStore.from_config(host, port)) +class ModelRegistry: + def __init__(self, host: str = "http://localhost", port: int = 8080): + self.api = ModelRegistryAPIClient.insecure_connection(host, port) - def upsert_registered_model(self, registered_model) -> str: - p = RegisteredModel("") - for key, value in registered_model.items(): - setattr(p, key, value) - return super().upsert_registered_model(p) + async def upsert_registered_model(self, registered_model: dict) -> str: + return ( + await self.api.upsert_registered_model(RegisteredModel(**registered_model)) + ).id - def upsert_model_version(self, model_version, registered_model_id: str) -> str: + async def upsert_model_version( + self, model_version: dict, registered_model_id: str + ) -> str: write_to_console(model_version) - p = ModelVersion("", "", "") - for key, value in model_version.items(): - setattr(p, key, value) + p = ModelVersion(**model_version) write_to_console(p) - return super().upsert_model_version(p, registered_model_id) + return (await self.api.upsert_model_version(p, registered_model_id)).id - def upsert_model_artifact(self, model_artifact, model_version_id: str) -> str: + async def upsert_model_artifact( + self, model_artifact: dict, model_version_id: str + ) -> str: write_to_console(model_artifact) - p = ModelArtifact("", "") - for key, value in model_artifact.items(): - setattr(p, key, value) + p = ModelArtifact(**model_artifact) write_to_console(p) - return super().upsert_model_artifact(p, model_version_id) + return (await self.api.upsert_model_artifact(p, model_version_id)).id + + +async def test(): + demo_instance = ModelRegistry() + await demo_instance.upsert_registered_model({"name": "testing123"}) + await demo_instance.upsert_model_version({"name": "v1"}, None) # Used only for quick smoke tests if __name__ == "__main__": - demo_instance = ModelRegistry() - demo_instance.upsert_registered_model({"name": "testing123"}) - demo_instance.upsert_model_version({"name": "v1"}, None) + import asyncio + + asyncio.run(test()) From 99372a5bc7007e6d8a9f3a2bab77cc9cf993ebfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 07:27:13 +0000 Subject: [PATCH 3/3] build(deps): bump github.com/testcontainers/testcontainers-go from 0.26.0 to 0.32.0 (#171) * build(deps): bump github.com/testcontainers/testcontainers-go Bumps [github.com/testcontainers/testcontainers-go](https://github.com/testcontainers/testcontainers-go) from 0.26.0 to 0.32.0. - [Release notes](https://github.com/testcontainers/testcontainers-go/releases) - [Commits](https://github.com/testcontainers/testcontainers-go/compare/v0.26.0...v0.32.0) --- updated-dependencies: - dependency-name: github.com/testcontainers/testcontainers-go dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Avoid deprecated TestContainers method Signed-off-by: Matteo Mortari * bump golangci-lint tool as the problem does not reproduce locally Signed-off-by: Matteo Mortari * def testcontainers import symbol to please linter Signed-off-by: Matteo Mortari * fix: bumped csi version to 1.21, aligned go versions (#177) * fix: bumped csi version to 1.21, which was causing toolchain issues Signed-off-by: Dhiraj Bokde * fix: align go version across readme, go.mod versions Signed-off-by: Dhiraj Bokde --------- Signed-off-by: Dhiraj Bokde --------- Signed-off-by: dependabot[bot] Signed-off-by: Matteo Mortari Signed-off-by: Dhiraj Bokde Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matteo Mortari Co-authored-by: Dhiraj Bokde --- .github/workflows/build.yml | 2 +- Makefile | 2 +- README.md | 2 +- csi/Dockerfile | 2 +- csi/go.mod | 2 +- csi/go.sum | 21 +++++ docs/mr_go_library.md | 2 +- go.mod | 39 +++++---- go.sum | 96 ++++++++++++++-------- internal/testutils/test_container_utils.go | 12 +-- 10 files changed, 119 insertions(+), 61 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 19aa441be..937f28b46 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.19' + go-version: '1.21' - name: Install Protoc uses: arduino/setup-protoc@v3 with: diff --git a/Makefile b/Makefile index 1b841af14..614811125 100644 --- a/Makefile +++ b/Makefile @@ -126,7 +126,7 @@ bin/protoc-gen-go-grpc: GOLANGCI_LINT ?= ${PROJECT_BIN}/golangci-lint bin/golangci-lint: - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) v1.54.2 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(PROJECT_BIN) v1.59.1 GOVERTER ?= ${PROJECT_BIN}/goverter bin/goverter: diff --git a/README.md b/README.md index 1be7dd5f8..910857cd6 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Model registry provides a central repository for model developers to store and m [![codecov](https://codecov.io/github/kubeflow/model-registry/graph/badge.svg?token=61URLQA3VS)](https://codecov.io/github/kubeflow/model-registry) ## Pre-requisites: -- go >= 1.19 +- go >= 1.21 - protoc v24.3 - [Protocol Buffers v24.3 Release](https://github.com/protocolbuffers/protobuf/releases/tag/v24.3) - npm >= 10.2.0 - [Installing Node.js and npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) - Java >= 11.0 diff --git a/csi/Dockerfile b/csi/Dockerfile index d9fb65b8f..7a21bde3f 100644 --- a/csi/Dockerfile +++ b/csi/Dockerfile @@ -1,5 +1,5 @@ # Build the model-registry binary -FROM registry.access.redhat.com/ubi8/go-toolset:1.19 as builder +FROM registry.access.redhat.com/ubi8/go-toolset:1.21 as builder WORKDIR /workspace # Copy the Go Modules manifests diff --git a/csi/go.mod b/csi/go.mod index a47d9b126..e0b0cda83 100644 --- a/csi/go.mod +++ b/csi/go.mod @@ -1,6 +1,6 @@ module github.com/kubeflow/model-registry/csi -go 1.20 +go 1.21 require ( github.com/kserve/kserve v0.12.0 diff --git a/csi/go.sum b/csi/go.sum index e4317f6e8..920a02d8b 100644 --- a/csi/go.sum +++ b/csi/go.sum @@ -24,14 +24,17 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa h1:jQCWAUqqlij9Pgj2i/PB79y4KOPYVyFYdROxgaCwdTQ= +github.com/cncf/xds/go v0.0.0-20231128003011-0fa0005c9caa/go.mod h1:x/1Gn8zydmfq8dk6e9PdstVsDgu9RuyIIJqAaF//0IM= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= +github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= @@ -40,6 +43,7 @@ github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ4 github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -81,9 +85,11 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/ github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.3.2 h1:IqNFLAmvJOgVlpdEBiQbDc2EwKW77amAycfTuWKdfvw= +github.com/google/martian/v3 v3.3.2/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 h1:K6RDEckDVWvDI9JAJYCmNdQXq6neHJOYx3V6jnqNEec= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o= github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -109,7 +115,9 @@ github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1 github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kserve/kserve v0.12.0 h1:9/H9hGM9UPDDgRXemhlc76nrOEzasNv4Medp1oiKvKE= github.com/kserve/kserve v0.12.0/go.mod h1:Rz6mjJFdMIW12dy5enQF767P+xprmltC3+lL2HZwpMY= github.com/kubeflow/model-registry v0.0.0-20240227075359-247c23c4f6b1 h1:OA1UDnJPw+CZ839beHuQSQ0MJnnFa99DCixXD79L2m8= @@ -120,12 +128,17 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= +github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= github.com/onsi/gomega v1.30.0 h1:hvMK7xYz4D3HapigLTeGdId/NcfQx1VHMJc60ew99+8= +github.com/onsi/gomega v1.30.0/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -134,6 +147,7 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -150,9 +164,11 @@ go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znn go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4= go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM= go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8= +go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E= go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc= go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= go.uber.org/zap v1.26.0 h1:sI7k6L95XOKS281NhVKOFCUNIvv9e0w4BF8N3u+tCRo= @@ -177,6 +193,7 @@ golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -254,11 +271,13 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8= +golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= +golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -309,6 +328,7 @@ google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGm google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -341,3 +361,4 @@ sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h6 sigs.k8s.io/structured-merge-diff/v4 v4.4.1 h1:150L+0vs/8DA78h1u02ooW1/fFq/Lwr+sGiqlzvrtq4= sigs.k8s.io/structured-merge-diff/v4 v4.4.1/go.mod h1:N8hJocpFajUSSeSJ9bOZ77VzejKZaXsTtZo4/u7Io08= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/docs/mr_go_library.md b/docs/mr_go_library.md index 3f57cdee2..ed8e83b43 100644 --- a/docs/mr_go_library.md +++ b/docs/mr_go_library.md @@ -17,7 +17,7 @@ It provides model registry metadata capabilities, e.g., store and retrieve ML mo ### Prerequisites * MLMD server, check [ml-metadata doc](https://github.com/google/ml-metadata/blob/f0fef74eae2bdf6650a79ba976b36bea0b777c2e/g3doc/get_started.md#use-mlmd-with-a-remote-grpc-server) for more details on how to startup a MLMD store server. -* Go >= 1.19 +* Go >= 1.21 ### Usage diff --git a/go.mod b/go.mod index 2751ac30b..6e2cdf189 100644 --- a/go.mod +++ b/go.mod @@ -10,24 +10,38 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.19.0 github.com/stretchr/testify v1.9.0 - github.com/testcontainers/testcontainers-go v0.26.0 + github.com/testcontainers/testcontainers-go v0.32.0 google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.34.2 ) +require ( + github.com/containerd/errdefs v0.1.0 // indirect + github.com/distribution/reference v0.6.0 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/moby/docker-image-spec v1.3.1 // indirect + github.com/moby/sys/user v0.1.0 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + golang.org/x/crypto v0.22.0 // indirect +) + require ( dario.cat/mergo v1.0.0 // indirect github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/Microsoft/hcsshim v0.11.4 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect + github.com/Microsoft/hcsshim v0.11.5 // indirect github.com/cenkalti/backoff/v4 v4.2.1 // indirect - github.com/containerd/containerd v1.7.13 // indirect + github.com/containerd/containerd v1.7.18 // indirect github.com/containerd/log v0.1.0 // indirect github.com/cpuguy83/dockercfg v0.3.1 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect - github.com/docker/distribution v2.8.2+incompatible // indirect - github.com/docker/docker v24.0.9+incompatible // indirect - github.com/docker/go-connections v0.4.0 // indirect + github.com/docker/docker v27.0.3+incompatible + github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/go-ole/go-ole v1.2.6 // indirect @@ -35,7 +49,7 @@ require ( github.com/google/uuid v1.6.0 github.com/hashicorp/hcl v1.0.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect @@ -44,15 +58,14 @@ require ( github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect - github.com/opencontainers/image-spec v1.1.0-rc5 // indirect - github.com/opencontainers/runc v1.1.12 // indirect + github.com/opencontainers/image-spec v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect - github.com/shirou/gopsutil/v3 v3.23.9 // indirect + github.com/shirou/gopsutil/v3 v3.23.12 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sourcegraph/conc v0.3.0 // indirect @@ -65,11 +78,9 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.9.0 // indirect golang.org/x/exp v0.0.0-20230905200255-921286631fa9 - golang.org/x/mod v0.12.0 // indirect golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.13.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index acc6789eb..6caaf3f3c 100644 --- a/go.sum +++ b/go.sum @@ -4,14 +4,16 @@ github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 h1:bvDV9 github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24/go.mod h1:8o94RPi1/7XTJvwPpRSzSUedZrtlirdB3r9Z20bi2f8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8= github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= -github.com/Microsoft/hcsshim v0.11.4 h1:68vKo2VN8DE9AdN4tnkWnmdhqdbpUFM8OF3Airm7fz8= -github.com/Microsoft/hcsshim v0.11.4/go.mod h1:smjE4dvqPX9Zldna+t5FG3rnoHhaB7QYxPRqGcpAD9w= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= +github.com/Microsoft/hcsshim v0.11.5 h1:haEcLNpj9Ka1gd3B3tAEs9CpE0c+1IhoL59w/exYU38= +github.com/Microsoft/hcsshim v0.11.5/go.mod h1:MV8xMfmECjl5HdO7U/3/hFVnkmSBjAjmA09d4bExKcU= github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM= github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE= -github.com/containerd/containerd v1.7.13 h1:wPYKIeGMN8vaggSKuV1X0wZulpMz4CrgEsZdaCyB6Is= -github.com/containerd/containerd v1.7.13/go.mod h1:zT3up6yTRfEUa6+GsITYIJNgSVL9NQ4x4h1RPzk0Wu4= +github.com/containerd/containerd v1.7.18 h1:jqjZTQNfXGoEaZdW1WwPU0RqSn1Bm2Ay/KJPUuO8nao= +github.com/containerd/containerd v1.7.18/go.mod h1:IYEk9/IO6wAPUz2bCMVUbsfXjzw5UNP5fLz4PsUygQ4= +github.com/containerd/errdefs v0.1.0 h1:m0wCRBiu1WJT/Fr+iOoQHMQS/eP5myQ8lCv4Dz5ZURM= +github.com/containerd/errdefs v0.1.0/go.mod h1:YgWiiHtLmSeBrvpw+UfPijzbLaB77mEG1WwJTDETIV0= github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I= github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo= github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E= @@ -23,14 +25,16 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= -github.com/docker/docker v24.0.9+incompatible h1:HPGzNmwfLZWdxHqK9/II92pyi1EpYKsAqcl4G0Of9v0= -github.com/docker/docker v24.0.9+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5QvfrDyIgxBk= +github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= +github.com/docker/docker v27.0.3+incompatible h1:aBGI9TeQ4MPlhquTQKq9XbK79rKFVwXNUAYz9aXyEBE= +github.com/docker/docker v27.0.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= +github.com/docker/go-connections v0.5.0 h1:USnMq7hx7gwdVZq1L49hLXaFtUdTADjXGp+uj1Br63c= +github.com/docker/go-connections v0.5.0/go.mod h1:ov60Kzw0kKElRwhNs9UlUHAE/F9Fe6GLaXnqyDdmEXc= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= +github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -39,6 +43,11 @@ github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/cors v1.2.1 h1:xEC8UT3Rlp2QuWNEr4Fs/c2EAGVKBwy/1vHx3bppil4= github.com/go-chi/cors v1.2.1/go.mod h1:sSbTewc+6wYHBBCW7ytsFSn836hqM7JxpglAy2Vzc58= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -51,14 +60,16 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0 h1:YBftPWNWd4WwGqtY2yeZL2ef8rHAxPBD8KFhJpmcqms= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.0/go.mod h1:YN5jB8ie0yfIUg6VvR9Kz84aCaG7AsGZnLjhHbUqwPg= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -69,20 +80,22 @@ github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0V github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0= +github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo= github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk= github.com/moby/patternmatcher v0.6.0/go.mod h1:hDPoyOpDY7OrrMDLaYoY3hf52gNCR/YOUYxkhApJIxc= github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc= github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo= +github.com/moby/sys/user v0.1.0 h1:WmZ93f5Ux6het5iituh9x2zAG7NFY9Aqi49jjE1PaQg= +github.com/moby/sys/user v0.1.0/go.mod h1:fKJhFOnsCN6xZ5gSfbM6zaHGgDJMrqt9/reuj4T7MmU= github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0= github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI= -github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8= -github.com/opencontainers/runc v1.1.12 h1:BOIssBaW1La0/qbNZHXOOa71dZfZEQOzW7dqQf3phss= -github.com/opencontainers/runc v1.1.12/go.mod h1:S+lQwSfncpBha7XTy/5lBwWgm5+y5Ma/O44Ekby9FK8= +github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= +github.com/opencontainers/image-spec v1.1.0/go.mod h1:W4s4sFTMaBeK1BQLXbG4AdM2szdn85PY75RI83NrTrM= github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM= github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -99,8 +112,8 @@ github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6ke github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= -github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E= -github.com/shirou/gopsutil/v3 v3.23.9/go.mod h1:x/NWSb71eMcjFIO0vhyGW5nZ7oSIgVjrCnADckb85GA= +github.com/shirou/gopsutil/v3 v3.23.12 h1:z90NtUkp3bMtmICZKpC4+WaknU1eXtp5vtbQ11DgpE4= +github.com/shirou/gopsutil/v3 v3.23.12/go.mod h1:1FrWgea594Jp7qmjHUUPlJDTPgcsb9mGnXDxavtikzM= github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM= github.com/shoenig/go-m1cpu v0.1.6/go.mod h1:1JJMcUBvfNwpq05QDQVAnx3gUHr9IYF7GNg9SUEw2VQ= github.com/shoenig/test v0.6.4 h1:kVTaSd7WLz5WZ2IaoM0RSzRsUD+m8wRR+5qvntpn4LU= @@ -132,8 +145,8 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= -github.com/testcontainers/testcontainers-go v0.26.0 h1:uqcYdoOHBy1ca7gKODfBd9uTHVK3a7UL848z09MVZ0c= -github.com/testcontainers/testcontainers-go v0.26.0/go.mod h1:ICriE9bLX5CLxL9OFQ2N+2N+f+803LNJ1utJb1+Inx0= +github.com/testcontainers/testcontainers-go v0.32.0 h1:ug1aK08L3gCHdhknlTTwWjPHPS+/alvLJU/DRxTD/ME= +github.com/testcontainers/testcontainers-go v0.32.0/go.mod h1:CRHrzHLQhlXUsa5gXjTOfqIEJcrK5+xMDmBr/WMI88E= github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU= github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI= github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk= @@ -142,6 +155,22 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw= github.com/yusufpapurcu/wmi v1.2.3/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 h1:jq9TW8u3so/bN+JPT166wjOI6/vQPF6Xe7nMNIltagk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0/go.mod h1:p8pYQP+m5XfbZm9fxtSKAbM6oIllS7s2AfxrChvc7iw= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 h1:Mne5On7VWdx7omSrSSZvM4Kw7cS7NQkOOmLcgscI51U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0/go.mod h1:IPtUMKL4O3tH5y+iXVyAXqpAwMuzC1IrxVS81rummfE= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 h1:IeMeyr1aBvBiPVYihXIaeIZba6b8E1bYp7lbdxK8CQg= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0/go.mod h1:oVdCUtjq9MK9BlS7TtucsQwUcXcymNiEDjgDD2jMtZU= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o= +go.opentelemetry.io/otel/sdk v1.19.0/go.mod h1:NedEbbS4w3C6zElbLdPJKOpJQOrGUJ+GfzpjUvI0v1A= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I= +go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM= go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= @@ -149,12 +178,12 @@ go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTV golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20230905200255-921286631fa9 h1:GoHiUyI/Tp2nVkLI2mCxVkOjsbSXD66ic0XW0js0R9g= golang.org/x/exp v0.0.0-20230905200255-921286631fa9/go.mod h1:S2oDrQGGwySpoQPVqRShND87VCbxmc6bL1Yd2oYrm6k= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc= -golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -164,8 +193,6 @@ golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -175,9 +202,11 @@ golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= +golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= @@ -188,12 +217,13 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 h1:rIo7ocm2roD9DcFIX67Ym8icoGCKSARAiPljFhh5suQ= +google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y= google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c h1:lfpJ/2rWPa/kJgxyyXM8PrNnfCzcmxJ265mADgwmvLI= google.golang.org/genproto/googleapis/rpc v0.0.0-20240314234333-6e1732d8331c/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= @@ -208,5 +238,5 @@ gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= -gotest.tools/v3 v3.5.0/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= +gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= +gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= diff --git a/internal/testutils/test_container_utils.go b/internal/testutils/test_container_utils.go index e99f52993..2795b2a7a 100644 --- a/internal/testutils/test_container_utils.go +++ b/internal/testutils/test_container_utils.go @@ -10,8 +10,9 @@ import ( "os/exec" "testing" + "github.com/docker/docker/api/types/container" "github.com/kubeflow/model-registry/internal/ml_metadata/proto" - "github.com/testcontainers/testcontainers-go" + testcontainers "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" "google.golang.org/grpc" "google.golang.org/grpc/credentials/insecure" @@ -85,13 +86,8 @@ func SetupMLMetadataTestContainer(t *testing.T) (*grpc.ClientConn, proto.Metadat Env: map[string]string{ "METADATA_STORE_SERVER_CONFIG_FILE": "/tmp/shared/conn_config.pb", }, - Mounts: testcontainers.ContainerMounts{ - testcontainers.ContainerMount{ - Source: testcontainers.GenericBindMountSource{ - HostPath: wd, - }, - Target: "/tmp/shared", - }, + HostConfigModifier: func(hc *container.HostConfig) { + hc.Binds = []string{wd + ":/tmp/shared"} }, WaitingFor: wait.ForLog("Server listening on"), }