From 9e19a40a4a81cf17759637f0310f0885166b626e Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 24 Aug 2022 19:44:35 -0700 Subject: [PATCH] feat: add read_mask to ListPipelineJobsRequest in aiplatform v1 pipeline_service (#1589) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add WriteFeatureValues in aiplatform v1beta1 featurestore_online_service.proto PiperOrigin-RevId: 467107520 Source-Link: https://github.com/googleapis/googleapis/commit/0dd98150b55b1dfabc0d63ecc1984286aa82b73d Source-Link: https://github.com/googleapis/googleapis-gen/commit/03d96fd2965824e0fe50b136c1babe0e5c3c5f57 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDNkOTZmZDI5NjU4MjRlMGZlNTBiMTM2YzFiYWJlMGU1YzNjNWY1NyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * restore line in .coveragerc * chore: use gapic-generator-python 1.2.0 PiperOrigin-RevId: 467286830 Source-Link: https://github.com/googleapis/googleapis/commit/e6e875a456c046e94eeb5a76211daa046a8e72c9 Source-Link: https://github.com/googleapis/googleapis-gen/commit/0295ea14d9cd4d47ddb23b9ebd39a31e2035e28f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDI5NWVhMTRkOWNkNGQ0N2RkYjIzYjllYmQzOWEzMWUyMDM1ZTI4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: remove unused proto imports PiperOrigin-RevId: 468735472 Source-Link: https://github.com/googleapis/googleapis/commit/cfa1b3782da7ccae31673d45401a0b79d2d4a84b Source-Link: https://github.com/googleapis/googleapis-gen/commit/09b7666656510f5b00b893f003a0ba5766f9e250 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDliNzY2NjY1NjUxMGY1YjAwYjg5M2YwMDNhMGJhNTc2NmY5ZTI1MCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: Updating comments chore: added LRO to API list PiperOrigin-RevId: 469161541 Source-Link: https://github.com/googleapis/googleapis/commit/65b91e66739f4b4704da0fe79cc30e9510a5a146 Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8efb529ccf285a97e78b4f0a4b2852e08f2a78e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhlZmI1MjljY2YyODVhOTdlNzhiNGYwYTRiMjg1MmUwOGYyYTc4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(googleads): Update C# targets to use GAX v4 Committer: @aohren PiperOrigin-RevId: 469186513 Source-Link: https://github.com/googleapis/googleapis/commit/49de9d59d6f01e48ce7f193b781fb9fb48a03d21 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7cb925ebc5d0ec0c95148bc070c4c703532069a3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2NiOTI1ZWJjNWQwZWMwYzk1MTQ4YmMwNzBjNGM3MDM1MzIwNjlhMyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1beta1 index_service.proto PiperOrigin-RevId: 469481692 Source-Link: https://github.com/googleapis/googleapis/commit/624cc451fc305bb5c4d844024890b55add66406f Source-Link: https://github.com/googleapis/googleapis-gen/commit/fd6880812cab6b3434a7e1d339a99907698f9508 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ2ODgwODEyY2FiNmIzNDM0YTdlMWQzMzlhOTk5MDc2OThmOTUwOCJ9 * feat: add UpsertDatapoints and RemoveDatapoints rpcs to IndexService in aiplatform v1 index_service.proto PiperOrigin-RevId: 469481982 Source-Link: https://github.com/googleapis/googleapis/commit/e4fe55a80e18c5e60827821243146e2bb2ac17bd Source-Link: https://github.com/googleapis/googleapis-gen/commit/1ff3c40d85fe8f13538b0f2264d60f806d744fd2 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWZmM2M0MGQ4NWZlOGYxMzUzOGIwZjIyNjRkNjBmODA2ZDc0NGZkMiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add read_mask to ListPipelineJobsRequest in aiplatform v1 pipeline_service feat: add input_artifacts to PipelineJob.runtime_config in aiplatform v1 pipeline_job PiperOrigin-RevId: 469843667 Source-Link: https://github.com/googleapis/googleapis/commit/eb382eda1d3dfe5a3fe07b32f15a3a7dab266597 Source-Link: https://github.com/googleapis/googleapis-gen/commit/7af72d71f16060f229b77ae7edc74da5cfb8ee79 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiN2FmNzJkNzFmMTYwNjBmMjI5Yjc3YWU3ZWRjNzRkYTVjZmI4ZWU3OSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou Co-authored-by: Yu-Han Liu --- google/cloud/aiplatform_v1/__init__.py | 12 + .../cloud/aiplatform_v1/gapic_metadata.json | 20 + .../services/dataset_service/async_client.py | 14 + .../services/dataset_service/client.py | 14 + .../services/endpoint_service/async_client.py | 14 + .../services/endpoint_service/client.py | 14 + .../async_client.py | 14 + .../client.py | 14 + .../featurestore_service/async_client.py | 14 + .../services/featurestore_service/client.py | 14 + .../index_endpoint_service/async_client.py | 14 + .../services/index_endpoint_service/client.py | 14 + .../services/index_service/async_client.py | 160 ++++++ .../services/index_service/client.py | 162 ++++++ .../services/index_service/transports/base.py | 34 ++ .../services/index_service/transports/grpc.py | 56 +++ .../index_service/transports/grpc_asyncio.py | 58 +++ .../services/job_service/async_client.py | 14 + .../services/job_service/client.py | 14 + .../services/metadata_service/async_client.py | 14 + .../services/metadata_service/client.py | 14 + .../migration_service/async_client.py | 14 + .../services/migration_service/client.py | 32 +- .../services/model_service/async_client.py | 24 +- .../services/model_service/client.py | 24 +- .../services/pipeline_service/async_client.py | 14 + .../services/pipeline_service/client.py | 14 + .../prediction_service/async_client.py | 14 + .../services/prediction_service/client.py | 14 + .../specialist_pool_service/async_client.py | 14 + .../specialist_pool_service/client.py | 14 + .../tensorboard_service/async_client.py | 14 + .../services/tensorboard_service/client.py | 14 + .../services/vizier_service/async_client.py | 14 + .../services/vizier_service/client.py | 14 + google/cloud/aiplatform_v1/types/__init__.py | 12 + .../aiplatform_v1/types/dataset_service.py | 2 +- .../cloud/aiplatform_v1/types/explanation.py | 4 +- google/cloud/aiplatform_v1/types/index.py | 136 +++++ .../aiplatform_v1/types/index_service.py | 65 +++ .../aiplatform_v1/types/model_monitoring.py | 9 +- .../aiplatform_v1/types/model_service.py | 9 +- .../cloud/aiplatform_v1/types/pipeline_job.py | 32 ++ .../aiplatform_v1/types/pipeline_service.py | 7 + .../cloud/aiplatform_v1/types/saved_query.py | 6 +- .../aiplatform_v1/types/vizier_service.py | 2 +- google/cloud/aiplatform_v1beta1/__init__.py | 18 + .../aiplatform_v1beta1/gapic_metadata.json | 30 ++ .../services/dataset_service/async_client.py | 14 + .../services/dataset_service/client.py | 14 + .../async_client.py | 14 + .../client.py | 14 + .../services/endpoint_service/async_client.py | 14 + .../services/endpoint_service/client.py | 14 + .../async_client.py | 137 +++++ .../client.py | 139 +++++ .../transports/base.py | 17 + .../transports/grpc.py | 33 ++ .../transports/grpc_asyncio.py | 33 ++ .../featurestore_service/async_client.py | 14 + .../services/featurestore_service/client.py | 14 + .../index_endpoint_service/async_client.py | 14 + .../services/index_endpoint_service/client.py | 14 + .../services/index_service/async_client.py | 160 ++++++ .../services/index_service/client.py | 162 ++++++ .../services/index_service/transports/base.py | 34 ++ .../services/index_service/transports/grpc.py | 56 +++ .../index_service/transports/grpc_asyncio.py | 58 +++ .../services/job_service/async_client.py | 14 + .../services/job_service/client.py | 14 + .../services/metadata_service/async_client.py | 14 + .../services/metadata_service/client.py | 14 + .../migration_service/async_client.py | 14 + .../services/migration_service/client.py | 32 +- .../services/model_service/async_client.py | 24 +- .../services/model_service/client.py | 24 +- .../services/pipeline_service/async_client.py | 14 + .../services/pipeline_service/client.py | 14 + .../prediction_service/async_client.py | 14 + .../services/prediction_service/client.py | 14 + .../specialist_pool_service/async_client.py | 14 + .../specialist_pool_service/client.py | 14 + .../tensorboard_service/async_client.py | 14 + .../services/tensorboard_service/client.py | 14 + .../services/vizier_service/async_client.py | 14 + .../services/vizier_service/client.py | 14 + .../aiplatform_v1beta1/types/__init__.py | 18 + .../types/dataset_service.py | 2 +- .../aiplatform_v1beta1/types/explanation.py | 4 +- .../types/featurestore_online_service.py | 63 +++ .../cloud/aiplatform_v1beta1/types/index.py | 136 +++++ .../aiplatform_v1beta1/types/index_service.py | 65 +++ .../types/model_monitoring.py | 23 +- .../aiplatform_v1beta1/types/model_service.py | 9 +- .../aiplatform_v1beta1/types/saved_query.py | 6 +- .../types/vizier_service.py | 2 +- owlbot.py | 1 + ...d_index_service_remove_datapoints_async.py | 45 ++ ...ed_index_service_remove_datapoints_sync.py | 45 ++ ...d_index_service_upsert_datapoints_async.py | 45 ++ ...ed_index_service_upsert_datapoints_sync.py | 45 ++ ...ving_service_write_feature_values_async.py | 49 ++ ...rving_service_write_feature_values_sync.py | 49 ++ ...d_index_service_remove_datapoints_async.py | 45 ++ ...ed_index_service_remove_datapoints_sync.py | 45 ++ ...d_index_service_upsert_datapoints_async.py | 45 ++ ...ed_index_service_upsert_datapoints_sync.py | 45 ++ .../snippet_metadata_aiplatform_v1.json | 306 +++++++++++ .../snippet_metadata_aiplatform_v1beta1.json | 475 ++++++++++++++++++ .../aiplatform_v1/test_dataset_service.py | 10 +- .../aiplatform_v1/test_endpoint_service.py | 10 +- ...est_featurestore_online_serving_service.py | 10 +- .../test_featurestore_service.py | 10 +- .../test_index_endpoint_service.py | 10 +- .../gapic/aiplatform_v1/test_index_service.py | 324 +++++++++++- .../gapic/aiplatform_v1/test_job_service.py | 10 +- .../aiplatform_v1/test_metadata_service.py | 10 +- .../aiplatform_v1/test_migration_service.py | 36 +- .../gapic/aiplatform_v1/test_model_service.py | 10 +- .../aiplatform_v1/test_pipeline_service.py | 10 +- .../aiplatform_v1/test_prediction_service.py | 10 +- .../test_specialist_pool_service.py | 10 +- .../aiplatform_v1/test_tensorboard_service.py | 10 +- .../aiplatform_v1/test_vizier_service.py | 10 +- .../test_dataset_service.py | 10 +- .../test_deployment_resource_pool_service.py | 10 +- .../test_endpoint_service.py | 10 +- ...est_featurestore_online_serving_service.py | 288 ++++++++++- .../test_featurestore_service.py | 10 +- .../test_index_endpoint_service.py | 10 +- .../aiplatform_v1beta1/test_index_service.py | 324 +++++++++++- .../aiplatform_v1beta1/test_job_service.py | 10 +- .../test_metadata_service.py | 10 +- .../test_migration_service.py | 36 +- .../aiplatform_v1beta1/test_model_service.py | 10 +- .../test_pipeline_service.py | 10 +- .../test_prediction_service.py | 10 +- .../test_specialist_pool_service.py | 10 +- .../test_tensorboard_service.py | 10 +- .../aiplatform_v1beta1/test_vizier_service.py | 10 +- 140 files changed, 5107 insertions(+), 252 deletions(-) create mode 100644 samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_async.py create mode 100644 samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_sync.py create mode 100644 samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_async.py create mode 100644 samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_sync.py create mode 100644 samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_async.py create mode 100644 samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_sync.py create mode 100644 samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_async.py create mode 100644 samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_sync.py create mode 100644 samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_async.py create mode 100644 samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_sync.py diff --git a/google/cloud/aiplatform_v1/__init__.py b/google/cloud/aiplatform_v1/__init__.py index 864d3f79ad..549f3f399c 100644 --- a/google/cloud/aiplatform_v1/__init__.py +++ b/google/cloud/aiplatform_v1/__init__.py @@ -182,6 +182,8 @@ from .types.featurestore_service import UpdateFeaturestoreRequest from .types.hyperparameter_tuning_job import HyperparameterTuningJob from .types.index import Index +from .types.index import IndexDatapoint +from .types.index import IndexStats from .types.index_endpoint import DeployedIndex from .types.index_endpoint import DeployedIndexAuthConfig from .types.index_endpoint import IndexEndpoint @@ -209,8 +211,12 @@ from .types.index_service import ListIndexesRequest from .types.index_service import ListIndexesResponse from .types.index_service import NearestNeighborSearchOperationMetadata +from .types.index_service import RemoveDatapointsRequest +from .types.index_service import RemoveDatapointsResponse from .types.index_service import UpdateIndexOperationMetadata from .types.index_service import UpdateIndexRequest +from .types.index_service import UpsertDatapointsRequest +from .types.index_service import UpsertDatapointsResponse from .types.io import AvroSource from .types.io import BigQueryDestination from .types.io import BigQuerySource @@ -743,10 +749,12 @@ "ImportFeatureValuesResponse", "ImportModelEvaluationRequest", "Index", + "IndexDatapoint", "IndexEndpoint", "IndexEndpointServiceClient", "IndexPrivateEndpoints", "IndexServiceClient", + "IndexStats", "InputDataConfig", "Int64Array", "IntegratedGradientsAttribution", @@ -890,6 +898,8 @@ "ReadTensorboardBlobDataResponse", "ReadTensorboardTimeSeriesDataRequest", "ReadTensorboardTimeSeriesDataResponse", + "RemoveDatapointsRequest", + "RemoveDatapointsResponse", "ResourcesConsumed", "ResumeModelDeploymentMonitoringJobRequest", "SampleConfig", @@ -964,6 +974,8 @@ "UploadModelOperationMetadata", "UploadModelRequest", "UploadModelResponse", + "UpsertDatapointsRequest", + "UpsertDatapointsResponse", "UserActionReference", "Value", "VizierServiceClient", diff --git a/google/cloud/aiplatform_v1/gapic_metadata.json b/google/cloud/aiplatform_v1/gapic_metadata.json index 3de331502f..ffbf9eb765 100644 --- a/google/cloud/aiplatform_v1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1/gapic_metadata.json @@ -580,10 +580,20 @@ "list_indexes" ] }, + "RemoveDatapoints": { + "methods": [ + "remove_datapoints" + ] + }, "UpdateIndex": { "methods": [ "update_index" ] + }, + "UpsertDatapoints": { + "methods": [ + "upsert_datapoints" + ] } } }, @@ -610,10 +620,20 @@ "list_indexes" ] }, + "RemoveDatapoints": { + "methods": [ + "remove_datapoints" + ] + }, "UpdateIndex": { "methods": [ "update_index" ] + }, + "UpsertDatapoints": { + "methods": [ + "upsert_datapoints" + ] } } } diff --git a/google/cloud/aiplatform_v1/services/dataset_service/async_client.py b/google/cloud/aiplatform_v1/services/dataset_service/async_client.py index 5462e20e0c..be88687ef8 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/async_client.py @@ -1784,8 +1784,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1809,8 +1812,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1825,6 +1831,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1898,8 +1905,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1923,8 +1933,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1939,6 +1952,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/dataset_service/client.py b/google/cloud/aiplatform_v1/services/dataset_service/client.py index 026c1d3f70..573d439caa 100644 --- a/google/cloud/aiplatform_v1/services/dataset_service/client.py +++ b/google/cloud/aiplatform_v1/services/dataset_service/client.py @@ -2110,8 +2110,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2135,8 +2138,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2151,6 +2157,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2224,8 +2231,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2249,8 +2259,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2265,6 +2278,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py b/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py index 74f2c2618e..61ff403f0f 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/async_client.py @@ -1411,8 +1411,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1436,8 +1439,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1452,6 +1458,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1525,8 +1532,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1550,8 +1560,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1566,6 +1579,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/endpoint_service/client.py b/google/cloud/aiplatform_v1/services/endpoint_service/client.py index 34984818da..62c105fb9b 100644 --- a/google/cloud/aiplatform_v1/services/endpoint_service/client.py +++ b/google/cloud/aiplatform_v1/services/endpoint_service/client.py @@ -1700,8 +1700,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1725,8 +1728,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1741,6 +1747,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1814,8 +1821,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1839,8 +1849,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1855,6 +1868,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py index 37cd57510a..a02afc12dc 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/async_client.py @@ -770,8 +770,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -795,8 +798,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -811,6 +817,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -884,8 +891,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -909,8 +919,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -925,6 +938,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/client.py b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/client.py index fd54bea5ee..59e1e7cc16 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_online_serving_service/client.py @@ -997,8 +997,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1022,8 +1025,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1038,6 +1044,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1111,8 +1118,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1136,8 +1146,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1152,6 +1165,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py b/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py index 7fda241104..7372ae4482 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/async_client.py @@ -3077,8 +3077,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3102,8 +3105,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3118,6 +3124,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3191,8 +3198,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3216,8 +3226,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3232,6 +3245,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/featurestore_service/client.py b/google/cloud/aiplatform_v1/services/featurestore_service/client.py index 60143748d3..7bd9c418a9 100644 --- a/google/cloud/aiplatform_v1/services/featurestore_service/client.py +++ b/google/cloud/aiplatform_v1/services/featurestore_service/client.py @@ -3358,8 +3358,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3383,8 +3386,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3399,6 +3405,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3472,8 +3479,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3497,8 +3507,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3513,6 +3526,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py index d064474ce5..2dc83f58e7 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/async_client.py @@ -1481,8 +1481,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1506,8 +1509,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1522,6 +1528,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1595,8 +1602,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1620,8 +1630,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1636,6 +1649,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py b/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py index 58682a530f..8f89c623ef 100644 --- a/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py +++ b/google/cloud/aiplatform_v1/services/index_endpoint_service/client.py @@ -1736,8 +1736,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1761,8 +1764,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1777,6 +1783,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1850,8 +1857,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1875,8 +1885,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1891,6 +1904,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/index_service/async_client.py b/google/cloud/aiplatform_v1/services/index_service/async_client.py index 4e6e816a3d..59e89222ec 100644 --- a/google/cloud/aiplatform_v1/services/index_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/index_service/async_client.py @@ -793,6 +793,152 @@ async def sample_delete_index(): # Done; return the response. return response + async def upsert_datapoints( + self, + request: Union[index_service.UpsertDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.UpsertDatapointsResponse: + r"""Add/update Datapoints into an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1 + + async def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.upsert_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1.types.UpsertDatapointsRequest, dict]): + The request object. Request message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1.types.UpsertDatapointsResponse: + Response message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] + + """ + # Create or coerce a protobuf request object. + request = index_service.UpsertDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.upsert_datapoints, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def remove_datapoints( + self, + request: Union[index_service.RemoveDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.RemoveDatapointsResponse: + r"""Remove Datapoints from an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1 + + async def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.remove_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1.types.RemoveDatapointsRequest, dict]): + The request object. Request message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1.types.RemoveDatapointsResponse: + Response message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] + + """ + # Create or coerce a protobuf request object. + request = index_service.RemoveDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.remove_datapoints, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def list_operations( self, request: operations_pb2.ListOperationsRequest = None, @@ -1106,8 +1252,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1131,8 +1280,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1147,6 +1299,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1220,8 +1373,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1245,8 +1401,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1261,6 +1420,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/index_service/client.py b/google/cloud/aiplatform_v1/services/index_service/client.py index 2998fc75e3..e463d0e8f9 100644 --- a/google/cloud/aiplatform_v1/services/index_service/client.py +++ b/google/cloud/aiplatform_v1/services/index_service/client.py @@ -1038,6 +1038,154 @@ def sample_delete_index(): # Done; return the response. return response + def upsert_datapoints( + self, + request: Union[index_service.UpsertDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.UpsertDatapointsResponse: + r"""Add/update Datapoints into an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1 + + def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.upsert_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1.types.UpsertDatapointsRequest, dict]): + The request object. Request message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1.types.UpsertDatapointsResponse: + Response message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a index_service.UpsertDatapointsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, index_service.UpsertDatapointsRequest): + request = index_service.UpsertDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.upsert_datapoints] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def remove_datapoints( + self, + request: Union[index_service.RemoveDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.RemoveDatapointsResponse: + r"""Remove Datapoints from an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1 + + def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.remove_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1.types.RemoveDatapointsRequest, dict]): + The request object. Request message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1.types.RemoveDatapointsResponse: + Response message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a index_service.RemoveDatapointsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, index_service.RemoveDatapointsRequest): + request = index_service.RemoveDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.remove_datapoints] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def __enter__(self): return self @@ -1364,8 +1512,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1389,8 +1540,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1405,6 +1559,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1478,8 +1633,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1503,8 +1661,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1519,6 +1680,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/index_service/transports/base.py b/google/cloud/aiplatform_v1/services/index_service/transports/base.py index e56b1a69fb..a31f6d8e1a 100644 --- a/google/cloud/aiplatform_v1/services/index_service/transports/base.py +++ b/google/cloud/aiplatform_v1/services/index_service/transports/base.py @@ -159,6 +159,16 @@ def _prep_wrapped_messages(self, client_info): default_timeout=None, client_info=client_info, ), + self.upsert_datapoints: gapic_v1.method.wrap_method( + self.upsert_datapoints, + default_timeout=None, + client_info=client_info, + ), + self.remove_datapoints: gapic_v1.method.wrap_method( + self.remove_datapoints, + default_timeout=None, + client_info=client_info, + ), } def close(self): @@ -222,6 +232,30 @@ def delete_index( ]: raise NotImplementedError() + @property + def upsert_datapoints( + self, + ) -> Callable[ + [index_service.UpsertDatapointsRequest], + Union[ + index_service.UpsertDatapointsResponse, + Awaitable[index_service.UpsertDatapointsResponse], + ], + ]: + raise NotImplementedError() + + @property + def remove_datapoints( + self, + ) -> Callable[ + [index_service.RemoveDatapointsRequest], + Union[ + index_service.RemoveDatapointsResponse, + Awaitable[index_service.RemoveDatapointsResponse], + ], + ]: + raise NotImplementedError() + @property def list_operations( self, diff --git a/google/cloud/aiplatform_v1/services/index_service/transports/grpc.py b/google/cloud/aiplatform_v1/services/index_service/transports/grpc.py index d34fbf00a3..ebdac264a5 100644 --- a/google/cloud/aiplatform_v1/services/index_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1/services/index_service/transports/grpc.py @@ -384,6 +384,62 @@ def delete_index( ) return self._stubs["delete_index"] + @property + def upsert_datapoints( + self, + ) -> Callable[ + [index_service.UpsertDatapointsRequest], index_service.UpsertDatapointsResponse + ]: + r"""Return a callable for the upsert datapoints method over gRPC. + + Add/update Datapoints into an Index. + + Returns: + Callable[[~.UpsertDatapointsRequest], + ~.UpsertDatapointsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "upsert_datapoints" not in self._stubs: + self._stubs["upsert_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1.IndexService/UpsertDatapoints", + request_serializer=index_service.UpsertDatapointsRequest.serialize, + response_deserializer=index_service.UpsertDatapointsResponse.deserialize, + ) + return self._stubs["upsert_datapoints"] + + @property + def remove_datapoints( + self, + ) -> Callable[ + [index_service.RemoveDatapointsRequest], index_service.RemoveDatapointsResponse + ]: + r"""Return a callable for the remove datapoints method over gRPC. + + Remove Datapoints from an Index. + + Returns: + Callable[[~.RemoveDatapointsRequest], + ~.RemoveDatapointsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "remove_datapoints" not in self._stubs: + self._stubs["remove_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1.IndexService/RemoveDatapoints", + request_serializer=index_service.RemoveDatapointsRequest.serialize, + response_deserializer=index_service.RemoveDatapointsResponse.deserialize, + ) + return self._stubs["remove_datapoints"] + def close(self): self.grpc_channel.close() diff --git a/google/cloud/aiplatform_v1/services/index_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1/services/index_service/transports/grpc_asyncio.py index d784c403f8..ae711c9af8 100644 --- a/google/cloud/aiplatform_v1/services/index_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1/services/index_service/transports/grpc_asyncio.py @@ -397,6 +397,64 @@ def delete_index( ) return self._stubs["delete_index"] + @property + def upsert_datapoints( + self, + ) -> Callable[ + [index_service.UpsertDatapointsRequest], + Awaitable[index_service.UpsertDatapointsResponse], + ]: + r"""Return a callable for the upsert datapoints method over gRPC. + + Add/update Datapoints into an Index. + + Returns: + Callable[[~.UpsertDatapointsRequest], + Awaitable[~.UpsertDatapointsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "upsert_datapoints" not in self._stubs: + self._stubs["upsert_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1.IndexService/UpsertDatapoints", + request_serializer=index_service.UpsertDatapointsRequest.serialize, + response_deserializer=index_service.UpsertDatapointsResponse.deserialize, + ) + return self._stubs["upsert_datapoints"] + + @property + def remove_datapoints( + self, + ) -> Callable[ + [index_service.RemoveDatapointsRequest], + Awaitable[index_service.RemoveDatapointsResponse], + ]: + r"""Return a callable for the remove datapoints method over gRPC. + + Remove Datapoints from an Index. + + Returns: + Callable[[~.RemoveDatapointsRequest], + Awaitable[~.RemoveDatapointsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "remove_datapoints" not in self._stubs: + self._stubs["remove_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1.IndexService/RemoveDatapoints", + request_serializer=index_service.RemoveDatapointsRequest.serialize, + response_deserializer=index_service.RemoveDatapointsResponse.deserialize, + ) + return self._stubs["remove_datapoints"] + def close(self): return self.grpc_channel.close() diff --git a/google/cloud/aiplatform_v1/services/job_service/async_client.py b/google/cloud/aiplatform_v1/services/job_service/async_client.py index ba1c6d18d8..a8d5690145 100644 --- a/google/cloud/aiplatform_v1/services/job_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/job_service/async_client.py @@ -3641,8 +3641,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3666,8 +3669,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3682,6 +3688,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3755,8 +3762,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3780,8 +3790,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3796,6 +3809,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/job_service/client.py b/google/cloud/aiplatform_v1/services/job_service/client.py index e0c23f0eda..34b4dc8429 100644 --- a/google/cloud/aiplatform_v1/services/job_service/client.py +++ b/google/cloud/aiplatform_v1/services/job_service/client.py @@ -4126,8 +4126,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4151,8 +4154,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4167,6 +4173,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4240,8 +4247,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4265,8 +4275,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4281,6 +4294,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/metadata_service/async_client.py b/google/cloud/aiplatform_v1/services/metadata_service/async_client.py index 7ed573919a..d290614128 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/async_client.py @@ -4000,8 +4000,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4025,8 +4028,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4041,6 +4047,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4114,8 +4121,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4139,8 +4149,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4155,6 +4168,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/metadata_service/client.py b/google/cloud/aiplatform_v1/services/metadata_service/client.py index 49d335551d..00ce91c221 100644 --- a/google/cloud/aiplatform_v1/services/metadata_service/client.py +++ b/google/cloud/aiplatform_v1/services/metadata_service/client.py @@ -4336,8 +4336,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4361,8 +4364,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4377,6 +4383,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4450,8 +4457,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4475,8 +4485,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4491,6 +4504,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/migration_service/async_client.py b/google/cloud/aiplatform_v1/services/migration_service/async_client.py index 4f32f8c39f..3a0f6bced0 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/async_client.py @@ -787,8 +787,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -812,8 +815,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -828,6 +834,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -901,8 +908,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -926,8 +936,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -942,6 +955,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/migration_service/client.py b/google/cloud/aiplatform_v1/services/migration_service/client.py index 5895dd947c..54fff9fc6c 100644 --- a/google/cloud/aiplatform_v1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1/services/migration_service/client.py @@ -218,40 +218,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, - location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( + return "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod @@ -1140,8 +1140,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1165,8 +1168,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1181,6 +1187,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1254,8 +1261,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1279,8 +1289,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1295,6 +1308,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/model_service/async_client.py b/google/cloud/aiplatform_v1/services/model_service/async_client.py index 0fd9729cce..1b48845930 100644 --- a/google/cloud/aiplatform_v1/services/model_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/model_service/async_client.py @@ -1109,11 +1109,11 @@ async def sample_merge_version_aliases(): version_aliases (:class:`Sequence[str]`): Required. The set of version aliases to merge. The alias should be at most 128 characters, and match - ``[a-z][a-z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix - to an alias means removing that alias from the version. - ``-`` is NOT counted in the 128 characters. Example: - ``-golden`` means removing the ``golden`` alias from the - version. + ``[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` + prefix to an alias means removing that alias from the + version. ``-`` is NOT counted in the 128 characters. + Example: ``-golden`` means removing the ``golden`` alias + from the version. There is NO ordering in aliases, which means @@ -2254,8 +2254,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2279,8 +2282,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2295,6 +2301,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2368,8 +2375,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2393,8 +2403,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2409,6 +2422,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/model_service/client.py b/google/cloud/aiplatform_v1/services/model_service/client.py index 9df3e08c34..1432990659 100644 --- a/google/cloud/aiplatform_v1/services/model_service/client.py +++ b/google/cloud/aiplatform_v1/services/model_service/client.py @@ -1414,11 +1414,11 @@ def sample_merge_version_aliases(): version_aliases (Sequence[str]): Required. The set of version aliases to merge. The alias should be at most 128 characters, and match - ``[a-z][a-z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix - to an alias means removing that alias from the version. - ``-`` is NOT counted in the 128 characters. Example: - ``-golden`` means removing the ``golden`` alias from the - version. + ``[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` + prefix to an alias means removing that alias from the + version. ``-`` is NOT counted in the 128 characters. + Example: ``-golden`` means removing the ``golden`` alias + from the version. There is NO ordering in aliases, which means @@ -2580,8 +2580,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2605,8 +2608,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2621,6 +2627,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2694,8 +2701,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2719,8 +2729,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2735,6 +2748,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py b/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py index 335df2f723..da89ac6733 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/async_client.py @@ -1633,8 +1633,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1658,8 +1661,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1674,6 +1680,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1747,8 +1754,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1772,8 +1782,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1788,6 +1801,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/pipeline_service/client.py b/google/cloud/aiplatform_v1/services/pipeline_service/client.py index efa1096653..b5ee274058 100644 --- a/google/cloud/aiplatform_v1/services/pipeline_service/client.py +++ b/google/cloud/aiplatform_v1/services/pipeline_service/client.py @@ -2030,8 +2030,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2055,8 +2058,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2071,6 +2077,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2144,8 +2151,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2169,8 +2179,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2185,6 +2198,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/prediction_service/async_client.py b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py index 10ad298f35..91fb7ee67d 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/async_client.py @@ -991,8 +991,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1016,8 +1019,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1032,6 +1038,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1105,8 +1112,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1130,8 +1140,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1146,6 +1159,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/prediction_service/client.py b/google/cloud/aiplatform_v1/services/prediction_service/client.py index f0fbcec317..74487b992e 100644 --- a/google/cloud/aiplatform_v1/services/prediction_service/client.py +++ b/google/cloud/aiplatform_v1/services/prediction_service/client.py @@ -1249,8 +1249,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1274,8 +1277,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1290,6 +1296,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1363,8 +1370,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1388,8 +1398,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1404,6 +1417,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py index 4e6441f17f..2f45b8d12e 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/async_client.py @@ -1141,8 +1141,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1166,8 +1169,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1182,6 +1188,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1255,8 +1262,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1280,8 +1290,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1296,6 +1309,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py b/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py index c33409cd91..0e1e673371 100644 --- a/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py +++ b/google/cloud/aiplatform_v1/services/specialist_pool_service/client.py @@ -1372,8 +1372,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1397,8 +1400,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1413,6 +1419,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1486,8 +1493,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1511,8 +1521,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1527,6 +1540,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py b/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py index 62cf4fc67d..225a5e05ff 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/async_client.py @@ -3776,8 +3776,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3801,8 +3804,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3817,6 +3823,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3890,8 +3897,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3915,8 +3925,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3931,6 +3944,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/tensorboard_service/client.py b/google/cloud/aiplatform_v1/services/tensorboard_service/client.py index 8802aeb4b1..130ea27fa7 100644 --- a/google/cloud/aiplatform_v1/services/tensorboard_service/client.py +++ b/google/cloud/aiplatform_v1/services/tensorboard_service/client.py @@ -4135,8 +4135,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4160,8 +4163,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4176,6 +4182,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4249,8 +4256,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4274,8 +4284,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4290,6 +4303,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/vizier_service/async_client.py b/google/cloud/aiplatform_v1/services/vizier_service/async_client.py index c24eddd596..b12036cfda 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/async_client.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/async_client.py @@ -1945,8 +1945,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1970,8 +1973,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1986,6 +1992,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2059,8 +2066,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2084,8 +2094,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2100,6 +2113,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/services/vizier_service/client.py b/google/cloud/aiplatform_v1/services/vizier_service/client.py index 18f8e205db..37704a871a 100644 --- a/google/cloud/aiplatform_v1/services/vizier_service/client.py +++ b/google/cloud/aiplatform_v1/services/vizier_service/client.py @@ -2230,8 +2230,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2255,8 +2258,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2271,6 +2277,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2344,8 +2351,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2369,8 +2379,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2385,6 +2398,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1/types/__init__.py b/google/cloud/aiplatform_v1/types/__init__.py index 58930340ac..07fe8eeca8 100644 --- a/google/cloud/aiplatform_v1/types/__init__.py +++ b/google/cloud/aiplatform_v1/types/__init__.py @@ -206,6 +206,8 @@ ) from .index import ( Index, + IndexDatapoint, + IndexStats, ) from .index_endpoint import ( DeployedIndex, @@ -239,8 +241,12 @@ ListIndexesRequest, ListIndexesResponse, NearestNeighborSearchOperationMetadata, + RemoveDatapointsRequest, + RemoveDatapointsResponse, UpdateIndexOperationMetadata, UpdateIndexRequest, + UpsertDatapointsRequest, + UpsertDatapointsResponse, ) from .io import ( AvroSource, @@ -726,6 +732,8 @@ "UpdateFeaturestoreRequest", "HyperparameterTuningJob", "Index", + "IndexDatapoint", + "IndexStats", "DeployedIndex", "DeployedIndexAuthConfig", "IndexEndpoint", @@ -753,8 +761,12 @@ "ListIndexesRequest", "ListIndexesResponse", "NearestNeighborSearchOperationMetadata", + "RemoveDatapointsRequest", + "RemoveDatapointsResponse", "UpdateIndexOperationMetadata", "UpdateIndexRequest", + "UpsertDatapointsRequest", + "UpsertDatapointsResponse", "AvroSource", "BigQueryDestination", "BigQuerySource", diff --git a/google/cloud/aiplatform_v1/types/dataset_service.py b/google/cloud/aiplatform_v1/types/dataset_service.py index 63f9191a9b..1ce61ae9cd 100644 --- a/google/cloud/aiplatform_v1/types/dataset_service.py +++ b/google/cloud/aiplatform_v1/types/dataset_service.py @@ -499,7 +499,7 @@ class ListSavedQueriesResponse(proto.Message): Attributes: saved_queries (Sequence[google.cloud.aiplatform_v1.types.SavedQuery]): - A list of SavedQueries that matches the + A list of SavedQueries that match the specified filter in the request. next_page_token (str): The standard List next-page token. diff --git a/google/cloud/aiplatform_v1/types/explanation.py b/google/cloud/aiplatform_v1/types/explanation.py index 22ceae1252..e3495403c4 100644 --- a/google/cloud/aiplatform_v1/types/explanation.py +++ b/google/cloud/aiplatform_v1/types/explanation.py @@ -309,7 +309,7 @@ class ExplanationSpec(proto.Message): Required. Parameters that configure explaining of the Model's predictions. metadata (google.cloud.aiplatform_v1.types.ExplanationMetadata): - Required. Metadata describing the Model's + Optional. Metadata describing the Model's input and output for explanation. """ @@ -384,7 +384,7 @@ class ExplanationParameters(proto.Message): If not populated, returns attributions for [top_k][google.cloud.aiplatform.v1.ExplanationParameters.top_k] - indices of outputs. If neither top_k nor output_indeices is + indices of outputs. If neither top_k nor output_indices is populated, returns the argmax index of the outputs. Only applicable to Models that predict multiple outputs diff --git a/google/cloud/aiplatform_v1/types/index.py b/google/cloud/aiplatform_v1/types/index.py index c119df7780..5a2edba05c 100644 --- a/google/cloud/aiplatform_v1/types/index.py +++ b/google/cloud/aiplatform_v1/types/index.py @@ -24,6 +24,8 @@ package="google.cloud.aiplatform.v1", manifest={ "Index", + "IndexDatapoint", + "IndexStats", }, ) @@ -90,8 +92,19 @@ class Index(proto.Message): not mean their results are not already reflected in the Index. Result of any successfully completed Operation on the Index is reflected in it. + index_stats (google.cloud.aiplatform_v1.types.IndexStats): + Output only. Stats of the index resource. + index_update_method (google.cloud.aiplatform_v1.types.Index.IndexUpdateMethod): + Immutable. The update method to use with this Index. If not + set, BATCH_UPDATE will be used by default. """ + class IndexUpdateMethod(proto.Enum): + r"""The update method of an Index.""" + INDEX_UPDATE_METHOD_UNSPECIFIED = 0 + BATCH_UPDATE = 1 + STREAM_UPDATE = 2 + name = proto.Field( proto.STRING, number=1, @@ -137,6 +150,129 @@ class Index(proto.Message): number=11, message=timestamp_pb2.Timestamp, ) + index_stats = proto.Field( + proto.MESSAGE, + number=14, + message="IndexStats", + ) + index_update_method = proto.Field( + proto.ENUM, + number=16, + enum=IndexUpdateMethod, + ) + + +class IndexDatapoint(proto.Message): + r"""A datapoint of Index. + + Attributes: + datapoint_id (str): + Required. Unique identifier of the datapoint. + feature_vector (Sequence[float]): + Required. Feature embedding vector. An array of numbers with + the length of [NearestNeighborSearchConfig.dimensions]. + restricts (Sequence[google.cloud.aiplatform_v1.types.IndexDatapoint.Restriction]): + Optional. List of Restrict of the datapoint, + used to perform "restricted searches" where + boolean rule are used to filter the subset of + the database eligible for matching. + See: + https://cloud.google.com/vertex-ai/docs/matching-engine/filtering + crowding_tag (google.cloud.aiplatform_v1.types.IndexDatapoint.CrowdingTag): + Optional. CrowdingTag of the datapoint, the + number of neighbors to return in each crowding + can be configured during query. + """ + + class Restriction(proto.Message): + r"""Restriction of a datapoint which describe its + attributes(tokens) from each of several attribute + categories(namespaces). + + Attributes: + namespace (str): + The namespace of this restriction. eg: color. + allow_list (Sequence[str]): + The attributes to allow in this namespace. + eg: 'red' + deny_list (Sequence[str]): + The attributes to deny in this namespace. eg: + 'blue' + """ + + namespace = proto.Field( + proto.STRING, + number=1, + ) + allow_list = proto.RepeatedField( + proto.STRING, + number=2, + ) + deny_list = proto.RepeatedField( + proto.STRING, + number=3, + ) + + class CrowdingTag(proto.Message): + r"""Crowding tag is a constraint on a neighbor list produced by nearest + neighbor search requiring that no more than some value k' of the k + neighbors returned have the same value of crowding_attribute. + + Attributes: + crowding_attribute (str): + The attribute value used for crowding. The maximum number of + neighbors to return per crowding attribute value + (per_crowding_attribute_num_neighbors) is configured + per-query. This field is ignored if + per_crowding_attribute_num_neighbors is larger than the + total number of neighbors to return for a given query. + """ + + crowding_attribute = proto.Field( + proto.STRING, + number=1, + ) + + datapoint_id = proto.Field( + proto.STRING, + number=1, + ) + feature_vector = proto.RepeatedField( + proto.FLOAT, + number=2, + ) + restricts = proto.RepeatedField( + proto.MESSAGE, + number=4, + message=Restriction, + ) + crowding_tag = proto.Field( + proto.MESSAGE, + number=5, + message=CrowdingTag, + ) + + +class IndexStats(proto.Message): + r"""Stats of the Index. + + Attributes: + vectors_count (int): + Output only. The number of vectors in the + Index. + shards_count (int): + Output only. The number of shards in the + Index. + """ + + vectors_count = proto.Field( + proto.INT64, + number=1, + ) + shards_count = proto.Field( + proto.INT32, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1/types/index_service.py b/google/cloud/aiplatform_v1/types/index_service.py index 2e77fa43be..4a4448befa 100644 --- a/google/cloud/aiplatform_v1/types/index_service.py +++ b/google/cloud/aiplatform_v1/types/index_service.py @@ -31,6 +31,10 @@ "UpdateIndexRequest", "UpdateIndexOperationMetadata", "DeleteIndexRequest", + "UpsertDatapointsRequest", + "UpsertDatapointsResponse", + "RemoveDatapointsRequest", + "RemoveDatapointsResponse", "NearestNeighborSearchOperationMetadata", }, ) @@ -241,6 +245,67 @@ class DeleteIndexRequest(proto.Message): ) +class UpsertDatapointsRequest(proto.Message): + r"""Request message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] + + Attributes: + index (str): + Required. The name of the Index resource to be updated. + Format: + ``projects/{project}/locations/{location}/indexes/{index}`` + datapoints (Sequence[google.cloud.aiplatform_v1.types.IndexDatapoint]): + A list of datapoints to be created/updated. + """ + + index = proto.Field( + proto.STRING, + number=1, + ) + datapoints = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=gca_index.IndexDatapoint, + ) + + +class UpsertDatapointsResponse(proto.Message): + r"""Response message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1.IndexService.UpsertDatapoints] + + """ + + +class RemoveDatapointsRequest(proto.Message): + r"""Request message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] + + Attributes: + index (str): + Required. The name of the Index resource to be updated. + Format: + ``projects/{project}/locations/{location}/indexes/{index}`` + datapoint_ids (Sequence[str]): + A list of datapoint ids to be deleted. + """ + + index = proto.Field( + proto.STRING, + number=1, + ) + datapoint_ids = proto.RepeatedField( + proto.STRING, + number=2, + ) + + +class RemoveDatapointsResponse(proto.Message): + r"""Response message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1.IndexService.RemoveDatapoints] + + """ + + class NearestNeighborSearchOperationMetadata(proto.Message): r"""Runtime operation metadata with regard to Matching Engine Index. diff --git a/google/cloud/aiplatform_v1/types/model_monitoring.py b/google/cloud/aiplatform_v1/types/model_monitoring.py index f861e37162..94f8d81645 100644 --- a/google/cloud/aiplatform_v1/types/model_monitoring.py +++ b/google/cloud/aiplatform_v1/types/model_monitoring.py @@ -30,7 +30,9 @@ class ModelMonitoringObjectiveConfig(proto.Message): - r"""Next ID: 8 + r"""The objective configuration for model monitoring, including + the information needed to detect anomalies for one particular + model. Attributes: training_dataset (google.cloud.aiplatform_v1.types.ModelMonitoringObjectiveConfig.TrainingDataset): @@ -314,7 +316,7 @@ class PredictionFormat(proto.Enum): class ModelMonitoringAlertConfig(proto.Message): - r"""Next ID: 3 + r""" .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -358,8 +360,6 @@ class EmailAlertConfig(proto.Message): class ThresholdConfig(proto.Message): r"""The config for feature monitoring threshold. - Next ID: 3 - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -390,7 +390,6 @@ class ThresholdConfig(proto.Message): class SamplingStrategy(proto.Message): r"""Sampling Strategy for logging, can be for both training and prediction dataset. - Next ID: 2 Attributes: random_sample_config (google.cloud.aiplatform_v1.types.SamplingStrategy.RandomSampleConfig): diff --git a/google/cloud/aiplatform_v1/types/model_service.py b/google/cloud/aiplatform_v1/types/model_service.py index 6069ec6d97..6dff4a54f9 100644 --- a/google/cloud/aiplatform_v1/types/model_service.py +++ b/google/cloud/aiplatform_v1/types/model_service.py @@ -452,10 +452,11 @@ class MergeVersionAliasesRequest(proto.Message): version_aliases (Sequence[str]): Required. The set of version aliases to merge. The alias should be at most 128 characters, and match - ``[a-z][a-z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix to - an alias means removing that alias from the version. ``-`` - is NOT counted in the 128 characters. Example: ``-golden`` - means removing the ``golden`` alias from the version. + ``[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix + to an alias means removing that alias from the version. + ``-`` is NOT counted in the 128 characters. Example: + ``-golden`` means removing the ``golden`` alias from the + version. There is NO ordering in aliases, which means diff --git a/google/cloud/aiplatform_v1/types/pipeline_job.py b/google/cloud/aiplatform_v1/types/pipeline_job.py index 3e2152b65e..0eb9ef7c4d 100644 --- a/google/cloud/aiplatform_v1/types/pipeline_job.py +++ b/google/cloud/aiplatform_v1/types/pipeline_job.py @@ -163,8 +163,34 @@ class RuntimeConfig(proto.Message): set to PIPELINE_FAILURE_POLICY_FAIL_FAST, it will stop scheduling any new tasks when a task has failed. Any scheduled tasks will continue to completion. + input_artifacts (Mapping[str, google.cloud.aiplatform_v1.types.PipelineJob.RuntimeConfig.InputArtifact]): + The runtime artifacts of the PipelineJob. The + key will be the input artifact name and the + value would be one of the InputArtifact. """ + class InputArtifact(proto.Message): + r"""The type of an input artifact. + + .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields + + Attributes: + artifact_id (str): + Artifact resource id from MLMD. Which is the last portion of + an artifact resource + name(projects/{project}/locations/{location}/metadataStores/default/artifacts/{artifact_id}). + The artifact must stay within the same project, location and + default metadatastore as the pipeline. + + This field is a member of `oneof`_ ``kind``. + """ + + artifact_id = proto.Field( + proto.STRING, + number=1, + oneof="kind", + ) + parameters = proto.MapField( proto.STRING, proto.MESSAGE, @@ -186,6 +212,12 @@ class RuntimeConfig(proto.Message): number=4, enum=pipeline_failure_policy.PipelineFailurePolicy, ) + input_artifacts = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=5, + message="PipelineJob.RuntimeConfig.InputArtifact", + ) name = proto.Field( proto.STRING, diff --git a/google/cloud/aiplatform_v1/types/pipeline_service.py b/google/cloud/aiplatform_v1/types/pipeline_service.py index ae71535469..376c4fb520 100644 --- a/google/cloud/aiplatform_v1/types/pipeline_service.py +++ b/google/cloud/aiplatform_v1/types/pipeline_service.py @@ -333,6 +333,8 @@ class ListPipelineJobsRequest(proto.Message): - ``update_time`` - ``end_time`` - ``start_time`` + read_mask (google.protobuf.field_mask_pb2.FieldMask): + Mask specifying which fields to read. """ parent = proto.Field( @@ -355,6 +357,11 @@ class ListPipelineJobsRequest(proto.Message): proto.STRING, number=6, ) + read_mask = proto.Field( + proto.MESSAGE, + number=7, + message=field_mask_pb2.FieldMask, + ) class ListPipelineJobsResponse(proto.Message): diff --git a/google/cloud/aiplatform_v1/types/saved_query.py b/google/cloud/aiplatform_v1/types/saved_query.py index 814ff195fb..0afba76023 100644 --- a/google/cloud/aiplatform_v1/types/saved_query.py +++ b/google/cloud/aiplatform_v1/types/saved_query.py @@ -67,9 +67,9 @@ class SavedQuery(proto.Message): Output only. Number of AnnotationSpecs in the context of the SavedQuery. etag (str): - Used to perform consistent read-modify-write - updates. If not set, a blind "overwrite" update - happens. + Used to perform a consistent + read-modify-write update. If not set, a blind + "overwrite" update happens. support_automl_training (bool): Output only. If the Annotations belonging to the SavedQuery can be used for AutoML training. diff --git a/google/cloud/aiplatform_v1/types/vizier_service.py b/google/cloud/aiplatform_v1/types/vizier_service.py index 916be3b3de..b2b0c0f1b1 100644 --- a/google/cloud/aiplatform_v1/types/vizier_service.py +++ b/google/cloud/aiplatform_v1/types/vizier_service.py @@ -202,7 +202,7 @@ class SuggestTrialsRequest(proto.Message): ``projects/{project}/locations/{location}/studies/{study}`` suggestion_count (int): Required. The number of suggestions - requested. + requested. It must be positive. client_id (str): Required. The identifier of the client that is requesting the suggestion. diff --git a/google/cloud/aiplatform_v1beta1/__init__.py b/google/cloud/aiplatform_v1beta1/__init__.py index ccb19b424c..d3568d7de5 100644 --- a/google/cloud/aiplatform_v1beta1/__init__.py +++ b/google/cloud/aiplatform_v1beta1/__init__.py @@ -164,6 +164,9 @@ from .types.featurestore_online_service import ReadFeatureValuesRequest from .types.featurestore_online_service import ReadFeatureValuesResponse from .types.featurestore_online_service import StreamingReadFeatureValuesRequest +from .types.featurestore_online_service import WriteFeatureValuesPayload +from .types.featurestore_online_service import WriteFeatureValuesRequest +from .types.featurestore_online_service import WriteFeatureValuesResponse from .types.featurestore_service import BatchCreateFeaturesOperationMetadata from .types.featurestore_service import BatchCreateFeaturesRequest from .types.featurestore_service import BatchCreateFeaturesResponse @@ -204,6 +207,8 @@ from .types.featurestore_service import UpdateFeaturestoreRequest from .types.hyperparameter_tuning_job import HyperparameterTuningJob from .types.index import Index +from .types.index import IndexDatapoint +from .types.index import IndexStats from .types.index_endpoint import DeployedIndex from .types.index_endpoint import DeployedIndexAuthConfig from .types.index_endpoint import IndexEndpoint @@ -231,8 +236,12 @@ from .types.index_service import ListIndexesRequest from .types.index_service import ListIndexesResponse from .types.index_service import NearestNeighborSearchOperationMetadata +from .types.index_service import RemoveDatapointsRequest +from .types.index_service import RemoveDatapointsResponse from .types.index_service import UpdateIndexOperationMetadata from .types.index_service import UpdateIndexRequest +from .types.index_service import UpsertDatapointsRequest +from .types.index_service import UpsertDatapointsResponse from .types.io import AvroSource from .types.io import BigQueryDestination from .types.io import BigQuerySource @@ -777,10 +786,12 @@ "ImportFeatureValuesResponse", "ImportModelEvaluationRequest", "Index", + "IndexDatapoint", "IndexEndpoint", "IndexEndpointServiceClient", "IndexPrivateEndpoints", "IndexServiceClient", + "IndexStats", "InputDataConfig", "Int64Array", "IntegratedGradientsAttribution", @@ -930,6 +941,8 @@ "ReadTensorboardBlobDataResponse", "ReadTensorboardTimeSeriesDataRequest", "ReadTensorboardTimeSeriesDataResponse", + "RemoveDatapointsRequest", + "RemoveDatapointsResponse", "ResourcesConsumed", "ResumeModelDeploymentMonitoringJobRequest", "SampleConfig", @@ -1008,10 +1021,15 @@ "UploadModelOperationMetadata", "UploadModelRequest", "UploadModelResponse", + "UpsertDatapointsRequest", + "UpsertDatapointsResponse", "UserActionReference", "Value", "VizierServiceClient", "WorkerPoolSpec", + "WriteFeatureValuesPayload", + "WriteFeatureValuesRequest", + "WriteFeatureValuesResponse", "WriteTensorboardExperimentDataRequest", "WriteTensorboardExperimentDataResponse", "WriteTensorboardRunDataRequest", diff --git a/google/cloud/aiplatform_v1beta1/gapic_metadata.json b/google/cloud/aiplatform_v1beta1/gapic_metadata.json index 13a15e75c7..f277b55457 100644 --- a/google/cloud/aiplatform_v1beta1/gapic_metadata.json +++ b/google/cloud/aiplatform_v1beta1/gapic_metadata.json @@ -291,6 +291,11 @@ "methods": [ "streaming_read_feature_values" ] + }, + "WriteFeatureValues": { + "methods": [ + "write_feature_values" + ] } } }, @@ -306,6 +311,11 @@ "methods": [ "streaming_read_feature_values" ] + }, + "WriteFeatureValues": { + "methods": [ + "write_feature_values" + ] } } } @@ -644,10 +654,20 @@ "list_indexes" ] }, + "RemoveDatapoints": { + "methods": [ + "remove_datapoints" + ] + }, "UpdateIndex": { "methods": [ "update_index" ] + }, + "UpsertDatapoints": { + "methods": [ + "upsert_datapoints" + ] } } }, @@ -674,10 +694,20 @@ "list_indexes" ] }, + "RemoveDatapoints": { + "methods": [ + "remove_datapoints" + ] + }, "UpdateIndex": { "methods": [ "update_index" ] + }, + "UpsertDatapoints": { + "methods": [ + "upsert_datapoints" + ] } } } diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py index 2ce17e6833..624ac1fffe 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/async_client.py @@ -1784,8 +1784,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1809,8 +1812,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1825,6 +1831,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1898,8 +1905,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1923,8 +1933,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1939,6 +1952,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py b/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py index 63d9e3bf38..930f62c4d2 100644 --- a/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/dataset_service/client.py @@ -2110,8 +2110,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2135,8 +2138,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2151,6 +2157,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2224,8 +2231,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2249,8 +2259,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2265,6 +2278,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/async_client.py index 43a4712437..e8aac37bad 100644 --- a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/async_client.py @@ -1151,8 +1151,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1176,8 +1179,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1192,6 +1198,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1265,8 +1272,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1290,8 +1300,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1306,6 +1319,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/client.py b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/client.py index fe13aa7e5c..adef374875 100644 --- a/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/deployment_resource_pool_service/client.py @@ -1446,8 +1446,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1471,8 +1474,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1487,6 +1493,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1560,8 +1567,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1585,8 +1595,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1601,6 +1614,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py index ee3f45dd5f..01c2a9de1f 100644 --- a/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/endpoint_service/async_client.py @@ -1417,8 +1417,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1442,8 +1445,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1458,6 +1464,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1531,8 +1538,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1556,8 +1566,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1572,6 +1585,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/endpoint_service/client.py b/google/cloud/aiplatform_v1beta1/services/endpoint_service/client.py index 2c98fa2cb6..cecd22e69a 100644 --- a/google/cloud/aiplatform_v1beta1/services/endpoint_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/endpoint_service/client.py @@ -1722,8 +1722,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1747,8 +1750,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1763,6 +1769,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1836,8 +1843,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1861,8 +1871,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1877,6 +1890,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py index f7625f45b0..73eb58164c 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/async_client.py @@ -457,6 +457,129 @@ async def sample_streaming_read_feature_values(): # Done; return the response. return response + async def write_feature_values( + self, + request: Union[ + featurestore_online_service.WriteFeatureValuesRequest, dict + ] = None, + *, + entity_type: str = None, + payloads: Sequence[ + featurestore_online_service.WriteFeatureValuesPayload + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> featurestore_online_service.WriteFeatureValuesResponse: + r"""Writes Feature values of one or more entities of an + EntityType. + The Feature values are merged into existing entities if + any. The Feature values to be written must have + timestamp within the online storage retention. + + .. code-block:: python + + from google.cloud import aiplatform_v1beta1 + + async def sample_write_feature_values(): + # Create a client + client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceAsyncClient() + + # Initialize request argument(s) + payloads = aiplatform_v1beta1.WriteFeatureValuesPayload() + payloads.entity_id = "entity_id_value" + + request = aiplatform_v1beta1.WriteFeatureValuesRequest( + entity_type="entity_type_value", + payloads=payloads, + ) + + # Make the request + response = await client.write_feature_values(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesRequest, dict]): + The request object. Request message for + [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. + entity_type (:class:`str`): + Required. The resource name of the EntityType for the + entities being written. Value format: + ``projects/{project}/locations/{location}/featurestores/ {featurestore}/entityTypes/{entityType}``. + For example, for a machine learning model predicting + user clicks on a website, an EntityType ID could be + ``user``. + + This corresponds to the ``entity_type`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + payloads (:class:`Sequence[google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesPayload]`): + Required. The entities to be written. Up to 100,000 + feature values can be written across all ``payloads``. + + This corresponds to the ``payloads`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesResponse: + Response message for + [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([entity_type, payloads]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + request = featurestore_online_service.WriteFeatureValuesRequest(request) + + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if entity_type is not None: + request.entity_type = entity_type + if payloads: + request.payloads.extend(payloads) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.write_feature_values, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("entity_type", request.entity_type),) + ), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def list_operations( self, request: operations_pb2.ListOperationsRequest = None, @@ -770,8 +893,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -795,8 +921,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -811,6 +940,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -884,8 +1014,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -909,8 +1042,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -925,6 +1061,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/client.py b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/client.py index 1696c9e732..54fce65e2f 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/client.py @@ -671,6 +671,131 @@ def sample_streaming_read_feature_values(): # Done; return the response. return response + def write_feature_values( + self, + request: Union[ + featurestore_online_service.WriteFeatureValuesRequest, dict + ] = None, + *, + entity_type: str = None, + payloads: Sequence[ + featurestore_online_service.WriteFeatureValuesPayload + ] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> featurestore_online_service.WriteFeatureValuesResponse: + r"""Writes Feature values of one or more entities of an + EntityType. + The Feature values are merged into existing entities if + any. The Feature values to be written must have + timestamp within the online storage retention. + + .. code-block:: python + + from google.cloud import aiplatform_v1beta1 + + def sample_write_feature_values(): + # Create a client + client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceClient() + + # Initialize request argument(s) + payloads = aiplatform_v1beta1.WriteFeatureValuesPayload() + payloads.entity_id = "entity_id_value" + + request = aiplatform_v1beta1.WriteFeatureValuesRequest( + entity_type="entity_type_value", + payloads=payloads, + ) + + # Make the request + response = client.write_feature_values(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesRequest, dict]): + The request object. Request message for + [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. + entity_type (str): + Required. The resource name of the EntityType for the + entities being written. Value format: + ``projects/{project}/locations/{location}/featurestores/ {featurestore}/entityTypes/{entityType}``. + For example, for a machine learning model predicting + user clicks on a website, an EntityType ID could be + ``user``. + + This corresponds to the ``entity_type`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + payloads (Sequence[google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesPayload]): + Required. The entities to be written. Up to 100,000 + feature values can be written across all ``payloads``. + + This corresponds to the ``payloads`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesResponse: + Response message for + [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. + + """ + # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([entity_type, payloads]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + + # Minor optimization to avoid making a copy if the user passes + # in a featurestore_online_service.WriteFeatureValuesRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance( + request, featurestore_online_service.WriteFeatureValuesRequest + ): + request = featurestore_online_service.WriteFeatureValuesRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if entity_type is not None: + request.entity_type = entity_type + if payloads is not None: + request.payloads = payloads + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.write_feature_values] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata( + (("entity_type", request.entity_type),) + ), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def __enter__(self): return self @@ -997,8 +1122,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1022,8 +1150,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1038,6 +1169,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1111,8 +1243,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1136,8 +1271,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1152,6 +1290,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/base.py b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/base.py index ae778465a7..03777d9bd6 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/base.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/base.py @@ -141,6 +141,11 @@ def _prep_wrapped_messages(self, client_info): default_timeout=5.0, client_info=client_info, ), + self.write_feature_values: gapic_v1.method.wrap_method( + self.write_feature_values, + default_timeout=None, + client_info=client_info, + ), } def close(self): @@ -176,6 +181,18 @@ def streaming_read_feature_values( ]: raise NotImplementedError() + @property + def write_feature_values( + self, + ) -> Callable[ + [featurestore_online_service.WriteFeatureValuesRequest], + Union[ + featurestore_online_service.WriteFeatureValuesResponse, + Awaitable[featurestore_online_service.WriteFeatureValuesResponse], + ], + ]: + raise NotImplementedError() + @property def list_operations( self, diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc.py b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc.py index da9a2e3e1e..fa82c5b7df 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc.py @@ -300,6 +300,39 @@ def streaming_read_feature_values( ) return self._stubs["streaming_read_feature_values"] + @property + def write_feature_values( + self, + ) -> Callable[ + [featurestore_online_service.WriteFeatureValuesRequest], + featurestore_online_service.WriteFeatureValuesResponse, + ]: + r"""Return a callable for the write feature values method over gRPC. + + Writes Feature values of one or more entities of an + EntityType. + The Feature values are merged into existing entities if + any. The Feature values to be written must have + timestamp within the online storage retention. + + Returns: + Callable[[~.WriteFeatureValuesRequest], + ~.WriteFeatureValuesResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "write_feature_values" not in self._stubs: + self._stubs["write_feature_values"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService/WriteFeatureValues", + request_serializer=featurestore_online_service.WriteFeatureValuesRequest.serialize, + response_deserializer=featurestore_online_service.WriteFeatureValuesResponse.deserialize, + ) + return self._stubs["write_feature_values"] + def close(self): self.grpc_channel.close() diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc_asyncio.py index 9de769e438..3c6095b276 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_online_serving_service/transports/grpc_asyncio.py @@ -303,6 +303,39 @@ def streaming_read_feature_values( ) return self._stubs["streaming_read_feature_values"] + @property + def write_feature_values( + self, + ) -> Callable[ + [featurestore_online_service.WriteFeatureValuesRequest], + Awaitable[featurestore_online_service.WriteFeatureValuesResponse], + ]: + r"""Return a callable for the write feature values method over gRPC. + + Writes Feature values of one or more entities of an + EntityType. + The Feature values are merged into existing entities if + any. The Feature values to be written must have + timestamp within the online storage retention. + + Returns: + Callable[[~.WriteFeatureValuesRequest], + Awaitable[~.WriteFeatureValuesResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "write_feature_values" not in self._stubs: + self._stubs["write_feature_values"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService/WriteFeatureValues", + request_serializer=featurestore_online_service.WriteFeatureValuesRequest.serialize, + response_deserializer=featurestore_online_service.WriteFeatureValuesResponse.deserialize, + ) + return self._stubs["write_feature_values"] + def close(self): return self.grpc_channel.close() diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py index d3ba7e2259..62b5b65da4 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_service/async_client.py @@ -3078,8 +3078,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3103,8 +3106,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3119,6 +3125,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3192,8 +3199,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3217,8 +3227,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3233,6 +3246,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/featurestore_service/client.py b/google/cloud/aiplatform_v1beta1/services/featurestore_service/client.py index bf4b73ab8e..3ef61a1875 100644 --- a/google/cloud/aiplatform_v1beta1/services/featurestore_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/featurestore_service/client.py @@ -3359,8 +3359,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3384,8 +3387,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3400,6 +3406,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3473,8 +3480,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3498,8 +3508,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3514,6 +3527,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py index 808f28c7d9..3bd4f951ba 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/async_client.py @@ -1481,8 +1481,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1506,8 +1509,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1522,6 +1528,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1595,8 +1602,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1620,8 +1630,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1636,6 +1649,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/client.py b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/client.py index 03420f3c41..f420b4411f 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/index_endpoint_service/client.py @@ -1736,8 +1736,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1761,8 +1764,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1777,6 +1783,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1850,8 +1857,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1875,8 +1885,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1891,6 +1904,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py index e546811cb9..6819240043 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/async_client.py @@ -793,6 +793,152 @@ async def sample_delete_index(): # Done; return the response. return response + async def upsert_datapoints( + self, + request: Union[index_service.UpsertDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.UpsertDatapointsResponse: + r"""Add/update Datapoints into an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1beta1 + + async def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.upsert_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.UpsertDatapointsRequest, dict]): + The request object. Request message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1beta1.types.UpsertDatapointsResponse: + Response message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] + + """ + # Create or coerce a protobuf request object. + request = index_service.UpsertDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.upsert_datapoints, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + async def remove_datapoints( + self, + request: Union[index_service.RemoveDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.RemoveDatapointsResponse: + r"""Remove Datapoints from an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1beta1 + + async def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.remove_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.RemoveDatapointsRequest, dict]): + The request object. Request message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1beta1.types.RemoveDatapointsResponse: + Response message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] + + """ + # Create or coerce a protobuf request object. + request = index_service.RemoveDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = gapic_v1.method_async.wrap_method( + self._client._transport.remove_datapoints, + default_timeout=None, + client_info=DEFAULT_CLIENT_INFO, + ) + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + async def list_operations( self, request: operations_pb2.ListOperationsRequest = None, @@ -1106,8 +1252,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1131,8 +1280,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1147,6 +1299,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1220,8 +1373,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1245,8 +1401,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1261,6 +1420,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/client.py b/google/cloud/aiplatform_v1beta1/services/index_service/client.py index 3dbc1521b9..beac88f4cd 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/client.py @@ -1038,6 +1038,154 @@ def sample_delete_index(): # Done; return the response. return response + def upsert_datapoints( + self, + request: Union[index_service.UpsertDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.UpsertDatapointsResponse: + r"""Add/update Datapoints into an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1beta1 + + def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.upsert_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.UpsertDatapointsRequest, dict]): + The request object. Request message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1beta1.types.UpsertDatapointsResponse: + Response message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a index_service.UpsertDatapointsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, index_service.UpsertDatapointsRequest): + request = index_service.UpsertDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.upsert_datapoints] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + + def remove_datapoints( + self, + request: Union[index_service.RemoveDatapointsRequest, dict] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: float = None, + metadata: Sequence[Tuple[str, str]] = (), + ) -> index_service.RemoveDatapointsResponse: + r"""Remove Datapoints from an Index. + + .. code-block:: python + + from google.cloud import aiplatform_v1beta1 + + def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.remove_datapoints(request=request) + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.aiplatform_v1beta1.types.RemoveDatapointsRequest, dict]): + The request object. Request message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, str]]): Strings which should be + sent along with the request as metadata. + + Returns: + google.cloud.aiplatform_v1beta1.types.RemoveDatapointsResponse: + Response message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] + + """ + # Create or coerce a protobuf request object. + # Minor optimization to avoid making a copy if the user passes + # in a index_service.RemoveDatapointsRequest. + # There's no risk of modifying the input as we've already verified + # there are no flattened fields. + if not isinstance(request, index_service.RemoveDatapointsRequest): + request = index_service.RemoveDatapointsRequest(request) + + # Wrap the RPC method; this adds retry and timeout information, + # and friendly error handling. + rpc = self._transport._wrapped_methods[self._transport.remove_datapoints] + + # Certain fields should be provided within the metadata header; + # add these here. + metadata = tuple(metadata) + ( + gapic_v1.routing_header.to_grpc_metadata((("index", request.index),)), + ) + + # Send the request. + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Done; return the response. + return response + def __enter__(self): return self @@ -1364,8 +1512,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1389,8 +1540,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1405,6 +1559,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1478,8 +1633,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1503,8 +1661,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1519,6 +1680,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/transports/base.py b/google/cloud/aiplatform_v1beta1/services/index_service/transports/base.py index b3d858c8bc..9ca82be0a4 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/transports/base.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/transports/base.py @@ -159,6 +159,16 @@ def _prep_wrapped_messages(self, client_info): default_timeout=5.0, client_info=client_info, ), + self.upsert_datapoints: gapic_v1.method.wrap_method( + self.upsert_datapoints, + default_timeout=None, + client_info=client_info, + ), + self.remove_datapoints: gapic_v1.method.wrap_method( + self.remove_datapoints, + default_timeout=None, + client_info=client_info, + ), } def close(self): @@ -222,6 +232,30 @@ def delete_index( ]: raise NotImplementedError() + @property + def upsert_datapoints( + self, + ) -> Callable[ + [index_service.UpsertDatapointsRequest], + Union[ + index_service.UpsertDatapointsResponse, + Awaitable[index_service.UpsertDatapointsResponse], + ], + ]: + raise NotImplementedError() + + @property + def remove_datapoints( + self, + ) -> Callable[ + [index_service.RemoveDatapointsRequest], + Union[ + index_service.RemoveDatapointsResponse, + Awaitable[index_service.RemoveDatapointsResponse], + ], + ]: + raise NotImplementedError() + @property def list_operations( self, diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc.py b/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc.py index d511dd25f5..f00f6642eb 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc.py @@ -384,6 +384,62 @@ def delete_index( ) return self._stubs["delete_index"] + @property + def upsert_datapoints( + self, + ) -> Callable[ + [index_service.UpsertDatapointsRequest], index_service.UpsertDatapointsResponse + ]: + r"""Return a callable for the upsert datapoints method over gRPC. + + Add/update Datapoints into an Index. + + Returns: + Callable[[~.UpsertDatapointsRequest], + ~.UpsertDatapointsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "upsert_datapoints" not in self._stubs: + self._stubs["upsert_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.IndexService/UpsertDatapoints", + request_serializer=index_service.UpsertDatapointsRequest.serialize, + response_deserializer=index_service.UpsertDatapointsResponse.deserialize, + ) + return self._stubs["upsert_datapoints"] + + @property + def remove_datapoints( + self, + ) -> Callable[ + [index_service.RemoveDatapointsRequest], index_service.RemoveDatapointsResponse + ]: + r"""Return a callable for the remove datapoints method over gRPC. + + Remove Datapoints from an Index. + + Returns: + Callable[[~.RemoveDatapointsRequest], + ~.RemoveDatapointsResponse]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "remove_datapoints" not in self._stubs: + self._stubs["remove_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.IndexService/RemoveDatapoints", + request_serializer=index_service.RemoveDatapointsRequest.serialize, + response_deserializer=index_service.RemoveDatapointsResponse.deserialize, + ) + return self._stubs["remove_datapoints"] + def close(self): self.grpc_channel.close() diff --git a/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc_asyncio.py b/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc_asyncio.py index b78e8bdafd..82d7b0eb9c 100644 --- a/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc_asyncio.py +++ b/google/cloud/aiplatform_v1beta1/services/index_service/transports/grpc_asyncio.py @@ -397,6 +397,64 @@ def delete_index( ) return self._stubs["delete_index"] + @property + def upsert_datapoints( + self, + ) -> Callable[ + [index_service.UpsertDatapointsRequest], + Awaitable[index_service.UpsertDatapointsResponse], + ]: + r"""Return a callable for the upsert datapoints method over gRPC. + + Add/update Datapoints into an Index. + + Returns: + Callable[[~.UpsertDatapointsRequest], + Awaitable[~.UpsertDatapointsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "upsert_datapoints" not in self._stubs: + self._stubs["upsert_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.IndexService/UpsertDatapoints", + request_serializer=index_service.UpsertDatapointsRequest.serialize, + response_deserializer=index_service.UpsertDatapointsResponse.deserialize, + ) + return self._stubs["upsert_datapoints"] + + @property + def remove_datapoints( + self, + ) -> Callable[ + [index_service.RemoveDatapointsRequest], + Awaitable[index_service.RemoveDatapointsResponse], + ]: + r"""Return a callable for the remove datapoints method over gRPC. + + Remove Datapoints from an Index. + + Returns: + Callable[[~.RemoveDatapointsRequest], + Awaitable[~.RemoveDatapointsResponse]]: + A function that, when called, will call the underlying RPC + on the server. + """ + # Generate a "stub function" on-the-fly which will actually make + # the request. + # gRPC handles serialization and deserialization, so we just need + # to pass in the functions for each. + if "remove_datapoints" not in self._stubs: + self._stubs["remove_datapoints"] = self.grpc_channel.unary_unary( + "/google.cloud.aiplatform.v1beta1.IndexService/RemoveDatapoints", + request_serializer=index_service.RemoveDatapointsRequest.serialize, + response_deserializer=index_service.RemoveDatapointsResponse.deserialize, + ) + return self._stubs["remove_datapoints"] + def close(self): return self.grpc_channel.close() diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py index b2331938f0..9b864e2372 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/async_client.py @@ -3643,8 +3643,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3668,8 +3671,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3684,6 +3690,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3757,8 +3764,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3782,8 +3792,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3798,6 +3811,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/job_service/client.py b/google/cloud/aiplatform_v1beta1/services/job_service/client.py index 80e47f4f05..d9482f5dfa 100644 --- a/google/cloud/aiplatform_v1beta1/services/job_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/job_service/client.py @@ -4128,8 +4128,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4153,8 +4156,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4169,6 +4175,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4242,8 +4249,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4267,8 +4277,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4283,6 +4296,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py index 76753ab511..eaaad9cd6a 100644 --- a/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/metadata_service/async_client.py @@ -4000,8 +4000,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4025,8 +4028,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4041,6 +4047,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4114,8 +4121,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4139,8 +4149,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4155,6 +4168,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/metadata_service/client.py b/google/cloud/aiplatform_v1beta1/services/metadata_service/client.py index 2099ed6f28..095e60666a 100644 --- a/google/cloud/aiplatform_v1beta1/services/metadata_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/metadata_service/client.py @@ -4336,8 +4336,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4361,8 +4364,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4377,6 +4383,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4450,8 +4457,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4475,8 +4485,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4491,6 +4504,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py index ef1b557946..dd417d9803 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/async_client.py @@ -787,8 +787,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -812,8 +815,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -828,6 +834,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -901,8 +908,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -926,8 +936,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -942,6 +955,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/migration_service/client.py b/google/cloud/aiplatform_v1beta1/services/migration_service/client.py index f12418a9a5..9581b4dd95 100644 --- a/google/cloud/aiplatform_v1beta1/services/migration_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/migration_service/client.py @@ -218,40 +218,40 @@ def parse_dataset_path(path: str) -> Dict[str, str]: @staticmethod def dataset_path( project: str, - location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/locations/{location}/datasets/{dataset}".format( + return "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match( - r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", - path, - ) + m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def dataset_path( project: str, + location: str, dataset: str, ) -> str: """Returns a fully-qualified dataset string.""" - return "projects/{project}/datasets/{dataset}".format( + return "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) @staticmethod def parse_dataset_path(path: str) -> Dict[str, str]: """Parses a dataset path into its component segments.""" - m = re.match(r"^projects/(?P.+?)/datasets/(?P.+?)$", path) + m = re.match( + r"^projects/(?P.+?)/locations/(?P.+?)/datasets/(?P.+?)$", + path, + ) return m.groupdict() if m else {} @staticmethod @@ -1140,8 +1140,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1165,8 +1168,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1181,6 +1187,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1254,8 +1261,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1279,8 +1289,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1295,6 +1308,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py index b106c8802c..51157fdb99 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/model_service/async_client.py @@ -1226,11 +1226,11 @@ async def sample_merge_version_aliases(): version_aliases (:class:`Sequence[str]`): Required. The set of version aliases to merge. The alias should be at most 128 characters, and match - ``[a-z][a-z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix - to an alias means removing that alias from the version. - ``-`` is NOT counted in the 128 characters. Example: - ``-golden`` means removing the ``golden`` alias from the - version. + ``[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` + prefix to an alias means removing that alias from the + version. ``-`` is NOT counted in the 128 characters. + Example: ``-golden`` means removing the ``golden`` alias + from the version. There is NO ordering in aliases, which means @@ -2371,8 +2371,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2396,8 +2399,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2412,6 +2418,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2485,8 +2492,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2510,8 +2520,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2526,6 +2539,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/model_service/client.py b/google/cloud/aiplatform_v1beta1/services/model_service/client.py index 8484e4e0fc..0e5d33e047 100644 --- a/google/cloud/aiplatform_v1beta1/services/model_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/model_service/client.py @@ -1533,11 +1533,11 @@ def sample_merge_version_aliases(): version_aliases (Sequence[str]): Required. The set of version aliases to merge. The alias should be at most 128 characters, and match - ``[a-z][a-z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix - to an alias means removing that alias from the version. - ``-`` is NOT counted in the 128 characters. Example: - ``-golden`` means removing the ``golden`` alias from the - version. + ``[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` + prefix to an alias means removing that alias from the + version. ``-`` is NOT counted in the 128 characters. + Example: ``-golden`` means removing the ``golden`` alias + from the version. There is NO ordering in aliases, which means @@ -2699,8 +2699,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2724,8 +2727,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2740,6 +2746,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2813,8 +2820,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2838,8 +2848,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2854,6 +2867,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py index e5f215925a..a12004ab19 100644 --- a/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/pipeline_service/async_client.py @@ -1635,8 +1635,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1660,8 +1663,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1676,6 +1682,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1749,8 +1756,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1774,8 +1784,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1790,6 +1803,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/pipeline_service/client.py b/google/cloud/aiplatform_v1beta1/services/pipeline_service/client.py index 6169f953f7..5fd8065763 100644 --- a/google/cloud/aiplatform_v1beta1/services/pipeline_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/pipeline_service/client.py @@ -2032,8 +2032,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2057,8 +2060,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2073,6 +2079,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2146,8 +2153,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2171,8 +2181,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2187,6 +2200,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py index 2a4467854d..6422055fd9 100644 --- a/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/prediction_service/async_client.py @@ -991,8 +991,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1016,8 +1019,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1032,6 +1038,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1105,8 +1112,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1130,8 +1140,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1146,6 +1159,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py b/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py index 3f59e975a7..253b6478b4 100644 --- a/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/prediction_service/client.py @@ -1249,8 +1249,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1274,8 +1277,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1290,6 +1296,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1363,8 +1370,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1388,8 +1398,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1404,6 +1417,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py index 67134cf9cd..dbd9d3ebf8 100644 --- a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/async_client.py @@ -1141,8 +1141,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1166,8 +1169,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1182,6 +1188,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1255,8 +1262,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1280,8 +1290,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1296,6 +1309,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/client.py b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/client.py index 1fe1f7ac36..883bf5b6f6 100644 --- a/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/specialist_pool_service/client.py @@ -1372,8 +1372,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1397,8 +1400,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1413,6 +1419,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -1486,8 +1493,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1511,8 +1521,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1527,6 +1540,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py index 4f5691a77f..9e5b9756d1 100644 --- a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/async_client.py @@ -3776,8 +3776,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3801,8 +3804,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3817,6 +3823,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -3890,8 +3897,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -3915,8 +3925,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -3931,6 +3944,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/client.py b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/client.py index 2a408b4251..28f4cd4cca 100644 --- a/google/cloud/aiplatform_v1beta1/services/tensorboard_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/tensorboard_service/client.py @@ -4135,8 +4135,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4160,8 +4163,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4176,6 +4182,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -4249,8 +4256,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -4274,8 +4284,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -4290,6 +4303,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py b/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py index 6a4b2788b4..ee17fd0f99 100644 --- a/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py +++ b/google/cloud/aiplatform_v1beta1/services/vizier_service/async_client.py @@ -1945,8 +1945,11 @@ async def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -1970,8 +1973,11 @@ async def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -1986,6 +1992,7 @@ async def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2059,8 +2066,11 @@ async def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2084,8 +2094,11 @@ async def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2100,6 +2113,7 @@ async def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/services/vizier_service/client.py b/google/cloud/aiplatform_v1beta1/services/vizier_service/client.py index b7c5d44cd8..7a3341335b 100644 --- a/google/cloud/aiplatform_v1beta1/services/vizier_service/client.py +++ b/google/cloud/aiplatform_v1beta1/services/vizier_service/client.py @@ -2230,8 +2230,11 @@ def set_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2255,8 +2258,11 @@ def set_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2271,6 +2277,7 @@ def set_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. @@ -2344,8 +2351,11 @@ def get_iam_policy( expression that further constrains the role binding based on attributes about the request and/or target resource. + **JSON Example** + :: + { "bindings": [ { @@ -2369,8 +2379,11 @@ def get_iam_policy( } ] } + **YAML Example** + :: + bindings: - members: - user:mike@example.com @@ -2385,6 +2398,7 @@ def get_iam_policy( title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + For a description of IAM and its features, see the `IAM developer's guide `__. diff --git a/google/cloud/aiplatform_v1beta1/types/__init__.py b/google/cloud/aiplatform_v1beta1/types/__init__.py index fc4ad4db89..8e72801d5e 100644 --- a/google/cloud/aiplatform_v1beta1/types/__init__.py +++ b/google/cloud/aiplatform_v1beta1/types/__init__.py @@ -176,6 +176,9 @@ ReadFeatureValuesRequest, ReadFeatureValuesResponse, StreamingReadFeatureValuesRequest, + WriteFeatureValuesPayload, + WriteFeatureValuesRequest, + WriteFeatureValuesResponse, ) from .featurestore_service import ( BatchCreateFeaturesOperationMetadata, @@ -222,6 +225,8 @@ ) from .index import ( Index, + IndexDatapoint, + IndexStats, ) from .index_endpoint import ( DeployedIndex, @@ -255,8 +260,12 @@ ListIndexesRequest, ListIndexesResponse, NearestNeighborSearchOperationMetadata, + RemoveDatapointsRequest, + RemoveDatapointsResponse, UpdateIndexOperationMetadata, UpdateIndexRequest, + UpsertDatapointsRequest, + UpsertDatapointsResponse, ) from .io import ( AvroSource, @@ -718,6 +727,9 @@ "ReadFeatureValuesRequest", "ReadFeatureValuesResponse", "StreamingReadFeatureValuesRequest", + "WriteFeatureValuesPayload", + "WriteFeatureValuesRequest", + "WriteFeatureValuesResponse", "BatchCreateFeaturesOperationMetadata", "BatchCreateFeaturesRequest", "BatchCreateFeaturesResponse", @@ -758,6 +770,8 @@ "UpdateFeaturestoreRequest", "HyperparameterTuningJob", "Index", + "IndexDatapoint", + "IndexStats", "DeployedIndex", "DeployedIndexAuthConfig", "IndexEndpoint", @@ -785,8 +799,12 @@ "ListIndexesRequest", "ListIndexesResponse", "NearestNeighborSearchOperationMetadata", + "RemoveDatapointsRequest", + "RemoveDatapointsResponse", "UpdateIndexOperationMetadata", "UpdateIndexRequest", + "UpsertDatapointsRequest", + "UpsertDatapointsResponse", "AvroSource", "BigQueryDestination", "BigQuerySource", diff --git a/google/cloud/aiplatform_v1beta1/types/dataset_service.py b/google/cloud/aiplatform_v1beta1/types/dataset_service.py index 9722778d6a..f6c91efd4f 100644 --- a/google/cloud/aiplatform_v1beta1/types/dataset_service.py +++ b/google/cloud/aiplatform_v1beta1/types/dataset_service.py @@ -499,7 +499,7 @@ class ListSavedQueriesResponse(proto.Message): Attributes: saved_queries (Sequence[google.cloud.aiplatform_v1beta1.types.SavedQuery]): - A list of SavedQueries that matches the + A list of SavedQueries that match the specified filter in the request. next_page_token (str): The standard List next-page token. diff --git a/google/cloud/aiplatform_v1beta1/types/explanation.py b/google/cloud/aiplatform_v1beta1/types/explanation.py index a276c39b41..d9495e3bbd 100644 --- a/google/cloud/aiplatform_v1beta1/types/explanation.py +++ b/google/cloud/aiplatform_v1beta1/types/explanation.py @@ -312,7 +312,7 @@ class ExplanationSpec(proto.Message): Required. Parameters that configure explaining of the Model's predictions. metadata (google.cloud.aiplatform_v1beta1.types.ExplanationMetadata): - Required. Metadata describing the Model's + Optional. Metadata describing the Model's input and output for explanation. """ @@ -392,7 +392,7 @@ class ExplanationParameters(proto.Message): If not populated, returns attributions for [top_k][google.cloud.aiplatform.v1beta1.ExplanationParameters.top_k] - indices of outputs. If neither top_k nor output_indeices is + indices of outputs. If neither top_k nor output_indices is populated, returns the argmax index of the outputs. Only applicable to Models that predict multiple outputs diff --git a/google/cloud/aiplatform_v1beta1/types/featurestore_online_service.py b/google/cloud/aiplatform_v1beta1/types/featurestore_online_service.py index b153d6be49..f2da9a5c50 100644 --- a/google/cloud/aiplatform_v1beta1/types/featurestore_online_service.py +++ b/google/cloud/aiplatform_v1beta1/types/featurestore_online_service.py @@ -25,6 +25,9 @@ __protobuf__ = proto.module( package="google.cloud.aiplatform.v1beta1", manifest={ + "WriteFeatureValuesRequest", + "WriteFeatureValuesPayload", + "WriteFeatureValuesResponse", "ReadFeatureValuesRequest", "ReadFeatureValuesResponse", "StreamingReadFeatureValuesRequest", @@ -34,6 +37,66 @@ ) +class WriteFeatureValuesRequest(proto.Message): + r"""Request message for + [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. + + Attributes: + entity_type (str): + Required. The resource name of the EntityType for the + entities being written. Value format: + ``projects/{project}/locations/{location}/featurestores/ {featurestore}/entityTypes/{entityType}``. + For example, for a machine learning model predicting user + clicks on a website, an EntityType ID could be ``user``. + payloads (Sequence[google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesPayload]): + Required. The entities to be written. Up to 100,000 feature + values can be written across all ``payloads``. + """ + + entity_type = proto.Field( + proto.STRING, + number=1, + ) + payloads = proto.RepeatedField( + proto.MESSAGE, + number=2, + message="WriteFeatureValuesPayload", + ) + + +class WriteFeatureValuesPayload(proto.Message): + r"""Contains Feature values to be written for a specific entity. + + Attributes: + entity_id (str): + Required. The ID of the entity. + feature_values (Mapping[str, google.cloud.aiplatform_v1beta1.types.FeatureValue]): + Required. Feature values to be written, mapping from Feature + ID to value. Up to 100,000 ``feature_values`` entries may be + written across all payloads. The feature generation time, + aligned by days, must be no older than five years (1825 + days) and no later than one year (366 days) in the future. + """ + + entity_id = proto.Field( + proto.STRING, + number=1, + ) + feature_values = proto.MapField( + proto.STRING, + proto.MESSAGE, + number=2, + message="FeatureValue", + ) + + +class WriteFeatureValuesResponse(proto.Message): + r"""Response message for + [FeaturestoreOnlineServingService.WriteFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues]. + + """ + + class ReadFeatureValuesRequest(proto.Message): r"""Request message for [FeaturestoreOnlineServingService.ReadFeatureValues][google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.ReadFeatureValues]. diff --git a/google/cloud/aiplatform_v1beta1/types/index.py b/google/cloud/aiplatform_v1beta1/types/index.py index 96efd0f02d..3154d1cb42 100644 --- a/google/cloud/aiplatform_v1beta1/types/index.py +++ b/google/cloud/aiplatform_v1beta1/types/index.py @@ -24,6 +24,8 @@ package="google.cloud.aiplatform.v1beta1", manifest={ "Index", + "IndexDatapoint", + "IndexStats", }, ) @@ -90,8 +92,19 @@ class Index(proto.Message): not mean their results are not already reflected in the Index. Result of any successfully completed Operation on the Index is reflected in it. + index_stats (google.cloud.aiplatform_v1beta1.types.IndexStats): + Output only. Stats of the index resource. + index_update_method (google.cloud.aiplatform_v1beta1.types.Index.IndexUpdateMethod): + Immutable. The update method to use with this Index. If not + set, BATCH_UPDATE will be used by default. """ + class IndexUpdateMethod(proto.Enum): + r"""The update method of an Index.""" + INDEX_UPDATE_METHOD_UNSPECIFIED = 0 + BATCH_UPDATE = 1 + STREAM_UPDATE = 2 + name = proto.Field( proto.STRING, number=1, @@ -137,6 +150,129 @@ class Index(proto.Message): number=11, message=timestamp_pb2.Timestamp, ) + index_stats = proto.Field( + proto.MESSAGE, + number=14, + message="IndexStats", + ) + index_update_method = proto.Field( + proto.ENUM, + number=16, + enum=IndexUpdateMethod, + ) + + +class IndexDatapoint(proto.Message): + r"""A datapoint of Index. + + Attributes: + datapoint_id (str): + Required. Unique identifier of the datapoint. + feature_vector (Sequence[float]): + Required. Feature embedding vector. An array of numbers with + the length of [NearestNeighborSearchConfig.dimensions]. + restricts (Sequence[google.cloud.aiplatform_v1beta1.types.IndexDatapoint.Restriction]): + Optional. List of Restrict of the datapoint, + used to perform "restricted searches" where + boolean rule are used to filter the subset of + the database eligible for matching. + See: + https://cloud.google.com/vertex-ai/docs/matching-engine/filtering + crowding_tag (google.cloud.aiplatform_v1beta1.types.IndexDatapoint.CrowdingTag): + Optional. CrowdingTag of the datapoint, the + number of neighbors to return in each crowding + can be configured during query. + """ + + class Restriction(proto.Message): + r"""Restriction of a datapoint which describe its + attributes(tokens) from each of several attribute + categories(namespaces). + + Attributes: + namespace (str): + The namespace of this restriction. eg: color. + allow_list (Sequence[str]): + The attributes to allow in this namespace. + eg: 'red' + deny_list (Sequence[str]): + The attributes to deny in this namespace. eg: + 'blue' + """ + + namespace = proto.Field( + proto.STRING, + number=1, + ) + allow_list = proto.RepeatedField( + proto.STRING, + number=2, + ) + deny_list = proto.RepeatedField( + proto.STRING, + number=3, + ) + + class CrowdingTag(proto.Message): + r"""Crowding tag is a constraint on a neighbor list produced by nearest + neighbor search requiring that no more than some value k' of the k + neighbors returned have the same value of crowding_attribute. + + Attributes: + crowding_attribute (str): + The attribute value used for crowding. The maximum number of + neighbors to return per crowding attribute value + (per_crowding_attribute_num_neighbors) is configured + per-query. This field is ignored if + per_crowding_attribute_num_neighbors is larger than the + total number of neighbors to return for a given query. + """ + + crowding_attribute = proto.Field( + proto.STRING, + number=1, + ) + + datapoint_id = proto.Field( + proto.STRING, + number=1, + ) + feature_vector = proto.RepeatedField( + proto.FLOAT, + number=2, + ) + restricts = proto.RepeatedField( + proto.MESSAGE, + number=4, + message=Restriction, + ) + crowding_tag = proto.Field( + proto.MESSAGE, + number=5, + message=CrowdingTag, + ) + + +class IndexStats(proto.Message): + r"""Stats of the Index. + + Attributes: + vectors_count (int): + Output only. The number of vectors in the + Index. + shards_count (int): + Output only. The number of shards in the + Index. + """ + + vectors_count = proto.Field( + proto.INT64, + number=1, + ) + shards_count = proto.Field( + proto.INT32, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/aiplatform_v1beta1/types/index_service.py b/google/cloud/aiplatform_v1beta1/types/index_service.py index 375b381c82..60ccad9fff 100644 --- a/google/cloud/aiplatform_v1beta1/types/index_service.py +++ b/google/cloud/aiplatform_v1beta1/types/index_service.py @@ -31,6 +31,10 @@ "UpdateIndexRequest", "UpdateIndexOperationMetadata", "DeleteIndexRequest", + "UpsertDatapointsRequest", + "UpsertDatapointsResponse", + "RemoveDatapointsRequest", + "RemoveDatapointsResponse", "NearestNeighborSearchOperationMetadata", }, ) @@ -241,6 +245,67 @@ class DeleteIndexRequest(proto.Message): ) +class UpsertDatapointsRequest(proto.Message): + r"""Request message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] + + Attributes: + index (str): + Required. The name of the Index resource to be updated. + Format: + ``projects/{project}/locations/{location}/indexes/{index}`` + datapoints (Sequence[google.cloud.aiplatform_v1beta1.types.IndexDatapoint]): + A list of datapoints to be created/updated. + """ + + index = proto.Field( + proto.STRING, + number=1, + ) + datapoints = proto.RepeatedField( + proto.MESSAGE, + number=2, + message=gca_index.IndexDatapoint, + ) + + +class UpsertDatapointsResponse(proto.Message): + r"""Response message for + [IndexService.UpsertDatapoints][google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints] + + """ + + +class RemoveDatapointsRequest(proto.Message): + r"""Request message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] + + Attributes: + index (str): + Required. The name of the Index resource to be updated. + Format: + ``projects/{project}/locations/{location}/indexes/{index}`` + datapoint_ids (Sequence[str]): + A list of datapoint ids to be deleted. + """ + + index = proto.Field( + proto.STRING, + number=1, + ) + datapoint_ids = proto.RepeatedField( + proto.STRING, + number=2, + ) + + +class RemoveDatapointsResponse(proto.Message): + r"""Response message for + [IndexService.RemoveDatapoints][google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints] + + """ + + class NearestNeighborSearchOperationMetadata(proto.Message): r"""Runtime operation metadata with regard to Matching Engine Index. diff --git a/google/cloud/aiplatform_v1beta1/types/model_monitoring.py b/google/cloud/aiplatform_v1beta1/types/model_monitoring.py index 79bb1357cd..1a2e0aaff6 100644 --- a/google/cloud/aiplatform_v1beta1/types/model_monitoring.py +++ b/google/cloud/aiplatform_v1beta1/types/model_monitoring.py @@ -31,7 +31,8 @@ class ModelMonitoringConfig(proto.Message): - r"""Next ID: 5 + r"""The model monitoring configuration used for Batch Prediction + Job. Attributes: objective_configs (Sequence[google.cloud.aiplatform_v1beta1.types.ModelMonitoringObjectiveConfig]): @@ -49,6 +50,12 @@ class ModelMonitoringConfig(proto.Message): trained with Vertex AI, this field must be set as all the fields in predict instance formatted as string. + stats_anomalies_base_directory (google.cloud.aiplatform_v1beta1.types.GcsDestination): + A Google Cloud Storage location for batch + prediction model monitoring to dump statistics + and anomalies. If not provided, a folder will be + created in customer project to hold statistics + and anomalies. """ objective_configs = proto.RepeatedField( @@ -65,10 +72,17 @@ class ModelMonitoringConfig(proto.Message): proto.STRING, number=4, ) + stats_anomalies_base_directory = proto.Field( + proto.MESSAGE, + number=5, + message=io.GcsDestination, + ) class ModelMonitoringObjectiveConfig(proto.Message): - r"""Next ID: 8 + r"""The objective configuration for model monitoring, including + the information needed to detect anomalies for one particular + model. Attributes: training_dataset (google.cloud.aiplatform_v1beta1.types.ModelMonitoringObjectiveConfig.TrainingDataset): @@ -352,7 +366,7 @@ class PredictionFormat(proto.Enum): class ModelMonitoringAlertConfig(proto.Message): - r"""Next ID: 3 + r""" .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -396,8 +410,6 @@ class EmailAlertConfig(proto.Message): class ThresholdConfig(proto.Message): r"""The config for feature monitoring threshold. - Next ID: 3 - .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields @@ -428,7 +440,6 @@ class ThresholdConfig(proto.Message): class SamplingStrategy(proto.Message): r"""Sampling Strategy for logging, can be for both training and prediction dataset. - Next ID: 2 Attributes: random_sample_config (google.cloud.aiplatform_v1beta1.types.SamplingStrategy.RandomSampleConfig): diff --git a/google/cloud/aiplatform_v1beta1/types/model_service.py b/google/cloud/aiplatform_v1beta1/types/model_service.py index ec9137affa..b249e44a96 100644 --- a/google/cloud/aiplatform_v1beta1/types/model_service.py +++ b/google/cloud/aiplatform_v1beta1/types/model_service.py @@ -484,10 +484,11 @@ class MergeVersionAliasesRequest(proto.Message): version_aliases (Sequence[str]): Required. The set of version aliases to merge. The alias should be at most 128 characters, and match - ``[a-z][a-z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix to - an alias means removing that alias from the version. ``-`` - is NOT counted in the 128 characters. Example: ``-golden`` - means removing the ``golden`` alias from the version. + ``[a-z][a-zA-Z0-9-]{0,126}[a-z-0-9]``. Add the ``-`` prefix + to an alias means removing that alias from the version. + ``-`` is NOT counted in the 128 characters. Example: + ``-golden`` means removing the ``golden`` alias from the + version. There is NO ordering in aliases, which means diff --git a/google/cloud/aiplatform_v1beta1/types/saved_query.py b/google/cloud/aiplatform_v1beta1/types/saved_query.py index abc5ee5856..ebcb8e7dd4 100644 --- a/google/cloud/aiplatform_v1beta1/types/saved_query.py +++ b/google/cloud/aiplatform_v1beta1/types/saved_query.py @@ -67,9 +67,9 @@ class SavedQuery(proto.Message): Output only. Number of AnnotationSpecs in the context of the SavedQuery. etag (str): - Used to perform consistent read-modify-write - updates. If not set, a blind "overwrite" update - happens. + Used to perform a consistent + read-modify-write update. If not set, a blind + "overwrite" update happens. support_automl_training (bool): Output only. If the Annotations belonging to the SavedQuery can be used for AutoML training. diff --git a/google/cloud/aiplatform_v1beta1/types/vizier_service.py b/google/cloud/aiplatform_v1beta1/types/vizier_service.py index d1e50bd957..d580c7e4fe 100644 --- a/google/cloud/aiplatform_v1beta1/types/vizier_service.py +++ b/google/cloud/aiplatform_v1beta1/types/vizier_service.py @@ -202,7 +202,7 @@ class SuggestTrialsRequest(proto.Message): ``projects/{project}/locations/{location}/studies/{study}`` suggestion_count (int): Required. The number of suggestions - requested. + requested. It must be positive. client_id (str): Required. The identifier of the client that is requesting the suggestion. diff --git a/owlbot.py b/owlbot.py index 3a9d1200ad..9bfa38eb33 100644 --- a/owlbot.py +++ b/owlbot.py @@ -60,6 +60,7 @@ s.move( library, excludes=[ + ".coveragerc", ".pre-commit-config.yaml", "setup.py", "README.rst", diff --git a/samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_async.py b/samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_async.py new file mode 100644 index 0000000000..03eed55853 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1_generated_IndexService_RemoveDatapoints_async] +from google.cloud import aiplatform_v1 + + +async def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.remove_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_IndexService_RemoveDatapoints_async] diff --git a/samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_sync.py b/samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_sync.py new file mode 100644 index 0000000000..ea16db6a04 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_index_service_remove_datapoints_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1_generated_IndexService_RemoveDatapoints_sync] +from google.cloud import aiplatform_v1 + + +def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.remove_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_IndexService_RemoveDatapoints_sync] diff --git a/samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_async.py b/samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_async.py new file mode 100644 index 0000000000..82d7362754 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpsertDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1_generated_IndexService_UpsertDatapoints_async] +from google.cloud import aiplatform_v1 + + +async def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.upsert_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_IndexService_UpsertDatapoints_async] diff --git a/samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_sync.py b/samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_sync.py new file mode 100644 index 0000000000..fb6a5c4f49 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1_generated_index_service_upsert_datapoints_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpsertDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1_generated_IndexService_UpsertDatapoints_sync] +from google.cloud import aiplatform_v1 + + +def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.upsert_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1_generated_IndexService_UpsertDatapoints_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_async.py new file mode 100644 index 0000000000..55d26abe39 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for WriteFeatureValues +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_async] +from google.cloud import aiplatform_v1beta1 + + +async def sample_write_feature_values(): + # Create a client + client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceAsyncClient() + + # Initialize request argument(s) + payloads = aiplatform_v1beta1.WriteFeatureValuesPayload() + payloads.entity_id = "entity_id_value" + + request = aiplatform_v1beta1.WriteFeatureValuesRequest( + entity_type="entity_type_value", + payloads=payloads, + ) + + # Make the request + response = await client.write_feature_values(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_sync.py new file mode 100644 index 0000000000..c108a5ac40 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for WriteFeatureValues +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_sync] +from google.cloud import aiplatform_v1beta1 + + +def sample_write_feature_values(): + # Create a client + client = aiplatform_v1beta1.FeaturestoreOnlineServingServiceClient() + + # Initialize request argument(s) + payloads = aiplatform_v1beta1.WriteFeatureValuesPayload() + payloads.entity_id = "entity_id_value" + + request = aiplatform_v1beta1.WriteFeatureValuesRequest( + entity_type="entity_type_value", + payloads=payloads, + ) + + # Make the request + response = client.write_feature_values(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_async.py new file mode 100644 index 0000000000..a20f224da9 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_IndexService_RemoveDatapoints_async] +from google.cloud import aiplatform_v1beta1 + + +async def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.remove_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_IndexService_RemoveDatapoints_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_sync.py new file mode 100644 index 0000000000..c40a288d83 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_remove_datapoints_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RemoveDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_IndexService_RemoveDatapoints_sync] +from google.cloud import aiplatform_v1beta1 + + +def sample_remove_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.RemoveDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.remove_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_IndexService_RemoveDatapoints_sync] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_async.py b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_async.py new file mode 100644 index 0000000000..c4f5185689 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpsertDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_IndexService_UpsertDatapoints_async] +from google.cloud import aiplatform_v1beta1 + + +async def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceAsyncClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = await client.upsert_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_IndexService_UpsertDatapoints_async] diff --git a/samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_sync.py b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_sync.py new file mode 100644 index 0000000000..250df524b7 --- /dev/null +++ b/samples/generated_samples/aiplatform_v1beta1_generated_index_service_upsert_datapoints_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpsertDatapoints +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-aiplatform + + +# [START aiplatform_v1beta1_generated_IndexService_UpsertDatapoints_sync] +from google.cloud import aiplatform_v1beta1 + + +def sample_upsert_datapoints(): + # Create a client + client = aiplatform_v1beta1.IndexServiceClient() + + # Initialize request argument(s) + request = aiplatform_v1beta1.UpsertDatapointsRequest( + index="index_value", + ) + + # Make the request + response = client.upsert_datapoints(request=request) + + # Handle the response + print(response) + +# [END aiplatform_v1beta1_generated_IndexService_UpsertDatapoints_sync] diff --git a/samples/generated_samples/snippet_metadata_aiplatform_v1.json b/samples/generated_samples/snippet_metadata_aiplatform_v1.json index 987c32c41a..ef2e33dfc4 100644 --- a/samples/generated_samples/snippet_metadata_aiplatform_v1.json +++ b/samples/generated_samples/snippet_metadata_aiplatform_v1.json @@ -8622,6 +8622,159 @@ ], "title": "aiplatform_v1_generated_index_service_list_indexes_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1.IndexServiceAsyncClient", + "shortName": "IndexServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1.IndexServiceAsyncClient.remove_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1.IndexService.RemoveDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1.IndexService", + "shortName": "IndexService" + }, + "shortName": "RemoveDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.RemoveDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1.types.RemoveDatapointsResponse", + "shortName": "remove_datapoints" + }, + "description": "Sample for RemoveDatapoints", + "file": "aiplatform_v1_generated_index_service_remove_datapoints_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_IndexService_RemoveDatapoints_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_index_service_remove_datapoints_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1.IndexServiceClient", + "shortName": "IndexServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1.IndexServiceClient.remove_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1.IndexService.RemoveDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1.IndexService", + "shortName": "IndexService" + }, + "shortName": "RemoveDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.RemoveDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1.types.RemoveDatapointsResponse", + "shortName": "remove_datapoints" + }, + "description": "Sample for RemoveDatapoints", + "file": "aiplatform_v1_generated_index_service_remove_datapoints_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_IndexService_RemoveDatapoints_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_index_service_remove_datapoints_sync.py" + }, { "canonical": true, "clientMethod": { @@ -8791,6 +8944,159 @@ ], "title": "aiplatform_v1_generated_index_service_update_index_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1.IndexServiceAsyncClient", + "shortName": "IndexServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1.IndexServiceAsyncClient.upsert_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1.IndexService.UpsertDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1.IndexService", + "shortName": "IndexService" + }, + "shortName": "UpsertDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.UpsertDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1.types.UpsertDatapointsResponse", + "shortName": "upsert_datapoints" + }, + "description": "Sample for UpsertDatapoints", + "file": "aiplatform_v1_generated_index_service_upsert_datapoints_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_IndexService_UpsertDatapoints_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_index_service_upsert_datapoints_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1.IndexServiceClient", + "shortName": "IndexServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1.IndexServiceClient.upsert_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1.IndexService.UpsertDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1.IndexService", + "shortName": "IndexService" + }, + "shortName": "UpsertDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1.types.UpsertDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1.types.UpsertDatapointsResponse", + "shortName": "upsert_datapoints" + }, + "description": "Sample for UpsertDatapoints", + "file": "aiplatform_v1_generated_index_service_upsert_datapoints_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1_generated_IndexService_UpsertDatapoints_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1_generated_index_service_upsert_datapoints_sync.py" + }, { "canonical": true, "clientMethod": { diff --git a/samples/generated_samples/snippet_metadata_aiplatform_v1beta1.json b/samples/generated_samples/snippet_metadata_aiplatform_v1beta1.json index 65b4c2c329..0546c77a16 100644 --- a/samples/generated_samples/snippet_metadata_aiplatform_v1beta1.json +++ b/samples/generated_samples/snippet_metadata_aiplatform_v1beta1.json @@ -4139,6 +4139,175 @@ ], "title": "aiplatform_v1beta1_generated_featurestore_online_serving_service_streaming_read_feature_values_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.FeaturestoreOnlineServingServiceAsyncClient", + "shortName": "FeaturestoreOnlineServingServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.FeaturestoreOnlineServingServiceAsyncClient.write_feature_values", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService", + "shortName": "FeaturestoreOnlineServingService" + }, + "shortName": "WriteFeatureValues" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesRequest" + }, + { + "name": "entity_type", + "type": "str" + }, + { + "name": "payloads", + "type": "Sequence[google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesPayload]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesResponse", + "shortName": "write_feature_values" + }, + "description": "Sample for WriteFeatureValues", + "file": "aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.FeaturestoreOnlineServingServiceClient", + "shortName": "FeaturestoreOnlineServingServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.FeaturestoreOnlineServingServiceClient.write_feature_values", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.WriteFeatureValues", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService", + "shortName": "FeaturestoreOnlineServingService" + }, + "shortName": "WriteFeatureValues" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesRequest" + }, + { + "name": "entity_type", + "type": "str" + }, + { + "name": "payloads", + "type": "Sequence[google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesPayload]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.WriteFeatureValuesResponse", + "shortName": "write_feature_values" + }, + "description": "Sample for WriteFeatureValues", + "file": "aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_FeaturestoreOnlineServingService_WriteFeatureValues_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_featurestore_online_serving_service_write_feature_values_sync.py" + }, { "canonical": true, "clientMethod": { @@ -9443,6 +9612,159 @@ ], "title": "aiplatform_v1beta1_generated_index_service_list_indexes_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceAsyncClient", + "shortName": "IndexServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceAsyncClient.remove_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService", + "shortName": "IndexService" + }, + "shortName": "RemoveDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.RemoveDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.RemoveDatapointsResponse", + "shortName": "remove_datapoints" + }, + "description": "Sample for RemoveDatapoints", + "file": "aiplatform_v1beta1_generated_index_service_remove_datapoints_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_IndexService_RemoveDatapoints_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_index_service_remove_datapoints_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceClient", + "shortName": "IndexServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceClient.remove_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService.RemoveDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService", + "shortName": "IndexService" + }, + "shortName": "RemoveDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.RemoveDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.RemoveDatapointsResponse", + "shortName": "remove_datapoints" + }, + "description": "Sample for RemoveDatapoints", + "file": "aiplatform_v1beta1_generated_index_service_remove_datapoints_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_IndexService_RemoveDatapoints_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_index_service_remove_datapoints_sync.py" + }, { "canonical": true, "clientMethod": { @@ -9612,6 +9934,159 @@ ], "title": "aiplatform_v1beta1_generated_index_service_update_index_sync.py" }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceAsyncClient", + "shortName": "IndexServiceAsyncClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceAsyncClient.upsert_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService", + "shortName": "IndexService" + }, + "shortName": "UpsertDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.UpsertDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.UpsertDatapointsResponse", + "shortName": "upsert_datapoints" + }, + "description": "Sample for UpsertDatapoints", + "file": "aiplatform_v1beta1_generated_index_service_upsert_datapoints_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_IndexService_UpsertDatapoints_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_index_service_upsert_datapoints_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceClient", + "shortName": "IndexServiceClient" + }, + "fullName": "google.cloud.aiplatform_v1beta1.IndexServiceClient.upsert_datapoints", + "method": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService.UpsertDatapoints", + "service": { + "fullName": "google.cloud.aiplatform.v1beta1.IndexService", + "shortName": "IndexService" + }, + "shortName": "UpsertDatapoints" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.aiplatform_v1beta1.types.UpsertDatapointsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.aiplatform_v1beta1.types.UpsertDatapointsResponse", + "shortName": "upsert_datapoints" + }, + "description": "Sample for UpsertDatapoints", + "file": "aiplatform_v1beta1_generated_index_service_upsert_datapoints_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "aiplatform_v1beta1_generated_IndexService_UpsertDatapoints_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ], + "title": "aiplatform_v1beta1_generated_index_service_upsert_datapoints_sync.py" + }, { "canonical": true, "clientMethod": { diff --git a/tests/unit/gapic/aiplatform_v1/test_dataset_service.py b/tests/unit/gapic/aiplatform_v1/test_dataset_service.py index fbf1dcf060..3e5afb3c7a 100644 --- a/tests/unit/gapic/aiplatform_v1/test_dataset_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_dataset_service.py @@ -4987,7 +4987,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5126,7 +5126,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5410,7 +5410,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5555,7 +5555,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5700,7 +5700,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py b/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py index 189b4cadcd..9efca8a21b 100644 --- a/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_endpoint_service.py @@ -3473,7 +3473,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3612,7 +3612,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3896,7 +3896,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4041,7 +4041,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4186,7 +4186,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py b/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py index 41bb8f2abc..37da436327 100644 --- a/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_featurestore_online_serving_service.py @@ -1948,7 +1948,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2087,7 +2087,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2371,7 +2371,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2516,7 +2516,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2661,7 +2661,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py b/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py index f135bb6362..2f4a1ada75 100644 --- a/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_featurestore_service.py @@ -7250,7 +7250,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7389,7 +7389,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7673,7 +7673,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7818,7 +7818,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7963,7 +7963,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py b/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py index 3f6e59ba3e..de829a7b34 100644 --- a/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_index_endpoint_service.py @@ -3687,7 +3687,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3826,7 +3826,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4110,7 +4110,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4255,7 +4255,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4400,7 +4400,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_index_service.py b/tests/unit/gapic/aiplatform_v1/test_index_service.py index aa81112a65..081c0420b8 100644 --- a/tests/unit/gapic/aiplatform_v1/test_index_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_index_service.py @@ -945,6 +945,7 @@ def test_get_index(request_type, transport: str = "grpc"): description="description_value", metadata_schema_uri="metadata_schema_uri_value", etag="etag_value", + index_update_method=index.Index.IndexUpdateMethod.BATCH_UPDATE, ) response = client.get_index(request) @@ -960,6 +961,7 @@ def test_get_index(request_type, transport: str = "grpc"): assert response.description == "description_value" assert response.metadata_schema_uri == "metadata_schema_uri_value" assert response.etag == "etag_value" + assert response.index_update_method == index.Index.IndexUpdateMethod.BATCH_UPDATE def test_get_index_empty_call(): @@ -1001,6 +1003,7 @@ async def test_get_index_async( description="description_value", metadata_schema_uri="metadata_schema_uri_value", etag="etag_value", + index_update_method=index.Index.IndexUpdateMethod.BATCH_UPDATE, ) ) response = await client.get_index(request) @@ -1017,6 +1020,7 @@ async def test_get_index_async( assert response.description == "description_value" assert response.metadata_schema_uri == "metadata_schema_uri_value" assert response.etag == "etag_value" + assert response.index_update_method == index.Index.IndexUpdateMethod.BATCH_UPDATE @pytest.mark.asyncio @@ -2045,6 +2049,314 @@ async def test_delete_index_flattened_error_async(): ) +@pytest.mark.parametrize( + "request_type", + [ + index_service.UpsertDatapointsRequest, + dict, + ], +) +def test_upsert_datapoints(request_type, transport: str = "grpc"): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = index_service.UpsertDatapointsResponse() + response = client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.UpsertDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.UpsertDatapointsResponse) + + +def test_upsert_datapoints_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + client.upsert_datapoints() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.UpsertDatapointsRequest() + + +@pytest.mark.asyncio +async def test_upsert_datapoints_async( + transport: str = "grpc_asyncio", request_type=index_service.UpsertDatapointsRequest +): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.UpsertDatapointsResponse() + ) + response = await client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.UpsertDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.UpsertDatapointsResponse) + + +@pytest.mark.asyncio +async def test_upsert_datapoints_async_from_dict(): + await test_upsert_datapoints_async(request_type=dict) + + +def test_upsert_datapoints_field_headers(): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.UpsertDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + call.return_value = index_service.UpsertDatapointsResponse() + client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_upsert_datapoints_field_headers_async(): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.UpsertDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.UpsertDatapointsResponse() + ) + await client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + +@pytest.mark.parametrize( + "request_type", + [ + index_service.RemoveDatapointsRequest, + dict, + ], +) +def test_remove_datapoints(request_type, transport: str = "grpc"): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = index_service.RemoveDatapointsResponse() + response = client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.RemoveDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.RemoveDatapointsResponse) + + +def test_remove_datapoints_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + client.remove_datapoints() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.RemoveDatapointsRequest() + + +@pytest.mark.asyncio +async def test_remove_datapoints_async( + transport: str = "grpc_asyncio", request_type=index_service.RemoveDatapointsRequest +): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.RemoveDatapointsResponse() + ) + response = await client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.RemoveDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.RemoveDatapointsResponse) + + +@pytest.mark.asyncio +async def test_remove_datapoints_async_from_dict(): + await test_remove_datapoints_async(request_type=dict) + + +def test_remove_datapoints_field_headers(): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.RemoveDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + call.return_value = index_service.RemoveDatapointsResponse() + client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_remove_datapoints_field_headers_async(): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.RemoveDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.RemoveDatapointsResponse() + ) + await client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.IndexServiceGrpcTransport( @@ -2187,6 +2499,8 @@ def test_index_service_base_transport(): "list_indexes", "update_index", "delete_index", + "upsert_datapoints", + "remove_datapoints", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -2787,7 +3101,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2926,7 +3240,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3210,7 +3524,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3355,7 +3669,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3500,7 +3814,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_job_service.py b/tests/unit/gapic/aiplatform_v1/test_job_service.py index c4455f8457..d424daf151 100644 --- a/tests/unit/gapic/aiplatform_v1/test_job_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_job_service.py @@ -10089,7 +10089,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10228,7 +10228,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10512,7 +10512,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10657,7 +10657,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10802,7 +10802,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_metadata_service.py b/tests/unit/gapic/aiplatform_v1/test_metadata_service.py index 867937994a..ce02d70764 100644 --- a/tests/unit/gapic/aiplatform_v1/test_metadata_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_metadata_service.py @@ -10294,7 +10294,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10433,7 +10433,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10717,7 +10717,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10862,7 +10862,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -11007,7 +11007,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1/test_migration_service.py index fde972daff..ba01e7f9c9 100644 --- a/tests/unit/gapic/aiplatform_v1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_migration_service.py @@ -2030,22 +2030,19 @@ def test_parse_dataset_path(): def test_dataset_path(): project = "squid" - location = "clam" - dataset = "whelk" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + dataset = "clam" + expected = "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "octopus", - "location": "oyster", - "dataset": "nudibranch", + "project": "whelk", + "dataset": "octopus", } path = MigrationServiceClient.dataset_path(**expected) @@ -2055,19 +2052,22 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "cuttlefish" - dataset = "mussel" - expected = "projects/{project}/datasets/{dataset}".format( + project = "oyster" + location = "nudibranch" + dataset = "cuttlefish" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "winkle", + "project": "mussel", + "location": "winkle", "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) @@ -2320,7 +2320,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2459,7 +2459,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2743,7 +2743,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2888,7 +2888,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3033,7 +3033,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_model_service.py b/tests/unit/gapic/aiplatform_v1/test_model_service.py index bf5cd4a6e1..ae0a44a4b2 100644 --- a/tests/unit/gapic/aiplatform_v1/test_model_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_model_service.py @@ -6229,7 +6229,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -6368,7 +6368,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -6652,7 +6652,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -6797,7 +6797,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -6942,7 +6942,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py b/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py index d7b35c0244..ff9f34ce79 100644 --- a/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_pipeline_service.py @@ -4605,7 +4605,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4744,7 +4744,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5028,7 +5028,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5173,7 +5173,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5318,7 +5318,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_prediction_service.py b/tests/unit/gapic/aiplatform_v1/test_prediction_service.py index e3cff56682..81df0b7e4f 100644 --- a/tests/unit/gapic/aiplatform_v1/test_prediction_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_prediction_service.py @@ -2045,7 +2045,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2184,7 +2184,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2468,7 +2468,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2613,7 +2613,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2758,7 +2758,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py b/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py index 5457bdcc6d..d48eb114ec 100644 --- a/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_specialist_pool_service.py @@ -2906,7 +2906,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3045,7 +3045,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3329,7 +3329,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3474,7 +3474,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3619,7 +3619,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py b/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py index 4643644bd4..7dbc333e9c 100644 --- a/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_tensorboard_service.py @@ -9919,7 +9919,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10058,7 +10058,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10342,7 +10342,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10487,7 +10487,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10632,7 +10632,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1/test_vizier_service.py b/tests/unit/gapic/aiplatform_v1/test_vizier_service.py index fe13602fe2..408af0431d 100644 --- a/tests/unit/gapic/aiplatform_v1/test_vizier_service.py +++ b/tests/unit/gapic/aiplatform_v1/test_vizier_service.py @@ -5057,7 +5057,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5196,7 +5196,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5480,7 +5480,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5625,7 +5625,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5770,7 +5770,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py index 2d1795244f..79e174ef0e 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_dataset_service.py @@ -4989,7 +4989,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5128,7 +5128,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5412,7 +5412,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5557,7 +5557,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5702,7 +5702,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = DatasetServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_deployment_resource_pool_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_deployment_resource_pool_service.py index 3157157632..1a866df55e 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_deployment_resource_pool_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_deployment_resource_pool_service.py @@ -3245,7 +3245,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = DeploymentResourcePoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3384,7 +3384,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = DeploymentResourcePoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3668,7 +3668,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = DeploymentResourcePoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3813,7 +3813,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = DeploymentResourcePoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3958,7 +3958,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = DeploymentResourcePoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py index e2784df903..2b929d3cc0 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_endpoint_service.py @@ -3503,7 +3503,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3642,7 +3642,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3926,7 +3926,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4071,7 +4071,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4216,7 +4216,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = EndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py index 733d3a5ba9..5f0afe70f9 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_online_serving_service.py @@ -48,12 +48,14 @@ ) from google.cloud.aiplatform_v1beta1.types import feature_selector from google.cloud.aiplatform_v1beta1.types import featurestore_online_service +from google.cloud.aiplatform_v1beta1.types import types from google.cloud.location import locations_pb2 from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import timestamp_pb2 # type: ignore import google.auth @@ -1235,6 +1237,281 @@ async def test_streaming_read_feature_values_flattened_error_async(): ) +@pytest.mark.parametrize( + "request_type", + [ + featurestore_online_service.WriteFeatureValuesRequest, + dict, + ], +) +def test_write_feature_values(request_type, transport: str = "grpc"): + client = FeaturestoreOnlineServingServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_feature_values), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = featurestore_online_service.WriteFeatureValuesResponse() + response = client.write_feature_values(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == featurestore_online_service.WriteFeatureValuesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, featurestore_online_service.WriteFeatureValuesResponse) + + +def test_write_feature_values_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = FeaturestoreOnlineServingServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_feature_values), "__call__" + ) as call: + client.write_feature_values() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == featurestore_online_service.WriteFeatureValuesRequest() + + +@pytest.mark.asyncio +async def test_write_feature_values_async( + transport: str = "grpc_asyncio", + request_type=featurestore_online_service.WriteFeatureValuesRequest, +): + client = FeaturestoreOnlineServingServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_feature_values), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + featurestore_online_service.WriteFeatureValuesResponse() + ) + response = await client.write_feature_values(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == featurestore_online_service.WriteFeatureValuesRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, featurestore_online_service.WriteFeatureValuesResponse) + + +@pytest.mark.asyncio +async def test_write_feature_values_async_from_dict(): + await test_write_feature_values_async(request_type=dict) + + +def test_write_feature_values_field_headers(): + client = FeaturestoreOnlineServingServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = featurestore_online_service.WriteFeatureValuesRequest() + + request.entity_type = "entity_type_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_feature_values), "__call__" + ) as call: + call.return_value = featurestore_online_service.WriteFeatureValuesResponse() + client.write_feature_values(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "entity_type=entity_type_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_write_feature_values_field_headers_async(): + client = FeaturestoreOnlineServingServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = featurestore_online_service.WriteFeatureValuesRequest() + + request.entity_type = "entity_type_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_feature_values), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + featurestore_online_service.WriteFeatureValuesResponse() + ) + await client.write_feature_values(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "entity_type=entity_type_value", + ) in kw["metadata"] + + +def test_write_feature_values_flattened(): + client = FeaturestoreOnlineServingServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_feature_values), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = featurestore_online_service.WriteFeatureValuesResponse() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.write_feature_values( + entity_type="entity_type_value", + payloads=[ + featurestore_online_service.WriteFeatureValuesPayload( + entity_id="entity_id_value" + ) + ], + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].entity_type + mock_val = "entity_type_value" + assert arg == mock_val + arg = args[0].payloads + mock_val = [ + featurestore_online_service.WriteFeatureValuesPayload( + entity_id="entity_id_value" + ) + ] + assert arg == mock_val + + +def test_write_feature_values_flattened_error(): + client = FeaturestoreOnlineServingServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.write_feature_values( + featurestore_online_service.WriteFeatureValuesRequest(), + entity_type="entity_type_value", + payloads=[ + featurestore_online_service.WriteFeatureValuesPayload( + entity_id="entity_id_value" + ) + ], + ) + + +@pytest.mark.asyncio +async def test_write_feature_values_flattened_async(): + client = FeaturestoreOnlineServingServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.write_feature_values), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = featurestore_online_service.WriteFeatureValuesResponse() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + featurestore_online_service.WriteFeatureValuesResponse() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.write_feature_values( + entity_type="entity_type_value", + payloads=[ + featurestore_online_service.WriteFeatureValuesPayload( + entity_id="entity_id_value" + ) + ], + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].entity_type + mock_val = "entity_type_value" + assert arg == mock_val + arg = args[0].payloads + mock_val = [ + featurestore_online_service.WriteFeatureValuesPayload( + entity_id="entity_id_value" + ) + ] + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_write_feature_values_flattened_error_async(): + client = FeaturestoreOnlineServingServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.write_feature_values( + featurestore_online_service.WriteFeatureValuesRequest(), + entity_type="entity_type_value", + payloads=[ + featurestore_online_service.WriteFeatureValuesPayload( + entity_id="entity_id_value" + ) + ], + ) + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.FeaturestoreOnlineServingServiceGrpcTransport( @@ -1376,6 +1653,7 @@ def test_featurestore_online_serving_service_base_transport(): methods = ( "read_feature_values", "streaming_read_feature_values", + "write_feature_values", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -1948,7 +2226,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2087,7 +2365,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2371,7 +2649,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2516,7 +2794,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2661,7 +2939,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = FeaturestoreOnlineServingServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py index 546935139f..0d0498791d 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_featurestore_service.py @@ -7251,7 +7251,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7390,7 +7390,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7674,7 +7674,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7819,7 +7819,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7964,7 +7964,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = FeaturestoreServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py index cf04b00504..801ac54a05 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_index_endpoint_service.py @@ -3687,7 +3687,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3826,7 +3826,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4110,7 +4110,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4255,7 +4255,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4400,7 +4400,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = IndexEndpointServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py index 04d8a2a1ac..10b669ae69 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_index_service.py @@ -947,6 +947,7 @@ def test_get_index(request_type, transport: str = "grpc"): description="description_value", metadata_schema_uri="metadata_schema_uri_value", etag="etag_value", + index_update_method=index.Index.IndexUpdateMethod.BATCH_UPDATE, ) response = client.get_index(request) @@ -962,6 +963,7 @@ def test_get_index(request_type, transport: str = "grpc"): assert response.description == "description_value" assert response.metadata_schema_uri == "metadata_schema_uri_value" assert response.etag == "etag_value" + assert response.index_update_method == index.Index.IndexUpdateMethod.BATCH_UPDATE def test_get_index_empty_call(): @@ -1003,6 +1005,7 @@ async def test_get_index_async( description="description_value", metadata_schema_uri="metadata_schema_uri_value", etag="etag_value", + index_update_method=index.Index.IndexUpdateMethod.BATCH_UPDATE, ) ) response = await client.get_index(request) @@ -1019,6 +1022,7 @@ async def test_get_index_async( assert response.description == "description_value" assert response.metadata_schema_uri == "metadata_schema_uri_value" assert response.etag == "etag_value" + assert response.index_update_method == index.Index.IndexUpdateMethod.BATCH_UPDATE @pytest.mark.asyncio @@ -2047,6 +2051,314 @@ async def test_delete_index_flattened_error_async(): ) +@pytest.mark.parametrize( + "request_type", + [ + index_service.UpsertDatapointsRequest, + dict, + ], +) +def test_upsert_datapoints(request_type, transport: str = "grpc"): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = index_service.UpsertDatapointsResponse() + response = client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.UpsertDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.UpsertDatapointsResponse) + + +def test_upsert_datapoints_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + client.upsert_datapoints() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.UpsertDatapointsRequest() + + +@pytest.mark.asyncio +async def test_upsert_datapoints_async( + transport: str = "grpc_asyncio", request_type=index_service.UpsertDatapointsRequest +): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.UpsertDatapointsResponse() + ) + response = await client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.UpsertDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.UpsertDatapointsResponse) + + +@pytest.mark.asyncio +async def test_upsert_datapoints_async_from_dict(): + await test_upsert_datapoints_async(request_type=dict) + + +def test_upsert_datapoints_field_headers(): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.UpsertDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + call.return_value = index_service.UpsertDatapointsResponse() + client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_upsert_datapoints_field_headers_async(): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.UpsertDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.upsert_datapoints), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.UpsertDatapointsResponse() + ) + await client.upsert_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + +@pytest.mark.parametrize( + "request_type", + [ + index_service.RemoveDatapointsRequest, + dict, + ], +) +def test_remove_datapoints(request_type, transport: str = "grpc"): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = index_service.RemoveDatapointsResponse() + response = client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.RemoveDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.RemoveDatapointsResponse) + + +def test_remove_datapoints_empty_call(): + # This test is a coverage failsafe to make sure that totally empty calls, + # i.e. request == None and no flattened fields passed, work. + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + client.remove_datapoints() + call.assert_called() + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.RemoveDatapointsRequest() + + +@pytest.mark.asyncio +async def test_remove_datapoints_async( + transport: str = "grpc_asyncio", request_type=index_service.RemoveDatapointsRequest +): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, + ) + + # Everything is optional in proto3 as far as the runtime is concerned, + # and we are mocking out the actual API, so just send an empty request. + request = request_type() + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + # Designate an appropriate return value for the call. + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.RemoveDatapointsResponse() + ) + response = await client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == index_service.RemoveDatapointsRequest() + + # Establish that the response is the type that we expect. + assert isinstance(response, index_service.RemoveDatapointsResponse) + + +@pytest.mark.asyncio +async def test_remove_datapoints_async_from_dict(): + await test_remove_datapoints_async(request_type=dict) + + +def test_remove_datapoints_field_headers(): + client = IndexServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.RemoveDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + call.return_value = index_service.RemoveDatapointsResponse() + client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + +@pytest.mark.asyncio +async def test_remove_datapoints_field_headers_async(): + client = IndexServiceAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as + # a field header. Set these to a non-empty value. + request = index_service.RemoveDatapointsRequest() + + request.index = "index_value" + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object( + type(client.transport.remove_datapoints), "__call__" + ) as call: + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + index_service.RemoveDatapointsResponse() + ) + await client.remove_datapoints(request) + + # Establish that the underlying gRPC stub method was called. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + assert args[0] == request + + # Establish that the field header was sent. + _, _, kw = call.mock_calls[0] + assert ( + "x-goog-request-params", + "index=index_value", + ) in kw["metadata"] + + def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.IndexServiceGrpcTransport( @@ -2189,6 +2501,8 @@ def test_index_service_base_transport(): "list_indexes", "update_index", "delete_index", + "upsert_datapoints", + "remove_datapoints", "set_iam_policy", "get_iam_policy", "test_iam_permissions", @@ -2789,7 +3103,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2928,7 +3242,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3212,7 +3526,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3357,7 +3671,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3502,7 +3816,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = IndexServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py index acaf1fdf68..ddafa4539a 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_job_service.py @@ -10099,7 +10099,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10238,7 +10238,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10522,7 +10522,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10667,7 +10667,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10812,7 +10812,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = JobServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py index 78c4062196..d62d463690 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_metadata_service.py @@ -10296,7 +10296,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10435,7 +10435,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10719,7 +10719,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10864,7 +10864,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -11009,7 +11009,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = MetadataServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py index 6e2a310b89..9f659c8a92 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_migration_service.py @@ -2032,22 +2032,19 @@ def test_parse_dataset_path(): def test_dataset_path(): project = "squid" - location = "clam" - dataset = "whelk" - expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( + dataset = "clam" + expected = "projects/{project}/datasets/{dataset}".format( project=project, - location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, location, dataset) + actual = MigrationServiceClient.dataset_path(project, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "octopus", - "location": "oyster", - "dataset": "nudibranch", + "project": "whelk", + "dataset": "octopus", } path = MigrationServiceClient.dataset_path(**expected) @@ -2057,19 +2054,22 @@ def test_parse_dataset_path(): def test_dataset_path(): - project = "cuttlefish" - dataset = "mussel" - expected = "projects/{project}/datasets/{dataset}".format( + project = "oyster" + location = "nudibranch" + dataset = "cuttlefish" + expected = "projects/{project}/locations/{location}/datasets/{dataset}".format( project=project, + location=location, dataset=dataset, ) - actual = MigrationServiceClient.dataset_path(project, dataset) + actual = MigrationServiceClient.dataset_path(project, location, dataset) assert expected == actual def test_parse_dataset_path(): expected = { - "project": "winkle", + "project": "mussel", + "location": "winkle", "dataset": "nautilus", } path = MigrationServiceClient.dataset_path(**expected) @@ -2322,7 +2322,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2461,7 +2461,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2745,7 +2745,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2890,7 +2890,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3035,7 +3035,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = MigrationServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py index a9ea5f0186..e223850fce 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_model_service.py @@ -6459,7 +6459,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -6598,7 +6598,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -6882,7 +6882,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7027,7 +7027,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -7172,7 +7172,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = ModelServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py index f03700c697..77303c9f9c 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_pipeline_service.py @@ -4609,7 +4609,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -4748,7 +4748,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5032,7 +5032,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5177,7 +5177,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5322,7 +5322,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = PipelineServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py index a4661b0ca4..bfaa4af614 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_prediction_service.py @@ -2046,7 +2046,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2185,7 +2185,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2469,7 +2469,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2614,7 +2614,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -2759,7 +2759,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = PredictionServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py index b63fd11c09..ba68c0d504 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_specialist_pool_service.py @@ -2906,7 +2906,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3045,7 +3045,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3329,7 +3329,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3474,7 +3474,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -3619,7 +3619,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = SpecialistPoolServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py index d672014255..e900aee1a2 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_tensorboard_service.py @@ -9904,7 +9904,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10043,7 +10043,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10327,7 +10327,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10472,7 +10472,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -10617,7 +10617,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = TensorboardServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, diff --git a/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py b/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py index fbd70299ab..ce0d37e293 100644 --- a/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py +++ b/tests/unit/gapic/aiplatform_v1beta1/test_vizier_service.py @@ -5059,7 +5059,7 @@ def test_delete_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_delete_operation(transport: str = "grpc"): +async def test_delete_operation_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5198,7 +5198,7 @@ def test_cancel_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_cancel_operation(transport: str = "grpc"): +async def test_cancel_operation_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5482,7 +5482,7 @@ def test_get_operation(transport: str = "grpc"): @pytest.mark.asyncio -async def test_get_operation(transport: str = "grpc"): +async def test_get_operation_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5627,7 +5627,7 @@ def test_list_operations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_operations(transport: str = "grpc"): +async def test_list_operations_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, @@ -5772,7 +5772,7 @@ def test_list_locations(transport: str = "grpc"): @pytest.mark.asyncio -async def test_list_locations(transport: str = "grpc"): +async def test_list_locations_async(transport: str = "grpc"): client = VizierServiceAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport,